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

Method scale

tools/Wires/WireNetwork/WireNetwork.cpp:99–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99void WireNetwork::scale(const VectorF& factors) {
100 if (factors.size() != m_dim) {
101 std::stringstream err_msg;
102 err_msg << "Scaling factors is of dim ("
103 << factors.size() << "), expecting (" << m_dim << ")";
104 throw RuntimeError(err_msg.str());
105 }
106
107 const size_t num_vertices = get_num_vertices();
108 for (size_t i=0; i<num_vertices; i++) {
109 const VectorF& v = m_vertices.row(i);
110 m_vertices.row(i) = v.cwiseProduct(factors);
111 }
112
113 update_bbox();
114}
115
116void WireNetwork::scale_fit(const VectorF& bbox_min, const VectorF& bbox_max) {
117 center_at_origin();

Callers 6

normalize_unit_wireMethod · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45

Calls 3

RuntimeErrorClass · 0.85
sizeMethod · 0.45
strMethod · 0.45

Tested by 5

TEST_FFunction · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36