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.
This commit is contained in:
Russell Johnson
2021-09-27 20:47:46 -05:00
parent 3bb37bd471
commit 9cbed30c76

View File

@@ -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