]> SALOME platform Git repositories - modules/smesh.git/blob - doc/salome/examples/quality_controls_ex17.py
Salome HOME
[bos #23982] EDF 22984 - aspect ratio of hexa
[modules/smesh.git] / doc / salome / examples / quality_controls_ex17.py
1 # Warping
2
3 import SMESH_mechanic
4 import SMESH
5
6 smesh  = SMESH_mechanic.smesh
7 mesh   = SMESH_mechanic.mesh
8 salome = SMESH_mechanic.salome
9
10 # Criterion : WARP ANGLE > 1e-15
11 wa_margin = 1e-15
12
13 aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Warping, SMESH.FT_MoreThan, wa_margin)
14
15 anIds = mesh.GetIdsFromFilter(aFilter) 
16
17 # print the result
18 print("Criterion: Warp > ", wa_margin, " Nb = ", len(anIds))
19 j = 1
20 for i in range(len(anIds)):
21   if j > 20: j = 1; print("")
22   print(anIds[i], end=' ')
23   j = j + 1
24   pass
25 print("")
26
27 # create a group
28 aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Warp > " + repr(wa_margin))
29
30 aGroup.Add(anIds)
31
32 salome.sg.updateObjBrowser()