From 2e692dff2d06af4ed23b1370d0bd374462deea7f Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Mon, 4 Feb 2019 11:44:03 -0800 Subject: [PATCH] Restrict removal of g0 to clearance height to the engraving of the last base model. --- src/Mod/Path/PathScripts/PathDeburr.py | 4 ++++ src/Mod/Path/PathScripts/PathEngrave.py | 3 +++ src/Mod/Path/PathScripts/PathEngraveBase.py | 2 -- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathDeburr.py b/src/Mod/Path/PathScripts/PathDeburr.py index aa34cbde4a..1df6721f13 100644 --- a/src/Mod/Path/PathScripts/PathDeburr.py +++ b/src/Mod/Path/PathScripts/PathDeburr.py @@ -119,6 +119,10 @@ class ObjectDeburr(PathEngraveBase.ObjectOp): self.wires = wires self.buildpathocc(obj, wires, zValues, True) + # the last command is a move to clearance, which is automatically added by PathOp + if self.commandlist: + self.commandlist.pop() + def opRejectAddBase(self, obj, base, sub): '''The chamfer op can only deal with features of the base model, all others are rejected.''' return not base in self.model diff --git a/src/Mod/Path/PathScripts/PathEngrave.py b/src/Mod/Path/PathScripts/PathEngrave.py index 5723989bfc..7a16955eea 100644 --- a/src/Mod/Path/PathScripts/PathEngrave.py +++ b/src/Mod/Path/PathScripts/PathEngrave.py @@ -146,6 +146,9 @@ class ObjectEngrave(PathEngraveBase.ObjectOp): self.buildpathocc(obj, shapeWires, zValues) wires.extend(shapeWires) self.wires = wires + # the last command is a move to clearance, which is automatically added by PathOp + if self.commandlist: + self.commandlist.pop() except Exception as e: PathLog.error(e) diff --git a/src/Mod/Path/PathScripts/PathEngraveBase.py b/src/Mod/Path/PathScripts/PathEngraveBase.py index e38fd7ec94..c178754a96 100644 --- a/src/Mod/Path/PathScripts/PathEngraveBase.py +++ b/src/Mod/Path/PathScripts/PathEngraveBase.py @@ -113,8 +113,6 @@ class ObjectOp(PathOp.ObjectOp): self.appendCommand(cmd, z, rel) last = edge.Vertexes[0].Point self.commandlist.append(Path.Command('G0', {'Z': obj.ClearanceHeight.Value, 'F': self.vertRapid})) - if self.commandlist: - self.commandlist.pop() def appendCommand(self, cmd, z, rel): params = cmd.Parameters