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

Method update_face_sources

tools/Wires/Inflator/IsotropicPeriodicInflator.cpp:272–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

270}
271
272void IsotropicPeriodicInflator::update_face_sources() {
273 BoxChecker box_checker(m_center_cell_bbox_min, m_center_cell_bbox_max);
274 const size_t num_faces = m_faces.rows();
275 MatrixFr face_centroids(num_faces, 3);
276 for (size_t i=0; i<num_faces; i++) {
277 const VectorI& f = m_faces.row(i);
278 face_centroids.row(i) = (
279 m_vertices.row(f[0]) +
280 m_vertices.row(f[1]) +
281 m_vertices.row(f[2])) / 3.0;
282 }
283
284 VectorF squared_dists;
285 VectorI closest_face_indices;
286 MatrixFr closest_points;
287 m_tree->lookup(face_centroids, squared_dists, closest_face_indices, closest_points);
288
289 m_face_sources = VectorI::Zero(num_faces);
290 for (size_t i=0; i<num_faces; i++) {
291 const VectorF& centroid = face_centroids.row(i);
292 if (box_checker.is_on_boundary(centroid)) {
293 continue;
294 } else {
295 m_face_sources[i] = m_phantom_face_sources[closest_face_indices[i]];
296 }
297 }
298}
299
300Float IsotropicPeriodicInflator::get_distance_threshold() const {
301 return (m_octa_cell_bbox_max - m_octa_cell_bbox_min).maxCoeff() * 1e-4;

Callers

nothing calls this directly

Calls 2

is_on_boundaryMethod · 0.80
lookupMethod · 0.45

Tested by

no test coverage detected