4 salome.salome_init_without_session()
7 from salome.geom import geomBuilder
8 from salome.smesh import smeshBuilder
10 geom_builder = geomBuilder.New()
11 smesh_builder = smeshBuilder.New()
13 box = geom_builder.MakeBoxDXDYDZ(100, 30, 10)
14 # the smallest face of the box
15 face = geom_builder.SubShapeAllSorted( box, geom_builder.ShapeType["FACE"])[0]
17 geom_builder.addToStudy( box, "box" )
18 geom_builder.addToStudyInFather( box, face, "face" )
20 mesh = smesh_builder.Mesh(box)
21 mesh.AutomaticHexahedralization();
23 # remove half of mesh faces from the smallest face
24 faceFaces = mesh.GetSubMeshElementsId(face)
25 faceToRemove = faceFaces[: len(faceFaces) // 2]
26 mesh.RemoveElements( faceToRemove )
28 # make a group of volumes missing the removed faces
29 bareGroup = mesh.MakeGroup("bare volumes", SMESH.VOLUME, SMESH.FT_BareBorderVolume)
30 assert(bareGroup.Size() == len( faceToRemove))