smesh/doc/examples/quality_controls_ex10.py

21 lines
622 B
Python
Raw Permalink Normal View History

2022-04-11 18:28:01 +05:00
# Over-constrained volumes
import salome
salome.salome_init_without_session()
import SMESH
from salome.smesh import smeshBuilder
smesh_builder = smeshBuilder.New()
mesh = smesh_builder.Mesh()
volumeFilter = smesh_builder.GetFilter(SMESH.VOLUME,SMESH.FT_OverConstrainedVolume)
# make volumes by extrusion of one face
n1 = mesh.AddNode(0,0,0)
n2 = mesh.AddNode(10,0,0)
edge = mesh.AddEdge([n1,n2])
mesh.ExtrusionSweep([edge], smesh_builder.MakeDirStruct(0,7,0), 1)
mesh.ExtrusionSweep( mesh.GetElementsByType(SMESH.FACE), smesh_builder.MakeDirStruct(0,0,5), 7)
assert( 7 == len( mesh.GetIdsFromFilter( volumeFilter )))