0025003: Selection of a face fails if sensitive triangulation is computed with interi...
authorvro <vro@opencascade.com>
Wed, 11 Jun 2014 08:19:44 +0000 (12:19 +0400)
committerbugmaster <bugmaster@opencascade.com>
Thu, 17 Jul 2014 10:03:53 +0000 (14:03 +0400)
A check on length is added to avoid manipulation with a vector of null length.

src/Select3D/Select3D_SensitiveTriangulation.cxx

index 700f138..70f6cd3 100644 (file)
@@ -59,6 +59,9 @@ static Standard_Boolean S3D_STriangul_NearSegment (const gp_XY& p0, const gp_XY&
   gp_XY V01(p1);V01-=p0;
   gp_XY Vec(TheP);Vec -= p0;
 
+  if (V01.SquareModulus() < Precision::SquareConfusion())
+    return Standard_False;
+
   Standard_Real u = Vec*V01.Normalized();
   if(u<-aTol) return Standard_False;
   Standard_Real u1 = u-aTol;