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

Method normalize_unit_wire

tools/Wires/Tiler/TilerEngine.cpp:103–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103void TilerEngine::normalize_unit_wire(const VectorF& cell_size) {
104 if (cell_size.minCoeff() <= 1e-30) {
105 const size_t dim = cell_size.size();
106 if (dim == 3)
107 throw RuntimeError("It seems the 3D wires are flat.");
108 else if (dim == 2)
109 throw RuntimeError("It seems the 2D wires are degenerated/linear.");
110 else
111 throw NotImplementedError("Unsupported dimension!");
112 }
113
114 VectorF factors = cell_size.cwiseQuotient(
115 m_unit_wire_network->get_bbox_max() - m_unit_wire_network->get_bbox_min());
116 m_unit_wire_network->center_at_origin();
117 m_unit_wire_network->scale(factors);
118}
119
120void TilerEngine::update_attributes(WireNetwork& wire_network, size_t num_repetitions) {
121 std::vector<std::string> attr_names = m_unit_wire_network->get_attribute_names();

Callers

nothing calls this directly

Calls 7

RuntimeErrorClass · 0.85
NotImplementedErrorClass · 0.85
get_bbox_maxMethod · 0.80
get_bbox_minMethod · 0.80
sizeMethod · 0.45
center_at_originMethod · 0.45
scaleMethod · 0.45

Tested by

no test coverage detected