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

Method scale_fit

tools/Wires/WireNetwork/WireNetwork.cpp:116–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114}
115
116void WireNetwork::scale_fit(const VectorF& bbox_min, const VectorF& bbox_max) {
117 center_at_origin();
118
119 VectorF bbox_size = bbox_max - bbox_min;
120 VectorF bbox_center = 0.5 * (bbox_min + bbox_max);
121 VectorF cur_bbox_size = get_bbox_max() - get_bbox_min();
122
123 VectorF scale_factor = bbox_size.cwiseQuotient(cur_bbox_size);
124 scale(scale_factor);
125
126 translate(bbox_center);
127}
128
129void WireNetwork::translate(const VectorF& offset) {
130 if (offset.size() != m_dim) {

Callers 7

PeriodicExplorationMethod · 0.80
inflateMethod · 0.80
inflateMethod · 0.80
TEST_FFunction · 0.80
TEST_FFunction · 0.80

Calls

no outgoing calls

Tested by 6

inflateMethod · 0.64
inflateMethod · 0.64
TEST_FFunction · 0.64
TEST_FFunction · 0.64