X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FTools%2FblocFissure%2Fgmu%2FpartitionneFissureParPipe.py;h=d0a4e4f406207cba7ebb6e5278e305339034975b;hb=81adb7985f3c35fa2a7778eb4d2346832536ddc9;hp=7d6289797d00843eac503d3ba6d55c3c77646098;hpb=a8380feec5b500ecfb5d0254e9126103539f4a78;p=modules%2Fsmesh.git diff --git a/src/Tools/blocFissure/gmu/partitionneFissureParPipe.py b/src/Tools/blocFissure/gmu/partitionneFissureParPipe.py index 7d6289797..d0a4e4f40 100644 --- a/src/Tools/blocFissure/gmu/partitionneFissureParPipe.py +++ b/src/Tools/blocFissure/gmu/partitionneFissureParPipe.py @@ -1,13 +1,33 @@ # -*- coding: utf-8 -*- +# Copyright (C) 2014-2020 EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# import math import logging -from geomsmesh import geompy -from geomsmesh import geomPublish -from geomsmesh import geomPublishInFather -import initLog -from findWireEndVertices import findWireEndVertices -from prolongeWire import prolongeWire +from .geomsmesh import geompy +from .geomsmesh import geomPublish +from .geomsmesh import geomPublishInFather +from . import initLog +from .findWireEndVertices import findWireEndVertices +from .prolongeWire import prolongeWire +import traceback +from .fissError import fissError def partitionneFissureParPipe(shapesFissure, elementsDefaut, rayonPipe): """ @@ -33,7 +53,12 @@ def partitionneFissureParPipe(shapesFissure, elementsDefaut, rayonPipe): cercle = geompy.MakeRotation(cercle, norms[0], math.pi/3.0 ) # éviter d'avoir l'arête de couture du pipe presque confondue avec la face fissure geomPublish(initLog.debug, cercle, 'cercle') fondFissProlonge = prolongeWire(fondFiss, extrem, norms, 2*rayonPipe) - pipeFiss = geompy.MakePipe(cercle, fondFissProlonge) + try: + pipeFiss = geompy.MakePipe(cercle, fondFissProlonge) + except: + texte = "génération du pipe le long de la ligne de fond de fissure prolongée impossible. " + texte += "Cause possible : la ligne s'autointersecte lorsqu'on la prolonge." + raise fissError(traceback.extract_stack(),texte) geomPublish(initLog.debug, pipeFiss, 'pipeFiss') partFissPipe = geompy.MakePartition([shapeDefaut, pipeFiss], [], [], [], geompy.ShapeType["FACE"], 0, [], 1) geomPublish(initLog.debug, partFissPipe, 'partFissPipe')