2013-02-12 20:37:44 +06:00
|
|
|
# Bare border volumes
|
|
|
|
|
2013-04-04 13:08:19 +06:00
|
|
|
|
|
|
|
import salome
|
|
|
|
salome.salome_init()
|
|
|
|
import GEOM
|
|
|
|
from salome.geom import geomBuilder
|
2017-06-13 15:01:10 +05:00
|
|
|
geompy = geomBuilder.New()
|
2013-04-04 13:08:19 +06:00
|
|
|
|
|
|
|
import SMESH, SALOMEDS
|
|
|
|
from salome.smesh import smeshBuilder
|
2017-06-13 15:01:10 +05:00
|
|
|
smesh = smeshBuilder.New()
|
2013-04-04 13:08:19 +06:00
|
|
|
import salome_notebook
|
|
|
|
|
2013-02-12 20:37:44 +06:00
|
|
|
|
|
|
|
box = geompy.MakeBoxDXDYDZ(100, 30, 10)
|
|
|
|
# the smallest face of the box
|
|
|
|
face = geompy.SubShapeAllSorted( box, geompy.ShapeType["FACE"])[0]
|
|
|
|
|
|
|
|
geompy.addToStudy( box, "box" )
|
|
|
|
geompy.addToStudyInFather( box, face, "face" )
|
|
|
|
|
2013-04-04 13:08:19 +06:00
|
|
|
mesh = smesh.Mesh(box)
|
2013-02-12 20:37:44 +06:00
|
|
|
mesh.AutomaticHexahedralization();
|
|
|
|
|
|
|
|
# remove half of mesh faces from the smallest face
|
|
|
|
faceFaces = mesh.GetSubMeshElementsId(face)
|
2017-03-29 19:58:59 +05:00
|
|
|
faceToRemove = faceFaces[: len(faceFaces) // 2]
|
2013-02-12 20:37:44 +06:00
|
|
|
mesh.RemoveElements( faceToRemove )
|
|
|
|
|
|
|
|
# make a group of volumes missing the removed faces
|
2013-04-04 13:08:19 +06:00
|
|
|
bareGroup = mesh.MakeGroup("bare volumes", SMESH.VOLUME, SMESH.FT_BareBorderVolume)
|
2013-02-12 20:37:44 +06:00
|
|
|
assert(bareGroup.Size() == len( faceToRemove))
|