X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FTools%2FZCracksPlug%2Fsphere.py;h=e400b817e2eecc32ea707ba4e9baa2d97cb950eb;hp=79542b2c5b6b7cf16669f3440fae8e92feb7cbac;hb=d9f4b53e489dd5857db264ede6acded7b076c9f1;hpb=a1920ff31054e2c882bd94d4f3c04abe53980ce0 diff --git a/src/Tools/ZCracksPlug/sphere.py b/src/Tools/ZCracksPlug/sphere.py index 79542b2c5..e400b817e 100644 --- a/src/Tools/ZCracksPlug/sphere.py +++ b/src/Tools/ZCracksPlug/sphere.py @@ -1,4 +1,22 @@ # -*- coding: utf-8 -*- +# Copyright (C) 2016-2022 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 +# ### ### This file is generated automatically by SALOME v7.7.1 with dump python functionality @@ -8,10 +26,9 @@ import sys, numpy import salome salome.salome_init() -theStudy = salome.myStudy import salome_notebook -notebook = salome_notebook.NoteBook(theStudy) +notebook = salome_notebook.NoteBook() ### ### GEOM component @@ -21,8 +38,8 @@ import GEOM from salome.geom import geomBuilder import math import SALOMEDS -import utilityFunctions as uF -from output import message +from . import utilityFunctions as uF +from .output import message #import GEOM_Gen.ild @@ -30,7 +47,7 @@ def generate(data_rayon,data_centre,outFile): #data_rayon = 0.1 #data_centre = [1., 1., 01.] - geompy = geomBuilder.New(theStudy) + geompy = geomBuilder.New() O = geompy.MakeVertex(0, 0, 0) OX = geompy.MakeVectorDXDYDZ(1, 0, 0) @@ -48,7 +65,7 @@ def generate(data_rayon,data_centre,outFile): import SMESH, SALOMEDS from salome.smesh import smeshBuilder - smesh = smeshBuilder.New(theStudy) + smesh = smeshBuilder.New() A=numpy.pi/(20.) chordal, minSize = uF.calcElemSize(A, data_rayon) @@ -57,14 +74,14 @@ def generate(data_rayon,data_centre,outFile): Maillage=uF.meshCrack(FACE_FISSURE, minSize, maxSize, chordal, dim=3) try: - Maillage.ExportMED( outFile, 0, SMESH.MED_V2_2, 1, None ,1) + Maillage.ExportMED(outFile) smesh.SetName(Maillage.GetMesh(), 'MAILLAGE_FISSURE') except: - print 'ExportToMEDX() failed. Invalid file name?' + print('ExportMED() failed. Invalid file name?') ## Set names of Mesh objects if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser(1) + salome.sg.updateObjBrowser()