#include <TopExp.hxx>
 #include <TopExp_Explorer.hxx>
 #include <BOPTools_AlgoTools2D.hxx>
+#include <Geom2dAdaptor_Curve.hxx>
 //
 
 static
   }
   //
   BOPTools_AlgoTools2D::CurveOnSurface (anEdge, myFace, aC2D, 
-                                    aFirst, aLast, aToler);
+                                       aFirst, aLast, aToler);
   dt=2.*Tolerance2D(aV, aGAS);
   //
   //for case chl/927/r9
     dt = aTX; 
   }
   //
+  GeomAbs_CurveType aType;
+  Geom2dAdaptor_Curve aGAC2D(aC2D);
+  aType=aGAC2D.GetType();
+  if (aType==GeomAbs_BSplineCurve || aType==GeomAbs_BezierCurve) {
+    dt=1.1*dt;
+  }
   if (fabs (aTV-aFirst) < fabs(aTV - aLast)) {
     aTV1=aTV + dt;
   }
 
   Standard_Real AngleWithRef(const gp_Dir& theD1,
                              const gp_Dir& theD2,
                              const gp_Dir& theDRef);
-static 
-  inline Standard_Real fsqrt(Standard_Real val);
 
 static
   Standard_Boolean FindFacePairs (const TopoDS_Edge& theE,
       aPi=BRep_Tool::Pnt(aVi);
       aTi=BRep_Tool::Tolerance(aVi);
       aDi=aP.SquareDistance(aPi);
-      aDi=fsqrt(aDi);
+      aDi=sqrt(aDi);
       aDi=aDi+aTi;
       if (aDi > aDmax) {
         aDmax=aDi;
   }
   return aBeta;
 }
-//=======================================================================
-//function : fsqrt
-//purpose  : 
-//=======================================================================
-Standard_Real fsqrt(Standard_Real val)  
-{
-  union {
-    int tmp;
-    float val;
-  } u;
-  //
-  u.val = (float)val;
-  u.tmp -= 1<<23; /* Remove last bit so 1.0 gives 1.0 */
-  /* tmp is now an approximation to logbase2(val) */
-  u.tmp >>= 1; /* divide by 2 */
-  u.tmp += 1<<29; /* add 64 to exponent: (e+127)/2 =(e/2)+63, */
-  /* that represents (e/2)-64 but we want e/2 */
-  return (double)u.val;
-}
-
 //=======================================================================
 // function: IsBlockInOnFace
 // purpose: