PAL7221 (DEVELOPMENT : Improve filter which find elements on Shape).

Add "LyingOnGeom" filter.
Add script containing BuildGroupLyingOn(...) function.
This commit is contained in:
mzn 2005-01-17 13:39:04 +00:00
parent 157b19ec7f
commit f0ddb8c3ac
2 changed files with 27 additions and 1 deletions

View File

@ -82,7 +82,8 @@ EXPORT_PYSCRIPTS = libSMESH_Swig.py \
SMESH_demo_hexa2_upd.py \ SMESH_demo_hexa2_upd.py \
SMESH_hexaedre.py \ SMESH_hexaedre.py \
SMESH_Sphere.py \ SMESH_Sphere.py \
SMESH_GroupFromGeom.py SMESH_GroupFromGeom.py \
SMESH_GroupLyingOnGeom.py
LIB_CLIENT_IDL = SALOMEDS.idl \ LIB_CLIENT_IDL = SALOMEDS.idl \
SALOME_Exception.idl \ SALOME_Exception.idl \

View File

@ -0,0 +1,25 @@
import SMESH
def BuildGroupLyingOn(theMesh, theElemType, theName, theShape):
aMeshGen = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH")
aFilterMgr = aMeshGen.CreateFilterManager()
aFilter = aFilterMgr.CreateFilter()
aLyingOnGeom = aFilterMgr.CreateLyingOnGeom()
aLyingOnGeom.SetGeom(theShape)
aLyingOnGeom.SetElementType(theElemType)
aFilter.SetPredicate(aLyingOnGeom)
anIds = aFilter.GetElementsId(theMesh)
aGroup = theMesh.CreateGroup(theElemType, theName)
aGroup.Add(anIds)
#Example
from SMESH_test1 import *
smesh.Compute(mesh, box)
BuildGroupLyingOn(mesh, SMESH.FACE, "Group of faces lying on edge", edge )
salome.sg.updateObjBrowser(1);