cosmétique

This commit is contained in:
GERALD NICOLAS 2021-01-27 16:38:18 +01:00
parent a9dfed39c8
commit 9b4ce9dbf2
3 changed files with 14 additions and 22 deletions

View File

@ -18,20 +18,17 @@
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
# #
"""tri par longueur d'edges"""
import logging import logging
from .geomsmesh import geompy from .geomsmesh import geompy
# -----------------------------------------------------------------------------
# --- tri par longueur d'edges
def sortEdges(edgesToSort): def sortEdges(edgesToSort):
""" """tri des edges par longueur"""
tri des edges par longueur
"""
logging.info('start') logging.info('start')
lenEdges = [(geompy.BasicProperties(edge)[0], i, edge) for i, edge in enumerate(edgesToSort)] l_length = [(geompy.BasicProperties(edge)[0], i, edge) for i, edge in enumerate(edgesToSort)]
lenEdges.sort() l_length.sort()
edgesSorted = [edge for length, i, edge in lenEdges] edgesSorted = [edge for length, i, edge in l_length]
return edgesSorted, lenEdges[0][0], lenEdges[-1][0]
return edgesSorted, l_length[0][0], l_length[-1][0]

View File

@ -18,20 +18,17 @@
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
# #
"""tri par surface de faces"""
import logging import logging
from .geomsmesh import geompy from .geomsmesh import geompy
# -----------------------------------------------------------------------------
# --- tri par surface de faces
def sortFaces(facesToSort): def sortFaces(facesToSort):
""" """tri des faces par surface"""
tri des faces par surface
"""
logging.info('start') logging.info('start')
surFaces = [(geompy.BasicProperties(face)[1], i, face) for i, face in enumerate(facesToSort)] l_surfaces = [(geompy.BasicProperties(face)[1], i, face) for i, face in enumerate(facesToSort)]
surFaces.sort() l_surfaces.sort()
facesSorted = [face for surf, i, face in surFaces] facesSorted = [face for surf, i, face in l_surfaces]
return facesSorted, surFaces[0][0], surFaces[-1][0]
return facesSorted, l_surfaces[0][0], l_surfaces[-1][0]

View File

@ -25,8 +25,6 @@ import salome
salome.salome_init() salome.salome_init()
import salome_notebook
import os import os
from blocFissure import gmu from blocFissure import gmu