X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=doc%2Fsalome%2Fexamples%2Ffilters_belong2group.py;h=b3b5b61b7c8c8b9e16502c0e6745c94683a8e1d8;hb=6d32f944a0a115b6419184c50b57bf7c4eef5786;hp=889c0aef7c24cd3925b1e1608ad54a51256c7f3d;hpb=7a65c9fad427b1ccba6b9ccae612296e5092a324;p=modules%2Fsmesh.git diff --git a/doc/salome/examples/filters_belong2group.py b/doc/salome/examples/filters_belong2group.py index 889c0aef7..b3b5b61b7 100644 --- a/doc/salome/examples/filters_belong2group.py +++ b/doc/salome/examples/filters_belong2group.py @@ -2,17 +2,18 @@ # create mesh from SMESH_mechanic import * +print() # create a group of all faces (quadrangles) generated on sub_face3 -faces_on_face3 = mesh.MakeGroup("faces_on_face3", SMESH.FACE, SMESH.FT_BelongToGeom,'=',sub_face3) -print "There are %s quadrangles generated on '%s' and included in the group '%s'" % ( faces_on_face3.Size(), sub_face3.GetName(), faces_on_face3.GetName() ) +quads_on_face3 = mesh.MakeGroup("quads_on_face3", SMESH.FACE, SMESH.FT_BelongToGeom,'=',sub_face3) +print("There are %s quadrangles generated on '%s' and included in the group '%s'" % ( quads_on_face3.Size(), sub_face3.GetName(), quads_on_face3.GetName() )) # create a group of all the rest quadrangles, generated on other faces by combining 2 criteria: -# - negated FT_BelongToMeshGroup to select elements not included in faces_on_face3 +# - negated FT_BelongToMeshGroup to select elements not included in quads_on_face3 # - FT_ElemGeomType to select quadrangles -not_on_face3 = smesh.GetCriterion( SMESH.FACE, SMESH.FT_BelongToMeshGroup,'=',faces_on_face3, SMESH.FT_LogicalNOT ) +not_on_face3 = smesh.GetCriterion( SMESH.FACE, SMESH.FT_BelongToMeshGroup,'=',quads_on_face3, SMESH.FT_LogicalNOT ) quadrangles = smesh.GetCriterion( SMESH.FACE, SMESH.FT_ElemGeomType,'=',SMESH.Geom_QUADRANGLE ) rest_quads = mesh.MakeGroupByCriteria("rest_quads", [ not_on_face3, quadrangles ]) -print "'%s' group includes all the rest %s quadrangles" % ( rest_quads.GetName(), rest_quads.Size() ) +print("'%s' group includes all the rest %s quadrangles" % ( rest_quads.GetName(), rest_quads.Size() ))