]> SALOME platform Git repositories - modules/geom.git/blob - doc/salome/examples/blocks_operations_ex02.py
Salome HOME
Merge from V6_main 11/02/2013
[modules/geom.git] / doc / salome / examples / blocks_operations_ex02.py
1 # Explode on Blocks
2
3 import geompy
4 import salome
5 gg = salome.ImportComponentGUI("GEOM")
6
7 # create a box and a sphere
8 box = geompy.MakeBoxDXDYDZ(200, 200, 200)
9 sphere = geompy.MakeSphereR(100)
10
11 # make a compound
12 compound = geompy.MakeCompound([box, sphere])
13
14 # get all the blocks of the given compound, by criteria: min_nb_faces <= nb. of faces <= max_nb_faces
15 min_nb_faces = 6
16 max_nb_faces = 6
17 make_block_explode = geompy.MakeBlockExplode(compound, min_nb_faces, max_nb_faces)
18
19 # add objects in the study
20 id_compound = geompy.addToStudy(compound, "Compound")
21 id_make_block_explode = geompy.addToStudyInFather(compound, make_block_explode[0], "MakeBlockExplode")
22
23 # display the results
24 gg.createAndDisplayGO(id_compound)
25 gg.createAndDisplayGO(id_make_block_explode)
26 gg.setDisplayMode(id_make_block_explode,1)