From 1f0bda27f6533494312dbbfec42ff52fbeb55019 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Sat, 1 Sep 2018 16:49:48 -0700 Subject: [PATCH] New approach to determine if an object is a solid - based on it's volume. --- src/Mod/Path/PathScripts/PathUtil.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathUtil.py b/src/Mod/Path/PathScripts/PathUtil.py index 3dd46d3bb1..e73d92d1ce 100644 --- a/src/Mod/Path/PathScripts/PathUtil.py +++ b/src/Mod/Path/PathScripts/PathUtil.py @@ -59,11 +59,8 @@ def isSolid(obj): if hasattr(obj, 'Tip'): return isSolid(obj.Tip) if hasattr(obj, 'Shape'): - if obj.Shape.ShapeType == 'Solid' and obj.Shape.isClosed(): + if obj.Shape.Volume > 0.0 and obj.Shape.isClosed(): return True - if obj.Shape.ShapeType == 'Compound': - if hasattr(obj, 'Base') and hasattr(obj, 'Tool'): - return isSolid(obj.Base) and isSolid(obj.Tool) if hasattr(obj, 'TypeId') and 'App::Part' == obj.TypeId: if not obj.Group or any(hasattr(o, 'Shape') and not isSolid(o) for o in obj.Group): return False