X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FTools%2FblocFissure%2FmaterielCasTests%2FcubeAngle.py;h=727c3b2e57a7fa3496b05fbf24790bb3bfd41faf;hb=a274ade365bd0f0e19d56c577acc4a13aa1972a7;hp=e596663ca6d4e07ce71b985171ebda7dc56b7013;hpb=072a73120b6db7bba2389aa7ada0cde20e22ee57;p=modules%2Fsmesh.git diff --git a/src/Tools/blocFissure/materielCasTests/cubeAngle.py b/src/Tools/blocFissure/materielCasTests/cubeAngle.py index e596663ca..727c3b2e5 100644 --- a/src/Tools/blocFissure/materielCasTests/cubeAngle.py +++ b/src/Tools/blocFissure/materielCasTests/cubeAngle.py @@ -1,13 +1,29 @@ -# -*- coding: iso-8859-1 -*- +# -*- coding: utf-8 -*- +# Copyright (C) 2014-2021 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 sys import salome salome.salome_init() -theStudy = salome.myStudy import salome_notebook -notebook = salome_notebook.NoteBook(theStudy) import os from blocFissure import gmu @@ -22,7 +38,7 @@ import math import SALOMEDS -geompy = geomBuilder.New(theStudy) +geompy = geomBuilder.New() O = geompy.MakeVertex(0, 0, 0) OX = geompy.MakeVectorDXDYDZ(1, 0, 0) @@ -35,7 +51,7 @@ Vertex_2 = geompy.MakeVertex(-5, -5, 90) Vertex_3 = geompy.MakeVertex(65, 65, 110) Box_2 = geompy.MakeBoxTwoPnt(Vertex_3, Vertex_2) Common_1 = geompy.MakeCommon(Disk_1, Box_2) -geompy.Export(Common_1, os.path.join(gmu.pathBloc, "materielCasTests/CubeAngleFiss.brep"), "BREP") +geompy.ExportBREP(Common_1, os.path.join(gmu.pathBloc, "materielCasTests/CubeAngleFiss.brep")) geompy.addToStudy( O, 'O' ) geompy.addToStudy( OX, 'OX' ) geompy.addToStudy( OY, 'OY' ) @@ -55,7 +71,7 @@ geompy.addToStudy( Common_1, 'Common_1' ) import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(theStudy) +smesh = smeshBuilder.New() from salome.StdMeshers import StdMeshersBuilder Mesh_1 = smesh.Mesh(Box_1) Regular_1D = Mesh_1.Segment() @@ -65,7 +81,7 @@ Quadrangle_2D = Mesh_1.Quadrangle(algo=smeshBuilder.QUADRANGLE) Hexa_3D = Mesh_1.Hexahedron(algo=smeshBuilder.Hexa) isDone = Mesh_1.Compute() smesh.SetName(Mesh_1, 'Mesh_1') -Mesh_1.ExportMED( os.path.join(gmu.pathBloc, "materielCasTests/CubeAngle.med"), 0, SMESH.MED_V2_2, 1 ) +Mesh_1.ExportMED(os.path.join(gmu.pathBloc, "materielCasTests/CubeAngle.med")) ## set object names smesh.SetName(Mesh_1.GetMesh(), 'Mesh_1') @@ -75,4 +91,4 @@ smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D') smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D') if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser(1) + salome.sg.updateObjBrowser()