From 326d1eb70b7c8582bd7a41b8f0dd5cbc8a516d91 Mon Sep 17 00:00:00 2001 From: Roy-043 Date: Sun, 12 Jan 2025 18:12:34 +0100 Subject: [PATCH] BIM: improve roof getSubVolume function Fixes #19013. * Check direction of plane axis with a tolerance. * Check the produced solids. Notably check for a min. volume. Required for solids created from non-planar faces. * Apply placement to created compound. --- src/Mod/BIM/ArchRoof.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Mod/BIM/ArchRoof.py b/src/Mod/BIM/ArchRoof.py index 022b886e85..a5392ec381 100644 --- a/src/Mod/BIM/ArchRoof.py +++ b/src/Mod/BIM/ArchRoof.py @@ -755,7 +755,7 @@ class _Roof(ArchComponent.Component): for f in obj.Base.Shape.Faces: # obj.Base.Shape.Solids.Faces p = f.findPlane() # Curve face (surface) seems return no Plane if p: - if p.Axis[2] < 0: # z<0, i.e. normal pointing below horizon + if p.Axis[2] < -1e-7: # i.e. normal pointing below horizon faces.append(f) else: # Not sure if it is pointing towards and/or above horizon @@ -768,8 +768,10 @@ class _Roof(ArchComponent.Component): for f in faces: solid = f.extrude(Vector(0.0, 0.0, 1000000.0)) - solids.append(solid) + if not solid.isNull() and solid.isValid() and solid.Volume > 1e-3: + solids.append(solid) compound = Part.Compound(solids) + compound.Placement = obj.Placement return compound sub_field = getattr(self, 'sub', None)