Salome HOME
PR: synchro V6_main tag mergeto_V7_main_11Feb13
[modules/geom.git] / doc / salome / examples / boolean_operations_ex04.py
1 # Section
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 # make a section
21 section = geompy.MakeSection(cylinder, sphere)
22
23 # add objects in the study
24 id_section = geompy.addToStudy(section, "Section")
25
26 # display the results
27 gg.createAndDisplayGO(id_section)
28 gg.setDisplayMode(id_section,1)