diff --git a/src/Mod/Path/PathScripts/PathDeburr.py b/src/Mod/Path/PathScripts/PathDeburr.py index 952f0afe83..f0129fe018 100644 --- a/src/Mod/Path/PathScripts/PathDeburr.py +++ b/src/Mod/Path/PathScripts/PathDeburr.py @@ -78,6 +78,7 @@ class ObjectDeburr(PathEngraveBase.ObjectOp): obj.Direction = ['CW', 'CCW'] obj.addProperty('App::PropertyEnumeration', 'Side', 'Deburr', QtCore.QT_TRANSLATE_NOOP('PathDeburr', 'Side of Operation')) obj.Side = ['Outside', 'Inside'] + obj.addProperty('App::PropertyInteger', 'EntryPoint', 'Deburr', QtCore.QT_TRANSLATE_NOOP('PathDeburr', 'Select the segment, there the operations starts')) def opOnDocumentRestored(self, obj): obj.setEditorMode('Join', 2) # hide for now @@ -129,9 +130,12 @@ class ObjectDeburr(PathEngraveBase.ObjectOp): zValues.append(z) zValues.append(depth) PathLog.track(obj.Label, depth, zValues) - + + if obj.EntryPoint < 0: + obj.EntryPoint = 0; + self.wires = wires # pylint: disable=attribute-defined-outside-init - self.buildpathocc(obj, wires, zValues, True, forward) + self.buildpathocc(obj, wires, zValues, True, forward, obj.EntryPoint) # the last command is a move to clearance, which is automatically added by PathOp if self.commandlist: @@ -150,6 +154,7 @@ class ObjectDeburr(PathEngraveBase.ObjectOp): obj.StepDown = '0 mm' obj.Direction = 'CW' obj.Side = "Outside" + obj.EntryPoint = 0; def SetupProperties(): diff --git a/src/Mod/Path/PathScripts/PathEngraveBase.py b/src/Mod/Path/PathScripts/PathEngraveBase.py index 11b48a33ae..459e60a839 100644 --- a/src/Mod/Path/PathScripts/PathEngraveBase.py +++ b/src/Mod/Path/PathScripts/PathEngraveBase.py @@ -59,7 +59,7 @@ class ObjectOp(PathOp.ObjectOp): zValues.append(obj.FinalDepth.Value) return zValues - def buildpathocc(self, obj, wires, zValues, relZ=False, forward=True): + def buildpathocc(self, obj, wires, zValues, relZ=False, forward=True, start_idx=0): '''buildpathocc(obj, wires, zValues, relZ=False) ... internal helper function to generate engraving commands.''' PathLog.track(obj.Label, len(wires), zValues) @@ -78,6 +78,10 @@ class ObjectOp(PathOp.ObjectOp): self.appendCommand(Path.Command('G1', {'X': last.x, 'Y': last.y, 'Z': last.z}), z, relZ, self.vertFeed) first = True + if start_idx > len(edges)-1: + start_idx = len(edges)-1 + + edges = edges[start_idx:] + edges[:start_idx] for edge in edges: if first and (not last or not wire.isClosed()): # we set the first move to our first point