Salome HOME
Revert "Synchronize adm files"
[modules/geom.git] / doc / salome / examples / repairing_operations_ex08.py
1 # Glue Edges
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 # create boxes
11 box1 = geompy.MakeBox(0,0,0,100,50,100)
12 box2 = geompy.MakeBox(100,0,0,250,50,100)
13
14 # make compound
15 compound = geompy.MakeCompound([box1, box2])
16
17 # glue all compound's edges
18 tolerance = 1e-5
19 glue1 = geompy.MakeGlueEdges(compound, tolerance)
20
21 # glue some compound's edges
22 list_edges = geompy.GetGlueEdges(compound, tolerance)
23 glue2 = geompy.MakeGlueEdgesByList(compound, tolerance, [list_edges[0], list_edges[2]])
24
25 # add objects in study
26 geompy.addToStudy(box1, "Box1")
27 geompy.addToStudy(box2, "Box2")
28 geompy.addToStudy(compound, "Compound")
29 geompy.addToStudy(glue1, "Glue all edges")
30 geompy.addToStudy(glue2, "Glue two edges")
31
32 if salome.sg.hasDesktop():
33   salome.sg.updateObjBrowser(1)