Salome HOME
29470 - Point cloud on a face
[modules/geom.git] / src / GEOM_SWIG / geomBuilder.py
old mode 100755 (executable)
new mode 100644 (file)
index fad3398..9c8ad7f
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2022  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
@@ -52,7 +52,7 @@
 ## @code
 ## import salome
 ## from salome.geom import geomBuilder
-## geompy = geomBuilder.New(salome.myStudy)
+## geompy = geomBuilder.New()
 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100) # box is not published in the study yet
 ## geompy.addToStudy(box, "box")             # explicit publishing
 ## @endcode
 ## @code
 ## import salome
 ## from salome.geom import geomBuilder
-## geompy = geomBuilder.New(salome.myStudy)
+## geompy = geomBuilder.New()
 ## geompy.addToStudyAuto() # enable automatic publication
 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100)
 ## # the box is created and published in the study with default name
 ## vertices = geompy.SubShapeAll(box, geomBuilder.ShapeType['VERTEX'])
 ## # only 5 first vertices will be published, with default names
 ## print len(vertices)
-## # note, that result value still containes all 8 vertices
+## # note, that result value still contains all 8 vertices
 ## geompy.addToStudyAuto(-1) # disable automatic publication
 ## @endcode
 ##
 ## @code
 ## import salome
 ## from salome.geom import geomBuilder
-## geompy = geomBuilder.New(salome.myStudy)
+## geompy = geomBuilder.New()
 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "Box")
 ## # the box was created and published in the study
 ## folder = geompy.NewFolder("Primitives")
 ##   @}
 ##   @defgroup l2_measure       Using measurement tools
 ##   @defgroup l2_field         Field on Geometry
+##   @defgroup l2_testing       Testing
 
 ## @}
 
+import omniORB
+
 # initialize SALOME session in try/except block
 # to avoid problems in some cases, e.g. when generating documentation
 try:
@@ -258,11 +261,89 @@ import functools
 
 from salome.geom.gsketcher import Sketcher3D, Sketcher2D, Polyline2D
 
+# In case the omniORBpy EnumItem class does not fully support Python 3
+# (for instance in version 4.2.1-2), the comparison ordering methods must be
+# defined
+#
+try:
+    GEOM.COMPOUND < GEOM.SOLID
+except TypeError:
+    def enumitem_eq(self, other):
+        try:
+            if isinstance(other, omniORB.EnumItem):
+                if other._parent_id == self._parent_id:
+                    return self._v == other._v
+                else:
+                    return self._parent_id == other._parent_id
+            else:
+                return id(self) == id(other)
+        except:
+            return id(self) == id(other)
+
+    def enumitem_lt(self, other):
+        try:
+            if isinstance(other, omniORB.EnumItem):
+                if other._parent_id == self._parent_id:
+                    return self._v < other._v
+                else:
+                    return self._parent_id < other._parent_id
+            else:
+                return id(self) < id(other)
+        except:
+            return id(self) < id(other)
+
+    def enumitem_le(self, other):
+        try:
+            if isinstance(other, omniORB.EnumItem):
+                if other._parent_id == self._parent_id:
+                    return self._v <= other._v
+                else:
+                    return self._parent_id <= other._parent_id
+            else:
+                return id(self) <= id(other)
+        except:
+            return id(self) <= id(other)
+
+    def enumitem_gt(self, other):
+        try:
+            if isinstance(other, omniORB.EnumItem):
+                if other._parent_id == self._parent_id:
+                    return self._v > other._v
+                else:
+                    return self._parent_id > other._parent_id
+            else:
+                return id(self) > id(other)
+        except:
+            return id(self) > id(other)
+
+    def enumitem_ge(self, other):
+        try:
+            if isinstance(other, omniORB.EnumItem):
+                if other._parent_id == self._parent_id:
+                    return self._v >= other._v
+                else:
+                    return self._parent_id >= other._parent_id
+            else:
+                return id(self) >= id(other)
+        except:
+            return id(self) >= id(other)
+
+    GEOM.omniORB.EnumItem.__eq__ = enumitem_eq
+    GEOM.omniORB.EnumItem.__lt__ = enumitem_lt
+    GEOM.omniORB.EnumItem.__le__ = enumitem_le
+    GEOM.omniORB.EnumItem.__gt__ = enumitem_gt
+    GEOM.omniORB.EnumItem.__ge__ = enumitem_ge
+    omniORB.EnumItem.__eq__ = enumitem_eq
+    omniORB.EnumItem.__lt__ = enumitem_lt
+    omniORB.EnumItem.__le__ = enumitem_le
+    omniORB.EnumItem.__gt__ = enumitem_gt
+    omniORB.EnumItem.__ge__ = enumitem_ge
+
 # service function
 def _toListOfNames(_names, _size=-1):
     l = []
     import types
-    if type(_names) in [types.ListType, types.TupleType]:
+    if type(_names) in [list, tuple]:
         for i in _names: l.append(i)
     elif _names:
         l.append(_names)
@@ -295,8 +376,14 @@ def ManageTransactions(theOpeName):
 ## Raise an Error, containing the Method_name, if Operation is Failed
 ## @ingroup l1_geomBuilder_auxiliary
 def RaiseIfFailed (Method_name, Operation):
-    if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
-        raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
+    if not Operation.IsDone() and Operation.GetErrorCode() != "NOT_FOUND_ANY":
+        raise RuntimeError(Method_name + " : " + Operation.GetErrorCode())
+
+def PrintOrRaise(message, raiseException=False):
+    if raiseException:
+        raise RuntimeError(message)
+    else:
+        print(message)
 
 ## Return list of variables value from salome notebook
 ## @ingroup l1_geomBuilder_auxiliary
@@ -316,7 +403,7 @@ def ParseParameters(*parameters):
                 if notebook.isVariable(parameter):
                     Result.append(notebook.get(parameter))
                 else:
-                    raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
+                    raise RuntimeError("Variable with name '" + parameter + "' doesn't exist!!!")
                 pass
             else:
                 Result.append(parameter)
@@ -365,7 +452,7 @@ def ParseSketcherCommand(command):
                     Result = Result + str(notebook.get(parameter)) + " "
                     pass
                 else:
-                    raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
+                    raise RuntimeError("Variable with name '" + parameter + "' doesn't exist!!!")
                     pass
                 pass
             else:
@@ -438,7 +525,7 @@ def PackData(data):
 ## For example,
 ## \code
 ## from salome.geom import geomBuilder
-## geompy = geomBuilder.New(salome.myStudy)
+## geompy = geomBuilder.New()
 ## texture = geompy.readtexture('mytexture.dat')
 ## texture = geompy.AddTexture(*texture)
 ## obj.SetMarkerTexture(texture)
@@ -464,7 +551,7 @@ def ReadTexture(fname):
 
     Example of usage:
         from salome.geom import geomBuilder
-        geompy = geomBuilder.New(salome.myStudy)
+        geompy = geomBuilder.New()
         texture = geompy.readtexture('mytexture.dat')
         texture = geompy.AddTexture(*texture)
         obj.SetMarkerTexture(texture)
@@ -554,7 +641,7 @@ engine = None
 doLcc = False
 created = False
 
-class geomBuilder(object, GEOM._objref_GEOM_Gen):
+class geomBuilder(GEOM._objref_GEOM_Gen):
 
         ## Enumeration ShapeType as a dictionary. \n
         ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
@@ -600,10 +687,12 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #  - EDGE:                                                 [nb_vertices]
         #
         #  - VERTEX:       [x  y  z]
+        #
+        #  - LCS:          [x y z  xx xy xz  yx yy yz  zx zy zz]
         #  @ingroup l1_geomBuilder_auxiliary
         kind = GEOM.GEOM_IKindOfShape
 
-        def __new__(cls):
+        def __new__(cls, *args):
             global engine
             global geom
             global doLcc
@@ -642,17 +731,14 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             #print "return geom 2 ", geom
             return geom
 
-        def __init__(self):
+        def __init__(self, *args):
             global created
             #print "-------- geomBuilder __init__ --- ", created, self
             if not created:
               created = True
-              GEOM._objref_GEOM_Gen.__init__(self)
+              GEOM._objref_GEOM_Gen.__init__(self, *args)
               self.myMaxNbSubShapesAllowed = 0 # auto-publishing is disabled by default
               self.myBuilder = None
-              self.myStudyId = 0
-              self.father    = None
-
               self.BasicOp  = None
               self.CurvesOp = None
               self.PrimOp   = None
@@ -666,6 +752,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
               self.BlocksOp = None
               self.GroupOp  = None
               self.FieldOp  = None
+              self.TestOp   = None
             pass
 
         ## Process object publication in the study, as follows:
@@ -684,10 +771,10 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             # ---
             def _item_name(_names, _defname, _idx=-1):
                 if not _names: _names = _defname
-                if type(_names) in [types.ListType, types.TupleType]:
+                if type(_names) in [list, tuple]:
                     if _idx >= 0:
                         if _idx >= len(_names) or not _names[_idx]:
-                            if type(_defname) not in [types.ListType, types.TupleType]:
+                            if type(_defname) not in [list, tuple]:
                                 _name = "%s_%d"%(_defname, _idx+1)
                             elif len(_defname) > 0 and _idx >= 0 and _idx < len(_defname):
                                 _name = _defname[_idx]
@@ -732,7 +819,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             if not theName and not theDefaultName:
                 return # neither theName nor theDefaultName is given
             import types
-            if type(theObj) in [types.ListType, types.TupleType]:
+            if type(theObj) in [list, tuple]:
                 # list of objects is being published
                 idx = 0
                 for obj in theObj:
@@ -751,44 +838,35 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
 
         ## @addtogroup l1_geomBuilder_auxiliary
         ## @{
-        def init_geom(self,theStudy):
-            self.myStudy = theStudy
-            self.myStudyId = self.myStudy._get_StudyId()
+        def init_geom(self):
+            self.myStudy = salome.myStudy
             self.myBuilder = self.myStudy.NewBuilder()
-            self.father = self.myStudy.FindComponent("GEOM")
-            notebook.myStudy = theStudy
-            if self.father is None:
-                self.father = self.myBuilder.NewComponent("GEOM")
-                A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
-                FName = A1._narrow(SALOMEDS.AttributeName)
-                FName.SetValue("Geometry")
-                A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
-                aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
-                aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
-                self.myBuilder.DefineComponentInstance(self.father,self)
-                pass
-            self.BasicOp  = self.GetIBasicOperations    (self.myStudyId)
-            self.CurvesOp = self.GetICurvesOperations   (self.myStudyId)
-            self.PrimOp   = self.GetI3DPrimOperations   (self.myStudyId)
-            self.ShapesOp = self.GetIShapesOperations   (self.myStudyId)
-            self.HealOp   = self.GetIHealingOperations  (self.myStudyId)
-            self.InsertOp = self.GetIInsertOperations   (self.myStudyId)
-            self.BoolOp   = self.GetIBooleanOperations  (self.myStudyId)
-            self.TrsfOp   = self.GetITransformOperations(self.myStudyId)
-            self.LocalOp  = self.GetILocalOperations    (self.myStudyId)
-            self.MeasuOp  = self.GetIMeasureOperations  (self.myStudyId)
-            self.BlocksOp = self.GetIBlocksOperations   (self.myStudyId)
-            self.GroupOp  = self.GetIGroupOperations    (self.myStudyId)
-            self.FieldOp  = self.GetIFieldOperations    (self.myStudyId)
-
-            # set GEOM as root in the use case tree
-            self.myUseCaseBuilder = self.myStudy.GetUseCaseBuilder()
-            self.myUseCaseBuilder.SetRootCurrent()
-            self.myUseCaseBuilder.Append(self.father)
+
+            # load data from the study file, if necessary
+            component = self.myStudy.FindComponent("GEOM")
+            if component:
+                self.myBuilder.LoadWith(component, self)
+
+            self.BasicOp  = self.GetIBasicOperations    ()
+            self.CurvesOp = self.GetICurvesOperations   ()
+            self.PrimOp   = self.GetI3DPrimOperations   ()
+            self.ShapesOp = self.GetIShapesOperations   ()
+            self.HealOp   = self.GetIHealingOperations  ()
+            self.InsertOp = self.GetIInsertOperations   ()
+            self.BoolOp   = self.GetIBooleanOperations  ()
+            self.TrsfOp   = self.GetITransformOperations()
+            self.LocalOp  = self.GetILocalOperations    ()
+            self.MeasuOp  = self.GetIMeasureOperations  ()
+            self.BlocksOp = self.GetIBlocksOperations   ()
+            self.GroupOp  = self.GetIGroupOperations    ()
+            self.FieldOp  = self.GetIFieldOperations    ()
+            self.TestOp   = self.GetITestOperations     ()
+
+            notebook.myStudy = self.myStudy
             pass
 
-        def GetPluginOperations(self, studyID, libraryName):
-            op = GEOM._objref_GEOM_Gen.GetPluginOperations(self, studyID, libraryName)
+        def GetPluginOperations(self, libraryName):
+            op = GEOM._objref_GEOM_Gen.GetPluginOperations(self, libraryName)
             return op
 
         ## Enable / disable results auto-publishing
@@ -828,12 +906,12 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
 
         ## Dump component to the Python script
         #  This method overrides IDL function to allow default values for the parameters.
-        def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
+        def DumpPython(self, theIsPublished=True, theIsMultiFile=True):
             """
             Dump component to the Python script
             This method overrides IDL function to allow default values for the parameters.
             """
-            return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
+            return GEOM._objref_GEOM_Gen.DumpPython(self, theIsPublished, theIsMultiFile)
 
         ## Get name for sub-shape aSubObj of shape aMainObj
         #
@@ -888,13 +966,13 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             """
             # Example: see GEOM_TestAll.py
             try:
-                aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
+                aSObject = self.AddInStudy(aShape, aName, None)
                 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
                 if doRestoreSubShapes:
-                    self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
+                    self.RestoreSubShapesSO(aSObject, theArgs,
                                             theFindMethod, theInheritFirstArg, True )
             except:
-                print "addToStudy() failed"
+                print("addToStudy() failed")
                 return ""
             return aShape.GetStudyEntry()
 
@@ -921,10 +999,10 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             """
             # Example: see GEOM_TestAll.py
             try:
-                aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
+                aSObject = self.AddInStudy(aShape, aName, aFather)
                 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
             except:
-                print "addToStudyInFather() failed"
+                print("addToStudyInFather() failed")
                 return ""
             return aShape.GetStudyEntry()
 
@@ -971,7 +1049,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #                            in place of sub-shapes of the first argument,
         #                            because the whole shape corresponds to the first argument.
         #                            Mainly to be used after transformations, but it also can be
-        #                            usefull after partition with one object shape, and some other
+        #                            useful after partition with one object shape, and some other
         #                            operations, where only the first argument has to be considered.
         #                            If theObject has only one argument shape, this flag is automatically
         #                            considered as True, not regarding really passed value.
@@ -997,7 +1075,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                                    in place of sub-shapes of the first argument,
                                    because the whole shape corresponds to the first argument.
                                    Mainly to be used after transformations, but it also can be
-                                   usefull after partition with one object shape, and some other
+                                   useful after partition with one object shape, and some other
                                    operations, where only the first argument has to be considered.
                                    If theObject has only one argument shape, this flag is automatically
                                    considered as True, not regarding really passed value.
@@ -1007,7 +1085,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                 list of published sub-shapes
             """
             # Example: see GEOM_TestAll.py
-            return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
+            return self.RestoreSubShapesO(theObject, theArgs,
                                           theFindMethod, theInheritFirstArg, theAddPrefix)
 
         ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
@@ -1022,7 +1100,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #                            in place of sub-shapes of the first argument,
         #                            because the whole shape corresponds to the first argument.
         #                            Mainly to be used after transformations, but it also can be
-        #                            usefull after partition with one object shape, and some other
+        #                            useful after partition with one object shape, and some other
         #                            operations, where only the first argument has to be considered.
         #                            If theObject has only one argument shape, this flag is automatically
         #                            considered as True, not regarding really passed value.
@@ -1048,7 +1126,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                                    in place of sub-shapes of the first argument,
                                    because the whole shape corresponds to the first argument.
                                    Mainly to be used after transformations, but it also can be
-                                   usefull after partition with one object shape, and some other
+                                   useful after partition with one object shape, and some other
                                    operations, where only the first argument has to be considered.
                                    If theObject has only one argument shape, this flag is automatically
                                    considered as True, not regarding really passed value.
@@ -1059,7 +1137,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                 list of published sub-shapes
             """
             # Example: see GEOM_TestAll.py
-            return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
+            return self.RestoreGivenSubShapesO(theObject, theArgs,
                                                theFindMethod, theInheritFirstArg, theAddPrefix)
 
         # end of l3_restore_ss
@@ -1145,6 +1223,11 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         ## Create a point, corresponding to the given parameter on the given curve.
         #  @param theRefCurve The referenced curve.
         #  @param theParameter Value of parameter on the referenced curve.
+        #  @param takeOrientationIntoAccount flag that tells if it is necessary
+        #         to take the curve's orientation into account for the
+        #         operation. I.e. if this flag is set, the results for the same
+        #         parameters (except the value 0.5) is different for forward
+        #         and reversed curves. If it is not set the result is the same.
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
@@ -1153,13 +1236,20 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #
         #  @ref tui_creation_point "Example"
         @ManageTransactions("BasicOp")
-        def MakeVertexOnCurve(self, theRefCurve, theParameter, theName=None):
+        def MakeVertexOnCurve(self, theRefCurve, theParameter,
+                              takeOrientationIntoAccount=False, theName=None):
             """
             Create a point, corresponding to the given parameter on the given curve.
 
             Parameters:
                 theRefCurve The referenced curve.
                 theParameter Value of parameter on the referenced curve.
+                takeOrientationIntoAccount flag that tells if it is necessary
+                        to take the curve's orientation into account for the
+                        operation. I.e. if this flag is set, the results for
+                        the same parameters (except the value 0.5) is different
+                        for forward and reversed curves. If it is not set
+                        the result is the same.
                 theName Object name; when specified, this parameter is used
                         for result publication in the study. Otherwise, if automatic
                         publication is switched on, default value is used for result name.
@@ -1171,8 +1261,10 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
             """
             # Example: see GEOM_TestAll.py
-            theParameter, Parameters = ParseParameters(theParameter)
-            anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
+            theParameter, takeOrientationIntoAccount, Parameters = ParseParameters(
+                theParameter, takeOrientationIntoAccount)
+            anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter,
+                                                  takeOrientationIntoAccount)
             RaiseIfFailed("MakePointOnCurve", self.BasicOp)
             anObj.SetParameters(Parameters)
             self._autoPublish(anObj, theName, "vertex")
@@ -1349,7 +1441,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #
         #  @ref swig_MakeVertexInsideFace "Example"
         @ManageTransactions("BasicOp")
-        def MakeVertexInsideFace (self, theFace, theName=None):
+        def MakeVertexInsideFace (self, theFace, theNumberOfPnts=1, theName=None):
             """
             Create a point, which lays on the given face.
             The point will lay in arbitrary place of the face.
@@ -1359,6 +1451,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
 
             Parameters:
                 theFace The referenced face.
+                theNumberOfPnts The number of points we want to get, 1 by default.
                 theName Object name; when specified, this parameter is used
                         for result publication in the study. Otherwise, if automatic
                         publication is switched on, default value is used for result name.
@@ -1370,7 +1463,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                 p_on_face = geompy.MakeVertexInsideFace(Face)
             """
             # Example: see GEOM_TestAll.py
-            anObj = self.BasicOp.MakePointOnFace(theFace)
+            anObj = self.BasicOp.MakePointOnFace(theFace, theNumberOfPnts)
             RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
             self._autoPublish(anObj, theName, "vertex")
             return anObj
@@ -1541,7 +1634,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             return anObj
 
         ## Create a line, passing through the given point
-        #  and parrallel to the given direction
+        #  and parallel to the given direction
         #  @param thePnt Point. The resulting line will pass through it.
         #  @param theDir Direction. The resulting line will be parallel to it.
         #  @param theName Object name; when specified, this parameter is used
@@ -1555,7 +1648,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         def MakeLine(self, thePnt, theDir, theName=None):
             """
             Create a line, passing through the given point
-            and parrallel to the given direction
+            and parallel to the given direction
 
             Parameters:
                 thePnt Point. The resulting line will pass through it.
@@ -1675,7 +1768,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         ## Create a plane, passing through the three given points
         #  @param thePnt1 First of three points, defining the plane.
         #  @param thePnt2 Second of three points, defining the plane.
-        #  @param thePnt3 Fird of three points, defining the plane.
+        #  @param thePnt3 Third of three points, defining the plane.
         #  @param theTrimSize Half size of a side of quadrangle face, representing the plane.
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
@@ -1692,7 +1785,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             Parameters:
                 thePnt1 First of three points, defining the plane.
                 thePnt2 Second of three points, defining the plane.
-                thePnt3 Fird of three points, defining the plane.
+                thePnt3 Third of three points, defining the plane.
                 theTrimSize Half size of a side of quadrangle face, representing the plane.
                 theName Object name; when specified, this parameter is used
                         for result publication in the study. Otherwise, if automatic
@@ -2395,7 +2488,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
               anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
             else:
               anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
-            RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
+            RaiseIfFailed("MakeCurveParametric", self.CurvesOp)
             anObj.SetParameters(Parameters)
             self._autoPublish(anObj, theName, "curve")
             return anObj
@@ -3050,8 +3143,10 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             if isinstance(theA,str):
                 flag = True
             theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
-           if flag:
+            if flag:
                 theA = theA*math.pi/180.
+            if theA<=0. or theA>=2*math.pi:
+                raise ValueError("The angle parameter should be strictly between 0 and 2*pi.")
             anObj = self.PrimOp.MakeCylinderPntVecRHA(thePnt, theAxis, theR, theH, theA)
             RaiseIfFailed("MakeCylinderPntVecRHA", self.PrimOp)
             anObj.SetParameters(Parameters)
@@ -3133,6 +3228,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
             if flag:
                 theA = theA*math.pi/180.
+            if theA<=0. or theA>=2*math.pi:
+                raise ValueError("The angle parameter should be strictly between 0 and 2*pi.")
             anObj = self.PrimOp.MakeCylinderRHA(theR, theH, theA)
             RaiseIfFailed("MakeCylinderRHA", self.PrimOp)
             anObj.SetParameters(Parameters)
@@ -3823,7 +3920,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             """
             # Example: see GEOM_TestAll.py
             theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
-            anObj = self.PrimOp.MakeFilling(theContours, theMinDeg, theMaxDeg,
+            anObj = self.PrimOp.MakeFilling(ToList(theContours), theMinDeg, theMaxDeg,
                                             0, theTol3D, 0, GEOM.FOM_Default, True)
             RaiseIfFailed("MakeFillingNew", self.PrimOp)
             anObj.SetParameters(Parameters)
@@ -3866,41 +3963,97 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             return anObj
 
         ## Create a shape by extrusion of the base shape along
-        #  the path shape. The path shape can be a wire or an edge.
+        #  the path shape. The path shape can be a wire or an edge. It is
+        #  possible to generate groups along with the result by means of
+        #  setting the flag \a IsGenerateGroups.<BR>
+        #  If \a thePath is a closed edge or wire and \a IsGenerateGroups is
+        #  set, an error is occurred. If \a thePath is not closed edge/wire,
+        #  the following groups are returned:
+        #  - If \a theBase is unclosed edge or wire: "Down", "Up", "Side1",
+        #    "Side2";
+        #  - If \a theBase is closed edge or wire, face or shell: "Down", "Up",
+        #    "Other".
+        #  .
+        #  "Down" and "Up" groups contain:
+        #  - Edges if \a theBase is edge or wire;
+        #  - Faces if \a theBase is face or shell.<BR>
+        #  .
+        #  "Side1" and "Side2" groups contain edges generated from the first
+        #  and last vertices of \a theBase. The first and last vertices are
+        #  determined taking into account edge/wire orientation.<BR>
+        #  "Other" group represents faces generated from the bounding edges of
+        #  \a theBase.
+        #
         #  @param theBase Base shape to be extruded.
         #  @param thePath Path shape to extrude the base shape along it.
+        #  @param IsGenerateGroups flag that tells if it is necessary to
+        #         create groups. It is equal to False by default.
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
         #
-        #  @return New GEOM.GEOM_Object, containing the created pipe.
+        #  @return New GEOM.GEOM_Object, containing the created pipe if 
+        #          \a IsGenerateGroups is not set. Otherwise it returns a
+        #          list of GEOM.GEOM_Object. Its first element is the created pipe, the
+        #          remaining ones are created groups.
         #
         #  @ref tui_creation_pipe "Example"
         @ManageTransactions("PrimOp")
-        def MakePipe(self, theBase, thePath, theName=None):
+        def MakePipe(self, theBase, thePath,
+                     IsGenerateGroups=False, theName=None):
             """
             Create a shape by extrusion of the base shape along
-            the path shape. The path shape can be a wire or an edge.
+            the path shape. The path shape can be a wire or an edge. It is
+            possible to generate groups along with the result by means of
+            setting the flag IsGenerateGroups.
+            If thePath is a closed edge or wire and IsGenerateGroups is
+            set, an error is occurred. If thePath is not closed edge/wire,
+            the following groups are returned:
+            - If theBase is unclosed edge or wire: "Down", "Up", "Side1",
+              "Side2";
+            - If theBase is closed edge or wire, face or shell: "Down", "Up",
+              "Other".
+            "Down" and "Up" groups contain:
+            - Edges if theBase is edge or wire;
+            - Faces if theBase is face or shell.
+            "Side1" and "Side2" groups contain edges generated from the first
+            and last vertices of theBase. The first and last vertices are
+            determined taking into account edge/wire orientation.
+            "Other" group represents faces generated from the bounding edges of
+            theBase.
 
             Parameters:
                 theBase Base shape to be extruded.
                 thePath Path shape to extrude the base shape along it.
+                IsGenerateGroups flag that tells if it is necessary to
+                        create groups. It is equal to False by default.
                 theName Object name; when specified, this parameter is used
                         for result publication in the study. Otherwise, if automatic
                         publication is switched on, default value is used for result name.
 
             Returns:
-                New GEOM.GEOM_Object, containing the created pipe.
+                New GEOM.GEOM_Object, containing the created pipe if 
+                IsGenerateGroups is not set. Otherwise it returns a
+                list of GEOM.GEOM_Object. Its first element is the created pipe, the
+                remaining ones are created groups.
             """
             # Example: see GEOM_TestAll.py
-            anObj = self.PrimOp.MakePipe(theBase, thePath)
+            aList = self.PrimOp.MakePipe(theBase, thePath, IsGenerateGroups)
             RaiseIfFailed("MakePipe", self.PrimOp)
-            self._autoPublish(anObj, theName, "pipe")
-            return anObj
+
+            if IsGenerateGroups:
+              self._autoPublish(aList, theName, "pipe")
+              return aList
+
+            self._autoPublish(aList[0], theName, "pipe")
+            return aList[0]
 
         ## Create a shape by extrusion of the profile shape along
         #  the path shape. The path shape can be a wire or an edge.
         #  the several profiles can be specified in the several locations of path.
+        #  It is possible to generate groups along with the result by means of
+        #  setting the flag \a IsGenerateGroups. For detailed information on
+        #  groups that can be created please see the method MakePipe().
         #  @param theSeqBases - list of  Bases shape to be extruded.
         #  @param theLocations - list of locations on the path corresponding
         #                        specified list of the Bases shapes. Number of locations
@@ -3910,21 +4063,30 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #                          contact with the spine.
         #  @param theWithCorrection - defining that the section is rotated to be
         #                             orthogonal to the spine tangent in the correspondent point
+        #  @param IsGenerateGroups - flag that tells if it is necessary to
+        #                          create groups. It is equal to False by default.
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
         #
-        #  @return New GEOM.GEOM_Object, containing the created pipe.
+        #  @return New GEOM.GEOM_Object, containing the created pipe if 
+        #          \a IsGenerateGroups is not set. Otherwise it returns new
+        #          GEOM.ListOfGO. Its first element is the created pipe, the
+        #          remaining ones are created groups.
         #
         #  @ref tui_creation_pipe_with_diff_sec "Example"
         @ManageTransactions("PrimOp")
         def MakePipeWithDifferentSections(self, theSeqBases,
                                           theLocations, thePath,
-                                          theWithContact, theWithCorrection, theName=None):
+                                          theWithContact, theWithCorrection,
+                                          IsGenerateGroups=False, theName=None):
             """
             Create a shape by extrusion of the profile shape along
             the path shape. The path shape can be a wire or an edge.
             the several profiles can be specified in the several locations of path.
+            It is possible to generate groups along with the result by means of
+            setting the flag IsGenerateGroups. For detailed information on
+            groups that can be created please see the method geompy.MakePipe().
 
             Parameters:
                 theSeqBases - list of  Bases shape to be extruded.
@@ -3936,23 +4098,74 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                                  contact with the spine(0/1)
                 theWithCorrection - defining that the section is rotated to be
                                     orthogonal to the spine tangent in the correspondent point (0/1)
+                IsGenerateGroups - flag that tells if it is necessary to
+                                 create groups. It is equal to False by default.
                 theName Object name; when specified, this parameter is used
                         for result publication in the study. Otherwise, if automatic
                         publication is switched on, default value is used for result name.
 
             Returns:
-                New GEOM.GEOM_Object, containing the created pipe.
+                New GEOM.GEOM_Object, containing the created pipe if 
+                IsGenerateGroups is not set. Otherwise it returns new
+                GEOM.ListOfGO. Its first element is the created pipe, the
+                remaining ones are created groups.
             """
-            anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
+            aList = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
                                                               theLocations, thePath,
-                                                              theWithContact, theWithCorrection)
+                                                              theWithContact, theWithCorrection,
+                                                              False, IsGenerateGroups)
             RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
-            self._autoPublish(anObj, theName, "pipe")
-            return anObj
+
+            if IsGenerateGroups:
+              self._autoPublish(aList, theName, "pipe")
+              return aList
+
+            self._autoPublish(aList[0], theName, "pipe")
+            return aList[0]
 
         ## Create a shape by extrusion of the profile shape along
-        #  the path shape. The path shape can be a wire or a edge.
+        #  the path shape. This function is a version of
+        #  MakePipeWithDifferentSections() with the same parameters, except
+        #  eliminated theWithContact and theWithCorrection. So it is
+        #  possible to find the description of all parameters is in this
+        #  method. The difference is that this method performs the operation
+        #  step by step, i.e. it creates pipes between each pair of neighbor
+        #  sections and fuses them into a single shape.
+        #
+        #  @ref tui_creation_pipe_with_diff_sec "Example"
+        @ManageTransactions("PrimOp")
+        def MakePipeWithDifferentSectionsBySteps(self, theSeqBases,
+                                                 theLocations, thePath,
+                                                 IsGenerateGroups=False, theName=None):
+            """
+            Create a shape by extrusion of the profile shape along
+            the path shape. This function is a version of
+            MakePipeWithDifferentSections() with the same parameters, except
+            eliminated theWithContact and theWithCorrection. So it is
+            possible to find the description of all parameters is in this
+            method. The difference is that this method performs the operation
+            step by step, i.e. it creates pipes between each pair of neighbor
+            sections and fuses them into a single shape.
+            """
+            aList = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
+                                                              theLocations, thePath,
+                                                              False, False,
+                                                              True, IsGenerateGroups)
+            RaiseIfFailed("MakePipeWithDifferentSectionsBySteps", self.PrimOp)
+
+            if IsGenerateGroups:
+              self._autoPublish(aList, theName, "pipe")
+              return aList
+
+            self._autoPublish(aList[0], theName, "pipe")
+            return aList[0]
+
+        ## Create a shape by extrusion of the profile shape along
+        #  the path shape. The path shape can be a wire or an edge.
         #  the several profiles can be specified in the several locations of path.
+        #  It is possible to generate groups along with the result by means of
+        #  setting the flag \a IsGenerateGroups. For detailed information on
+        #  groups that can be created please see the method MakePipe().
         #  @param theSeqBases - list of  Bases shape to be extruded. Base shape must be
         #                       shell or face. If number of faces in neighbour sections
         #                       aren't coincided result solid between such sections will
@@ -3971,21 +4184,30 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #                          contact with the spine.
         #  @param theWithCorrection - defining that the section is rotated to be
         #                             orthogonal to the spine tangent in the correspondent point
+        #  @param IsGenerateGroups - flag that tells if it is necessary to
+        #                          create groups. It is equal to False by default.
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
         #
-        #  @return New GEOM.GEOM_Object, containing the created solids.
+        #  @return New GEOM.GEOM_Object, containing the created solids if 
+        #          \a IsGenerateGroups is not set. Otherwise it returns new
+        #          GEOM.ListOfGO. Its first element is the created solids, the
+        #          remaining ones are created groups.
         #
         #  @ref tui_creation_pipe_with_shell_sec "Example"
         @ManageTransactions("PrimOp")
         def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
                                       theLocations, thePath,
-                                      theWithContact, theWithCorrection, theName=None):
+                                      theWithContact, theWithCorrection,
+                                      IsGenerateGroups=False, theName=None):
             """
             Create a shape by extrusion of the profile shape along
-            the path shape. The path shape can be a wire or a edge.
+            the path shape. The path shape can be a wire or an edge.
             the several profiles can be specified in the several locations of path.
+            It is possible to generate groups along with the result by means of
+            setting the flag IsGenerateGroups. For detailed information on
+            groups that can be created please see the method geompy.MakePipe().
 
             Parameters:
                 theSeqBases - list of  Bases shape to be extruded. Base shape must be
@@ -4006,35 +4228,47 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                                  contact with the spine (0/1)
                 theWithCorrection - defining that the section is rotated to be
                                     orthogonal to the spine tangent in the correspondent point (0/1)
+                IsGenerateGroups - flag that tells if it is necessary to
+                                 create groups. It is equal to False by default.
                 theName Object name; when specified, this parameter is used
                         for result publication in the study. Otherwise, if automatic
                         publication is switched on, default value is used for result name.
 
             Returns:
-                New GEOM.GEOM_Object, containing the created solids.
+                New GEOM.GEOM_Object, containing the created solids if 
+                IsGenerateGroups is not set. Otherwise it returns new
+                GEOM.ListOfGO. Its first element is the created solids, the
+                remaining ones are created groups.
             """
-            anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
+            aList = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
                                                           theLocations, thePath,
-                                                          theWithContact, theWithCorrection)
+                                                          theWithContact, theWithCorrection,
+                                                          IsGenerateGroups)
             RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
-            self._autoPublish(anObj, theName, "pipe")
-            return anObj
+
+            if IsGenerateGroups:
+              self._autoPublish(aList, theName, "pipe")
+              return aList
+
+            self._autoPublish(aList[0], theName, "pipe")
+            return aList[0]
 
         ## Create a shape by extrusion of the profile shape along
         #  the path shape. This function is used only for debug pipe
         #  functionality - it is a version of function MakePipeWithShellSections()
-        #  which give a possibility to recieve information about
+        #  which give a possibility to receive information about
         #  creating pipe between each pair of sections step by step.
         @ManageTransactions("PrimOp")
         def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
                                              theLocations, thePath,
-                                             theWithContact, theWithCorrection, theName=None):
+                                             theWithContact, theWithCorrection,
+                                             IsGenerateGroups=False, theName=None):
             """
             Create a shape by extrusion of the profile shape along
             the path shape. This function is used only for debug pipe
             functionality - it is a version of previous function
             geompy.MakePipeWithShellSections() which give a possibility to
-            recieve information about creating pipe between each pair of
+            receive information about creating pipe between each pair of
             sections step by step.
             """
             res = []
@@ -4047,16 +4281,17 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                 tmpLocations = [ theLocations[i-1], theLocations[i] ]
                 tmpSeqSubBases = []
                 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
-                anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
+                aList = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
                                                               tmpLocations, thePath,
-                                                              theWithContact, theWithCorrection)
+                                                              theWithContact, theWithCorrection,
+                                                              IsGenerateGroups)
                 if self.PrimOp.IsDone() == 0:
-                    print "Problems with pipe creation between ",i," and ",i+1," sections"
+                    print("Problems with pipe creation between ",i," and ",i+1," sections")
                     RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
                     break
                 else:
-                    print "Pipe between ",i," and ",i+1," sections is OK"
-                    res.append(anObj)
+                    print("Pipe between ",i," and ",i+1," sections is OK")
+                    res.append(aList[0])
                     pass
                 pass
 
@@ -4066,132 +4301,213 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             self._autoPublish(resc, theName, "pipe")
             return resc
 
-        ## Create solids between given sections
+        ## Create solids between given sections.
+        #  It is possible to generate groups along with the result by means of
+        #  setting the flag \a IsGenerateGroups. For detailed information on
+        #  groups that can be created please see the method MakePipe().
         #  @param theSeqBases - list of sections (shell or face).
         #  @param theLocations - list of corresponding vertexes
+        #  @param IsGenerateGroups - flag that tells if it is necessary to
+        #         create groups. It is equal to False by default.
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
         #
-        #  @return New GEOM.GEOM_Object, containing the created solids.
+        #  @return New GEOM.GEOM_Object, containing the created solids if 
+        #          \a IsGenerateGroups is not set. Otherwise it returns new
+        #          GEOM.ListOfGO. Its first element is the created solids, the
+        #          remaining ones are created groups.
         #
         #  @ref tui_creation_pipe_without_path "Example"
         @ManageTransactions("PrimOp")
-        def MakePipeShellsWithoutPath(self, theSeqBases, theLocations, theName=None):
+        def MakePipeShellsWithoutPath(self, theSeqBases, theLocations,
+                                      IsGenerateGroups=False, theName=None):
             """
-            Create solids between given sections
+            Create solids between given sections.
+            It is possible to generate groups along with the result by means of
+            setting the flag IsGenerateGroups. For detailed information on
+            groups that can be created please see the method geompy.MakePipe().
 
             Parameters:
                 theSeqBases - list of sections (shell or face).
                 theLocations - list of corresponding vertexes
+                IsGenerateGroups - flag that tells if it is necessary to
+                                 create groups. It is equal to False by default.
                 theName Object name; when specified, this parameter is used
                         for result publication in the study. Otherwise, if automatic
                         publication is switched on, default value is used for result name.
 
             Returns:
-                New GEOM.GEOM_Object, containing the created solids.
+                New GEOM.GEOM_Object, containing the created solids if 
+                IsGenerateGroups is not set. Otherwise it returns new
+                GEOM.ListOfGO. Its first element is the created solids, the
+                remaining ones are created groups.
             """
-            anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
+            aList = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations,
+                                                          IsGenerateGroups)
             RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
-            self._autoPublish(anObj, theName, "pipe")
-            return anObj
+
+            if IsGenerateGroups:
+              self._autoPublish(aList, theName, "pipe")
+              return aList
+
+            self._autoPublish(aList[0], theName, "pipe")
+            return aList[0]
 
         ## Create a shape by extrusion of the base shape along
         #  the path shape with constant bi-normal direction along the given vector.
         #  The path shape can be a wire or an edge.
+        #  It is possible to generate groups along with the result by means of
+        #  setting the flag \a IsGenerateGroups. For detailed information on
+        #  groups that can be created please see the method MakePipe().
         #  @param theBase Base shape to be extruded.
         #  @param thePath Path shape to extrude the base shape along it.
         #  @param theVec Vector defines a constant binormal direction to keep the
-        #                same angle beetween the direction and the sections
+        #                same angle between the direction and the sections
         #                along the sweep surface.
+        #  @param IsGenerateGroups flag that tells if it is necessary to
+        #         create groups. It is equal to False by default.
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
         #
-        #  @return New GEOM.GEOM_Object, containing the created pipe.
+        #  @return New GEOM.GEOM_Object, containing the created pipe if 
+        #          \a IsGenerateGroups is not set. Otherwise it returns new
+        #          GEOM.ListOfGO. Its first element is the created pipe, the
+        #          remaining ones are created groups.
         #
         #  @ref tui_creation_pipe "Example"
         @ManageTransactions("PrimOp")
-        def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec, theName=None):
+        def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec,
+                                        IsGenerateGroups=False, theName=None):
             """
             Create a shape by extrusion of the base shape along
             the path shape with constant bi-normal direction along the given vector.
             The path shape can be a wire or an edge.
+            It is possible to generate groups along with the result by means of
+            setting the flag IsGenerateGroups. For detailed information on
+            groups that can be created please see the method geompy.MakePipe().
 
             Parameters:
                 theBase Base shape to be extruded.
                 thePath Path shape to extrude the base shape along it.
                 theVec Vector defines a constant binormal direction to keep the
-                       same angle beetween the direction and the sections
+                       same angle between the direction and the sections
                        along the sweep surface.
+                IsGenerateGroups flag that tells if it is necessary to
+                                 create groups. It is equal to False by default.
                 theName Object name; when specified, this parameter is used
                         for result publication in the study. Otherwise, if automatic
                         publication is switched on, default value is used for result name.
 
             Returns:
-                New GEOM.GEOM_Object, containing the created pipe.
+                New GEOM.GEOM_Object, containing the created pipe if 
+                IsGenerateGroups is not set. Otherwise it returns new
+                GEOM.ListOfGO. Its first element is the created pipe, the
+                remaining ones are created groups.
             """
             # Example: see GEOM_TestAll.py
-            anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
+            aList = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath,
+                          theVec, IsGenerateGroups)
             RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
-            self._autoPublish(anObj, theName, "pipe")
-            return anObj
 
-        ## Makes a thick solid from a face or a shell
-        #  @param theShape Face or Shell to be thicken
+            if IsGenerateGroups:
+              self._autoPublish(aList, theName, "pipe")
+              return aList
+
+            self._autoPublish(aList[0], theName, "pipe")
+            return aList[0]
+
+        ## Makes a thick solid from a shape. If the input is a surface shape
+        #  (face or shell) the result is a thick solid. If an input shape is
+        #  a solid the result is a hollowed solid with removed faces.
+        #  @param theShape Face or Shell to get thick solid or solid to get
+        #         hollowed solid.
         #  @param theThickness Thickness of the resulting solid
+        #  @param theFacesIDs the list of face IDs to be removed from the
+        #         result. It is ignored if \a theShape is a face or a shell.
+        #         It is empty by default. 
+        #  @param theInside If true the thickness is applied towards inside
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
         #
         #  @return New GEOM.GEOM_Object, containing the created solid
         #
+        #  @ref tui_creation_thickness "Example"
         @ManageTransactions("PrimOp")
-        def MakeThickSolid(self, theShape, theThickness, theName=None):
+        def MakeThickSolid(self, theShape, theThickness,
+                           theFacesIDs=[], theInside=False, theName=None):
             """
-            Make a thick solid from a face or a shell
+            Make a thick solid from a shape. If the input is a surface shape
+            (face or shell) the result is a thick solid. If an input shape is
+            a solid the result is a hollowed solid with removed faces.
 
             Parameters:
-                 theShape Face or Shell to be thicken
+                 theShape Face or Shell to get thick solid or solid to get
+                          hollowed solid.
                  theThickness Thickness of the resulting solid
+                 theFacesIDs the list of face IDs to be removed from the
+                          result. It is ignored if theShape is a face or a
+                          shell. It is empty by default. 
+                 theInside If true the thickness is applied towards inside
                  theName Object name; when specified, this parameter is used
-                 for result publication in the study. Otherwise, if automatic
-                 publication is switched on, default value is used for result name.
+                         for result publication in the study. Otherwise, if automatic
+                         publication is switched on, default value is used for result name.
 
             Returns:
                 New GEOM.GEOM_Object, containing the created solid
             """
             # Example: see GEOM_TestAll.py
-            anObj = self.PrimOp.MakeThickening(theShape, theThickness, True)
-            RaiseIfFailed("MakeThickening", self.PrimOp)
-            self._autoPublish(anObj, theName, "pipe")
+            theThickness,Parameters = ParseParameters(theThickness)
+            anObj = self.PrimOp.MakeThickening(theShape, theFacesIDs,
+                                               theThickness, True, theInside)
+            RaiseIfFailed("MakeThickSolid", self.PrimOp)
+            anObj.SetParameters(Parameters)
+            self._autoPublish(anObj, theName, "thickSolid")
             return anObj
 
 
-        ## Modifies a face or a shell to make it a thick solid
-        #  @param theShape Face or Shell to be thicken
+        ## Modifies a shape to make it a thick solid. If the input is a surface
+        #  shape (face or shell) the result is a thick solid. If an input shape
+        #  is a solid the result is a hollowed solid with removed faces.
+        #  @param theShape Face or Shell to get thick solid or solid to get
+        #         hollowed solid.
         #  @param theThickness Thickness of the resulting solid
+        #  @param theFacesIDs the list of face IDs to be removed from the
+        #         result. It is ignored if \a theShape is a face or a shell.
+        #         It is empty by default. 
+        #  @param theInside If true the thickness is applied towards inside
         #
         #  @return The modified shape
         #
+        #  @ref tui_creation_thickness "Example"
         @ManageTransactions("PrimOp")
-        def Thicken(self, theShape, theThickness):
+        def Thicken(self, theShape, theThickness, theFacesIDs=[], theInside=False):
             """
-            Modifies a face or a shell to make it a thick solid
+            Modifies a shape to make it a thick solid. If the input is a
+            surface shape (face or shell) the result is a thick solid. If
+            an input shape is a solid the result is a hollowed solid with
+            removed faces.
 
             Parameters:
-                theBase Base shape to be extruded.
-                thePath Path shape to extrude the base shape along it.
-                theName Object name; when specified, this parameter is used
-                        for result publication in the study. Otherwise, if automatic
-                        publication is switched on, default value is used for result name.
+                theShape Face or Shell to get thick solid or solid to get
+                         hollowed solid.
+                theThickness Thickness of the resulting solid
+                theFacesIDs the list of face IDs to be removed from the
+                         result. It is ignored if \a theShape is a face or
+                         a shell. It is empty by default. 
+                theInside If true the thickness is applied towards inside
 
             Returns:
                 The modified shape
             """
             # Example: see GEOM_TestAll.py
-            anObj = self.PrimOp.MakeThickening(theShape, theThickness, False)
-            RaiseIfFailed("MakeThickening", self.PrimOp)
+            theThickness,Parameters = ParseParameters(theThickness)
+            anObj = self.PrimOp.MakeThickening(theShape, theFacesIDs,
+                                               theThickness, False, theInside)
+            RaiseIfFailed("Thicken", self.PrimOp)
+            anObj.SetParameters(Parameters)
             return anObj
 
         ## Build a middle path of a pipe-like shape.
@@ -4287,7 +4603,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         # end of l3_complex
         ## @}
 
-        ## @addtogroup l3_advanced
+        ## @addtogroup l3_basic_go
         ## @{
 
         ## Create a linear edge with specified ends.
@@ -4437,11 +4753,11 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
         #
-        #  @return New GEOM.GEOM_Object, containing the created face.
+        #  @return New GEOM.GEOM_Object, containing the created face (compound of faces).
         #
         #  @ref tui_creation_face "Example"
         @ManageTransactions("ShapesOp")
-        def MakeFace(self, theWire, isPlanarWanted, theName=None):
+        def MakeFace(self, theWire, isPlanarWanted, theName=None, raiseException=False):
             """
             Create a face on the given wire.
 
@@ -4457,12 +4773,12 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                         publication is switched on, default value is used for result name.
 
             Returns:
-                New GEOM.GEOM_Object, containing the created face.
+                New GEOM.GEOM_Object, containing the created face (compound of faces).
             """
             # Example: see GEOM_TestAll.py
             anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
             if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
-                print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
+                PrintOrRaise("WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built.",raiseException)
             else:
                 RaiseIfFailed("MakeFace", self.ShapesOp)
             self._autoPublish(anObj, theName, "face")
@@ -4479,11 +4795,11 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
         #
-        #  @return New GEOM.GEOM_Object, containing the created face.
+        #  @return New GEOM.GEOM_Object, containing the created face (compound of faces).
         #
         #  @ref tui_creation_face "Example"
         @ManageTransactions("ShapesOp")
-        def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
+        def MakeFaceWires(self, theWires, isPlanarWanted, theName=None, raiseException=False):
             """
             Create a face on the given wires set.
 
@@ -4499,12 +4815,12 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                         publication is switched on, default value is used for result name.
 
             Returns:
-                New GEOM.GEOM_Object, containing the created face.
+                New GEOM.GEOM_Object, containing the created face (compound of faces).
             """
             # Example: see GEOM_TestAll.py
             anObj = self.ShapesOp.MakeFaceWires(ToList(theWires), isPlanarWanted)
             if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
-                print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
+                PrintOrRaise("WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built.",raiseException)
             else:
                 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
             self._autoPublish(anObj, theName, "face")
@@ -4592,13 +4908,13 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             self._autoPublish(anObj, theName, "face")
             return anObj
 
-        ## Create a shell from the set of faces and shells.
-        #  @param theFacesAndShells List of faces and/or shells.
+        ## Create a shell from the set of faces, shells and/or compounds of faces.
+        #  @param theFacesAndShells List of faces, shells and/or compounds of faces.
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
         #
-        #  @return New GEOM.GEOM_Object, containing the created shell.
+        #  @return New GEOM.GEOM_Object, containing the created shell (compound of shells).
         #
         #  @ref tui_creation_shell "Example"
         @ManageTransactions("ShapesOp")
@@ -4613,7 +4929,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                         publication is switched on, default value is used for result name.
 
             Returns:
-                New GEOM.GEOM_Object, containing the created shell.
+                New GEOM.GEOM_Object, containing the created shell (compound of shells).
             """
             # Example: see GEOM_TestAll.py
             anObj = self.ShapesOp.MakeShell( ToList( theFacesAndShells ))
@@ -4651,7 +4967,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                 #if len(descr) > 0:
                 #    raise RuntimeError, "MakeSolidShells : " + descr
                 if descr == "WRN_SHAPE_UNCLOSED":
-                    raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
+                    raise RuntimeError("MakeSolidShells : Unable to create solid from unclosed shape")
             anObj = self.ShapesOp.MakeSolidShells(theShells)
             RaiseIfFailed("MakeSolidShells", self.ShapesOp)
             self._autoPublish(anObj, theName, "solid")
@@ -4719,7 +5035,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             self._autoPublish(anObj, theName, "solid")
             return anObj
 
-        # end of l3_advanced
+        # end of l3_basic_go
         ## @}
 
         ## @addtogroup l2_measure
@@ -5351,9 +5667,9 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #  @param theShape Shape to find sub-shapes of.
         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
         #  @param theTopLeftPoint Point, specifying top left corner of a quadrangle
-        #  @param theTopRigthPoint Point, specifying top right corner of a quadrangle
+        #  @param theTopRightPoint Point, specifying top right corner of a quadrangle
         #  @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
-        #  @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
+        #  @param theBottomRightPoint Point, specifying bottom right corner of a quadrangle
         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
@@ -5364,8 +5680,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #  @ref swig_GetShapesOnQuadrangle "Example"
         @ManageTransactions("ShapesOp")
         def GetShapesOnQuadrangle(self, theShape, theShapeType,
-                                  theTopLeftPoint, theTopRigthPoint,
-                                  theBottomLeftPoint, theBottomRigthPoint, theState, theName=None):
+                                  theTopLeftPoint, theTopRightPoint,
+                                  theBottomLeftPoint, theBottomRightPoint, theState, theName=None):
             """
             Find in theShape all sub-shapes of type theShapeType, situated relatively
             the specified quadrangle by the certain way, defined through theState parameter.
@@ -5374,9 +5690,9 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                 theShape Shape to find sub-shapes of.
                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
                 theTopLeftPoint Point, specifying top left corner of a quadrangle
-                theTopRigthPoint Point, specifying top right corner of a quadrangle
+                theTopRightPoint Point, specifying top right corner of a quadrangle
                 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
-                theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
+                theBottomRightPoint Point, specifying bottom right corner of a quadrangle
                 theState The state of the sub-shapes to find (see GEOM::shape_state)
                 theName Object name; when specified, this parameter is used
                         for result publication in the study. Otherwise, if automatic
@@ -5387,8 +5703,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             """
             # Example: see GEOM_TestOthers.py
             aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
-                                                        theTopLeftPoint, theTopRigthPoint,
-                                                        theBottomLeftPoint, theBottomRigthPoint, theState)
+                                                        theTopLeftPoint, theTopRightPoint,
+                                                        theBottomLeftPoint, theBottomRightPoint, theState)
             RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
             self._autoPublish(aList, theName, "shapeOnQuadrangle")
             return aList
@@ -5398,9 +5714,9 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #  @param theShape Shape to find sub-shapes of.
         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
         #  @param theTopLeftPoint Point, specifying top left corner of a quadrangle
-        #  @param theTopRigthPoint Point, specifying top right corner of a quadrangle
+        #  @param theTopRightPoint Point, specifying top right corner of a quadrangle
         #  @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
-        #  @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
+        #  @param theBottomRightPoint Point, specifying bottom right corner of a quadrangle
         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
         #
         #  @return List of all found sub-shapes indices.
@@ -5408,8 +5724,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #  @ref swig_GetShapesOnQuadrangleIDs "Example"
         @ManageTransactions("ShapesOp")
         def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
-                                     theTopLeftPoint, theTopRigthPoint,
-                                     theBottomLeftPoint, theBottomRigthPoint, theState):
+                                     theTopLeftPoint, theTopRightPoint,
+                                     theBottomLeftPoint, theBottomRightPoint, theState):
             """
             Find in theShape all sub-shapes of type theShapeType, situated relatively
             the specified quadrangle by the certain way, defined through theState parameter.
@@ -5418,9 +5734,9 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                 theShape Shape to find sub-shapes of.
                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
                 theTopLeftPoint Point, specifying top left corner of a quadrangle
-                theTopRigthPoint Point, specifying top right corner of a quadrangle
+                theTopRightPoint Point, specifying top right corner of a quadrangle
                 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
-                theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
+                theBottomRightPoint Point, specifying bottom right corner of a quadrangle
                 theState The state of the sub-shapes to find (see GEOM::shape_state)
 
             Returns:
@@ -5429,8 +5745,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
 
             # Example: see GEOM_TestOthers.py
             aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
-                                                           theTopLeftPoint, theTopRigthPoint,
-                                                           theBottomLeftPoint, theBottomRigthPoint, theState)
+                                                           theTopLeftPoint, theTopRightPoint,
+                                                           theBottomLeftPoint, theBottomRightPoint, theState)
             RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
             return aList
 
@@ -5624,7 +5940,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
         #
-        #  @return Group of all found sub-shapes or a single found sub-shape.
+        #  @return Compound which includes all found sub-shapes if they have different types; 
+        #          or group of all found shapes of the equal type; or a single found sub-shape.
         #
         #  @note This function has a restriction on argument shapes.
         #        If \a theShapeWhere has curved parts with significantly
@@ -5649,7 +5966,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                         publication is switched on, default value is used for result name.
 
             Returns:
-                Group of all found sub-shapes or a single found sub-shape.
+                Compound which includes all found sub-shapes if they have different types; 
+                or group of all found shapes of the equal type; or a single found sub-shape.
 
 
             Note:
@@ -5685,7 +6003,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
         #
-        #  @return Group of all found sub-shapes or a single found sub-shape.
+        #  @return Compound which includes all found sub-shapes if they have different types; 
+        #          or group of all found shapes of the equal type; or a single found sub-shape.
         #
         #  @ref swig_GetInPlace "Example"
         @ManageTransactions("ShapesOp")
@@ -5706,7 +6025,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                         publication is switched on, default value is used for result name.
 
             Returns:
-                Group of all found sub-shapes or a single found sub-shape.
+                Compound which includes all found sub-shapes if they have different types; 
+                or group of all found shapes of the equal type; or a single found sub-shape.
             """
             # Example: see GEOM_TestOthers.py
             anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
@@ -5714,6 +6034,38 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             self._autoPublish(anObj, theName, "inplace")
             return anObj
 
+        ## A sort of GetInPlace functionality, returning IDs of sub-shapes.
+        #  For each sub-shape ID of @a theShapeWhat return a list of corresponding sub-shape
+        #  IDs of @a theShapeWhere.
+        #  For example, if theShapeWhat is a box and theShapeWhere is this box cut into 
+        #  two parts by a plane, then the result can be as this: 
+        #    len( result_list ) = 35,
+        #    result_list[ 1 ] = [ 2, 36 ], which means that the box  (ID 1) turned into two
+        #  solids with IDs 2 and 36 within theShapeWhere
+        #
+        #  @param theShapeWhere Shape to find sub-shapes of.
+        #  @param theShapeWhat Shape, specifying what to find.
+        #  @return List of lists of sub-shape IDS of theShapeWhere.
+        def GetInPlaceMap(self, theShapeWhere, theShapeWhat):
+            """
+            A sort of GetInPlace functionality, returning IDs of sub-shapes.
+            For each sub-shape ID of @a theShapeWhat return a list of corresponding sub-shape
+            IDs of @a theShapeWhere.
+            For example, if theShapeWhat is a box and theShapeWhere is this box cut into 
+            two parts by a plane, then the result can be as this: 
+              len( result_list ) = 35,
+              result_list[ 1 ] = [ 2, 36 ], which means that the box (ID 1) turned into two
+            solids with IDs 2 and 36 within theShapeWhere
+
+            Parameters:
+                theShapeWhere Shape to find sub-shapes of.
+                theShapeWhat Shape, specifying what to find.
+
+            Returns:
+                List of lists of sub-shape IDS of theShapeWhere.
+            """
+            return self.ShapesOp.GetInPlaceMap(theShapeWhere, theShapeWhat)
+
         ## Get sub-shape of theShapeWhere, which is
         #  equal to \a theShapeWhat.
         #  @param theShapeWhere Shape to find sub-shape of.
@@ -5805,8 +6157,10 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             Returns:
                 New GEOM.GEOM_Object, containing the created edge.
             """
+            theMin, theMax, Parameters = ParseParameters(theMin, theMax)
             anObj = self.ShapesOp.ExtendEdge(theEdge, theMin, theMax)
             RaiseIfFailed("ExtendEdge", self.ShapesOp)
+            anObj.SetParameters(Parameters)
             self._autoPublish(anObj, theName, "edge")
             return anObj
 
@@ -5853,9 +6207,11 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             Returns:
                 New GEOM.GEOM_Object, containing the created face.
             """
+            theUMin, theUMax, theVMin, theVMax, Parameters = ParseParameters(theUMin, theUMax, theVMin, theVMax)
             anObj = self.ShapesOp.ExtendFace(theFace, theUMin, theUMax,
                                              theVMin, theVMax)
             RaiseIfFailed("ExtendFace", self.ShapesOp)
+            anObj.SetParameters(Parameters)
             self._autoPublish(anObj, theName, "face")
             return anObj
 
@@ -6133,7 +6489,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
 
         ## Explode a shape on sub-shapes of a given type.
         #  Sub-shapes will be sorted taking into account their gravity centers,
-        #  to provide stable order of sub-shapes.
+        #  to provide stable order of sub-shapes. Please see
+        #  @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
         #  If the shape itself matches the type, it is also returned.
         #  @param aShape Shape to be exploded.
         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
@@ -6170,7 +6527,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
 
         ## Explode a shape on sub-shapes of a given type.
         #  Sub-shapes will be sorted taking into account their gravity centers,
-        #  to provide stable order of sub-shapes.
+        #  to provide stable order of sub-shapes. Please see
+        #  @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
         #  @param aShape Shape to be exploded.
         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
         #  @return List of IDs of sub-shapes.
@@ -6196,6 +6554,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
 
         ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
         #  selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
+        #  Please see @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
         #  Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
         #  @param aShape Shape to get sub-shape of.
         #  @param ListOfInd List of sub-shapes indices.
@@ -6236,7 +6595,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         ## Extract shapes (excluding the main shape) of given type.
         #  @param aShape The shape.
         #  @param aType  The shape type (see ShapeType())
-        #  @param isSorted Boolean flag to switch sorting on/off.
+        #  @param isSorted Boolean flag to switch sorting on/off. Please see
+        #         @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
@@ -6328,6 +6688,57 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             self._autoPublish(ListObj, theName, "SortedEdges")
             return ListObj
 
+        ##
+        # Return the list of subshapes that satisfies a certain tolerance
+        # criterion. The user defines the type of shapes to be returned, the
+        # condition and the tolerance value. The operation is defined for
+        # faces, edges and vertices only. E.g. for theShapeType FACE,
+        # theCondition GEOM::CC_GT and theTolerance 1.e-7 this method returns
+        # all faces of theShape that have tolerances greater then 1.e7.
+        #
+        #  @param theShape the shape to be exploded
+        #  @param theShapeType the type of sub-shapes to be returned (see
+        #         ShapeType()). Can have the values FACE, EDGE and VERTEX only.
+        #  @param theCondition the condition type (see GEOM::comparison_condition).
+        #  @param theTolerance the tolerance filter.
+        #  @param theName Object name; when specified, this parameter is used
+        #         for result publication in the study. Otherwise, if automatic
+        #         publication is switched on, default value is used for result name.
+        #  @return the list of shapes that satisfy the conditions.
+        #
+        #  @ref swig_GetSubShapesWithTolerance "Example"
+        @ManageTransactions("ShapesOp")
+        def GetSubShapesWithTolerance(self, theShape, theShapeType,
+                                      theCondition, theTolerance, theName=None):
+            """
+            Return the list of subshapes that satisfies a certain tolerance
+            criterion. The user defines the type of shapes to be returned, the
+            condition and the tolerance value. The operation is defined for
+            faces, edges and vertices only. E.g. for theShapeType FACE,
+            theCondition GEOM::CC_GT and theTolerance 1.e-7 this method returns
+            all faces of theShape that have tolerances greater then 1.e7.
+            
+            Parameters:
+                theShape the shape to be exploded
+                theShapeType the type of sub-shapes to be returned (see
+                             ShapeType()). Can have the values FACE,
+                             EDGE and VERTEX only.
+                theCondition the condition type (see GEOM::comparison_condition).
+                theTolerance the tolerance filter.
+                theName Object name; when specified, this parameter is used
+                        for result publication in the study. Otherwise, if automatic
+                        publication is switched on, default value is used for result name.
+
+            Returns:
+                The list of shapes that satisfy the conditions.
+            """
+            # Example: see GEOM_TestAll.py
+            ListObj = self.ShapesOp.GetSubShapesWithTolerance(theShape, EnumToLong(theShapeType),
+                                                              theCondition, theTolerance)
+            RaiseIfFailed("GetSubShapesWithTolerance", self.ShapesOp)
+            self._autoPublish(ListObj, theName, "SubShapeWithTolerance")
+            return ListObj
+
         ## Check if the object is a sub-object of another GEOM object.
         #  @param aSubObject Checked sub-object (or its parent object, in case if
         #         \a theSubObjectIndex is non-zero).
@@ -6360,6 +6771,35 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             RaiseIfFailed("IsSubShapeBelongsTo", self.ShapesOp)
             return IsOk
 
+        ## Perform extraction of sub-shapes from the main shape.
+        #
+        #  @param theShape the main shape
+        #  @param theListOfID the list of sub-shape IDs to be extracted from
+        #         the main shape.
+        #  @return New GEOM.GEOM_Object, containing the shape without
+        #          extracted sub-shapes.
+        #
+        #  @ref swig_MakeExtraction "Example"
+        @ManageTransactions("ShapesOp")
+        def MakeExtraction(self, theShape, theListOfID, theName=None):
+            """
+            Perform extraction of sub-shapes from the main shape.
+
+            Parameters:
+                theShape the main shape
+                theListOfID the list of sub-shape IDs to be extracted from
+                            the main shape.
+
+            Returns
+                New GEOM.GEOM_Object, containing the shape without
+                extracted sub-shapes.
+            """
+            # Example: see GEOM_TestAll.py
+            (anObj, aStat) = self.ShapesOp.MakeExtraction(theShape, theListOfID)
+            RaiseIfFailed("MakeExtraction", self.ShapesOp)
+            self._autoPublish(anObj, theName, "Extraction")
+            return anObj
+
         # end of l4_decompose
         ## @}
 
@@ -7044,7 +7484,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #         publication is switched on, default value is used for result name.
         #
         #  @return [\a status, \a theClosedWires, \a theOpenWires]
-        #  \n \a status: FALSE, if an error(s) occured during the method execution.
+        #  \n \a status: FALSE, if an error(s) occurred during the method execution.
         #  \n \a theClosedWires: Closed wires on the free boundary of the given shape.
         #  \n \a theOpenWires: Open wires on the free boundary of the given shape.
         #
@@ -7063,7 +7503,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
 
             Returns:
                 [status, theClosedWires, theOpenWires]
-                 status: FALSE, if an error(s) occured during the method execution.
+                 status: FALSE, if an error(s) occurred during the method execution.
                  theClosedWires: Closed wires on the free boundary of the given shape.
                  theOpenWires: Open wires on the free boundary of the given shape.
             """
@@ -7107,7 +7547,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             theTolerance,Parameters = ParseParameters(theTolerance)
             anObj = self.ShapesOp.MakeGlueFaces(ToList(theShapes), theTolerance, doKeepNonSolids)
             if anObj is None:
-                raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
+                raise RuntimeError("MakeGlueFaces : " + self.ShapesOp.GetErrorCode())
             anObj.SetParameters(Parameters)
             self._autoPublish(anObj, theName, "glueFaces")
             return anObj
@@ -7186,10 +7626,10 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             Returns:
                 New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
             """
-            anObj = self.ShapesOp.MakeGlueFacesByList(ToList(theShapes), theTolerance, theFaces,
+            anObj = self.ShapesOp.MakeGlueFacesByList(ToList(theShapes), theTolerance, ToList(theFaces),
                                                       doKeepNonSolids, doGlueAllEdges)
             if anObj is None:
-                raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
+                raise RuntimeError("MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode())
             self._autoPublish(anObj, theName, "glueFaces")
             return anObj
 
@@ -7221,7 +7661,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             theTolerance,Parameters = ParseParameters(theTolerance)
             anObj = self.ShapesOp.MakeGlueEdges(ToList(theShapes), theTolerance)
             if anObj is None:
-                raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
+                raise RuntimeError("MakeGlueEdges : " + self.ShapesOp.GetErrorCode())
             anObj.SetParameters(Parameters)
             self._autoPublish(anObj, theName, "glueEdges")
             return anObj
@@ -7291,7 +7731,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             """
             anObj = self.ShapesOp.MakeGlueEdgesByList(ToList(theShapes), theTolerance, theEdges)
             if anObj is None:
-                raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
+                raise RuntimeError("MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode())
             self._autoPublish(anObj, theName, "glueEdges")
             return anObj
 
@@ -7760,7 +8200,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #      @param ListRemoveInside Shapes, inside which the results will be deleted.
         #         Each shape from theRemoveInside must belong to theShapes also.
         #      @param RemoveWebs If TRUE, perform Glue 3D algorithm.
-        #      @param ListMaterials Material indices for each shape. Make sence,
+        #      @param ListMaterials Material indices for each shape. Make sense,
         #         only if theRemoveWebs is TRUE.
         #
         #  @return New GEOM.GEOM_Object, containing the result shapes.
@@ -7802,7 +8242,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                 ListRemoveInside Shapes, inside which the results will be deleted.
                                  Each shape from theRemoveInside must belong to theShapes also.
                 RemoveWebs If TRUE, perform Glue 3D algorithm.
-                ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
+                ListMaterials Material indices for each shape. Make sense, only if theRemoveWebs is TRUE.
 
             Returns:
                 New GEOM.GEOM_Object, containing the result shapes.
@@ -7811,7 +8251,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             if Limit == self.ShapeType["AUTO"]:
                 # automatic detection of the most appropriate shape limit type
                 lim = GEOM.SHAPE
-                for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
+                for s in ListShapes: lim = min(lim, s.GetMaxShapeType())
                 Limit = EnumToLong(lim)
                 pass
             anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
@@ -7884,7 +8324,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             if Limit == self.ShapeType["AUTO"]:
                 # automatic detection of the most appropriate shape limit type
                 lim = GEOM.SHAPE
-                for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
+                for s in ListShapes: lim = min(lim, s.GetMaxShapeType())
                 Limit = EnumToLong(lim)
                 pass
             anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
@@ -7922,6 +8362,23 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #
         #  @return New GEOM.GEOM_Object, containing the result shape.
         #
+        #  @note This operation is a shortcut to the more general @ref MakePartition
+        #  operation, where @a theShape specifies single "object" (shape being partitioned)
+        #  and @a thePlane specifies single "tool" (intersector shape). Other parameters of
+        #  @ref MakePartition operation have default values:
+        #  - @a Limit: GEOM::SHAPE (shape limit corresponds to the type of @a theShape)
+        #  - @a KeepNonlimitShapes: 0
+        #  - @a KeepInside, @a RemoveInside, @a RemoveWebs,
+        #    @a Materials (obsolete parameters): empty
+        #
+        #  @note I.e. the following two operations are equivalent:
+        #  @code
+        #  Result = geompy.MakeHalfPartition(Object, Plane)
+        #  Result = geompy.MakePartition([Object], [Plane])
+        #  @endcode
+        #
+        #  @sa MakePartition, MakePartitionNonSelfIntersectedShape
+        #
         #  @ref tui_partition "Example"
         @ManageTransactions("BoolOp")
         def MakeHalfPartition(self, theShape, thePlane, theName=None):
@@ -7937,6 +8394,18 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
 
             Returns:
                 New GEOM.GEOM_Object, containing the result shape.
+         
+            Note: This operation is a shortcut to the more general MakePartition
+            operation, where theShape specifies single "object" (shape being partitioned)
+            and thePlane specifies single "tool" (intersector shape). Other parameters of
+            MakePartition operation have default values:
+            - Limit: GEOM::SHAPE (shape limit corresponds to the type of theShape)
+            - KeepNonlimitShapes: 0
+            - KeepInside, RemoveInside, RemoveWebs, Materials (obsolete parameters): empty
+         
+            I.e. the following two operations are equivalent:
+              Result = geompy.MakeHalfPartition(Object, Plane)
+              Result = geompy.MakePartition([Object], [Plane])
             """
             # Example: see GEOM_TestAll.py
             anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
@@ -8865,14 +9334,15 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             """
             theOffset, Parameters = ParseParameters(theOffset)
             if theCopy:
-                anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
+                anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset, True)
             else:
-                anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
+                anObj = self.TrsfOp.OffsetShape(theObject, theOffset, True)
             RaiseIfFailed("Offset", self.TrsfOp)
             anObj.SetParameters(Parameters)
             return anObj
 
-        ## Create new object as offset of the given one.
+        ## Create new object as offset of the given one. Gap between two adjacent
+        #  offset surfaces is filled by a pipe.
         #  @param theObject The base object for the offset.
         #  @param theOffset Offset value.
         #  @param theName Object name; when specified, this parameter is used
@@ -8881,11 +9351,13 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #
         #  @return New GEOM.GEOM_Object, containing the offset object.
         #
+        #  @sa MakeOffsetIntersectionJoin
         #  @ref tui_offset "Example"
         @ManageTransactions("TrsfOp")
         def MakeOffset(self, theObject, theOffset, theName=None):
             """
-            Create new object as offset of the given one.
+            Create new object as offset of the given one. Gap between adjacent
+            offset surfaces is filled by a pipe.
 
             Parameters:
                 theObject The base object for the offset.
@@ -8904,7 +9376,48 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             """
             # Example: see GEOM_TestAll.py
             theOffset, Parameters = ParseParameters(theOffset)
-            anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
+            anObj = self.TrsfOp.OffsetShapeCopy( theObject, theOffset, True )
+            RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
+            anObj.SetParameters(Parameters)
+            self._autoPublish(anObj, theName, "offset")
+            return anObj
+
+        ## Create new object as offset of the given one. Gap between adjacent
+        #  offset surfaces is filled by extending and intersecting them.
+        #  @param theObject The base object for the offset.
+        #  @param theOffset Offset value.
+        #  @param theName Object name; when specified, this parameter is used
+        #         for result publication in the study. Otherwise, if automatic
+        #         publication is switched on, default value is used for result name.
+        #
+        #  @return New GEOM.GEOM_Object, containing the offset object.
+        #
+        #  @sa MakeOffset
+        #  @ref tui_offset "Example"
+        @ManageTransactions("TrsfOp")
+        def MakeOffsetIntersectionJoin(self, theObject, theOffset, theName=None):
+            """
+            Create new object as offset of the given one. Gap between adjacent
+            offset surfaces is filled by extending and intersecting them.
+
+            Parameters:
+                theObject The base object for the offset.
+                theOffset Offset value.
+                theName Object name; when specified, this parameter is used
+                        for result publication in the study. Otherwise, if automatic
+                        publication is switched on, default value is used for result name.
+
+            Returns:
+                New GEOM.GEOM_Object, containing the offset object.
+
+            Example of usage:
+                 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
+                 # create a new box extended by 70
+                 offset = geompy.MakeOffsetIntersectionJoin(box, 70.)
+            """
+            # Example: see GEOM_TestAll.py
+            theOffset, Parameters = ParseParameters( theOffset )
+            anObj = self.TrsfOp.OffsetShapeCopy( theObject, theOffset, False )
             RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
             anObj.SetParameters(Parameters)
             self._autoPublish(anObj, theName, "offset")
@@ -8943,7 +9456,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             self._autoPublish(anObj, theName, "projection")
             return anObj
 
-        ## Create a projection projection of the given point on a wire or an edge.
+        ## Create a projection of the given point on a wire or an edge.
         #  If there are no solutions or there are 2 or more solutions It throws an
         #  exception.
         #  @param thePoint the point to be projected.
@@ -8961,7 +9474,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         @ManageTransactions("TrsfOp")
         def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
             """
-            Create a projection projection of the given point on a wire or an edge.
+            Create a projection of the given point on a wire or an edge.
             If there are no solutions or there are 2 or more solutions It throws an
             exception.
 
@@ -9344,6 +9857,91 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
             return anObj
 
+        ##
+        #  Compute a wire or a face that represents a projection of the source
+        #  shape onto cylinder. The cylinder's coordinate system is the same
+        #  as the global coordinate system.
+        #
+        #  @param theObject The object to be projected. It can be either
+        #         a planar wire or a face.
+        #  @param theRadius The radius of the cylinder.
+        #  @param theStartAngle The starting angle in radians from
+        #         the cylinder's X axis around Z axis. The angle from which
+        #         the projection is started.
+        #  @param theAngleLength The projection length angle in radians.
+        #         The angle in which to project the total length of the wire.
+        #         If it is negative the projection is not scaled and natural
+        #         wire length is kept for the projection.
+        #  @param theAngleRotation The desired angle in radians between
+        #         the tangent vector to the first curve at the first point of
+        #         the theObject's projection in 2D space and U-direction of
+        #         cylinder's 2D space.
+        #  @param theName Object name; when specified, this parameter is used
+        #         for result publication in the study. Otherwise, if automatic
+        #         publication is switched on, default value is used for result name.
+        #
+        #  @return New GEOM.GEOM_Object, containing the result shape. The result
+        #         represents a wire or a face that represents a projection of
+        #         the source shape onto a cylinder.
+        #
+        #  @ref tui_projection "Example"
+        def MakeProjectionOnCylinder (self, theObject, theRadius,
+                                      theStartAngle=0.0, theAngleLength=-1.0,
+                                      theAngleRotation=0.0,
+                                      theName=None):
+            """
+            Compute a wire or a face that represents a projection of the source
+            shape onto cylinder. The cylinder's coordinate system is the same
+            as the global coordinate system.
+
+            Parameters:
+                theObject The object to be projected. It can be either
+                        a planar wire or a face.
+                theRadius The radius of the cylinder.
+                theStartAngle The starting angle in radians from the cylinder's X axis
+                        around Z axis. The angle from which the projection is started.
+                theAngleLength The projection length angle in radians. The angle in which
+                        to project the total length of the wire. If it is negative the
+                        projection is not scaled and natural wire length is kept for
+                        the projection.
+                theAngleRotation The desired angle in radians between
+                        the tangent vector to the first curve at the first
+                        point of the theObject's projection in 2D space and
+                        U-direction of cylinder's 2D space.
+                theName Object name; when specified, this parameter is used
+                        for result publication in the study. Otherwise, if automatic
+                        publication is switched on, default value is used for result name.
+
+            Returns:
+                New GEOM.GEOM_Object, containing the result shape. The result
+                represents a wire or a face that represents a projection of
+                the source shape onto a cylinder.
+            """
+            # Example: see GEOM_TestAll.py
+            flagStartAngle = False
+            if isinstance(theStartAngle,str):
+                flagStartAngle = True
+            flagAngleLength = False
+            if isinstance(theAngleLength,str):
+                flagAngleLength = True
+            flagAngleRotation = False
+            if isinstance(theAngleRotation,str):
+                flagAngleRotation = True
+            theRadius, theStartAngle, theAngleLength, theAngleRotation, Parameters = ParseParameters(
+              theRadius, theStartAngle, theAngleLength, theAngleRotation)
+            if flagStartAngle:
+                theStartAngle = theStartAngle*math.pi/180.
+            if flagAngleLength:
+                theAngleLength = theAngleLength*math.pi/180.
+            if flagAngleRotation:
+                theAngleRotation = theAngleRotation*math.pi/180.
+            anObj = self.TrsfOp.MakeProjectionOnCylinder(theObject, theRadius,
+                theStartAngle, theAngleLength, theAngleRotation)
+            RaiseIfFailed("MakeProjectionOnCylinder", self.TrsfOp)
+            anObj.SetParameters(Parameters)
+            self._autoPublish(anObj, theName, "projection")
+            return anObj
+
         # end of l3_transform
         ## @}
 
@@ -9355,7 +9953,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             """
             Deprecated method. Use MultiRotate1DNbTimes instead.
             """
-            print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
+            print("The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead.")
             return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
 
         ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
@@ -9369,7 +9967,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             Example of usage:
                 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
             """
-            print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
+            print("The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead.")
             theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
             anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
             RaiseIfFailed("MultiRotate2D", self.TrsfOp)
@@ -9389,7 +9987,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
                 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
             """
-            print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
+            print("The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.")
             aVec = self.MakeLine(aPoint,aDir)
             # note: auto-publishing is done in self.MultiRotate1D()
             anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
@@ -9407,7 +10005,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
                 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
             """
-            print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
+            print("The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead.")
             aVec = self.MakeLine(aPoint,aDir)
             # note: auto-publishing is done in self.MultiRotate2D()
             anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
@@ -9829,14 +10427,14 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             self._autoPublish(anObj, theName, "chamfer")
             return anObj
 
-        ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
+        ## The Same that MakeChamferFaces() but with params theD is chamfer length and
         #  theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
         #
         #  @ref swig_FilletChamfer "Example"
         @ManageTransactions("LocalOp")
         def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
             """
-            The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
+            The Same that geompy.MakeChamferFaces but with params theD is chamfer length and
             theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
             """
             flag = False
@@ -9887,12 +10485,12 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             self._autoPublish(anObj, theName, "chamfer")
             return anObj
 
-        ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
+        ## The Same that MakeChamferEdges() but with params theD is chamfer length and
         #  theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
         @ManageTransactions("LocalOp")
         def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
             """
-            The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
+            The Same that geompy.MakeChamferEdges but with params theD is chamfer length and
             theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
             """
             flag = False
@@ -9929,6 +10527,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #  @param theBase Closed edge or wire defining the base shape to be extruded.
         #  @param theH Prism dimension along the normal to theBase
         #  @param theAngle Draft angle in degrees.
+        #  @param theInvert If true material changes the direction
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
@@ -9937,15 +10536,16 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #
         #  @ref tui_creation_prism "Example"
         @ManageTransactions("PrimOp")
-        def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None):
+        def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theInvert=False, theName=None):
             """
             Add material to a solid by extrusion of the base shape on the given distance.
 
             Parameters:
                 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
                 theBase Closed edge or wire defining the base shape to be extruded.
-                theH Prism dimension along the normal  to theBase
+                theH Prism dimension along the normal to theBase
                 theAngle Draft angle in degrees.
+                theInvert If true material changes the direction.
                 theName Object name; when specified, this parameter is used
                         for result publication in the study. Otherwise, if automatic
                         publication is switched on, default value is used for result name.
@@ -9954,10 +10554,10 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                 New GEOM.GEOM_Object,  containing the initial shape with removed material.
             """
             # Example: see GEOM_TestAll.py
-            #theH,Parameters = ParseParameters(theH)
-            anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
+            theH,theAngle,Parameters = ParseParameters(theH,theAngle)
+            anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False, theInvert)
             RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
-            #anObj.SetParameters(Parameters)
+            anObj.SetParameters(Parameters)
             self._autoPublish(anObj, theName, "extrudedCut")
             return anObj
 
@@ -9967,6 +10567,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #  @param theBase Closed edge or wire defining the base shape to be extruded.
         #  @param theH Prism dimension along the normal to theBase
         #  @param theAngle Draft angle in degrees.
+        #  @param theInvert If true material changes the direction
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
@@ -9975,15 +10576,16 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #
         #  @ref tui_creation_prism "Example"
         @ManageTransactions("PrimOp")
-        def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None):
+        def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theInvert=False, theName=None):
             """
             Add material to a solid by extrusion of the base shape on the given distance.
 
             Parameters:
                 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
                 theBase Closed edge or wire defining the base shape to be extruded.
-                theH Prism dimension along the normal  to theBase
+                theH Prism dimension along the normal to theBase
                 theAngle Draft angle in degrees.
+                theInvert If true material changes the direction.
                 theName Object name; when specified, this parameter is used
                         for result publication in the study. Otherwise, if automatic
                         publication is switched on, default value is used for result name.
@@ -9992,10 +10594,10 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                 New GEOM.GEOM_Object,  containing the initial shape with added material.
             """
             # Example: see GEOM_TestAll.py
-            #theH,Parameters = ParseParameters(theH)
-            anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
+            theH,theAngle,Parameters = ParseParameters(theH,theAngle)
+            anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True, theInvert)
             RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
-            #anObj.SetParameters(Parameters)
+            anObj.SetParameters(Parameters)
             self._autoPublish(anObj, theName, "extrudedBoss")
             return anObj
 
@@ -10127,6 +10729,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         ## Get summarized length of all wires,
         #  area of surface and volume of the given shape.
         #  @param theShape Shape to define properties of.
+        #  @param theTolerance maximal relative error of area
+        #         and volume computation.
         #  @return [theLength, theSurfArea, theVolume]\n
         #  theLength:   Summarized length of all wires of the given shape.\n
         #  theSurfArea: Area of surface of the given shape.\n
@@ -10134,13 +10738,15 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #
         #  @ref tui_basic_properties_page "Example"
         @ManageTransactions("MeasuOp")
-        def BasicProperties(self,theShape):
+        def BasicProperties(self,theShape, theTolerance=1.e-6):
             """
             Get summarized length of all wires,
             area of surface and volume of the given shape.
 
             Parameters:
                 theShape Shape to define properties of.
+                theTolerance maximal relative error of area
+                             and volume computation.
 
             Returns:
                 [theLength, theSurfArea, theVolume]
@@ -10149,7 +10755,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                  theVolume:   Volume of the given shape.
             """
             # Example: see GEOM_TestMeasures.py
-            aTuple = self.MeasuOp.GetBasicProperties(theShape)
+            aTuple = self.MeasuOp.GetBasicProperties(theShape, theTolerance)
             RaiseIfFailed("GetBasicProperties", self.MeasuOp)
             return aTuple
 
@@ -10573,6 +11179,56 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             return aSurf
         ## @}
 
+        ## Measure curvature radius of surface in the given point along the given direction.
+        #  @param theSurf the given face.
+        #  @param thePoint given point.
+        #  @param theDirection given direction.
+        #  @param theName Object name; when specified, this parameter is used
+        #         for result publication in the study. Otherwise, if automatic
+        #         publication is switched on, default value is used for result name.
+        #
+        #  @return New GEOM.GEOM_Object, containing vector of curvature of theSurf.
+        #          The returned vector is codirectional with the normal to the face
+        #          in the given point in case of positive curvature value
+        #          and opposite to the normal in case of negative curvature.
+        #          The normal of the returned vector is equal to the
+        #          absolute value of the curvature radius.
+        #          Null shape is returned in case of infinite radius
+        #          (zero curvature), for example, in case of flat face.
+        #
+        ## @ref swig_CurvatureOnFace "Example"
+        @ManageTransactions("MeasuOp")
+        def CurvatureOnFace(self, theSurf, thePoint, theDirection, theName=None):
+            """
+            Measure curvature radius of surface in the given point along the given direction.
+
+            Parameters:
+                theSurf the given face.
+                thePoint given point.
+                theDirection given direction.
+                theName Object name; when specified, this parameter is used
+                        for result publication in the study. Otherwise, if automatic
+                        publication is switched on, default value is used for result name.
+
+            Returns:
+                New GEOM.GEOM_Object, containing vector of curvature of theSurf.
+                The returned vector is codirectional with the normal to the face
+                in the given point in case of positive curvature value
+                and opposite to the normal in case of negative curvature.
+                The normal of the returned vector is equal to the
+                absolute value of the curvature radius.
+                Null shape is returned in case of infinite radius
+                (zero curvature), for example, in case of flat face.
+
+            Example of usage:
+                curvature_1 = geompy.CurvatureOnFace(Face_1, Vertex_1, OX)
+            """
+            aVec = self.MeasuOp.SurfaceCurvatureByPointAndDirection(theSurf,thePoint,theDirection)
+            if self.MeasuOp.GetErrorCode() != "ZERO_CURVATURE":
+                RaiseIfFailed("CurvatureOnFace", self.MeasuOp)
+                self._autoPublish(aVec, theName, "curvature")
+            return aVec
+
         ## Get min and max tolerances of sub-shapes of theShape
         #  @param theShape Shape, to get tolerances of.
         #  @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
@@ -10673,14 +11329,17 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             return aDict
 
         def GetCreationInformation(self, theShape):
-            info = theShape.GetCreationInformation()
-            # operationName
-            opName = info.operationName
-            if not opName: opName = "no info available"
-            res = "Operation: " + opName
-            # parameters
-            for parVal in info.params:
-                res += " \n %s = %s" % ( parVal.name, parVal.value )
+            res = ''
+            infos = theShape.GetCreationInformation()
+            for info in infos:
+                # operationName
+                opName = info.operationName
+                if not opName: opName = "no info available"
+                if res: res += "\n"
+                res += "Operation: " + opName
+                # parameters
+                for parVal in info.params:
+                    res += "\n \t%s = %s" % ( parVal.name, parVal.value )
             return res
 
         ## Get a point, situated at the centre of mass of theShape.
@@ -10712,9 +11371,10 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             self._autoPublish(anObj, theName, "centerOfMass")
             return anObj
 
-        ## Get a vertex sub-shape by index depended with orientation.
+        ## Get a vertex sub-shape by index.
         #  @param theShape Shape to find sub-shape.
         #  @param theIndex Index to find vertex by this index (starting from zero)
+        #  @param theUseOri To consider edge/wire orientation or not
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
@@ -10723,13 +11383,14 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #
         #  @ref tui_measurement_tools_page "Example"
         @ManageTransactions("MeasuOp")
-        def GetVertexByIndex(self, theShape, theIndex, theName=None):
+        def GetVertexByIndex(self, theShape, theIndex, theUseOri=True, theName=None):
             """
-            Get a vertex sub-shape by index depended with orientation.
+            Get a vertex sub-shape by index.
 
             Parameters:
                 theShape Shape to find sub-shape.
                 theIndex Index to find vertex by this index (starting from zero)
+                theUseOri To consider edge/wire orientation or not
                 theName Object name; when specified, this parameter is used
                         for result publication in the study. Otherwise, if automatic
                         publication is switched on, default value is used for result name.
@@ -10738,7 +11399,9 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                 New GEOM.GEOM_Object, containing the created vertex.
             """
             # Example: see GEOM_TestMeasures.py
-            anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
+            if isinstance( theUseOri, str ): # theUseOri was inserted before theName
+                theUseOri, theName = True, theUseOri
+            anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex, theUseOri)
             RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
             self._autoPublish(anObj, theName, "vertex")
             return anObj
@@ -10767,7 +11430,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             """
             # Example: see GEOM_TestMeasures.py
             # note: auto-publishing is done in self.GetVertexByIndex()
-            return self.GetVertexByIndex(theShape, 0, theName)
+            return self.GetVertexByIndex(theShape, 0, True, theName)
 
         ## Get the last vertex of wire/edge depended orientation.
         #  @param theShape Shape to find last vertex.
@@ -10794,7 +11457,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             # Example: see GEOM_TestMeasures.py
             nb_vert =  self.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
             # note: auto-publishing is done in self.GetVertexByIndex()
-            return self.GetVertexByIndex(theShape, (nb_vert-1), theName)
+            return self.GetVertexByIndex(theShape, (nb_vert-1), True, theName)
 
         ## Get a normale to the given face. If the point is not given,
         #  the normale is calculated at the center of mass.
@@ -10857,7 +11520,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             Descr = self.MeasuOp.PrintShapeErrors(theShape, theShapeErrors)
             if theReturnStatus == 1:
                 return Descr
-            print Descr
+            print(Descr)
             pass
 
         ## Check a topology of the given shape.
@@ -10912,7 +11575,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             if IsValid == 0:
                 if theReturnStatus == 0:
                     Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
-                    print Descr
+                    print(Descr)
             if theReturnStatus == 1:
               Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
               return (IsValid, Descr)
@@ -10957,13 +11620,62 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
             return IsValid
 
+        ## Detect self-intersections of the given shape with algorithm based on mesh intersections.
+        #  @param theShape Shape to check.
+        #  @param theDeflection Linear deflection coefficient that specifies quality of tessellation:
+        #         - if \a theDeflection <= 0, default deflection 0.001 is used
+        #  @param theTolerance Specifies a distance between sub-shapes used for detecting gaps:
+        #         - if \a theTolerance <= 0, algorithm detects intersections (default behavior)
+        #         - if \a theTolerance > 0, algorithm detects gaps
+        #  @return TRUE, if the shape contains no self-intersections.
+        #
+        #  @ref tui_check_self_intersections_fast_page "Example"
+        @ManageTransactions("MeasuOp")
+        def CheckSelfIntersectionsFast(self, theShape, theDeflection = 0.001, theTolerance = 0.0):
+            """
+            Detect self-intersections of the given shape with algorithm based on mesh intersections.
+
+            Parameters:
+                theShape Shape to check.
+                theDeflection Linear deflection coefficient that specifies quality of tessellation:
+                    - if theDeflection <= 0, default deflection 0.001 is used
+                theTolerance Specifies a distance between shapes used for detecting gaps:
+                    - if theTolerance <= 0, algorithm detects intersections (default behavior)
+                    - if theTolerance > 0, algorithm detects gaps
+            Returns:
+                TRUE, if the shape contains no self-intersections.
+            """
+            # Example: see GEOM_TestMeasures.py
+            (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersectionsFast(theShape, theDeflection, theTolerance)
+            RaiseIfFailed("CheckSelfIntersectionsFast", self.MeasuOp)
+            return IsValid
+
+        ## Check boolean and partition operations arguments.
+        #  @param theShape the argument of an operation to be checked
+        #  @return TRUE if the argument is valid for a boolean or partition
+        #          operation; FALSE otherwise.
+        @ManageTransactions("MeasuOp")
+        def CheckBOPArguments(self, theShape):
+            """
+            Check boolean and partition operations arguments.
+
+            Parameters:
+                theShape the argument of an operation to be checked
+
+            Returns:
+                TRUE if the argument is valid for a boolean or partition
+                operation; FALSE otherwise.
+            """
+            return self.MeasuOp.CheckBOPArguments(theShape)
+
         ## Detect intersections of the given shapes with algorithm based on mesh intersections.
         #  @param theShape1 First source object
         #  @param theShape2 Second source object
         #  @param theTolerance Specifies a distance between shapes used for detecting gaps:
         #         - if \a theTolerance <= 0, algorithm detects intersections (default behavior)
         #         - if \a theTolerance > 0, algorithm detects gaps
-        #  @param theDeflection Linear deflection coefficient that specifies quality of tesselation:
+        #  @param theDeflection Linear deflection coefficient that specifies quality of tessellation:
         #         - if \a theDeflection <= 0, default deflection 0.001 is used
         #  @return TRUE, if there are intersections (gaps) between source shapes
         #  @return List of sub-shapes IDs from 1st shape that localize intersection.
@@ -10981,7 +11693,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                 theTolerance Specifies a distance between shapes used for detecting gaps:
                     - if theTolerance <= 0, algorithm detects intersections (default behavior)
                     - if theTolerance > 0, algorithm detects gaps
-                theDeflection Linear deflection coefficient that specifies quality of tesselation:
+                theDeflection Linear deflection coefficient that specifies quality of tessellation:
                     - if theDeflection <= 0, default deflection 0.001 is used
  
             Returns:
@@ -11154,10 +11866,10 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                 material groups are not automatically published.
             """
             # Example: see GEOM_TestOthers.py
-            print """
+            print("""
             WARNING: Function ImportFile is deprecated, use Import<FormatName> instead,
             where <FormatName> is a name of desirable format for importing.
-            """
+            """)
             aListObj = self.InsertOp.ImportFile(theFileName, theFormatName)
             RaiseIfFailed("ImportFile", self.InsertOp)
             aNbObj = len(aListObj)
@@ -11176,8 +11888,14 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             return self.ImportFile(theFileName, theFormatName, theName)
 
         ## Read a shape from the binary stream, containing its bounding representation (BRep).
-        #  @note This method will not be dumped to the python script by DumpStudy functionality.
-        #  @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
+        #
+        #  @note As the byte-stream representing the shape data can be quite large, this method
+        #  is not automatically dumped to the Python script with the DumpStudy functionality;
+        #  so please use this method carefully, only for strong reasons.
+        #  
+        #  @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's
+        #  data stream.
+        #
         #  @param theStream The BRep binary stream.
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
@@ -11204,6 +11922,11 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                 New GEOM_Object, containing the shape, read from theStream.
             """
             # Example: see GEOM_TestOthers.py
+            if not theStream:
+                # this is the workaround to ignore invalid case when data stream is empty
+                if int(os.getenv("GEOM_IGNORE_RESTORE_SHAPE", "0")) > 0:
+                    print("WARNING: Result of RestoreShape is a NULL shape!")
+                    return None
             anObj = self.InsertOp.RestoreShape(theStream)
             RaiseIfFailed("RestoreShape", self.InsertOp)
             self._autoPublish(anObj, theName, "restored")
@@ -11237,13 +11960,13 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                               geompy.InsertOp.ExportTranslators()[0] method.
             """
             # Example: see GEOM_TestOthers.py
-            print """
+            print("""
             WARNING: Function Export is deprecated, use Export<FormatName> instead,
             where <FormatName> is a name of desirable format for exporting.
-            """
+            """)
             self.InsertOp.Export(theObject, theFileName, theFormatName)
             if self.InsertOp.IsDone() == 0:
-                raise RuntimeError,  "Export : " + self.InsertOp.GetErrorCode()
+                raise RuntimeError("Export : " + self.InsertOp.GetErrorCode())
                 pass
             pass
 
@@ -11254,7 +11977,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         ## @{
 
         ## Create a quadrangle face from four edges. Order of Edges is not
-        #  important. It is  not necessary that edges share the same vertex.
+        #  important. It is not necessary that edges share the same vertex.
         #  @param E1,E2,E3,E4 Edges for the face bound.
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
@@ -11267,7 +11990,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         def MakeQuad(self, E1, E2, E3, E4, theName=None):
             """
             Create a quadrangle face from four edges. Order of Edges is not
-            important. It is  not necessary that edges share the same vertex.
+            important. It is not necessary that edges share the same vertex.
 
             Parameters:
                 E1,E2,E3,E4 Edges for the face bound.
@@ -11372,7 +12095,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             return anObj
 
         ## Create a hexahedral solid, bounded by the six given faces. Order of
-        #  faces is not important. It is  not necessary that Faces share the same edge.
+        #  faces is not important. It is not necessary that Faces share the same edge.
         #  @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
@@ -11386,7 +12109,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
             """
             Create a hexahedral solid, bounded by the six given faces. Order of
-            faces is not important. It is  not necessary that Faces share the same edge.
+            faces is not important. It is not necessary that Faces share the same edge.
 
             Parameters:
                 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
@@ -11846,7 +12569,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
             if IsValid == 0:
                 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
-                print Descr
+                print(Descr)
             return IsValid
 
         ## Retrieve all non blocks solids and faces from \a theShape.
@@ -12250,7 +12973,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         ## Build all possible propagation groups.
         #  Propagation group is a set of all edges, opposite to one (main)
         #  edge of this group directly or through other opposite edges.
-        #  Notion of Opposite Edge make sence only on quadrangle face.
+        #  Notion of Opposite Edge make sense only on quadrangle face.
         #  @param theShape Shape to build propagation groups on.
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
@@ -12265,7 +12988,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             Build all possible propagation groups.
             Propagation group is a set of all edges, opposite to one (main)
             edge of this group directly or through other opposite edges.
-            Notion of Opposite Edge make sence only on quadrangle face.
+            Notion of Opposite Edge make sense only on quadrangle face.
 
             Parameters:
                 theShape Shape to build propagation groups on.
@@ -12373,7 +13096,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             RaiseIfFailed("RemoveObject", self.GroupOp)
             pass
 
-        ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
+        ## Adds to the group all the given shapes. No errors, if some shapes are already included.
         #  @param theGroup is a GEOM group to which the new sub-shapes are added.
         #  @param theSubShapes is a list of sub-shapes to be added.
         #
@@ -12381,7 +13104,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         @ManageTransactions("GroupOp")
         def UnionList (self,theGroup, theSubShapes):
             """
-            Adds to the group all the given shapes. No errors, if some shapes are alredy included.
+            Adds to the group all the given shapes. No errors, if some shapes are already included.
 
             Parameters:
                 theGroup is a GEOM group to which the new sub-shapes are added.
@@ -12392,7 +13115,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             RaiseIfFailed("UnionList", self.GroupOp)
             pass
 
-        ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
+        ## Adds to the group all the given shapes. No errors, if some shapes are already included.
         #  @param theGroup is a GEOM group to which the new sub-shapes are added.
         #  @param theSubShapes is a list of indices of sub-shapes to be added.
         #
@@ -12400,7 +13123,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         @ManageTransactions("GroupOp")
         def UnionIDs(self,theGroup, theSubShapes):
             """
-            Adds to the group all the given shapes. No errors, if some shapes are alredy included.
+            Adds to the group all the given shapes. No errors, if some shapes are already included.
 
             Parameters:
                 theGroup is a GEOM group to which the new sub-shapes are added.
@@ -12690,7 +13413,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             return aType
 
         ## Convert a type of geom object from id to string value
-        #  @param theId is a GEOM obect type id.
+        #  @param theId is a GEOM object type id.
         #  @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
         #  @ref swig_GetType "Example"
         def ShapeIdToType(self, theId):
@@ -12698,7 +13421,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             Convert a type of geom object from id to string value
 
             Parameters:
-                theId is a GEOM obect type id.
+                theId is a GEOM object type id.
 
             Returns:
                 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
@@ -12870,7 +13593,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                             edges_in_range.append(edge)
 
             if len(edges_in_range) <= 0:
-                print "No edges found by given criteria"
+                print("No edges found by given criteria")
                 return None
 
             # note: auto-publishing is done in self.CreateGroup()
@@ -12903,10 +13626,10 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             """
             nb_selected = sg.SelectedCount()
             if nb_selected < 1:
-                print "Select a shape before calling this function, please."
+                print("Select a shape before calling this function, please.")
                 return 0
             if nb_selected > 1:
-                print "Only one shape must be selected"
+                print("Only one shape must be selected")
                 return 0
 
             id_shape = sg.getSelected(0)
@@ -12919,10 +13642,10 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             if include_min: left_str  = " <= "
             if include_max: right_str  = " <= "
 
-            self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
-                                    + left_str + "length" + right_str + `max_length`)
+            self.addToStudyInFather(shape, group_edges, "Group of edges with " + repr(min_length)
+                                    + left_str + "length" + right_str + repr(max_length))
 
-            sg.updateObjBrowser(1)
+            sg.updateObjBrowser()
 
             return group_edges
 
@@ -13125,7 +13848,6 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             Returns:
                 a new created folder
             """
-            if not Father: Father = self.father
             return self.CreateFolder(Name, Father)
 
         ## Move object to the specified folder
@@ -13187,7 +13909,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             """
             if isinstance( type, int ):
                 if type < 0 or type > 3:
-                    raise RuntimeError, "CreateField : Error: data type must be within [0-3] range"
+                    raise RuntimeError("CreateField : Error: data type must be within [0-3] range")
                 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
 
             f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
@@ -13206,7 +13928,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             elif isinstance( field, geomField ):
                 geom.RemoveObject( field.field )
             else:
-                raise RuntimeError, "RemoveField() : the object is not a field"
+                raise RuntimeError("RemoveField() : the object is not a field")
             return
 
         ## Returns number of fields on a shape
@@ -13236,8 +13958,38 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         # end of l2_field
         ## @}
 
+        ## @addtogroup l2_testing
+        ## @{
+
+        ## Build a mesh on the given shape.
+        # @param shape the source shape
+        # @param linear_deflection linear deflection coefficient
+        # @param is_relative says if given value of deflection is relative to shape's bounding box
+        # @param angular_deflection angular deflection for edges in degrees
+        # @return True in case of success; otherwise False.
+        @ManageTransactions("TestOp")
+        def Tesselate(self, shape, linear_deflection=0, is_relative=True, angular_deflection=0):
+            """Build a mesh on the given shape.
+
+            Parameters:
+                shape the source shape
+                linear_deflection linear deflection coefficient
+                is_relative says if given value of deflection is relative to shape's bounding box
+                angular_deflection angular deflection for edges in degrees
+
+            Returns:
+                True in case of success; otherwise False.
+            """
+            if angular_deflection > 0:
+                angular_deflection = angular_deflection * math.pi / 180.
+            r = self.TestOp.Tesselate(shape, linear_deflection, is_relative, angular_deflection)
+            RaiseIfFailed("Tesselate", self.TestOp)
+            return r
+
+        # end of l2_testing
+        ## @}
+
 
-import omniORB
 # Register the new proxy for GEOM_Gen
 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
 
@@ -13246,8 +13998,8 @@ omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
 #  @ingroup l2_field
 class geomField( GEOM._objref_GEOM_Field ):
 
-    def __init__(self):
-        GEOM._objref_GEOM_Field.__init__(self)
+    def __init__(self, *args):
+        GEOM._objref_GEOM_Field.__init__(self, *args)
         self.field = GEOM._objref_GEOM_Field
         return
 
@@ -13264,7 +14016,7 @@ class geomField( GEOM._objref_GEOM_Field ):
     ## Returns type of field data as integer [0-3]
     def getType(self):
         "Returns type of field data"
-        return self.field.GetDataType(self)._v
+        return EnumToLong(self.field.GetDataType(self))
 
     ## Returns type of field data:
     #  one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
@@ -13292,8 +14044,7 @@ class geomField( GEOM._objref_GEOM_Field ):
         "Adds a time step to the field"
         stp = self.field.AddStep( self, step, stamp )
         if not stp:
-            raise RuntimeError, \
-                  "Field.addStep() : Error: step %s already exists in this field"%step
+            raise RuntimeError("Field.addStep() : Error: step %s already exists in this field"%step)
         global geom
         geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
         self.setValues( step, values )
@@ -13331,7 +14082,7 @@ class geomField( GEOM._objref_GEOM_Field ):
         "Returns a time step by its ID"
         stp = self.field.GetStep(self, step)
         if not stp:
-            raise RuntimeError, "Step %s is missing from this field"%step
+            raise RuntimeError("Step %s is missing from this field"%step)
         return stp
 
     ## Returns the time of the field step
@@ -13356,19 +14107,19 @@ class geomField( GEOM._objref_GEOM_Field ):
         errBeg = "Field.setValues(values) : Error: "
         try:
             ok = stp.SetValues( values )
-        except Exception, e:
+        except Exception as e:
             excStr = str(e)
             if excStr.find("WrongPythonType") > 0:
-                raise RuntimeErrorerrBeg +\
-                      "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:]
-            raise RuntimeError, errBeg + str(e)
+                raise RuntimeError(errBeg +\
+                      "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:])
+            raise RuntimeError(errBeg + str(e))
         if not ok:
             nbOK = self.field.GetArraySize(self)
             nbKO = len(values)
             if nbOK != nbKO:
-                raise RuntimeError, errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO)
+                raise RuntimeError(errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO))
             else:
-                raise RuntimeError, errBeg + "failed"
+                raise RuntimeError(errBeg + "failed")
         return
 
     pass # end of class geomField
@@ -13385,12 +14136,11 @@ omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
 #    import salome
 #    salome.salome_init()
 #    from salome.geom import geomBuilder
-#    geompy = geomBuilder.New(salome.myStudy)
+#    geompy = geomBuilder.New()
 #  \endcode
-#  @param  study     SALOME study, generally obtained by salome.myStudy.
 #  @param  instance  CORBA proxy of GEOM Engine. If None, the default Engine is used.
 #  @return geomBuilder instance
-def New( study, instance=None):
+def New( instance=None):
     """
     Create a new geomBuilder instance.The geomBuilder class provides the Python
     interface to GEOM operations.
@@ -13399,10 +14149,9 @@ def New( study, instance=None):
         import salome
         salome.salome_init()
         from salome.geom import geomBuilder
-        geompy = geomBuilder.New(salome.myStudy)
+        geompy = geomBuilder.New()
 
     Parameters:
-        study     SALOME study, generally obtained by salome.myStudy.
         instance  CORBA proxy of GEOM Engine. If None, the default Engine is used.
     Returns:
         geomBuilder instance
@@ -13411,12 +14160,16 @@ def New( study, instance=None):
     global engine
     global geom
     global doLcc
+    if instance and isinstance( instance, SALOMEDS._objref_Study ):
+        import sys
+        sys.stderr.write("Warning: 'study' argument is no more needed in geomBuilder.New(). Consider updating your script!!!\n\n")
+        instance = None
     engine = instance
     if engine is None:
       doLcc = True
     geom = geomBuilder()
     assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
-    geom.init_geom(study)
+    geom.init_geom()
     return geom
 
 
@@ -13426,15 +14179,15 @@ plugins_var = os.environ.get( "GEOM_PluginsList" )
 plugins = None
 if plugins_var is not None:
     plugins = plugins_var.split( ":" )
-    plugins=filter(lambda x: len(x)>0, plugins)
+    plugins=[x for x in plugins if len(x)>0]
 if plugins is not None:
     for pluginName in plugins:
         pluginBuilderName = pluginName + "Builder"
         try:
             exec( "from salome.%s.%s import *" % (pluginName, pluginBuilderName))
-        except Exception, e:
+        except Exception as e:
             from salome_utils import verbose
-            print "Exception while loading %s: %s" % ( pluginBuilderName, e )
+            print("Exception while loading %s: %s" % ( pluginBuilderName, e ))
             continue
         exec( "from salome.%s import %s" % (pluginName, pluginBuilderName))
         plugin = eval( pluginBuilderName )