Salome HOME
22491: EDF 2249 SMESH: Integration of a small python library for quadrangle meshing
authoreap <eap@opencascade.com>
Thu, 13 Mar 2014 13:43:57 +0000 (17:43 +0400)
committereap <eap@opencascade.com>
Thu, 13 Mar 2014 13:43:57 +0000 (17:43 +0400)
  Fix 1) license 2) bugs 3) obsolete import

15 files changed:
resources/SalomeApp.xml.in
src/Tools/CMakeLists.txt
src/Tools/MacMesh/CMakeLists.txt
src/Tools/MacMesh/Example/PressureValve.py.in
src/Tools/MacMesh/MacMesh/Alarms.py
src/Tools/MacMesh/MacMesh/CentralUnrefine.py
src/Tools/MacMesh/MacMesh/CompositeBox.py
src/Tools/MacMesh/MacMesh/CompositeBoxF.py
src/Tools/MacMesh/MacMesh/Config.py
src/Tools/MacMesh/MacMesh/CutnGroup.py
src/Tools/MacMesh/MacMesh/Cylinder.py
src/Tools/MacMesh/MacMesh/GenFunctions.py
src/Tools/MacMesh/MacMesh/MacObject.py
src/Tools/MacMesh/MacMesh/PublishGroups.py
src/Tools/MacMesh/MacMesh/SharpAngle.py

index ed4f2ade6fd8fac5b26d216de448904c1b411a46..aae5691668e37e1afa9cc31480f18bb0eb288e8c 100644 (file)
     <parameter name="User's Guide"      value="%SMESH_ROOT_DIR%/share/doc/salome/gui/SMESH/index.html"/>
     <parameter name="Plug-ins/MGSurfOpt plugin User's Guide" value="%SMESH_ROOT_DIR%/share/doc/salome/gui/SMESH/yams/index.html"/>
     <parameter name="Plug-ins/MGCleaner plugin User's Guide" value="%SMESH_ROOT_DIR%/share/doc/salome/gui/SMESH/MGCleaner/index.html"/>
+    <parameter name="Plug-ins/MacMesh plugin" value="%SMESH_ROOT_DIR%/share/doc/salome/gui/SMESH/MacMesh/index.html"/>
     <parameter name="Developer's Guide" value="%SMESH_ROOT_DIR%/share/doc/salome/tui/SMESH/index.html"/>
   </section>
   <section name="resources">
index 273b753bf3671246a36d63f49cb5aaf91bb243d0..9495dd8c383a8b10bcbbd35b20f84d9aa5c954db 100644 (file)
@@ -21,6 +21,7 @@ ADD_SUBDIRECTORY(MeshCut)
 ADD_SUBDIRECTORY(padder)
 ADD_SUBDIRECTORY(Verima)
 ADD_SUBDIRECTORY(blocFissure)
+ADD_SUBDIRECTORY(MacMesh)
 
 IF(SALOME_BUILD_GUI)
   ADD_SUBDIRECTORY(MGCleanerPlug)
index c50d207077be24a344ccce9968ed540549a363e6..4cf6c7293d5b8d904476abc250658026e9b4da7c 100644 (file)
@@ -17,7 +17,7 @@
 # License along with this library; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 
-See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 
 SET(MACMESH_INSTALL_PY ${SALOME_SMESH_INSTALL_PLUGINS}/MacMesh)
 SET(MACMESH_INSTALL_DOC ${SALOME_INSTALL_DOC}/gui/SMESH/MacMesh)
index e489faf5771a86445a4cbacbcea8937df32df272..713e27f4a0faa287913ca46d70305b739a54faaf 100755 (executable)
@@ -1,9 +1,34 @@
+# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+
+# Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
 ##################################################################
 # Header for salome initialization ###############################
 
-import sys, salome, geompy, smesh, SMESH, math, os
+import sys, salome, math, os
 sys.path.append( os.path.join( os.getenv('SMESH_ROOT_DIR'), '@MACMESH_INSTALL_PY@'))
 
+import Config, GenFunctions
+
+Config.theStudy = salome.myStudy; 
+
 from MacObject import *
 from SharpAngle import *
 from CentralUnrefine import *
@@ -12,10 +37,6 @@ from CompositeBox import *
 from CompositeBoxF import *
 
 
-import Config, GenFunctions
-
-Config.theStudy = salome.myStudy; 
-geompy.init_geom(Config.theStudy)
 
 ##################################################################
 # Mesh name ######################################################
index 939b40e7ca3f080f4bf7deb4e233720a8ca6261e..9bfd71a66754dec401ccd5988fe43effe3fe7e81 100644 (file)
@@ -1,3 +1,24 @@
+# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+
+# Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
 def Message (code) :
        import sys
        MessageString = { 1 : lambda x: "Successfully created \n",
index 1daeb4dbe47ec60816cac2dab5c32db1eecb92a2..2a7c9d59c937c00b64b7f545d9b89c0a02df8218 100644 (file)
@@ -1,9 +1,33 @@
+# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+
+# Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+
+
+
 # This object allows unrefining from a central point (actually, a line) to the exterior
 # X0 and Y0 are the center points of the origin point and not those of the center of the generated block
 
 
 
-import sys, salome, geompy, smesh, SMESH, math, commands
+import sys, math, commands
 CWD = commands.getoutput('pwd')
 sys.path.append(CWD)
 
index 042f69c9c1c4d63bf797e7cafdb04e64dd5b925b..773fc41b74bcb9c5713eea99c39f5825c9509409 100644 (file)
@@ -1,6 +1,29 @@
+# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+
+# Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+
+
 # INTRODUCTION HERE
 
-import sys, salome, geompy, smesh, SMESH, math, copy, commands
+import sys, math, copy, commands
 CWD = commands.getoutput('pwd')
 sys.path.append(CWD)
 
index 62c1414fa1321a34c944e48bb63703c3bcec7c22..88cdc83b05746548d3b326cc1f14eaba10398314 100644 (file)
@@ -1,6 +1,30 @@
+# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+
+# Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+
+
+
 # INTRODUCTION HERE
 
-import sys, salome, geompy, smesh, SMESH, math, copy, commands
+import sys, math, copy, commands
 CWD = commands.getoutput('pwd')
 sys.path.append(CWD)
 
index a86220e7957ffc477fff7cfa337e0ace265eff5a..a0816f497d31fff189bd38b0dee209283aedda8b 100644 (file)
@@ -1,3 +1,26 @@
+# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+
+# Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+
+
 dz = 1
 debug = 1
 
@@ -27,3 +50,11 @@ except NameError : RefPts = []
 
 try : DirIndex
 except NameError : DirIndex = 0
+
+try : theStudy
+except NameError :
+    import salome
+    salome.salome_init()
+    theStudy = salome.myStudy
+
+
index 207862eb6f3177087e754999595eb74f59775ba2..3a4cd4f49341a24453dd49635e2ee9f9b3559965 100644 (file)
@@ -1,5 +1,33 @@
+# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+
+# Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+
+
+
 # This module allows cutting and grouping geometries by defining plane sections, with level of cutting as well as customizable Prefixes.
-import geompy, math
+
+import math, Config
+
+from salome.geom import geomBuilder
+geompy = geomBuilder.New( Config.theStudy )
 
 def Go(GeoObj, CutPlnLst, OutLvlLst, PrefixLst, Publish):
 
index 201cd6c7ad8f998d6feb0c019a88c33c27c993af..e2e2c42196cedab228eccb1302b7d141ea38b923 100644 (file)
@@ -1,10 +1,35 @@
+# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+
+# Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+
+
+
+
 # This is an automation of the cylinder-box object, defined with the coordinates of its center, its radius, and the box's 
 # boundary size.
 # The pitch ratio is calculated automatically from the minimum of the box dimensions on x and y.
 # This functions can take a groups input containing the group names of 4 sides in addition to the internal circular boundary
 # in the following order : [South,North,West,East,Internal].
 
-import sys, salome, geompy, smesh, SMESH, math, commands
+import sys, math, commands
 CWD = commands.getoutput('pwd')
 sys.path.append(CWD)
 
index 12610d9271692c064b0739d0f9f7bac269b75a33..2e3dce3087e91e95176bc2701fea3df15c48f84a 100644 (file)
@@ -1,10 +1,39 @@
-# In this file are all the generation functions for manipulating the different created macro-objects 
-import geompy, smesh
+# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+
+# Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+
+
+# In this file are all the generation functions for manipulating the different created macro-objects
+
 import math, copy
 import Config
 import CutnGroup
 import CompositeBox
 
+from salome.geom import geomBuilder
+geompy = geomBuilder.New( Config.theStudy )
+
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New( Config.theStudy )
+
 ##########################################################################################################
 
 def Box11 (MacObject):
index 445cd5d73f28b47e3f14bb46b28a48dffcad52b0..4b78724cc13d2dd5a2ae2bf78ada49be3fb88b9a 100644 (file)
@@ -1,3 +1,26 @@
+# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+
+# Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+
+
 class MacObject:
        """ 
        This represents a python class definition which contains 
@@ -217,7 +240,10 @@ class MacObject:
                 return [PtCoor[PtIndex+1][0]-PtCoor[PtIndex][0],PtCoor[PtIndex+1][1]-PtCoor[PtIndex][1],0.]
                                 
         def GetBorder (self, Criterion):
-                import geompy, GenFunctions
+                import GenFunctions, Config
+
+                from salome.geom import geomBuilder
+                geompy = geomBuilder.New( Config.theStudy )
                 
                 if type(Criterion) is str :
                         Crit = {'South'  : lambda : 0,
index dc8dcd899974a36829bc615200baf578435813be..f634488992ac8433a4fa98edca11e1cc6ea3e243 100644 (file)
@@ -1,7 +1,36 @@
+# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+
+# Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+
 # 
-import geompy, smesh, SMESH
+import SMESH
 import math
 import Config
+
+from salome.geom import geomBuilder
+geompy = geomBuilder.New( Config.theStudy )
+
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New( Config.theStudy )
+
 ##########################################################################################################
 
 def PublishGroups ():
@@ -37,7 +66,8 @@ def PublishGroups ():
                 geompy.addToStudyInFather(FinalCompound,GroupGEO[-1],'GR_'+group)
                 
                 # Mesh groups definition
-                Criterion = smesh.Filter.Criterion(18,39,0,'GR_'+group,'GR_'+group,39,39,1e-06,smesh.EDGE,7)
+                Criterion = smesh.GetCriterion(SMESH.EDGE, SMESH.FT_BelongToGeom,'=',GroupGEO[-1],Tolerance=1e-06)
+                #Criterion = smesh.Filter.Criterion(18,39,0,'GR_'+group,'GR_'+group,39,39,1e-06,smesh.EDGE,7)
                 MeshCompound.MakeGroupByCriterion(group,Criterion)
         
         StudyBuilder = Config.theStudy.NewBuilder()
@@ -119,18 +149,22 @@ def RevolveMesh(MainMesh,**args):
         # Removing the _rotated prefix from the rotated FACE groups
         for GR in Rev3DMeshGroups:
                 CurrentName = GR.GetName()
-                if CurrentName=='LOFAC_rotated' :
-                        GR.SetName('VOL')
-                else :
+                if CurrentName.endswith( "_rotated"):
+                        if CurrentName.startswith( 'LOFAC_' ):
+                                GR.SetName('VOL')
+                        else:
+                                GR.SetName(CurrentName[:-8])
+                elif CurrentName == 'LOFAC_top':
+                        GR.SetName('HIFAC')
                         #Index = [ GR_Names[i] in CurrentName for i in range(0,len(GR_Names)) ].index(True)
                         #GR.SetName(GR_Names[Index])
-                        GR.SetName(CurrentName[:-8])
 
         # Creating the upper face group HIFAC
         ALLFAC = MainMesh.CreateEmptyGroup( SMESH.FACE, 'ALLFAC' )
         ALLFAC.AddFrom(MainMesh.GetMesh())
 
-        HIFAC = MainMesh.GetMesh().CutListOfGroups( [ ALLFAC ], [LOFAC] + [ MeshGroup for MeshGroup in Rev3DMeshGroups if not(MeshGroup.GetName()=='VOL') ], 'HIFAC' )
+        #HIFAC = MainMesh.GetMesh().CutListOfGroups( [ ALLFAC ], [LOFAC] + [ MeshGroup for MeshGroup in Rev3DMeshGroups if not(MeshGroup.GetName()=='VOL') ], 'HIFAC' )
+        #HIFAC = MainMesh.GetMesh().CutListOfGroups( [ ALLFAC ], [LOFAC] + [ MeshGroup for MeshGroup in Rev3DMeshGroups if ( not(MeshGroup.GetName()=='VOL') and MeshGroup.GetType() == SMESH.FACE )], 'HIFAC' )
 
         # Scaling down the mesh to meter units
         if not(Scale==1.):
@@ -182,21 +216,22 @@ def ExtrudeMesh(MainMesh,**args):
                 if CurrentName in GR_Names and not(CurrentName=='LOFAC'):  # Meaning that this is an old edge group
                         GR.SetName(CurrentName+'_EDGE')
 
-        # Removing the _rotated prefix from the rotated FACE groups
+        # Removing the _extruded suffix from the extruded FACE groups
         for GR in Ext3DMeshGroups:
                 CurrentName = GR.GetName()
-                if CurrentName=='LOFAC_extruded' :
-                        GR.SetName('VOL')
-                else :
-                        #Index = [ GR_Names[i] in CurrentName for i in range(0,len(GR_Names)) ].index(True)
-                        #GR.SetName(GR_Names[Index])
-                        GR.SetName(CurrentName[:-9])
+                if CurrentName.endswith( "_extruded"):
+                        if CurrentName.startswith( 'LOFAC_' ):
+                                GR.SetName('VOL')
+                        else:
+                                GR.SetName(CurrentName[:-9])
+                elif CurrentName == 'LOFAC_top':
+                        GR.SetName('HIFAC')
 
         # Creating the upper face group HIFAC
         ALLFAC = MainMesh.CreateEmptyGroup( SMESH.FACE, 'ALLFAC' )
         ALLFAC.AddFrom(MainMesh.GetMesh())
 
-        HIFAC = MainMesh.GetMesh().CutListOfGroups( [ ALLFAC ], [LOFAC] + [ MeshGroup for MeshGroup in Ext3DMeshGroups if not(MeshGroup.GetName()=='VOL') ], 'HIFAC' )
+        #HIFAC = MainMesh.GetMesh().CutListOfGroups( [ ALLFAC ], [LOFAC] + [ MeshGroup for MeshGroup in Ext3DMeshGroups if not(MeshGroup.GetName()=='VOL') ], 'HIFAC' )
 
         # Scaling down the mesh to meter units
         if not(Scale==1.):
index 3ddc895821b0410d902259d484fa039319adbe19..dd6293029aee01897082bc31886fd1d61bb49800 100644 (file)
@@ -1,3 +1,26 @@
+# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+
+# Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+
+
 # This is an automation of the sharp angle object, with a corner at (X0,Y0), side length : Extension and a fine local meshing : LocalMeshing
 # The corner orientation is defined as NE (North-East) , NW (North-West), SE, or SW. The object's "arm" is 8/14 of Extension
 #                      |      |     8      6
@@ -6,7 +29,7 @@
 #              |   NW             NE    |  oo
 #         _____|                        |_____
 
-import sys, salome, geompy, smesh, SMESH, math, commands
+import sys, math, commands
 CWD = commands.getoutput('pwd')
 sys.path.append(CWD)