X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH_SWIG%2FPAL_MESH_043_2D.py;h=15eb20e40caeb85c9a688c807527c101c763a697;hp=76ab25924e38af9b17a5a0e9b8a65b280a727f1b;hb=de3c6b4c6100515a37e8f83bb493b473452a373f;hpb=37839553555c3877bf282c5d592b137700cbbaf4 diff --git a/src/SMESH_SWIG/PAL_MESH_043_2D.py b/src/SMESH_SWIG/PAL_MESH_043_2D.py index 76ab25924..15eb20e40 100755 --- a/src/SMESH_SWIG/PAL_MESH_043_2D.py +++ b/src/SMESH_SWIG/PAL_MESH_043_2D.py @@ -1,32 +1,34 @@ -# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -# -# 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. -# -# 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# -*- coding: iso-8859-1 -*- +# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE # +# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS # +# 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. # +# 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 +# + # File : SMESH_testExtrusion2D.py # Module : SMESH # Description : Create meshes to test extrusion of mesh elements along path - +# import salome import geompy -import SMESH -import StdMeshers +import smesh + #----------------------------------GEOM @@ -51,51 +53,26 @@ id_ellipse2 = geompy.addToStudy(ellipse2, "Ellips 2") #---------------------------------SMESH -# get smesh engine -smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH") smesh.SetCurrentStudy(salome.myStudy) -# get SMESH GUI -smeshgui = salome.ImportComponentGUI("SMESH") -smeshgui.Init(salome.myStudyId) - -# create hypoteses -hypNbSeg1 = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") -hypNbSeg1.SetNumberOfSegments(18) -id_hypNbSeg1 = salome.ObjectToID(hypNbSeg1) -smeshgui.SetName(id_hypNbSeg1, "NumberOfSegments 1"); - -hypNbSeg2 = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") -hypNbSeg2.SetNumberOfSegments(34) -id_hypNbSeg2 = salome.ObjectToID(hypNbSeg2) -smeshgui.SetName(id_hypNbSeg2, "NumberOfSegments 2"); - -# create algorithmes -algoReg = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") -id_algoReg = salome.ObjectToID(algoReg) -smeshgui.SetName(id_algoReg, "Regular_1D"); - # create the path mesh -mesh1 = smesh.CreateMesh(ellipse1) -id_mesh1 = salome.ObjectToID(mesh1) -smeshgui.SetName(id_mesh1, "Path Mesh"); +mesh1 = smesh.Mesh(ellipse1, "Path Mesh") -# set hypotheses and algos -mesh1.AddHypothesis(ellipse1,algoReg) -mesh1.AddHypothesis(ellipse1,hypNbSeg1) +algoReg1 = mesh1.Segment() +algoReg1.SetName("Regular_1D") +hypNbSeg1 = algoReg1.NumberOfSegments(18) +smesh.SetName(hypNbSeg1, "NumberOfSegments 1") # create the tool mesh -mesh2 = smesh.CreateMesh(ellipse2) -id_mesh2 = salome.ObjectToID(mesh2) -smeshgui.SetName(id_mesh2, "Tool Mesh"); - -# set hypotheses and algos -mesh2.AddHypothesis(ellipse2,algoReg) -mesh2.AddHypothesis(ellipse2,hypNbSeg2) +mesh2 = smesh.Mesh(ellipse2, "Tool Mesh") +algoReg2 = mesh2.Segment() +algoReg2.SetName("Regular_1D") +hypNbSeg2 = algoReg2.NumberOfSegments(34) +smesh.SetName(hypNbSeg2, "NumberOfSegments 2") # compute meshes -smesh.Compute(mesh1,ellipse1) -smesh.Compute(mesh2,ellipse2) +mesh1.Compute() +mesh2.Compute() # ---- udate object browser