Salome HOME
Mantis issue 0020998: EDF 1572 GEOM: Some limitations to the PipeTShape.
[modules/geom.git] / src / GEOMImpl / GEOMImpl_MeasureDriver.cxx
index 75c1b8eabd6a6abb7482b268b32882946bb5cc65..c3b9cd0ca273bf8c9eb11df46c53146047ade569 100644 (file)
@@ -1,4 +1,4 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//  Copyright (C) 2007-2010  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
@@ -19,6 +19,7 @@
 //
 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include <Standard_Stream.hxx>
 
 #include <GEOMImpl_MeasureDriver.hxx>
@@ -215,6 +216,17 @@ Standard_Integer GEOMImpl_MeasureDriver::Execute(TFunction_Logbook& log) const
     gp_Vec Vec1,Vec2;
     BRepAdaptor_Surface SF (aFace);
     SF.D1(pUV.X(), pUV.Y(), p1, Vec1, Vec2);
+    if (Vec1.Magnitude() < Precision::Confusion()) {
+      gp_Vec tmpV;
+      gp_Pnt tmpP;
+      SF.D1(pUV.X(), pUV.Y()-0.1, tmpP, Vec1, tmpV);
+    }
+    else if (Vec2.Magnitude() < Precision::Confusion()) {
+      gp_Vec tmpV;
+      gp_Pnt tmpP;
+      SF.D1(pUV.X()-0.1, pUV.Y(), tmpP, tmpV, Vec2);
+    }
+
     gp_Vec V = Vec1.Crossed(Vec2);
     Standard_Real mod = V.Magnitude();
     if (mod < Precision::Confusion())