From d585499825abf51441ea717502b0fbde82a5b22e Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" Date: Tue, 3 Jan 2017 17:05:28 +0800 Subject: [PATCH] Make DraftGeomUtils.findWires use Part.sortEdges Renamed the original DraftGeomUtils.findWires() to findWiresOld2(). The original findWires() has a bug which may cause missing edge(s). Besides, using C++ implementation of Part.sortEdges will have better performance. --- src/Mod/Draft/DraftGeomUtils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Mod/Draft/DraftGeomUtils.py b/src/Mod/Draft/DraftGeomUtils.py index d6b04f4c1..4efa2154b 100755 --- a/src/Mod/Draft/DraftGeomUtils.py +++ b/src/Mod/Draft/DraftGeomUtils.py @@ -870,8 +870,10 @@ def flattenWire(wire): w = Part.makePolygon(verts) return w - def findWires(edgeslist): + return [ Part.Wire(e) for e in Part.sortEdges(edgeslist)] + +def findWiresOld2(edgeslist): '''finds connected wires in the given list of edges''' def touches(e1,e2):