Hello.
I've got an issue importing a STeP model that I unfortunately cannot share.
OC keeps consuming more and more memory until it's killed (aroung 40GB or so).
I tried debugging it and I see the problem arises in the function CreateSolids (ShapeFix_Solid.cxx, line 248 in version 7.8.1).
The code is:
//Creation of compsolid from shells containing shared faces.
TopTools_IndexedDataMapOfShapeListOfShape aMapFaceShells;
TopExp::MapShapesAndAncestors(theShape,TopAbs_FACE,TopAbs_SHELL,aMapFaceShells);
for(Standard_Integer i =1; i <= aMapFaceShells.Extent(); i++) {
const TopTools_ListOfShape& lshells = aMapFaceShells.FindFromIndex(i);
if(lshells.Extent() <2) continue;
TopoDS_CompSolid aCompSolid;
BRep_Builder aB;
aB.MakeCompSolid(aCompSolid);
isDone = (theShape.ShapeType() != TopAbs_COMPSOLID || isDone);
Standard_Integer nbSol = 0;
for(TopTools_ListIteratorOfListOfShape lItSh(lshells);lItSh.More(); lItSh.Next()) {
if(ShellSolid.Contains(lItSh.Value())) {
const TopoDS_Shape& aShape = ShellSolid.FindFromKey(lItSh.Value());
TopExp_Explorer aExpSol(aShape, TopAbs_SOLID);
for(;aExpSol.More(); aExpSol.Next())
{
aB.Add(aCompSolid,aExpSol.Current());
nbSol++;
}
}
}
if(nbSol >1)
{
for(TopTools_ListIteratorOfListOfShape lItSh1(lshells);lItSh1.More(); lItSh1.Next())
{
if(ShellSolid.Contains(lItSh1.Value()))
ShellSolid.ChangeFromKey(lItSh1.Value()) = aCompSolid;
}
}
}
At each iteration of i, nbSol keeps growing exponentially:
_ i = 1 -> nbSol = 1;
_ i = 2 -> nbSol = 4;
_ i = 3 -> nbSol = 8;
_ i = 4 -> nbSol = 16;
_ i = 5 -> nbSol = 32;
_ i = 6 -> nbSol = 64;
_ i = 7 -> nbSol = 128;
_ i = 8 -> nbSol = 256;
_ i = 9 -> nbSol = 512;
...
_ i = 24 -> nbSol = 16777216;
_ i = 25 -> nbSol = 33554432
... then it's hard to keep going on.
Something is obviously wrong (as the model is imported correctly by other softwares); however I'm not so proficient with OC internals, so I don't know where to look or what to set or what tools I should try.
Anyone can give any hint?
Thanks in advance.