Salome HOME
Update of CheckDone
[modules/smesh.git] / src / Tools / blocFissure / gmu / trouveEdgesFissPeau.py
index 13289ac2cbe6613a3f94a02d66c0ea97401ac393..fcf6c9b78a8ad3a03aef9f1f6f96a8b6b0de1862 100644 (file)
@@ -1,29 +1,52 @@
 # -*- coding: utf-8 -*-
+# Copyright (C) 2014-2024  EDF
+#
+# 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
+#
+"""Pour les faces de peau sans extremité débouchante de fissure, il faut recenser les edges de fissure sur la face de peau"""
 
 import logging
 
-from geomsmesh import geompy
+from .geomsmesh import geompy
+from .geomsmesh import geomPublishInFather
+
+from . import initLog
 
 def trouveEdgesFissPeau(facesInside, facesOnside, edgesPipeIn, edgesFondIn, partitionPeauFissFond, edgesFissExtPeau):
-  """
-  pour les faces de peau sans extremité débouchante de fissure, il faut recenser les edges de fissure sur la face de peau
-  """
+  """Pour les faces de peau sans extremité débouchante de fissure, il faut recenser les edges de fissure sur la face de peau"""
   logging.info('start')
-  
-  j = 0
+
+  i_aux = 0
   for face in facesInside:
-    edgesPeauFis = []
-    edgesPipeFis = []
-    edgesPipeFnd = []
+
+    edgesPeauFis = list()
+    edgesPipeFis = list()
+    edgesPipeFnd = list()
     try:
       edgesPeauFis = geompy.GetSharedShapesMulti([geompy.MakeCompound(facesOnside), face], geompy.ShapeType["EDGE"])
       edgesPipeFis = geompy.GetSharedShapesMulti([geompy.MakeCompound(edgesPipeIn), face], geompy.ShapeType["EDGE"])
       edgesPipeFnd = geompy.GetSharedShapesMulti([geompy.MakeCompound(edgesFondIn), face], geompy.ShapeType["EDGE"])
     except:
       pass
-    if (len(edgesPeauFis) > 0) and (len(edgesPipeFis) > 0) and (len(edgesPipeFnd) == 0):
+
+    if ( edgesPeauFis and edgesPipeFis and ( not edgesPipeFnd ) ):
       edgesFissExtPeau.append(edgesPeauFis[0])
-      name="edgesFissExtPeau%d"%j
-      geompy.addToStudyInFather(partitionPeauFissFond, edgesPeauFis[0], name)
-      j += 1
-  return edgesFissExtPeau
\ No newline at end of file
+      name="edgesFissExtPeau{}".format(i_aux)
+      geomPublishInFather(initLog.debug,partitionPeauFissFond, edgesPeauFis[0], name)
+      i_aux += 1
+
+  return edgesFissExtPeau