1 # Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/
20 #==============================================================================
22 # Bug (from script, bug) : box.py, PAL5223
23 # Modified : 25/11/2004
24 # Author : Kovaltchuk Alexey
25 # Project : PAL/SALOME
26 #==============================================================================
28 # Salome geometry and meshing for a box
38 geom = salome.lcc.FindOrLoadComponent("FactoryServer", "GEOM")
39 meshgenerator = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH")
41 ###geom.GetCurrentStudy(salome.myStudy._get_StudyId())
42 meshgenerator.SetCurrentStudy(salome.myStudy)
46 box = geompy.MakeBox(0.,0.,0.,1.,1.,1.)
47 boxId = geompy.addToStudy(box,"box")
51 smeshgui = salome.ImportComponentGUI("SMESH")
52 smeshgui.Init(salome.myStudyId)
53 # meshgenerator=smeshpy.smeshpy()
58 hypL1=meshgenerator.CreateHypothesis("LocalLength","libStdMeshersEngine.so")
60 hypL1Id = salome.ObjectToID(hypL1)
61 smeshgui.SetName(hypL1Id, "LocalLength")
65 alg1D=meshgenerator.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so")
66 alg1DId = salome.ObjectToID(alg1D)
67 smeshgui.SetName(alg1DId, "algo1D")
69 alg2D=meshgenerator.CreateHypothesis("Quadrangle_2D", "libStdMeshersEngine.so")
70 alg2DId = salome.ObjectToID(alg2D)
71 smeshgui.SetName(alg2DId, "algo2D")
73 alg3D=meshgenerator.CreateHypothesis("Hexa_3D", "libStdMeshersEngine.so")
74 alg3DId = salome.ObjectToID(alg3D)
75 smeshgui.SetName(alg3DId, "algo3D")
79 box_mesh=meshgenerator.CreateMesh(box)
80 box_meshId = salome.ObjectToID(box_mesh)
81 smeshgui.SetName(box_meshId, "box_mesh")
83 # ---- set Hypothesis & Algorithm
85 box_mesh.AddHypothesis(box,alg1D)
86 box_mesh.AddHypothesis(box,alg2D)
87 box_mesh.AddHypothesis(box,alg3D)
88 box_mesh.AddHypothesis(box,hypL1)
90 meshgenerator.Compute(box_mesh,box)
92 sg.updateObjBrowser(1)