Salome HOME
Merge from V6_main 11/02/2013
[modules/geom.git] / doc / salome / examples / repairing_operations_ex02.py
1 # Suppress Faces
2
3 import geompy
4 import salome
5 gg = salome.ImportComponentGUI("GEOM")
6
7 # create a box
8 box = geompy.MakeBoxDXDYDZ(200, 200, 200)
9
10 # The list of IDs (IDList) for suppress faces
11 sup_faces = []
12 sup_faces = geompy.SubShapeAllSortedCentres(box, geompy.ShapeType["FACE"])
13
14 # get indices of the sub-shape
15 f1_id = geompy.GetSubShapeID(box, sup_faces[3])
16
17 # remove faces from the given object (shape)
18 result = geompy.SuppressFaces(box, [f1_id])
19
20 # add objects in the study
21 id_box = geompy.addToStudy(box, "Box")
22 id_result = geompy.addToStudy(result, "Result")
23
24 # display the results
25 gg.createAndDisplayGO(id_box)
26 gg.setDisplayMode(id_box,1)
27 gg.createAndDisplayGO(id_result)
28 gg.setDisplayMode(id_result,1)