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

Method create

tools/MeshUtils/SubMesh.cpp:13–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11using namespace PyMesh;
12
13SubMesh::Ptr SubMesh::create(Mesh::Ptr mesh) {
14 const size_t dim = mesh->get_dim();
15 const size_t num_vertices = mesh->get_num_vertices();
16 const size_t num_faces = mesh->get_num_faces();
17 const size_t vertex_per_face = mesh->get_vertex_per_face();
18 const VectorF& vertices = mesh->get_vertices();
19 const VectorI& faces = mesh->get_faces();
20
21 Eigen::Map<const MatrixFr> mat_vertices(vertices.data(), num_vertices, dim);
22 Eigen::Map<const MatrixIr> mat_faces(faces.data(), num_faces, vertex_per_face);
23
24 return std::make_shared<SubMesh>(mat_vertices, mat_faces);
25}
26
27SubMesh::Ptr SubMesh::create_raw(const MatrixFr& vertices,
28 const MatrixIr& faces) {

Callers 5

cut_with_face_labelsMethod · 0.45
cut_along_edgesMethod · 0.45

Calls 6

get_dimMethod · 0.45
get_num_verticesMethod · 0.45
get_num_facesMethod · 0.45
get_vertex_per_faceMethod · 0.45
get_verticesMethod · 0.45
get_facesMethod · 0.45

Tested by

no test coverage detected