| 11 | using namespace PyMesh; |
| 12 | |
| 13 | void 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 | |
| 31 | void VertexValanceAttribute::compute_from_surface_mesh(Mesh& mesh) { |
| 32 | const size_t num_vertices = mesh.get_num_vertices(); |
nothing calls this directly
no test coverage detected