3 \page tui_boolean_operations_page Boolean Operations
11 gg = salome.ImportComponentGUI("GEOM")
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)
21 cylinder = geompy.MakeCylinder(p1, v, radius1, height)
24 sphere = geompy.MakeSphereR(40)
27 fuse1 = geompy.MakeFuse(cylinder, sphere)
28 fuse2 = geompy.MakeBoolean(cylinder, sphere, 3)
30 # add objects in the study
31 id_cylinder = geompy.addToStudy(cylinder, "Cylinder")
32 id_sphere = geompy.addToStudy(sphere, "Sphere")
33 id_fuse1 = geompy.addToStudy(fuse1, "Fuse_1")
34 id_fuse2 = geompy.addToStudy(fuse2, "Fuse_2")
37 gg.createAndDisplayGO(id_cylinder)
38 gg.setDisplayMode(id_cylinder,1)
39 gg.createAndDisplayGO(id_sphere)
40 gg.setDisplayMode(id_sphere,1)
41 gg.createAndDisplayGO(id_fuse1)
42 gg.setDisplayMode(id_fuse1,1)
43 gg.createAndDisplayGO(id_fuse2)
44 gg.setDisplayMode(id_fuse2,1)
53 gg = salome.ImportComponentGUI("GEOM")
55 # create a vertex and a vector
56 p1 = geompy.MakeVertex(25, 55, 0)
57 p2 = geompy.MakeVertex( 0, 0, 0)
58 v = geompy.MakeVector(p1, p2)
63 cylinder = geompy.MakeCylinder(p1, v, radius1, height)
66 sphere = geompy.MakeSphereR(40)
69 common = geompy.MakeCommon(cylinder, sphere)
71 # add objects in the study
72 id_common = geompy.addToStudy(common, "Common")
75 gg.createAndDisplayGO(id_common)
76 gg.setDisplayMode(id_common,1)
85 gg = salome.ImportComponentGUI("GEOM")
87 # create a vertex and a vector
88 p1 = geompy.MakeVertex(25, 55, 0)
89 p2 = geompy.MakeVertex( 0, 0, 0)
90 v = geompy.MakeVector(p1, p2)
95 cylinder = geompy.MakeCylinder(p1, v, radius1, height)
98 sphere = geompy.MakeSphereR(40)
101 cut = geompy.MakeCut(cylinder, sphere)
103 # add objects in the study
104 id_cut = geompy.addToStudy(cut, "Cut")
106 # display the results
107 gg.createAndDisplayGO(id_cut)
108 gg.setDisplayMode(id_cut,1)
117 gg = salome.ImportComponentGUI("GEOM")
119 # create a vertex and a vector
120 p1 = geompy.MakeVertex(25, 55, 0)
121 p2 = geompy.MakeVertex( 0, 0, 0)
122 v = geompy.MakeVector(p1, p2)
127 cylinder = geompy.MakeCylinder(p1, v, radius1, height)
130 sphere = geompy.MakeSphereR(40)
133 section = geompy.MakeSection(cylinder, sphere)
135 # add objects in the study
136 id_section = geompy.addToStudy(section, "Section")
138 # display the results
139 gg.createAndDisplayGO(id_section)
140 gg.setDisplayMode(id_section,1)