From 69da1439af06657165aa566c2dc8688146098574 Mon Sep 17 00:00:00 2001 From: Russell Johnson <47639332+Russ4262@users.noreply.github.com> Date: Mon, 25 Apr 2022 21:50:10 -0500 Subject: [PATCH] Path: Fixes #6775 - Check for end of range Change transition target point to last point at Safe Height if no more parts are available for processing. --- src/Mod/Path/PathScripts/PathSurface.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathSurface.py b/src/Mod/Path/PathScripts/PathSurface.py index 70a040bec8..7b1daa0088 100644 --- a/src/Mod/Path/PathScripts/PathSurface.py +++ b/src/Mod/Path/PathScripts/PathSurface.py @@ -1580,9 +1580,15 @@ class ObjectSurface(PathOp.ObjectOp): for i in range(0, lenAdjPrts): prt = ADJPRTS[i] lenPrt = len(prt) - if prt == "BRK" and prtsHasCmds is True: - nxtStart = ADJPRTS[i + 1][0] - prtsCmds.append(Path.Command("N (--Break)", {})) + if prt == "BRK" and prtsHasCmds: + if i + 1 < lenAdjPrts: + nxtStart = ADJPRTS[i + 1][0] + prtsCmds.append(Path.Command("N (--Break)", {})) + else: + # Transition straight up to Safe Height if no more parts + nxtStart = FreeCAD.Vector( + last.x, last.y, obj.SafeHeight.Value + ) prtsCmds.extend( self._stepTransitionCmds( obj, last, nxtStart, safePDC, tolrnc @@ -2097,7 +2103,7 @@ class ObjectSurface(PathOp.ObjectOp): hlim = bb.XMax # Compute max radius of stock, as it rotates, and rotational clearance & safe heights - self.bbRadius = math.sqrt(hlim**2 + vlim**2) + self.bbRadius = math.sqrt(hlim ** 2 + vlim ** 2) self.clearHeight = self.bbRadius + JOB.SetupSheet.ClearanceHeightOffset.Value self.safeHeight = self.bbRadius + JOB.SetupSheet.ClearanceHeightOffset.Value