From c4f39518289430412e91fb4fc546d92713f5b1a8 Mon Sep 17 00:00:00 2001 From: Stefan Endres Date: Sun, 13 Dec 2020 14:33:18 +0100 Subject: [PATCH] Path: Sort edges before splitting at selected vertex --- src/Mod/Path/PathScripts/PathEngraveBase.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Mod/Path/PathScripts/PathEngraveBase.py b/src/Mod/Path/PathScripts/PathEngraveBase.py index 4fdbc18a6b..abaf413dc8 100644 --- a/src/Mod/Path/PathScripts/PathEngraveBase.py +++ b/src/Mod/Path/PathScripts/PathEngraveBase.py @@ -30,6 +30,7 @@ import copy # lazily loaded modules from lazy_loader.lazy_loader import LazyLoader DraftGeomUtils = LazyLoader('DraftGeomUtils', globals(), 'DraftGeomUtils') +Part = LazyLoader('Part', globals(), 'Part') from PySide import QtCore @@ -69,9 +70,11 @@ class ObjectOp(PathOp.ObjectOp): # reorder the wire if hasattr(obj, 'StartVertex'): - offset = DraftGeomUtils.rebaseWire(offset, obj.StartVertex) + start_idx = obj.StartVertex edges = copy.copy(PathOpTools.orientWire(offset, forward).Edges) + edges = Part.sortEdges(edges)[0]; + last = None for z in zValues: