From d51608bce59e812ac8b7e2f30eb5d92244f86e01 Mon Sep 17 00:00:00 2001 From: sliptonic Date: Mon, 28 Mar 2022 16:30:41 -0500 Subject: [PATCH] [Path] Fix initial descent at start --- .../Path/PathScripts/PathDressupLeadInOut.py | 54 +++++++++++++------ 1 file changed, 37 insertions(+), 17 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathDressupLeadInOut.py b/src/Mod/Path/PathScripts/PathDressupLeadInOut.py index 0fecc17184..e1076adc22 100644 --- a/src/Mod/Path/PathScripts/PathDressupLeadInOut.py +++ b/src/Mod/Path/PathScripts/PathDressupLeadInOut.py @@ -41,7 +41,7 @@ from PathPythonGui.simple_edit_panel import SimpleEditPanel translate = FreeCAD.Qt.translate -if False: +if True: PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule()) PathLog.trackModule(PathLog.thisModule()) else: @@ -354,6 +354,16 @@ class ObjectDressup: # leadlinevec provides the offset from the beginning of the lead arc to the beginning of the extend line extendstart = leadstart.add(leadlinevec) + # commandname = "G0" if obj.RapidPlunge else "G1" + # extendcommand = Path.Command( + # commandname, + # { + # "X": leadstart.x, + # "Y": leadstart.y, + # "Z": p1.z, + # }, + # ) + # results.append(extendcommand) if action == "start": if obj.ExtendLeadIn != 0: # Rapid move to beginning of extend line @@ -369,7 +379,7 @@ class ObjectDressup: # Rapid move to beginning of leadin arc extendcommand = Path.Command( "G0", - {"X": leadstart.x, "Y": leadstart.y, "Z": op.ClearanceHeight.Value}, + {"X": extendstart.x, "Y": extendstart.y, "Z": op.ClearanceHeight.Value}, ) results.append(extendcommand) extendcommand = Path.Command("G0", {"Z": op.SafeHeight.Value}) @@ -380,23 +390,33 @@ class ObjectDressup: extendcommand = Path.Command("G0", {"Z": op.SafeHeight.Value}) results.append(extendcommand) - extendcommand = Path.Command("G0", {"X": leadstart.x, "Y": leadstart.y}) + extendcommand = Path.Command("G0", {"X": extendstart.x, "Y": extendstart.y}) results.append(extendcommand) - if not obj.RapidPlunge: - extendcommand = Path.Command( - "G1", {"X": leadstart.x, "Y": leadstart.y, "Z": p1.z, "F": vertFeed} - ) - else: - extendcommand = Path.Command( - "G0", - { - "X": leadstart.x, - "Y": leadstart.y, - "Z": p1.z, - }, - ) + commandname = "G0" if obj.RapidPlunge else "G1" + extendcommand = Path.Command( + commandname, + { + # "X": leadstart.x, + # "Y": leadstart.y, + "Z": p1.z, + }, + ) results.append(extendcommand) + # if not obj.RapidPlunge: + # extendcommand = Path.Command( + # "G1", {"X": leadstart.x, "Y": leadstart.y, "Z": p1.z, "F": vertFeed} + # ) + # else: + # extendcommand = Path.Command( + # "G0", + # { + # "X": leadstart.x, + # "Y": leadstart.y, + # "Z": p1.z, + # }, + # ) + # results.append(extendcommand) if obj.UseMachineCRC: if self.getDirectionOfPath(obj) == "right": @@ -602,7 +622,7 @@ class ObjectDressup: newpath.extend(temp) for cmd in layer: - PathLog.debug("CurLoc: {}, NewCmd: {}".format(currLocation, cmd)) + PathLog.debug("CurLoc: {}, NewCmd: {}!!".format(currLocation, cmd)) newpath.append(cmd) if obj.LeadOut: