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

Method get_3D_tiling_operators

tools/Wires/Tiler/MeshTilerHelper.cpp:36–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36TilerEngine::FuncList MeshTilerHelper::get_3D_tiling_operators(Mesh::Ptr mesh) {
37 const size_t num_cells = mesh->get_num_voxels();
38 const size_t num_vertex_per_cell = mesh->get_vertex_per_voxel();
39 if (num_vertex_per_cell != 8) {
40 throw NotImplementedError("Only hex guide mesh is supported in 3D");
41 }
42
43 TilerEngine::FuncList operators;
44 for (size_t i=0; i<num_cells; i++) {
45 const VectorI voxel = mesh->get_voxel(i);
46 MatrixFr corners(num_vertex_per_cell, 3);
47 for (size_t j=0; j<num_vertex_per_cell; j++) {
48 corners.row(j) = mesh->get_vertex(voxel[j]).transpose();
49 }
50
51 operators.push_back(
52 [=](const MatrixFr& vertices) {
53 TrilinearInterpolation interpolator(corners);
54 return interpolator.interpolate_batch(vertices);
55 });
56 }
57 return operators;
58}
59
60std::vector<ParameterCommon::Variables> MeshTilerHelper::extract_face_attributes(
61 Mesh::Ptr mesh) {

Callers

nothing calls this directly

Calls 6

NotImplementedErrorClass · 0.85
get_voxelMethod · 0.80
get_num_voxelsMethod · 0.45
get_vertex_per_voxelMethod · 0.45
get_vertexMethod · 0.45
interpolate_batchMethod · 0.45

Tested by

no test coverage detected