2013-02-12 20:37:44 +06:00
|
|
|
# Bare border faces
|
|
|
|
|
2013-04-04 13:08:19 +06:00
|
|
|
import salome
|
2021-08-12 14:38:10 +05:00
|
|
|
salome.salome_init_without_session()
|
2013-04-04 13:08:19 +06:00
|
|
|
|
2022-04-11 18:28:01 +05:00
|
|
|
import SMESH
|
|
|
|
from salome.geom import geomBuilder
|
2013-04-04 13:08:19 +06:00
|
|
|
from salome.smesh import smeshBuilder
|
|
|
|
|
2022-04-11 18:28:01 +05:00
|
|
|
geom_builder = geomBuilder.New()
|
|
|
|
smesh_builder = smeshBuilder.New()
|
2013-02-12 20:37:44 +06:00
|
|
|
|
2022-04-11 18:28:01 +05:00
|
|
|
box = geom_builder.MakeBoxDXDYDZ(100, 100, 100)
|
|
|
|
geom_builder.addToStudy( box, "box" )
|
2013-02-12 20:37:44 +06:00
|
|
|
|
2022-04-11 18:28:01 +05:00
|
|
|
mesh = smesh_builder.Mesh(box)
|
2013-02-12 20:37:44 +06:00
|
|
|
mesh.Segment().NumberOfSegments(3)
|
|
|
|
mesh.Quadrangle()
|
2023-02-21 18:59:44 +05:00
|
|
|
if not mesh.Compute(): raise Exception("Error when computing Mesh")
|
2013-02-12 20:37:44 +06:00
|
|
|
|
|
|
|
# remove 2 faces
|
2013-04-04 13:08:19 +06:00
|
|
|
allFaces = mesh.GetElementsByType(SMESH.FACE)
|
2013-02-12 20:37:44 +06:00
|
|
|
mesh.RemoveElements( allFaces[0:2])
|
|
|
|
|
2013-04-04 13:08:19 +06:00
|
|
|
bareGroup = mesh.MakeGroup("bare faces", SMESH.FACE, SMESH.FT_BareBorderFace)
|
2013-02-12 20:37:44 +06:00
|
|
|
assert(bareGroup.Size() == 3)
|