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

Method extract_volume_boundary_raw

tools/MeshUtils/Boundary.cpp:42–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42Boundary::Ptr Boundary::extract_volume_boundary_raw(
43 MatrixFr& vertices, MatrixIr& voxels) {
44 VectorF flattened_vertices = Eigen::Map<VectorF>(vertices.data(),
45 vertices.rows() * vertices.cols());
46 VectorI faces = VectorI::Zero(0);
47 VectorI flattened_voxels = Eigen::Map<VectorI>(voxels.data(),
48 voxels.rows() * voxels.cols());
49
50 size_t vertex_per_voxel = voxels.cols();
51 size_t vertex_per_face=0;
52 if (vertex_per_voxel == 4) vertex_per_face = 3;
53 else if (vertex_per_voxel == 8) vertex_per_face = 4;
54 else {
55 throw RuntimeError("Unknown voxel type.");
56 }
57
58 MeshFactory factory;
59 Mesh::Ptr mesh = factory.load_data(flattened_vertices, faces,
60 flattened_voxels, vertices.cols(), vertex_per_face,
61 vertex_per_voxel).create();
62
63 return extract_volume_boundary(*mesh);
64}

Callers

nothing calls this directly

Calls 3

RuntimeErrorClass · 0.85
createMethod · 0.45
load_dataMethod · 0.45

Tested by

no test coverage detected