Salome HOME
Switch to SSL mode for tests : naive approach
[modules/geom.git] / doc / salome / examples / topological_geom_objs_ex06.py
1 # Creation of a Compound
2
3 import salome
4 salome.salome_init_without_session()
5 import GEOM
6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New()
8 gg = salome.ImportComponentGUI("GEOM")
9
10 # create a vertex and a vector
11 p1 = geompy.MakeVertex(  -30.,  -30.,  50.)
12 p2 = geompy.MakeVertex(  -60.,  -60.,  30.)
13 p3 = geompy.MakeVertex(  -30.,  -30.,  10.)
14
15 # create an arc from three points
16 arc = geompy.MakeArc(p1, p2, p3)
17 ShapeListCompound = []
18 i = 0
19 while i <= 3 :
20     S = geompy.MakeTranslation(arc, i * 50., 0., 0.)
21     ShapeListCompound.append(S)
22     i = i + 1
23
24 # create a compound of the given shapes
25 compound = geompy.MakeCompound(ShapeListCompound)
26
27 # add object in the study
28 id_compound = geompy.addToStudy(compound,"Compound")
29
30 # display the compound
31 gg.createAndDisplayGO(id_compound)