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

Method evaluate_offset_parameters

tools/Wires/Tiler/AABBTiler.cpp:143–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143void AABBTiler::evaluate_offset_parameters(WireNetwork& wire_network,
144 const AABBTiler::FuncList& funcs) {
145 const size_t dim = wire_network.get_dim();
146 const size_t num_vertices = wire_network.get_num_vertices();
147 const size_t num_unit_vertices = m_unit_wire_network->get_num_vertices();
148
149 wire_network.add_attribute("vertex_offset", true);
150 MatrixFr attr_value(num_vertices, dim);
151
152 ParameterCommon::Variables vars;
153 const MatrixFr& ori_vertices = m_unit_wire_network->get_vertices();
154 size_t count=0;
155 for (auto f : funcs) {
156 MatrixFr local_offseted_vertices = ori_vertices + m_params->evaluate_offset(vars);
157 attr_value.block(count * num_unit_vertices, 0,
158 num_unit_vertices, dim) = f(local_offseted_vertices);
159 count++;
160 }
161
162 attr_value = attr_value - wire_network.get_vertices();
163 wire_network.set_attribute("vertex_offset", attr_value);
164}
165

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected