3 \page tui_primitives_page Primitives
5 \anchor tui_creation_box
6 <br><h2>Creation of a Box</h2>
11 gg = salome.ImportComponentGUI("GEOM")
14 p0 = geompy.MakeVertex(15, 25, 35)
15 p70 = geompy.MakeVertex(70, 70, 70)
18 box1 = geompy.MakeBoxDXDYDZ(10, 20, 30)
19 box2 = geompy.MakeBox(10,20,30, 15,25,35)
20 box3 = geompy.MakeBoxTwoPnt(p0, p70)
22 # add objects in the study
23 id_box1 = geompy.addToStudy(box1,"Box1")
24 id_box2 = geompy.addToStudy(box2,"Box2")
25 id_box3 = geompy.addToStudy(box3,"Box3")
28 gg.createAndDisplayGO(id_box1)
29 gg.setDisplayMode(id_box1,1)
30 gg.createAndDisplayGO(id_box2)
31 gg.setDisplayMode(id_box2,1)
32 gg.createAndDisplayGO(id_box3)
33 gg.setDisplayMode(id_box3,1)
36 \anchor tui_creation_cylinder
37 <br><h2>Creation of a Cylinder</h2>
43 gg = salome.ImportComponentGUI("GEOM")
45 # create a vertex and a vector
46 p1 = geompy.MakeVertex(25, 35, 45)
47 p2 = geompy.MakeVertex(70, 70, 70)
48 v = geompy.MakeVector(p1, p2)
54 cylinder1 = geompy.MakeCylinder(p1, v, radius1, height)
57 cylinder2 = geompy.MakeCylinderRH(radius2, height)
59 # add objects in the study
60 id_cylinder1 = geompy.addToStudy(cylinder1,"Cylinder1")
61 id_cylinder2 = geompy.addToStudy(cylinder2,"Cylinder2")
63 # display the cylinders
64 gg.createAndDisplayGO(id_cylinder1)
65 gg.setDisplayMode(id_cylinder1,1)
66 gg.createAndDisplayGO(id_cylinder2)
67 gg.setDisplayMode(id_cylinder2,1)
70 \anchor tui_creation_sphere
71 <br><h2>Creation of a Sphere</h2>
76 gg = salome.ImportComponentGUI("GEOM")
79 p = geompy.MakeVertex(55, 45, 25)
83 sphere1 = geompy.MakeSpherePntR(p, radius1)
85 sphere2 = geompy.MakeSphere(0, 0, 45, radius2)
87 sphere3 = geompy.MakeSphereR(radius3)
89 # add objects in the study
90 id_sphere1 = geompy.addToStudy(sphere1,"Sphere1")
91 id_sphere2 = geompy.addToStudy(sphere2,"Sphere2")
92 id_sphere3 = geompy.addToStudy(sphere3,"Sphere3")
95 gg.createAndDisplayGO(id_sphere1)
96 gg.setDisplayMode(id_sphere1,1)
97 gg.createAndDisplayGO(id_sphere2)
98 gg.setDisplayMode(id_sphere2,1)
99 gg.createAndDisplayGO(id_sphere3)
100 gg.setDisplayMode(id_sphere3,1)
103 \anchor tui_creation_torus
104 <br><h2>Creation of a Torus</h2>
109 gg = salome.ImportComponentGUI("GEOM")
111 # create a vertex and a vector
112 p1 = geompy.MakeVertex(35, 40, 45)
113 p2 = geompy.MakeVertex(35, 45, 70)
114 v = geompy.MakeVector(p1, p2)
117 torus1 = geompy.MakeTorus(p1, v, 20, 10)
118 torus2 = geompy.MakeTorusRR(30, 15)
120 # add objects in the study
121 id_torus1 = geompy.addToStudy(torus1,"Torus1")
122 id_torus2 = geompy.addToStudy(torus2,"Torus2")
125 gg.createAndDisplayGO(id_torus1)
126 gg.setDisplayMode(id_torus1,1)
127 gg.createAndDisplayGO(id_torus2)
128 gg.setDisplayMode(id_torus2,1)
131 \anchor tui_creation_cone
132 <br><h2>Creation of a Cone</h2>
137 gg = salome.ImportComponentGUI("GEOM")
139 # create a vertex and a vector
140 p1 = geompy.MakeVertex(35, 35, 0)
141 p2 = geompy.MakeVertex(35, 35, 70)
142 v = geompy.MakeVector(p1, p2)
145 cone1 = geompy.MakeCone(p1, v, 17, 1, 20)
146 cone2 = geompy.MakeConeR1R2H(30, 10, 30)
148 # add objects in the study
149 id_cone1 = geompy.addToStudy(cone1,"Cone1")
150 id_cone2 = geompy.addToStudy(cone2,"Cone2")
153 gg.createAndDisplayGO(id_cone1)
154 gg.setDisplayMode(id_cone1,1)
155 gg.createAndDisplayGO(id_cone2)
156 gg.setDisplayMode(id_cone2,1)