From 5883bad32b30807f0596a1a80a97716eebbe236c Mon Sep 17 00:00:00 2001 From: Dimitris75 <30848292+Dimitris75@users.noreply.github.com> Date: Wed, 31 Dec 2025 04:29:42 +0200 Subject: [PATCH 1/2] Fix 3D Surface Rotational Scan Retract to Clearance Height Before Transition Between Passes --- src/Mod/CAM/Path/Op/Surface.py | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/src/Mod/CAM/Path/Op/Surface.py b/src/Mod/CAM/Path/Op/Surface.py index 98563e394f..ae4750a044 100644 --- a/src/Mod/CAM/Path/Op/Surface.py +++ b/src/Mod/CAM/Path/Op/Surface.py @@ -2195,8 +2195,7 @@ class ObjectSurface(PathOp.ObjectOp): rSTG = self._rotationalScanToGcode(obj, rng, rNum, prevDepth, layDep, advances) commands.extend(rSTG) if arc != 360.0: - clrZ = self.layerEndzMax + self.SafeHeightOffset - commands.append(Path.Command("G0", {"Z": clrZ, "F": self.vertRapid})) + commands.append(Path.Command("G0", {"Z": self.clearHeight, "F": self.vertRapid})) rNum += 1 # Eol @@ -2314,19 +2313,15 @@ class ObjectSurface(PathOp.ObjectOp): # Create first point pnt = CLP[0] + # Always retract to full clearHeight before any A/B axis rotation + output.append(Path.Command("G0", {"Z": self.clearHeight, "F": self.vertRapid})) + # Rotate to correct index location if obj.RotationAxis == "X": output.append(Path.Command("G0", {"A": idxAng, "F": self.axialFeed})) else: output.append(Path.Command("G0", {"B": idxAng, "F": self.axialFeed})) - - if li > 0: - if pnt.z > self.layerEndPnt.z: - clrZ = pnt.z + 2.0 - output.append(Path.Command("G1", {"Z": clrZ, "F": self.vertRapid})) - else: - output.append(Path.Command("G0", {"Z": self.clearHeight, "F": self.vertRapid})) - + output.append(Path.Command("G0", {"X": pnt.x, "Y": pnt.y, "F": self.horizRapid})) output.append(Path.Command("G1", {"Z": pnt.z, "F": self.vertFeed})) @@ -2424,12 +2419,7 @@ class ObjectSurface(PathOp.ObjectOp): # Adjust feed rate based on radius/circumference of cutter. # Original feed rate based on travel at circumference. - if rN > 0: - if pnt.z >= self.layerEndzMax - FLOAT_EPSILON: - clrZ = pnt.z + 5.0 - output.append(Path.Command("G1", {"Z": clrZ, "F": self.vertRapid})) - else: - output.append(Path.Command("G1", {"Z": self.clearHeight, "F": self.vertRapid})) + output.append(Path.Command("G1", {"Z": self.clearHeight, "F": self.vertRapid})) output.append(Path.Command("G0", {axisOfRot: ang, "F": self.axialFeed})) output.append(Path.Command("G1", {"X": pnt.x, "Y": pnt.y, "F": self.axialFeed})) From 61e053ffb98a7ea38e74c7966ae217ed779dd069 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 31 Dec 2025 02:39:54 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/Mod/CAM/Path/Op/Surface.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Mod/CAM/Path/Op/Surface.py b/src/Mod/CAM/Path/Op/Surface.py index ae4750a044..603309cd5e 100644 --- a/src/Mod/CAM/Path/Op/Surface.py +++ b/src/Mod/CAM/Path/Op/Surface.py @@ -2195,7 +2195,9 @@ class ObjectSurface(PathOp.ObjectOp): rSTG = self._rotationalScanToGcode(obj, rng, rNum, prevDepth, layDep, advances) commands.extend(rSTG) if arc != 360.0: - commands.append(Path.Command("G0", {"Z": self.clearHeight, "F": self.vertRapid})) + commands.append( + Path.Command("G0", {"Z": self.clearHeight, "F": self.vertRapid}) + ) rNum += 1 # Eol @@ -2315,13 +2317,13 @@ class ObjectSurface(PathOp.ObjectOp): # Always retract to full clearHeight before any A/B axis rotation output.append(Path.Command("G0", {"Z": self.clearHeight, "F": self.vertRapid})) - + # Rotate to correct index location if obj.RotationAxis == "X": output.append(Path.Command("G0", {"A": idxAng, "F": self.axialFeed})) else: output.append(Path.Command("G0", {"B": idxAng, "F": self.axialFeed})) - + output.append(Path.Command("G0", {"X": pnt.x, "Y": pnt.y, "F": self.horizRapid})) output.append(Path.Command("G1", {"Z": pnt.z, "F": self.vertFeed}))