<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">
ADD_SUBDIRECTORY(padder)
ADD_SUBDIRECTORY(Verima)
ADD_SUBDIRECTORY(blocFissure)
+ADD_SUBDIRECTORY(MacMesh)
IF(SALOME_BUILD_GUI)
ADD_SUBDIRECTORY(MGCleanerPlug)
# 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)
+# 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 *
from CompositeBoxF import *
-import Config, GenFunctions
-
-Config.theStudy = salome.myStudy;
-geompy.init_geom(Config.theStudy)
##################################################################
# Mesh name ######################################################
+# 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",
+# 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)
+# 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)
+# 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)
+# 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
try : DirIndex
except NameError : DirIndex = 0
+
+try : theStudy
+except NameError :
+ import salome
+ salome.salome_init()
+ theStudy = salome.myStudy
+
+
+# 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):
+# 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)
-# 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):
+# 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
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,
+# 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 ():
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()
# 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.):
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.):
+# 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
# | NW NE | oo
# _____| |_____
-import sys, salome, geompy, smesh, SMESH, math, commands
+import sys, math, commands
CWD = commands.getoutput('pwd')
sys.path.append(CWD)