Salome HOME
Mantis issue 0021414: There is a difference between vectors and other edges in Geometry.
[modules/geom.git] / src / GEOMImpl / GEOMImpl_I3DPrimOperations.cxx
index 1fd9e6a5b33a714f5d515d5adb2a53f9d0fbc4c9..bbd8a69628c79e3a429023c2dbb94e4a73a27444 100644 (file)
@@ -1,24 +1,28 @@
-// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// Copyright (C) 2007-2011  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
-// 
+//
 // 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 
+// License as published by the Free Software Foundation; either
 // version 2.1 of the License.
-// 
-// 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 
+//
+// 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 
+// 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
-//
+
 #include <Standard_Stream.hxx>
 
+#include <Basics_OCCTVersion.hxx>
+
 #include <GEOMImpl_I3DPrimOperations.hxx>
 
 #include "utilities.h"
@@ -36,6 +40,8 @@
 #include <GEOMImpl_Types.hxx>
 
 #include <GEOMImpl_BoxDriver.hxx>
+#include <GEOMImpl_FaceDriver.hxx>
+#include <GEOMImpl_DiskDriver.hxx>
 #include <GEOMImpl_CylinderDriver.hxx>
 #include <GEOMImpl_ConeDriver.hxx>
 #include <GEOMImpl_SphereDriver.hxx>
@@ -48,6 +54,8 @@
 #include <GEOMImpl_ThruSectionsDriver.hxx>
 
 #include <GEOMImpl_IBox.hxx>
+#include <GEOMImpl_IFace.hxx>
+#include <GEOMImpl_IDisk.hxx>
 #include <GEOMImpl_ICylinder.hxx>
 #include <GEOMImpl_ICone.hxx>
 #include <GEOMImpl_ISphere.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 <Precision.hxx>
+
+#include <Standard_Failure.hxx>
 #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
 
 //=============================================================================
@@ -111,6 +123,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeBoxDXDYDZ (double theDX, dou
 
   //Compute the box value
   try {
+#if OCC_VERSION_LARGE > 0x06010000
+    OCC_CATCH_SIGNALS;
+#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Box driver failed");
       return NULL;
@@ -165,6 +180,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeBoxTwoPnt (Handle(GEOM_Objec
 
   //Compute the Box value
   try {
+#if OCC_VERSION_LARGE > 0x06010000
+    OCC_CATCH_SIGNALS;
+#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Box driver failed");
       return NULL;
@@ -184,6 +202,281 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeBoxTwoPnt (Handle(GEOM_Objec
   return aBox;
 }
 
+//=============================================================================
+/*!
+ *  MakeFaceHW
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFaceHW (double theH, double theW, int theOrientation)
+{
+  SetErrorCode(KO);
+
+  if (theH == 0 || theW == 0) return NULL;
+
+  //Add a new Face object
+  Handle(GEOM_Object) aFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+
+  //Add a new Box function for creation a box relatively to two points
+  Handle(GEOM_Function) aFunction = aFace->AddFunction(GEOMImpl_FaceDriver::GetID(), FACE_H_W);
+  if (aFunction.IsNull()) return NULL;
+
+  //Check if the function is set correctly
+  if (aFunction->GetDriverGUID() != GEOMImpl_FaceDriver::GetID()) return aFace;
+
+  GEOMImpl_IFace aFI (aFunction);
+
+  aFI.SetH(theH);
+  aFI.SetW(theW);
+  aFI.SetOrientation(theOrientation);
+
+  //Compute the Face
+  try {
+#if OCC_VERSION_LARGE > 0x06010000
+    OCC_CATCH_SIGNALS;
+#endif
+    if (!GetSolver()->ComputeFunction(aFunction)) {
+      SetErrorCode("Face 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) << aFace << " = geompy.MakeFaceHW("
+    << theH << ", " << theW << ", " << theOrientation << ")";
+
+  SetErrorCode(OK);
+  return aFace;
+}
+
+//=============================================================================
+/*!
+ *  MakeFaceObjHW
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFaceObjHW (Handle(GEOM_Object) theObj,
+                                                               double theH, double theW)
+{
+  SetErrorCode(KO);
+
+  if (theObj.IsNull()) return NULL;
+
+  //Add a new Face object
+  Handle(GEOM_Object) aFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+
+  //Add a new Box function for creation a box relatively to two points
+  Handle(GEOM_Function) aFunction = aFace->AddFunction(GEOMImpl_FaceDriver::GetID(), FACE_OBJ_H_W);
+  if (aFunction.IsNull()) return NULL;
+
+  //Check if the function is set correctly
+  if (aFunction->GetDriverGUID() != GEOMImpl_FaceDriver::GetID()) return aFace;
+
+  GEOMImpl_IFace aFI (aFunction);
+
+  Handle(GEOM_Function) aRefFunction1 = theObj->GetLastFunction();
+
+  if (aRefFunction1.IsNull())
+    return aFace;
+
+  aFI.SetRef1(aRefFunction1);
+  aFI.SetH(theH);
+  aFI.SetW(theW);
+
+  //Compute the Face
+  try {
+#if OCC_VERSION_LARGE > 0x06010000
+    OCC_CATCH_SIGNALS;
+#endif
+    if (!GetSolver()->ComputeFunction(aFunction)) {
+      SetErrorCode("Face 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) << aFace << " = geompy.MakeFaceObjHW("
+    << theObj << ", " << theH << ", " << theW << ")";
+
+  SetErrorCode(OK);
+  return aFace;
+}
+
+//=============================================================================
+/*!
+ *  MakeDiskPntVecR
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeDiskPntVecR
+      (Handle(GEOM_Object) thePnt, Handle(GEOM_Object) theVec, double theR)
+{
+  SetErrorCode(KO);
+
+  if (thePnt.IsNull() || theVec.IsNull()) return NULL;
+
+  //Add a new Disk object
+  Handle(GEOM_Object) aDisk = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+
+  //Add a new Disk function for creation a disk relatively to point and vector
+  Handle(GEOM_Function) aFunction =
+    aDisk->AddFunction(GEOMImpl_DiskDriver::GetID(), DISK_PNT_VEC_R);
+  if (aFunction.IsNull()) return NULL;
+
+  //Check if the function is set correctly
+  if (aFunction->GetDriverGUID() != GEOMImpl_DiskDriver::GetID()) return NULL;
+
+  GEOMImpl_IDisk aCI (aFunction);
+
+  Handle(GEOM_Function) aRefPnt = thePnt->GetLastFunction();
+  Handle(GEOM_Function) aRefVec = theVec->GetLastFunction();
+
+  if (aRefPnt.IsNull() || aRefVec.IsNull()) return NULL;
+
+  aCI.SetCenter(aRefPnt);
+  aCI.SetVector(aRefVec);
+  aCI.SetRadius(theR);
+
+  //Compute the Disk value
+  try {
+#if OCC_VERSION_LARGE > 0x06010000
+    OCC_CATCH_SIGNALS;
+#endif
+    if (!GetSolver()->ComputeFunction(aFunction)) {
+      SetErrorCode("Disk 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) << aDisk << " = geompy.MakeDiskPntVecR("
+    << thePnt << ", " << theVec << ", " << theR << ")";
+
+  SetErrorCode(OK);
+  return aDisk;
+}
+
+//=============================================================================
+/*!
+ *  MakeDiskThreePnt
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeDiskThreePnt (Handle(GEOM_Object) thePnt1,
+                                                                  Handle(GEOM_Object) thePnt2,
+                                                                  Handle(GEOM_Object) thePnt3)
+{
+  SetErrorCode(KO);
+
+  if (thePnt1.IsNull() || thePnt2.IsNull() || thePnt3.IsNull()) return NULL;
+
+  //Add a new Disk object
+  Handle(GEOM_Object) aDisk = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+
+  //Add a new Disk function for creation a disk relatively to three points
+  Handle(GEOM_Function) aFunction =
+    aDisk->AddFunction(GEOMImpl_DiskDriver::GetID(), DISK_THREE_PNT);
+  if (aFunction.IsNull()) return NULL;
+
+  //Check if the function is set correctly
+  if (aFunction->GetDriverGUID() != GEOMImpl_DiskDriver::GetID()) return NULL;
+
+  GEOMImpl_IDisk aCI (aFunction);
+
+  Handle(GEOM_Function) aRefPnt1 = thePnt1->GetLastFunction();
+  Handle(GEOM_Function) aRefPnt2 = thePnt2->GetLastFunction();
+  Handle(GEOM_Function) aRefPnt3 = thePnt3->GetLastFunction();
+
+  if (aRefPnt1.IsNull() || aRefPnt2.IsNull() || aRefPnt3.IsNull()) return NULL;
+
+  aCI.SetPoint1(aRefPnt1);
+  aCI.SetPoint2(aRefPnt2);
+  aCI.SetPoint3(aRefPnt3);
+
+  //Compute the Disk value
+  try {
+#if OCC_VERSION_LARGE > 0x06010000
+    OCC_CATCH_SIGNALS;
+#endif
+    if (!GetSolver()->ComputeFunction(aFunction)) {
+      SetErrorCode("Disk 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) << aDisk << " = geompy.MakeDiskThreePnt("
+    << thePnt1 << ", " << thePnt2 << ", " << thePnt3 << ")";
+
+  SetErrorCode(OK);
+  return aDisk;
+}
+
+//=============================================================================
+/*!
+ *  MakeDiskR
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeDiskR (double theR, int theOrientation)
+{
+  SetErrorCode(KO);
+
+  if (theR == 0 ) return NULL;
+
+  //Add a new Disk object
+  Handle(GEOM_Object) aDisk = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+
+  //Add a new Box function for creation a box relatively to two points
+  Handle(GEOM_Function) aFunction = aDisk->AddFunction(GEOMImpl_DiskDriver::GetID(), DISK_R);
+  if (aFunction.IsNull()) return NULL;
+
+  //Check if the function is set correctly
+  if (aFunction->GetDriverGUID() != GEOMImpl_DiskDriver::GetID()) return aDisk;
+
+  GEOMImpl_IDisk aDI (aFunction);
+
+  aDI.SetRadius(theR);
+  aDI.SetOrientation(theOrientation);
+
+  //Compute the Disk
+  try {
+#if OCC_VERSION_LARGE > 0x06010000
+    OCC_CATCH_SIGNALS;
+#endif
+    if (!GetSolver()->ComputeFunction(aFunction)) {
+      SetErrorCode("Disk 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) << aDisk << " = geompy.MakeDiskR("
+    << theR << ", " << theOrientation << ")";
+
+  SetErrorCode(OK);
+  return aDisk;
+}
 
 //=============================================================================
 /*!
@@ -211,6 +504,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeCylinderRH (double theR, dou
 
   //Compute the Cylinder value
   try {
+#if OCC_VERSION_LARGE > 0x06010000
+    OCC_CATCH_SIGNALS;
+#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Cylinder driver failed");
       return NULL;
@@ -269,6 +565,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeCylinderPntVecRH (Handle(GEO
 
   //Compute the Cylinder value
   try {
+#if OCC_VERSION_LARGE > 0x06010000
+    OCC_CATCH_SIGNALS;
+#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Cylinder driver failed");
       return NULL;
@@ -318,6 +617,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeConeR1R2H (double theR1, dou
 
   //Compute the Cone value
   try {
+#if OCC_VERSION_LARGE > 0x06010000
+    OCC_CATCH_SIGNALS;
+#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Cone driver failed");
       return NULL;
@@ -378,6 +680,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeConePntVecR1R2H (Handle(GEOM
 
   //Compute the Cone value
   try {
+#if OCC_VERSION_LARGE > 0x06010000
+    OCC_CATCH_SIGNALS;
+#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Cone driver failed");
       return NULL;
@@ -423,6 +728,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeSphereR (double theR)
 
   //Compute the Sphere value
   try {
+#if OCC_VERSION_LARGE > 0x06010000
+    OCC_CATCH_SIGNALS;
+#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Sphere driver failed");
       return NULL;
@@ -475,6 +783,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeSpherePntR (Handle(GEOM_Obje
 
   //Compute the Sphere value
   try {
+#if OCC_VERSION_LARGE > 0x06010000
+    OCC_CATCH_SIGNALS;
+#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Sphere driver failed");
       return NULL;
@@ -523,6 +834,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeTorusRR
 
   //Compute the Torus value
   try {
+#if OCC_VERSION_LARGE > 0x06010000
+    OCC_CATCH_SIGNALS;
+#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Torus driver failed");
       return NULL;
@@ -580,6 +894,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeTorusPntVecRR
 
   //Compute the Torus value
   try {
+#if OCC_VERSION_LARGE > 0x06010000
+    OCC_CATCH_SIGNALS;
+#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Torus driver failed");
       return NULL;
@@ -607,7 +924,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);
 
@@ -634,11 +951,16 @@ 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_LARGE > 0x06010000
+    OCC_CATCH_SIGNALS;
+#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
-      SetErrorCode("Prism driver failed");
+      //SetErrorCode("Prism driver failed");
+      SetErrorCode("Extrusion can not be created, check input data");
       return NULL;
     }
   }
@@ -649,8 +971,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;
@@ -658,23 +984,23 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismVecH (Handle(GEOM_Objec
 
 //=============================================================================
 /*!
- *  MakePrismTwoPnt
+ *  MakePrismVecH2Ways
  */
 //=============================================================================
-Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismTwoPnt
-       (Handle(GEOM_Object) theBase,
-        Handle(GEOM_Object) thePoint1, Handle(GEOM_Object) thePoint2)
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismVecH2Ways (Handle(GEOM_Object) theBase,
+                                                                    Handle(GEOM_Object) theVec,
+                                                                    double theH)
 {
   SetErrorCode(KO);
 
-  if (theBase.IsNull() || thePoint1.IsNull() || thePoint2.IsNull()) return NULL;
+  if (theBase.IsNull() || theVec.IsNull()) return NULL;
 
   //Add a new Prism object
   Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GetDocID(), GEOM_PRISM);
 
-  //Add a new Prism function for creation a Prism relatively to two points
+  //Add a new Prism function for creation a Prism relatively to vector
   Handle(GEOM_Function) aFunction =
-    aPrism->AddFunction(GEOMImpl_PrismDriver::GetID(), PRISM_BASE_TWO_PNT);
+    aPrism->AddFunction(GEOMImpl_PrismDriver::GetID(), PRISM_BASE_VEC_H_2WAYS);
   if (aFunction.IsNull()) return NULL;
 
   //Check if the function is set correctly
@@ -683,19 +1009,22 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismTwoPnt
   GEOMImpl_IPrism aCI (aFunction);
 
   Handle(GEOM_Function) aRefBase = theBase->GetLastFunction();
-  Handle(GEOM_Function) aRefPnt1 = thePoint1->GetLastFunction();
-  Handle(GEOM_Function) aRefPnt2 = thePoint2->GetLastFunction();
+  Handle(GEOM_Function) aRefVec  = theVec->GetLastFunction();
 
-  if (aRefBase.IsNull() || aRefPnt1.IsNull() || aRefPnt2.IsNull()) return NULL;
+  if (aRefBase.IsNull() || aRefVec.IsNull()) return NULL;
 
   aCI.SetBase(aRefBase);
-  aCI.SetFirstPoint(aRefPnt1);
-  aCI.SetLastPoint(aRefPnt2);
+  aCI.SetVector(aRefVec);
+  aCI.SetH(theH);
 
   //Compute the Prism value
   try {
+#if OCC_VERSION_LARGE > 0x06010000
+    OCC_CATCH_SIGNALS;
+#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
-      SetErrorCode("Prism driver failed");
+      //SetErrorCode("Prism driver failed");
+      SetErrorCode("Extrusion can not be created, check input data");
       return NULL;
     }
   }
@@ -706,51 +1035,59 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismTwoPnt
   }
 
   //Make a Python command
-  GEOM::TPythonDump(aFunction) << aPrism << " = geompy.MakePrism("
-    << theBase << ", " << thePoint1 << ", " << thePoint2 << ")";
+  GEOM::TPythonDump(aFunction) << aPrism << " = geompy.MakePrismVecH2Ways("
+    << theBase << ", " << theVec << ", " << theH << ")";
 
   SetErrorCode(OK);
   return aPrism;
 }
 
-
 //=============================================================================
 /*!
- *  MakePipe
+ *  MakePrismTwoPnt
  */
 //=============================================================================
-Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipe (Handle(GEOM_Object) theBase,
-                                                          Handle(GEOM_Object) thePath)
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismTwoPnt
+       (Handle(GEOM_Object) theBase,
+        Handle(GEOM_Object) thePoint1, Handle(GEOM_Object) thePoint2,
+        double theScaleFactor)
 {
   SetErrorCode(KO);
 
-  if (theBase.IsNull() || thePath.IsNull()) return NULL;
+  if (theBase.IsNull() || thePoint1.IsNull() || thePoint2.IsNull()) return NULL;
 
-  //Add a new Pipe object
-  Handle(GEOM_Object) aPipe = GetEngine()->AddObject(GetDocID(), GEOM_PIPE);
+  //Add a new Prism object
+  Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GetDocID(), GEOM_PRISM);
 
-  //Add a new Pipe function
+  //Add a new Prism function for creation a Prism relatively to two points
   Handle(GEOM_Function) aFunction =
-    aPipe->AddFunction(GEOMImpl_PipeDriver::GetID(), PIPE_BASE_PATH);
+    aPrism->AddFunction(GEOMImpl_PrismDriver::GetID(), PRISM_BASE_TWO_PNT);
   if (aFunction.IsNull()) return NULL;
 
   //Check if the function is set correctly
-  if (aFunction->GetDriverGUID() != GEOMImpl_PipeDriver::GetID()) return NULL;
+  if (aFunction->GetDriverGUID() != GEOMImpl_PrismDriver::GetID()) return NULL;
 
-  GEOMImpl_IPipe aCI (aFunction);
+  GEOMImpl_IPrism aCI (aFunction);
 
   Handle(GEOM_Function) aRefBase = theBase->GetLastFunction();
-  Handle(GEOM_Function) aRefPath = thePath->GetLastFunction();
+  Handle(GEOM_Function) aRefPnt1 = thePoint1->GetLastFunction();
+  Handle(GEOM_Function) aRefPnt2 = thePoint2->GetLastFunction();
 
-  if (aRefBase.IsNull() || aRefPath.IsNull()) return NULL;
+  if (aRefBase.IsNull() || aRefPnt1.IsNull() || aRefPnt2.IsNull()) return NULL;
 
   aCI.SetBase(aRefBase);
-  aCI.SetPath(aRefPath);
+  aCI.SetFirstPoint(aRefPnt1);
+  aCI.SetLastPoint(aRefPnt2);
+  aCI.SetScale(theScaleFactor);
 
-  //Compute the Pipe value
+  //Compute the Prism value
   try {
+#if OCC_VERSION_LARGE > 0x06010000
+    OCC_CATCH_SIGNALS;
+#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
-      SetErrorCode("Pipe driver failed");
+      //SetErrorCode("Prism driver failed");
+      SetErrorCode("Extrusion can not be created, check input data");
       return NULL;
     }
   }
@@ -761,39 +1098,284 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipe (Handle(GEOM_Object) th
   }
 
   //Make a Python command
-  GEOM::TPythonDump(aFunction) << aPipe << " = geompy.MakePipe("
-    << theBase << ", " << thePath << ")";
+  GEOM::TPythonDump pd (aFunction);
+  pd << aPrism << " = geompy.MakePrism(" << theBase << ", " << thePoint1 << ", " << thePoint2;
+  if (theScaleFactor > Precision::Confusion())
+    pd << ", " << theScaleFactor << ")";
+  else
+    pd << ")";
 
   SetErrorCode(OK);
-  return aPipe;
+  return aPrism;
 }
 
-
 //=============================================================================
 /*!
- *  MakeRevolutionAxisAngle
+ *  MakePrismTwoPnt2Ways
  */
 //=============================================================================
-Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeRevolutionAxisAngle (Handle(GEOM_Object) theBase,
-                                                                         Handle(GEOM_Object) theAxis,
-                                                                         double theAngle)
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismTwoPnt2Ways
+       (Handle(GEOM_Object) theBase,
+        Handle(GEOM_Object) thePoint1, Handle(GEOM_Object) thePoint2)
 {
   SetErrorCode(KO);
 
-  if (theBase.IsNull() || theAxis.IsNull()) return NULL;
+  if (theBase.IsNull() || thePoint1.IsNull() || thePoint2.IsNull()) return NULL;
 
-  //Add a new Revolution object
-  Handle(GEOM_Object) aRevolution = GetEngine()->AddObject(GetDocID(), GEOM_REVOLUTION);
+  //Add a new Prism object
+  Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GetDocID(), GEOM_PRISM);
 
-  //Add a new Revolution function for creation a revolution relatively to axis
+  //Add a new Prism function for creation a Prism relatively to two points
   Handle(GEOM_Function) aFunction =
-    aRevolution->AddFunction(GEOMImpl_RevolutionDriver::GetID(), REVOLUTION_BASE_AXIS_ANGLE);
+    aPrism->AddFunction(GEOMImpl_PrismDriver::GetID(), PRISM_BASE_TWO_PNT_2WAYS);
   if (aFunction.IsNull()) return NULL;
 
   //Check if the function is set correctly
-  if (aFunction->GetDriverGUID() != GEOMImpl_RevolutionDriver::GetID()) return NULL;
+  if (aFunction->GetDriverGUID() != GEOMImpl_PrismDriver::GetID()) return NULL;
 
-  GEOMImpl_IRevolution aCI (aFunction);
+  GEOMImpl_IPrism aCI (aFunction);
+
+  Handle(GEOM_Function) aRefBase = theBase->GetLastFunction();
+  Handle(GEOM_Function) aRefPnt1 = thePoint1->GetLastFunction();
+  Handle(GEOM_Function) aRefPnt2 = thePoint2->GetLastFunction();
+
+  if (aRefBase.IsNull() || aRefPnt1.IsNull() || aRefPnt2.IsNull()) return NULL;
+
+  aCI.SetBase(aRefBase);
+  aCI.SetFirstPoint(aRefPnt1);
+  aCI.SetLastPoint(aRefPnt2);
+
+  //Compute the Prism value
+  try {
+#if OCC_VERSION_LARGE > 0x06010000
+    OCC_CATCH_SIGNALS;
+#endif
+    if (!GetSolver()->ComputeFunction(aFunction)) {
+      //SetErrorCode("Prism driver failed");
+      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
+  GEOM::TPythonDump(aFunction) << aPrism << " = geompy.MakePrism2Ways("
+    << theBase << ", " << thePoint1 << ", " << thePoint2 << ")";
+
+  SetErrorCode(OK);
+  return aPrism;
+}
+
+//=============================================================================
+/*!
+ *  MakePrismDXDYDZ
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismDXDYDZ
+       (Handle(GEOM_Object) theBase, double theDX, double theDY, double theDZ,
+        double theScaleFactor)
+{
+  SetErrorCode(KO);
+
+  if (theBase.IsNull()) return NULL;
+
+  //Add a new Prism object
+  Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GetDocID(), GEOM_PRISM);
+
+  //Add a new Prism function for creation a Prism by DXDYDZ
+  Handle(GEOM_Function) aFunction =
+    aPrism->AddFunction(GEOMImpl_PrismDriver::GetID(), PRISM_BASE_DXDYDZ);
+  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) aRefBase = theBase->GetLastFunction();
+
+  if (aRefBase.IsNull()) return NULL;
+
+  aCI.SetBase(aRefBase);
+  aCI.SetDX(theDX);
+  aCI.SetDY(theDY);
+  aCI.SetDZ(theDZ);
+  aCI.SetScale(theScaleFactor);
+
+  //Compute the Prism value
+  try {
+#if OCC_VERSION_LARGE > 0x06010000
+    OCC_CATCH_SIGNALS;
+#endif
+    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
+  GEOM::TPythonDump pd (aFunction);
+  pd << aPrism << " = geompy.MakePrismDXDYDZ("
+     << theBase << ", " << theDX << ", " << theDY << ", " << theDZ;
+  if (theScaleFactor > Precision::Confusion())
+    pd << ", " << theScaleFactor << ")";
+  else
+    pd << ")";
+
+  SetErrorCode(OK);
+  return aPrism;
+}
+
+//=============================================================================
+/*!
+ *  MakePrismDXDYDZ_2WAYS
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismDXDYDZ2Ways
+       (Handle(GEOM_Object) theBase, double theDX, double theDY, double theDZ)
+{
+  SetErrorCode(KO);
+
+  if (theBase.IsNull()) return NULL;
+
+  //Add a new Prism object
+  Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GetDocID(), GEOM_PRISM);
+
+  //Add a new Prism function for creation a Prism by DXDYDZ
+  Handle(GEOM_Function) aFunction =
+    aPrism->AddFunction(GEOMImpl_PrismDriver::GetID(), PRISM_BASE_DXDYDZ_2WAYS);
+  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) aRefBase = theBase->GetLastFunction();
+
+  if (aRefBase.IsNull()) return NULL;
+
+  aCI.SetBase(aRefBase);
+  aCI.SetDX(theDX);
+  aCI.SetDY(theDY);
+  aCI.SetDZ(theDZ);
+
+  //Compute the Prism value
+  try {
+#if OCC_VERSION_LARGE > 0x06010000
+    OCC_CATCH_SIGNALS;
+#endif
+    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
+  GEOM::TPythonDump(aFunction) << aPrism << " = geompy.MakePrismDXDYDZ2Ways("
+    << theBase << ", " << theDX << ", " << theDY << ", " << theDZ << ")";
+
+  SetErrorCode(OK);
+  return aPrism;
+}
+
+//=============================================================================
+/*!
+ *  MakePipe
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipe (Handle(GEOM_Object) theBase,
+                                                          Handle(GEOM_Object) thePath)
+{
+  SetErrorCode(KO);
+
+  if (theBase.IsNull() || thePath.IsNull()) return NULL;
+
+  //Add a new Pipe object
+  Handle(GEOM_Object) aPipe = GetEngine()->AddObject(GetDocID(), GEOM_PIPE);
+
+  //Add a new Pipe function
+  Handle(GEOM_Function) aFunction =
+    aPipe->AddFunction(GEOMImpl_PipeDriver::GetID(), PIPE_BASE_PATH);
+  if (aFunction.IsNull()) return NULL;
+
+  //Check if the function is set correctly
+  if (aFunction->GetDriverGUID() != GEOMImpl_PipeDriver::GetID()) return NULL;
+
+  GEOMImpl_IPipe aCI (aFunction);
+
+  Handle(GEOM_Function) aRefBase = theBase->GetLastFunction();
+  Handle(GEOM_Function) aRefPath = thePath->GetLastFunction();
+
+  if (aRefBase.IsNull() || aRefPath.IsNull()) return NULL;
+
+  aCI.SetBase(aRefBase);
+  aCI.SetPath(aRefPath);
+
+  //Compute the Pipe value
+  try {
+#if OCC_VERSION_LARGE > 0x06010000
+    OCC_CATCH_SIGNALS;
+#endif
+    if (!GetSolver()->ComputeFunction(aFunction)) {
+      SetErrorCode("Pipe 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) << aPipe << " = geompy.MakePipe("
+    << theBase << ", " << thePath << ")";
+
+  SetErrorCode(OK);
+  return aPipe;
+}
+
+
+//=============================================================================
+/*!
+ *  MakeRevolutionAxisAngle
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeRevolutionAxisAngle (Handle(GEOM_Object) theBase,
+                                                                         Handle(GEOM_Object) theAxis,
+                                                                         double theAngle)
+{
+  SetErrorCode(KO);
+
+  if (theBase.IsNull() || theAxis.IsNull()) return NULL;
+
+  //Add a new Revolution object
+  Handle(GEOM_Object) aRevolution = GetEngine()->AddObject(GetDocID(), GEOM_REVOLUTION);
+
+  //Add a new Revolution function for creation a revolution relatively to axis
+  Handle(GEOM_Function) aFunction =
+    aRevolution->AddFunction(GEOMImpl_RevolutionDriver::GetID(), REVOLUTION_BASE_AXIS_ANGLE);
+  if (aFunction.IsNull()) return NULL;
+
+  //Check if the function is set correctly
+  if (aFunction->GetDriverGUID() != GEOMImpl_RevolutionDriver::GetID()) return NULL;
+
+  GEOMImpl_IRevolution aCI (aFunction);
 
   Handle(GEOM_Function) aRefBase = theBase->GetLastFunction();
   Handle(GEOM_Function) aRefAxis = theAxis->GetLastFunction();
@@ -806,6 +1388,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeRevolutionAxisAngle (Handle(
 
   //Compute the Revolution value
   try {
+#if OCC_VERSION_LARGE > 0x06010000
+    OCC_CATCH_SIGNALS;
+#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Revolution driver failed");
       return NULL;
@@ -825,41 +1410,47 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeRevolutionAxisAngle (Handle(
   return aRevolution;
 }
 
-
 //=============================================================================
 /*!
- *  MakeSolidShell
+ *  MakeRevolutionAxisAngle2Ways
  */
 //=============================================================================
-Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeSolidShell (Handle(GEOM_Object) theShell)
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeRevolutionAxisAngle2Ways
+                   (Handle(GEOM_Object) theBase, Handle(GEOM_Object) theAxis, double theAngle)
 {
   SetErrorCode(KO);
 
-  if (theShell.IsNull()) return NULL;
+  if (theBase.IsNull() || theAxis.IsNull()) return NULL;
 
-  //Add a new Solid object
-  Handle(GEOM_Object) aSolid = GetEngine()->AddObject(GetDocID(), GEOM_SOLID);
+  //Add a new Revolution object
+  Handle(GEOM_Object) aRevolution = GetEngine()->AddObject(GetDocID(), GEOM_REVOLUTION);
 
-  //Add a new Solid function for creation a solid from a shell
+  //Add a new Revolution function for creation a revolution relatively to axis
   Handle(GEOM_Function) aFunction =
-    aSolid->AddFunction(GEOMImpl_ShapeDriver::GetID(), SOLID_SHELL);
+    aRevolution->AddFunction(GEOMImpl_RevolutionDriver::GetID(), REVOLUTION_BASE_AXIS_ANGLE_2WAYS);
   if (aFunction.IsNull()) return NULL;
 
   //Check if the function is set correctly
-  if (aFunction->GetDriverGUID() != GEOMImpl_ShapeDriver::GetID()) return NULL;
+  if (aFunction->GetDriverGUID() != GEOMImpl_RevolutionDriver::GetID()) return NULL;
 
-  GEOMImpl_IShapes aCI (aFunction);
+  GEOMImpl_IRevolution aCI (aFunction);
 
-  Handle(GEOM_Function) aRefShell = theShell->GetLastFunction();
+  Handle(GEOM_Function) aRefBase = theBase->GetLastFunction();
+  Handle(GEOM_Function) aRefAxis = theAxis->GetLastFunction();
 
-  if (aRefShell.IsNull()) return NULL;
+  if (aRefBase.IsNull() || aRefAxis.IsNull()) return NULL;
 
-  aCI.SetBase(aRefShell);
+  aCI.SetBase(aRefBase);
+  aCI.SetAxis(aRefAxis);
+  aCI.SetAngle(theAngle);
 
-  //Compute the Solid value
+  //Compute the Revolution value
   try {
+#if OCC_VERSION_LARGE > 0x06010000
+    OCC_CATCH_SIGNALS;
+#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
-      SetErrorCode("Solid driver failed");
+      SetErrorCode("Revolution driver failed");
       return NULL;
     }
   }
@@ -870,10 +1461,11 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeSolidShell (Handle(GEOM_Obje
   }
 
   //Make a Python command
-  GEOM::TPythonDump(aFunction) << aSolid << " = geompy.MakeSolid(" << theShell << ")";
+  GEOM::TPythonDump(aFunction) << aRevolution << " = geompy.MakeRevolution2Ways("
+    << theBase << ", " << theAxis << ", " << theAngle * 180.0 / PI << "*math.pi/180.0)";
 
   SetErrorCode(OK);
-  return aSolid;
+  return aRevolution;
 }
 
 //=============================================================================
@@ -883,7 +1475,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)
+        double theTol2D, double theTol3D, int theNbIter,
+        int theMethod, bool isApprox)
 {
   SetErrorCode(KO);
 
@@ -911,9 +1504,14 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFilling
   aFI.SetTol2D(theTol2D);
   aFI.SetTol3D(theTol3D);
   aFI.SetNbIter(theNbIter);
+  aFI.SetApprox(isApprox);
+  aFI.SetMethod(theMethod);
 
   //Compute the Solid value
   try {
+#if OCC_VERSION_LARGE > 0x06010000
+    OCC_CATCH_SIGNALS;
+#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Filling driver failed");
       return NULL;
@@ -929,9 +1527,16 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFilling
   }
 
   //Make a Python command
-  GEOM::TPythonDump(aFunction) << aFilling << " = geompy.MakeFilling("
-    << theShape << ", " << theMinDeg << ", " << theMaxDeg << ", "
-      << theTol2D << ", " << theTol3D << ", " << theNbIter << ")";
+  GEOM::TPythonDump pd (aFunction);
+  pd << aFilling << " = geompy.MakeFilling("
+     << theShape << ", " << theMinDeg << ", " << theMaxDeg << ", "
+     << theTol2D << ", " << theTol3D << ", " << theNbIter  << ", ";
+  if( theMethod==1 ) pd << "GEOM.FOM_UseOri";
+  else if( theMethod==2 ) pd << "GEOM.FOM_AutoCorrect";
+  else pd << "GEOM.FOM_Default";
+  if(isApprox)
+    pd << ", " << isApprox ;
+  pd << ")";
 
   SetErrorCode(OK);
   return aFilling;
@@ -943,10 +1548,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);
@@ -954,13 +1559,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);
@@ -981,7 +1586,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())
     {
@@ -1000,6 +1605,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeThruSections(
 
   //Compute the ThruSections value
   try {
+#if OCC_VERSION_LARGE > 0x06010000
+    OCC_CATCH_SIGNALS;
+#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("ThruSections driver failed");
       return anObj;
@@ -1020,34 +1628,33 @@ 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;
-  
-   
 }
 
+
 //=============================================================================
 /*!
  *  MakePipeWithDifferentSections
  */
 //=============================================================================
 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);
@@ -1055,14 +1662,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 =
@@ -1087,7 +1694,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;
@@ -1098,14 +1705,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);
@@ -1119,9 +1726,12 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithDifferentSections(
   aCI.SetPath(aRefPath);
   aCI.SetWithContactMode(theWithContact);
   aCI.SetWithCorrectionMode(theWithCorrections);
-  
+
   //Compute the Pipe value
   try {
+#if OCC_VERSION_LARGE > 0x06010000
+    OCC_CATCH_SIGNALS;
+#endif
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Pipe with defferent section driver failed");
       return anObj;
@@ -1142,36 +1752,401 @@ 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;
-  
-   
+}
+
+
+//=============================================================================
+/*!
+ *  MakePipeWithShellSections
+ */
+//=============================================================================
+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)
+{
+  Handle(GEOM_Object) anObj;
+  SetErrorCode(KO);
+  if(theBases.IsNull())
+    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 =
+    aPipeDS->AddFunction(GEOMImpl_PipeDriver::GetID(), PIPE_SHELL_SECTIONS);
+  if (aFunction.IsNull()) return anObj;
+
+  //Check if the function is set correctly
+  if (aFunction->GetDriverGUID() != GEOMImpl_PipeDriver::GetID()) return anObj;
+
+  //GEOMImpl_IPipeDiffSect aCI (aFunction);
+  GEOMImpl_IPipeShellSect aCI (aFunction);
+
+  Handle(GEOM_Function) aRefPath = thePath->GetLastFunction();
+  if(aRefPath.IsNull())
+    return anObj;
+
+  Handle(TColStd_HSequenceOfTransient) aSeqBases = new TColStd_HSequenceOfTransient;
+  Handle(TColStd_HSequenceOfTransient) aSeqSubBases = new TColStd_HSequenceOfTransient;
+  Handle(TColStd_HSequenceOfTransient) aSeqLocs = new TColStd_HSequenceOfTransient;
+
+  Standard_Integer i =1;
+  for( ; i <= nbBases; i++) {
+
+    Handle(Standard_Transient) anItem = theBases->Value(i);
+    if(anItem.IsNull())
+      continue;
+    Handle(GEOM_Object) aBase = Handle(GEOM_Object)::DownCast(anItem);
+    if(aBase.IsNull())
+      continue;
+    Handle(GEOM_Function) aRefBase = aBase->GetLastFunction();
+    if(aRefBase.IsNull())
+      continue;
+
+    if( nbSubBases >= nbBases ) {
+      Handle(Standard_Transient) aSubItem = theSubBases->Value(i);
+      if(aSubItem.IsNull())
+        continue;
+      Handle(GEOM_Object) aSubBase = Handle(GEOM_Object)::DownCast(aSubItem);
+      if(aSubBase.IsNull())
+        continue;
+      Handle(GEOM_Function) aRefSubBase = aSubBase->GetLastFunction();
+      if(aRefSubBase.IsNull())
+        continue;
+      aSeqSubBases->Append(aRefSubBase);
+    }
+
+    if(nbLocs) {
+      Handle(Standard_Transient) anItemLoc = theLocations->Value(i);
+      if(anItemLoc.IsNull())
+        continue;
+      Handle(GEOM_Object) aLoc = Handle(GEOM_Object)::DownCast(anItemLoc);
+      if(aLoc.IsNull())
+        continue;
+      Handle(GEOM_Function) aRefLoc = aLoc->GetLastFunction();
+      if(aRefLoc.IsNull())
+        continue;
+      aSeqLocs->Append(aRefLoc);
+    }
+
+    aSeqBases->Append(aRefBase);
+  }
+
+  if(!aSeqBases->Length())
+    return anObj;
+
+  aCI.SetBases(aSeqBases);
+  aCI.SetSubBases(aSeqSubBases);
+  aCI.SetLocations(aSeqLocs);
+  aCI.SetPath(aRefPath);
+  aCI.SetWithContactMode(theWithContact);
+  aCI.SetWithCorrectionMode(theWithCorrections);
+
+  //Compute the Pipe value
+  try {
+#if OCC_VERSION_LARGE > 0x06010000
+    OCC_CATCH_SIGNALS;
+#endif
+    if (!GetSolver()->ComputeFunction(aFunction)) {
+      SetErrorCode("Pipe with shell sections driver failed");
+      return anObj;
+    }
+  }
+  catch (Standard_Failure) {
+    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+    SetErrorCode(aFail->GetMessageString());
+    return anObj;
+  }
+
+  //Make a Python command
+  GEOM::TPythonDump pyDump(aFunction);
+  pyDump << aPipeDS << " = geompy.MakePipeWithShellSections([";
+
+  for(i =1 ; i <= nbBases; i++) {
+
+    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<< "], [";
+
+  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<< "], [";
+
+  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<< "], "<<thePath<<","<<theWithContact << "," << theWithCorrections<<")";
+
+  SetErrorCode(OK);
+  return aPipeDS;
+
+}
+
+
+//=============================================================================
+/*!
+ *  MakePipeShellsWithoutPath
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeShellsWithoutPath(
+                const Handle(TColStd_HSequenceOfTransient)& theBases,
+                const Handle(TColStd_HSequenceOfTransient)& theLocations)
+{
+  Handle(GEOM_Object) anObj;
+  SetErrorCode(KO);
+  if(theBases.IsNull())
+    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 =
+    aPipeDS->AddFunction(GEOMImpl_PipeDriver::GetID(), PIPE_SHELLS_WITHOUT_PATH);
+  if (aFunction.IsNull()) return anObj;
+
+  //Check if the function is set correctly
+  if (aFunction->GetDriverGUID() != GEOMImpl_PipeDriver::GetID()) return anObj;
+
+  GEOMImpl_IPipeShellSect aCI (aFunction);
+
+  Handle(TColStd_HSequenceOfTransient) aSeqBases = new TColStd_HSequenceOfTransient;
+  Handle(TColStd_HSequenceOfTransient) aSeqLocs = new TColStd_HSequenceOfTransient;
+
+  Standard_Integer i =1;
+  for( ; i <= nbBases; i++) {
+
+    Handle(Standard_Transient) anItem = theBases->Value(i);
+    if(anItem.IsNull())
+      continue;
+    Handle(GEOM_Object) aBase = Handle(GEOM_Object)::DownCast(anItem);
+    if(aBase.IsNull())
+      continue;
+    Handle(GEOM_Function) aRefBase = aBase->GetLastFunction();
+    if(aRefBase.IsNull())
+      continue;
+
+    if(nbLocs) {
+      Handle(Standard_Transient) anItemLoc = theLocations->Value(i);
+      if(anItemLoc.IsNull())
+        continue;
+      Handle(GEOM_Object) aLoc = Handle(GEOM_Object)::DownCast(anItemLoc);
+      if(aLoc.IsNull())
+        continue;
+      Handle(GEOM_Function) aRefLoc = aLoc->GetLastFunction();
+      if(aRefLoc.IsNull())
+        continue;
+      aSeqLocs->Append(aRefLoc);
+    }
+
+    aSeqBases->Append(aRefBase);
+  }
+
+  if(!aSeqBases->Length())
+    return anObj;
+
+  aCI.SetBases(aSeqBases);
+  aCI.SetLocations(aSeqLocs);
+
+  //Compute the Pipe value
+  try {
+#if OCC_VERSION_LARGE > 0x06010000
+    OCC_CATCH_SIGNALS;
+#endif
+    if (!GetSolver()->ComputeFunction(aFunction)) {
+      SetErrorCode("Pipe with shell sections without path driver failed");
+      return anObj;
+    }
+  }
+  catch (Standard_Failure) {
+    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+    SetErrorCode(aFail->GetMessageString());
+    return anObj;
+  }
+
+  //Make a Python command
+  GEOM::TPythonDump pyDump(aFunction);
+  pyDump << aPipeDS << " = geompy.MakePipeShellsWithoutPath([";
+
+  for(i =1 ; i <= nbBases; i++) {
+
+    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<< "], [";
+
+  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<< "])";
+
+  SetErrorCode(OK);
+  return aPipeDS;
+
+}
+
+
+//=============================================================================
+/*!
+ *  MakePipeBiNormalAlongVector
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeBiNormalAlongVector (Handle(GEOM_Object) theBase,
+                                                                             Handle(GEOM_Object) thePath,
+                                                                             Handle(GEOM_Object) theVec)
+{
+  SetErrorCode(KO);
+
+  if (theBase.IsNull() || thePath.IsNull() || theVec.IsNull()) return NULL;
+
+  //Add a new Pipe object
+  Handle(GEOM_Object) aPipe = GetEngine()->AddObject(GetDocID(), GEOM_PIPE);
+
+  //Add a new Pipe function
+  Handle(GEOM_Function) aFunction =
+    aPipe->AddFunction(GEOMImpl_PipeDriver::GetID(), PIPE_BI_NORMAL_ALONG_VECTOR);
+  if (aFunction.IsNull()) return NULL;
+
+  //Check if the function is set correctly
+  if (aFunction->GetDriverGUID() != GEOMImpl_PipeDriver::GetID()) return NULL;
+
+  GEOMImpl_IPipeBiNormal aCI (aFunction);
+
+  Handle(GEOM_Function) aRefBase = theBase->GetLastFunction();
+  Handle(GEOM_Function) aRefPath = thePath->GetLastFunction();
+  Handle(GEOM_Function) aRefVec  = theVec->GetLastFunction();
+
+  if (aRefBase.IsNull() || aRefPath.IsNull() || aRefVec.IsNull()) return NULL;
+
+  aCI.SetBase(aRefBase);
+  aCI.SetPath(aRefPath);
+  aCI.SetVector(aRefVec);
+
+  //Compute the Pipe value
+  try {
+#if OCC_VERSION_LARGE > 0x06010000
+    OCC_CATCH_SIGNALS;
+#endif
+    if (!GetSolver()->ComputeFunction(aFunction)) {
+      SetErrorCode("Pipe 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) << aPipe << " = geompy.MakePipeBiNormalAlongVector("
+    << theBase << ", " << thePath << ", " << theVec << ")";
+
+  SetErrorCode(OK);
+  return aPipe;
 }