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

Method get_2D_tiling_operators

tools/Wires/Tiler/MeshTilerHelper.cpp:12–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10using namespace PyMesh;
11
12TilerEngine::FuncList MeshTilerHelper::get_2D_tiling_operators(Mesh::Ptr mesh) {
13 const size_t num_cells = mesh->get_num_faces();
14 const size_t num_vertex_per_cell = mesh->get_vertex_per_face();
15 if (num_vertex_per_cell != 4) {
16 throw NotImplementedError("Only quad guide mesh is supported in 2D");
17 }
18
19 TilerEngine::FuncList operators;
20 for (size_t i=0; i<num_cells; i++) {
21 const VectorI face = mesh->get_face(i);
22 MatrixFr corners(num_vertex_per_cell, 2);
23 for (size_t j=0; j<num_vertex_per_cell; j++) {
24 corners.row(j) = mesh->get_vertex(face[j]).transpose();
25 }
26
27 operators.push_back(
28 [=](const MatrixFr& vertices) {
29 BilinearInterpolation interpolator(corners);
30 return interpolator.interpolate_batch(vertices);
31 });
32 }
33 return operators;
34}
35
36TilerEngine::FuncList MeshTilerHelper::get_3D_tiling_operators(Mesh::Ptr mesh) {
37 const size_t num_cells = mesh->get_num_voxels();

Callers

nothing calls this directly

Calls 6

NotImplementedErrorClass · 0.85
get_faceMethod · 0.80
get_num_facesMethod · 0.45
get_vertex_per_faceMethod · 0.45
get_vertexMethod · 0.45
interpolate_batchMethod · 0.45

Tested by

no test coverage detected