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