]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
fixed problem where only the first solid was imported from STEP
authormbs <martin.bernhard@opencascade.com>
Mon, 27 Feb 2023 16:41:06 +0000 (16:41 +0000)
committermbs <martin.bernhard@opencascade.com>
Wed, 5 Apr 2023 11:13:04 +0000 (12:13 +0100)
src/GeomAlgoAPI/GeomAlgoAPI_STEPImportXCAF.cpp

index 3daecc1b64424fc7bef3e3e8e3edc4aabe42f0e3..b6b2332362e1d862e162a5a79e0c3525d99abd4d 100644 (file)
@@ -166,7 +166,7 @@ std::shared_ptr<GeomAPI_Shape> setGeom(const Handle(XCAFDoc_ShapeTool) &theShape
     aGeomShape->setImpl(new TopoDS_Shape(shape));
     return aGeomShape;
   } else {
-    for (Standard_Integer i=1; i<aFrshapes.Length(); i++) {
+    for (Standard_Integer i=1; i<=aFrshapes.Length(); i++) {
       TopoDS_Shape aS = theShapeTool->GetShape(aFrshapes.Value(i));
       TDF_Label aLabel = theShapeTool->FindShape(aS, Standard_False);
       if ( (!aLabel.IsNull()) && (theShapeTool->IsShape(aLabel)) ) {
@@ -174,7 +174,7 @@ std::shared_ptr<GeomAPI_Shape> setGeom(const Handle(XCAFDoc_ShapeTool) &theShape
           if (aS.IsNull()) {
             continue;
           } else {
-            if (!theShapeTool->IsReference(aLabel) ){
+            if (aS.ShapeType() != TopAbs_SOLID && !theShapeTool->IsReference(aLabel)){
               for(TDF_ChildIterator anIt(aLabel); anIt.More(); anIt.Next()) {
                 aB.Add(aCompound, theShapeTool->GetShape(anIt.Value()) );
               }