MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / create

Method create

tools/IGL/HarmonicSolver.cpp:11–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9using namespace PyMesh;
10
11HarmonicSolver::Ptr HarmonicSolver::create(const Mesh::Ptr mesh) {
12 const bool is_volume_mesh = (mesh->get_dim() == 3) && (mesh->get_num_voxels() > 0);
13 HarmonicSolver::Ptr solver;
14 const MatrixFr vertices = MatrixUtils::reshape<MatrixFr>(
15 mesh->get_vertices(),
16 mesh->get_num_vertices(),
17 mesh->get_dim());
18
19 if (is_volume_mesh) {
20 const MatrixIr voxels = MatrixUtils::reshape<MatrixIr>(
21 mesh->get_voxels(),
22 mesh->get_num_voxels(),
23 mesh->get_vertex_per_voxel());
24 solver = std::make_shared<HarmonicSolver>(vertices, voxels);
25 } else {
26 const MatrixIr faces = MatrixUtils::reshape<MatrixIr>(
27 mesh->get_faces(),
28 mesh->get_num_faces(),
29 mesh->get_vertex_per_face());
30 solver = std::make_shared<HarmonicSolver>(vertices, faces);
31 }
32 solver->pre_process(); // Check dimensions
33 return solver;
34}
35
36HarmonicSolver::Ptr HarmonicSolver::create_raw(
37 const MatrixFr& nodes, const MatrixIr& elements) {

Callers

nothing calls this directly

Calls 10

pre_processMethod · 0.80
get_dimMethod · 0.45
get_num_voxelsMethod · 0.45
get_verticesMethod · 0.45
get_num_verticesMethod · 0.45
get_voxelsMethod · 0.45
get_vertex_per_voxelMethod · 0.45
get_facesMethod · 0.45
get_num_facesMethod · 0.45
get_vertex_per_faceMethod · 0.45

Tested by

no test coverage detected