Salome HOME
Merge branch 'gni/evolution'
[modules/smesh.git] / src / Tools / blocFissure / gmu / sortFaces.py
index 84871cf46842129728a58e2601b8f7238de83b07..d6966fe0ab92ede19eea8b6d42657a0fe2027ed8 100644 (file)
@@ -1,5 +1,5 @@
 # -*- coding: utf-8 -*-
-# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+# 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
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
+"""tri par surface de faces"""
+
 import logging
 from .geomsmesh import geompy
 
-# -----------------------------------------------------------------------------
-# --- tri par surface de faces
-
 def sortFaces(facesToSort):
-  """
-  tri des faces par surface
-  """
+  """tri des faces par surface"""
   logging.info('start')
 
-  surFaces = [(geompy.BasicProperties(face)[1], i, face) for i, face in enumerate(facesToSort)]
-  surFaces.sort()
-  facesSorted = [face for surf, i, face in surFaces]
-  return facesSorted, surFaces[0][0], surFaces[-1][0]
+  l_surfaces = [(geompy.BasicProperties(face)[1], i, face) for i, face in enumerate(facesToSort)]
+  l_surfaces.sort()
+  facesSorted = [face for surf, i, face in l_surfaces]
 
+  return facesSorted, l_surfaces[0][0], l_surfaces[-1][0]