1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
4 # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
5 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License.
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this library; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 # File : SMESH_control.py
24 # Author : Sergey LITONIN
31 mesh = SMESH_mechanic.mesh
34 # ---- Criterion : AREA > 100
37 aGroup = mesh.MakeGroup("Area > 100", smesh.FACE, smesh.FT_Area, smesh.FT_MoreThan, 100)
40 anIds = aGroup.GetIDs()
41 print "Criterion: Area > 100 Nb = ", len( anIds )
42 #for i in range( len( anIds ) ):
46 # ---- Criterion : Taper > 3e-15
49 aGroup = mesh.MakeGroup("Taper > 3e-15", smesh.FACE, smesh.FT_Taper, smesh.FT_MoreThan, 3e-15)
52 anIds = aGroup.GetIDs()
53 print "Criterion: Taper > 3e-15 Nb = ", len( anIds )
54 #for i in range( len( anIds ) ):
58 # ---- Criterion : ASPECT RATIO > 1.3
61 aGroup = mesh.MakeGroup("Aspect Ratio > 1.3", smesh.FACE, smesh.FT_AspectRatio, smesh.FT_MoreThan, 1.3)
64 anIds = aGroup.GetIDs()
65 print "Criterion: Aspect Ratio > 1.3 Nb = ", len( anIds )
66 #for i in range( len( anIds ) ):
70 # ---- Criterion : MINIMUM ANGLE < 30
73 aGroup = mesh.MakeGroup("Minimum Angle < 30", smesh.FACE, smesh.FT_MinimumAngle, smesh.FT_LessThan, 30)
76 anIds = aGroup.GetIDs()
77 print "Criterion: Minimum Angle < 30 Nb = ", len( anIds )
78 #for i in range( len( anIds ) ):
82 # ---- Criterion : Warp > 2e-13
85 aGroup = mesh.MakeGroup("Warp > 2e-13", smesh.FACE, smesh.FT_Warping, smesh.FT_MoreThan, 2e-13 )
88 anIds = aGroup.GetIDs()
89 print "Criterion: Warp > 2e-13 Nb = ", len( anIds )
90 #for i in range( len( anIds ) ):
94 # ---- Criterion : Skew > 18
97 aGroup = mesh.MakeGroup("Skew > 18", smesh.FACE, smesh.FT_Skew, smesh.FT_MoreThan, 18 )
100 anIds = aGroup.GetIDs()
101 print "Criterion: Skew > 18 Nb = ", len( anIds )
102 #for i in range( len( anIds ) ):
106 # Criterion : Length > 10
109 aGroup = mesh.MakeGroup("Length > 10", smesh.FACE, smesh.FT_Length, smesh.FT_MoreThan, 10 )
112 anIds = aGroup.GetIDs()
113 print "Criterion: Length > 10 Nb = ", len( anIds )
114 #for i in range( len( anIds ) ):
118 # Criterion : Borders at multi-connections = 2
121 aGroup = mesh.MakeGroup("Borders at multi-connections = 2", smesh.EDGE, smesh.FT_MultiConnection, smesh.FT_EqualTo, 2)
124 anIds = aGroup.GetIDs()
125 print "Criterion: Borders at multi-connections = 2 Nb = ", len( anIds )
126 #for i in range( len( anIds ) ):
130 salome.sg.updateObjBrowser(1)