Salome HOME
Typo fixes by Kunda
[modules/smesh.git] / src / SMESH_SWIG / smeshBuilder.py
index 64ee3091fac4d11ff59c6b0682d2f9bfb3cc2865..52d2451574f7651daa11cea0c9fb85fa4a6f7d57 100644 (file)
@@ -475,6 +475,24 @@ class smeshBuilder( SMESH._objref_SMESH_Gen, object ):
             obj,name = name,obj
         return Mesh(self, self.geompyD, obj, name)
 
+    def RemoveMesh( self, mesh ):
+        """
+        Delete a mesh
+        """
+        if isinstance( mesh, Mesh ):
+            mesh = mesh.GetMesh()
+            pass
+        if not isinstance( mesh, SMESH._objref_SMESH_Mesh ):
+            raise TypeError("%s is not a mesh" % mesh )
+        so = salome.ObjectToSObject( mesh )
+        if so:
+            sb = salome.myStudy.NewBuilder()
+            sb.RemoveObjectWithChildren( so )
+        else:
+            mesh.UnRegister()
+            pass
+        return
+
     def EnumToLong(self,theItem):
         """
         Return a long value from enumeration
@@ -812,7 +830,7 @@ class smeshBuilder( SMESH._objref_SMESH_Gen, object ):
 
         Parameters:
                 sourceMesh: the mesh to copy definition of.
-                newGeom: the new geomtry.
+                newGeom: the new geometry.
                 meshName: an optional name of the new mesh. If omitted, the mesh name is kept.
                 toCopyGroups: to create groups in the new mesh.
                 toReuseHypotheses: to reuse hypotheses of the *sourceMesh*.
@@ -823,7 +841,7 @@ class smeshBuilder( SMESH._objref_SMESH_Gen, object ):
                 *invalidEntries* are study entries of objects whose
                 counterparts are not found in the *newGeom*, followed by entries
                 of mesh sub-objects that are invalid because they depend on a not found
-                preceeding sub-shape
+                preceding sub-shape
         """
         if isinstance( sourceMesh, Mesh ):
             sourceMesh = sourceMesh.GetMesh()
@@ -4384,7 +4402,8 @@ class Mesh(metaclass = MeshMeta):
 
         Returns:
              A list of edge groups and a list of corresponding node groups,
-             where the group is a list of IDs of edges or elements.
+             where the group is a list of IDs of edges or elements, like follows
+             [[[branch_edges_1],[branch_edges_2]], [[branch_nodes_1],[branch_nodes_2]]].
              If a group is closed, the first and last nodes of the group are same.
         """
         if isinstance( edges, Mesh ):
@@ -4489,8 +4508,8 @@ class Mesh(metaclass = MeshMeta):
         Reorient faces contained in *the2DObject*.
 
         Parameters:
-                the2DObject: is a :class:`mesh, sub-mesh, group or filter <SMESH.SMESH_IDSource>` or list of IDs of 2D elements
-                theDirection: is a desired direction of normal of *theFace*.
+                the2DObject: a :class:`mesh, sub-mesh, group or filter <SMESH.SMESH_IDSource>` or list of IDs of 2D elements
+                theDirection: a desired direction of normal of *theFace*.
                         It can be either a GEOM vector or a list of coordinates [x,y,z].
                 theFaceOrPoint: defines a face of *the2DObject* whose normal will be
                         compared with theDirection. It can be either ID of face or a point
@@ -6418,7 +6437,7 @@ class Mesh(metaclass = MeshMeta):
             holeNodes = SMESH.FreeBorder(nodeIDs=holeNodes)
         if not isinstance( holeNodes, SMESH.FreeBorder ):
             raise TypeError("holeNodes must be either SMESH.FreeBorder or list of integer and not %s" % holeNodes)
-        self.editor.FillHole( holeNodes, groupName )
+        return self.editor.FillHole( holeNodes, groupName )
 
     def FindCoincidentFreeBorders (self, tolerance=0.):
         """
@@ -6898,7 +6917,7 @@ class Mesh(metaclass = MeshMeta):
     def MakeSlot(self, segmentGroup, width ):
         """
         Create a slot of given width around given 1D elements lying on a triangle mesh.
-        The slot is consrtucted by cutting faces by cylindrical surfaces made
+        The slot is constructed by cutting faces by cylindrical surfaces made
         around each segment. Segments are expected to be created by MakePolyLine().
 
         Returns:
@@ -6947,7 +6966,7 @@ class Mesh(metaclass = MeshMeta):
 
     def GetLength(self, elemId=None):
         """
-        Get length of all given 1D elements or sum length of all 1D mesh elements
+        Get length of given 1D elements or of all 1D mesh elements
 
         Parameters:
             elemId: either a mesh element ID or a list of IDs or :class:`sub-mesh, group or filter <SMESH.SMESH_IDSource>`. By default sum length of all 1D elements will be calculated.
@@ -6977,7 +6996,7 @@ class Mesh(metaclass = MeshMeta):
 
     def GetArea(self, elemId=None):
         """
-        Get area of given 2D elements or sum area of all 2D mesh elements
+        Get area of given 2D elements or of all 2D mesh elements
 
         Parameters:
             elemId: either a mesh element ID or a list of IDs or :class:`sub-mesh, group or filter <SMESH.SMESH_IDSource>`. By default sum area of all 2D elements will be calculated.
@@ -7007,7 +7026,7 @@ class Mesh(metaclass = MeshMeta):
 
     def GetVolume(self, elemId=None):
         """
-        Get volume of a 3D element or sum of volumes of all 3D mesh elements
+        Get volume of given 3D elements or of all 3D mesh elements
 
         Parameters:
             elemId: either a mesh element ID or a list of IDs or :class:`sub-mesh, group or filter <SMESH.SMESH_IDSource>`. By default sum volume of all 3D elements will be calculated.