]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
PAL7221 (DEVELOPMENT : Improve filter which find elements on Shape).
authormzn <mzn@opencascade.com>
Mon, 17 Jan 2005 13:39:04 +0000 (13:39 +0000)
committermzn <mzn@opencascade.com>
Mon, 17 Jan 2005 13:39:04 +0000 (13:39 +0000)
Add "LyingOnGeom" filter.
Add script containing BuildGroupLyingOn(...) function.

src/SMESH_SWIG/Makefile.in
src/SMESH_SWIG/SMESH_GroupLyingOnGeom.py [new file with mode: 0644]

index 4034f1e1eb54fa8b2ea42d6ab2250d30c8b874ee..1b40066fab0da6c8b4899eb82649b143a5dbcfa4 100644 (file)
@@ -82,7 +82,8 @@ EXPORT_PYSCRIPTS = libSMESH_Swig.py \
                   SMESH_demo_hexa2_upd.py \
                   SMESH_hexaedre.py \
                   SMESH_Sphere.py \
-                  SMESH_GroupFromGeom.py
+                  SMESH_GroupFromGeom.py \
+                  SMESH_GroupLyingOnGeom.py
 
 LIB_CLIENT_IDL = SALOMEDS.idl \
                 SALOME_Exception.idl \
diff --git a/src/SMESH_SWIG/SMESH_GroupLyingOnGeom.py b/src/SMESH_SWIG/SMESH_GroupLyingOnGeom.py
new file mode 100644 (file)
index 0000000..0df585e
--- /dev/null
@@ -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);