From 5b315bfa8fc474bd354392ef497ea8c10e067605 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Thu, 19 Dec 2024 15:45:17 +0500 Subject: [PATCH] shape_builder - add test for mirror --- src/ifcopenshell-python/test/util/test_shape_builder.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ifcopenshell-python/test/util/test_shape_builder.py b/src/ifcopenshell-python/test/util/test_shape_builder.py index ba17a28296..650311565b 100644 --- a/src/ifcopenshell-python/test/util/test_shape_builder.py +++ b/src/ifcopenshell-python/test/util/test_shape_builder.py @@ -123,6 +123,15 @@ class TestCreatePolyline(test.bootstrap.IFC4): assert segment.wrappedValue == (2, 3, 1) +class TestMirror(test.bootstrap.IFC4): + def test_mirror(self): + builder = ShapeBuilder(self.file) + rectangle = builder.rectangle(size=(100, 100)) + assert np.allclose(rectangle.Points.CoordList, ((0.0, 0.0), (100.0, 0.0), (100.0, 100.0), (0.0, 100.0))) + builder.mirror(rectangle, mirror_axes=(1, 0)) + assert np.allclose(rectangle.Points.CoordList, ((0.0, 0.0), (-100.0, 0.0), (-100.0, 100.0), (0.0, 100.0))) + + class TestCalculateTransitions(test.bootstrap.IFC4): def calculate_and_test(self, params: dict[str, Any], length: Union[float, None]): np_X, np_Y = 0, 1