X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=doc%2Fsalome%2Fexamples%2Fquality_controls_defl.py;h=9c018e8ded479b58cd8746fc9127458c389406d2;hb=15fdc1b6fc53ec90f8f3abf5f1dafdb469217c17;hp=9105fee6a37d445e42e50be7e2c6856775b05a6c;hpb=05a257d4f4e64a05ba8bb953efd5a2f1846e3fe1;p=modules%2Fsmesh.git diff --git a/doc/salome/examples/quality_controls_defl.py b/doc/salome/examples/quality_controls_defl.py index 9105fee6a..9c018e8de 100644 --- a/doc/salome/examples/quality_controls_defl.py +++ b/doc/salome/examples/quality_controls_defl.py @@ -4,11 +4,11 @@ import salome salome.salome_init() from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # fuse a box and a sphere Sphere_1 = geompy.MakeSphereR(100) @@ -24,22 +24,22 @@ mesh.Compute() # get min and max deflection minMax = mesh.GetMinMax( SMESH.FT_Deflection2D ) -print "min and max deflection: ", minMax +print("min and max deflection: ", minMax) # get deflection of a certain face faceID = mesh.NbEdges() + mesh.NbFaces() defl = mesh.FunctorValue( SMESH.FT_Deflection2D, faceID ) -print "deflection of face %s = %s" % ( faceID, defl ) +print("deflection of face %s = %s" % ( faceID, defl )) margin = minMax[1] / 2 # get all faces with deflection LESS than the margin aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Deflection2D, '<', margin, mesh=mesh) anIds = aFilter.GetIDs() -print "%s faces have deflection less than %s" %( len(anIds), margin ) +print("%s faces have deflection less than %s" %( len(anIds), margin )) # create a group of faces with deflection MORE than the margin -aGroup = mesh.MakeGroup("Deflection > " + `margin`, SMESH.FACE, SMESH.FT_Deflection2D,'>',margin) -print "%s faces have deflection more than %s: %s ..." %( aGroup.Size(), margin, aGroup.GetIDs()[:10] ) +aGroup = mesh.MakeGroup("Deflection > " + repr(margin), SMESH.FACE, SMESH.FT_Deflection2D,'>',margin) +print("%s faces have deflection more than %s: %s ..." %( aGroup.Size(), margin, aGroup.GetIDs()[:10] )) -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser()