Salome HOME
Fichier d'archive à la norme python
[modules/smesh.git] / src / Tools / blocFissure / materielCasTests / fissureGauche.py
index 6efe23942683984121b651c193f9e44b36e24aa3..5c26f0207426ed1e4658925b4570ffb074b37983 100644 (file)
@@ -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)
@@ -34,7 +51,7 @@ geomObj_2 = geompy.MakeCylinder(O, OX, 2000, 5000)
 Cylinder_2 = geompy.MakeRotation(geomObj_2, OX, 180*math.pi/180.0)
 Translation_1 = geompy.MakeTranslation(Cylinder_2, -2000, 0, 0)
 Fuse_1 = geompy.MakeFuse(Cylinder_1, Translation_1)
-Fillet_1 = geompy.MakeFillet(Fuse_1, 800, geompy.ShapeType["EDGE"], [11])
+Fillet_1 = geompy.MakeFillet(Fuse_1, 800, geompy.ShapeType["EDGE"], [8])
 Vertex_1 = geompy.MakeVertex(0, -3000, -3000)
 Vertex_2 = geompy.MakeVertex(2500, 3000, 3000)
 Box_1 = geompy.MakeBoxTwoPnt(Vertex_2, Vertex_1)
@@ -43,7 +60,7 @@ geomObj_3 = geompy.MakeCylinderRH(1450, 8000)
 Cylinder_3 = geompy.MakeRotation(geomObj_3, OZ, 180*math.pi/180.0)
 Cut_1 = geompy.MakeCut(Partition_1, Cylinder_3)
 geompy.addToStudy( Cut_1, 'Cut_1' )
-[faceFiss1] = geompy.SubShapes(Cut_1, [63])
+[faceFiss1] = geompy.SubShapes(Cut_1, [61])
 geompy.addToStudyInFather( Cut_1, faceFiss1, 'faceFiss1' )
 [Vertex_3,geomObj_4] = geompy.SubShapes(faceFiss1, [4, 5])
 Cylinder_4 = geompy.MakeCylinderRH(2000, 4000)
@@ -59,7 +76,7 @@ Box_2 = geompy.MakeBoxTwoPnt(Vertex_7, Vertex_6)
 Common_1 = geompy.MakeCommon(Box_2, Cut_2)
 objetSain = geompy.MakePartition([Common_1], [Plane_1, Plane_2, Plane_3], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
 [hauteurs, epaisseurs, Compound_3, Compound_4, Compound_5, Compound_6] = geompy.Propagate(objetSain)
-geompy.Export(faceFiss1, os.path.join(gmu.pathBloc, "materielCasTests/faceGaucheFiss.brep"), "BREP")
+geompy.ExportBREP(faceFiss1, os.path.join(gmu.pathBloc, "materielCasTests", "faceGaucheFiss.brep"))
 geompy.addToStudy( O, 'O' )
 geompy.addToStudy( OX, 'OX' )
 geompy.addToStudy( OY, 'OY' )
@@ -101,7 +118,7 @@ geompy.addToStudyInFather( objetSain, Compound_6, 'Compound_6' )
 import  SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
 
-smesh = smeshBuilder.New(theStudy)
+smesh = smeshBuilder.New()
 from salome.StdMeshers import StdMeshersBuilder
 objetSain_1 = smesh.Mesh(objetSain)
 Regular_1D = objetSain_1.Segment()
@@ -117,7 +134,7 @@ Nb_Segments_3 = Regular_1D_2.NumberOfSegments(5,[],[  ])
 Nb_Segments_3.SetDistrType( 0 )
 isDone = objetSain_1.Compute()
 smesh.SetName(objetSain_1, 'objetSain')
-objetSain_1.ExportMED( os.path.join(gmu.pathBloc, "materielCasTests/faceGaucheSain.med"), 0, SMESH.MED_V2_2, 1 )
+objetSain_1.ExportMED(os.path.join(gmu.pathBloc, "materielCasTests", "faceGaucheSain.med"))
 SubMesh_1 = Regular_1D_1.GetSubMesh()
 SubMesh_2 = Regular_1D_2.GetSubMesh()
 
@@ -133,4 +150,4 @@ smesh.SetName(SubMesh_1, 'SubMesh_1')
 smesh.SetName(SubMesh_2, 'SubMesh_2')
 
 if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser(1)
+  salome.sg.updateObjBrowser()