Restore manual override of FinalDepth values

Manual entries of FinalDepth values are now respected, even if below the calculated bottom of selected geometry.
Affected modules include PathPocketShape, PathPocket, PathCircularHoleBase, and PathAreaOp-based operations.

Fix format syntax issues
This commit is contained in:
Russell Johnson
2020-02-13 17:30:20 -06:00
parent 27771fc6ee
commit 6af211fbd5
4 changed files with 960 additions and 1036 deletions

View File

@@ -37,11 +37,11 @@ __url__ = "http://www.freecadweb.org"
__doc__ = "Class and implementation of the 3D Pocket operation."
__contributors__ = "russ4262 (Russell Johnson)"
__created__ = "2014"
__scriptVersion__ = "2g testing"
__lastModified__ = "2019-07-20 22:02 CST"
__scriptVersion__ = "2e"
__lastModified__ = "2020-02-13 17:22 CST"
PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule())
#PathLog.trackModule(PathLog.thisModule())
# PathLog.trackModule(PathLog.thisModule())
# Qt translation handling
@@ -102,8 +102,11 @@ class ObjectPocket(PathPocketBase.ObjectPocket):
allSubsFaceType = False
if allSubsFaceType is True and obj.HandleMultipleFeatures == 'Collectively':
(fzmin, fzmax) = self.getMinMaxOfFaces(Faces)
if obj.FinalDepth.Value < fzmin:
PathLog.warning(translate('PathPocket', 'Final depth set below ZMin of face(s) selected.'))
'''
if obj.OpFinalDepth == obj.FinalDepth:
(fzmin, fzmax) = self.getMinMaxOfFaces(Faces)
obj.FinalDepth.Value = fzmin
finish_step = obj.FinishDepth.Value if hasattr(obj, "FinishDepth") else 0.0
self.depthparams = PathUtils.depth_params(
@@ -115,6 +118,7 @@ class ObjectPocket(PathPocketBase.ObjectPocket):
final_depth=fzmin,
user_depths=None)
PathLog.info("Updated obj.FinalDepth.Value and self.depthparams to zmin: {}".format(fzmin))
'''
if obj.AdaptivePocketStart is True or obj.AdaptivePocketFinish is True:
pocketTup = self.calculateAdaptivePocket(obj, base, subObjTups)
@@ -148,8 +152,9 @@ class ObjectPocket(PathPocketBase.ObjectPocket):
PathLog.debug("processing the whole job base object")
strDep = obj.StartDepth.Value
finDep = obj.FinalDepth.Value
recomputeDepthparams = False
# recomputeDepthparams = False
for base in self.model:
'''
if obj.OpFinalDepth == obj.FinalDepth:
if base.Shape.BoundBox.ZMin < obj.FinalDepth.Value:
obj.FinalDepth.Value = base.Shape.BoundBox.ZMin
@@ -173,11 +178,13 @@ class ObjectPocket(PathPocketBase.ObjectPocket):
final_depth=obj.FinalDepth.Value,
user_depths=None)
recomputeDepthparams = False
'''
if obj.ProcessStockArea is True:
job = PathUtils.findParentJob(obj)
finish_step = obj.FinishDepth.Value if hasattr(obj, "FinishDepth") else 0.0
'''
finish_step = obj.FinishDepth.Value if hasattr(obj, "FinishDepth") else 0.0
depthparams = PathUtils.depth_params(
clearance_height=obj.ClearanceHeight.Value,
safe_height=obj.SafeHeight.Value,
@@ -187,6 +194,8 @@ class ObjectPocket(PathPocketBase.ObjectPocket):
final_depth=base.Shape.BoundBox.ZMin,
user_depths=None)
stockEnvShape = PathUtils.getEnvelope(job.Stock.Shape, subshape=None, depthparams=depthparams)
'''
stockEnvShape = PathUtils.getEnvelope(job.Stock.Shape, subshape=None, depthparams=self.depthparams)
obj.removalshape = stockEnvShape.cut(base.Shape)
obj.removalshape.tessellate(0.1)
@@ -225,7 +234,6 @@ class ObjectPocket(PathPocketBase.ObjectPocket):
tryNonPlanar = False
isHighFacePlanar = True
isLowFacePlanar = True
faceType = 0
for (sub, face) in subObjTups:
Faces.append(face)