diff --git a/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h b/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h index 13bbb522bc5..9c7ed064a3e 100644 --- a/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h +++ b/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h @@ -513,6 +513,28 @@ public: m_omega_P = value; } + /// \cgalAdvancedFunction + /// \cgalAdvancedBegin + /// Fixes a range of vertices. Fixed vertices will not be moved + /// during contraction and this will therefore prevent convergence + /// towards the skeleton if `contract_until_convergence()` is used. + /// It is only useful if the object is to retrieve the meso-skeleton + /// after a number of `contract_geometry()`, keeping the specified + /// vertices fixed in place. + /// \cgalAdvancedEnd + template + void set_fixed_vertices(InputIterator begin, InputIterator end) + { + std::unordered_set set(begin, end); + + for(vertex_descriptor vd : vertices(m_tmesh)) + { + if (set.find(vd->vertices[0]) != set.end()) { + vd->is_fixed = true; + } + } + } + /// \cond SKIP_FROM_MANUAL void set_zero_TH(double value) {