Salome HOME
0022373: EDF 2691 GEOM: Publish the shapes with error in Check Shape
[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 ShapeListCompound = []
24 i = 0
25 while i <= 3 :
26     S = geompy.MakeTranslation(arc, i * 50., 0., 0.)
27     ShapeListCompound.append(S)
28     i = i + 1
29
30 compound = geompy.MakeCompound(ShapeListCompound)
31
32 # create a filling
33 filling = geompy.MakeFilling(compound, mindeg, maxdeg, tol3d, tol2d, nbiter)
34
35 # add objects in the study
36 id_compound = geompy.addToStudy(compound,"Compound")
37 id_filling = geompy.addToStudy(filling,"Filling")
38
39 # display the compound and the filling
40 gg.createAndDisplayGO(id_compound)
41 gg.createAndDisplayGO(id_filling)
42 gg.setDisplayMode(id_filling,1)