예제 #1
0
 def test_module2(self):
     param_model = SimpleStru("ParametricModel")
     param_model.gmsh.mesh(size=0.1, max_dim=2)
     param_model.add_bcs()
     a = Assembly("ParametricSite")
     a.add_part(param_model)
     a._repr_html_()
     # a._renderer.toggle_geom_visibility()
     a._renderer.toggle_mesh_visibility()
예제 #2
0
    def test_fem(self):
        a = Assembly("MyAssembly")
        p = Part("MyPart")
        p.add_beam(Beam("Bm", (0, 0, 0), (1, 0, 0), "IPE300"))
        a.add_part(p)
        a.gmsh.mesh()

        a._repr_html_()
        a._renderer.toggle_mesh_visibility()
예제 #3
0
    def test_pipe_straight(self):
        a = Assembly("MyTest")

        p = Part("MyPart")
        a.add_part(p)
        z = 3.2
        y0 = -200e-3
        pipe1 = Pipe("Pipe1", [(0, y0, 0), (0, y0, z)],
                     Section("PSec", "PIPE", r=0.10, wt=5e-3))
        p.add_pipe(pipe1)
        a.to_ifc(test_folder / "pipe_straight.ifc")
        a._repr_html_()
예제 #4
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_()
예제 #5
0
 def test_pipe_bend(self):
     a = Assembly("MyTest")
     p = Part("MyPart")
     a.add_part(p)
     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("PSec", "PIPE", r=0.10, wt=5e-3),
     )
     p.add_pipe(pipe1)
     a.to_ifc(test_folder / "pipe_bend.ifc")
     a._repr_html_()
예제 #6
0
 def test_viz(self):
     a = Assembly("my_test_assembly")
     a.add_beam(
         Beam("bm1", n1=[0, 0, 0], n2=[2, 0, 0], sec="IPE220",
              colour="red"))
     a.add_beam(
         Beam("bm2",
              n1=[0, 0, 1],
              n2=[2, 0, 1],
              sec="HP220x10",
              colour="blue"))
     a.add_beam(
         Beam("bm3",
              n1=[0, 0, 2],
              n2=[2, 0, 2],
              sec="BG800x400x20x40",
              colour="green"))
     a.add_beam(
         Beam("bm4",
              n1=[0, 0, 3],
              n2=[2, 0, 3],
              sec="CIRC200",
              colour="green"))
     a.add_beam(
         Beam("bm5",
              n1=[0, 0, 4],
              n2=[2, 0, 4],
              sec="TUB200x10",
              colour="green"))
     a.add_plate(
         Plate(
             "pl1",
             [(0, 0, 0), (0, 0, 1), (0, 1, 1), (0, 1, 0)],
             0.01,
             use3dnodes=True,
         ))
     a._repr_html_()
예제 #7
0
    def test_module(self):
        a = Assembly("ParametricSite") / SimpleStru("ParametricModel")
        a.gmsh.mesh()

        a._repr_html_()
        a._renderer.toggle_mesh_visibility()