Files
IfcOpenShell/src/ifcopenshell-python/test/fixtures/rules/generate_13.py
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

86 lines
2.7 KiB
Python
Raw Normal View History

2022-12-26 11:29:32 +01:00
import ifcopenshell
from ...fixture_generate import normalize_header, write_fixture
2022-12-26 11:29:32 +01:00
2024-07-26 12:00:28 +10:00
coords = [(0.0, 0.0), (10.0, 0.0), (10.0, 10.0), (0.0, 10.0)]
make_3d = lambda cs: [c + (0.0,) for c in cs]
inner_1 = [(1.0, 1.0), (2.0, 1.0), (2.0, 2.0), (1.0, 2.0)]
inner_2 = [(3.0, 3.0), (4.0, 3.0), (4.0, 4.0), (3.0, 4.0)]
2022-12-26 11:29:32 +01:00
old_map = map
map = lambda fn, *args: list(old_map(fn, *args))
f = ifcopenshell.file(schema="IFC2X3")
2024-07-26 12:00:28 +10:00
f.createIfcAxis2Placement3D(f.createIfcCartesianPoint((0.0, 0.0, 0.0)))
2026-08-03 16:07:29 +05:00
normalize_header(f)
write_fixture(f, __file__, "pass", "axis2-3d-pos-ifc2x3")
2022-12-26 11:29:32 +01:00
f = ifcopenshell.file(schema="IFC2X3")
f.createIfcAxis2Placement3D(
2024-07-26 12:00:28 +10:00
f.createIfcCartesianPoint((0.0, 0.0, 0.0)),
f.createIfcDirection((0.0, 0.0, 1.0)),
f.createIfcDirection((1.0, 0.0, 0.0)),
2022-12-26 11:29:32 +01:00
)
2026-08-03 16:07:29 +05:00
normalize_header(f)
write_fixture(f, __file__, "pass", "axis2-two-directions-ifc2x3")
2022-12-26 11:29:32 +01:00
f = ifcopenshell.file(schema="IFC2X3")
f.createIfcAxis2Placement3D(
2024-07-26 12:00:28 +10:00
f.createIfcCartesianPoint((0.0, 0.0, 0.0)),
Axis=f.createIfcDirection((0.0, 0.0, 1.0)),
2022-12-26 11:29:32 +01:00
RefDirection=None,
)
2026-08-03 16:07:29 +05:00
normalize_header(f)
write_fixture(f, __file__, "fail", "axis2-only-axis-ifc2x3")
2022-12-26 11:29:32 +01:00
f = ifcopenshell.file(schema="IFC2X3")
f.createIfcAxis2Placement3D(
2024-07-26 12:00:28 +10:00
f.createIfcCartesianPoint((0.0, 0.0, 0.0)),
2022-12-26 11:29:32 +01:00
Axis=None,
2024-07-26 12:00:28 +10:00
RefDirection=f.createIfcDirection((1.0, 0.0, 0.0)),
2022-12-26 11:29:32 +01:00
)
2026-08-03 16:07:29 +05:00
normalize_header(f)
write_fixture(f, __file__, "fail", "axis2-only-ref-ifc2x3")
2022-12-26 11:29:32 +01:00
f = ifcopenshell.file(schema="IFC2X3")
f.createIfcAxis2Placement3D(
2024-07-26 12:00:28 +10:00
f.createIfcCartesianPoint((0.0, 0.0, 0.0)),
f.createIfcDirection((1.0, 0.0)),
f.createIfcDirection((0.0, 1.0, 0.0)),
2022-12-26 11:29:32 +01:00
)
2026-08-03 16:07:29 +05:00
normalize_header(f)
write_fixture(f, __file__, "fail", "axis2-2d-axis-ifc2x3")
2022-12-26 11:29:32 +01:00
f = ifcopenshell.file(schema="IFC2X3")
f.createIfcAxis2Placement3D(
2024-07-26 12:00:28 +10:00
f.createIfcCartesianPoint((0.0, 0.0)),
2022-12-26 11:29:32 +01:00
)
2026-08-03 16:07:29 +05:00
normalize_header(f)
write_fixture(f, __file__, "fail", "axis2-2d-pos-ifc2x3")
2022-12-26 11:29:32 +01:00
f = ifcopenshell.file(schema="IFC2X3")
f.createIfcAxis2Placement3D(
2024-07-26 12:00:28 +10:00
f.createIfcCartesianPoint((0.0, 0.0, 0.0)),
f.createIfcDirection((0.0, 0.0, 1.0)),
f.createIfcDirection((1.0, 0.0)),
2022-12-26 11:29:32 +01:00
)
2026-08-03 16:07:29 +05:00
normalize_header(f)
write_fixture(f, __file__, "fail", "axis2-2d-ref-ifc2x3")
2022-12-26 11:29:32 +01:00
f = ifcopenshell.file(schema="IFC2X3")
f.createIfcAxis2Placement3D(
2024-07-26 12:00:28 +10:00
f.createIfcCartesianPoint((0.0, 0.0, 0.0)),
Axis=f.createIfcDirection((0.0, 0.0, 1.0)),
RefDirection=f.createIfcDirection((0.0, 0.0, 1.0)),
2022-12-26 11:29:32 +01:00
)
2026-08-03 16:07:29 +05:00
normalize_header(f)
write_fixture(f, __file__, "fail", "axis2-parallel-axes")
2022-12-26 11:29:32 +01:00
f = ifcopenshell.file(schema="IFC2X3")
f.createIfcAxis2Placement3D(
2024-07-26 12:00:28 +10:00
f.createIfcCartesianPoint((0.0, 0.0, 0.0)),
Axis=f.createIfcDirection((0.0, 0.0, 1.0)),
RefDirection=f.createIfcDirection((0.0, 0.0, -1.0)),
2022-12-26 11:29:32 +01:00
)
2026-08-03 16:07:29 +05:00
normalize_header(f)
write_fixture(f, __file__, "fail", "axis2-anti-parallel-axes")