Salome HOME
Bug 0020072: GHS3DPRLPLUGIN update. Integrating the attached patch.
[modules/smesh.git] / src / SMESH_SWIG / SMESH_controls.py
1 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 #
3 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 #  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 #
6 #  This library is free software; you can redistribute it and/or
7 #  modify it under the terms of the GNU Lesser General Public
8 #  License as published by the Free Software Foundation; either
9 #  version 2.1 of the License.
10 #
11 #  This library is distributed in the hope that it will be useful,
12 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 #  Lesser General Public License for more details.
15 #
16 #  You should have received a copy of the GNU Lesser General Public
17 #  License along with this library; if not, write to the Free Software
18 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 #
20 #  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 #
22 #  File   : SMESH_control.py
23 #  Author : Sergey LITONIN
24 #  Module : SMESH
25 #
26 import smesh
27 import SMESH_mechanic
28
29 salome = smesh.salome
30 mesh   = SMESH_mechanic.mesh
31
32
33 # ---- Criterion : AREA > 100
34
35 # create group
36 aGroup = mesh.MakeGroup("Area > 100", smesh.FACE, smesh.FT_Area, smesh.FT_MoreThan, 100)
37
38 # print result
39 anIds = aGroup.GetIDs()
40 print "Criterion: Area > 100 Nb = ", len( anIds )
41 #for i in range( len( anIds ) ):
42   #print anIds[ i ]
43
44
45 # ----  Criterion : Taper > 3e-15
46
47 # create group
48 aGroup = mesh.MakeGroup("Taper > 3e-15", smesh.FACE, smesh.FT_Taper, smesh.FT_MoreThan, 3e-15)
49
50 # print result
51 anIds = aGroup.GetIDs()
52 print "Criterion: Taper > 3e-15 Nb = ", len( anIds )
53 #for i in range( len( anIds ) ):
54   #print anIds[ i ]
55
56
57 # ----  Criterion : ASPECT RATIO > 1.3
58
59 # create group
60 aGroup = mesh.MakeGroup("Aspect Ratio > 1.3", smesh.FACE, smesh.FT_AspectRatio, smesh.FT_MoreThan, 1.3)
61
62 # print result
63 anIds = aGroup.GetIDs()
64 print "Criterion: Aspect Ratio > 1.3 Nb = ", len( anIds )
65 #for i in range( len( anIds ) ):
66   #print anIds[ i ]
67
68
69 # ----  Criterion : MINIMUM ANGLE < 30
70
71 # create group
72 aGroup = mesh.MakeGroup("Minimum Angle < 30", smesh.FACE, smesh.FT_MinimumAngle, smesh.FT_LessThan, 30)
73
74 # print result
75 anIds = aGroup.GetIDs()
76 print "Criterion: Minimum Angle < 30 Nb = ", len( anIds )
77 #for i in range( len( anIds ) ):
78   #print anIds[ i ]
79
80
81 # ---- Criterion : Warp > 2e-13
82
83 # create group
84 aGroup = mesh.MakeGroup("Warp > 2e-13", smesh.FACE, smesh.FT_Warping, smesh.FT_MoreThan, 2e-13 )
85
86 # print result
87 anIds = aGroup.GetIDs()
88 print "Criterion: Warp > 2e-13 Nb = ", len( anIds )
89 #for i in range( len( anIds ) ):
90   #print anIds[ i ]
91
92
93 # ---- Criterion : Skew > 18
94
95 # create group
96 aGroup = mesh.MakeGroup("Skew > 18", smesh.FACE, smesh.FT_Skew, smesh.FT_MoreThan, 18 )
97
98 # print result
99 anIds = aGroup.GetIDs()
100 print "Criterion: Skew > 18 Nb = ", len( anIds )
101 #for i in range( len( anIds ) ):
102   #print anIds[ i ]
103
104
105 # Criterion : Length > 10
106
107 # create group
108 aGroup = mesh.MakeGroup("Length > 10", smesh.FACE, smesh.FT_Length, smesh.FT_MoreThan, 10 )
109
110 # print result
111 anIds = aGroup.GetIDs()
112 print "Criterion: Length > 10 Nb = ", len( anIds )
113 #for i in range( len( anIds ) ):
114   #print anIds[ i ]
115
116
117 # Criterion : Borders at multi-connections = 2
118
119 # create group
120 aGroup = mesh.MakeGroup("Borders at multi-connections = 2", smesh.EDGE, smesh.FT_MultiConnection, smesh.FT_EqualTo, 2)
121
122 # print result
123 anIds = aGroup.GetIDs()
124 print "Criterion: Borders at multi-connections = 2 Nb = ", len( anIds )
125 #for i in range( len( anIds ) ):
126   #print anIds[ i ]
127
128
129 salome.sg.updateObjBrowser(1)