X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FTools%2FblocFissure%2FmaterielCasTests%2FfissureGauche2.py;h=2e0fb8454499cb4eb50bc977d7fe955e08a55a0a;hp=9a508a5f9fbf70b5a7504a43bdc35c406e3a5a91;hb=b3c9d09a8a81c0ad6cd5a1513d6b890d31f5fd9a;hpb=f8923c57965084c2260bfd4cee3d0d5266ae0c9f diff --git a/src/Tools/blocFissure/materielCasTests/fissureGauche2.py b/src/Tools/blocFissure/materielCasTests/fissureGauche2.py index 9a508a5f9..2e0fb8454 100644 --- a/src/Tools/blocFissure/materielCasTests/fissureGauche2.py +++ b/src/Tools/blocFissure/materielCasTests/fissureGauche2.py @@ -1,10 +1,27 @@ # -*- 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 sys import salome salome.salome_init() -theStudy = salome.myStudy import salome_notebook notebook = salome_notebook.notebook @@ -22,7 +39,7 @@ import math import SALOMEDS -geompy = geomBuilder.New(theStudy) +geompy = geomBuilder.New() O = geompy.MakeVertex(0, 0, 0) OX = geompy.MakeVectorDXDYDZ(1, 0, 0) @@ -36,7 +53,7 @@ Extrusion_2 = geompy.MakePrismVecH(Circle_3, OZ, 1000) Partition_1 = geompy.MakePartition([Extrusion_1], [Extrusion_2], [], [], geompy.ShapeType["FACE"], 0, [], 0) [Face_1,Face_2] = geompy.SubShapes(Partition_1, [18, 13]) FaceFissExt = geompy.MakeFuse(Face_2, Face_1) -geompy.ExportBREP(FaceFissExt, os.path.join(gmu.pathBloc, "materielCasTests/faceGauche2Fiss.brep")) +geompy.ExportBREP(FaceFissExt, os.path.join(gmu.pathBloc, "materielCasTests", "faceGauche2Fiss.brep")) Vertex_2 = geompy.MakeVertex(0, -500, 0) Vertex_3 = geompy.MakeVertex(400, 500, 800) objetSain = geompy.MakeBoxTwoPnt(Vertex_3, Vertex_2) @@ -47,7 +64,7 @@ geompy.addToStudy( Partition_2, 'Partition_2' ) geompy.addToStudyInFather( Partition_2, FaceFissExtSimple, 'FaceFissExtSimple' ) Plane_1 = geompy.MakePlaneLCS(None, 2000, 3) FaceFissExtCoupe = geompy.MakePartition([FaceFissExtSimple], [Plane_1], [], [], geompy.ShapeType["FACE"], 0, [], 0) -geompy.ExportBREP(FaceFissExtCoupe, os.path.join(gmu.pathBloc, "materielCasTests/faceGauche2FissCoupe.brep")) +geompy.ExportBREP(FaceFissExtCoupe, os.path.join(gmu.pathBloc, "materielCasTests", "faceGauche2FissCoupe.brep")) geompy.addToStudy( O, 'O' ) geompy.addToStudy( OX, 'OX' ) geompy.addToStudy( OY, 'OY' ) @@ -75,7 +92,7 @@ geompy.addToStudy( FaceFissExtCoupe, 'FaceFissExtCoupe' ) import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(theStudy) +smesh = smeshBuilder.New() from salome.StdMeshers import StdMeshersBuilder Mesh_1 = smesh.Mesh(objetSain) Regular_1D = Mesh_1.Segment() @@ -85,7 +102,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/boiteSaine.med"), 0, SMESH.MED_V2_2, 1 ) +Mesh_1.ExportMED(os.path.join(gmu.pathBloc, "materielCasTests", "boiteSaine.med")) ## set object names smesh.SetName(Mesh_1.GetMesh(), 'Mesh_1') @@ -95,4 +112,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()