Пример #1
0
    def test_wall_simple(self):
        points = [(0, 0, 0), (5, 0, 0), (5, 5, 0)]
        w = Wall("MyWall", points, 3, 0.15, offset="LEFT")
        wi = Window("MyWindow1", 1.5, 1, 0.15)
        wi2 = Window("MyWindow2", 2, 1, 0.15)
        door = Door("Door1", 1.5, 2, 0.2)
        w.add_insert(wi, 0, 1, 1.2)
        w.add_insert(wi2, 1, 1, 1.2)
        w.add_insert(door, 0, 3.25, 0)

        a = Assembly("MyAssembly")
        p = Part("MyPart")
        a.add_part(p)
        p.add_wall(w)
        a.to_ifc(test_folder / "my_wall_wDoorsWindows.ifc")
        a._repr_html_()
Пример #2
0
def test_wall_simple(dummy_display):
    points = [(0, 0, 0), (5, 0, 0), (5, 5, 0)]
    w = Wall("MyWall", points, 3, 0.15, offset="LEFT")
    wi = Window("MyWindow1", 1.5, 1, 0.15)
    wi2 = Window("MyWindow2", 2, 1, 0.15)
    door = Door("Door1", 1.5, 2, 0.2)
    w.add_insert(wi, 0, 1, 1.2)
    w.add_insert(wi2, 1, 1, 1.2)
    w.add_insert(door, 0, 3.25, 0)

    a = Assembly("MyAssembly")
    p = Part("MyPart")
    a.add_part(p)
    p.add_wall(w)
    _ = a.to_ifc(test_folder / "my_wall_wDoorsWindows.ifc", return_file_obj=True)

    dummy_display(a)
Пример #3
0
def test_ifc_reimport():
    # Model to be re-imported
    a = Assembly("my_test_assembly") / SimpleStru("my_simple_stru")
    fp = a.to_ifc(test_folder / "my_exported_param_model.ifc",
                  return_file_obj=True)

    points = [(0, 0, 0), (5, 0, 0), (5, 5, 0)]
    w = Wall("MyWall", points, 3, 0.15, offset="LEFT")
    wi = Window("MyWindow1", 1.5, 1, 0.15)
    wi2 = Window("MyWindow2", 2, 1, 0.15)
    door = Door("Door1", 1.5, 2, 0.2)
    w.add_insert(wi, 0, 1, 1.2)
    w.add_insert(wi2, 1, 1, 1.2)
    w.add_insert(door, 0, 3.25, 0)

    p = Part("MyPart")

    p.add_elements_from_ifc(fp)
    p.add_wall(w)

    z = 3.2
    y0 = -200e-3
    x0 = -y0
    pipe1 = Pipe(
        "Pipe1",
        [
            (0, y0, z),
            (5 + x0, y0, z),
            (5 + x0, y0 + 5, z),
            (10, y0 + 5, z + 2),
            (10, y0 + 5, z + 10),
        ],
        Section("PSec1", "PIPE", r=0.10, wt=5e-3),
    )
    p.add_pipe(pipe1)

    b = Assembly("MyTest") / p

    b.units = "mm"
    b.to_ifc(test_folder / "my_reimport_of_elements_mm.ifc")
    # TODO: Re-import is still not supported. Should look into same approach as BlenderBIM by
    #       only communicating and updating the ifcopenshell file object.
    b.units = "m"
Пример #4
0
    def test_ifc_reimport(self):
        # Model to be re-imported
        a = Assembly("my_test_assembly") / SimpleStru("my_simple_stru")
        a.to_ifc(test_folder / "my_exported_param_model.ifc")

        points = [(0, 0, 0), (5, 0, 0), (5, 5, 0)]
        w = Wall("MyWall", points, 3, 0.15, offset="LEFT")
        wi = Window("MyWindow1", 1.5, 1, 0.15)
        wi2 = Window("MyWindow2", 2, 1, 0.15)
        door = Door("Door1", 1.5, 2, 0.2)
        w.add_insert(wi, 0, 1, 1.2)
        w.add_insert(wi2, 1, 1, 1.2)
        w.add_insert(door, 0, 3.25, 0)

        p = Part("MyPart")

        p.add_elements_from_ifc(test_folder / "my_exported_param_model.ifc")
        p.add_wall(w)

        z = 3.2
        y0 = -200e-3
        x0 = -y0
        pipe1 = Pipe(
            "Pipe1",
            [
                (0, y0, z),
                (5 + x0, y0, z),
                (5 + x0, y0 + 5, z),
                (10, y0 + 5, z + 2),
                (10, y0 + 5, z + 10),
            ],
            Section("PSec1", "PIPE", r=0.10, wt=5e-3),
        )
        p.add_pipe(pipe1)

        b = Assembly("MyTest") / p

        b.units = "mm"
        b.to_ifc(test_folder / "my_reimport_of_elements_mm.ifc")