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