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
27 # -----------------------------------------------------------------------------
28 # --- faces fissure dans et hors tore, et edges face hors tore
30 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
33 @param faceFissure : la face de fissure avec la partie dans le tore elliptique et la partie externe
34 @return (facefissintore, facefissoutore, edgeint, edgeext)
38 [f0,f1] = geompy.ExtractShapes(faceFissure, geompy.ShapeType["FACE"], True)
39 ed0 = geompy.ExtractShapes(f0, geompy.ShapeType["EDGE"], True)
40 ed1 = geompy.ExtractShapes(f1, geompy.ShapeType["EDGE"], True)
41 if len(ed0) > len(ed1):
48 geomPublishInFather(initLog.debug, faceFissure, facefissintore,'facefissintore')
49 geomPublishInFather(initLog.debug, faceFissure, facefissoutore,'facefissoutore')
51 edgeint = geompy.GetShapesOnShape(extrusionDefaut, facefissoutore, geompy.ShapeType["EDGE"], GEOM.ST_IN)
52 edgeext = geompy.GetShapesOnShape(extrusionDefaut, facefissoutore, geompy.ShapeType["EDGE"], GEOM.ST_ON)
54 for i in range(len(edgeint)):
56 geomPublishInFather(initLog.debug, facefissoutore, edgeint[i],name)
57 for i in range(len(edgeext)):
59 geomPublishInFather(initLog.debug, facefissoutore, edgeext[i],name)
63 vertices = geompy.ExtractShapes(genint, geompy.ShapeType["VERTEX"], False)
64 for i in range(len(edgeext)):
65 vertedge = geompy.ExtractShapes(edgeext[i], geompy.ShapeType["VERTEX"], False)
66 if ((geompy.GetSubShapeID(blocp, vertedge[0]) == geompy.GetSubShapeID(blocp, vertices[0])) or
67 (geompy.GetSubShapeID(blocp, vertedge[0]) == geompy.GetSubShapeID(blocp, vertices[1]))):
72 return facefissintore, facefissoutore, edgeint, edgeext, reverext