Salome HOME
Merge from V6_main 11/02/2013
[modules/geom.git] / doc / salome / examples / repairing_operations_ex07.py
1 # Glue Faces
2
3 import geompy
4 import salome
5 gg = salome.ImportComponentGUI("GEOM")
6
7 # create boxes
8 box1 = geompy.MakeBox(0,0,0,100,50,100)
9 box2 = geompy.MakeBox(100,0,0,250,50,100)
10
11 # make compound
12 compound = geompy.MakeCompound([box1, box2])
13
14 # glue compound's faces
15 tolerance = 1e-5
16 glue = geompy.MakeGlueFaces(compound, tolerance)
17
18 # add objects in study
19 id_box1 = geompy.addToStudy(box1, "Box1")
20 id_box2 = geompy.addToStudy(box2, "Box2")
21 id_compound = geompy.addToStudy(compound, "Compound")
22 id_glue = geompy.addToStudy(glue, "Glue faces")
23
24 # display results
25 gg.createAndDisplayGO(id_box1)
26 gg.setDisplayMode(id_box1,1)
27 gg.createAndDisplayGO(id_box2)
28 gg.setDisplayMode(id_box2,1)
29 gg.createAndDisplayGO(id_compound)
30 gg.setDisplayMode(id_compound,1)
31 gg.createAndDisplayGO(id_glue)
32 gg.setDisplayMode(id_glue,1)