Salome HOME
PR: synchro V6_main tag mergeto_V7_main_11Feb13
[modules/geom.git] / doc / salome / examples / basic_geom_objs_ex03.py
1 # Creation of a Circle
2
3 import geompy
4 import salome
5 gg = salome.ImportComponentGUI("GEOM")
6
7 # create vertices
8 p0 = geompy.MakeVertex(0., 0., 0.)
9 px = geompy.MakeVertex(100., 0.  , 0.  )
10 py = geompy.MakeVertex(0.  , 100., 0.  )
11 pz = geompy.MakeVertex(0.  , 0.  , 100.)
12
13 # create a vector on two points
14 vxy  = geompy.MakeVector(px, py)
15
16 # create a circle from a point, a vector and a radius
17 circle1 = geompy.MakeCircle(pz, vxy, 30)
18
19 #create a circle from three points
20 circle2 = geompy.MakeCircleThreePnt(p0, px, py)
21
22 # add objects in the study
23 id_vxy      = geompy.addToStudy(vxy,    "Vector")
24 id_circle1  = geompy.addToStudy(circle1,"Circle1")
25 id_circle2  = geompy.addToStudy(circle2,"Circle2")
26
27 # display circles
28 gg.createAndDisplayGO(id_vxy)
29 gg.createAndDisplayGO(id_circle1)
30 gg.createAndDisplayGO(id_circle2)