handle triangles attached by non-manifold vertices

This commit is contained in:
Sébastien Loriot 2019-01-16 15:24:57 +01:00
parent e0184766d2
commit c697c2086f
1 changed files with 41 additions and 55 deletions

View File

@ -1349,7 +1349,6 @@ bool
out_edge_iterator eb1, ee1 ; out_edge_iterator eb1, ee1 ;
out_edge_iterator eb2, ee2 ; out_edge_iterator eb2, ee2 ;
// The following loop checks the link condition for v0_v1. // The following loop checks the link condition for v0_v1.
// Specifically, that for every vertex 'k' adjacent to both 'p and 'q', 'pkq' is a face of the mesh. // Specifically, that for every vertex 'k' adjacent to both 'p and 'q', 'pkq' is a face of the mesh.
// //
@ -1382,8 +1381,6 @@ bool
bool lIsFace = ( vL == k && (! is_border(v0_v1,g)) ) bool lIsFace = ( vL == k && (! is_border(v0_v1,g)) )
|| ( vR == k && (! is_border(v1_v0,g)) ) ; || ( vR == k && (! is_border(v1_v0,g)) ) ;
if ( !lIsFace ) if ( !lIsFace )
{ {
// CGAL_ECMS_TRACE(3," k=V" << get(Vertex_index_map,k) << " IS NOT in a face with p-q. NON-COLLAPSABLE edge." ) ; // CGAL_ECMS_TRACE(3," k=V" << get(Vertex_index_map,k) << " IS NOT in a face with p-q. NON-COLLAPSABLE edge." ) ;
@ -1398,24 +1395,13 @@ bool
} }
} }
// detect isolated triangle (or triangle attached to a mesh with non-manifold vertices)
if (!is_border(v0_v1,g) && is_border(opposite(next(v0_v1,g), g), g)
&& is_border(opposite(prev(v0_v1,g), g), g) ) return false;
if (!is_border(v1_v0,g) && is_border(opposite(next(v1_v0,g), g), g)
&& is_border(opposite(prev(v1_v0,g), g), g) ) return false;
if ( is_border(v0_v1,g) ) if ( !is_border(v0_v1,g) && !is_border(v1_v0,g) )
{
if ( next(next(next(v0_v1,g),g),g) == v0_v1 )
{
//CGAL_ECMS_TRACE(3," p-q belongs to an open triangle. NON-COLLAPSABLE edge." ) ;
return false ;
}
}
else if ( is_border(v1_v0,g) )
{
if ( next(next(next(v1_v0,g),g),g) == v1_v0 )
{
//CGAL_ECMS_TRACE(3," p-q belongs to an open triangle. NON-COLLAPSABLE edge." ) ;
return false ;
}
}
else
{ {
if ( is_border(v0,g) && is_border(v1,g) ) if ( is_border(v0,g) && is_border(v1,g) )
{ {