X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FTools%2FblocFissure%2Fgmu%2FconstruitPartitionsPeauFissure.py;h=31a3b079f4f1a82f3756be82ed3be38ed56606ba;hp=d3c46dffdb30fe9741ed7c9788ff100e00446247;hb=2cf6435f1492b63b9adf4e8256d88968638ed9bf;hpb=e8173b4ff130ddb26d165c92403ef847fdfb8be2 diff --git a/src/Tools/blocFissure/gmu/construitPartitionsPeauFissure.py b/src/Tools/blocFissure/gmu/construitPartitionsPeauFissure.py index d3c46dffd..31a3b079f 100644 --- a/src/Tools/blocFissure/gmu/construitPartitionsPeauFissure.py +++ b/src/Tools/blocFissure/gmu/construitPartitionsPeauFissure.py @@ -1,46 +1,66 @@ # -*- 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 +# +"""peau et face de fissure + +partition peau défaut - face de fissure prolongée - wire de fond de fissure prolongée +il peut y avoir plusieurs faces externes, dont certaines sont découpées par la fissure +liste de faces externes : facesDefaut +liste de partitions face externe - fissure : partitionPeauFissFond (None quand pas d'intersection) +""" import logging + +from . import initLog + from .geomsmesh import geompy from .geomsmesh import geomPublish from .geomsmesh import geomPublishInFather -from . import initLog -from .checkDecoupePartition import checkDecoupePartition - # ----------------------------------------------------------------------------- - # --- peau et face de fissure - # - # --- partition peau défaut - face de fissure prolongée - wire de fond de fissure prolongée - # il peut y avoir plusieurs faces externes, dont certaines sont découpées par la fissure - # liste de faces externes : facesDefaut - # liste de partitions face externe - fissure : partitionPeauFissFond (None quand pas d'intersection) +from .checkDecoupePartition import checkDecoupePartition def construitPartitionsPeauFissure(facesDefaut, fissPipe): - """ - partition peau défaut - face de fissure prolongée - wire de fond de fissure prolongée. + """partition peau défaut - face de fissure prolongée - wire de fond de fissure prolongée. + Il peut y avoir plusieurs faces externes, dont certaines sont découpées par la fissure. @param facesDefaut liste de faces externes @param fissPipe partition face de fissure etendue par pipe prolongé @return partitionsPeauFissFond : liste de partitions face externe - fissure (None quand pas d'intersection) """ - + logging.info('start') - partitionsPeauFissFond = [] + partitionsPeauFissFond = list() ipart = 0 - for filling in facesDefaut: - part = geompy.MakePartition([fissPipe, filling], [], [], [], geompy.ShapeType["FACE"], 0, [], 0) - isPart = checkDecoupePartition([fissPipe, filling], part) - if isPart: # on recrée la partition avec toutes les faces filling en outil pour avoir une face de fissure correcte + for filling in facesDefaut: + part = geompy.MakePartition([fissPipe, filling], list(), list(), list(), geompy.ShapeType["FACE"], 0, list(), 0) + # on recrée la partition avec toutes les faces filling en outil pour avoir une face de fissure correcte + if checkDecoupePartition([fissPipe, filling], part): otherFD = [fd for fd in facesDefaut if fd != filling] - if len(otherFD) > 0: - fissPipePart = geompy.MakePartition([fissPipe], otherFD, [], [], geompy.ShapeType["FACE"], 0, [], 0) + if otherFD: + fissPipePart = geompy.MakePartition([fissPipe], otherFD, list(), list(), geompy.ShapeType["FACE"], 0, list(), 0) else: fissPipePart = fissPipe - part = geompy.MakePartition([fissPipePart, filling], [], [], [], geompy.ShapeType["FACE"], 0, [], 0) + part = geompy.MakePartition([fissPipePart, filling], list(), list(), list(), geompy.ShapeType["FACE"], 0, list(), 0) partitionsPeauFissFond.append(part) geomPublish(initLog.debug, part, 'partitionPeauFissFond%d'%ipart ) else: partitionsPeauFissFond.append(None) - ipart = ipart +1 + ipart += 1 - return partitionsPeauFissFond \ No newline at end of file + return partitionsPeauFissFond