diff --git a/src/Mod/TechDraw/App/ShapeExtractor.cpp b/src/Mod/TechDraw/App/ShapeExtractor.cpp index 3361ad39dc..e52ac691f5 100644 --- a/src/Mod/TechDraw/App/ShapeExtractor.cpp +++ b/src/Mod/TechDraw/App/ShapeExtractor.cpp @@ -166,25 +166,30 @@ TopoDS_Shape ShapeExtractor::getShapes(const std::vector l for (auto& s:sourceShapes) { if (SU::isShapeReallyNull(s)) { continue; - } else if (s.ShapeType() < TopAbs_SOLID) { - //clean up composite shapes - TopoDS_Shape cleanShape = ShapeFinder::ShapeFinder::stripInfiniteShapes(s); + } + + if (s.ShapeType() < TopAbs_SOLID) { + //clean up TopAbs_COMPOUND & TopAbs_COMPSOLID + TopoDS_Shape cleanShape = ShapeFinder::stripInfiniteShapes(s); if (!cleanShape.IsNull()) { builder.Add(comp, cleanShape); } } else if (Part::TopoShape(s).isInfinite()) { continue; //simple shape is infinite - } else { - //a simple shape - add to compound - builder.Add(comp, s); } - } - //it appears that an empty compound is !IsNull(), so we need to check a different way - if (!SU::isShapeReallyNull(comp)) { - return comp; + + //a simple shape - add to compound + builder.Add(comp, s); } - return TopoDS_Shape(); + //it appears that an empty compound is !IsNull(), so we need to check a different way + if (SU::isShapeReallyNull(comp)) { + return {}; + } + + // BRepTools::Write(comp, "SEgetShapesOut.brep"); + + return comp; } std::vector ShapeExtractor::getXShapes(const App::Link* xLink)