X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH_SWIG%2FPAL_MESH_043_3D.py;h=156a86dc9bebb86c63aae364e2b0030d32d83fe9;hp=cfd0f45c46f1526e6139ef7afa2e7af4352b6723;hb=aa67cc96d730566d202d1014d97b7f0b3a4d71f4;hpb=37839553555c3877bf282c5d592b137700cbbaf4 diff --git a/src/SMESH_SWIG/PAL_MESH_043_3D.py b/src/SMESH_SWIG/PAL_MESH_043_3D.py index cfd0f45c4..156a86dc9 100755 --- a/src/SMESH_SWIG/PAL_MESH_043_3D.py +++ b/src/SMESH_SWIG/PAL_MESH_043_3D.py @@ -1,36 +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-2010 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_testExtrusion3D.py # Module : SMESH # Description : Create meshes to test extrusion of mesh elements along path - +# import salome import geompy -import SMESH -import StdMeshers +import smesh -# get smesh engine -smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH") -smesh.SetCurrentStudy(salome.myStudy) # create points to build two circles p1 = geompy.MakeVertex(0, 100, 0) @@ -52,53 +50,40 @@ face = geompy.MakeFace(wire, 1) idcircle = geompy.addToStudy(circle, "Circle") idface = geompy.addToStudy(face, "Circular face") -# get SMESH GUI -smeshgui = salome.ImportComponentGUI("SMESH") -smeshgui.Init(salome.myStudyId) -# create hypoteses -hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") -hypNbSeg.SetNumberOfSegments(12) -idseg = salome.ObjectToID(hypNbSeg) -smeshgui.SetName(idseg, "NumberOfSegments_10"); +smesh.SetCurrentStudy(salome.myStudy) -hypArea = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so") -hypArea.SetMaxElementArea(30) -idarea = salome.ObjectToID(hypArea) -smeshgui.SetName(idarea, "MaxElementArea_20"); +# init a Mesh with the circular face +mesh1 = smesh.Mesh(face, "Mesh on circular face") -# create algorithmes -algoReg = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") -idreg = salome.ObjectToID(algoReg) -smeshgui.SetName(idreg, "Regular_1D"); +# set hypotheses and algos to the first mesh +numberOfSegments1 = 12 +algoReg1 = mesh1.Segment() +algoReg1.SetName("Regular_1D") +hypNbSeg1 = algoReg1.NumberOfSegments(numberOfSegments1) +smesh.SetName(hypNbSeg1, "NumberOfSegments_" + str(numberOfSegments1)) -algoMef = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so") -idmef = salome.ObjectToID(algoMef) -smeshgui.SetName(idmef, "MEFISTO_2D"); +maxElementArea = 30 -# init a Mesh with the circular face -mesh1 = smesh.CreateMesh(face) -idmesh1 = salome.ObjectToID(mesh1) -smeshgui.SetName(idmesh1, "Mesh on circular face"); +algoMef = mesh1.Triangle() +algoMef.SetName("MEFISTO_2D") +hypArea = algoMef.MaxElementArea(maxElementArea) +smesh.SetName(hypArea, "MaxElementArea_" + str(maxElementArea)) -# set hypotheses and algos -mesh1.AddHypothesis(face,algoReg) -mesh1.AddHypothesis(face,hypNbSeg) -mesh1.AddHypothesis(face,algoMef) -mesh1.AddHypothesis(face,hypArea) # init a Mesh with the second circle -mesh2 = smesh.CreateMesh(circle) -idmesh2 = salome.ObjectToID(mesh2) -smeshgui.SetName(idmesh2, "Mesh on circular edge"); +mesh2 = smesh.Mesh(circle, "Mesh on circular edge") + +numberOfSegments2 = 12 +algoReg2 = mesh2.Segment() +algoReg2.SetName("Regular_1D") +hypNbSeg2 = algoReg2.NumberOfSegments(numberOfSegments2) +smesh.SetName(hypNbSeg2, "NumberOfSegments_" + str(numberOfSegments2)) -# set hypotheses and algos -mesh2.AddHypothesis(circle,algoReg) -mesh2.AddHypothesis(circle,hypNbSeg) # compute meshes -smesh.Compute(mesh1,face) -smesh.Compute(mesh2,circle) +mesh1.Compute() +mesh2.Compute() # ---- udate object browser salome.sg.updateObjBrowser(1);