Salome HOME
44c597405f42297596138ae81399ea437a7ee05e
[modules/geom.git] / doc / salome / examples / boolean_operations_ex03.py
1 # Cut
2
3 import geompy
4 import salome
5 gg = salome.ImportComponentGUI("GEOM")
6
7 # create a vertex and a vector
8 p1 = geompy.MakeVertex(25, 55, 0)
9 p2 = geompy.MakeVertex( 0,  0, 0)
10 v = geompy.MakeVector(p1, p2)
11
12 # create a cylinder
13 height = 35
14 radius1 = 20
15 cylinder = geompy.MakeCylinder(p1, v, radius1, height)
16
17 # create a sphere
18 sphere = geompy.MakeSphereR(40)
19
20 #cut
21 cut = geompy.MakeCut(cylinder, sphere)
22
23 # add objects in the study
24 id_cut = geompy.addToStudy(cut, "Cut")
25
26 # display the results
27 gg.createAndDisplayGO(id_cut)
28 gg.setDisplayMode(id_cut,1)