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.

78 lines
2.2 KiB
Python
Raw Normal View History

2022-12-26 11:29:32 +01:00
import ifcopenshell
coords = [(0., 0.), (10., 0.), (10., 10.), (0., 10.)]
make_3d = lambda cs: [c + (0.,) for c in cs]
inner_1 = [(1., 1.), (2., 1.), (2., 2.), (1., 2.)]
inner_2 = [(3., 3.), (4., 3.), (4., 4.), (3., 4.)]
old_map = map
map = lambda fn, *args: list(old_map(fn, *args))
f = ifcopenshell.file(schema="IFC2X3")
f.createIfcAxis2Placement3D(
f.createIfcCartesianPoint((0., 0., 0.))
)
f.write(f"pass-axis2-3d-pos-ifc2x3.ifc")
f = ifcopenshell.file(schema="IFC2X3")
f.createIfcAxis2Placement3D(
f.createIfcCartesianPoint((0., 0., 0.)),
f.createIfcDirection((0., 0., 1.)),
f.createIfcDirection((1., 0., 0.)),
)
f.write(f"pass-axis2-two-directions-ifc2x3.ifc")
f = ifcopenshell.file(schema="IFC2X3")
f.createIfcAxis2Placement3D(
f.createIfcCartesianPoint((0., 0., 0.)),
Axis=f.createIfcDirection((0., 0., 1.)),
RefDirection=None,
)
f.write(f"fail-axis2-only-axis-ifc2x3.ifc")
f = ifcopenshell.file(schema="IFC2X3")
f.createIfcAxis2Placement3D(
f.createIfcCartesianPoint((0., 0., 0.)),
Axis=None,
RefDirection=f.createIfcDirection((1., 0., 0.)),
)
f.write(f"fail-axis2-only-ref-ifc2x3.ifc")
f = ifcopenshell.file(schema="IFC2X3")
f.createIfcAxis2Placement3D(
f.createIfcCartesianPoint((0., 0., 0.)),
f.createIfcDirection((1., 0.)),
f.createIfcDirection((0., 1., 0.)),
)
f.write(f"fail-axis2-2d-axis-ifc2x3.ifc")
f = ifcopenshell.file(schema="IFC2X3")
f.createIfcAxis2Placement3D(
f.createIfcCartesianPoint((0., 0.)),
)
f.write(f"fail-axis2-2d-pos-ifc2x3.ifc")
f = ifcopenshell.file(schema="IFC2X3")
f.createIfcAxis2Placement3D(
f.createIfcCartesianPoint((0., 0., 0.)),
f.createIfcDirection((0., 0., 1.)),
f.createIfcDirection((1., 0.)),
)
f.write(f"fail-axis2-2d-ref-ifc2x3.ifc")
f = ifcopenshell.file(schema="IFC2X3")
f.createIfcAxis2Placement3D(
f.createIfcCartesianPoint((0., 0., 0.)),
Axis=f.createIfcDirection((0., 0., 1.)),
RefDirection=f.createIfcDirection((0., 0., 1.)),
)
f.write(f"fail-axis2-parallel-axes.ifc")
f = ifcopenshell.file(schema="IFC2X3")
f.createIfcAxis2Placement3D(
f.createIfcCartesianPoint((0., 0., 0.)),
Axis=f.createIfcDirection((0., 0., 1.)),
RefDirection=f.createIfcDirection((0., 0., -1.)),
)
f.write(f"fail-axis2-anti-parallel-axes.ifc")