Salome HOME
Merge from V6_main 11/02/2013
[modules/geom.git] / doc / salome / examples / complex_objs_ex03.py
1 # Creation of a Filling
2
3 import geompy
4 import salome
5 gg = salome.ImportComponentGUI("GEOM")
6
7 mindeg = 2
8 maxdeg = 5
9 tol3d  = 0.0001
10 tol2d  = 0.0001
11 nbiter = 5
12
13 # create a vertex and a vector
14 p1 = geompy.MakeVertex(  -30.,  -30.,  50.)
15 p2 = geompy.MakeVertex(  -60.,  -60.,  30.)
16 p3 = geompy.MakeVertex(  -30.,  -30.,  10.)
17
18 # create an arc from three points
19 arc = geompy.MakeArc(p1, p2, p3)
20 ShapeListCompound = []
21 i = 0
22 while i <= 3 :
23     S = geompy.MakeTranslation(arc, i * 50., 0., 0.)
24     ShapeListCompound.append(S)
25     i = i + 1
26
27 compound = geompy.MakeCompound(ShapeListCompound)
28
29 # create a filling
30 filling = geompy.MakeFilling(compound, mindeg, maxdeg, tol3d, tol2d, nbiter)
31
32 # add objects in the study
33 id_compound = geompy.addToStudy(compound,"Compound")
34 id_filling = geompy.addToStudy(filling,"Filling")
35
36 # display the compound and the filling
37 gg.createAndDisplayGO(id_compound)
38 gg.createAndDisplayGO(id_filling)
39 gg.setDisplayMode(id_filling,1)