1 # Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 # File : SMESH_control.py
23 # Author : Sergey LITONIN
30 mesh = SMESH_mechanic.mesh
33 # ---- Criterion : AREA > 100
36 aGroup = mesh.MakeGroup("Area > 100", smesh.FACE, smesh.FT_Area, smesh.FT_MoreThan, 100)
39 anIds = aGroup.GetIDs()
40 print "Criterion: Area > 100 Nb = ", len( anIds )
41 #for i in range( len( anIds ) ):
45 # ---- Criterion : Taper > 3e-15
48 aGroup = mesh.MakeGroup("Taper > 3e-15", smesh.FACE, smesh.FT_Taper, smesh.FT_MoreThan, 3e-15)
51 anIds = aGroup.GetIDs()
52 print "Criterion: Taper > 3e-15 Nb = ", len( anIds )
53 #for i in range( len( anIds ) ):
57 # ---- Criterion : ASPECT RATIO > 1.3
60 aGroup = mesh.MakeGroup("Aspect Ratio > 1.3", smesh.FACE, smesh.FT_AspectRatio, smesh.FT_MoreThan, 1.3)
63 anIds = aGroup.GetIDs()
64 print "Criterion: Aspect Ratio > 1.3 Nb = ", len( anIds )
65 #for i in range( len( anIds ) ):
69 # ---- Criterion : MINIMUM ANGLE < 30
72 aGroup = mesh.MakeGroup("Minimum Angle < 30", smesh.FACE, smesh.FT_MinimumAngle, smesh.FT_LessThan, 30)
75 anIds = aGroup.GetIDs()
76 print "Criterion: Minimum Angle < 30 Nb = ", len( anIds )
77 #for i in range( len( anIds ) ):
81 # ---- Criterion : Warp > 2e-13
84 aGroup = mesh.MakeGroup("Warp > 2e-13", smesh.FACE, smesh.FT_Warping, smesh.FT_MoreThan, 2e-13 )
87 anIds = aGroup.GetIDs()
88 print "Criterion: Warp > 2e-13 Nb = ", len( anIds )
89 #for i in range( len( anIds ) ):
93 # ---- Criterion : Skew > 18
96 aGroup = mesh.MakeGroup("Skew > 18", smesh.FACE, smesh.FT_Skew, smesh.FT_MoreThan, 18 )
99 anIds = aGroup.GetIDs()
100 print "Criterion: Skew > 18 Nb = ", len( anIds )
101 #for i in range( len( anIds ) ):
105 # Criterion : Length > 10
108 aGroup = mesh.MakeGroup("Length > 10", smesh.FACE, smesh.FT_Length, smesh.FT_MoreThan, 10 )
111 anIds = aGroup.GetIDs()
112 print "Criterion: Length > 10 Nb = ", len( anIds )
113 #for i in range( len( anIds ) ):
117 # Criterion : Borders at multi-connections = 2
120 aGroup = mesh.MakeGroup("Borders at multi-connections = 2", smesh.EDGE, smesh.FT_MultiConnection, smesh.FT_EqualTo, 2)
123 anIds = aGroup.GetIDs()
124 print "Criterion: Borders at multi-connections = 2 Nb = ", len( anIds )
125 #for i in range( len( anIds ) ):
129 salome.sg.updateObjBrowser(1)