diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h index d45268c81a0..bffc206b326 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h @@ -24,6 +24,7 @@ #include #include #include +#include #include namespace CGAL { @@ -99,6 +100,7 @@ boolean_operation( TriangleMesh& tm1, NamedParametersOut3>& nps_out, const bool throw_on_self_intersection = false ) { + // Vertex point maps //for input meshes typedef typename GetVertexPointMap Ecm; + if (&tm1==&tm2) + { + Corefinement::mark_all_edges(tm1, ecm1); + Corefinement::mark_all_edges(tm2, ecm2); + return; + } + // surface intersection algorithm call typedef Corefinement::Default_node_visitor Dnv; typedef Corefinement::Default_face_visitor Dfv; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/Visitor.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/Visitor.h index e7ffb017871..3adfe1127f9 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/Visitor.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/Visitor.h @@ -76,6 +76,20 @@ struct No_mark {} }; +template +void mark_all_edges(TriangleMesh& tm, const EdgeMarkMap& edge_mark_map) +{ + BOOST_FOREACH(typename boost::graph_traits::edge_descriptor ed, + edges(tm)) + { + put(edge_mark_map, ed, true); + } +} + +template +void mark_all_edges(TriangleMesh& tm, const No_mark&) +{} //nothing to do + //binds two edge constrained pmaps template struct Ecm_bind{