Merge pull request #27013 from tarman3/CmdMoveMill

CAM: Path.Geom.CmdMoveMill
This commit is contained in:
sliptonic
2026-02-25 18:31:26 -06:00
committed by GitHub
5 changed files with 8 additions and 12 deletions
+3
View File
@@ -31,6 +31,9 @@ GCODE_MOVE_ARC = GCODE_MOVE_CW + GCODE_MOVE_CCW
# Canned drilling cycles
GCODE_MOVE_DRILL = ["G73", "G81", "G82", "G83", "G85"]
# Cutting moves (feed moves and arcs)
GCODE_MOVE_MILL = GCODE_MOVE_STRAIGHT + GCODE_MOVE_ARC
# All cutting moves (feed moves, arcs, and drill cycles)
GCODE_MOVE = GCODE_MOVE_STRAIGHT + GCODE_MOVE_ARC + GCODE_MOVE_DRILL
+1 -1
View File
@@ -672,7 +672,7 @@ class ObjectDressup:
z = z and round(z, 8)
if cmd.Name in ["G1", "G2", "G3", "G01", "G02", "G03"]:
if cmd.Name in Path.Geom.CmdMoveMill:
if lastZ != z:
if Path.Geom.isRoughly(x, lastX) and Path.Geom.isRoughly(y, lastY):
params["F"] = vertFeed
+1 -1
View File
@@ -174,7 +174,7 @@ class ObjectDressup:
Path.Log.debug(" curLoc:{}".format(currLocation))
newparams = dict(c.Parameters)
zval = newparams.get("Z", currLocation["Z"])
if c.Name in Path.Geom.CmdMoveStraight + Path.Geom.CmdMoveArc:
if c.Name in Path.Geom.CmdMoveMill:
curVec = FreeCAD.Vector(
currLocation["X"],
currLocation["Y"],
+1
View File
@@ -90,6 +90,7 @@ CmdMoveCW = Constants.GCODE_MOVE_CW
CmdMoveCCW = Constants.GCODE_MOVE_CCW
CmdMoveDrill = Constants.GCODE_MOVE_DRILL
CmdMoveArc = Constants.GCODE_MOVE_ARC
CmdMoveMill = Constants.GCODE_MOVE_MILL
CmdMove = Constants.GCODE_MOVE
CmdMoveAll = Constants.GCODE_MOVE_ALL
+2 -10
View File
@@ -1024,14 +1024,6 @@ def applyPlacementToPath(placement, path):
Applies the rotation, and then position of the placement to path
"""
CmdMoveRapid = ["G0", "G00"]
CmdMoveStraight = ["G1", "G01"]
CmdMoveCW = ["G2", "G02"]
CmdMoveCCW = ["G3", "G03"]
CmdDrill = ["G73", "G81", "G82", "G83"]
CmdMoveArc = CmdMoveCW + CmdMoveCCW
CmdMove = CmdMoveStraight + CmdMoveArc
commands = []
currX = 0
currY = 0
@@ -1046,7 +1038,7 @@ def applyPlacementToPath(placement, path):
transC0 = tparams.get("C", 0)
for cmd in path.Commands:
if (cmd.Name in CmdMoveRapid) or (cmd.Name in CmdMove) or (cmd.Name in CmdDrill):
if cmd.Name in Path.Geom.CmdMoveAll:
params = cmd.Parameters
currX = x = params.get("X", currX)
currY = y = params.get("Y", currY)
@@ -1062,7 +1054,7 @@ def applyPlacementToPath(placement, path):
params.update({"Z": z})
# Arcs need to have the I and J params rotated as well
if cmd.Name in CmdMoveArc:
if cmd.Name in Path.Geom.CmdMoveArc:
currI = i = params.get("I", 0)
currJ = j = params.get("J", 0)