This commit is contained in:
Andrej730
2025-02-24 11:47:19 +05:00
parent 3854afb34d
commit 0783f8082e
8 changed files with 153 additions and 119 deletions
@@ -84,6 +84,7 @@ ENDSEC;
END-ISO-10303-21;
"""
def test_original_edges():
ifc_file = ifcopenshell.file.from_string(contents)
element = ifc_file.by_id(95)
@@ -92,6 +93,6 @@ def test_original_edges():
assert (len(shape.edges) // 2) == 20
shape = ifcopenshell.geom.create_shape(settings, element, geometry_library="cgal")
assert (len(shape.edges) // 2) == 16
settings.set('cgal-original-edges', True)
settings.set("cgal-original-edges", True)
shape = ifcopenshell.geom.create_shape(settings, element, geometry_library="cgal")
assert (len(shape.edges) // 2) == 20
@@ -18,28 +18,29 @@
import ifcopenshell.util.stationing as sta
def test_station_as_string():
# test with a bunch of "random" station values
s = sta.station_as_string(0.0)
assert(s == "0+000.000")
assert s == "0+000.000"
s = sta.station_as_string(0.0,2,2)
assert(s == "0+00.00")
s = sta.station_as_string(0.0, 2, 2)
assert s == "0+00.00"
s = sta.station_as_string(0.0,2)
assert(s == "0+00.000")
s = sta.station_as_string(0.0, 2)
assert s == "0+00.000"
s = sta.station_as_string(100.00)
assert(s == "0+100.000")
s = sta.station_as_string(100.00)
assert s == "0+100.000"
s = sta.station_as_string(-100.00)
assert(s == "-0+100.000")
s = sta.station_as_string(-100.00)
assert s == "-0+100.000"
s = sta.station_as_string(123456.789,2,2)
assert(s == "1234+56.79")
s = sta.station_as_string(123456.789, 2, 2)
assert s == "1234+56.79"
s = sta.station_as_string(-123456.789,2,2)
assert(s == "-1234+56.79")
s = sta.station_as_string(-123456.789, 2, 2)
assert s == "-1234+56.79"
s = sta.station_as_string(123456.789,3,4)
assert(s == "123+456.7890")
s = sta.station_as_string(123456.789, 3, 4)
assert s == "123+456.7890"