From 9cbed30c76ac2fed60a6e74b85ad1c900b4df24d Mon Sep 17 00:00:00 2001 From: Russell Johnson <47639332+Russ4262@users.noreply.github.com> Date: Mon, 27 Sep 2021 20:47:46 -0500 Subject: [PATCH] Path: Restore removal shape envelope buffer This buffer application was removed in PR #4978 with removal of rotational code. The buffer is required to provided adequate significant digit or rounding in later processing of envelope in Path.Area(). NOTE: I suggest separate `removalshape` envelopes be created without the necessary `buffer` adjustment to allow for usage of the `removalshape` for subsequent REST type operations. --- src/Mod/Path/PathScripts/PathPocketShape.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathPocketShape.py b/src/Mod/Path/PathScripts/PathPocketShape.py index c57778be53..169541f116 100644 --- a/src/Mod/Path/PathScripts/PathPocketShape.py +++ b/src/Mod/Path/PathScripts/PathPocketShape.py @@ -138,12 +138,17 @@ class ObjectPocket(PathPocketBase.ObjectPocket): # check all faces and see if they are touching/overlapping and combine and simplify self.horizontal = PathGeom.combineHorizontalFaces(self.horiz) - # Move all faces to final depth before extrusion + # Move all faces to final depth less buffer before extrusion + # Small negative buffer is applied to compensate for internal significant digits/rounding issue + if self.job.GeometryTolerance.Value == 0.0: + buffer = 0.000001 + else: + buffer = self.job.GeometryTolerance.Value / 10.0 for h in self.horizontal: - h.translate(FreeCAD.Vector(0.0, 0.0, obj.FinalDepth.Value - h.BoundBox.ZMin)) + h.translate(FreeCAD.Vector(0.0, 0.0, obj.FinalDepth.Value - h.BoundBox.ZMin - buffer)) - # extrude all faces up to StartDepth and those are the removal shapes - extent = FreeCAD.Vector(0, 0, obj.StartDepth.Value - obj.FinalDepth.Value) + # extrude all faces up to StartDepth plus buffer and those are the removal shapes + extent = FreeCAD.Vector(0, 0, obj.StartDepth.Value - obj.FinalDepth.Value + buffer) self.removalshapes = [(face.removeSplitter().extrude(extent), False) for face in self.horizontal] else: # process the job base object as a whole