Salome HOME
Merge multi-study removal branch.
[modules/geom.git] / doc / salome / examples / complex_objs_ex11.py
1 # Apply thickness for shell
2
3 import salome
4 salome.salome_init()
5 import GEOM
6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New()
8 gg = salome.ImportComponentGUI("GEOM")
9
10 # create box
11 box = geompy.MakeBoxDXDYDZ(100, 100, 100)
12
13 # get the list of faces
14 faces = geompy.SubShapeAllSortedCentres(box, geompy.ShapeType["FACE"])
15
16 # get the list of face IDs
17 faceIDs = geompy.SubShapeAllSortedCentresIDs(box, geompy.ShapeType["FACE"])
18
19 # make a shell from 3 faces
20 shell = geompy.MakeShell([faces[0], faces[1], faces[2]])
21
22 # apply thickness
23 solid = geompy.MakeThickSolid(shell, 30.)
24
25 # create box
26 hsolid = geompy.MakeBoxDXDYDZ(100, 100, 100)
27
28 # make hollowed solid
29 geompy.Thicken(hsolid, 30., [faceIDs[0], faceIDs[1]])
30
31 # add objects in the study
32 id_shell  = geompy.addToStudy(shell, "Shell")
33 id_solid  = geompy.addToStudy(solid, "Solid")
34 id_hsolid = geompy.addToStudy(hsolid, "Hollowed Solid")
35
36 # display the shell and the result thicknen solid and hollowed solid
37 gg.createAndDisplayGO(id_shell)
38 gg.createAndDisplayGO(id_solid)
39 gg.createAndDisplayGO(id_hsolid)