From 343589f1c0e1beed3ff408e8cb5db0335a999030 Mon Sep 17 00:00:00 2001 From: Bruno Postle Date: Tue, 12 Dec 2023 22:15:59 +0000 Subject: [PATCH] Fix Clipping divide error (reported in #4057) --- src/ifcopenshell-python/ifcopenshell/util/data.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ifcopenshell-python/ifcopenshell/util/data.py b/src/ifcopenshell-python/ifcopenshell/util/data.py index 3c1e2c1669..a66ea80252 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/data.py +++ b/src/ifcopenshell-python/ifcopenshell/util/data.py @@ -78,7 +78,9 @@ class Clipping: direction = ifc_file.createIfcDirection(self.normal) normal = np.array(self.normal) - if np.allclose(normal, np.array([0.0, 0.0, 1.0]), atol=1e-2): + if np.allclose(normal, np.array([0.0, 0.0, 1.0]), atol=1e-2) or np.allclose( + normal, np.array([0.0, 0.0, -1.0]), atol=1e-2 + ): arbitrary_vector = np.array([0.0, 1.0, 0.0]) else: arbitrary_vector = np.array([0.0, 0.0, 1.0])