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

Method extract_face_attributes

tools/Wires/Tiler/MeshTilerHelper.cpp:60–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60std::vector<ParameterCommon::Variables> MeshTilerHelper::extract_face_attributes(
61 Mesh::Ptr mesh) {
62 const size_t num_faces = mesh->get_num_faces();
63 std::vector<ParameterCommon::Variables> vars_array;
64 const auto& attr_names = mesh->get_attribute_names();
65
66 for (size_t i=0; i<num_faces; i++) {
67 ParameterCommon::Variables vars;
68 for (const auto& name : attr_names) {
69 const MatrixFr& attr = mesh->get_attribute(name);
70 if (attr.rows() != num_faces) continue;
71 if (attr.cols() != 1) continue;
72 vars[name] = attr(i, 0);
73 }
74 vars_array.push_back(vars);
75 }
76 return vars_array;
77}
78
79std::vector<ParameterCommon::Variables> MeshTilerHelper::extract_voxel_attributes(
80 Mesh::Ptr mesh) {

Callers

nothing calls this directly

Calls 3

get_num_facesMethod · 0.45
get_attribute_namesMethod · 0.45
get_attributeMethod · 0.45

Tested by

no test coverage detected