Merge pull request #21732 from tarman3/engrave

CAM: Engrave - Fix step down for closed profile
This commit is contained in:
sliptonic
2025-06-24 12:49:05 -05:00
committed by GitHub

View File

@@ -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})
)