X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=doc%2Fsalome%2Fexamples%2Fboolean_operations_ex02.py;h=b37e081ec53bb5f8f660bff720b8230bbec42657;hb=8d33dd3a86bbcf751c5cab63d04f3158e31f9c76;hp=90317ba93efe389d951cfbed3b28b05f04fb7c64;hpb=3f9390adf4628a2ed448be3bd6f85546bf056457;p=modules%2Fgeom.git diff --git a/doc/salome/examples/boolean_operations_ex02.py b/doc/salome/examples/boolean_operations_ex02.py index 90317ba93..b37e081ec 100644 --- a/doc/salome/examples/boolean_operations_ex02.py +++ b/doc/salome/examples/boolean_operations_ex02.py @@ -1,10 +1,10 @@ # Common import salome -salome.salome_init() +salome.salome_init_without_session() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() gg = salome.ImportComponentGUI("GEOM") # create a vertex and a vector @@ -20,12 +20,28 @@ cylinder = geompy.MakeCylinder(p1, v, radius1, height) # create a sphere sphere = geompy.MakeSphereR(40) +# create a box +box = geompy.MakeBoxDXDYDZ(80, 80, 80) + # make common -common = geompy.MakeCommon(cylinder, sphere) +common1 = geompy.MakeCommon(cylinder, sphere) +common2 = geompy.MakeCommonList([cylinder, sphere, box]) # add objects in the study -id_common = geompy.addToStudy(common, "Common") +id_cylinder = geompy.addToStudy(cylinder, "Cylinder") +id_sphere = geompy.addToStudy(sphere, "Sphere") +id_box = geompy.addToStudy(box, "Box") +id_common1 = geompy.addToStudy(common1, "Common_1") +id_common2 = geompy.addToStudy(common2, "Common_2") # display the results -gg.createAndDisplayGO(id_common) -gg.setDisplayMode(id_common,1) +gg.createAndDisplayGO(id_cylinder) +gg.setDisplayMode(id_cylinder,1) +gg.createAndDisplayGO(id_sphere) +gg.setDisplayMode(id_sphere,1) +gg.createAndDisplayGO(id_box) +gg.setDisplayMode(id_box,1) +gg.createAndDisplayGO(id_common1) +gg.setDisplayMode(id_common1,1) +gg.createAndDisplayGO(id_common2) +gg.setDisplayMode(id_common2,1)