diff --git a/src/Mod/Path/PathScripts/PathContour.py b/src/Mod/Path/PathScripts/PathContour.py index 5e6820e1f6..8c201a00dd 100644 --- a/src/Mod/Path/PathScripts/PathContour.py +++ b/src/Mod/Path/PathScripts/PathContour.py @@ -262,6 +262,9 @@ class ObjectContour: FreeCAD.Console.PrintError(e) FreeCAD.Console.PrintError("Something unexpected happened. Unable to generate a contour path. Check project and tool config.") + # Let's finish by rapid to clearance...just for safety + commandlist.append(Path.Command("G0", {"Z": obj.ClearanceHeight.Value})) + path = Path.Path(commandlist) obj.Path = path obj.ViewObject.Visibility = True diff --git a/src/Mod/Path/PathScripts/PathMillFace.py b/src/Mod/Path/PathScripts/PathMillFace.py index 963e807c4b..6bf02ea673 100644 --- a/src/Mod/Path/PathScripts/PathMillFace.py +++ b/src/Mod/Path/PathScripts/PathMillFace.py @@ -287,6 +287,9 @@ class ObjectFace: planeshape = baseobject.Shape PathLog.info("Working on a shape {}".format(baseobject.Name)) + # Let's start by rapid to clearance...just for safety + commandlist.append(Path.Command("G0", {"Z": obj.ClearanceHeight.Value})) + # if user wants the boundbox, calculate that PathLog.info("Boundary Shape: {}".format(obj.BoundaryShape)) bb = planeshape.BoundBox @@ -302,6 +305,9 @@ class ObjectFace: FreeCAD.Console.PrintError(e) FreeCAD.Console.PrintError(translate("Path_MillFace", "The selected settings did not produce a valid path.\n")) + # Let's finish by rapid to clearance...just for safety + commandlist.append(Path.Command("G0", {"Z": obj.ClearanceHeight.Value})) + path = Path.Path(commandlist) obj.Path = path obj.ViewObject.Visibility = True diff --git a/src/Mod/Path/PathScripts/PathPocket.py b/src/Mod/Path/PathScripts/PathPocket.py index c0d75b5962..37253e71f0 100644 --- a/src/Mod/Path/PathScripts/PathPocket.py +++ b/src/Mod/Path/PathScripts/PathPocket.py @@ -280,6 +280,9 @@ class ObjectPocket: FreeCAD.Console.PrintError(e) FreeCAD.Console.PrintError("Something unexpected happened. Unable to generate a pocket path. Check project and tool config.") + # Let's finish by rapid to clearance...just for safety + commandlist.append(Path.Command("G0", {"Z": obj.ClearanceHeight.Value})) + path = Path.Path(commandlist) obj.Path = path obj.ViewObject.Visibility = True diff --git a/src/Mod/Path/PathScripts/PathProfile.py b/src/Mod/Path/PathScripts/PathProfile.py index 318b19e90f..eea9e7c8a6 100644 --- a/src/Mod/Path/PathScripts/PathProfile.py +++ b/src/Mod/Path/PathScripts/PathProfile.py @@ -169,7 +169,7 @@ class ObjectProfile: profile.setParams(**profileparams) obj.AreaParams = str(profile.getParams()) - + # PathLog.debug("About to profile with params: {}".format(profileparams)) PathLog.debug("About to profile with params: {}".format(profile.getParams())) @@ -316,6 +316,9 @@ class ObjectProfile: FreeCAD.Console.PrintError(e) FreeCAD.Console.PrintError("Something unexpected happened. Unable to generate a contour path. Check project and tool config.") + # Let's finish by rapid to clearance...just for safety + commandlist.append(Path.Command("G0", {"Z": obj.ClearanceHeight.Value})) + path = Path.Path(commandlist) obj.Path = path obj.ViewObject.Visibility = True diff --git a/src/Mod/Path/PathScripts/PathProfileEdges.py b/src/Mod/Path/PathScripts/PathProfileEdges.py index 9731de825d..dc054ed30d 100644 --- a/src/Mod/Path/PathScripts/PathProfileEdges.py +++ b/src/Mod/Path/PathScripts/PathProfileEdges.py @@ -285,6 +285,9 @@ class ObjectProfile: FreeCAD.Console.PrintError(e) FreeCAD.Console.PrintError("Something unexpected happened. Unable to generate a contour path. Check project and tool config.") + # Let's finish by rapid to clearance...just for safety + commandlist.append(Path.Command("G0", {"Z": obj.ClearanceHeight.Value})) + path = Path.Path(commandlist) obj.Path = path obj.ViewObject.Visibility = True diff --git a/src/Mod/Path/PathTests/test_linuxcnc_00.ngc b/src/Mod/Path/PathTests/test_linuxcnc_00.ngc index eaacef64f7..3fb2a21c47 100644 --- a/src/Mod/Path/PathTests/test_linuxcnc_00.ngc +++ b/src/Mod/Path/PathTests/test_linuxcnc_00.ngc @@ -64,6 +64,7 @@ G1 X10.00 Y0.00 Z0.00 G1 X0.00 Y0.00 Z0.00 G1 X0.00 Y10.00 Z0.00 G1 X10.00 Y10.00 Z0.00 +G0 Z15.00 M05 G00 X-1.0 Y1.0 G17 G90