Salome HOME
Copyright update 2021
[modules/smesh.git] / src / Tools / blocFissure / gmu / creeZoneDefautDansObjetSain.py
index d119ce0ac6deeb369ce057f74c358b81634adf03..7f12388522c93992db88af3b6b0f429697b9a3c6 100644 (file)
@@ -1,16 +1,34 @@
 # -*- coding: utf-8 -*-
+# Copyright (C) 2014-2021  EDF R&D
+#
+# 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 logging
-from geomsmesh import smesh
+from .geomsmesh import smesh
 import SMESH
 import SALOMEDS
 
-from creeZoneDefautMaillage import creeZoneDefautMaillage
-from peauInterne import peauInterne
-from quadranglesToShapeNoCorner import quadranglesToShapeNoCorner
-from creeZoneDefautFilling import creeZoneDefautFilling
-from creeZoneDefautGeom import creeZoneDefautGeom
-from getCentreFondFiss import getCentreFondFiss
+from .creeZoneDefautMaillage import creeZoneDefautMaillage
+from .peauInterne import peauInterne
+from .quadranglesToShapeNoCorner import quadranglesToShapeNoCorner
+from .creeZoneDefautFilling import creeZoneDefautFilling
+from .creeZoneDefautGeom import creeZoneDefautGeom
+from .getCentreFondFiss import getCentreFondFiss
 
 # -----------------------------------------------------------------------------
 # ---
@@ -30,10 +48,10 @@ def creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure,
   coordsNoeudsFissure = shapesFissure[3]
 
   isElliptique = False
-  if shapeFissureParams.has_key('elliptique'):
+  if 'elliptique' in shapeFissureParams:
     isElliptique      = shapeFissureParams['elliptique']
   if isElliptique:
-    if shapeFissureParams.has_key('demiGrandAxe'):
+    if 'demiGrandAxe' in shapeFissureParams:
       demiGrandAxe    = shapeFissureParams['demiGrandAxe']
     else:
       demiGrandAxe    = shapeFissureParams['longueur']
@@ -57,7 +75,7 @@ def creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure,
   [origShapes, verticesShapes, dmoyen] = \
     creeZoneDefautMaillage(maillagesSains, shapeDefaut, tailleDefaut, nomZones, coordsNoeudsFissure)
 
-  maillageSain.ExportMED( fichierMaillageSain, 0, SMESH.MED_V2_2, 1 )
+  maillageSain.ExportMED(fichierMaillageSain)
   logging.debug("fichier maillage sain %s", fichierMaillageSain)
   [maillageSain, internalBoundary, zoneDefaut, zoneDefaut_skin, zoneDefaut_internalFaces, zoneDefaut_internalEdges] = \
     peauInterne(fichierMaillageSain, shapeDefaut, nomZones)
@@ -86,7 +104,7 @@ def creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure,
     for face in facesDefaut:
       bordsPartages.append([None,None]) # TODO : traitement des arĂȘtes vives ?
     fillconts = facesDefaut
-    idFilToCont = range(len(facesDefaut))
+    idFilToCont = list(range(len(facesDefaut)))
 
   return [facesDefaut, centresDefaut, normalsDefaut, extrusionsDefaut, dmoyen, bordsPartages, fillconts, idFilToCont,
           maillageSain, internalBoundary, zoneDefaut, zoneDefaut_skin, zoneDefaut_internalFaces, zoneDefaut_internalEdges,