From e0ef4feab61cfdaf05191434f59d0611fb96b3dc Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Mon, 18 Sep 2017 17:07:02 -0700 Subject: [PATCH] Ensure all edges of wires for horizontalEdgeLoop are also horizontal - required for rejecting solutions that include part of cylinder walls. --- src/Mod/Path/PathScripts/PathUtils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mod/Path/PathScripts/PathUtils.py b/src/Mod/Path/PathScripts/PathUtils.py index a1558186ea..b392500acb 100644 --- a/src/Mod/Path/PathScripts/PathUtils.py +++ b/src/Mod/Path/PathScripts/PathUtils.py @@ -221,7 +221,7 @@ def horizontalEdgeLoop(obj, edge): '''horizontalEdgeLoop(obj, edge) ... returns a wire in the horizontal plane, if that is the only horizontal wire the given edge is a part of.''' h = edge.hashCode() wires = [w for w in obj.Shape.Wires if any(e.hashCode() == h for e in w.Edges)] - loops = [w for w in wires if PathGeom.isHorizontal(Part.Face(w))] + loops = [w for w in wires if all(PathGeom.isHorizontal(e) for e in w.Edges) and PathGeom.isHorizontal(Part.Face(w))] if len(loops) == 1: return loops[0] return None