5 # Criterion : AREA > 20
6 aFilter = smesh_builder.GetFilter(SMESH.FACE, SMESH.FT_Area, SMESH.FT_MoreThan, 20.)
8 anIds = mesh.GetIdsFromFilter(aFilter)
10 print("Criterion: Area > 20, Nb = ", len(anIds))
12 # create a group by adding elements with area > 20
13 aGroupMain = mesh.MakeGroupByIds("Area > 20", SMESH.FACE, anIds)
15 # Criterion : AREA < 60
16 aFilter = smesh_builder.GetFilter(SMESH.FACE, SMESH.FT_Area, SMESH.FT_LessThan, 60.)
18 anIds = mesh.GetIdsFromFilter(aFilter)
20 print("Criterion: Area < 60, Nb = ", len(anIds))
22 # create a group by adding elements with area < 60
23 aGroupTool = mesh.MakeGroupByIds("Area < 60", SMESH.FACE, anIds)
25 # create a cut of groups : area >= 60
26 aGroupRes = mesh.CutGroups(aGroupMain, aGroupTool, "Area >= 60")
27 print("Criterion: Area >= 60, Nb = ", len(aGroupRes.GetListOfID()))
28 # Please note that also there is CutListOfGroups() method which works with lists of groups of any lengths