Salome HOME
IPAL53011: Order of sub-mesh in meshing process does't work
[modules/smesh.git] / doc / salome / examples / filters_ex01.py
index 8af735e71aaed8ecfc5dc037c417d4bba0d52c94..7de1cd33addd6c138fb1a2d1abced051f20de470 100644 (file)
@@ -4,14 +4,19 @@
 # create mesh
 from SMESH_mechanic import *
 
-# get faces with aspect ratio > 1.5
-filter = smesh.GetFilter(SMESH.FACE, SMESH.FT_AspectRatio, SMESH.FT_MoreThan, 1.5)
+# get faces with aspect ratio > 2.5
+filter = smesh.GetFilter(SMESH.FACE, SMESH.FT_AspectRatio, SMESH.FT_MoreThan, 2.5)
 ids = mesh.GetIdsFromFilter(filter)
+print "Number of faces with aspect ratio > 2.5:", len(ids)
+
+# get faces with aspect ratio > 1.5
+filter = smesh.GetFilter(SMESH.FACE, SMESH.FT_AspectRatio, '>', 1.5, mesh=mesh)
+ids = filter.GetIDs()
 print "Number of faces with aspect ratio > 1.5:", len(ids)
 
 # copy the faces with aspect ratio > 1.5 to another mesh;
 # this demostrates that a filter can be used where usually a group or sub-mesh is acceptable
-filter.SetMesh( mesh.GetMesh() )
+filter.SetMesh( mesh.GetMesh() ) # - actually non necessary as mesh is set at filter creation
 mesh2 = smesh.CopyMesh( filter, "AR > 1.5" )
 print "Number of copied faces with aspect ratio > 1.5:", mesh2.NbFaces()