Salome HOME
Merge from V6_main 11/02/2013
[modules/geom.git] / doc / salome / examples / repairing_operations_ex04.py
1 # Suppress Internal Wires
2
3 import geompy
4 import salome
5 gg = salome.ImportComponentGUI("GEOM")
6
7 # create a vertex and a vector
8 p1 = geompy.MakeVertex(55, 65, 50)
9 p2 = geompy.MakeVertex(55,  0, 50)
10 v = geompy.MakeVector(p1, p2)
11
12 # create a cylinder
13 height = 100
14 radius1 = 40
15 cylinder = geompy.MakeCylinder(p1, v, radius1, height)
16
17 # create a box
18 box = geompy.MakeBoxDXDYDZ(100, 100, 100)
19
20 # make a cut
21 cut = geompy.MakeCut(box, cylinder)
22
23 # suppress all internal wires
24 result = geompy.SuppressInternalWires(cut, [])
25
26 # add objects in the study
27 id_cut = geompy.addToStudy(cut, "Cut")
28 id_result = geompy.addToStudy(result, "Result")
29
30 # display the results
31 gg.createAndDisplayGO(id_cut)
32 gg.setDisplayMode(id_cut,1)
33 gg.createAndDisplayGO(id_result)
34 gg.setDisplayMode(id_result,1)