Path: Fix the rotational LimitDepthToFace feature
This commit is contained in:
@@ -657,14 +657,14 @@ class ObjectPocket(PathPocketBase.ObjectPocket):
|
||||
self.horizontal.append(shape)
|
||||
|
||||
# extrude all faces up to StartDepth and those are the removal shapes
|
||||
sD = obj.StartDepth.Value
|
||||
fD = obj.FinalDepth.Value
|
||||
start_dep = obj.StartDepth.Value
|
||||
clrnc = 0.5
|
||||
for face in self.horizontal:
|
||||
afD = fD
|
||||
adj_final_dep = obj.FinalDepth.Value
|
||||
useAngle = angle
|
||||
shpZMin = face.BoundBox.ZMin
|
||||
PathLog.debug('self.horizontal shpZMin: {}'.format(shpZMin))
|
||||
shpZMinVal = shpZMin
|
||||
PathLog.debug('self.horizontal pre-shpZMin: {}'.format(shpZMin))
|
||||
if self.isFaceUp(subBase, face) is False:
|
||||
useAngle += 180.0
|
||||
invZ = (-2 * shpZMin) - clrnc
|
||||
@@ -672,21 +672,24 @@ class ObjectPocket(PathPocketBase.ObjectPocket):
|
||||
shpZMin = -1 * shpZMin
|
||||
else:
|
||||
face.translate(FreeCAD.Vector(0.0, 0.0, -1 * clrnc))
|
||||
PathLog.debug('self.horizontal post-shpZMin: {}'.format(shpZMin))
|
||||
|
||||
if obj.LimitDepthToFace is True and obj.EnableRotation != 'Off':
|
||||
if shpZMin > obj.FinalDepth.Value:
|
||||
afD = shpZMin
|
||||
if sD <= afD:
|
||||
sD = afD + 1.0
|
||||
if shpZMinVal > obj.FinalDepth.Value:
|
||||
PathLog.debug('shpZMin > obj.FinalDepth.Value')
|
||||
adj_final_dep = shpZMinVal # shpZMin
|
||||
if start_dep <= adj_final_dep:
|
||||
start_dep = adj_final_dep + 1.0
|
||||
msg = translate('PathPocketShape', 'Start Depth is lower than face depth. Setting to ')
|
||||
PathLog.warning(msg + ' {} mm.'.format(sD))
|
||||
PathLog.warning(msg + ' {} mm.'.format(start_dep))
|
||||
PathLog.debug('LimitDepthToFace adj_final_dep: {}'.format(adj_final_dep))
|
||||
else:
|
||||
face.translate(FreeCAD.Vector(0, 0, obj.FinalDepth.Value - shpZMin))
|
||||
|
||||
extent = FreeCAD.Vector(0, 0, sD - afD + clrnc)
|
||||
extent = FreeCAD.Vector(0, 0, start_dep - shpZMin + clrnc) # adj_final_dep + clrnc)
|
||||
extShp = face.removeSplitter().extrude(extent)
|
||||
self.removalshapes.append((extShp, False, 'pathPocketShape', useAngle, axis, sD, afD))
|
||||
PathLog.debug("Extent values are strDep: {}, finDep: {}, extrd: {}".format(sD, afD, extent))
|
||||
self.removalshapes.append((extShp, False, 'pathPocketShape', useAngle, axis, start_dep, adj_final_dep))
|
||||
PathLog.debug("Extent values are strDep: {}, finDep: {}, extrd: {}".format(start_dep, adj_final_dep, extent))
|
||||
# Efor face
|
||||
# Efor
|
||||
|
||||
|
||||
Reference in New Issue
Block a user