FIX: step model split COMPOUND and COMPOUNSOLID type (#8084)
JIRA:STUDIO-5632 GITHUB: #3153 Change-Id: I1b9b49321cc0da8bdd79e2beb4009283cfada287 (cherry picked from commit 6191a66441549b1cee8be8d7f740c2d466557691) (cherry picked from commit 90f325792dc4910b80d69c9d6a5677f24b8fa259) Co-authored-by: Mack <yongfang.bian@bambulab.com>
This commit is contained in:
parent
6cdede8e10
commit
16340fd6b6
1 changed files with 7 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue