1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0025712: Non-deterministic behavior of ShapeFix_Solid

Test-case for issue #25712
This commit is contained in:
Roman Lygin
2015-01-29 13:56:53 +03:00
committed by bugmaster
parent c7806cb6e6
commit a70f58235a
4 changed files with 54 additions and 16 deletions

View File

@@ -140,10 +140,11 @@ static void GetMiddlePoint(const TopoDS_Shape& aShape, gp_Pnt& pmid)
//purpose :
//=======================================================================
static void CollectSolids(const TopTools_SequenceOfShape& aSeqShells ,
TopTools_DataMapOfShapeListOfShape& aMapShellHoles,
TopTools_IndexedDataMapOfShapeListOfShape& anIndexedMapShellHoles,
TopTools_DataMapOfShapeInteger& theMapStatus)
{
TopTools_MapOfShape aMapHoles;
TopTools_DataMapOfShapeListOfShape aMapShellHoles;
for ( Standard_Integer i1 = 1; i1 <= aSeqShells.Length(); i1++ ) {
TopoDS_Shell aShell1 = TopoDS::Shell(aSeqShells.Value(i1));
TopTools_ListOfShape lshells;
@@ -244,8 +245,15 @@ static void CollectSolids(const TopTools_SequenceOfShape& aSeqShells ,
}
}
for(TopTools_MapIteratorOfMapOfShape aIterHoles(aMapHoles);aIterHoles.More(); aIterHoles.Next())
aMapShellHoles.UnBind(aIterHoles.Key());
aMapShellHoles.UnBind (aIterHoles.Key());
for (Standard_Integer i = 1; i <= aSeqShells.Length(); ++i) {
const TopoDS_Shape& aShell1 = aSeqShells.Value (i);
if (aMapShellHoles.IsBound (aShell1)) {
const TopTools_ListOfShape& ls = aMapShellHoles.Find (aShell1);
anIndexedMapShellHoles.Add (aShell1, ls);
}
}
}
//=======================================================================
//function : CreateSolids
@@ -260,14 +268,13 @@ static Standard_Boolean CreateSolids(const TopoDS_Shape aShape,TopTools_IndexedM
for(TopExp_Explorer aExpShell(aShape,TopAbs_SHELL); aExpShell.More(); aExpShell.Next()) {
aSeqShells.Append(aExpShell.Current());
}
TopTools_DataMapOfShapeListOfShape aMapShellHoles;
TopTools_IndexedDataMapOfShapeListOfShape aMapShellHoles;
TopTools_DataMapOfShapeInteger aMapStatus;
CollectSolids(aSeqShells,aMapShellHoles,aMapStatus);
TopTools_IndexedDataMapOfShapeShape ShellSolid;
TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItShellHoles( aMapShellHoles);
//Defines correct orientation of shells
for(; aItShellHoles.More();aItShellHoles.Next()) {
TopoDS_Shell aShell = TopoDS::Shell(aItShellHoles.Key());
for (Standard_Integer i = 1; i <= aMapShellHoles.Extent(); ++i) {
TopoDS_Shell aShell = TopoDS::Shell(aMapShellHoles.FindKey(i));
TopExp_Explorer aExpEdges(aShell,TopAbs_EDGE);
if(!BRep_Tool::IsClosed(aShell) || !aExpEdges.More()) {
ShellSolid.Add(aShell,aShell);
@@ -311,7 +318,7 @@ static Standard_Boolean CreateSolids(const TopoDS_Shape aShape,TopTools_IndexedM
aSolid = aTmpSolid;
}
const TopTools_ListOfShape& lHoles = aItShellHoles.Value();
const TopTools_ListOfShape& lHoles = aMapShellHoles (i);
for(TopTools_ListIteratorOfListOfShape lItHoles(lHoles); lItHoles.More();lItHoles.Next()) {
TopoDS_Shell aShellHole = TopoDS::Shell(lItHoles.Value());
if(aMapStatus.IsBound(aShellHole)) {