]> SALOME platform Git repositories - modules/geom.git/blob - doc/salome/examples/advanced_geom_objs_ex01.py
Salome HOME
Merge from V6_main 15/03/2013
[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 object with left thickness reduction
31 pipetshape_thr = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0,
32                                        theRL=60, theWL=20, theLtransL=40, theLthinL=20)
33
34 # add object in the study
35 id_pipetshape_thr = geompy.addToStudy(pipetshape_thr[0],"PipeTShape_left_thickness_reduction")
36 # add groups in the study
37 for g in pipetshape_thr[1:]:
38     geompy.addToStudyInFather(pipetshape_thr[0], g, g.GetName())
39
40 # create PipeTShape with chamfer object
41 pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
42
43 # add object in the study
44 id_pipetshapechamfer = geompy.addToStudy(pipetshapechamfer[0],"PipeTShapeChamfer")
45 # add groups in the study
46 for g in pipetshapechamfer[1:]:
47     geompy.addToStudyInFather(pipetshapechamfer[0], g, g.GetName())
48
49 # create PipeTShape with chamfer object with position
50 pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
51
52 # add object in the study
53 id_pipetshapechamfer_position = geompy.addToStudy(pipetshapechamfer_position[0],"PipeTShapeChamfer_position")
54 # add groups in the study
55 for g in pipetshapechamfer_position[1:]:
56     geompy.addToStudyInFather(pipetshapechamfer_position[0], g, g.GetName())
57
58 # create PipeTShape with chamfer object with left and right thickness reductions
59 pipetshapechamfer_thr = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0,
60                                                      theRL=60, theWL=20, theLtransL=40, theLthinL=20,
61                                                      theRR=40, theWR=10, theLtransR=60, theLthinR=30)
62
63 # add object in the study
64 id_pipetshapechamfer_thr = geompy.addToStudy(pipetshapechamfer_thr[0],"PipeTShapeChamfer_two_thickness_reductions")
65 # add groups in the study
66 for g in pipetshapechamfer_thr[1:]:
67     geompy.addToStudyInFather(pipetshapechamfer_thr[0], g, g.GetName())
68
69 # create PipeTShape with fillet object
70 pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
71
72 # add object in the study
73 id_pipetshapefillet = geompy.addToStudy(pipetshapefillet[0],"PipeTShapeFillet")
74 # add groups in the study
75 for g in pipetshapefillet[1:]:
76     geompy.addToStudyInFather(pipetshapefillet[0], g, g.GetName())
77
78 # create PipeTShape with fillet object with position
79 pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
80
81 # add object in the study
82 id_pipetshapefillet_position = geompy.addToStudy(pipetshapefillet_position[0],"PipeTShapeFillet_position")
83 # add groups in the study
84 for g in pipetshapefillet_position[1:]:
85     geompy.addToStudyInFather(pipetshapefillet_position[0], g, g.GetName())
86
87 # create PipeTShape with fillet object with three thickness reductions
88 pipetshapefillet_thr = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0,
89                                                    5.0, True, None, None, None,
90                                                    60, 20, 40, 20,
91                                                    40, 10, 60, 30,
92                                                    20, 10, 30, 30)
93
94 # add object in the study
95 id_pipetshapefillet_thr = geompy.addToStudy(pipetshapefillet_thr[0],"PipeTShapeFillet_three_thickness_reductions")
96 # add groups in the study
97 for g in pipetshapefillet_thr[1:]:
98     geompy.addToStudyInFather(pipetshapefillet_thr[0], g, g.GetName())
99
100
101 # display pipetshapes
102 gg.createAndDisplayGO(id_pipetshape)
103 gg.createAndDisplayGO(id_pipetshape_position)
104 gg.createAndDisplayGO(id_pipetshape_thr)
105 gg.createAndDisplayGO(id_pipetshapechamfer)
106 gg.createAndDisplayGO(id_pipetshapechamfer_position)
107 gg.createAndDisplayGO(id_pipetshapechamfer_thr)
108 gg.createAndDisplayGO(id_pipetshapefillet)
109 gg.createAndDisplayGO(id_pipetshapefillet_position)
110 gg.createAndDisplayGO(id_pipetshapefillet_thr)