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

Method extract_voxel_attributes

tools/Wires/Tiler/MeshTilerHelper.cpp:79–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79std::vector<ParameterCommon::Variables> MeshTilerHelper::extract_voxel_attributes(
80 Mesh::Ptr mesh) {
81 const size_t num_voxels = mesh->get_num_voxels();
82 std::vector<ParameterCommon::Variables> vars_array;
83 const auto& attr_names = mesh->get_attribute_names();
84
85 for (size_t i=0; i<num_voxels; i++) {
86 ParameterCommon::Variables vars;
87 for (const auto& name : attr_names) {
88 const MatrixFr& attr = mesh->get_attribute(name);
89 if (attr.rows() != num_voxels) continue;
90 if (attr.cols() != 1) continue;
91 vars[name] = attr(i, 0);
92 }
93 vars_array.push_back(vars);
94 }
95 return vars_array;
96}
97
98std::vector<ParameterCommon::Variables> MeshTilerHelper::extract_attributes(
99 Mesh::Ptr mesh) {

Callers

nothing calls this directly

Calls 3

get_num_voxelsMethod · 0.45
get_attribute_namesMethod · 0.45
get_attributeMethod · 0.45

Tested by

no test coverage detected