Salome HOME
cb016efadce6ebfa11c0153ea622ee070148313b
[modules/geom.git] / src / GEOM_SWIG / GEOM_example2.py
1 #==============================================================================
2 #  File      : GEOM_example2.py
3 #  Created   : sam nov 10 00:53:24 CET 2001
4 #  Author    : Paul RASCLE, EDF
5 #  Project   : SALOME
6 #  Copyright : EDF 2001
7 #  $Header$
8 #==============================================================================
9
10 import salome
11 import geompy
12 import math
13
14 geom = salome.lcc.FindOrLoadComponent("FactoryServer", "GEOM")
15 myBuilder = salome.myStudy.NewBuilder()
16
17 point0  = geom.MakePointStruct(0.,0.,0.)
18 pointz1 = geom.MakePointStruct(0.,0.,1.)
19 dirz = geom.MakeDirection(pointz1)
20
21 torus1 = geompy.MakeTorus(point0,dirz,150.,25.)
22 id_torus1 = geompy.addToStudy(torus1,"torus1")
23
24 torus2 = geom.MakeCopy(torus1)
25 torus2 = geom.MakeTranslation(torus2,0.,0.,100.)
26 id_torus2 = geompy.addToStudy(torus2,"torus2")
27
28 cylz1 = geompy.MakeCylinder(point0,dirz,25.,100.)
29
30 ind = 0
31 cyllist = []
32 while ind < 6:
33     acyl = geom.MakeCopy(cylz1)
34     x = 150. * math.cos(ind * math.pi/3.)
35     y = 150. * math.sin(ind * math.pi/3.)
36     z = 0.
37     name = "cyl%d"%(ind)
38     acyl = geompy.MakeTranslation(acyl,x,y,z)
39     id_acyl = geompy.addToStudy(acyl,name)
40     cyllist.append(acyl)
41     ind = ind +1
42
43
44
45