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 """Estimation de la longueur du pipe necessaire de part et d'autre du point de sortie"""
25 from .geomsmesh import geompy
27 from .whichSide import whichSide
29 def identifieElementsDebouchants_b(ifil, \
30 facesDefaut,aretesVivesC, fillingFaceExterne, rayonPipe, \
31 ptPeau, centre, norm, localEdgeInFondFiss):
32 """Estimation de la longueur du pipe necessaire de part et d'autre du point de sortie"""
36 # --- estimation de la longueur du pipe necessaire de part et d'autre du point de sortie
37 if aretesVivesC is None:
38 face_test_peau = fillingFaceExterne
40 face_test_peau = facesDefaut[ifil]
41 side_centre = whichSide(face_test_peau, centre)
42 loc_pt0 = geompy.MakeVertexOnCurve(localEdgeInFondFiss, 0.0)
43 loc_pt1 = geompy.MakeVertexOnCurve(localEdgeInFondFiss, 1.0)
44 side_point_0 = whichSide(face_test_peau, loc_pt0)
45 side_point_1 = whichSide(face_test_peau, loc_pt1)
46 logging.debug("position centre cercle: %s, extremité edge u0: %s, u1: %s", side_centre, side_point_0, side_point_1)
47 norm_face = geompy.GetNormal(face_test_peau, ptPeau)
48 incl_pipe = abs(geompy.GetAngleRadians(norm, norm_face))
49 lgp = max(rayonPipe/2., abs(3*rayonPipe*math.tan(incl_pipe)))
50 logging.debug("angle inclinaison Pipe en sortie: %s degres, lgp: %s", incl_pipe*180/math.pi, lgp)