Salome HOME
Nommage des éléments de smesh
[modules/smesh.git] / src / Tools / blocFissure / gmu / partitionneFissureParPipe.py
index bf5a4c10994257009a57bfdd4cc48fcb9640f9bb..94531de72041aee30ebba71d50100bb679cd61c7 100644 (file)
@@ -1,14 +1,35 @@
 # -*- 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
+#
+"""Pipe de fond de fissure, prolongé, partition face fissure par pipe"""
 
-import math
 import logging
+import math
+import traceback
+
 from .geomsmesh import geompy
 from .geomsmesh import geomPublish
 from .geomsmesh import geomPublishInFather
+
 from . import initLog
 from .findWireEndVertices import findWireEndVertices
 from .prolongeWire import prolongeWire
-import traceback
 from .fissError import fissError
 
 def partitionneFissureParPipe(shapesFissure, elementsDefaut, rayonPipe):
@@ -28,7 +49,7 @@ def partitionneFissureParPipe(shapesFissure, elementsDefaut, rayonPipe):
     #fondFissCoupe = geompy.GetInPlaceByHistory(shapeDefaut, fondFiss) #= inutile
     geomPublish(initLog.debug, shapeDefaut, 'shapeDefaut_coupe')
     #geomPublishInFather(initLog.debug,shapeDefaut, fondFissCoupe, 'fondFiss_coupe')
-  
+
   extrem, norms = findWireEndVertices(fondFiss, True)
   logging.debug("extrem: %s, norm: %s",extrem, norms)
   cercle = geompy.MakeCircle(extrem[0], norms[0], rayonPipe)
@@ -48,10 +69,10 @@ def partitionneFissureParPipe(shapesFissure, elementsDefaut, rayonPipe):
   geomPublish(initLog.debug, fissPipe, 'fissPipe')
   partPipe = geompy.GetInPlaceByHistory(partFissPipe, pipeFiss)
   geomPublish(initLog.debug, partPipe, 'partPipe')
-  
+
   edgesPipeFiss = geompy.GetSharedShapesMulti([fissPipe, partPipe], geompy.ShapeType["EDGE"])
-  for i, edge in enumerate(edgesPipeFiss):
-    name = "edgePipe%d"%i
+  for i_aux, edge in enumerate(edgesPipeFiss):
+    name = "edgePipe{}".format(i_aux)
     geomPublishInFather(initLog.debug,fissPipe, edge, name)
   try:
     wirePipeFiss = geompy.MakeWire(edgesPipeFiss)
@@ -59,13 +80,13 @@ def partitionneFissureParPipe(shapesFissure, elementsDefaut, rayonPipe):
     wirePipeFiss = geompy.MakeCompound(edgesPipeFiss)
     logging.debug("wirePipeFiss construit sous forme de compound")
   geomPublish(initLog.debug, wirePipeFiss, "wirePipeFiss")
-  
+
   wireFondFiss = geompy.GetInPlace(partFissPipe,fondFiss)
   edgesFondFiss = geompy.GetSharedShapesMulti([fissPipe, wireFondFiss], geompy.ShapeType["EDGE"])
-  for i, edge in enumerate(edgesFondFiss):
-    name = "edgeFondFiss%d"%i
+  for i_aux, edge in enumerate(edgesFondFiss):
+    name = "edgeFondFiss{}".format(i_aux)
     geomPublishInFather(initLog.debug,fissPipe, edge, name)
   wireFondFiss = geompy.MakeWire(edgesFondFiss)
-  geomPublish(initLog.debug, wireFondFiss,"wireFondFiss")  
+  geomPublish(initLog.debug, wireFondFiss,"wireFondFiss")
 
-  return (fissPipe, edgesPipeFiss, edgesFondFiss, wirePipeFiss, wireFondFiss)
\ No newline at end of file
+  return (fissPipe, edgesPipeFiss, edgesFondFiss, wirePipeFiss, wireFondFiss)