From c4945970e33b36e1de22099e65ba31456e090a3e Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Fri, 13 Dec 2024 12:17:28 +0500 Subject: [PATCH] test IfcCircle values --- src/ifcopenshell-python/test/geom/geometry_tests.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/ifcopenshell-python/test/geom/geometry_tests.py b/src/ifcopenshell-python/test/geom/geometry_tests.py index 0d77f505ed..249f10e5e6 100644 --- a/src/ifcopenshell-python/test/geom/geometry_tests.py +++ b/src/ifcopenshell-python/test/geom/geometry_tests.py @@ -18,17 +18,23 @@ import ifcopenshell import ifcopenshell.geom +import ifcopenshell.util.shape import test.bootstrap +import numpy as np from ifcopenshell.util.shape_builder import ShapeBuilder, V -class TestCreatingShapes(test.bootstrap.IFC4): +class TestCreatingShapesIfcCurve(test.bootstrap.IFC4): def test_create_IfcCirle(self): builder = ShapeBuilder(self.file) - item = builder.circle(radius=1.0) + radius = 1.0 + item = builder.circle(radius=radius) settings = ifcopenshell.geom.settings() shape = ifcopenshell.geom.create_shape(settings, item) - assert shape.verts + verts = ifcopenshell.util.shape.get_vertices(shape) + assert len(verts) == 72 + distances = np.linalg.norm(verts, axis=1) + assert np.allclose(distances, np.full(len(verts), radius)) def test_create_IfcEllipse(self): builder = ShapeBuilder(self.file)