From ffa9b78df19931ebb8a561257b552f2be82d14d0 Mon Sep 17 00:00:00 2001 From: Russell Johnson <47639332+Russ4262@users.noreply.github.com> Date: Tue, 1 Dec 2020 09:20:40 -0600 Subject: [PATCH 1/3] Path: Address problem with rounding issue Translate removal shape down into buffer zone to offset rounding issue. --- src/Mod/Path/PathScripts/PathMillFace.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Mod/Path/PathScripts/PathMillFace.py b/src/Mod/Path/PathScripts/PathMillFace.py index 172891a466..45a620dc26 100644 --- a/src/Mod/Path/PathScripts/PathMillFace.py +++ b/src/Mod/Path/PathScripts/PathMillFace.py @@ -203,9 +203,11 @@ class ObjectFace(PathPocketBase.ObjectPocket): plane=planeshape) ofstShape.translate(FreeCAD.Vector(0.0, 0.0, psZMin - ofstShape.BoundBox.ZMin)) - custDepthparams = self._customDepthParams(obj, obj.StartDepth.Value + 0.1, obj.FinalDepth.Value - 0.1) # only an envelope + # Calculate custom depth params for removal shape envelope, with start and final depth buffers + custDepthparams = self._customDepthParams(obj, obj.StartDepth.Value + 0.2, obj.FinalDepth.Value - 0.1) # only an envelope ofstShapeEnv = PathUtils.getEnvelope(partshape=ofstShape, depthparams=custDepthparams) env = ofstShapeEnv.cut(baseShape) + env.translate(FreeCAD.Vector(0.0, 0.0, -0.000001)) # lower removal shape into buffer zone if holeShape: PathLog.debug("Processing holes and face ...") From 361e5edc2965d77992b6c65aafb035ce66496694 Mon Sep 17 00:00:00 2001 From: Russell Johnson <47639332+Russ4262@users.noreply.github.com> Date: Mon, 30 Nov 2020 22:31:59 -0600 Subject: [PATCH 2/3] Path: Instate `obj.removalshape` property for debugging purposes --- src/Mod/Path/PathScripts/PathMillFace.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Mod/Path/PathScripts/PathMillFace.py b/src/Mod/Path/PathScripts/PathMillFace.py index 45a620dc26..0400bd7f31 100644 --- a/src/Mod/Path/PathScripts/PathMillFace.py +++ b/src/Mod/Path/PathScripts/PathMillFace.py @@ -106,6 +106,7 @@ class ObjectFace(PathPocketBase.ObjectPocket): if obj.Base: PathLog.debug("obj.Base: {}".format(obj.Base)) + self.removalshapes = list() faces = [] holes = [] holeEnvs = [] @@ -217,7 +218,11 @@ class ObjectFace(PathPocketBase.ObjectPocket): else: PathLog.debug("Processing solid face ...") tup = env, False, 'pathMillFace', 0.0, 'X', obj.StartDepth.Value, obj.FinalDepth.Value - return [tup] + + self.removalshapes.append(tup) + obj.removalshape = self.removalshapes[0][0] # save removal shape + + return self.removalshapes def areaOpSetDefaultValues(self, obj, job): '''areaOpSetDefaultValues(obj, job) ... initialize mill facing properties''' From 6200f1afc0614323e974df8480424c972b0971a9 Mon Sep 17 00:00:00 2001 From: Russell Johnson <47639332+Russ4262@users.noreply.github.com> Date: Wed, 2 Dec 2020 11:34:49 -0600 Subject: [PATCH 3/3] Path: Swap list instantiation per senior devs specifications --- src/Mod/Path/PathScripts/PathMillFace.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathMillFace.py b/src/Mod/Path/PathScripts/PathMillFace.py index 0400bd7f31..e87a24e80b 100644 --- a/src/Mod/Path/PathScripts/PathMillFace.py +++ b/src/Mod/Path/PathScripts/PathMillFace.py @@ -106,7 +106,7 @@ class ObjectFace(PathPocketBase.ObjectPocket): if obj.Base: PathLog.debug("obj.Base: {}".format(obj.Base)) - self.removalshapes = list() + self.removalshapes = [] faces = [] holes = [] holeEnvs = [] @@ -239,7 +239,7 @@ class ObjectFace(PathPocketBase.ObjectPocket): # If the operation has a geometry identified the Finaldepth # is the top of the boundbox which includes all features. if len(obj.Base) >= 1: - shapes = list() + shapes = [] for base, subs in obj.Base: for s in subs: shapes.append(getattr(base.Shape, s))