1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-19 13:40:49 +03:00

0030149: BRepMesh_Delaun: free triangle is left in the mesh after cleanup of auxiliary items

Remove free triangles connected to triangles over nodes of super triangle.
Modification of improved test case.
This commit is contained in:
oan
2019-03-06 14:29:57 +03:00
committed by apn
parent bf5f0ca20a
commit 060fc60338
3 changed files with 49 additions and 3 deletions

View File

@@ -682,7 +682,7 @@ void BRepMesh_Delaun::cleanupMesh()
if ( anEdges[aCurEdgeIdx] != aFreeEdgeId )
continue;
for ( Standard_Integer anOtherEdgeIt = 1; anOtherEdgeIt <= 2; ++anOtherEdgeIt )
for ( Standard_Integer anOtherEdgeIt = 1; anOtherEdgeIt <= 2 && isCanNotBeRemoved; ++anOtherEdgeIt )
{
Standard_Integer anOtherEdgeId = ( aCurEdgeIdx + anOtherEdgeIt ) % 3;
const BRepMesh_PairOfIndex& anOtherEdgePair =
@@ -691,7 +691,27 @@ void BRepMesh_Delaun::cleanupMesh()
if ( anOtherEdgePair.Extent() < 2 )
{
isCanNotBeRemoved = Standard_False;
break;
}
else
{
for (int aTriIdx = 1; aTriIdx <= anOtherEdgePair.Extent () && isCanNotBeRemoved; ++aTriIdx)
{
if (anOtherEdgePair.Index (aTriIdx) == aTriId)
continue;
Standard_Integer v[3];
const BRepMesh_Triangle& aCurTriangle = GetTriangle (anOtherEdgePair.Index (aTriIdx));
myMeshData->ElementNodes (aCurTriangle, v);
for (int aNodeIdx = 0; aNodeIdx < 3 && isCanNotBeRemoved; ++aNodeIdx)
{
if (v[aNodeIdx] == mySupVert[0] ||
v[aNodeIdx] == mySupVert[1] ||
v[aNodeIdx] == mySupVert[2])
{
isCanNotBeRemoved = Standard_False;
}
}
}
}
}