1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2014-2021 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 """Faces fissure dans et hors tore, et edges face hors tore"""
28 from .geomsmesh import geompy
29 from .geomsmesh import geomPublishInFather
31 def facesFissure(blocp, faceFissure, extrusionDefaut, genint):
32 """Extraction des faces de fissure dans et hors tore, des edges le long du tore et en paroi
34 @param faceFissure : la face de fissure avec la partie dans le tore elliptique et la partie externe
35 @return (facefissintore, facefissoutore, edgeint, edgeext)
39 [face_0,face_1] = geompy.ExtractShapes(faceFissure, geompy.ShapeType["FACE"], True)
40 ed0 = geompy.ExtractShapes(face_0, geompy.ShapeType["EDGE"], True)
41 ed1 = geompy.ExtractShapes(face_1, geompy.ShapeType["EDGE"], True)
42 if len(ed0) > len(ed1):
43 facefissintore = face_0
44 facefissoutore = face_1
46 facefissintore = face_1
47 facefissoutore = face_0
49 geomPublishInFather(initLog.debug, faceFissure, facefissintore,'facefissintore')
50 geomPublishInFather(initLog.debug, faceFissure, facefissoutore,'facefissoutore')
52 edgeint = geompy.GetShapesOnShape(extrusionDefaut, facefissoutore, geompy.ShapeType["EDGE"], GEOM.ST_IN)
53 edgeext = geompy.GetShapesOnShape(extrusionDefaut, facefissoutore, geompy.ShapeType["EDGE"], GEOM.ST_ON)
55 for i_aux, edge in enumerate(edgeint):
56 name = "edgeint_{}".format(i_aux)
57 geomPublishInFather(initLog.debug, facefissoutore, edge,name)
58 for i_aux, edge in enumerate(edgeext):
59 name = "edgeext_{}".format(i_aux)
60 geomPublishInFather(initLog.debug, facefissoutore, edge,name)
64 vertices = geompy.ExtractShapes(genint, geompy.ShapeType["VERTEX"], False)
66 vertedge = geompy.ExtractShapes(edge, geompy.ShapeType["VERTEX"], False)
67 if ((geompy.GetSubShapeID(blocp, vertedge[0]) == geompy.GetSubShapeID(blocp, vertices[0])) or
68 (geompy.GetSubShapeID(blocp, vertedge[0]) == geompy.GetSubShapeID(blocp, vertices[1]))):
73 return facefissintore, facefissoutore, edgeint, edgeext, reverext