From ad8131114dbfcf1bb0faeaf4029f8d17c9b146f6 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Wed, 11 Sep 2024 15:08:18 +0500 Subject: [PATCH] IfcLine, IfcBSplineCurve geometry tests --- .../test/geom/geometry_tests.py | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/ifcopenshell-python/test/geom/geometry_tests.py b/src/ifcopenshell-python/test/geom/geometry_tests.py index 92a8f14da6..c7163df73f 100644 --- a/src/ifcopenshell-python/test/geom/geometry_tests.py +++ b/src/ifcopenshell-python/test/geom/geometry_tests.py @@ -38,3 +38,27 @@ class TestCreatingShapes(test.bootstrap.IFC4): settings = ifcopenshell.geom.settings() shape = ifcopenshell.geom.create_shape(settings, item) assert shape.verts + + def test_create_IfcLine(self): + item = self.file.create_entity( + "IfcLine", + Pnt=self.file.create_entity("IfcCartesianPoint", (0.0, 0.0)), + Dir=self.file.create_entity( + "IfcVector", Orientation=self.file.create_entity("IfcDirection", (1.0, 0.0)), Magnitude=1.0 + ), + ) + settings = ifcopenshell.geom.settings() + shape = ifcopenshell.geom.create_shape(settings, item) + assert shape.verts + + def test_create_IfcBSplineCurve(self): + item = item = self.file.create_entity( + "IfcBSplineCurveWithKnots", + Degree=3, + ControlPointsList=[self.file.create_entity("IfcCartesianPoint", p) for p in points], + KnotMultiplicities=(4, 1, 1, 4), + Knots=(0.0, 1 / 3, 2 / 3, 1.0), + ) + settings = ifcopenshell.geom.settings() + shape = ifcopenshell.geom.create_shape(settings, item) + assert shape.verts