]> SALOME platform Git repositories - modules/geom.git/blobdiff - src/GEOMImpl/GEOMImpl_I3DPrimOperations.cxx
Salome HOME
0022686: [CEA 1268] Explode a shape into edges sorted in a row from a starting point
[modules/geom.git] / src / GEOMImpl / GEOMImpl_I3DPrimOperations.cxx
index ffa7b4d3fd3297e2af21c36b6ffd0914403ae957..27c366d8e01dbff2140a0177ecf9409613845c3a 100644 (file)
@@ -1,26 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
 //
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include <Standard_Stream.hxx>
 
+#include <Basics_OCCTVersion.hxx>
+
 #include <GEOMImpl_I3DPrimOperations.hxx>
 
 #include "utilities.h"
 #include <GEOMImpl_TorusDriver.hxx>
 #include <GEOMImpl_PrismDriver.hxx>
 #include <GEOMImpl_PipeDriver.hxx>
+#include <GEOMImpl_PipePathDriver.hxx>
 #include <GEOMImpl_RevolutionDriver.hxx>
 #include <GEOMImpl_ShapeDriver.hxx>
 #include <GEOMImpl_FillingDriver.hxx>
 #include <GEOMImpl_ThruSectionsDriver.hxx>
+#include <GEOMImpl_OffsetDriver.hxx>
 
 #include <GEOMImpl_IBox.hxx>
 #include <GEOMImpl_IFace.hxx>
 #include <GEOMImpl_IPrism.hxx>
 #include <GEOMImpl_IPipe.hxx>
 #include <GEOMImpl_IRevolution.hxx>
-#include <GEOMImpl_IShapes.hxx>
 #include <GEOMImpl_IFilling.hxx>
 #include <GEOMImpl_IThruSections.hxx>
 #include <GEOMImpl_IPipeDiffSect.hxx>
 #include <GEOMImpl_IPipeShellSect.hxx>
 #include <GEOMImpl_IPipeBiNormal.hxx>
+#include <GEOMImpl_IOffset.hxx>
+#include <GEOMImpl_IPipePath.hxx>
+
+#include <Precision.hxx>
 
 #include <Standard_Failure.hxx>
 #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
@@ -120,9 +128,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeBoxDXDYDZ (double theDX, dou
 
   //Compute the box value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Box driver failed");
       return NULL;
@@ -177,9 +183,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeBoxTwoPnt (Handle(GEOM_Objec
 
   //Compute the Box value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Box driver failed");
       return NULL;
@@ -228,9 +232,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFaceHW (double theH, double
 
   //Compute the Face
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Face driver failed");
       return NULL;
@@ -256,7 +258,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFaceHW (double theH, double
  */
 //=============================================================================
 Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFaceObjHW (Handle(GEOM_Object) theObj,
-                                                              double theH, double theW)
+                                                               double theH, double theW)
 {
   SetErrorCode(KO);
 
@@ -285,9 +287,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFaceObjHW (Handle(GEOM_Objec
 
   //Compute the Face
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Face driver failed");
       return NULL;
@@ -343,9 +343,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeDiskPntVecR
 
   //Compute the Disk value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Disk driver failed");
       return NULL;
@@ -371,8 +369,8 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeDiskPntVecR
  */
 //=============================================================================
 Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeDiskThreePnt (Handle(GEOM_Object) thePnt1,
-                                                                 Handle(GEOM_Object) thePnt2,
-                                                                 Handle(GEOM_Object) thePnt3)
+                                                                  Handle(GEOM_Object) thePnt2,
+                                                                  Handle(GEOM_Object) thePnt3)
 {
   SetErrorCode(KO);
 
@@ -403,9 +401,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeDiskThreePnt (Handle(GEOM_Ob
 
   //Compute the Disk value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Disk driver failed");
       return NULL;
@@ -453,9 +449,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeDiskR (double theR, int theO
 
   //Compute the Disk
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Disk driver failed");
       return NULL;
@@ -501,9 +495,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeCylinderRH (double theR, dou
 
   //Compute the Cylinder value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Cylinder driver failed");
       return NULL;
@@ -523,6 +515,52 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeCylinderRH (double theR, dou
   return aCylinder;
 }
 
+//=============================================================================
+/*!
+ *  MakeCylinderRHA
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeCylinderRHA (double theR, double theH, double theA)
+{
+  SetErrorCode(KO);
+
+  //Add a new Cylinder object
+  Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GetDocID(), GEOM_CYLINDER);
+
+  //Add a new Cylinder function with R and H parameters
+  Handle(GEOM_Function) aFunction = aCylinder->AddFunction(GEOMImpl_CylinderDriver::GetID(), CYLINDER_R_H_A);
+  if (aFunction.IsNull()) return NULL;
+
+  //Check if the function is set correctly
+  if (aFunction->GetDriverGUID() != GEOMImpl_CylinderDriver::GetID()) return NULL;
+
+  GEOMImpl_ICylinder aCI (aFunction);
+
+  aCI.SetR(theR);
+  aCI.SetH(theH);
+  aCI.SetA(theA);
+
+  //Compute the Cylinder value
+  try {
+    OCC_CATCH_SIGNALS;
+    if (!GetSolver()->ComputeFunction(aFunction)) {
+      SetErrorCode("Cylinder driver failed");
+      return NULL;
+    }
+  }
+  catch (Standard_Failure) {
+    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+    SetErrorCode(aFail->GetMessageString());
+    return NULL;
+  }
+
+  //Make a Python command
+  GEOM::TPythonDump(aFunction) << aCylinder
+    << " = geompy.MakeCylinderRHA(" << theR << ", " << theH << ", " << theA*180./M_PI << "*math.pi/180.)";
+
+  SetErrorCode(OK);
+  return aCylinder;
+}
 
 //=============================================================================
 /*!
@@ -562,9 +600,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeCylinderPntVecRH (Handle(GEO
 
   //Compute the Cylinder value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Cylinder driver failed");
       return NULL;
@@ -584,6 +620,65 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeCylinderPntVecRH (Handle(GEO
   return aCylinder;
 }
 
+//=============================================================================
+/*!
+ *  MakeCylinderPntVecRHA
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeCylinderPntVecRHA (Handle(GEOM_Object) thePnt,
+                                                                      Handle(GEOM_Object) theVec,
+                                                                      double theR, double theH, double theA)
+{
+  SetErrorCode(KO);
+
+  if (thePnt.IsNull() || theVec.IsNull()) return NULL;
+
+  //Add a new Cylinder object
+  Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GetDocID(), GEOM_CYLINDER);
+
+  //Add a new Cylinder function for creation a cylinder relatively to point and vector
+  Handle(GEOM_Function) aFunction =
+    aCylinder->AddFunction(GEOMImpl_CylinderDriver::GetID(), CYLINDER_PNT_VEC_R_H_A);
+  if (aFunction.IsNull()) return NULL;
+
+  //Check if the function is set correctly
+  if (aFunction->GetDriverGUID() != GEOMImpl_CylinderDriver::GetID()) return NULL;
+
+  GEOMImpl_ICylinder aCI (aFunction);
+
+  Handle(GEOM_Function) aRefPnt = thePnt->GetLastFunction();
+  Handle(GEOM_Function) aRefVec = theVec->GetLastFunction();
+
+  if (aRefPnt.IsNull() || aRefVec.IsNull()) return NULL;
+
+  aCI.SetPoint(aRefPnt);
+  aCI.SetVector(aRefVec);
+  aCI.SetR(theR);
+  aCI.SetH(theH);
+  aCI.SetA(theA);
+
+  //Compute the Cylinder value
+  try {
+    OCC_CATCH_SIGNALS;
+    if (!GetSolver()->ComputeFunction(aFunction)) {
+      SetErrorCode("Cylinder driver failed");
+      return NULL;
+    }
+  }
+  catch (Standard_Failure) {
+    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+    SetErrorCode(aFail->GetMessageString());
+    return NULL;
+  }
+
+  //Make a Python command
+  GEOM::TPythonDump(aFunction) << aCylinder << " = geompy.MakeCylinderA("
+    << thePnt << ", " << theVec << ", " << theR << ", " << theH << ", " << theA*180./M_PI << "*math.pi/180.)";
+
+  SetErrorCode(OK);
+  return aCylinder;
+}
+
 
 //=============================================================================
 /*!
@@ -614,9 +709,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeConeR1R2H (double theR1, dou
 
   //Compute the Cone value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Cone driver failed");
       return NULL;
@@ -677,9 +770,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeConePntVecR1R2H (Handle(GEOM
 
   //Compute the Cone value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Cone driver failed");
       return NULL;
@@ -725,9 +816,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeSphereR (double theR)
 
   //Compute the Sphere value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Sphere driver failed");
       return NULL;
@@ -780,9 +869,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeSpherePntR (Handle(GEOM_Obje
 
   //Compute the Sphere value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Sphere driver failed");
       return NULL;
@@ -831,9 +918,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeTorusRR
 
   //Compute the Torus value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Torus driver failed");
       return NULL;
@@ -891,9 +976,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeTorusPntVecRR
 
   //Compute the Torus value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Torus driver failed");
       return NULL;
@@ -921,7 +1004,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeTorusPntVecRR
 //=============================================================================
 Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismVecH (Handle(GEOM_Object) theBase,
                                                                Handle(GEOM_Object) theVec,
-                                                               double theH)
+                                                               double theH, double theScaleFactor)
 {
   SetErrorCode(KO);
 
@@ -948,12 +1031,11 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismVecH (Handle(GEOM_Objec
   aCI.SetBase(aRefBase);
   aCI.SetVector(aRefVec);
   aCI.SetH(theH);
+  aCI.SetScale(theScaleFactor);
 
   //Compute the Prism value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       //SetErrorCode("Prism driver failed");
       SetErrorCode("Extrusion can not be created, check input data");
@@ -967,8 +1049,12 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismVecH (Handle(GEOM_Objec
   }
 
   //Make a Python command
-  GEOM::TPythonDump(aFunction) << aPrism << " = geompy.MakePrismVecH("
-    << theBase << ", " << theVec << ", " << theH << ")";
+  GEOM::TPythonDump pd (aFunction);
+  pd << aPrism << " = geompy.MakePrismVecH(" << theBase << ", " << theVec << ", " << theH;
+  if (theScaleFactor > Precision::Confusion())
+    pd << ", " << theScaleFactor << ")";
+  else
+    pd << ")";
 
   SetErrorCode(OK);
   return aPrism;
@@ -980,8 +1066,8 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismVecH (Handle(GEOM_Objec
  */
 //=============================================================================
 Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismVecH2Ways (Handle(GEOM_Object) theBase,
-                                                                   Handle(GEOM_Object) theVec,
-                                                                   double theH)
+                                                                    Handle(GEOM_Object) theVec,
+                                                                    double theH)
 {
   SetErrorCode(KO);
 
@@ -1011,9 +1097,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismVecH2Ways (Handle(GEOM_
 
   //Compute the Prism value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       //SetErrorCode("Prism driver failed");
       SetErrorCode("Extrusion can not be created, check input data");
@@ -1041,7 +1125,8 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismVecH2Ways (Handle(GEOM_
 //=============================================================================
 Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismTwoPnt
        (Handle(GEOM_Object) theBase,
-        Handle(GEOM_Object) thePoint1, Handle(GEOM_Object) thePoint2)
+        Handle(GEOM_Object) thePoint1, Handle(GEOM_Object) thePoint2,
+        double theScaleFactor)
 {
   SetErrorCode(KO);
 
@@ -1069,12 +1154,11 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismTwoPnt
   aCI.SetBase(aRefBase);
   aCI.SetFirstPoint(aRefPnt1);
   aCI.SetLastPoint(aRefPnt2);
+  aCI.SetScale(theScaleFactor);
 
   //Compute the Prism value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       //SetErrorCode("Prism driver failed");
       SetErrorCode("Extrusion can not be created, check input data");
@@ -1088,8 +1172,12 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismTwoPnt
   }
 
   //Make a Python command
-  GEOM::TPythonDump(aFunction) << aPrism << " = geompy.MakePrism("
-    << theBase << ", " << thePoint1 << ", " << thePoint2 << ")";
+  GEOM::TPythonDump pd (aFunction);
+  pd << aPrism << " = geompy.MakePrism(" << theBase << ", " << thePoint1 << ", " << thePoint2;
+  if (theScaleFactor > Precision::Confusion())
+    pd << ", " << theScaleFactor << ")";
+  else
+    pd << ")";
 
   SetErrorCode(OK);
   return aPrism;
@@ -1133,9 +1221,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismTwoPnt2Ways
 
   //Compute the Prism value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       //SetErrorCode("Prism driver failed");
       SetErrorCode("Extrusion can not be created, check input data");
@@ -1162,7 +1248,8 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismTwoPnt2Ways
  */
 //=============================================================================
 Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismDXDYDZ
-       (Handle(GEOM_Object) theBase, double theDX, double theDY, double theDZ)
+       (Handle(GEOM_Object) theBase, double theDX, double theDY, double theDZ,
+        double theScaleFactor)
 {
   SetErrorCode(KO);
 
@@ -1189,12 +1276,11 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismDXDYDZ
   aCI.SetDX(theDX);
   aCI.SetDY(theDY);
   aCI.SetDZ(theDZ);
+  aCI.SetScale(theScaleFactor);
 
   //Compute the Prism value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Extrusion can not be created, check input data");
       return NULL;
@@ -1207,8 +1293,13 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismDXDYDZ
   }
 
   //Make a Python command
-  GEOM::TPythonDump(aFunction) << aPrism << " = geompy.MakePrismDXDYDZ("
-    << theBase << ", " << theDX << ", " << theDY << ", " << theDZ << ")";
+  GEOM::TPythonDump pd (aFunction);
+  pd << aPrism << " = geompy.MakePrismDXDYDZ("
+     << theBase << ", " << theDX << ", " << theDY << ", " << theDZ;
+  if (theScaleFactor > Precision::Confusion())
+    pd << ", " << theScaleFactor << ")";
+  else
+    pd << ")";
 
   SetErrorCode(OK);
   return aPrism;
@@ -1250,9 +1341,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismDXDYDZ2Ways
 
   //Compute the Prism value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Extrusion can not be created, check input data");
       return NULL;
@@ -1272,6 +1361,86 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismDXDYDZ2Ways
   return aPrism;
 }
 
+//=============================================================================
+/*!
+ *  MakeDraftPrism
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeDraftPrism
+       (Handle(GEOM_Object) theInitShape ,Handle(GEOM_Object) theBase, double theHeight, double theAngle, bool theFuse)
+{
+  SetErrorCode(KO);
+
+  if (theBase.IsNull() || theInitShape.IsNull()) return NULL;
+
+  Handle(GEOM_Object) aPrism = NULL;
+  
+  if ( theFuse )
+  {
+    //Add a new Extruded Boss object  
+    aPrism = GetEngine()->AddObject(GetDocID(), GEOM_EXTRUDED_BOSS);
+  }
+  else
+  { 
+    //Add a new Extruded Cut object  
+    aPrism = GetEngine()->AddObject(GetDocID(), GEOM_EXTRUDED_CUT);
+  }
+  
+  //Add a new Prism function for the creation of a Draft Prism feature
+  Handle(GEOM_Function) aFunction = 
+    aPrism->AddFunction(GEOMImpl_PrismDriver::GetID(), DRAFT_PRISM_FEATURE);
+  if (aFunction.IsNull()) return NULL;
+  
+  //Check if the function is set correctly
+  if (aFunction->GetDriverGUID() != GEOMImpl_PrismDriver::GetID()) return NULL;
+  
+  GEOMImpl_IPrism aCI (aFunction);
+
+  Handle(GEOM_Function) aRefInit = theInitShape->GetLastFunction();
+  Handle(GEOM_Function) aRefBase = theBase->GetLastFunction();
+  if (aRefBase.IsNull() || aRefInit.IsNull()) return NULL;
+  
+  // Set parameters 
+  aCI.SetBase(aRefBase);
+  aCI.SetInitShape(aRefInit);
+  aCI.SetH(theHeight);
+  aCI.SetDraftAngle(theAngle);
+  if ( theFuse )
+    aCI.SetFuseFlag(1);
+  else
+    aCI.SetFuseFlag(0);
+  
+  //Compute the Draft Prism Feature value
+  try {
+    OCC_CATCH_SIGNALS;
+    if (!GetSolver()->ComputeFunction(aFunction)) {
+      SetErrorCode("Extrusion can not be created, check input data");
+      return NULL;
+    }
+  }
+  catch (Standard_Failure) {
+    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+    SetErrorCode(aFail->GetMessageString());
+    return NULL;
+  }
+  
+  //Make a Python command
+  if(theFuse)
+  {
+    GEOM::TPythonDump(aFunction) << aPrism << " = geompy.MakeExtrudedBoss("
+      << theInitShape << ", " << theBase << ", " << theHeight << ", " << theAngle << ")";
+  }
+  else
+  {   
+    GEOM::TPythonDump(aFunction) << aPrism << " = geompy.MakeExtrudedCut("
+      << theInitShape << ", " << theBase << ", " << theHeight << ", " << theAngle << ")";
+  }
+
+  SetErrorCode(OK);
+  return aPrism;
+}
+
 //=============================================================================
 /*!
  *  MakePipe
@@ -1307,9 +1476,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipe (Handle(GEOM_Object) th
 
   //Compute the Pipe value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Pipe driver failed");
       return NULL;
@@ -1367,9 +1534,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeRevolutionAxisAngle (Handle(
 
   //Compute the Revolution value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Revolution driver failed");
       return NULL;
@@ -1383,8 +1548,8 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeRevolutionAxisAngle (Handle(
 
   //Make a Python command
   GEOM::TPythonDump(aFunction) << aRevolution << " = geompy.MakeRevolution("
-    << theBase << ", " << theAxis << ", " << theAngle * 180.0 / PI << "*math.pi/180.0)";
-
+    << theBase << ", " << theAxis << ", " << theAngle * 180.0 / M_PI << "*math.pi/180.0)";
+  
   SetErrorCode(OK);
   return aRevolution;
 }
@@ -1425,9 +1590,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeRevolutionAxisAngle2Ways
 
   //Compute the Revolution value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Revolution driver failed");
       return NULL;
@@ -1441,65 +1604,12 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeRevolutionAxisAngle2Ways
 
   //Make a Python command
   GEOM::TPythonDump(aFunction) << aRevolution << " = geompy.MakeRevolution2Ways("
-    << theBase << ", " << theAxis << ", " << theAngle * 180.0 / PI << "*math.pi/180.0)";
+    << theBase << ", " << theAxis << ", " << theAngle * 180.0 / M_PI << "*math.pi/180.0)";
 
   SetErrorCode(OK);
   return aRevolution;
 }
 
-//=============================================================================
-/*!
- *  MakeSolidShell
- */
-//=============================================================================
-Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeSolidShell (Handle(GEOM_Object) theShell)
-{
-  SetErrorCode(KO);
-
-  if (theShell.IsNull()) return NULL;
-
-  //Add a new Solid object
-  Handle(GEOM_Object) aSolid = GetEngine()->AddObject(GetDocID(), GEOM_SOLID);
-
-  //Add a new Solid function for creation a solid from a shell
-  Handle(GEOM_Function) aFunction =
-    aSolid->AddFunction(GEOMImpl_ShapeDriver::GetID(), SOLID_SHELL);
-  if (aFunction.IsNull()) return NULL;
-
-  //Check if the function is set correctly
-  if (aFunction->GetDriverGUID() != GEOMImpl_ShapeDriver::GetID()) return NULL;
-
-  GEOMImpl_IShapes aCI (aFunction);
-
-  Handle(GEOM_Function) aRefShell = theShell->GetLastFunction();
-
-  if (aRefShell.IsNull()) return NULL;
-
-  aCI.SetBase(aRefShell);
-
-  //Compute the Solid value
-  try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
-    OCC_CATCH_SIGNALS;
-#endif
-    if (!GetSolver()->ComputeFunction(aFunction)) {
-      SetErrorCode("Solid driver failed");
-      return NULL;
-    }
-  }
-  catch (Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    SetErrorCode(aFail->GetMessageString());
-    return NULL;
-  }
-
-  //Make a Python command
-  GEOM::TPythonDump(aFunction) << aSolid << " = geompy.MakeSolid(" << theShell << ")";
-
-  SetErrorCode(OK);
-  return aSolid;
-}
-
 //=============================================================================
 /*!
  *  MakeFilling
@@ -1507,7 +1617,8 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeSolidShell (Handle(GEOM_Obje
 //=============================================================================
 Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFilling
        (Handle(GEOM_Object) theShape, int theMinDeg, int theMaxDeg,
-        double theTol2D, double theTol3D, int theNbIter, bool isApprox)
+        double theTol2D, double theTol3D, int theNbIter,
+        int theMethod, bool isApprox)
 {
   SetErrorCode(KO);
 
@@ -1536,12 +1647,11 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFilling
   aFI.SetTol3D(theTol3D);
   aFI.SetNbIter(theNbIter);
   aFI.SetApprox(isApprox);
+  aFI.SetMethod(theMethod);
 
   //Compute the Solid value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Filling driver failed");
       return NULL;
@@ -1558,11 +1668,17 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFilling
 
   //Make a Python command
   GEOM::TPythonDump pd (aFunction);
-  pd << aFilling << " = geompy.MakeFilling("
-    << theShape << ", " << theMinDeg << ", " << theMaxDeg << ", "
-      << theTol2D << ", " << theTol3D << ", " << theNbIter;
-  if(isApprox)
-    pd << ", " << isApprox;
+  pd << aFilling << " = geompy.MakeFilling(" << theShape ;
+  if ( theMinDeg != 2 )   pd << ", theMinDeg=" << theMinDeg ;
+  if ( theMaxDeg != 5 )   pd << ", theMaxDeg=" << theMaxDeg ;
+  if ( fabs(theTol2D-0.0001) > Precision::Confusion() )
+                          pd << ", theTol2D=" << theTol2D ;
+  if ( fabs(theTol3D-0.0001) > Precision::Confusion() )
+                          pd << ", theTol3D=" << theTol3D ;
+  if ( theNbIter != 0 )   pd << ", theNbIter=" << theNbIter ;
+  if ( theMethod==1 )     pd << ", theMethod=GEOM.FOM_UseOri";
+  else if( theMethod==2 ) pd << ", theMethod=GEOM.FOM_AutoCorrect";
+  if(isApprox)            pd << ", isApprox=" << isApprox ;
   pd << ")";
 
   SetErrorCode(OK);
@@ -1575,10 +1691,10 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFilling
  */
 //=============================================================================
 Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeThruSections(
-                                               const Handle(TColStd_HSequenceOfTransient)& theSeqSections,
-                                               bool theModeSolid,
-                                               double thePreci,
-                                               bool theRuled)
+                                                const Handle(TColStd_HSequenceOfTransient)& theSeqSections,
+                                                bool theModeSolid,
+                                                double thePreci,
+                                                bool theRuled)
 {
   Handle(GEOM_Object) anObj;
   SetErrorCode(KO);
@@ -1586,13 +1702,13 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeThruSections(
     return anObj;
 
   Standard_Integer nbObj = theSeqSections->Length();
-  if (!nbObj) 
+  if (!nbObj)
     return anObj;
 
   //Add a new ThruSections object
   Handle(GEOM_Object) aThruSect = GetEngine()->AddObject(GetDocID(), GEOM_THRUSECTIONS);
 
+
   //Add a new ThruSections function
 
   int aTypeFunc = (theRuled ? THRUSECTIONS_RULED : THRUSECTIONS_SMOOTHED);
@@ -1613,7 +1729,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeThruSections(
     Handle(Standard_Transient) anItem = theSeqSections->Value(i);
     if(anItem.IsNull())
       continue;
-    
+
     Handle(GEOM_Object) aSectObj = Handle(GEOM_Object)::DownCast(anItem);
     if(!aSectObj.IsNull())
     {
@@ -1632,9 +1748,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeThruSections(
 
   //Compute the ThruSections value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("ThruSections driver failed");
       return anObj;
@@ -1655,21 +1769,19 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeThruSections(
     Handle(Standard_Transient) anItem = theSeqSections->Value(i);
     if(anItem.IsNull())
       continue;
-    
+
     Handle(GEOM_Object) aSectObj = Handle(GEOM_Object)::DownCast(anItem);
     if(!aSectObj.IsNull()) {
       pyDump<< aSectObj;
       if(i < nbObj)
-       pyDump<<", ";
+        pyDump<<", ";
     }
   }
-  
+
   pyDump<< "],"<<theModeSolid << "," << thePreci <<","<< theRuled <<")";
 
   SetErrorCode(OK);
   return aThruSect;
-  
-   
 }
 
 
@@ -1679,11 +1791,11 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeThruSections(
  */
 //=============================================================================
 Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithDifferentSections(
-               const Handle(TColStd_HSequenceOfTransient)& theBases,
-               const Handle(TColStd_HSequenceOfTransient)& theLocations,
-               const Handle(GEOM_Object)& thePath,
-               bool theWithContact,
-               bool theWithCorrections)
+                const Handle(TColStd_HSequenceOfTransient)& theBases,
+                const Handle(TColStd_HSequenceOfTransient)& theLocations,
+                const Handle(GEOM_Object)& thePath,
+                bool theWithContact,
+                bool theWithCorrections)
 {
   Handle(GEOM_Object) anObj;
   SetErrorCode(KO);
@@ -1691,14 +1803,14 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithDifferentSections(
     return anObj;
 
   Standard_Integer nbBases = theBases->Length();
-  
+
   if (!nbBases)
     return anObj;
-  
+
   Standard_Integer nbLocs =  (theLocations.IsNull() ? 0 :theLocations->Length());
   //Add a new Pipe object
   Handle(GEOM_Object) aPipeDS = GetEngine()->AddObject(GetDocID(), GEOM_PIPE);
+
   //Add a new Pipe function
 
   Handle(GEOM_Function) aFunction =
@@ -1723,7 +1835,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithDifferentSections(
     Handle(Standard_Transient) anItem = theBases->Value(i);
     if(anItem.IsNull())
       continue;
-    
+
     Handle(GEOM_Object) aBase = Handle(GEOM_Object)::DownCast(anItem);
     if(aBase.IsNull())
       continue;
@@ -1734,14 +1846,14 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithDifferentSections(
     {
       Handle(Standard_Transient) anItemLoc = theLocations->Value(i);
       if(anItemLoc.IsNull())
-       continue;
-    
+        continue;
+
       Handle(GEOM_Object) aLoc = Handle(GEOM_Object)::DownCast(anItemLoc);
       if(aLoc.IsNull())
-       continue;
+        continue;
       Handle(GEOM_Function) aRefLoc = aLoc->GetLastFunction();
       if(aRefLoc.IsNull())
-       continue;
+        continue;
       aSeqLocs->Append(aRefLoc);
     }
     aSeqBases->Append(aRefBase);
@@ -1755,12 +1867,10 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithDifferentSections(
   aCI.SetPath(aRefPath);
   aCI.SetWithContactMode(theWithContact);
   aCI.SetWithCorrectionMode(theWithCorrections);
-  
+
   //Compute the Pipe value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Pipe with defferent section driver failed");
       return anObj;
@@ -1781,38 +1891,35 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithDifferentSections(
     Handle(Standard_Transient) anItem = theBases->Value(i);
     if(anItem.IsNull())
       continue;
-    
+
     Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(anItem);
     if(!anObj.IsNull()) {
       pyDump<< anObj;
       if(i < nbBases)
-       pyDump<<", ";
+        pyDump<<", ";
     }
-    
   }
-  
+
   pyDump<< "], [";
-   
+
   for(i =1 ; i <= nbLocs; i++) {
 
     Handle(Standard_Transient) anItem = theLocations->Value(i);
     if(anItem.IsNull())
       continue;
-    
+
     Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(anItem);
     if(!anObj.IsNull()) {
       pyDump<< anObj;
       if(i < nbLocs)
-       pyDump<<", ";
+        pyDump<<", ";
     }
-  }  
+  }
 
   pyDump<< "], "<<thePath<<","<<theWithContact << "," << theWithCorrections<<")";
 
   SetErrorCode(OK);
   return aPipeDS;
-  
-   
 }
 
 
@@ -1822,12 +1929,12 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithDifferentSections(
  */
 //=============================================================================
 Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithShellSections(
-               const Handle(TColStd_HSequenceOfTransient)& theBases,
-               const Handle(TColStd_HSequenceOfTransient)& theSubBases,
-               const Handle(TColStd_HSequenceOfTransient)& theLocations,
-               const Handle(GEOM_Object)& thePath,
-               bool theWithContact,
-               bool theWithCorrections)
+                const Handle(TColStd_HSequenceOfTransient)& theBases,
+                const Handle(TColStd_HSequenceOfTransient)& theSubBases,
+                const Handle(TColStd_HSequenceOfTransient)& theLocations,
+                const Handle(GEOM_Object)& thePath,
+                bool theWithContact,
+                bool theWithCorrections)
 {
   Handle(GEOM_Object) anObj;
   SetErrorCode(KO);
@@ -1835,17 +1942,17 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithShellSections(
     return anObj;
 
   Standard_Integer nbBases = theBases->Length();
-  
+
   if (!nbBases)
     return anObj;
-  
+
   Standard_Integer nbSubBases =  (theSubBases.IsNull() ? 0 :theSubBases->Length());
 
   Standard_Integer nbLocs =  (theLocations.IsNull() ? 0 :theLocations->Length());
 
   //Add a new Pipe object
   Handle(GEOM_Object) aPipeDS = GetEngine()->AddObject(GetDocID(), GEOM_PIPE);
+
   //Add a new Pipe function
 
   Handle(GEOM_Function) aFunction =
@@ -1882,26 +1989,26 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithShellSections(
     if( nbSubBases >= nbBases ) {
       Handle(Standard_Transient) aSubItem = theSubBases->Value(i);
       if(aSubItem.IsNull())
-       continue;
+        continue;
       Handle(GEOM_Object) aSubBase = Handle(GEOM_Object)::DownCast(aSubItem);
       if(aSubBase.IsNull())
-       continue;
+        continue;
       Handle(GEOM_Function) aRefSubBase = aSubBase->GetLastFunction();
       if(aRefSubBase.IsNull())
-       continue;
+        continue;
       aSeqSubBases->Append(aRefSubBase);
     }
 
     if(nbLocs) {
       Handle(Standard_Transient) anItemLoc = theLocations->Value(i);
       if(anItemLoc.IsNull())
-       continue;
+        continue;
       Handle(GEOM_Object) aLoc = Handle(GEOM_Object)::DownCast(anItemLoc);
       if(aLoc.IsNull())
-       continue;
+        continue;
       Handle(GEOM_Function) aRefLoc = aLoc->GetLastFunction();
       if(aRefLoc.IsNull())
-       continue;
+        continue;
       aSeqLocs->Append(aRefLoc);
     }
 
@@ -1917,12 +2024,10 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithShellSections(
   aCI.SetPath(aRefPath);
   aCI.SetWithContactMode(theWithContact);
   aCI.SetWithCorrectionMode(theWithCorrections);
-  
+
   //Compute the Pipe value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Pipe with shell sections driver failed");
       return anObj;
@@ -1943,48 +2048,46 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithShellSections(
     Handle(Standard_Transient) anItem = theBases->Value(i);
     if(anItem.IsNull())
       continue;
-    
+
     Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(anItem);
     if(!anObj.IsNull()) {
       pyDump<< anObj;
       if(i < nbBases)
-       pyDump<<", ";
+        pyDump<<", ";
     }
-    
   }
-  
+
   pyDump<< "], [";
-   
+
   for(i =1 ; i <= nbSubBases; i++) {
 
     Handle(Standard_Transient) anItem = theSubBases->Value(i);
     if(anItem.IsNull())
       continue;
-    
+
     Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(anItem);
     if(!anObj.IsNull()) {
       pyDump<< anObj;
       if(i < nbBases)
-       pyDump<<", ";
+        pyDump<<", ";
     }
-    
   }
-  
+
   pyDump<< "], [";
-   
+
   for(i =1 ; i <= nbLocs; i++) {
 
     Handle(Standard_Transient) anItem = theLocations->Value(i);
     if(anItem.IsNull())
       continue;
-    
+
     Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(anItem);
     if(!anObj.IsNull()) {
       pyDump<< anObj;
       if(i < nbLocs)
-       pyDump<<", ";
+        pyDump<<", ";
     }
-  }  
+  }
 
   pyDump<< "], "<<thePath<<","<<theWithContact << "," << theWithCorrections<<")";
 
@@ -2000,8 +2103,8 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithShellSections(
  */
 //=============================================================================
 Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeShellsWithoutPath(
-               const Handle(TColStd_HSequenceOfTransient)& theBases,
-               const Handle(TColStd_HSequenceOfTransient)& theLocations)
+                const Handle(TColStd_HSequenceOfTransient)& theBases,
+                const Handle(TColStd_HSequenceOfTransient)& theLocations)
 {
   Handle(GEOM_Object) anObj;
   SetErrorCode(KO);
@@ -2009,15 +2112,15 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeShellsWithoutPath(
     return anObj;
 
   Standard_Integer nbBases = theBases->Length();
-  
+
   if (!nbBases)
     return anObj;
-  
+
   Standard_Integer nbLocs =  (theLocations.IsNull() ? 0 :theLocations->Length());
 
   //Add a new Pipe object
   Handle(GEOM_Object) aPipeDS = GetEngine()->AddObject(GetDocID(), GEOM_PIPE);
+
   //Add a new Pipe function
 
   Handle(GEOM_Function) aFunction =
@@ -2048,13 +2151,13 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeShellsWithoutPath(
     if(nbLocs) {
       Handle(Standard_Transient) anItemLoc = theLocations->Value(i);
       if(anItemLoc.IsNull())
-       continue;
+        continue;
       Handle(GEOM_Object) aLoc = Handle(GEOM_Object)::DownCast(anItemLoc);
       if(aLoc.IsNull())
-       continue;
+        continue;
       Handle(GEOM_Function) aRefLoc = aLoc->GetLastFunction();
       if(aRefLoc.IsNull())
-       continue;
+        continue;
       aSeqLocs->Append(aRefLoc);
     }
 
@@ -2066,12 +2169,10 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeShellsWithoutPath(
 
   aCI.SetBases(aSeqBases);
   aCI.SetLocations(aSeqLocs);
-  
+
   //Compute the Pipe value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Pipe with shell sections without path driver failed");
       return anObj;
@@ -2092,31 +2193,30 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeShellsWithoutPath(
     Handle(Standard_Transient) anItem = theBases->Value(i);
     if(anItem.IsNull())
       continue;
-    
+
     Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(anItem);
     if(!anObj.IsNull()) {
       pyDump<< anObj;
       if(i < nbBases)
-       pyDump<<", ";
+        pyDump<<", ";
     }
-    
   }
-  
+
   pyDump<< "], [";
-   
+
   for(i =1 ; i <= nbLocs; i++) {
 
     Handle(Standard_Transient) anItem = theLocations->Value(i);
     if(anItem.IsNull())
       continue;
-    
+
     Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(anItem);
     if(!anObj.IsNull()) {
       pyDump<< anObj;
       if(i < nbLocs)
-       pyDump<<", ";
+        pyDump<<", ";
     }
-  }  
+  }
 
   pyDump<< "])";
 
@@ -2125,15 +2225,14 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeShellsWithoutPath(
 
 }
 
-
 //=============================================================================
 /*!
  *  MakePipeBiNormalAlongVector
  */
 //=============================================================================
 Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeBiNormalAlongVector (Handle(GEOM_Object) theBase,
-                                                                            Handle(GEOM_Object) thePath,
-                                                                            Handle(GEOM_Object) theVec)
+                                                                             Handle(GEOM_Object) thePath,
+                                                                             Handle(GEOM_Object) theVec)
 {
   SetErrorCode(KO);
 
@@ -2164,9 +2263,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeBiNormalAlongVector (Han
 
   //Compute the Pipe value
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
     OCC_CATCH_SIGNALS;
-#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Pipe driver failed");
       return NULL;
@@ -2186,3 +2283,236 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeBiNormalAlongVector (Han
   return aPipe;
 }
 
+//=============================================================================
+/*!
+ *  MakeThickening
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeThickening(Handle(GEOM_Object) theObject,
+                                                              double theOffset,
+                                                              bool copy = true)
+{
+  SetErrorCode(KO);
+
+  if (theObject.IsNull()) return NULL;
+
+  Handle(GEOM_Function) anOriginal = theObject->GetLastFunction();
+  if (anOriginal.IsNull()) return NULL; //There is no function which creates an object to be offset
+
+  //Add a new Offset function
+  Handle(GEOM_Function) aFunction;
+  Handle(GEOM_Object) aCopy; 
+  if (copy)
+  { 
+    //Add a new Copy object
+    aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+    aFunction = aCopy->AddFunction(GEOMImpl_OffsetDriver::GetID(), OFFSET_THICKENING_COPY);
+  }
+  else
+    aFunction = theObject->AddFunction(GEOMImpl_OffsetDriver::GetID(), OFFSET_THICKENING);
+  
+  if (aFunction.IsNull()) return NULL;
+
+  //Check if the function is set correctly
+  if (aFunction->GetDriverGUID() != GEOMImpl_OffsetDriver::GetID()) return NULL;
+
+  GEOMImpl_IOffset aTI (aFunction);
+  aTI.SetShape(anOriginal);
+  aTI.SetValue(theOffset);
+
+  //Compute the offset
+  try {
+    OCC_CATCH_SIGNALS;
+    if (!GetSolver()->ComputeFunction(aFunction)) {
+      SetErrorCode("Offset driver failed");
+      return NULL;
+    }
+  }
+  catch (Standard_Failure) {
+    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+    SetErrorCode(aFail->GetMessageString());
+    return NULL;
+  }
+
+  //Make a Python command
+  if(copy)
+  {
+    GEOM::TPythonDump(aFunction) << aCopy << " = geompy.MakeThickSolid("
+                               << theObject << ", " << theOffset << ")";
+    SetErrorCode(OK);
+    return aCopy;
+  }
+  else
+  {
+    GEOM::TPythonDump(aFunction) << "geompy.Thicken("
+                               << theObject << ", " << theOffset << ")";
+    SetErrorCode(OK);
+    return theObject;
+  }
+}
+
+//=============================================================================
+/*!
+ *  RestorePath
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::RestorePath (Handle(GEOM_Object) theShape,
+                                                             Handle(GEOM_Object) theBase1,
+                                                             Handle(GEOM_Object) theBase2)
+{
+  SetErrorCode(KO);
+
+  if (theShape.IsNull() || theBase1.IsNull() || theBase2.IsNull()) return NULL;
+
+  // Add a new Path object
+  Handle(GEOM_Object) aPath = GetEngine()->AddObject(GetDocID(), GEOM_PIPE_PATH);
+
+  // Add a new Path function
+  Handle(GEOM_Function) aFunction =
+    aPath->AddFunction(GEOMImpl_PipePathDriver::GetID(), PIPE_PATH_TWO_BASES);
+  if (aFunction.IsNull()) return NULL;
+
+  // Check if the function is set correctly
+  if (aFunction->GetDriverGUID() != GEOMImpl_PipePathDriver::GetID()) return NULL;
+
+  GEOMImpl_IPipePath aCI (aFunction);
+
+  Handle(GEOM_Function) aRefShape = theShape->GetLastFunction();
+  Handle(GEOM_Function) aRefBase1 = theBase1->GetLastFunction();
+  Handle(GEOM_Function) aRefBase2 = theBase2->GetLastFunction();
+
+  if (aRefShape.IsNull() || aRefBase1.IsNull() || aRefBase2.IsNull()) return NULL;
+
+  aCI.SetShape(aRefShape);
+  aCI.SetBase1(aRefBase1);
+  aCI.SetBase2(aRefBase2);
+
+  // Compute the Path value
+  try {
+    OCC_CATCH_SIGNALS;
+    if (!GetSolver()->ComputeFunction(aFunction)) {
+      SetErrorCode("PipePath driver failed");
+      return NULL;
+    }
+  }
+  catch (Standard_Failure) {
+    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+    SetErrorCode("RestorePath: inappropriate arguments given");
+    return NULL;
+  }
+
+  // Make a Python command
+  GEOM::TPythonDump(aFunction) << aPath << " = geompy.RestorePath("
+    << theShape << ", " << theBase1 << ", " << theBase2 << ")";
+
+  SetErrorCode(OK);
+  return aPath;
+}
+
+//=============================================================================
+/*!
+ *  RestorePath
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::RestorePath
+                         (Handle(GEOM_Object) theShape,
+                          const Handle(TColStd_HSequenceOfTransient)& theBase1,
+                          const Handle(TColStd_HSequenceOfTransient)& theBase2)
+{
+  SetErrorCode(KO);
+
+  if (theShape.IsNull() || theBase1.IsNull() || theBase2.IsNull()) return NULL;
+
+  Standard_Integer nbBases1 = theBase1->Length();
+  Standard_Integer nbBases2 = theBase2->Length();
+
+  if (!nbBases1 || !nbBases2)
+    return NULL;
+
+  // Add a new Path object
+  Handle(GEOM_Object) aPath = GetEngine()->AddObject(GetDocID(), GEOM_PIPE_PATH);
+
+  // Add a new Path function
+  Handle(GEOM_Function) aFunction =
+    aPath->AddFunction(GEOMImpl_PipePathDriver::GetID(), PIPE_PATH_TWO_SEQS);
+  if (aFunction.IsNull()) return NULL;
+
+  // Check if the function is set correctly
+  if (aFunction->GetDriverGUID() != GEOMImpl_PipePathDriver::GetID()) return NULL;
+
+  GEOMImpl_IPipePath aCI (aFunction);
+
+  Handle(GEOM_Function) aRefShape = theShape->GetLastFunction();
+  if (aRefShape.IsNull()) return NULL;
+
+  Handle(TColStd_HSequenceOfTransient) aSeqBases1 = new TColStd_HSequenceOfTransient;
+  Handle(TColStd_HSequenceOfTransient) aSeqBases2 = new TColStd_HSequenceOfTransient;
+
+  Standard_Integer i;
+  for (i = 1; i <= nbBases1; i++) {
+    Handle(Standard_Transient) anItem = theBase1->Value(i);
+    if (!anItem.IsNull()) {
+      Handle(GEOM_Object) aBase = Handle(GEOM_Object)::DownCast(anItem);
+      if (!aBase.IsNull()) {
+        Handle(GEOM_Function) aRefBase = aBase->GetLastFunction();
+        if (!aRefBase.IsNull())
+          aSeqBases1->Append(aRefBase);
+      }
+    }
+  }
+  for (i = 1; i <= nbBases2; i++) {
+    Handle(Standard_Transient) anItem = theBase2->Value(i);
+    if (!anItem.IsNull()) {
+      Handle(GEOM_Object) aBase = Handle(GEOM_Object)::DownCast(anItem);
+      if (!aBase.IsNull()) {
+        Handle(GEOM_Function) aRefBase = aBase->GetLastFunction();
+        if (!aRefBase.IsNull())
+          aSeqBases2->Append(aRefBase);
+      }
+    }
+  }
+  if (!aSeqBases1->Length() || !aSeqBases2->Length()) return NULL;
+
+  aCI.SetShape(aRefShape);
+  aCI.SetBaseSeq1(aSeqBases1);
+  aCI.SetBaseSeq2(aSeqBases2);
+
+  // Compute the Path value
+  try {
+    OCC_CATCH_SIGNALS;
+    if (!GetSolver()->ComputeFunction(aFunction)) {
+      SetErrorCode("PipePath driver failed");
+      return NULL;
+    }
+  }
+  catch (Standard_Failure) {
+    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+    SetErrorCode("RestorePath: inappropriate arguments given");
+    return NULL;
+  }
+
+  // Make a Python command
+  GEOM::TPythonDump pyDump (aFunction);
+  pyDump << aPath << " = geompy.RestorePathEdges(" << theShape << ", [";
+  for (i = 1; i <= nbBases1; i++) {
+    Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(theBase1->Value(i));
+    if (!anObj.IsNull()) {
+      pyDump << anObj;
+      if (i < nbBases1)
+        pyDump << ", ";
+    }
+  }
+  pyDump<< "], [";
+  for (i = 1; i <= nbBases2; i++) {
+    Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(theBase2->Value(i));
+    if (!anObj.IsNull()) {
+      pyDump << anObj;
+      if (i < nbBases2)
+        pyDump << ", ";
+    }
+  }
+  pyDump << "])";
+
+  SetErrorCode(OK);
+  return aPath;
+}