smesh/doc/salome/examples/quality_controls_ex07.py

30 lines
638 B
Python
Raw Normal View History

2013-02-12 20:37:44 +06:00
# Bare border faces
import salome
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
2017-06-13 15:01:10 +05:00
geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
2017-06-13 15:01:10 +05:00
smesh = smeshBuilder.New()
import salome_notebook
2013-02-12 20:37:44 +06:00
box = geompy.MakeBoxDXDYDZ(100, 100, 100)
geompy.addToStudy( box, "box" )
mesh = smesh.Mesh(box)
mesh.Segment().NumberOfSegments(3)
mesh.Quadrangle()
mesh.Compute()
# remove 2 faces
allFaces = mesh.GetElementsByType(SMESH.FACE)
2013-02-12 20:37:44 +06:00
mesh.RemoveElements( allFaces[0:2])
bareGroup = mesh.MakeGroup("bare faces", SMESH.FACE, SMESH.FT_BareBorderFace)
2013-02-12 20:37:44 +06:00
assert(bareGroup.Size() == 3)