Path: make pathmillface use different depth calculation

This commit is contained in:
sliptonic
2017-06-28 10:59:10 -05:00
committed by wmayer
parent 75dc43f047
commit bcfc1bf36c
2 changed files with 44 additions and 10 deletions

View File

@@ -699,6 +699,37 @@ def sort_jobs(locations, keys, attractors=[]):
return out
def guessDepths(objshape, subs=None):
"""
takes an object shape and optional list of subobjects and returns a depth_params
object with suggested height/depth values.
objshape = Part::Shape.
subs = list of subobjects from objshape
"""
bb = objshape.BoundBox # parent boundbox
clearance = bb.ZMax + 5.0
safe = bb.ZMax
start = bb.ZMax
final = bb.ZMin
if subs is not None:
subobj = Part.makeCompound(subs)
fbb = subobj.BoundBox # feature boundbox
start = fbb.ZMax
if fbb.ZMax == fbb.ZMin and fbb.ZMax == bb.ZMax: # top face
final = fbb.ZMin
elif fbb.ZMax > fbb.ZMin and fbb.ZMax == bb.ZMax: # vertical face, full cut
final = fbb.ZMin
elif fbb.ZMax > fbb.ZMin and fbb.ZMin > bb.ZMin: # internal vertical wall
final = fbb.ZMin
elif fbb.ZMax == fbb.ZMin and fbb.ZMax > bb.ZMin: # face/shelf
final = fbb.ZMin
return depth_params(clearance, safe, start, 1.0, 0.0, final, user_depths=None, equalstep=False)
class depth_params:
'''calculates the intermediate depth values for various operations given the starting, ending, and stepdown parameters