diff --git a/src/Mod/CAM/Path/Op/EngraveBase.py b/src/Mod/CAM/Path/Op/EngraveBase.py index cbbaa72368..add09f6eca 100644 --- a/src/Mod/CAM/Path/Op/EngraveBase.py +++ b/src/Mod/CAM/Path/Op/EngraveBase.py @@ -25,7 +25,8 @@ import Path import Path.Op.Base as PathOp import Path.Op.Util as PathOpUtil import PathScripts.PathUtils as PathUtils -import copy + +# import copy __doc__ = "Base class for all ops in the engrave family." @@ -93,7 +94,8 @@ class ObjectOp(PathOp.ObjectOp): for z in zValues: Path.Log.debug(z) - if last: + if last and wire.isClosed(): + # Add step down to next Z for closed profile self.appendCommand( Path.Command("G1", {"X": last.x, "Y": last.y, "Z": last.z}), z, @@ -118,7 +120,7 @@ class ObjectOp(PathOp.ObjectOp): ) if first and (not last or not wire.isClosed()): Path.Log.debug("processing first edge entry") - # we set the first move to our first point + # Add moves to first point of wire last = edge.Vertexes[0].Point self.commandlist.append( @@ -143,13 +145,18 @@ class ObjectOp(PathOp.ObjectOp): if Path.Geom.pointsCoincide(last, edge.valueAt(edge.FirstParameter)): # if Path.Geom.pointsCoincide(last, edge.Vertexes[0].Point): + # Edge not reversed for cmd in Path.Geom.cmdsForEdge(edge): + # Add gcode for edge self.appendCommand(cmd, z, relZ, self.horizFeed) last = edge.Vertexes[-1].Point else: + # Edge reversed for cmd in Path.Geom.cmdsForEdge(edge, True): + # Add gcode for reversed edge self.appendCommand(cmd, z, relZ, self.horizFeed) last = edge.Vertexes[0].Point + self.commandlist.append( Path.Command("G0", {"Z": obj.ClearanceHeight.Value, "F": self.vertRapid}) )