1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2014-2019 CEA/DEN, 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
23 from .geomsmesh import geompy
24 from .geomsmesh import geomPublish
25 from .geomsmesh import geomPublishInFather
28 from .extractionOrientee import extractionOrientee
29 from .extractionOrienteeMulti import extractionOrienteeMulti
31 def identifieElementsFissure(ifil, facesDefaut, partitionPeauFissFond,
32 edgesPipeFiss, edgesFondFiss, aretesVivesC,
33 fillingFaceExterne, centreFondFiss):
35 # -----------------------------------------------------------------------
36 # --- identification edges fond de fissure, edges pipe sur la face de fissure,
38 # edges internes communes pipe et fissure, points communs edges fissure peau et edges circulaires
43 edgesPipeC = geompy.GetInPlace(partitionPeauFissFond, geompy.MakeCompound(edgesPipeFiss))
44 geomPublishInFather(initLog.debug, partitionPeauFissFond, edgesPipeC, "edgesPipeFiss")
45 edgesFondC = geompy.GetInPlace(partitionPeauFissFond, geompy.MakeCompound(edgesFondFiss))
46 geomPublishInFather(initLog.debug, partitionPeauFissFond, edgesFondC, "edgesFondFiss")
48 if aretesVivesC is None:
49 [edgesInside, edgesOutside, edgesOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "EDGE", 1.e-3)
50 [facesInside, facesOutside, facesOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "FACE", 1.e-3)
52 [edgesInside, edgesOutside, edgesOnside] = extractionOrienteeMulti(facesDefaut, ifil, partitionPeauFissFond, centreFondFiss, "EDGE", 1.e-3)
53 [facesInside, facesOutside, facesOnside] = extractionOrienteeMulti(facesDefaut, ifil, partitionPeauFissFond, centreFondFiss, "FACE", 1.e-3)
55 edgesPipeIn = geompy.GetSharedShapesMulti([edgesPipeC, geompy.MakeCompound(edgesInside)], geompy.ShapeType["EDGE"])
58 for i, edge in enumerate(edgesPipeIn):
60 vertices = geompy.GetSharedShapesMulti([edge, geompy.MakeCompound(facesOnside)], geompy.ShapeType["VERTEX"])
61 verticesPipePeau.append(vertices[0])
62 name = "edgePipeIn%d"%i
63 geomPublishInFather(initLog.debug, partitionPeauFissFond, edge, name)
64 name = "verticePipePeau%d"%i
65 geomPublishInFather(initLog.debug, partitionPeauFissFond, vertices[0], name)
66 logging.debug("edgePipeIn%s coupe les faces OnSide", i)
68 logging.debug("edgePipeIn%s ne coupe pas les faces OnSide", i)
71 if len(verticesPipePeau) > 0: # au moins une extrémité du pipe sur cette face de peau
72 #tmp = geompy.GetSharedShapesMulti([edgesFondC, geompy.MakeCompound(edgesOutside)], geompy.ShapeType["EDGE"])
73 #edgesFondOut = [ ed for ed in tmp if geompy.MinDistance(ed, geompy.MakeCompound(facesOnside)) < 1.e-3]
74 tmp = geompy.GetSharedShapesMulti([edgesFondC, geompy.MakeCompound(edgesInside)], geompy.ShapeType["EDGE"])
75 edgesFondIn = [ ed for ed in tmp if geompy.MinDistance(ed, geompy.MakeCompound(facesOnside)) < 1.e-3]
77 return (edgesPipeIn, verticesPipePeau, edgesFondIn, facesInside, facesOnside)