diff --git a/src/libslic3r/Format/STEP.cpp b/src/libslic3r/Format/STEP.cpp index 5ee66be24d..fe189d5766 100644 --- a/src/libslic3r/Format/STEP.cpp +++ b/src/libslic3r/Format/STEP.cpp @@ -197,15 +197,19 @@ static void getNamedSolids(const TopLoc_Location& location, const std::string& p } } else { TopoDS_Shape shape; + TopExp_Explorer explorer; shapeTool->GetShape(referredLabel, shape); TopAbs_ShapeEnum shape_type = shape.ShapeType(); BRepBuilderAPI_Transform transform(shape, localLocation, Standard_True); + int i = 0; switch (shape_type) { case TopAbs_COMPOUND: - namedSolids.emplace_back(TopoDS::Compound(transform.Shape()), fullName); - break; case TopAbs_COMPSOLID: - namedSolids.emplace_back(TopoDS::CompSolid(transform.Shape()), fullName); + for (explorer.Init(transform.Shape(), TopAbs_SOLID); explorer.More(); explorer.Next()) { + i++; + const TopoDS_Shape& currentShape = explorer.Current(); + namedSolids.emplace_back(TopoDS::Solid(currentShape), fullName + "-SOLID-" + std::to_string(i)); + } break; case TopAbs_SOLID: namedSolids.emplace_back(TopoDS::Solid(transform.Shape()), fullName);