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

Method trim_irrelavent_edges

tools/Wires/Inflator/PhantomMeshGenerator.cpp:168–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166}
167
168void PhantomMeshGenerator::trim_irrelavent_edges() {
169 // Relavent edge is edge that have at least 1 end point from the original
170 // wire network.
171 const Float eps = 1e-3;
172 const size_t dim = m_wire_network->get_dim();
173 const VectorF bbox_min = m_wire_network->get_bbox_min() - VectorF::Ones(dim)*eps;
174 const VectorF bbox_max = m_wire_network->get_bbox_max() + VectorF::Ones(dim)*eps;
175
176 const size_t num_phantom_vertices = m_phantom_wires->get_num_vertices();
177 const MatrixFr& phantom_vertices = m_phantom_wires->get_vertices();
178 const MatrixIr& phantom_edges = m_phantom_wires->get_edges();
179
180 std::vector<bool> vertex_relavent_indicator(num_phantom_vertices, false);
181 for (size_t i=0; i<num_phantom_vertices; i++) {
182 const VectorF& v = phantom_vertices.row(i);
183 if ((v.array() > bbox_min.array()).all() &&
184 (v.array() < bbox_max.array()).all()) {
185 vertex_relavent_indicator[i] = true;
186 }
187 }
188
189 dilate(phantom_edges, vertex_relavent_indicator);
190 dilate(phantom_edges, vertex_relavent_indicator);
191 m_phantom_wires->filter_vertices(vertex_relavent_indicator);
192}
193
194void PhantomMeshGenerator::convert_attributes_to_parameters() {
195 assert(m_parameter_manager);

Callers

nothing calls this directly

Calls 8

dilateFunction · 0.85
get_bbox_minMethod · 0.80
get_bbox_maxMethod · 0.80
get_dimMethod · 0.45
get_num_verticesMethod · 0.45
get_verticesMethod · 0.45
get_edgesMethod · 0.45
filter_verticesMethod · 0.45

Tested by

no test coverage detected