From 135ede46fe266b3231a504119b01232ef8c323a3 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Wed, 20 Jun 2018 21:19:23 -0700 Subject: [PATCH] Get the outline of the syntesized shape for PocketShape before extruding. This greatly improves the robustness of the algorithm and gives PathArea less chances to mess it up. --- src/Mod/Path/PathScripts/PathPocketShape.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathPocketShape.py b/src/Mod/Path/PathScripts/PathPocketShape.py index 5a8efb0a65..2f263ed6f1 100644 --- a/src/Mod/Path/PathScripts/PathPocketShape.py +++ b/src/Mod/Path/PathScripts/PathPocketShape.py @@ -110,10 +110,13 @@ class ObjectPocket(PathPocketBase.ObjectPocket): f.translate(FreeCAD.Vector(0, 0, obj.FinalDepth.Value - f.BoundBox.ZMin)) # check all faces and see if they are touching/overlapping and combine those into a compound - self.horizontal = PathGeom.combineConnectedShapes(self.horiz) - for shape in self.horizontal: + self.horizontal = [] + for shape in PathGeom.combineConnectedShapes(self.horiz): shape.sewShape() shape.tessellate(0.1) + wire = TechDraw.findShapeOutline(shape, 1, FreeCAD.Vector(0, 0, 1)) + wire.translate(FreeCAD.Vector(0, 0, obj.FinalDepth.Value - wire.BoundBox.ZMin)) + self.horizontal.append(Part.Face(wire)) # extrude all faces up to StartDepth and those are the removal shapes extent = FreeCAD.Vector(0, 0, obj.StartDepth.Value - obj.FinalDepth.Value)