| 79 | } |
| 80 | |
| 81 | void PeriodicInflator3D::update_face_sources() { |
| 82 | BoxChecker box_checker(m_center_cell_bbox_min, m_center_cell_bbox_max); |
| 83 | const size_t num_faces = m_faces.rows(); |
| 84 | MatrixFr face_centroids(num_faces, 3); |
| 85 | for (size_t i=0; i<num_faces; i++) { |
| 86 | const VectorI& f = m_faces.row(i); |
| 87 | face_centroids.row(i) = ( |
| 88 | m_vertices.row(f[0]) + |
| 89 | m_vertices.row(f[1]) + |
| 90 | m_vertices.row(f[2])) / 3.0; |
| 91 | } |
| 92 | |
| 93 | VectorF squared_dists; |
| 94 | VectorI closest_face_indices; |
| 95 | MatrixFr closest_points; |
| 96 | m_tree->lookup(face_centroids, squared_dists, closest_face_indices, closest_points); |
| 97 | |
| 98 | m_face_sources = VectorI::Zero(num_faces); |
| 99 | for (size_t i=0; i<num_faces; i++) { |
| 100 | const VectorF& centroid = face_centroids.row(i); |
| 101 | if (box_checker.is_on_boundary(centroid)) { |
| 102 | continue; |
| 103 | } else { |
| 104 | m_face_sources[i] = m_phantom_face_sources[closest_face_indices[i]]; |
| 105 | } |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | void PeriodicInflator3D::periodic_remesh() { |
| 110 | Float default_thickness = m_parameter_manager->get_default_thickness(); |
nothing calls this directly
no test coverage detected