0028081: Fix regression in HLR introduced by the fix for 28053
authormsv <msv@opencascade.com>
Wed, 9 Nov 2016 15:27:47 +0000 (18:27 +0300)
committerapn <apn@opencascade.com>
Thu, 17 Nov 2016 11:48:57 +0000 (14:48 +0300)
The whole piece of the walking line between two vertices is no more checked for having length greater than Precision::Confusion(). Instead, only full duplicate points (comparing with gp::Resolution()) are removed, allowing the resulting line have any non-null length.

The test bugs modalg_6 bug27720_5 has been reverted to its original state.

src/Contap/Contap_Contour.cxx
tests/bugs/modalg_6/bug27720_5

index 0bcc1c6..ab4ebfb 100644 (file)
@@ -307,22 +307,23 @@ static void LineConstructor(Contap_TheSequenceOfLine& slin,
                                     else { 
                                       //-- cout<<"ContapWLine      : firtsp="<<firstp<<" lastp="<<lastp<<" Vtx:"<<i<<","<<i+1<<endl;
                                       Handle(IntSurf_LineOn2S) LineOn2S = new IntSurf_LineOn2S();
-                                      Contap_Line Line;
-                                      Standard_Real aLen = 0.;
-                                      for(Standard_Integer j=firstp; j<=lastp; j++) { 
-                                        LineOn2S->Add(L.Point(j));
-                                        if (j > firstp)
-                                          aLen += L.Point(j).Value().Distance(L.Point(j - 1).Value());
+                                      LineOn2S->Add(L.Point(firstp));
+                                      for (Standard_Integer j = firstp + 1; j <= lastp; j++) {
+                                        Standard_Real aSqDist = L.Point(j).Value().
+                                          SquareDistance(L.Point(j - 1).Value());
+                                        if (aSqDist > gp::Resolution())
+                                          LineOn2S->Add(L.Point(j));
                                       }
-                                      if (aLen < Precision::Confusion())
+                                      if (LineOn2S->NbPoints() < 2)
                                         continue;
+                                      Contap_Line Line;
                                       Line.SetLineOn2S(LineOn2S);
                                       Contap_Point pvtx = L.Vertex(i);
                                       pvtx.SetParameter(1);
                                       Line.Add(pvtx);
 
                                       pvtx = L.Vertex(i+1);
-                                      pvtx.SetParameter(lastp-firstp+1);
+                                      pvtx.SetParameter(LineOn2S->NbPoints());
                                       Line.Add(pvtx);
                                       Line.SetTransitionOnS(L.TransitionOnS());
                                       slin.Append(Line);
index b90f52e..167ba2a 100644 (file)
@@ -21,6 +21,6 @@ build3d result
 fit
 
 checkprops result -l 0.841499
-checknbshapes result -vertex 94 -edge 47
+checknbshapes result -vertex 92 -edge 46
 
 checkview -screenshot -2d -path ${imagedir}/${test_image}.png