Skip to content

Commit

Permalink
FIX: step model split COMPOUND and COMPOUNSOLID type
Browse files Browse the repository at this point in the history
JIRA:STUDIO-5632

GITHUB: bambulab#3153
Change-Id: I1b9b49321cc0da8bdd79e2beb4009283cfada287
(cherry picked from commit 6191a66441549b1cee8be8d7f740c2d466557691)
  • Loading branch information
MackBambu authored and lanewei120 committed Oct 15, 2024
1 parent 539dea0 commit 90f3257
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/libslic3r/Format/STEP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 90f3257

Please sign in to comment.