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

Method drop_zero_dim

tools/Wires/WireNetwork/WireNetwork.cpp:152–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150}
151
152void WireNetwork::drop_zero_dim() {
153 const size_t num_vertices = get_num_vertices();
154 std::vector<bool> to_keep(m_dim, false);
155 size_t num_cols_to_keep = 0;
156 for (size_t i=0; i<m_dim; i++) {
157 if (m_bbox_min[i] < m_bbox_max[i]) {
158 to_keep[i] = true;
159 num_cols_to_keep += 1;
160 }
161 }
162
163 MatrixFr vertices(num_vertices, num_cols_to_keep);
164 size_t count = 0;
165 for (size_t i=0; i<m_dim; i++) {
166 if (to_keep[i]) {
167 vertices.col(count) = m_vertices.col(i);
168 count++;
169 }
170 }
171 m_vertices.swap(vertices);
172 m_dim = num_cols_to_keep;
173 update_bbox();
174}
175
176void WireNetwork::filter_vertices(const std::vector<bool>& to_keep) {
177 const size_t num_vertices = m_vertices.rows();

Callers 3

load_meshFunction · 0.80
TEST_FFunction · 0.80
load_tmp_meshMethod · 0.80

Calls

no outgoing calls

Tested by 2

TEST_FFunction · 0.64
load_tmp_meshMethod · 0.64