Salome HOME
PR: synchro V6_main tag mergeto_V7_main_11Feb13
[modules/geom.git] / doc / salome / examples / complex_objs_ex02.py
1 # Creation of a Revolution
2
3 import geompy
4 import salome
5 gg = salome.ImportComponentGUI("GEOM")
6
7 # create a vertex and a vector
8 p1 = geompy.MakeVertex(  10.,  10.,  10.)
9 p2 = geompy.MakeVertex(  15.,  15.,  50.)
10 p3 = geompy.MakeVertex(  40.,  40.,   0.)
11
12 #create vectors from two points
13 vector1 = geompy.MakeVector(p1, p2)
14 vector2 = geompy.MakeVector(p1, p3)
15
16 # create a vector from the given components
17 vector3 = geompy.MakeVectorDXDYDZ(-20., -20., 100.)
18
19 # create a wire
20 wire = geompy.MakeWire([vector1, vector2])
21
22 # create a revolution
23 revolution = geompy.MakeRevolution(wire, vector3, 2.3)
24
25 # add objects in the study
26 id_vector3    = geompy.addToStudy(vector3,"Axis")
27 id_wire       = geompy.addToStudy(wire,"Wire")
28 id_revolution = geompy.addToStudy(revolution,"Revolution")
29
30 # display the vector, the wire and the revolution
31 gg.createAndDisplayGO(id_vector3)
32 gg.createAndDisplayGO(id_wire)
33 gg.createAndDisplayGO(id_revolution)
34 gg.setDisplayMode(id_revolution,1)