1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2014-2022 EDF R&D
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 """peau et face de fissure
22 partition peau défaut - face de fissure prolongée - wire de fond de fissure prolongée
23 il peut y avoir plusieurs faces externes, dont certaines sont découpées par la fissure
24 liste de faces externes : facesDefaut
25 liste de partitions face externe - fissure : partitionPeauFissFond (None quand pas d'intersection)
32 from .geomsmesh import geompy
33 from .geomsmesh import geomPublish
34 from .geomsmesh import geomPublishInFather
36 from .checkDecoupePartition import checkDecoupePartition
38 def construitPartitionsPeauFissure(facesDefaut, fissPipe):
39 """partition peau défaut - face de fissure prolongée - wire de fond de fissure prolongée.
41 Il peut y avoir plusieurs faces externes, dont certaines sont découpées par la fissure.
42 @param facesDefaut liste de faces externes
43 @param fissPipe partition face de fissure etendue par pipe prolongé
44 @return partitionsPeauFissFond : liste de partitions face externe - fissure (None quand pas d'intersection)
48 partitionsPeauFissFond = list()
50 for filling in facesDefaut:
51 part = geompy.MakePartition([fissPipe, filling], list(), list(), list(), geompy.ShapeType["FACE"], 0, list(), 0)
52 # on recrée la partition avec toutes les faces filling en outil pour avoir une face de fissure correcte
53 if checkDecoupePartition([fissPipe, filling], part):
54 otherFD = [fd for fd in facesDefaut if fd != filling]
56 fissPipePart = geompy.MakePartition([fissPipe], otherFD, list(), list(), geompy.ShapeType["FACE"], 0, list(), 0)
58 fissPipePart = fissPipe
59 part = geompy.MakePartition([fissPipePart, filling], list(), list(), list(), geompy.ShapeType["FACE"], 0, list(), 0)
60 partitionsPeauFissFond.append(part)
61 geomPublish(initLog.debug, part, 'partitionPeauFissFond%d'%ipart )
63 partitionsPeauFissFond.append(None)
66 return partitionsPeauFissFond