]> SALOME platform Git repositories - modules/geom.git/blob - doc/salome/examples/advanced_geom_objs_ex01.py
Salome HOME
eb3db5fe54495417b96261becead108a1756598f
[modules/geom.git] / doc / salome / examples / advanced_geom_objs_ex01.py
1 # Creation of PipeTShape
2
3 import geompy
4 import salome
5 gg = salome.ImportComponentGUI("GEOM")
6
7 # create PipeTShape object
8 pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
9
10 # add object in the study
11 id_pipetshape = geompy.addToStudy(pipetshape[0],"PipeTShape")
12 # add groups in the study
13 for g in pipetshape[1:]:
14     geompy.addToStudyInFather(pipetshape[0], g, g.GetName())
15     
16 # Create junction vertices
17 P1 = geompy.MakeVertex(0.0, 0.0, 0.0)
18 P2 = geompy.MakeVertex(400.0, 0.0, 0.0)
19 P3 = geompy.MakeVertex(200.0, 0.0, 200.0)
20
21 # create PipeTShape object with position
22 pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
23
24 # add object in the study
25 id_pipetshape_position = geompy.addToStudy(pipetshape_position[0],"PipeTShape_position")
26 # add groups in the study
27 for g in pipetshape_position[1:]:
28     geompy.addToStudyInFather(pipetshape_position[0], g, g.GetName())
29
30 # create PipeTShape with chamfer object
31 pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
32
33 # add object in the study
34 id_pipetshapechamfer = geompy.addToStudy(pipetshapechamfer[0],"PipeTShapeChamfer")
35 # add groups in the study
36 for g in pipetshapechamfer[1:]:
37     geompy.addToStudyInFather(pipetshapechamfer[0], g, g.GetName())
38
39 # create PipeTShape with chamfer object with position
40 pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
41
42 # add object in the study
43 id_pipetshapechamfer_position = geompy.addToStudy(pipetshapechamfer_position[0],"PipeTShapeChamfer_position")
44 # add groups in the study
45 for g in pipetshapechamfer_position[1:]:
46     geompy.addToStudyInFather(pipetshapechamfer_position[0], g, g.GetName())
47
48 # create PipeTShape with fillet object
49 pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
50
51 # add object in the study
52 id_pipetshapefillet = geompy.addToStudy(pipetshapefillet[0],"PipeTShapeFillet")
53 # add groups in the study
54 for g in pipetshapefillet[1:]:
55     geompy.addToStudyInFather(pipetshapefillet[0], g, g.GetName())
56
57 # create PipeTShape with fillet object with position
58 pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
59
60 # add object in the study
61 id_pipetshapefillet_position = geompy.addToStudy(pipetshapefillet_position[0],"PipeTShapeFillet_position")
62 # add groups in the study
63 for g in pipetshapefillet_position[1:]:
64     geompy.addToStudyInFather(pipetshapefillet_position[0], g, g.GetName())
65     
66
67 # display pipetshapes
68 gg.createAndDisplayGO(id_pipetshape)
69 gg.createAndDisplayGO(id_pipetshape_position)
70 gg.createAndDisplayGO(id_pipetshapechamfer)
71 gg.createAndDisplayGO(id_pipetshapechamfer_position)
72 gg.createAndDisplayGO(id_pipetshapefillet)
73 gg.createAndDisplayGO(id_pipetshapefillet_position)