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).
This commit is contained in:
Russell Johnson
2020-08-02 13:16:21 -05:00
parent ed4876abb4
commit 0697686695

View File

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