From 6620e149a576fe412c6f9d794fd0a4c3ebc4a363 Mon Sep 17 00:00:00 2001 From: tarman3 Date: Sun, 18 Jan 2026 21:47:37 +0200 Subject: [PATCH 1/3] CAM: Path.Geom.CmdMoveMill --- src/Mod/CAM/Path/Geom.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Mod/CAM/Path/Geom.py b/src/Mod/CAM/Path/Geom.py index 1887d470fa..9e062e40de 100644 --- a/src/Mod/CAM/Path/Geom.py +++ b/src/Mod/CAM/Path/Geom.py @@ -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 From 97cf5697568f0fa351c6357602d95e017ec1feae Mon Sep 17 00:00:00 2001 From: tarman3 Date: Mon, 19 Jan 2026 07:47:55 +0200 Subject: [PATCH 2/3] CAM: PathScripts/PathUtils.py - Get CmdMove from Geom --- src/Mod/CAM/PathScripts/PathUtils.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/Mod/CAM/PathScripts/PathUtils.py b/src/Mod/CAM/PathScripts/PathUtils.py index 7b7e0db9ff..018bb442b6 100644 --- a/src/Mod/CAM/PathScripts/PathUtils.py +++ b/src/Mod/CAM/PathScripts/PathUtils.py @@ -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) From 4a773d2f6a9bb6916d61f97ca32129c70348a4ce Mon Sep 17 00:00:00 2001 From: tarman3 Date: Mon, 19 Jan 2026 08:03:14 +0200 Subject: [PATCH 3/3] CAM: Refactor CmdMoveMill --- src/Mod/CAM/Constants.py | 3 +++ src/Mod/CAM/Path/Dressup/Gui/RampEntry.py | 2 +- src/Mod/CAM/Path/Dressup/Gui/ZCorrect.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Mod/CAM/Constants.py b/src/Mod/CAM/Constants.py index 894e4daff8..357c494101 100644 --- a/src/Mod/CAM/Constants.py +++ b/src/Mod/CAM/Constants.py @@ -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 diff --git a/src/Mod/CAM/Path/Dressup/Gui/RampEntry.py b/src/Mod/CAM/Path/Dressup/Gui/RampEntry.py index 84d808dab3..b5aacfd694 100644 --- a/src/Mod/CAM/Path/Dressup/Gui/RampEntry.py +++ b/src/Mod/CAM/Path/Dressup/Gui/RampEntry.py @@ -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 diff --git a/src/Mod/CAM/Path/Dressup/Gui/ZCorrect.py b/src/Mod/CAM/Path/Dressup/Gui/ZCorrect.py index 304881c9b8..c0fe6d5c12 100644 --- a/src/Mod/CAM/Path/Dressup/Gui/ZCorrect.py +++ b/src/Mod/CAM/Path/Dressup/Gui/ZCorrect.py @@ -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"],