[PATCH 3/7] BRepFill_Filling: WireFromList: We can't assume that a connected edge...
authorblobfish <blobfish@gmx.com>
Mon, 8 Feb 2021 00:02:09 +0000 (00:02 +0000)
committerKurt Kremitzki <kkremitzki@debian.org>
Mon, 8 Feb 2021 00:02:09 +0000 (00:02 +0000)
Gbp-Pq: Name 0003-BRepFill_Filling-WireFromList-We-can-t-assume-that-a.patch

src/BRepFill/BRepFill_Filling.cxx

index d45e19c3f97765f7621f5ac728055f6358d365a3..1d665682edebe9942dfca00bf6f32d52e750ec86 100644 (file)
@@ -105,6 +105,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());
@@ -127,11 +128,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);