Salome HOME
Merge from V6_main 19/03/2013
[modules/smesh.git] / doc / salome / examples / quality_controls_ex17.py
1 # Warping
2
3 import SMESH_mechanic
4
5 smesh  = SMESH_mechanic.smesh
6 mesh   = SMESH_mechanic.mesh
7 salome = SMESH_mechanic.salome
8
9 # Criterion : WARP ANGLE > 1e-15
10 wa_margin = 1e-15
11
12 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Warping, smesh.FT_MoreThan, wa_margin)
13
14 anIds = mesh.GetIdsFromFilter(aFilter) 
15
16 # print the result
17 print "Criterion: Warp > ", wa_margin, " Nb = ", len(anIds)
18 j = 1
19 for i in range(len(anIds)):
20   if j > 20: j = 1; print ""
21   print anIds[i],
22   j = j + 1
23   pass
24 print ""
25
26 # create a group
27 aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Warp > " + `wa_margin`)
28
29 aGroup.Add(anIds)
30
31 salome.sg.updateObjBrowser(1)