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
22 from .geomsmesh import geompy
23 from .geomsmesh import geomPublish
24 from .geomsmesh import geomPublishInFather
27 from .toreFissure import toreFissure
28 from .ellipsoideDefaut import ellipsoideDefaut
29 from .rotTrans import rotTrans
30 from .genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
32 # -----------------------------------------------------------------------------
33 # --- création élements géométriques fissure elliptique
35 def genereElemsFissureElliptique(shapeFissureParams):
41 centreDefaut = shapeFissureParams['centreDefaut']
42 vecteurDefaut = shapeFissureParams['vecteurDefaut']
43 demiGrandAxe = shapeFissureParams['demiGrandAxe']
44 demiPetitAxe = shapeFissureParams['demiPetitAxe']
45 orientation = shapeFissureParams['orientation']
46 tailleDefaut = shapeFissureParams['taille']
48 # --- ellipse incomplete : generatrice
50 allonge = demiGrandAxe/demiPetitAxe
51 rayonTore = demiPetitAxe/5.0
52 generatrice, FaceGenFiss, Pipe_1, FaceFissure, Plane_1, Pipe1Part = toreFissure(demiPetitAxe, allonge, rayonTore)
53 ellipsoide = ellipsoideDefaut(demiPetitAxe, allonge, rayonTore)
55 # --- positionnement sur le bloc defaut de generatrice, tore et plan fissure
57 pipe0 = rotTrans(Pipe_1, orientation, centreDefaut, vecteurDefaut)
58 gener1 = rotTrans(generatrice, orientation, centreDefaut, vecteurDefaut)
59 pipe1 = rotTrans(Pipe1Part, orientation, centreDefaut, vecteurDefaut)
60 facefis1 = rotTrans(FaceFissure, orientation, centreDefaut, vecteurDefaut)
61 plane1 = rotTrans(Plane_1, orientation, centreDefaut, vecteurDefaut)
62 ellipsoide1 = rotTrans(ellipsoide, orientation, centreDefaut, vecteurDefaut)
64 geomPublish(initLog.debug, pipe0, 'pipe0' )
65 geomPublish(initLog.debug, gener1, 'gener1' )
66 geomPublish(initLog.debug, pipe1, 'pipe1' )
67 geomPublish(initLog.debug, facefis1, 'facefis1' )
68 geomPublish(initLog.debug, plane1, 'plane1' )
69 geomPublish(initLog.debug, ellipsoide1, 'ellipsoide1' )
71 shapeDefaut = facefis1
72 xyz_defaut = geompy.PointCoordinates(centreDefaut)
73 coordsNoeudsFissure = genereMeshCalculZoneDefaut(facefis1, demiPetitAxe/10.0, demiPetitAxe/5.0)
75 return shapeDefaut, xyz_defaut, tailleDefaut, coordsNoeudsFissure, pipe0, gener1, pipe1, facefis1, plane1, ellipsoide1