0028053: Regressions in HLR when FPE signals are enabled
authormsv <msv@opencascade.com>
Mon, 7 Nov 2016 12:49:54 +0000 (15:49 +0300)
committerabv <abv@opencascade.com>
Tue, 8 Nov 2016 16:29:56 +0000 (19:29 +0300)
Protect Contap_Contour from creation of null-length curves.

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

index 1b071f9..0bcc1c6 100644 (file)
@@ -308,9 +308,14 @@ static void LineConstructor(Contap_TheSequenceOfLine& slin,
                                       //-- 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());
                                       }
+                                      if (aLen < Precision::Confusion())
+                                        continue;
                                       Line.SetLineOn2S(LineOn2S);
                                       Contap_Point pvtx = L.Vertex(i);
                                       pvtx.SetParameter(1);
index 167ba2a..b90f52e 100644 (file)
@@ -21,6 +21,6 @@ build3d result
 fit
 
 checkprops result -l 0.841499
-checknbshapes result -vertex 92 -edge 46
+checknbshapes result -vertex 94 -edge 47
 
 checkview -screenshot -2d -path ${imagedir}/${test_image}.png