]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
0020970: CEA 423 Bug on normal on a sphere
authorvsr <vsr@opencascade.com>
Tue, 5 Oct 2010 09:46:23 +0000 (09:46 +0000)
committervsr <vsr@opencascade.com>
Tue, 5 Oct 2010 09:46:23 +0000 (09:46 +0000)
src/GEOMImpl/GEOMImpl_MeasureDriver.cxx

index 70a0fb545911ceec6943582553dfd38f87e66bc8..c3b9cd0ca273bf8c9eb11df46c53146047ade569 100644 (file)
@@ -216,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())