| 108 | } |
| 109 | |
| 110 | void PeriodicInflator::refine_phantom_mesh() { |
| 111 | if (!m_refiner) return; |
| 112 | m_refiner->subdivide(m_phantom_vertices, m_phantom_faces, m_subdiv_order); |
| 113 | m_phantom_vertices = m_refiner->get_vertices(); |
| 114 | m_phantom_faces = m_refiner->get_faces(); |
| 115 | |
| 116 | VectorI face_indices = m_refiner->get_face_indices(); |
| 117 | const size_t num_faces = m_phantom_faces.rows(); |
| 118 | VectorI face_sources(num_faces); |
| 119 | for (size_t i=0; i<num_faces; i++) { |
| 120 | face_sources[i] = m_phantom_face_sources[face_indices[i]]; |
| 121 | } |
| 122 | m_phantom_face_sources = face_sources; |
| 123 | |
| 124 | if (m_with_shape_velocities) { |
| 125 | const std::vector<ZSparseMatrix>& subdiv_matrices = |
| 126 | m_refiner->get_subdivision_matrices(); |
| 127 | for (auto& shape_velocity : m_shape_velocities) { |
| 128 | for (const auto& mat : subdiv_matrices) { |
| 129 | shape_velocity = mat * shape_velocity; |
| 130 | } |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | assert(m_phantom_faces.rows() == m_phantom_face_sources.size()); |
| 135 | //save_mesh("phantom.msh", m_phantom_vertices, m_phantom_faces, |
| 136 | // m_phantom_face_sources.cast<Float>()); |
| 137 | } |
| 138 | |
| 139 | void PeriodicInflator::get_center_cell_bbox( |
| 140 | VectorF& bbox_min, VectorF& bbox_max) { |
nothing calls this directly
no test coverage detected