Salome HOME
#17351 [CEA] Mesh with Polyhedron
[modules/smesh.git] / src / SMESH_SWIG / StdMeshersBuilder.py
index 48356cac7ee00d4773c136cd5cf1ba085b0a08e3..8c8a4ced9ed58443984c7a396207ef72a193ecf8 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -75,6 +75,11 @@ POLYGON     = "PolygonPerFace_2D"
 Algorithm type: Polygon Per Face 2D algorithm, see :class:`~StdMeshersBuilder.StdMeshersBuilder_PolygonPerFace`
 """
 
+POLYHEDRON = "PolyhedronPerSolid_3D"
+"""
+Algorithm type: Polyhedron Per Solid 3D algorithm, see :class:`~StdMeshersBuilder.StdMeshersBuilder_PolyhedronPerSolid`
+"""
+
 # import items of enums
 for e in StdMeshers.QuadType._items: exec('%s = StdMeshers.%s'%(e,e))
 for e in StdMeshers.VLExtrusionMethod._items: exec('%s = StdMeshers.%s'%(e,e))
@@ -107,7 +112,7 @@ class StdMeshersBuilder_Segment(Mesh_Algorithm):
     of smeshBuilder.Mesh class    
     """
 
-    docHelper  = "Creates segment 1D algorithm for edges"
+    docHelper  = "Create segment 1D algorithm for edges"
     """
     doc string of the method
     """
@@ -131,7 +136,7 @@ class StdMeshersBuilder_Segment(Mesh_Algorithm):
         Parameters:
             l : for the length of segments that cut an edge
             UseExisting : if == true - searches for an  existing hypothesis created with
-                the same parameters, else (default) - creates a new one
+                the same parameters, else (default) - Create a new one
             p : precision, used for calculation of the number of segments.
                 The precision should be a positive, meaningful value within the range [0,1].
                 In general, the number of segments is calculated with the formula:
@@ -161,7 +166,7 @@ class StdMeshersBuilder_Segment(Mesh_Algorithm):
             length : is optional maximal allowed length of segment, if it is omitted
                 the preestimated length is used that depends on geometry size
             UseExisting : if ==true - searches for an existing hypothesis created with
-                the same parameters, else (default) - creates a new one
+                the same parameters, else (default) - Create a new one
         
         Returns:
             an instance of StdMeshers_MaxLength hypothesis
@@ -169,15 +174,16 @@ class StdMeshersBuilder_Segment(Mesh_Algorithm):
     
 
         hyp = self.Hypothesis("MaxLength", [length], UseExisting=UseExisting)
-        if length > 0.0:
+        if isinstance(length,str) or length > 0:
             # set given length
             hyp.SetLength(length)
         if not UseExisting:
             # set preestimated length
+            import SMESH
             gen = self.mesh.smeshpyD
             initHyp = gen.GetHypothesisParameterValues("MaxLength", "libStdMeshersEngine.so",
                                                        self.mesh.GetMesh(), self.mesh.GetShape(),
-                                                       False) # <- byMesh
+                                                       SMESH.HypInitParams( 1, 1.0, False ))
             preHyp = initHyp._narrow(StdMeshers.StdMeshers_MaxLength)
             if preHyp:
                 hyp.SetPreestimatedLength( preHyp.GetPreestimatedLength() )
@@ -252,7 +258,7 @@ class StdMeshersBuilder_Segment(Mesh_Algorithm):
             maxSize: defines the maximal allowed segment length
             deflection: defines the maximal allowed distance from a segment to an edge
             UseExisting: if ==true - searches for an existing hypothesis created with
-                the same parameters, else (default) - creates a new one
+                the same parameters, else (default) - Create a new one
 
         Returns:
             an instance of StdMeshers_Adaptive1D hypothesis
@@ -280,7 +286,7 @@ class StdMeshersBuilder_Segment(Mesh_Algorithm):
             reversedEdges: is a list of edges to mesh using reversed orientation.
                 A list item can also be a tuple (edge, 1st_vertex_of_edge)
             UseExisting: if ==true - searches for an existing hypothesis created with
-                the same parameters, else (default) - creates a new one
+                the same parameters, else (default) - Create a new one
 
         Returns:
                 an instance of StdMeshers_Arithmetic1D hypothesis
@@ -314,7 +320,7 @@ class StdMeshersBuilder_Segment(Mesh_Algorithm):
                 reversedEdges: is a list of edges to mesh using reversed orientation.
                     A list item can also be a tuple (edge, 1st_vertex_of_edge)
                 UseExisting: if ==true - searches for an existing hypothesis created with
-                    the same parameters, else (default) - creates a new one
+                    the same parameters, else (default) - Create a new one
 
             Returns:
                 an instance of StdMeshers_Geometric1D hypothesis
@@ -349,7 +355,7 @@ class StdMeshersBuilder_Segment(Mesh_Algorithm):
             reversedEdges: is a list of edges to mesh using reversed orientation.
                 A list item can also be a tuple (edge, 1st_vertex_of_edge)
             UseExisting: if ==true - searches for an existing hypothesis created with
-                the same parameters, else (default) - creates a new one
+                the same parameters, else (default) - Create a new one
 
         Returns:
                 an instance of StdMeshers_FixedPoints1D hypothesis
@@ -381,7 +387,7 @@ class StdMeshersBuilder_Segment(Mesh_Algorithm):
             reversedEdges: is a list of edges to mesh using reversed orientation.
                 A list item can also be a tuple (edge, 1st_vertex_of_edge)
             UseExisting: if ==true - searches for an existing hypothesis created with
-                the same parameters, else (default) - creates a new one
+                the same parameters, else (default) - Create a new one
 
         Returns:
             an instance of StdMeshers_StartEndLength hypothesis
@@ -458,7 +464,7 @@ class StdMeshersBuilder_Segment(Mesh_Algorithm):
         hyp.SetFineness( fineness )
         return hyp
 
-    def LengthNearVertex(self, length, vertex=0, UseExisting=0):
+    def LengthNearVertex(self, length, vertex=-1, UseExisting=0):
         """
         Defines "SegmentLengthAroundVertex" hypothesis
 
@@ -468,7 +474,7 @@ class StdMeshersBuilder_Segment(Mesh_Algorithm):
                 Any other integer value means that the hypothesis will be set on the
                 whole 1D shape, where Mesh_Segment algorithm is assigned.
             UseExisting: if ==true - searches for an  existing hypothesis created with
-                the same parameters, else (default) - creates a new one
+                the same parameters, else (default) - Create a new one
         """
         
         import types
@@ -545,7 +551,7 @@ class StdMeshersBuilder_CompositeSegment(StdMeshersBuilder_Segment):
         of smeshBuilder.Mesh class
     """
 
-    docHelper  = "Creates segment 1D algorithm for edges"
+    docHelper  = "Create segment 1D algorithm for edges"
     """
     doc string of the method
     """
@@ -566,8 +572,8 @@ class StdMeshersBuilder_CompositeSegment(StdMeshersBuilder_Segment):
 
 class StdMeshersBuilder_Segment_Python(Mesh_Algorithm):
     """
-    Defines a segment 1D algorithm for discretization of edges with Python function
-        It is created by calling smeshBuilder.Mesh.Segment(smeshBuilder.PYTHON,geom=0)
+    Defines a segment 1D algorithm for discretization of edges with Python function.
+    It is created by calling smeshBuilder.Mesh.Segment(smeshBuilder.PYTHON,geom=0)
     """
     
 
@@ -579,7 +585,7 @@ class StdMeshersBuilder_Segment_Python(Mesh_Algorithm):
     """
     type of algorithm used with helper function in smeshBuilder.Mesh class
     """
-    docHelper  = "Creates segment 1D algorithm for edges"
+    docHelper  = "Create segment 1D algorithm for edges"
     """
     doc string of the method
     """
@@ -605,7 +611,7 @@ class StdMeshersBuilder_Segment_Python(Mesh_Algorithm):
             n: for the number of segments that cut an edge
             func: for the python function that calculates the length of all segments
             UseExisting: if ==true - searches for the existing hypothesis created with
-                the same parameters, else (default) - creates a new one
+                the same parameters, else (default) - Create a new one
         """
         
         compFun = lambda hyp, args: False
@@ -619,7 +625,7 @@ class StdMeshersBuilder_Segment_Python(Mesh_Algorithm):
 
 class StdMeshersBuilder_Triangle_MEFISTO(Mesh_Algorithm):
     """
-    Triangle MEFISTO 2D algorithm
+    Triangle MEFISTO 2D algorithm.
     It is created by calling smeshBuilder.Mesh.Triangle(smeshBuilder.MEFISTO,geom=0)
     """
     
@@ -637,7 +643,7 @@ class StdMeshersBuilder_Triangle_MEFISTO(Mesh_Algorithm):
     flag pointing whether this algorithm should be used by default in dynamic method
         of smeshBuilder.Mesh class
     """
-    docHelper  = "Creates triangle 2D algorithm for faces"
+    docHelper  = "Create triangle 2D algorithm for faces"
     """
     doc string of the method
     """
@@ -662,7 +668,7 @@ class StdMeshersBuilder_Triangle_MEFISTO(Mesh_Algorithm):
         Parameters:
             area: for the maximum area of each triangle
             UseExisting: if ==true - searches for an  existing hypothesis created with the
-                same parameters, else (default) - creates a new one
+                same parameters, else (default) - Create a new one
         """
         
         from salome.smesh.smeshBuilder import IsEqual
@@ -685,7 +691,7 @@ class StdMeshersBuilder_Triangle_MEFISTO(Mesh_Algorithm):
 
 class StdMeshersBuilder_Quadrangle(Mesh_Algorithm):
     """
-    Defines a quadrangle 2D algorithm
+    Defines a quadrangle 2D algorithm.
     It is created by calling smeshBuilder.Mesh.Quadrangle(geom=0)
     """
     
@@ -703,7 +709,7 @@ class StdMeshersBuilder_Quadrangle(Mesh_Algorithm):
     flag pointing whether this algorithm should be used by default in dynamic method
         of smeshBuilder.Mesh class
     """
-    docHelper  = "Creates quadrangle 2D algorithm for faces"
+    docHelper  = "Create quadrangle 2D algorithm for faces"
     """
     doc string of the method
     """
@@ -726,7 +732,7 @@ class StdMeshersBuilder_Quadrangle(Mesh_Algorithm):
         pass
 
     def QuadrangleParameters(self, quadType=StdMeshers.QUAD_STANDARD, triangleVertex=0,
-                             enfVertices=[],enfPoints=[],UseExisting=0):
+                             enfVertices=[],enfPoints=[],corners=[],UseExisting=0):
         """
         Defines "QuadrangleParameters" hypothesis
             quadType defines the algorithm of transition between differently descretized
@@ -762,8 +768,15 @@ class StdMeshersBuilder_Quadrangle(Mesh_Algorithm):
                 or triples of values ([[x1,y1,z1], [x2,y2,z2], ...]).
                 In the case if the defined QuadrangleParameters() refer to a sole face,
                 all given points must lie on this face, else the mesher fails.
+            corners: list of vertices that should be used as quadrangle corners.
+                The parameter can be useful for faces with more than four vertices,
+                since in some cases Quadrangle Mapping algorithm chooses corner vertices
+                differently than it is desired.
+                A hypothesis can be global and define corners for all CAD faces that
+                require it, but be sure that each specified vertex is a corner in all
+                faces the hypothesis will be applied to.
             UseExisting: if *True* - searches for the existing hypothesis created with
-                the same parameters, else (default) - creates a new one
+                the same parameters, else (default) - Create a new one
         """
         
 
@@ -774,6 +787,7 @@ class StdMeshersBuilder_Quadrangle(Mesh_Algorithm):
         if isinstance( enfVertices, int ) and not enfPoints and not UseExisting:
             # a call of old syntax, before inserting enfVertices and enfPoints before UseExisting
             UseExisting, enfVertices = enfVertices, []
+
         pStructs, xyz = [], []
         for p in enfPoints:
             if isinstance( p, SMESH.PointStruct ):
@@ -791,6 +805,10 @@ class StdMeshersBuilder_Quadrangle(Mesh_Algorithm):
             self.params = self.Hypothesis("QuadrangleParams", [quadType,vertexID,entries,xyz],
                                           UseExisting = UseExisting, CompareMethod=compFun)
             pass
+
+        if corners and isinstance( corners[0], GEOM._objref_GEOM_Object ):
+            corners = [ self.mesh.geompyD.GetSubShapeID( self.mesh.geom, v ) for v in corners ]
+
         if self.params.GetQuadType() != quadType:
             self.params.SetQuadType(quadType)
         if vertexID > 0:
@@ -799,6 +817,7 @@ class StdMeshersBuilder_Quadrangle(Mesh_Algorithm):
         for v in enfVertices:
             AssureGeomPublished( self.mesh, v )
         self.params.SetEnforcedNodes( enfVertices, pStructs )
+        self.params.SetCorners( corners )
         return self.params
 
     def QuadranglePreference(self, reversed=False, UseExisting=0):
@@ -810,7 +829,7 @@ class StdMeshersBuilder_Quadrangle(Mesh_Algorithm):
         Parameters:
             reversed: if True, transition area is located along the coarser meshed sides.
         UseExisting: if ==true - searches for the existing hypothesis created with
-            the same parameters, else (default) - creates a new one
+            the same parameters, else (default) - Create a new one
         """
         
         if reversed:
@@ -824,7 +843,7 @@ class StdMeshersBuilder_Quadrangle(Mesh_Algorithm):
 
         Parameters:
             UseExisting: if ==true - searches for the existing hypothesis created with
-                the same parameters, else (default) - creates a new one
+                the same parameters, else (default) - Create a new one
         """
     
         return self.QuadrangleParameters(QUAD_TRIANGLE_PREF,UseExisting=UseExisting)
@@ -839,7 +858,7 @@ class StdMeshersBuilder_Quadrangle(Mesh_Algorithm):
 
         Parameters:
             UseExisting: if ==true - searches for the existing hypothesis created with
-                the same parameters, else (default) - creates a new one
+                the same parameters, else (default) - Create a new one
         """
         
         return self.QuadrangleParameters(QUAD_REDUCED,UseExisting=UseExisting)
@@ -854,7 +873,7 @@ class StdMeshersBuilder_Quadrangle(Mesh_Algorithm):
                 Vertex can be either a GEOM_Object or a vertex ID within the
                 shape to mesh
              UseExisting: if ==true - searches for the existing hypothesis created with
-                the same parameters, else (default) - creates a new one
+                the same parameters, else (default) - Create a new one
         """
         
         return self.QuadrangleParameters(QUAD_STANDARD,vertex,UseExisting)
@@ -863,7 +882,7 @@ class StdMeshersBuilder_Quadrangle(Mesh_Algorithm):
 
 class StdMeshersBuilder_Hexahedron(Mesh_Algorithm):
     """
-    Defines a hexahedron 3D algorithm
+    Defines a hexahedron 3D algorithm.
     It is created by calling smeshBuilder.Mesh.Hexahedron(geom=0)
     """
     
@@ -881,7 +900,7 @@ class StdMeshersBuilder_Hexahedron(Mesh_Algorithm):
     flag pointing whether this algorithm should be used by default in dynamic method
         of smeshBuilder.Mesh class
     """
-    docHelper  = "Creates hexahedron 3D algorithm for volumes"
+    docHelper  = "Create hexahedron 3D algorithm for volumes"
     """
     doc string of the method
     """
@@ -903,7 +922,7 @@ class StdMeshersBuilder_Hexahedron(Mesh_Algorithm):
 
 class StdMeshersBuilder_Projection1D(Mesh_Algorithm):
     """
-    Defines a projection 1D algorithm
+    Defines a projection 1D algorithm.
     It is created by calling smeshBuilder.Mesh.Projection1D(geom=0)
     """
     
@@ -921,7 +940,7 @@ class StdMeshersBuilder_Projection1D(Mesh_Algorithm):
     flag pointing whether this algorithm should be used by default in dynamic method
         of smeshBuilder.Mesh class
     """
-    docHelper  = "Creates projection 1D algorithm for edges"
+    docHelper  = "Create projection 1D algorithm for edges"
     """
     doc string of the method
     """
@@ -950,7 +969,7 @@ class StdMeshersBuilder_Projection1D(Mesh_Algorithm):
             srcV: a vertex of *edge* to associate with *tgtV* (optional)
             tgtV: a vertex of *the edge* to which the algorithm is assigned, to associate with *srcV* (optional)
             UseExisting: if ==true - searches for the existing hypothesis created with
-                the same parameters, else (default) - creates a new one
+                the same parameters, else (default) - Create a new one
         """
         from salome.smesh.smeshBuilder import AssureGeomPublished, Mesh
         AssureGeomPublished( self.mesh, edge )
@@ -971,7 +990,7 @@ class StdMeshersBuilder_Projection1D(Mesh_Algorithm):
 
 class StdMeshersBuilder_Projection2D(Mesh_Algorithm):
     """
-    Defines a projection 2D algorithm
+    Defines a projection 2D algorithm.
     It is created by calling smeshBuilder.Mesh.Projection2D(geom=0)
     """
     
@@ -989,7 +1008,7 @@ class StdMeshersBuilder_Projection2D(Mesh_Algorithm):
     flag pointing whether this algorithm should be used by default in dynamic method
         of smeshBuilder.Mesh class
     """
-    docHelper  = "Creates projection 2D algorithm for faces"
+    docHelper  = "Create projection 2D algorithm for faces"
     """
     doc string of the method
     """
@@ -1048,7 +1067,7 @@ class StdMeshersBuilder_Projection2D(Mesh_Algorithm):
 
 class StdMeshersBuilder_Projection1D2D(StdMeshersBuilder_Projection2D):
     """
-    Defines a projection 1D-2D algorithm
+    Defines a projection 1D-2D algorithm.
     It is created by calling smeshBuilder.Mesh.Projection1D2D(geom=0)
     """
     
@@ -1061,7 +1080,7 @@ class StdMeshersBuilder_Projection1D2D(StdMeshersBuilder_Projection2D):
     """
     type of algorithm used with helper function in smeshBuilder.Mesh class
     """
-    docHelper  = "Creates projection 1D-2D algorithm for faces"
+    docHelper  = "Create projection 1D-2D algorithm for faces"
     """
     doc string of the method
     """
@@ -1082,7 +1101,7 @@ class StdMeshersBuilder_Projection1D2D(StdMeshersBuilder_Projection2D):
 
 class StdMeshersBuilder_Projection3D(Mesh_Algorithm):
     """
-    Defines a projection 3D algorithm
+    Defines a projection 3D algorithm.
     It is created by calling smeshBuilder.Mesh.Projection3D(geom=0)
     """
     
@@ -1095,7 +1114,7 @@ class StdMeshersBuilder_Projection3D(Mesh_Algorithm):
     """
     type of algorithm used with helper function in smeshBuilder.Mesh class
     """
-    docHelper  = "Creates projection 3D algorithm for volumes"
+    docHelper  = "Create projection 3D algorithm for volumes"
     """
     doc string of the method
     """
@@ -1128,7 +1147,7 @@ class StdMeshersBuilder_Projection3D(Mesh_Algorithm):
             srcV2: a vertex of *solid* to associate with *tgtV1* (optional)
             tgtV2: a vertex of *the solid* to which the algorithm is assigned,to associate with *srcV2* (optional)
             UseExisting: if ==true - searches for the existing hypothesis created with
-                    the same parameters, else (default) - creates a new one
+                    the same parameters, else (default) - Create a new one
 
         Note: 
             association vertices must belong to one edge of a solid
@@ -1156,7 +1175,7 @@ class StdMeshersBuilder_Projection3D(Mesh_Algorithm):
 
 class StdMeshersBuilder_Prism3D(Mesh_Algorithm):
     """
-    Defines a Prism 3D algorithm, which is either "Extrusion 3D" or "Radial Prism" depending on geometry
+    Defines a Prism 3D algorithm, which is either "Extrusion 3D" or "Radial Prism" depending on geometry.
     It is created by calling smeshBuilder.Mesh.Prism(geom=0)
     """
     
@@ -1169,7 +1188,7 @@ class StdMeshersBuilder_Prism3D(Mesh_Algorithm):
     """
     type of algorithm used with helper function in smeshBuilder.Mesh class
     """
-    docHelper  = "Creates prism 3D algorithm for volumes"
+    docHelper  = "Create prism 3D algorithm for volumes"
     """
     doc string of the method
     """
@@ -1245,7 +1264,7 @@ class StdMeshersBuilder_Prism3D(Mesh_Algorithm):
         Parameters:
             n: number of layers
             UseExisting: if ==true - searches for the existing hypothesis created with
-                the same parameters, else (default) - creates a new one
+                the same parameters, else (default) - Create a new one
         """
         if self.algoType != "RadialPrism_3D":
             print("Prism_3D algorithm doesn't support any hypothesis")
@@ -1367,10 +1386,11 @@ class StdMeshersBuilder_Prism3D(Mesh_Algorithm):
 
 class StdMeshersBuilder_RadialPrism3D(StdMeshersBuilder_Prism3D):
     """
-    Defines Radial Prism 3D algorithm
-    It is created by calling smeshBuilder.Mesh.Prism(geom=0)
+    Defines Radial Prism 3D algorithm.
+    It is created by calling smeshBuilder.Mesh.Prism(geom=0).
+    See :class:`StdMeshersBuilder_Prism3D` for methods defining distribution of mesh layers
+    build between the inner and outer shells.
     """
-    
 
     meshMethod = "Prism"
     """
@@ -1380,7 +1400,7 @@ class StdMeshersBuilder_RadialPrism3D(StdMeshersBuilder_Prism3D):
     """
     type of algorithm used with helper function in smeshBuilder.Mesh class
     """
-    docHelper  = "Creates Raial Prism 3D algorithm for volumes"
+    docHelper  = "Create Raial Prism 3D algorithm for volumes"
     """
     doc string of the method
     """
@@ -1452,7 +1472,7 @@ class StdMeshersBuilder_RadialAlgorithm(Mesh_Algorithm):
         Parameters:
             n: number of layers
             UseExisting: if ==true - searches for the existing hypothesis created with
-                the same parameters, else (default) - creates a new one
+                the same parameters, else (default) - Create a new one
         """
         if self.distribHyp:
             self.mesh.GetMesh().RemoveHypothesis( self.geom, self.distribHyp )
@@ -1550,7 +1570,7 @@ class StdMeshersBuilder_RadialAlgorithm(Mesh_Algorithm):
 
 class StdMeshersBuilder_RadialQuadrangle1D2D(StdMeshersBuilder_RadialAlgorithm):
     """
-    Defines a Radial Quadrangle 1D-2D algorithm 
+    Defines a Radial Quadrangle 1D-2D algorithm.
     It is created by calling smeshBuilder.Mesh.Quadrangle(smeshBuilder.RADIAL_QUAD,geom=0)
     """
 
@@ -1562,7 +1582,7 @@ class StdMeshersBuilder_RadialQuadrangle1D2D(StdMeshersBuilder_RadialAlgorithm):
     """
     type of algorithm used with helper function in smeshBuilder.Mesh class
     """
-    docHelper  = "Creates quadrangle 1D-2D algorithm for faces having a shape of disk or a disk segment"
+    docHelper  = "Create quadrangle 1D-2D algorithm for faces having a shape of disk or a disk segment"
     """
     doc string of the method
     """
@@ -1586,7 +1606,7 @@ class StdMeshersBuilder_RadialQuadrangle1D2D(StdMeshersBuilder_RadialAlgorithm):
 
 class StdMeshersBuilder_QuadMA_1D2D(StdMeshersBuilder_RadialAlgorithm):
     """
-    Defines a Quadrangle (Medial Axis Projection) 1D-2D algorithm 
+    Defines a Quadrangle (Medial Axis Projection) 1D-2D algorithm .
     It is created by calling smeshBuilder.Mesh.Quadrangle(smeshBuilder.QUAD_MA_PROJ,geom=0)
     """
 
@@ -1598,7 +1618,7 @@ class StdMeshersBuilder_QuadMA_1D2D(StdMeshersBuilder_RadialAlgorithm):
     """
     type of algorithm used with helper function in smeshBuilder.Mesh class
     """
-    docHelper  = "Creates quadrangle 1D-2D algorithm for faces"
+    docHelper  = "Create quadrangle 1D-2D algorithm for faces"
     """
     doc string of the method
     """
@@ -1619,7 +1639,7 @@ class StdMeshersBuilder_QuadMA_1D2D(StdMeshersBuilder_RadialAlgorithm):
     pass
 
 class StdMeshersBuilder_PolygonPerFace(Mesh_Algorithm):
-    """ Defines a Polygon Per Face 2D algorithm 
+    """ Defines a Polygon Per Face 2D algorithm.
         It is created by calling smeshBuilder.Mesh.Polygon(geom=0)
     """
 
@@ -1636,7 +1656,45 @@ class StdMeshersBuilder_PolygonPerFace(Mesh_Algorithm):
     flag pointing whether this algorithm should be used by default in dynamic method
         of smeshBuilder.Mesh class
     """
-    docHelper  = "Creates polygon 2D algorithm for faces"
+    docHelper  = "Create polygon 2D algorithm for faces"
+    """
+    doc string of the method
+    """
+
+    def __init__(self, mesh, geom=0):
+        """
+        Private constructor.
+
+        Parameters:
+            mesh: parent mesh object algorithm is assigned to
+            geom: geometry (shape/sub-shape) algorithm is assigned to;
+                if it is :code:`0` (default), the algorithm is assigned to the main shape
+        """
+        Mesh_Algorithm.__init__(self)
+        self.Create(mesh, geom, self.algoType)
+        pass
+
+    pass
+
+class StdMeshersBuilder_PolyhedronPerSolid(Mesh_Algorithm):
+    """ Defines a Polyhedron Per Solid 3D algorithm.
+        It is created by calling smeshBuilder.Mesh.Polyhedron(geom=0)
+    """
+
+    meshMethod = "Polyhedron"
+    """
+    name of the dynamic method in smeshBuilder.Mesh class
+    """
+    algoType   = POLYHEDRON
+    """
+    type of algorithm used with helper function in smeshBuilder.Mesh class
+    """
+    isDefault  = True
+    """
+    flag pointing whether this algorithm should be used by default in dynamic method
+        of smeshBuilder.Mesh class
+    """
+    docHelper  = "Create polyhedron 3D algorithm for solids"
     """
     doc string of the method
     """
@@ -1657,7 +1715,7 @@ class StdMeshersBuilder_PolygonPerFace(Mesh_Algorithm):
     pass
 
 class StdMeshersBuilder_UseExistingElements_1D(Mesh_Algorithm):
-    """ Defines a Use Existing Elements 1D algorithm
+    """ Defines a Use Existing Elements 1D algorithm.
 
     It is created by calling smeshBuilder.Mesh.UseExisting1DElements(geom=0)
     """
@@ -1676,7 +1734,7 @@ class StdMeshersBuilder_UseExistingElements_1D(Mesh_Algorithm):
     flag pointing whether this algorithm should be used by default in dynamic method
         of smeshBuilder.Mesh class
     """
-    docHelper  = "Creates 1D algorithm for edges with reusing of existing mesh elements"
+    docHelper  = "Create 1D algorithm for edges with reusing of existing mesh elements"
     """
     doc string of the method
     """
@@ -1703,7 +1761,7 @@ class StdMeshersBuilder_UseExistingElements_1D(Mesh_Algorithm):
             toCopyMesh: if True, the whole mesh *groups* belong to is imported
             toCopyGroups: if True, all groups of the mesh *groups* belong to are imported
             UseExisting: if ==true - searches for the existing hypothesis created with
-                the same parameters, else (default) - creates a new one
+                the same parameters, else (default) - Create a new one
         """
         for group in groups:
             from salome.smesh.smeshBuilder import AssureGeomPublished
@@ -1719,7 +1777,7 @@ class StdMeshersBuilder_UseExistingElements_1D(Mesh_Algorithm):
     pass # end of StdMeshersBuilder_UseExistingElements_1D class
 
 class StdMeshersBuilder_UseExistingElements_1D2D(Mesh_Algorithm):
-    """ Defines a Use Existing Elements 1D-2D algorithm
+    """ Defines a Use Existing Elements 1D-2D algorithm.
 
     It is created by calling smeshBuilder.Mesh.UseExisting2DElements(geom=0)
     """
@@ -1738,7 +1796,7 @@ class StdMeshersBuilder_UseExistingElements_1D2D(Mesh_Algorithm):
     flag pointing whether this algorithm should be used by default in dynamic method
         of smeshBuilder.Mesh class
     """
-    docHelper  = "Creates 1D-2D algorithm for faces with reusing of existing mesh elements"
+    docHelper  = "Create 1D-2D algorithm for faces with reusing of existing mesh elements"
     """
     doc string of the method
     """
@@ -1765,7 +1823,7 @@ class StdMeshersBuilder_UseExistingElements_1D2D(Mesh_Algorithm):
             toCopyMesh: if True, the whole mesh *groups* belong to is imported
             toCopyGroups: if True, all groups of the mesh *groups* belong to are imported
             UseExisting: if ==true - searches for the existing hypothesis created with
-                the same parameters, else (default) - creates a new one
+                the same parameters, else (default) - Create a new one
         """
         import SMESH
         compFun = lambda hyp, args: ( hyp.GetSourceFaces() == args[0] and \
@@ -1782,7 +1840,7 @@ class StdMeshersBuilder_UseExistingElements_1D2D(Mesh_Algorithm):
     pass # end of StdMeshersBuilder_UseExistingElements_1D2D class
 
 class StdMeshersBuilder_Cartesian_3D(Mesh_Algorithm):
-    """ Defines a Body Fitting 3D algorithm
+    """ Defines a Body Fitting 3D algorithm.
 
     It is created by calling smeshBuilder.Mesh.BodyFitted(geom=0)
     """
@@ -1801,7 +1859,7 @@ class StdMeshersBuilder_Cartesian_3D(Mesh_Algorithm):
     flag pointing whether this algorithm should be used by default in dynamic method
         of smeshBuilder.Mesh class
     """
-    docHelper  = "Creates Body Fitting 3D algorithm for volumes"
+    docHelper  = "Create Body Fitting 3D algorithm for volumes"
     """
     doc string of the method
     """
@@ -1831,7 +1889,7 @@ class StdMeshersBuilder_Cartesian_3D(Mesh_Algorithm):
                     - Functions f(t) defining grid spacing at each point on grid axis. If there are
                         several functions, they must be accompanied by relative coordinates of
                         points dividing the whole shape into ranges where the functions apply; points
-                        coodrinates should vary within (0.0, 1.0) range. Parameter *t* of the spacing
+                        coordinates should vary within (0.0, 1.0) range. Parameter *t* of the spacing
                         function f(t) varies from 0.0 to 1.0 within a shape range. 
 
         Examples:
@@ -1944,7 +2002,7 @@ class StdMeshersBuilder_Cartesian_3D(Mesh_Algorithm):
 
 class StdMeshersBuilder_UseExisting_1D(Mesh_Algorithm):
     """ Defines a stub 1D algorithm, which enables "manual" creation of nodes and
-        segments usable by 2D algorithms
+        segments usable by 2D algorithms.
 
     It is created by calling smeshBuilder.Mesh.UseExistingSegments(geom=0)
     """
@@ -1958,7 +2016,7 @@ class StdMeshersBuilder_UseExisting_1D(Mesh_Algorithm):
     """
     type of algorithm used with helper function in smeshBuilder.Mesh class
     """
-    docHelper  = "Creates 1D algorithm allowing batch meshing of edges"
+    docHelper  = "Create 1D algorithm allowing batch meshing of edges"
     """
     doc string of the method
     """
@@ -1979,7 +2037,7 @@ class StdMeshersBuilder_UseExisting_1D(Mesh_Algorithm):
 
 class StdMeshersBuilder_UseExisting_2D(Mesh_Algorithm):
     """ Defines a stub 2D algorithm, which enables "manual" creation of nodes and
-    faces usable by 3D algorithms
+    faces usable by 3D algorithms.
 
     It is created by calling smeshBuilder.Mesh.UseExistingFaces(geom=0)
     """
@@ -1993,7 +2051,7 @@ class StdMeshersBuilder_UseExisting_2D(Mesh_Algorithm):
     """
     type of algorithm used with helper function in smeshBuilder.Mesh class
     """
-    docHelper  = "Creates 2D algorithm allowing batch meshing of faces"
+    docHelper  = "Create 2D algorithm allowing batch meshing of faces"
     """
     doc string of the method
     """