Path: fix potential crash bug.

This commit is contained in:
sliptonic
2017-06-16 09:00:20 -05:00
committed by wmayer
parent a42391fa3b
commit 5305247140
6 changed files with 20 additions and 1 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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