From: eap Date: Thu, 13 Mar 2014 13:43:57 +0000 (+0400) Subject: 22491: EDF 2249 SMESH: Integration of a small python library for quadrangle meshing X-Git-Tag: V7_4_0a1~36^2~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=143f1ac50c3924c23a5fdcae7b67813713f099ad;p=modules%2Fsmesh.git 22491: EDF 2249 SMESH: Integration of a small python library for quadrangle meshing Fix 1) license 2) bugs 3) obsolete import --- diff --git a/resources/SalomeApp.xml.in b/resources/SalomeApp.xml.in index ed4f2ade6..aae569166 100644 --- a/resources/SalomeApp.xml.in +++ b/resources/SalomeApp.xml.in @@ -118,6 +118,7 @@ +
diff --git a/src/Tools/CMakeLists.txt b/src/Tools/CMakeLists.txt index 273b753bf..9495dd8c3 100644 --- a/src/Tools/CMakeLists.txt +++ b/src/Tools/CMakeLists.txt @@ -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) diff --git a/src/Tools/MacMesh/CMakeLists.txt b/src/Tools/MacMesh/CMakeLists.txt index c50d20707..4cf6c7293 100644 --- a/src/Tools/MacMesh/CMakeLists.txt +++ b/src/Tools/MacMesh/CMakeLists.txt @@ -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) diff --git a/src/Tools/MacMesh/Example/PressureValve.py.in b/src/Tools/MacMesh/Example/PressureValve.py.in index e489faf57..713e27f4a 100755 --- a/src/Tools/MacMesh/Example/PressureValve.py.in +++ b/src/Tools/MacMesh/Example/PressureValve.py.in @@ -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 ###################################################### diff --git a/src/Tools/MacMesh/MacMesh/Alarms.py b/src/Tools/MacMesh/MacMesh/Alarms.py index 939b40e7c..9bfd71a66 100644 --- a/src/Tools/MacMesh/MacMesh/Alarms.py +++ b/src/Tools/MacMesh/MacMesh/Alarms.py @@ -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", diff --git a/src/Tools/MacMesh/MacMesh/CentralUnrefine.py b/src/Tools/MacMesh/MacMesh/CentralUnrefine.py index 1daeb4dbe..2a7c9d59c 100644 --- a/src/Tools/MacMesh/MacMesh/CentralUnrefine.py +++ b/src/Tools/MacMesh/MacMesh/CentralUnrefine.py @@ -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) diff --git a/src/Tools/MacMesh/MacMesh/CompositeBox.py b/src/Tools/MacMesh/MacMesh/CompositeBox.py index 042f69c9c..773fc41b7 100644 --- a/src/Tools/MacMesh/MacMesh/CompositeBox.py +++ b/src/Tools/MacMesh/MacMesh/CompositeBox.py @@ -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) diff --git a/src/Tools/MacMesh/MacMesh/CompositeBoxF.py b/src/Tools/MacMesh/MacMesh/CompositeBoxF.py index 62c1414fa..88cdc83b0 100644 --- a/src/Tools/MacMesh/MacMesh/CompositeBoxF.py +++ b/src/Tools/MacMesh/MacMesh/CompositeBoxF.py @@ -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) diff --git a/src/Tools/MacMesh/MacMesh/Config.py b/src/Tools/MacMesh/MacMesh/Config.py index a86220e79..a0816f497 100644 --- a/src/Tools/MacMesh/MacMesh/Config.py +++ b/src/Tools/MacMesh/MacMesh/Config.py @@ -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 + + diff --git a/src/Tools/MacMesh/MacMesh/CutnGroup.py b/src/Tools/MacMesh/MacMesh/CutnGroup.py index 207862eb6..3a4cd4f49 100644 --- a/src/Tools/MacMesh/MacMesh/CutnGroup.py +++ b/src/Tools/MacMesh/MacMesh/CutnGroup.py @@ -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): diff --git a/src/Tools/MacMesh/MacMesh/Cylinder.py b/src/Tools/MacMesh/MacMesh/Cylinder.py index 201cd6c7a..e2e2c4219 100644 --- a/src/Tools/MacMesh/MacMesh/Cylinder.py +++ b/src/Tools/MacMesh/MacMesh/Cylinder.py @@ -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) diff --git a/src/Tools/MacMesh/MacMesh/GenFunctions.py b/src/Tools/MacMesh/MacMesh/GenFunctions.py index 12610d927..2e3dce308 100644 --- a/src/Tools/MacMesh/MacMesh/GenFunctions.py +++ b/src/Tools/MacMesh/MacMesh/GenFunctions.py @@ -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): diff --git a/src/Tools/MacMesh/MacMesh/MacObject.py b/src/Tools/MacMesh/MacMesh/MacObject.py index 445cd5d73..4b78724cc 100644 --- a/src/Tools/MacMesh/MacMesh/MacObject.py +++ b/src/Tools/MacMesh/MacMesh/MacObject.py @@ -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, diff --git a/src/Tools/MacMesh/MacMesh/PublishGroups.py b/src/Tools/MacMesh/MacMesh/PublishGroups.py index dc8dcd899..f63448899 100644 --- a/src/Tools/MacMesh/MacMesh/PublishGroups.py +++ b/src/Tools/MacMesh/MacMesh/PublishGroups.py @@ -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.): diff --git a/src/Tools/MacMesh/MacMesh/SharpAngle.py b/src/Tools/MacMesh/MacMesh/SharpAngle.py index 3ddc89582..dd6293029 100644 --- a/src/Tools/MacMesh/MacMesh/SharpAngle.py +++ b/src/Tools/MacMesh/MacMesh/SharpAngle.py @@ -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)