Fixed pocket depth calculation in case no base object is specified.

This commit is contained in:
Markus Lampert
2017-09-18 01:11:24 -07:00
parent 55766140c4
commit 2eee30edd5

View File

@@ -147,6 +147,11 @@ class ObjectPocket(PathPocketBase.ObjectPocket):
'''areaOpSetDefaultValues(obj) ... set default values'''
obj.StepOver = 100
obj.ZigZagAngle = 45
job = PathUtils.findParentJob(obj)
if job and job.Stock:
bb = job.Stock.Shape.BoundBox
obj.FinalDepth = bb.ZMin
obj.StartDepth = bb.ZMax
def areaOpOnChanged(self, obj, prop):
if 'Base' == prop and obj.Base and not 'Restore' in obj.State:
@@ -186,6 +191,13 @@ class ObjectPocket(PathPocketBase.ObjectPocket):
if not PathGeom.isRoughly(safe, obj.SafeHeight.Value):
obj.SafeHeight = safe
if prop in ['Base', 'Stock'] and not obj.Base and not 'Restore' in obj.State:
job = PathUtils.findParentJob(obj)
if job and job.Stock:
bb = job.Stock.Shape.BoundBox
obj.FinalDepth = bb.ZMin
obj.StartDepth = bb.ZMax
def Create(name):
'''Create(name) ... Creates and returns a Pocket operation.'''