def test_ifc_groups(self): a = Assembly("MySiteName", project="MyTestProject") p = Part( "MyTopSpatialLevel", metadata=dict(ifctype="spatial", description="MyTopLevelSpace"), ) p.add_beam(Beam("bm1", n1=[0, 0, 0], n2=[2, 0, 0], sec="IPE220", colour="red")) a.add_part(p) newp = Part( "MySecondLevel", metadata=dict(ifctype="spatial", description="MySecondLevelSpace"), ) newp.add_beam(Beam("bm2", n1=[0, 0, 0], n2=[0, 2, 0], sec="IPE220", colour="blue")) p.add_part(newp) newp2 = Part( "MyThirdLevel", metadata=dict(ifctype="spatial", description="MyThirdLevelSpace"), ) newp2.add_beam(Beam("bm3", n1=[0, 0, 0], n2=[0, 0, 2], sec="IPE220", colour="green")) newp2.add_plate( Plate( "pl1", [(0, 0, 0), (0, 0, 2), (0, 2, 2), (0, 2.0, 0.0)], 0.01, use3dnodes=True, ) ) newp.add_part(newp2) a.to_ifc(test_folder / "my_test_groups.ifc")
def test_2ifc_simple(self): a = Assembly("ExportedPlates") p = Part("MyPart") a.add_part(p) atts2 = dict(origin=(0, 0, 0), xdir=(1, 0, 0), normal=(0, -1, 0)) pl2 = Plate("MyPl2", [(0, 0, 0.2), (5, 0, 0.2), (5, 5), (0, 5)], 20e-3, **atts2) p.add_plate(pl2) a.to_ifc(test_folder / "my_plate_poly.ifc")
def test_meter_to_millimeter(self): a = Assembly("MySiteName", project="MyTestProject") p = Part( "MyTopSpatialLevel", metadata=dict(ifctype="storey", description="MyTopLevelSpace"), ) bm1 = Beam("bm1", n1=[0, 0, 0], n2=[2, 0, 0], sec="IPE220", colour="red") p.add_beam(bm1) a.add_part(p) newp = Part( "MySecondLevel", metadata=dict(ifctype="storey", description="MySecondLevelSpace"), ) bm2 = Beam("bm2", n1=[0, 0, 0], n2=[0, 2, 0], sec="IPE220", colour="blue") newp.add_beam(bm2) p.add_part(newp) newp2 = Part( "MyThirdLevel", metadata=dict(ifctype="storey", description="MyThirdLevelSpace"), ) bm3 = Beam("bm3", n1=[0, 0, 0], n2=[0, 0, 2], sec="IPE220", colour="green") newp2.add_beam(bm3) pl1 = Plate( "pl1", [(0, 0, 0), (0, 0, 2), (0, 2, 2), (0, 2.0, 0.0)], 0.01, use3dnodes=True, ) newp2.add_plate(pl1) newp.add_part(newp2) a.to_ifc(test_folder / "my_test_in_meter.ifc") a.units = "mm"
def test_roundtrip_fillets(self): a = Assembly("ExportedPlates") p = Part("MyPart") a.add_part(p) pl1 = Plate("MyPl", [(0, 0, 0.2), (5, 0), (5, 5), (0, 5)], 20e-3, **atts) p.add_plate(pl1) atts2 = dict(origin=(0, 0, 0), xdir=(1, 0, 0), normal=(0, -1, 0)) pl2 = Plate("MyPl2", [(0, 0, 0.2), (5, 0, 0.2), (5, 5), (0, 5)], 20e-3, **atts2) p.add_plate(pl2) a.to_ifc(test_folder / "my_plate_simple.ifc") b = Assembly("MyReimport") b.read_ifc(test_folder / "my_plate_simple.ifc") b.to_ifc(test_folder / "my_plate_simple_re_exported.ifc")