| 68 | } |
| 69 | |
| 70 | void PeriodicExploration::periodic_inflate(bool use_reflective_inflator) { |
| 71 | ParameterCommon::Variables vars; |
| 72 | MatrixFr offset = m_parameters->evaluate_offset(vars); |
| 73 | MatrixFr ori_vertices = m_wire_network->get_vertices(); |
| 74 | m_wire_network->set_vertices(ori_vertices+ offset); |
| 75 | |
| 76 | InflatorEngine::Ptr inflator; |
| 77 | if (use_reflective_inflator) { |
| 78 | inflator = InflatorEngine::create_isotropic_parametric( |
| 79 | m_wire_network, m_parameters); |
| 80 | } else { |
| 81 | inflator = InflatorEngine::create_parametric(m_wire_network, m_parameters); |
| 82 | } |
| 83 | inflator->set_profile(m_profile); |
| 84 | inflator->with_shape_velocities(); |
| 85 | if (m_refine_order > 0) |
| 86 | inflator->with_refinement(m_refine_algorithm, m_refine_order); |
| 87 | |
| 88 | try { |
| 89 | inflator->inflate(); |
| 90 | } catch (...) { |
| 91 | m_wire_network->set_vertices(ori_vertices); |
| 92 | throw; |
| 93 | } |
| 94 | |
| 95 | m_wire_network->set_vertices(ori_vertices); |
| 96 | |
| 97 | m_vertices = inflator->get_vertices(); |
| 98 | m_faces = inflator->get_faces(); |
| 99 | m_voxels = MatrixIr::Zero(0, 4); |
| 100 | m_face_sources = inflator->get_face_sources(); |
| 101 | m_shape_velocities = inflator->get_shape_velocities(); |
| 102 | update_mesh(); |
| 103 | } |
| 104 | |
| 105 | bool PeriodicExploration::run_tetgen(Float max_tet_vol) { |
| 106 | #ifdef WITH_TETGEN |