X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=doc%2Fsalome%2Fexamples%2Ffilters_ex36.py;h=ec1e2b4fbfc786b08ba5cb60773da10ee956be7c;hp=3dc8e4fc6443614f2e6deacf038496b63a41e97e;hb=831ca6c828271732e46fba73b196d423482535ae;hpb=70e7642a8cdf2191e246458ec5f8294a6ced6344 diff --git a/doc/salome/examples/filters_ex36.py b/doc/salome/examples/filters_ex36.py index 3dc8e4fc6..ec1e2b4fb 100644 --- a/doc/salome/examples/filters_ex36.py +++ b/doc/salome/examples/filters_ex36.py @@ -1,13 +1,17 @@ -# Combine filters with Criterion structures using of "criteria". +# Combine several criteria into a filter # create mesh from SMESH_mechanic import * + # get all the quadrangle faces ... criterion1 = smesh.GetCriterion(SMESH.FACE, SMESH.FT_ElemGeomType, SMESH.Geom_QUADRANGLE, SMESH.FT_LogicalAND) -# ... AND do NOT get those from sub_face3 +# ... but those from sub_face3 criterion2 = smesh.GetCriterion(SMESH.FACE, SMESH.FT_BelongToGeom, sub_face3, SMESH.FT_LogicalNOT) -filter = smesh.CreateFilterManager().CreateFilter() -filter.SetCriteria([criterion1,criterion2]) -ids = mesh.GetIdsFromFilter(filter) -myGroup = mesh.MakeGroupByIds("Quads_on_cylindrical_faces",SMESH.FACE,ids) +quadFilter = smesh.GetFilterFromCriteria([criterion1,criterion2]) + +# get faces satisfying the criteria +ids = mesh.GetIdsFromFilter(quadFilter) + +# create a group of faces satisfying the criteria +myGroup = mesh.GroupOnFilter(SMESH.FACE,"Quads_on_cylindrical_faces",quadFilter)