Salome HOME
6dc223afbd6ad65abc96200d2e22580b77724ea6
[modules/geom.git] / doc / salome / examples / repairing_operations_ex02.py
1 # Suppress Faces
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 a box
11 box = geompy.MakeBoxDXDYDZ(200, 200, 200)
12
13 # The list of IDs (IDList) for suppress faces
14 sup_faces = []
15 sup_faces = geompy.SubShapeAllSortedCentres(box, geompy.ShapeType["FACE"])
16
17 # get indices of the sub-shape
18 f1_id = geompy.GetSubShapeID(box, sup_faces[3])
19
20 # remove faces from the given object (shape)
21 result = geompy.SuppressFaces(box, [f1_id])
22
23 # add objects in the study
24 id_box = geompy.addToStudy(box, "Box")
25 id_result = geompy.addToStudy(result, "Result")
26
27 # display the results
28 gg.createAndDisplayGO(id_box)
29 gg.setDisplayMode(id_box,1)
30 gg.createAndDisplayGO(id_result)
31 gg.setDisplayMode(id_result,1)