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

Method compute_from_mesh

src/Attributes/VertexValanceAttribute.cpp:13–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11using namespace PyMesh;
12
13void VertexValanceAttribute::compute_from_mesh(Mesh& mesh) {
14 const size_t num_voxels = mesh.get_num_voxels();
15 const size_t num_vertex_per_voxel = mesh.get_vertex_per_voxel();
16
17 if (num_voxels == 0) {
18 compute_from_surface_mesh(mesh);
19 } else if (num_vertex_per_voxel == 4) {
20 compute_from_tet_mesh(mesh);
21 } else if (num_vertex_per_voxel == 8) {
22 compute_from_hex_mesh(mesh);
23 } else {
24 std::stringstream err_msg;
25 err_msg << "Vertex valance computation is not supported on mesh with "
26 << num_vertex_per_voxel << " vertices per voxel";
27 throw NotImplementedError(err_msg.str());
28 }
29}
30
31void VertexValanceAttribute::compute_from_surface_mesh(Mesh& mesh) {
32 const size_t num_vertices = mesh.get_num_vertices();

Callers

nothing calls this directly

Calls 4

NotImplementedErrorClass · 0.85
get_num_voxelsMethod · 0.45
get_vertex_per_voxelMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected