Salome HOME
77e7e4c9454548aa88c53a285e5d7efa8a2942e3
[modules/smesh.git] / doc / salome / examples / quality_controls_ex08.py
1 # Bare border volumes
2
3 from smesh import *
4 SetCurrentStudy(salome.myStudy)
5
6 box = geompy.MakeBoxDXDYDZ(100, 30, 10)
7 # the smallest face of the box
8 face = geompy.SubShapeAllSorted( box, geompy.ShapeType["FACE"])[0]
9
10 geompy.addToStudy( box, "box" )
11 geompy.addToStudyInFather( box, face, "face" )
12
13 mesh = Mesh(box)
14 mesh.AutomaticHexahedralization();
15
16 # remove half of mesh faces from the smallest face
17 faceFaces = mesh.GetSubMeshElementsId(face)
18 faceToRemove = faceFaces[: len(faceFaces)/2]
19 mesh.RemoveElements( faceToRemove )
20
21 # make a group of volumes missing the removed faces
22 bareGroup = mesh.MakeGroup("bare volumes", VOLUME, FT_BareBorderVolume)
23 assert(bareGroup.Size() == len( faceToRemove))