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

Method create_isotropic

tools/Wires/Parameters/ParameterManager.cpp:195–238  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

193}
194
195ParameterManager::Ptr ParameterManager::create_isotropic(
196 WireNetwork::Ptr wire_network,
197 Float default_thickness,
198 ParameterManager::TargetType thickness_type) {
199 Ptr manager = create_empty_manager(wire_network, default_thickness);
200 if (!wire_network->has_attribute("vertex_cubic_symmetry_orbit")) {
201 wire_network->add_attribute("vertex_cubic_symmetry_orbit");
202 }
203 if (!wire_network->has_attribute("edge_cubic_symmetry_orbit")) {
204 wire_network->add_attribute("edge_cubic_symmetry_orbit");
205 }
206
207 std::list<VectorI> vertex_orbits = group_by_label(
208 wire_network->get_attribute("vertex_cubic_symmetry_orbit"));
209 std::list<VectorI> edge_orbits = group_by_label(
210 wire_network->get_attribute("edge_cubic_symmetry_orbit"));
211
212 manager->set_thickness_type(thickness_type);
213 if (thickness_type == ParameterCommon::VERTEX) {
214 for (const auto& roi : vertex_orbits) {
215 manager->add_thickness_parameter(roi, "", default_thickness);
216 }
217 } else {
218 for (const auto& roi : edge_orbits) {
219 manager->add_thickness_parameter(roi, "", default_thickness);
220 }
221 }
222
223 IsotropicDofExtractor extractor(wire_network);
224 const MatrixFr& vertices = wire_network->get_vertices();
225 manager->set_offset_type(ParameterCommon::VERTEX);
226 for (const auto& roi : vertex_orbits) {
227 const size_t seed_idx = roi.minCoeff();
228 VectorF seed = vertices.row(seed_idx);
229
230 const auto dofs = extractor.extract_dofs(seed);
231 for (const auto& dof_dir : dofs) {
232 manager->add_isotropic_offset_parameter(
233 roi, "", 0.0, dof_dir);
234 }
235 }
236 manager->m_dof_type = ISOTROPIC;
237 return manager;
238}
239
240ParameterManager::Ptr ParameterManager::create_empty_manager(
241 WireNetwork::Ptr wire_network, Float default_thickness) {

Callers

nothing calls this directly

Calls 10

group_by_labelFunction · 0.85
set_offset_typeMethod · 0.80
extract_dofsMethod · 0.80
has_attributeMethod · 0.45
add_attributeMethod · 0.45
get_attributeMethod · 0.45
set_thickness_typeMethod · 0.45
get_verticesMethod · 0.45

Tested by

no test coverage detected