From d9b67fcb0d2b5b57674cd6e6cf3ac637e22a44cd Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 9 Apr 2015 14:30:47 +0200 Subject: [PATCH] check that the halfedge is not a border halfedge --- .../CGAL/Polygon_mesh_processing/connected_components.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h index a24d3617849..c6a12ece434 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h @@ -691,15 +691,15 @@ std::size_t keep_largest_connected_components(PolygonMesh& pmesh #endif } else if( (is_border(oh,pmesh) && face_cc[fh]) || (is_border(h,pmesh) && face_cc[ofh]) || - (face_cc[fh] && face_cc[ofh]) ){ + (! is_border(oh,pmesh) && ! is_border(h,pmesh) &&face_cc[fh] && face_cc[ofh]) ){ // do nothing - } else if(face_cc[fh] && ! face_cc[ofh]){ + } else if(! is_border(h,pmesh) && face_cc[fh] && ! is_border(oh,pmesh) &&! face_cc[ofh]){ set_face(oh, boost::graph_traits::null_face(), pmesh); - } else if(! face_cc[fh] && face_cc[ofh]){ + } else if(! is_border(h,pmesh) && ! face_cc[fh] && ! is_border(oh,pmesh) && face_cc[ofh]){ set_face(h, boost::graph_traits::null_face(), pmesh); } else { // no face kept - assert( ! face_cc[fh] && ! face_cc[ofh]); + assert( (is_border(h,pmesh) || ! face_cc[fh]) && (is_border(oh,pmesh) ||! face_cc[ofh])); // vertices pointing to e must change their halfedge if(halfedge(v,pmesh) == oh){ set_halfedge(v,prev(h,pmesh),pmesh);