]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
PR: examples adaptation
authorprascle <prascle>
Wed, 13 Mar 2013 20:34:41 +0000 (20:34 +0000)
committerprascle <prascle>
Wed, 13 Mar 2013 20:34:41 +0000 (20:34 +0000)
doc/salome/examples/3dmesh.py
doc/salome/examples/creating_meshes_ex01.py
doc/salome/examples/creating_meshes_ex02.py
doc/salome/examples/creating_meshes_ex03.py
doc/salome/examples/creating_meshes_ex04.py
doc/salome/examples/creating_meshes_ex05.py
doc/salome/examples/creating_meshes_ex06.py
doc/salome/examples/creating_meshes_ex07.py
doc/salome/examples/creating_meshes_ex08.py
src/OBJECT/SMESH_SVTKActor.cxx
src/SMESH_SWIG/smeshBuilder.py

index bd6d3b4cc352935175d3d38cd4b2068a44f8708a..67a707533cd3d9b07904d350b186658f73ab3632 100644 (file)
@@ -1,7 +1,14 @@
 # 3d mesh generation
 
-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)
 
 ###
 # Geometry: an assembly of a box, a cylinder and a truncated cone
@@ -18,33 +25,33 @@ radius_2 = 40
 height = 100 
 
 # Build a box
-box = MakeBox(-cote, -cote, -cote, +cote, +cote, +cote) 
+box = geompy.MakeBox(-cote, -cote, -cote, +cote, +cote, +cote) 
 
 # Build a cylinder
-pt1 = MakeVertex(0, 0, cote/3) 
-di1 = MakeVectorDXDYDZ(0, 0, 1) 
-cyl = MakeCylinder(pt1, di1, section, size) 
+pt1 = geompy.MakeVertex(0, 0, cote/3) 
+di1 = geompy.MakeVectorDXDYDZ(0, 0, 1) 
+cyl = geompy.MakeCylinder(pt1, di1, section, size) 
 
 # Build a truncated cone
-pt2 = MakeVertex(0, 0, size) 
-cone = MakeCone(pt2, di1, radius_1, radius_2, height) 
+pt2 = geompy.MakeVertex(0, 0, size) 
+cone = geompy.MakeCone(pt2, di1, radius_1, radius_2, height) 
 
 # Fuse
-box_cyl = MakeFuse(box, cyl) 
-piece = MakeFuse(box_cyl, cone) 
+box_cyl = geompy.MakeFuse(box, cyl) 
+piece = geompy.MakeFuse(box_cyl, cone) 
 
 # Add to the study
-addToStudy(piece, name) 
+geompy.addToStudy(piece, name) 
 
 # Create a group of faces
-group = CreateGroup(piece, ShapeType["FACE"]) 
+group = geompy.CreateGroup(piece, geompy.ShapeType["FACE"]) 
 group_name = name + "_grp" 
-addToStudy(group, group_name) 
+geompy.addToStudy(group, group_name) 
 group.SetName(group_name) 
 
 # Add faces to the group
-faces = SubShapeAllIDs(piece, ShapeType["FACE"]) 
-UnionIDs(group, faces) 
+faces = geompy.SubShapeAllIDs(piece, geompy.ShapeType["FACE"]) 
+geompy.UnionIDs(group, faces) 
 
 ###
 # Create a mesh
index 0b93356c4cd6dd273e7bc6cb43037b2ec0163e27..f328d0582e19ccf5bbd6199beef539fa537d20f0 100644 (file)
@@ -1,7 +1,14 @@
 # Construction of a Mesh
 
-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.MakeBox(0., 0., 0., 100., 200., 300.)
index c541b4add7301c5b20bbe025937bdb7126bf3a5b..fe9f72f082364f2b8b9f0170f9cf7d7883cd4e22 100644 (file)
@@ -1,16 +1,23 @@
 # Construction of a Submesh
 
-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")
 
 # select one edge of the box for definition of a local hypothesis
-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
 quadra = smesh.Mesh(box, "Box : quadrangle 2D mesh")
index 7b219f3a6ec8b945a05a9c58dbf302032ed399d8..7cf85b786a4d0714564c97440e9c1670b444bf44 100644 (file)
@@ -1,9 +1,14 @@
 # Change priority of submeshes in Mesh
 
 import salome
-import geompy
-import smesh
-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)
 
 Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
 [Face_1,Face_2,Face_3,Face_4,Face_5,Face_6] = geompy.SubShapeAllSorted(Box_1, geompy.ShapeType["FACE"])
@@ -24,7 +29,7 @@ Max_Element_Volume_1 = Tetrahedron.MaxElementVolume(40000)
 Regular_1D_1 = Mesh_1.Segment(geom=Face_1)
 Nb_Segments_2 = Regular_1D_1.NumberOfSegments(4)
 Nb_Segments_2.SetDistrType( 0 )
-MEFISTO_2D_1 = Mesh_1.Triangle(algo=smesh.MEFISTO,geom=Face_1)
+MEFISTO_2D_1 = Mesh_1.Triangle(algo=smeshBuilder.MEFISTO,geom=Face_1)
 Length_From_Edges_2D = MEFISTO_2D_1.LengthFromEdges()
 SubMesh_1 = MEFISTO_2D_1.GetSubMesh()
 
@@ -32,7 +37,7 @@ SubMesh_1 = MEFISTO_2D_1.GetSubMesh()
 Regular_1D_2 = Mesh_1.Segment(geom=Face_2)
 Nb_Segments_3 = Regular_1D_2.NumberOfSegments(8)
 Nb_Segments_3.SetDistrType( 0 )
-MEFISTO_2D_2 = Mesh_1.Triangle(algo=smesh.MEFISTO,geom=Face_2)
+MEFISTO_2D_2 = Mesh_1.Triangle(algo=smeshBuilder.MEFISTO,geom=Face_2)
 Length_From_Edges_2D_1 = MEFISTO_2D_2.LengthFromEdges()
 SubMesh_2 = MEFISTO_2D_2.GetSubMesh()
 
@@ -40,7 +45,7 @@ SubMesh_2 = MEFISTO_2D_2.GetSubMesh()
 Regular_1D_3 = Mesh_1.Segment(geom=Face_3)
 Nb_Segments_4 = Regular_1D_3.NumberOfSegments(12)
 Nb_Segments_4.SetDistrType( 0 )
-MEFISTO_2D_3 = Mesh_1.Triangle(algo=smesh.MEFISTO,geom=Face_3)
+MEFISTO_2D_3 = Mesh_1.Triangle(algo=smeshBuilder.MEFISTO,geom=Face_3)
 Length_From_Edges_2D_2 = MEFISTO_2D_3.LengthFromEdges()
 SubMesh_3 = MEFISTO_2D_3.GetSubMesh()
 
index 33106c775ad4b0a66502e7d40d2b2c816e0c5833..f2cdfdb87aee36672f4a4066315c15ba8177e567 100644 (file)
@@ -1,7 +1,14 @@
 # Editing of a mesh
 
-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)
 
 def PrintMeshInfo(theMesh):
     aMesh = theMesh.GetMesh()
index 6ba410307773f58e9f653f0a7b85534ff7f50936..98e921a06981585e1f09d607d61bea3e9dc4a586 100644 (file)
@@ -1,7 +1,14 @@
 # Export of a Mesh
 
-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.MakeBox(0., 0., 0., 100., 200., 300.)
index 96b2a29c783fb9dc01d1042d6f790779b3f6a0bb..d16e067d34f2aa6152bad601e78a13a5320e9544 100644 (file)
@@ -1,12 +1,17 @@
 # Creating a hexahedral mesh on a cylinder.
 # Note: it is a copy of 'ex24_cylinder.py' from SMESH_SWIG
 
-import math
-
-import geompy
-import smesh
 import salome
-geo = geompy
+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 math
 
 # Parameters
 # ----------
@@ -17,62 +22,62 @@ height = 200
 # Build a cylinder
 # ----------------
 
-base = geo.MakeVertex(0, 0, 0)
-direction = geo.MakeVectorDXDYDZ(0, 0, 1)
+base = geompy.MakeVertex(0, 0, 0)
+direction = geompy.MakeVectorDXDYDZ(0, 0, 1)
 
-cylinder = geo.MakeCylinder(base, direction, radius, height)
+cylinder = geompy.MakeCylinder(base, direction, radius, height)
 
-geo.addToStudy(cylinder, "cylinder")
+geompy.addToStudy(cylinder, "cylinder")
 
 # Build blocks
 # ------------
 
 size = radius/2.0
 
-box_rot = geo.MakeBox(-size, -size, 0,  +size, +size, height)
-box_axis = geo.MakeLine(base, direction)
-box = geo.MakeRotation(box_rot, box_axis, math.pi/4)
+box_rot = geompy.MakeBox(-size, -size, 0,  +size, +size, height)
+box_axis = geompy.MakeLine(base, direction)
+box = geompy.MakeRotation(box_rot, box_axis, math.pi/4)
 
-hole = geo.MakeCut(cylinder, box)
+hole = geompy.MakeCut(cylinder, box)
 
 plane_trim = 2000
 
-plane_a = geo.MakePlane(base, geo.MakeVectorDXDYDZ(1, 0, 0), plane_trim)
-plane_b = geo.MakePlane(base, geo.MakeVectorDXDYDZ(0, 1, 0), plane_trim)
+plane_a = geompy.MakePlane(base, geompy.MakeVectorDXDYDZ(1, 0, 0), plane_trim)
+plane_b = geompy.MakePlane(base, geompy.MakeVectorDXDYDZ(0, 1, 0), plane_trim)
 
-blocks_part = geo.MakePartition([hole], [plane_a, plane_b], [], [], geo.ShapeType["SOLID"])
-blocks_list = [box] + geo.SubShapeAll(blocks_part, geo.ShapeType["SOLID"])
-blocks_all = geo.MakeCompound(blocks_list)
-blocks = geo.MakeGlueFaces(blocks_all, 0.0001)
+blocks_part = geompy.MakePartition([hole], [plane_a, plane_b], [], [], geompy.ShapeType["SOLID"])
+blocks_list = [box] + geompy.SubShapeAll(blocks_part, geompy.ShapeType["SOLID"])
+blocks_all = geompy.MakeCompound(blocks_list)
+blocks = geompy.MakeGlueFaces(blocks_all, 0.0001)
 
-geo.addToStudy(blocks, "cylinder:blocks")
+geompy.addToStudy(blocks, "cylinder:blocks")
 
 # Build geometric groups
 # ----------------------
 
 def group(name, shape, type, base=None, direction=None):
-    t = geo.ShapeType[type]
-    g = geo.CreateGroup(shape, t)
+    t = geompy.ShapeType[type]
+    g = geompy.CreateGroup(shape, t)
 
-    geo.addToStudy(g, name)
+    geompy.addToStudy(g, name)
     g.SetName(name)
 
     if base!=None:
-        l = geo.GetShapesOnPlaneWithLocationIDs(shape, t, direction, base, geo.GEOM.ST_ON)
-        geo.UnionIDs(g, l)
+        l = geompy.GetShapesOnPlaneWithLocationIDs(shape, t, direction, base, GEOM.ST_ON)
+        geompy.UnionIDs(g, l)
 
     return g
 
 group_a = group("baseA", blocks, "FACE", base, direction)
 
-base_b  = geo.MakeVertex(0, 0, height)
+base_b  = geompy.MakeVertex(0, 0, height)
 group_b = group("baseB", blocks, "FACE", base_b, direction)
 
 group_1 = group("limit", blocks, "SOLID")
-group_1_all = geo.SubShapeAllIDs(blocks, geo.ShapeType["SOLID"])
-geo.UnionIDs(group_1, group_1_all)
-group_1_box = geo.GetBlockNearPoint(blocks, base)
-geo.DifferenceList(group_1, [group_1_box])
+group_1_all = geompy.SubShapeAllIDs(blocks, geompy.ShapeType["SOLID"])
+geompy.UnionIDs(group_1, group_1_all)
+group_1_box = geompy.GetBlockNearPoint(blocks, base)
+geompy.DifferenceList(group_1, [group_1_box])
 
 # Mesh the blocks with hexahedral
 # -------------------------------
@@ -80,8 +85,8 @@ geo.DifferenceList(group_1, [group_1_box])
 smesh.SetCurrentStudy(salome.myStudy)
 
 def discretize(x, y, z,  n, s=blocks):
-    p = geo.MakeVertex(x, y, z)
-    e = geo.GetEdgeNearPoint(s, p)
+    p = geompy.MakeVertex(x, y, z)
+    e = geompy.GetEdgeNearPoint(s, p)
     a = hexa.Segment(e)
     a.NumberOfSegments(n)
     a.Propagation()
index 3140acee8b877f2a6f4dff513713a55224d73591..65a4f742efcbc78d80f789f7c139e4aa9ee2f817 100644 (file)
@@ -2,8 +2,14 @@
 # Note: it is a copy of 'SMESH_BuildCompound.py' from SMESH_SWIG
 
 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)
 
 ## create a bottom box
 Box_inf = geompy.MakeBox(0., 0., 0., 200., 200., 50.)
@@ -65,9 +71,9 @@ Ginf2=Mesh_sup.Group(Finf2, "Inf")
 ## create compounds
 # create a compound of two meshes with renaming groups with the same names and
 # merging of elements with the given tolerance
-Compound1 = smesh.smesh.Concatenate([Mesh_inf.GetMesh(), Mesh_sup.GetMesh()], 0, 1, 1e-05)
+Compound1 = smesh.Concatenate([Mesh_inf.GetMesh(), Mesh_sup.GetMesh()], 0, 1, 1e-05)
 smesh.SetName(Compound1, 'Compound_with_RenamedGrps_and_MergeElems')
 # create a compound of two meshes with uniting groups with the same names and
 # creating groups of all elements
-Compound2 = smesh.smesh.Concatenate([Mesh_inf.GetMesh(), Mesh_sup.GetMesh()], 1, 0, 1e-05, True)
+Compound2 = smesh.Concatenate([Mesh_inf.GetMesh(), Mesh_sup.GetMesh()], 1, 0, 1e-05, True)
 smesh.SetName(Compound2, 'Compound_with_UniteGrps_and_GrpsOfAllElems')
index a76e8d175fafa5fee68ac452c9201ed03327728f..18f9dad011c02108c0b9a222bf36a0d1d327b5cc 100644 (file)
@@ -1,40 +1,47 @@
 # Mesh Copying
 
-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 geometry of a box
 box = geompy.MakeBoxDXDYDZ(100,100,100)
 face = geompy.SubShapeAllSorted(box, geompy.ShapeType["FACE"])[0]
 
 # generate 3D mesh
-mesh = Mesh(box)
+mesh = smesh.Mesh(box)
 localAlgo = mesh.Triangle(face)
 mesh.AutomaticHexahedralization()
 
 # objects to copy
 fGroup = mesh.GroupOnGeom( face, "2D on face")
-nGroup = mesh.GroupOnGeom( face, "nodes on face", NODE)
+nGroup = mesh.GroupOnGeom( face, "nodes on face", SMESH.NODE)
 subMesh = localAlgo.GetSubMesh()
 
 # make a new mesh by copying different parts of the mesh
 
 # 1. copy the whole mesh
-newMesh = CopyMesh( mesh, "whole mesh copy")
+newMesh = smesh.CopyMesh( mesh, "whole mesh copy")
 
 # 2. copy a group of 2D elements along with groups
-newMesh = CopyMesh( fGroup,  "face group copy with groups",toCopyGroups=True)
+newMesh = smesh.CopyMesh( fGroup,  "face group copy with groups",toCopyGroups=True)
 
 # 3. copy a group of nodes with preseving their ids
-newMesh = CopyMesh( nGroup, "node group copy", toKeepIDs=True)
+newMesh = smesh.CopyMesh( nGroup, "node group copy", toKeepIDs=True)
 
 # 4. copy some faces
 faceIds = fGroup.GetIDs()[-10:]
-newMesh = CopyMesh( mesh.GetIDSource( faceIds, FACE ), "some faces copy")
+newMesh = smesh.CopyMesh( mesh.GetIDSource( faceIds, SMESH.FACE ), "some faces copy")
 
 # 5. copy some nodes
 nodeIds = nGroup.GetIDs()[-10:]
-newMesh = CopyMesh( mesh.GetIDSource( nodeIds, NODE), "some nodes copy")
+newMesh = smesh.CopyMesh( mesh.GetIDSource( nodeIds, SMESH.NODE), "some nodes copy")
 
 # 6. copy a sub-mesh
-newMesh = CopyMesh( subMesh, "submesh copy" )
+newMesh = smesh.CopyMesh( subMesh, "submesh copy" )
index 48ad8691026d940a2383031b614ba60cd0d10943..977e7987b1ec6a29229da23004ff25ae184655c1 100644 (file)
@@ -164,8 +164,8 @@ SMESH_SVTKActor
 ::Initialize()
 {
   Superclass::Initialize();
-  my0DActor->SetInput(my0DGrid);
-  myBallActor->SetInput(myBallGrid);
+  my0DActor->SetInputData(my0DGrid);
+  myBallActor->SetInputData(myBallGrid);
 }
 
 
index 9e31ea0e816d4d5cdd5b1927c5a442bcc485589c..70f3721bb86777350e633a1dc2a2e64471805d2a 100644 (file)
@@ -277,7 +277,7 @@ def AssureGeomPublished(mesh, geom, name=''):
 
 ## Return the first vertex of a geometrical edge by ignoring orientation
 def FirstVertexOnCurve(edge):
-    vv = geomBuilder.SubShapeAll( edge, geomBuilder.ShapeType["VERTEX"])
+    vv = geomBuilder.SubShapeAll( edge, geomBuilder.geomBuilder.ShapeType["VERTEX"])
     if not vv:
         raise TypeError, "Given object has no vertices"
     if len( vv ) == 1: return vv[0]
@@ -303,6 +303,9 @@ smeshInst = None
 engine = None
 doLcc = False
 
+## This class allows to create, load or manipulate meshes
+#  It has a set of methods to create load or copy meshes, to combine several meshes.
+#  It also has methods to get infos on meshes.
 class smeshBuilder(object, SMESH._objref_SMESH_Gen):
 
     def __new__(cls):
@@ -409,7 +412,7 @@ class smeshBuilder(object, SMESH._objref_SMESH_Gen):
     #  @return SMESH.DirStruct
     #  @ingroup l1_auxiliary
     def GetDirStruct(self,theVector):
-        vertices = self.geompyD.SubShapeAll( theVector, geomBuilder.ShapeType["VERTEX"] )
+        vertices = self.geompyD.SubShapeAll( theVector, geomBuilder.geomBuilder.ShapeType["VERTEX"] )
         if(len(vertices) != 2):
             print "Error: vector object is incorrect."
             return None
@@ -432,10 +435,10 @@ class smeshBuilder(object, SMESH._objref_SMESH_Gen):
     #  @return SMESH.AxisStruct
     #  @ingroup l1_auxiliary
     def GetAxisStruct(self,theObj):
-        edges = self.geompyD.SubShapeAll( theObj, geomBuilder.ShapeType["EDGE"] )
+        edges = self.geompyD.SubShapeAll( theObj, geomBuilder.geomBuilder.ShapeType["EDGE"] )
         if len(edges) > 1:
-            vertex1, vertex2 = self.geompyD.SubShapeAll( edges[0], geomBuilder.ShapeType["VERTEX"] )
-            vertex3, vertex4 = self.geompyD.SubShapeAll( edges[1], geomBuilder.ShapeType["VERTEX"] )
+            vertex1, vertex2 = self.geompyD.SubShapeAll( edges[0], geomBuilder.geomBuilder.ShapeType["VERTEX"] )
+            vertex3, vertex4 = self.geompyD.SubShapeAll( edges[1], geomBuilder.geomBuilder.ShapeType["VERTEX"] )
             vertex1 = self.geompyD.PointCoordinates(vertex1)
             vertex2 = self.geompyD.PointCoordinates(vertex2)
             vertex3 = self.geompyD.PointCoordinates(vertex3)
@@ -446,7 +449,7 @@ class smeshBuilder(object, SMESH._objref_SMESH_Gen):
             axis = AxisStruct(vertex1[0], vertex1[1], vertex1[2], normal[0], normal[1], normal[2])
             return axis
         elif len(edges) == 1:
-            vertex1, vertex2 = self.geompyD.SubShapeAll( edges[0], geomBuilder.ShapeType["VERTEX"] )
+            vertex1, vertex2 = self.geompyD.SubShapeAll( edges[0], geomBuilder.geomBuilder.ShapeType["VERTEX"] )
             p1 = self.geompyD.PointCoordinates( vertex1 )
             p2 = self.geompyD.PointCoordinates( vertex2 )
             axis = AxisStruct(p1[0], p1[1], p1[2], p2[0]-p1[0], p2[1]-p1[1], p2[2]-p1[2])
@@ -1003,8 +1006,37 @@ import omniORB
 #Registering the new proxy for SMESH_Gen
 omniORB.registerObjref(SMESH._objref_SMESH_Gen._NP_RepositoryId, smeshBuilder)
 
+## Create a new smeshBuilder instance.The smeshBuilder class provides the Python
+#  interface to create or load meshes.
+#
+#  Typical use is:
+#  \code
+#    import salome
+#    salome.salome_init()
+#    from salome.smesh import smeshBuilder
+#    smesh = smeshBuilder.New(theStudy)
+#  \endcode
+#  @param  study     SALOME study, generally obtained by salome.myStudy.
+#  @param  instance  CORBA proxy of SMESH Engine. If None, the default Engine is used.
+#  @return smeshBuilder instance
 
 def New( study, instance=None):
+    """
+    Create a new smeshBuilder instance.The smeshBuilder class provides the Python
+    interface to create or load meshes.
+
+    Typical use is:
+        import salome
+        salome.salome_init()
+        from salome.smesh import smeshBuilder
+        smesh = smeshBuilder.New(theStudy)
+
+    Parameters:
+        study     SALOME study, generally obtained by salome.myStudy.
+        instance  CORBA proxy of SMESH Engine. If None, the default Engine is used.
+    Returns:
+        smeshBuilder instance
+    """
     global engine
     global smeshInst
     global doLcc
@@ -1173,7 +1205,7 @@ class Mesh:
     #  @ingroup l1_auxiliary
     def MeshDimension(self):
         if self.mesh.HasShapeToMesh():
-            shells = self.geompyD.SubShapeAllIDs( self.geom, geomBuilder.ShapeType["SOLID"] )
+            shells = self.geompyD.SubShapeAllIDs( self.geom, self.geompyD.ShapeType["SOLID"] )
             if len( shells ) > 0 :
                 return 3
             elif self.geompyD.NumberOfFaces( self.geom ) > 0 :
@@ -1636,7 +1668,7 @@ class Mesh:
         elif tgeo == "SOLID" or tgeo == "COMPSOLID":
             typ = VOLUME
         elif tgeo == "COMPOUND":
-            sub = self.geompyD.SubShapeAll( shape, geomBuilder.ShapeType["SHAPE"])
+            sub = self.geompyD.SubShapeAll( shape, self.geompyD.ShapeType["SHAPE"])
             if not sub:
                 raise ValueError,"_groupTypeFromShape(): empty geometric group or compound '%s'" % GetName(shape)
             return self._groupTypeFromShape( sub[0] )