1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2014-2020 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
22 from .geomsmesh import geompy
23 from .geomsmesh import geomPublish
24 from .geomsmesh import geomPublishInFather
26 from .checkDecoupePartition import checkDecoupePartition
28 # -----------------------------------------------------------------------------
29 # --- peau et face de fissure
31 # --- partition peau défaut - face de fissure prolongée - wire de fond de fissure prolongée
32 # il peut y avoir plusieurs faces externes, dont certaines sont découpées par la fissure
33 # liste de faces externes : facesDefaut
34 # liste de partitions face externe - fissure : partitionPeauFissFond (None quand pas d'intersection)
36 def construitPartitionsPeauFissure(facesDefaut, fissPipe):
37 """partition peau défaut - face de fissure prolongée - wire de fond de fissure prolongée.
39 Il peut y avoir plusieurs faces externes, dont certaines sont découpées par la fissure.
40 @param facesDefaut liste de faces externes
41 @param fissPipe partition face de fissure etendue par pipe prolongé
42 @return partitionsPeauFissFond : liste de partitions face externe - fissure (None quand pas d'intersection)
46 partitionsPeauFissFond = list()
48 for filling in facesDefaut:
49 part = geompy.MakePartition([fissPipe, filling], list(), list(), list(), geompy.ShapeType["FACE"], 0, list(), 0)
50 isPart = checkDecoupePartition([fissPipe, filling], part)
51 if isPart: # on recrée la partition avec toutes les faces filling en outil pour avoir une face de fissure correcte
52 otherFD = [fd for fd in facesDefaut if fd != filling]
54 fissPipePart = geompy.MakePartition([fissPipe], otherFD, list(), list(), geompy.ShapeType["FACE"], 0, list(), 0)
56 fissPipePart = fissPipe
57 part = geompy.MakePartition([fissPipePart, filling], list(), list(), list(), geompy.ShapeType["FACE"], 0, list(), 0)
58 partitionsPeauFissFond.append(part)
59 geomPublish(initLog.debug, part, 'partitionPeauFissFond%d'%ipart )
61 partitionsPeauFissFond.append(None)
64 return partitionsPeauFissFond