]> SALOME platform Git repositories - modules/geom.git/blob - doc/salome/gui/GEOM/input/tui_boolean_operations.doc
Salome HOME
f88047f489d1a5664cf19d0c5f4211fa3628b798
[modules/geom.git] / doc / salome / gui / GEOM / input / tui_boolean_operations.doc
1 /*!
2
3 \page tui_boolean_operations_page Boolean Operations
4
5 \anchor tui_fuse
6 <br><h2>Fuse</h2>
7
8 \code
9 import geompy
10 import salome
11 gg = salome.ImportComponentGUI("GEOM")
12
13 # create a vertex and a vector
14 p1 = geompy.MakeVertex(25, 55, 0)
15 p2 = geompy.MakeVertex( 0,  0, 0)
16 v = geompy.MakeVector(p1, p2)
17
18 # create a cylinder
19 height = 35
20 radius1 = 20
21 cylinder = geompy.MakeCylinder(p1, v, radius1, height)
22
23 # create a sphere
24 sphere = geompy.MakeSphereR(40)
25
26 # fuse
27 fuse = geompy.MakeFuse(cylinder, sphere)
28
29 # add objects in the study
30 id_cylinder = geompy.addToStudy(cylinder, "Cylinder")
31 id_sphere = geompy.addToStudy(sphere, "Sphere")
32 id_fuse = geompy.addToStudy(fuse, "Fuse")
33
34 # display results
35 gg.createAndDisplayGO(id_cylinder)
36 gg.setDisplayMode(id_cylinder,1)
37 gg.createAndDisplayGO(id_sphere)
38 gg.setDisplayMode(id_sphere,1)
39 gg.createAndDisplayGO(id_fuse)
40 gg.setDisplayMode(id_fuse,1)
41 \endcode
42
43 \anchor tui_common
44 <br><h2>Common</h2>
45
46 \code
47 import geompy
48 import salome
49 gg = salome.ImportComponentGUI("GEOM")
50
51 # create a vertex and a vector
52 p1 = geompy.MakeVertex(25, 55, 0)
53 p2 = geompy.MakeVertex( 0,  0, 0)
54 v = geompy.MakeVector(p1, p2)
55
56 # create a cylinder
57 height = 35
58 radius1 = 20
59 cylinder = geompy.MakeCylinder(p1, v, radius1, height)
60
61 # create a sphere
62 sphere = geompy.MakeSphereR(40)
63
64 # make common
65 common = geompy.MakeCommon(cylinder, sphere)
66
67 # add objects in the study
68 id_common = geompy.addToStudy(common, "Common")
69
70 # display the results
71 gg.createAndDisplayGO(id_common)
72 gg.setDisplayMode(id_common,1)
73 \endcode
74
75 \anchor tui_cut
76 <br><h2>Cut</h2>
77
78 \code
79 import geompy
80 import salome
81 gg = salome.ImportComponentGUI("GEOM")
82
83 # create a vertex and a vector
84 p1 = geompy.MakeVertex(25, 55, 0)
85 p2 = geompy.MakeVertex( 0,  0, 0)
86 v = geompy.MakeVector(p1, p2)
87
88 # create a cylinder
89 height = 35
90 radius1 = 20
91 cylinder = geompy.MakeCylinder(p1, v, radius1, height)
92
93 # create a sphere
94 sphere = geompy.MakeSphereR(40)
95
96 #cut
97 cut = geompy.MakeCut(cylinder, sphere)
98
99 # add objects in the study
100 id_cut = geompy.addToStudy(cut, "Cut")
101
102 # display the results
103 gg.createAndDisplayGO(id_cut)
104 gg.setDisplayMode(id_cut,1) 
105 \endcode
106
107 \anchor tui_section 
108 <br><h2>Section</h2>
109
110 \code
111 import geompy
112 import salome
113 gg = salome.ImportComponentGUI("GEOM")
114
115 # create a vertex and a vector
116 p1 = geompy.MakeVertex(25, 55, 0)
117 p2 = geompy.MakeVertex( 0,  0, 0)
118 v = geompy.MakeVector(p1, p2)
119
120 # create a cylinder
121 height = 35
122 radius1 = 20
123 cylinder = geompy.MakeCylinder(p1, v, radius1, height)
124
125 # create a sphere
126 sphere = geompy.MakeSphereR(40)
127
128 # make a section
129 section = geompy.MakeSection(cylinder, sphere)
130
131 # add objects in the study
132 id_section = geompy.addToStudy(section, "Section")
133
134 # display the results
135 gg.createAndDisplayGO(id_section)
136 gg.setDisplayMode(id_section,1) 
137 \endcode
138
139 */