]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
PR: examples adaptation
authorprascle <prascle>
Thu, 14 Mar 2013 08:43:02 +0000 (08:43 +0000)
committerprascle <prascle>
Thu, 14 Mar 2013 08:43:02 +0000 (08:43 +0000)
22 files changed:
doc/salome/examples/defining_hypotheses_ex01.py
doc/salome/examples/defining_hypotheses_ex02.py
doc/salome/examples/defining_hypotheses_ex03.py
doc/salome/examples/defining_hypotheses_ex04.py
doc/salome/examples/defining_hypotheses_ex05.py
doc/salome/examples/defining_hypotheses_ex06.py
doc/salome/examples/defining_hypotheses_ex07.py
doc/salome/examples/defining_hypotheses_ex08.py
doc/salome/examples/defining_hypotheses_ex09.py
doc/salome/examples/defining_hypotheses_ex10.py
doc/salome/examples/defining_hypotheses_ex11.py
doc/salome/examples/defining_hypotheses_ex12.py
doc/salome/examples/defining_hypotheses_ex13.py
doc/salome/examples/defining_hypotheses_ex14.py
doc/salome/examples/defining_hypotheses_ex15.py
doc/salome/examples/defining_hypotheses_ex16.py
doc/salome/examples/defining_hypotheses_ex17.py
src/SMESH_SWIG/SMESH_mechanic.py
src/SMESH_SWIG/ex29_refine.py
src/SMESH_SWIG/ex30_groupsOp.py
src/SMESH_SWIG/ex30_tepal.py
src/SMESH_SWIG/ex31_dimGroup.py

index 6efb1cfb9c9cb7fc67887bb09510a659b81c7e84..4bb75c56b3b45a5e8b3fd802f8a22bf0317bae16 100644 (file)
@@ -1,7 +1,14 @@
 # Arithmetic 1D
 
-import geompy
-import smesh
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh =  smeshBuilder.New(salome.myStudy)
 
 # create a box
 box = geompy.MakeBoxDXDYDZ(10., 10., 10.)
index b0726a1ca0bb5246ef5418c4f17272bd0cc9cae2..3662d5632b1bc457caa14acb2c4e3c1af77a8b65 100644 (file)
@@ -1,7 +1,14 @@
 # Deflection 1D and Number of Segments
 
-import geompy
-import smesh
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh =  smeshBuilder.New(salome.myStudy)
 
 # create a face from arc and straight segment
 px = geompy.MakeVertex(100., 0.  , 0.  )
index cfb1ca86c204115512fb533ecba1590636a55d5f..05a984b77d2f68cf296e6ccfd5dff0959c1cf3cd 100644 (file)
@@ -1,16 +1,23 @@
 # Start and End Length
 
-from geompy import *
-import smesh
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh =  smeshBuilder.New(salome.myStudy)
 
 # create a box
-box = MakeBoxDXDYDZ(10., 10., 10.)
-addToStudy(box, "Box")
+box = geompy.MakeBoxDXDYDZ(10., 10., 10.)
+geompy.addToStudy(box, "Box")
 
 # get one edge of the box to put local hypothesis on
-p5 = MakeVertex(5., 0., 0.)
-EdgeX = GetEdgeNearPoint(box, p5)
-addToStudyInFather(box, EdgeX, "Edge [0,0,0 - 10,0,0]")
+p5 = geompy.MakeVertex(5., 0., 0.)
+EdgeX = geompy.GetEdgeNearPoint(box, p5)
+geompy.addToStudyInFather(box, EdgeX, "Edge [0,0,0 - 10,0,0]")
 
 # create a hexahedral mesh on the box
 hexa = smesh.Mesh(box, "Box : hexahedrical mesh")
index 0a17f5ca1c9071997a15a8d3baea549574e71eab..8ebddfc5c3fd32d58a57fd9d9902ced2ddd71cf1 100644 (file)
@@ -1,16 +1,23 @@
 # Local Length
 
-from geompy import *
-import smesh
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh =  smeshBuilder.New(salome.myStudy)
 
 # create a box
-box = MakeBoxDXDYDZ(10., 10., 10.)
-addToStudy(box, "Box")
+box = geompy.MakeBoxDXDYDZ(10., 10., 10.)
+geompy.addToStudy(box, "Box")
 
 # get one edge of the box to put local hypothesis on
-p5 = MakeVertex(5., 0., 0.)
-EdgeX = GetEdgeNearPoint(box, p5)
-addToStudyInFather(box, EdgeX, "Edge [0,0,0 - 10,0,0]")
+p5 = geompy.MakeVertex(5., 0., 0.)
+EdgeX = geompy.GetEdgeNearPoint(box, p5)
+geompy.addToStudyInFather(box, EdgeX, "Edge [0,0,0 - 10,0,0]")
 
 # create a hexahedral mesh on the box
 hexa = smesh.Mesh(box, "Box : hexahedrical mesh")
index fcf03d0d65d7a7c6febf9c2eac6d5cbe11d3f1e9..d2b98f1cc695fbed5ab83aff66c6e793bf1e403b 100644 (file)
@@ -1,8 +1,14 @@
 # Maximum Element Area
 
-import geompy
-import smesh
-import salome 
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh =  smeshBuilder.New(salome.myStudy)
 
 # create a face
 px   = geompy.MakeVertex(100., 0.  , 0.  )
index 24bc4da39fc4234f8422bca12e7331ba44dff8e7..d6978dfc36321bc974eb3fc32d899f86ada90814 100644 (file)
@@ -1,7 +1,14 @@
 # Maximum Element Volume
 
-import geompy
-import smesh
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh =  smeshBuilder.New(salome.myStudy)
 
 # create a cylinder
 cyl = geompy.MakeCylinderRH(30., 50.)
index 59d7521a274b657fe27481750ceff43f5ef9173f..c2dc2cfb080f4c8c935de053f65422220e92216b 100644 (file)
@@ -1,7 +1,14 @@
 # Length from Edges
 
-import geompy
-import smesh
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh =  smeshBuilder.New(salome.myStudy)
 
 # create sketchers
 sketcher1 = geompy.MakeSketcher("Sketcher:F 0 0:TT 70 0:TT 70 70:TT 0 70:WW")
index 43877342714d94b94d2549504d4762605193af08..34fcbc37789f885feaa07b77de169fbcf349c28b 100644 (file)
@@ -1,16 +1,23 @@
 # Propagation
 
-from geompy import *
-import smesh
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh =  smeshBuilder.New(salome.myStudy)
 
 # create a box
-box = MakeBoxDXDYDZ(10., 10., 10.)
-addToStudy(box, "Box")
+box = geompy.MakeBoxDXDYDZ(10., 10., 10.)
+geompy.addToStudy(box, "Box")
 
 # get one edge of the box to put local hypothesis on
-p5 = MakeVertex(5., 0., 0.)
-EdgeX = GetEdgeNearPoint(box, p5)
-addToStudyInFather(box, EdgeX, "Edge [0,0,0 - 10,0,0]")
+p5 = geompy.MakeVertex(5., 0., 0.)
+EdgeX = geompy.GetEdgeNearPoint(box, p5)
+geompy.addToStudyInFather(box, EdgeX, "Edge [0,0,0 - 10,0,0]")
 
 # create a hexahedral mesh on the box
 hexa = smesh.Mesh(box, "Box : hexahedrical mesh")
index 9956e4ba506208770f493f7247db08a2a45595d5..1ad07c6050d64be37f56c7e85c559f7629b657b6 100644 (file)
@@ -1,7 +1,14 @@
 # Defining Meshing Algorithms
 
-import geompy
-import smesh
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh =  smeshBuilder.New(salome.myStudy)
 
 # create a box
 box = geompy.MakeBoxDXDYDZ(10., 10., 10.)
index 644908be2a1e4ecd0818763f3bc7565e35fd9ab0..1ebd7d81ccb0955c910548ae5c2dcb0b65a96cf3 100644 (file)
@@ -2,7 +2,15 @@
 
 # Project prisms from one meshed box to another mesh on the same box
 
-from smesh import *
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh =  smeshBuilder.New(salome.myStudy)
 
 # Prepare geometry
 
@@ -36,7 +44,7 @@ geompy.addToStudyInFather( box, edgesF2, "edgesF2" )
 
 
 # Make the source mesh with prisms
-src_mesh = Mesh(box, "Source mesh")
+src_mesh = smesh.Mesh(box, "Source mesh")
 src_mesh.Segment().NumberOfSegments(9,10)
 src_mesh.Quadrangle()
 src_mesh.Hexahedron()
@@ -47,7 +55,7 @@ src_mesh.Compute()
 # Mesh the box using projection algoritms
 
 # Define the same global 1D and 2D hypotheses
-tgt_mesh = Mesh(box, "Target mesh")
+tgt_mesh = smesh.Mesh(box, "Target mesh")
 tgt_mesh.Segment().NumberOfSegments(9,10,UseExisting=True)
 tgt_mesh.Quadrangle()
 
@@ -73,4 +81,4 @@ proj3D.SourceShape3D( box, src_mesh, v1F1, v1F2, v2F1, v2F2 )
 tgt_mesh.Compute()
 
 # Move the source mesh to visualy compare the two meshes
-src_mesh.TranslateObject( src_mesh, MakeDirStruct( 210, 0, 0 ), Copy=False)
+src_mesh.TranslateObject( src_mesh, smesh.MakeDirStruct( 210, 0, 0 ), Copy=False)
index be550477883fd1d0a6056f90f8fecb4c872d1b0a..961a56d9cdbf3852e445af5d1f99a6e39fb17133 100644 (file)
@@ -2,7 +2,15 @@
 
 # Project triangles from one meshed face to another mesh on the same box
 
-from smesh import *
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh =  smeshBuilder.New(salome.myStudy)
 
 # Prepare geometry
 
@@ -20,7 +28,7 @@ geompy.addToStudyInFather( box, Face_1, 'Face_1' )
 geompy.addToStudyInFather( box, Face_2, 'Face_2' )
 
 # Make the source mesh with Netgem2D
-src_mesh = Mesh(Face_1, "Source mesh")
+src_mesh = smesh.Mesh(Face_1, "Source mesh")
 src_mesh.Segment().NumberOfSegments(15)
 src_mesh.Triangle()
 src_mesh.Compute()
index dd891a73eda3f6bd1674d49b48ecba621618bced..5b6842fb30194b39e09a290020b446f98e6cb6d9 100644 (file)
@@ -1,8 +1,14 @@
 # 1D Mesh with Fixed Points example
 
 import salome
-import geompy
-import smesh
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh =  smeshBuilder.New(salome.myStudy)
 import StdMeshers
 
 # Create face and explode it on edges
index 28398491684267fd266632e56cea9f725fa3f496..32fbef43838b56038266b765838d48f6ea6f0e3f 100644 (file)
@@ -1,8 +1,14 @@
 # Radial Quadrangle 1D2D example
 
-from smesh import *
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
 
-SetCurrentStudy(salome.myStudy)
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh =  smeshBuilder.New(salome.myStudy)
 
 # Create face from the wire and add to study
 Face = geompy.MakeSketcher("Sketcher:F 0 0:TT 20 0:R 90:C 20 90:WF", [0, 0, 0, 1, 0, 0, 0, 0, 1])
@@ -16,7 +22,7 @@ geompy.addToStudyInFather(Face, circle,"circle")
 
 # Define geometry for mesh, and Radial Quadrange algorithm
 mesh = smesh.Mesh(Face)
-radial_Quad_algo = mesh.Quadrangle(algo=RADIAL_QUAD)
+radial_Quad_algo = mesh.Quadrangle(algo=smeshBuilder.RADIAL_QUAD)
 
 # The Radial Quadrange algorithm can work without any hypothesis
 # In this case it uses "Default Nb of Segments" preferences parameter to discretize edges
index 6c93e3d270f0f322d705f42b484da1c7ff66e49b..3f55844cff79e68af6171aa669e98dcff52a7b0b 100644 (file)
@@ -1,7 +1,14 @@
 # Quadrangle Parameters example 1 (meshing a face with 3 edges)
 
-from smesh import *
-SetCurrentStudy(salome.myStudy)
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh =  smeshBuilder.New(salome.myStudy)
 
 # Get 1/4 part from the disk face.
 Box_1 = geompy.MakeBoxDXDYDZ(100, 100, 100)
index a08dfbfaeab8e9f5f829af18546d3a68bfdcf52b..6e077d8942e5c0093db67fb80eabb6f66ff3ecd3 100644 (file)
@@ -1,7 +1,14 @@
 # Quadrangle Parameters example 2 (using different types)
 
-import geompy
-import smesh
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh =  smeshBuilder.New(salome.myStudy)
 import StdMeshers
 
 # Make quadrangle face and explode it on edges.
index 493034020f2642ac2b864a4818e9698e75213582..9125787b25f3e57c737548db551165dcd8a5cb49 100644 (file)
@@ -1,7 +1,14 @@
 # "Use Existing Elements" example
 
-from smesh import *
-SetCurrentStudy(salome.myStudy)
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh =  smeshBuilder.New(salome.myStudy)
 
 # Make a patritioned box
 
@@ -23,15 +30,15 @@ geompy.addToStudyInFather( boxes[1], midFace1, "middle Face")
 
 # Mesh one of boxes with quadrangles. It is a source mesh
 
-srcMesh = Mesh(boxes[0], "source mesh") # box coloser to CS origin
+srcMesh = smesh.Mesh(boxes[0], "source mesh") # box coloser to CS origin
 nSeg1 = srcMesh.Segment().NumberOfSegments(4)
 srcMesh.Quadrangle()
 srcMesh.Compute()
-srcFaceGroup = srcMesh.GroupOnGeom( midFace0, "src faces", FACE )
+srcFaceGroup = srcMesh.GroupOnGeom( midFace0, "src faces", SMESH.FACE )
 
 # Import faces from midFace0 to the target mesh
 
-tgtMesh = Mesh(boxes[1], "target mesh")
+tgtMesh = smesh.Mesh(boxes[1], "target mesh")
 importAlgo = tgtMesh.UseExisting2DElements(midFace1)
 import2hyp = importAlgo.SourceFaces( [srcFaceGroup] )
 tgtMesh.Segment().NumberOfSegments(3)
index dc3ee9bc88b9a11c2c97e98dd8ef33431c00f07f..d21638fcc2a717235a51c5a7844df9a613e1f2d0 100644 (file)
@@ -1,7 +1,14 @@
 # Viscous layers construction
 
-from smesh import *
-SetCurrentStudy(salome.myStudy)
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh =  smeshBuilder.New(salome.myStudy)
 
 X = geompy.MakeVectorDXDYDZ( 1,0,0 )
 O = geompy.MakeVertex( 100,50,50 )
@@ -19,7 +26,7 @@ geompy.addToStudy( shape, "shape" )
 geompy.addToStudyInFather( shape, face1, "face1")
 
 
-mesh = Mesh(shape, "CFD")
+mesh = smesh.Mesh(shape, "CFD")
 
 mesh.Segment().NumberOfSegments( 4 )
 
@@ -35,6 +42,6 @@ layersHyp = algo3D.ViscousLayers(thickness,numberOfLayers,stretchFactor,ignoreFa
 
 mesh.Compute()
 
-mesh.MakeGroup("Tetras",VOLUME,FT_ElemGeomType,"=",Geom_TETRA)
-mesh.MakeGroup("Pyras",VOLUME,FT_ElemGeomType,"=",Geom_PYRAMID)
-mesh.MakeGroup("Prims",VOLUME,FT_ElemGeomType,"=",Geom_PENTA)
+mesh.MakeGroup("Tetras",SMESH.VOLUME,SMESH.FT_ElemGeomType,"=",SMESH.Geom_TETRA)
+mesh.MakeGroup("Pyras",SMESH.VOLUME,SMESH.FT_ElemGeomType,"=",SMESH.Geom_PYRAMID)
+mesh.MakeGroup("Prims",SMESH.VOLUME,SMESH.FT_ElemGeomType,"=",SMESH.Geom_PENTA)
index 5411c8dfdf2e48f9464839b19631ae0c8b3a691e..8db198037aeb75f3bdf5d623551b16be47aaa7e9 100644 (file)
 #-------------------------------------------------------------------------
 #
 import salome
-import geompy
-import smesh
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh =  smeshBuilder.New(salome.myStudy)
 
 import StdMeshers
 
index 8363ea81af0c46b54e4a1da98dd0470d2226fcaa..34798ab0118512084fddafc3debcf8ae7d423df6 100644 (file)
 # =======================================
 # Procedure that take a triangulation and split all triangles in 4 others triangles
 #
-import geompy
-import smesh
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh =  smeshBuilder.New(salome.myStudy)
 
 import os
 
@@ -81,10 +88,10 @@ def triangle(m, f, n1, n2, n3):
 
 def SplitTrianglesIn4(m):
     # Get all triangles
-    triangles = m.GetElementsByType(smesh.FACE)
+    triangles = m.GetElementsByType(SMESH.FACE)
 
     # Remove all edges
-    m.RemoveElements(m.GetElementsByType(smesh.EDGE))
+    m.RemoveElements(m.GetElementsByType(SMESH.EDGE))
 
     # Get the list of nodes (ids) associated with the CAD vertices
     shape = m.GetShape()
@@ -222,4 +229,4 @@ MyMesh.ExportMED(path+str(NbCells4)+"_triangles.med", 0)
 # Update the object browser
 # -------------------------
 
-geompy.salome.sg.updateObjBrowser(1)
+salome.sg.updateObjBrowser(1)
index 5bab3082321ab0471cf74e27c1a15123d96a2acf..d6443cec48fde8c4f799a1375d616863fbefc88d 100755 (executable)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-import sys
 import salome
-import geompy
-import math
-import SALOMEDS
-import SMESH
-import smesh
-
 salome.salome_init()
-aStudyId = salome.myStudy._get_StudyId()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh =  smeshBuilder.New(salome.myStudy)
+import math
 
-geompy.init_geom(salome.myStudy)
 global Face_1
 Face_1 = geompy.MakeFaceHW(100, 100, 1)
 geompy.addToStudy( Face_1, "Face_1" )
@@ -51,7 +50,7 @@ aListOfElems = [ 52, 53, 54, 55, 56, 57,
                  72, 73, 74, 75, 76, 77,
                  82, 83, 84, 85, 86, 87 ]
                  
-aRedGroup = Mesh_1.GetMesh().CreateGroup( smesh.FACE, "Red" )
+aRedGroup = Mesh_1.GetMesh().CreateGroup( SMESH.FACE, "Red" )
 aRedGroup.Add( aListOfElems );
 aRedGroup.SetColor( SALOMEDS.Color( 1, 0, 0 ) )
 
@@ -64,7 +63,7 @@ aListOfElems = [ 55, 56, 57, 58, 59,
                  115, 116, 117, 118, 119,
                  125, 126, 127, 128, 129 ]
                  
-aGreenGroup = Mesh_1.GetMesh().CreateGroup( smesh.FACE, "Green" )
+aGreenGroup = Mesh_1.GetMesh().CreateGroup( SMESH.FACE, "Green" )
 aGreenGroup.Add( aListOfElems );
 aGreenGroup.SetColor( SALOMEDS.Color( 0, 1, 0 ) )
 
@@ -75,7 +74,7 @@ aListOfElems = [ 63, 64, 65, 66, 67, 68,
                  103, 104, 105, 106, 107, 108, 
                  113, 114, 115, 116, 117, 118 ]
                  
-aBlueGroup = Mesh_1.GetMesh().CreateGroup( smesh.FACE, "Blue" )
+aBlueGroup = Mesh_1.GetMesh().CreateGroup( SMESH.FACE, "Blue" )
 aBlueGroup.Add( aListOfElems );
 aBlueGroup.SetColor( SALOMEDS.Color( 0, 0, 1 ) )
 
index ece87736daf7fd58ec5040b0b50368a3564ebe5e..379e8426803700eaa234dd280b12010fb558fcff 100644 (file)
 #
 import os
 
-import geompy
-import smesh
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh =  smeshBuilder.New(salome.myStudy)
 
 # Parameters
 # ----------
@@ -53,7 +60,7 @@ m = smesh.Mesh(cylinder)
 # 2D mesh with BLSURF
 # -------------------
 
-algo2d = m.Triangle(smesh.BLSURF)
+algo2d = m.Triangle(smeshBuilder.BLSURF)
 
 algo2d.SetPhysicalMesh(1)
 algo2d.SetPhySize(5)
@@ -63,7 +70,7 @@ algo2d.SetGeometricMesh(0)
 # 3D mesh with tepal
 # ------------------
 
-algo3d = m.Tetrahedron(smesh.GHS3DPRL)
+algo3d = m.Tetrahedron(smeshBuilder.GHS3DPRL)
 
 algo3d.SetMEDName(results)
 algo3d.SetNbPart(4)
index ae8daeb0cfe3979aa972a44038a0b145aba273fc..00764a9b4bf7e3e3ad0b33da7fa038596cf9a15a 100755 (executable)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-import sys
 import salome
-import geompy
-import math
-import SALOMEDS
-import SMESH
-import smesh
-
 salome.salome_init()
-aStudyId = salome.myStudy._get_StudyId()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
 
-geompy.init_geom(salome.myStudy)
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh =  smeshBuilder.New(salome.myStudy)
+import math
 
-geompy.init_geom(salome.myStudy)
 global Box_1
 Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
 geompy.addToStudy( Box_1, "Box_1" )
@@ -50,18 +47,18 @@ isDone = Mesh_1.Compute()
 
 aListOf3d_1=range(721,821)
 
-aGrp3D_1=Mesh_1.GetMesh().CreateGroup( smesh.VOLUME, "Src 3D 1" )
+aGrp3D_1=Mesh_1.GetMesh().CreateGroup( SMESH.VOLUME, "Src 3D 1" )
 aGrp3D_1.Add( aListOf3d_1 )
 
 aListOf3d_2=range(821, 921)
-aGrp3D_2=Mesh_1.GetMesh().CreateGroup( smesh.VOLUME, "Src 3D 2" )
+aGrp3D_2=Mesh_1.GetMesh().CreateGroup( SMESH.VOLUME, "Src 3D 2" )
 aGrp3D_2.Add( aListOf3d_2 )
 
-aGrp2D = Mesh_1.CreateDimGroup( [aGrp3D_1, aGrp3D_2], smesh.FACE, "Faces" )
+aGrp2D = Mesh_1.CreateDimGroup( [aGrp3D_1, aGrp3D_2], SMESH.FACE, "Faces" )
 
-aGrp1D = Mesh_1.CreateDimGroup( [aGrp3D_1, aGrp3D_2], smesh.EDGE, "Edges" )
+aGrp1D = Mesh_1.CreateDimGroup( [aGrp3D_1, aGrp3D_2], SMESH.EDGE, "Edges" )
 
-aGrp0D = Mesh_1.CreateDimGroup( [aGrp3D_1, aGrp3D_2], smesh.NODE, "Nodes" )
+aGrp0D = Mesh_1.CreateDimGroup( [aGrp3D_1, aGrp3D_2], SMESH.NODE, "Nodes" )
 
 salome.sg.updateObjBrowser( 1 )