1 #==============================================================================
3 # Bug (from script, bug) : box.py, PAL5223
4 # Modified : 25/11/2004
5 # Author : Kovaltchuk Alexey
7 #==============================================================================
9 # Salome geometry and meshing for a box
19 geom = salome.lcc.FindOrLoadComponent("FactoryServer", "GEOM")
20 meshgenerator = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH")
22 ###geom.GetCurrentStudy(salome.myStudy._get_StudyId())
23 meshgenerator.SetCurrentStudy(salome.myStudy)
27 box = geompy.MakeBox(0.,0.,0.,1.,1.,1.)
28 boxId = geompy.addToStudy(box,"box")
32 smeshgui = salome.ImportComponentGUI("SMESH")
33 smeshgui.Init(salome.myStudyId)
34 # meshgenerator=smeshpy.smeshpy()
39 hypL1=meshgenerator.CreateHypothesis("LocalLength","libStdMeshersEngine.so")
41 hypL1Id = salome.ObjectToID(hypL1)
42 smeshgui.SetName(hypL1Id, "LocalLength")
46 alg1D=meshgenerator.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so")
47 alg1DId = salome.ObjectToID(alg1D)
48 smeshgui.SetName(alg1DId, "algo1D")
50 alg2D=meshgenerator.CreateHypothesis("Quadrangle_2D", "libStdMeshersEngine.so")
51 alg2DId = salome.ObjectToID(alg2D)
52 smeshgui.SetName(alg2DId, "algo2D")
54 alg3D=meshgenerator.CreateHypothesis("Hexa_3D", "libStdMeshersEngine.so")
55 alg3DId = salome.ObjectToID(alg3D)
56 smeshgui.SetName(alg3DId, "algo3D")
60 box_mesh=meshgenerator.CreateMesh(box)
61 box_meshId = salome.ObjectToID(box_mesh)
62 smeshgui.SetName(box_meshId, "box_mesh")
64 # ---- set Hypothesis & Algorithm
66 box_mesh.AddHypothesis(box,alg1D)
67 box_mesh.AddHypothesis(box,alg2D)
68 box_mesh.AddHypothesis(box,alg3D)
69 box_mesh.AddHypothesis(box,hypL1)
71 meshgenerator.Compute(box_mesh,box)
73 sg.updateObjBrowser(1)