2023-03-11 20:44:59 +01:00
|
|
|
import ifcopenshell
|
|
|
|
|
|
|
|
|
|
segs = [
|
|
|
|
|
lambda _: None,
|
2024-07-26 12:00:28 +10:00
|
|
|
lambda f: [f.createIfcLineIndex((1, 2)), f.createIfcLineIndex((2, 3))],
|
|
|
|
|
lambda f: [f.createIfcLineIndex((1, 2)), f.createIfcLineIndex((1, 2))],
|
2023-03-11 20:44:59 +01:00
|
|
|
]
|
|
|
|
|
|
2026-08-03 15:16:27 +05:00
|
|
|
for schema in ("IFC4", "IFC4X3"):
|
2023-03-11 20:44:59 +01:00
|
|
|
for i, seg in enumerate(segs):
|
|
|
|
|
f = ifcopenshell.file(schema=schema)
|
|
|
|
|
s = seg(f)
|
2024-07-26 12:00:28 +10:00
|
|
|
f.createIfcIndexedPolyCurve(f.createIfcCartesianPointList2D([(0.0, 0.0), (0.0, 1.0), (1.0, 1.0)]), s)
|
|
|
|
|
f.write(
|
2026-08-03 15:16:27 +05:00
|
|
|
f'{"fail" if i == 2 else "pass"}-poly-curve-{"no-segments" if s is None else "-".join(["-".join(map(str, x[0])) for x in s])}-{schema.lower()}.ifc'
|
2024-07-26 12:00:28 +10:00
|
|
|
)
|