[PATCH 3/7] BRepFill_Filling: WireFromList: We can't assume that a connected edge...
authorblobfish <blobfish@gmx.com>
Tue, 2 Aug 2022 13:06:17 +0000 (14:06 +0100)
committerTobias Frost <tobi@debian.org>
Tue, 2 Aug 2022 13:06:17 +0000 (14:06 +0100)
Gbp-Pq: Name 0003-BRepFill_Filling-WireFromList-We-can-t-assume-that-a.patch

src/BRepFill/BRepFill_Filling.cxx

index 546919e9aac9d610570e40b270fbf5e69d676e09..9342a9ddea550e47fc4b97350b4ea1ab33491398 100644 (file)
@@ -104,6 +104,7 @@ static TopoDS_Wire WireFromList(TopTools_ListOfShape& Edges)
   while (!Edges.IsEmpty())
   {
     TopTools_ListIteratorOfListOfShape itl(Edges);
+    bool found = false;
     for (; itl.More(); itl.Next())
     {
       anEdge = TopoDS::Edge(itl.Value());
@@ -126,11 +127,17 @@ static TopoDS_Wire WireFromList(TopTools_ListOfShape& Edges)
           anEdge.Reverse();
           V2 = V3;
         }
+        found = true;
         break;
       }
     }
-    BB.Add(aWire, anEdge);
-    Edges.Remove(itl);
+    if (found)
+    {
+      BB.Add(aWire, anEdge);
+      Edges.Remove(itl);
+    }
+    else
+      break;
   }
 
   aWire.Closed(Standard_True);