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

Method evaluate_offset_parameters

tools/Wires/Tiler/MeshTiler.cpp:113–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113void MeshTiler::evaluate_offset_parameters(WireNetwork& wire_network,
114 const MeshTiler::FuncList& funcs) {
115 const size_t dim = wire_network.get_dim();
116 const size_t num_vertices = wire_network.get_num_vertices();
117 const size_t num_unit_vertices = m_unit_wire_network->get_num_vertices();
118
119 wire_network.add_attribute("vertex_offset", true);
120 MatrixFr attr_value(num_vertices, dim);
121
122 auto vars_array = extract_attributes(m_mesh);
123 const MatrixFr& ori_vertices = m_unit_wire_network->get_vertices();
124 size_t count=0;
125 auto vars_itr = vars_array.begin();
126 for (auto f : funcs) {
127 assert(vars_itr != vars_array.end());
128 MatrixFr local_offseted_vertices = ori_vertices +
129 m_params->evaluate_offset(*vars_itr);
130 attr_value.block(count * num_unit_vertices, 0,
131 num_unit_vertices, dim) = f(local_offseted_vertices);
132 count++;
133 vars_itr++;
134 }
135
136 attr_value = attr_value - wire_network.get_vertices();
137 wire_network.set_attribute("vertex_offset", attr_value);
138}
139

Callers

nothing calls this directly

Calls 8

evaluate_offsetMethod · 0.80
get_dimMethod · 0.45
get_num_verticesMethod · 0.45
add_attributeMethod · 0.45
get_verticesMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
set_attributeMethod · 0.45

Tested by

no test coverage detected