Salome HOME
Added unit-test that checks the issue #1379 is fixed
[modules/shaper.git] / src / Model / Model_BodyBuilder.cpp
index 6155c39237185d0a6d6becafcef6d7014be38c44..1a8ea5507f9518ca3810ac4bb6ba615e21bbfe6d 100755 (executable)
@@ -385,7 +385,9 @@ static void keepTopLevelShapes(ListOfShape& theShapes, const TopoDS_Shape& theRo
   ListOfShape::iterator anIt = theShapes.begin();
   while (anIt != theShapes.end()) {
     TopoDS_Shape aNewShape = (*anIt)->impl<TopoDS_Shape>();
-    if (theRoot.IsSame(aNewShape) || (theResultShape &&
+    bool aSkip = aNewShape.IsNull() ||
+      (aNewShape.ShapeType() == TopAbs_EDGE && BRep_Tool::Degenerated(TopoDS::Edge(aNewShape)));
+    if (aSkip || theRoot.IsSame(aNewShape) || (theResultShape &&
         (!theResultShape->isSubShape(*anIt, false) || theResultShape->isSame(*anIt)))) {
       ListOfShape::iterator aRemoveIt = anIt++;
       theShapes.erase(aRemoveIt);