From 069768669562b0b033a603ed6eca282ab933d693 Mon Sep 17 00:00:00 2001 From: Russell Johnson <47639332+Russ4262@users.noreply.github.com> Date: Sun, 2 Aug 2020 13:16:21 -0500 Subject: [PATCH] Path: PocketShape - Fixes ticket #4411 Existing code to determine if shape volume indeed existed, failed. Added additional pre-check for existing edges in shape to determine if shape geometry indeed exists. In forum: [Ticket #4411 - Can only generate pocket once for this shape, then it fails.](https://forum.freecadweb.org/viewtopic.php?style=3&f=15&t=49035). --- src/Mod/Path/PathScripts/PathAreaOp.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathAreaOp.py b/src/Mod/Path/PathScripts/PathAreaOp.py index 067845c51d..0547f3ddcd 100644 --- a/src/Mod/Path/PathScripts/PathAreaOp.py +++ b/src/Mod/Path/PathScripts/PathAreaOp.py @@ -991,11 +991,13 @@ class ObjectOp(PathOp.ObjectOp): dwn = face.extrude(FreeCAD.Vector(0.0, 0.0, -5.0)) upCmn = base.Shape.common(up) dwnCmn = base.Shape.common(dwn) - if upCmn.Volume == 0.0: + # Identify orientation based on volumes of common() results + if len(upCmn.Edges) > 0 and round(upCmn.Volume, 6) == 0.0: return True - elif dwnCmn.Volume == 0.0: + elif len(dwnCmn.Edges) > 0 and round(dwnCmn.Volume, 6) == 0.0: return False - if dwnCmn.Volume > upCmn.Volume: + if (len(upCmn.Edges) > 0 and len(dwnCmn.Edges) > 0 and + round(dwnCmn.Volume, 6) > round(upCmn.Volume, 6)): return True return False