From 9b4ce9dbf227329760a2e1fdc4133650e93552db Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Wed, 27 Jan 2021 16:38:18 +0100 Subject: [PATCH] =?utf8?q?cosm=C3=A9tique?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/Tools/blocFissure/gmu/sortEdges.py | 17 +++++++---------- src/Tools/blocFissure/gmu/sortFaces.py | 17 +++++++---------- .../blocFissure/materielCasTests/cubeAngle.py | 2 -- 3 files changed, 14 insertions(+), 22 deletions(-) diff --git a/src/Tools/blocFissure/gmu/sortEdges.py b/src/Tools/blocFissure/gmu/sortEdges.py index 9fc35523d..f43dbf090 100644 --- a/src/Tools/blocFissure/gmu/sortEdges.py +++ b/src/Tools/blocFissure/gmu/sortEdges.py @@ -18,20 +18,17 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +"""tri par longueur d'edges""" + import logging from .geomsmesh import geompy -# ----------------------------------------------------------------------------- -# --- tri par longueur d'edges - def sortEdges(edgesToSort): - """ - tri des edges par longueur - """ + """tri des edges par longueur""" logging.info('start') - lenEdges = [(geompy.BasicProperties(edge)[0], i, edge) for i, edge in enumerate(edgesToSort)] - lenEdges.sort() - edgesSorted = [edge for length, i, edge in lenEdges] - return edgesSorted, lenEdges[0][0], lenEdges[-1][0] + l_length = [(geompy.BasicProperties(edge)[0], i, edge) for i, edge in enumerate(edgesToSort)] + l_length.sort() + edgesSorted = [edge for length, i, edge in l_length] + return edgesSorted, l_length[0][0], l_length[-1][0] diff --git a/src/Tools/blocFissure/gmu/sortFaces.py b/src/Tools/blocFissure/gmu/sortFaces.py index 411ecf0a5..342a95039 100644 --- a/src/Tools/blocFissure/gmu/sortFaces.py +++ b/src/Tools/blocFissure/gmu/sortFaces.py @@ -18,20 +18,17 @@ # 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] diff --git a/src/Tools/blocFissure/materielCasTests/cubeAngle.py b/src/Tools/blocFissure/materielCasTests/cubeAngle.py index 9b7556196..acecb5fb4 100644 --- a/src/Tools/blocFissure/materielCasTests/cubeAngle.py +++ b/src/Tools/blocFissure/materielCasTests/cubeAngle.py @@ -25,8 +25,6 @@ import salome salome.salome_init() -import salome_notebook - import os from blocFissure import gmu -- 2.39.2