From: aml Date: Tue, 31 Oct 2017 03:43:57 +0000 (+0300) Subject: 0027784: Thickness fails on cylinder with draft X-Git-Tag: V7_3_0_beta~196 X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff_plain;h=3cdf48fe622e033052b29164d89375f1eaac5aa8 0027784: Thickness fails on cylinder with draft Incorrect calculation of intersection in 2D space is fixed. --- diff --git a/src/BRepOffset/BRepOffset_Tool.cxx b/src/BRepOffset/BRepOffset_Tool.cxx index 96e5a1ab21..717b0c8e41 100644 --- a/src/BRepOffset/BRepOffset_Tool.cxx +++ b/src/BRepOffset/BRepOffset_Tool.cxx @@ -2365,6 +2365,7 @@ void BRepOffset_Tool::Inter2d (const TopoDS_Face& F, #endif Standard_Real U1 = 0.,U2 = 0.; gp_Pnt2d P2d; + Standard_Boolean aCurrentFind = Standard_False; if (itry == 1) { fl1[0] = C1->FirstParameter(); fl1[1] = C1->LastParameter(); fl2[0] = C2->FirstParameter(); fl2[1] = C2->LastParameter(); @@ -2384,6 +2385,7 @@ void BRepOffset_Tool::Inter2d (const TopoDS_Face& F, Abs(fl2[i2]) < Precision::Infinite() ) { if (P1[i1].IsEqual(P2[i2],TolConf)) { YaSol = Standard_True; + aCurrentFind = Standard_True; U1 = fl1[i1]; U2 = fl2[i2]; P2d = C1->Value(U1); } @@ -2409,7 +2411,8 @@ void BRepOffset_Tool::Inter2d (const TopoDS_Face& F, } if (Dist2Min <= Precision::SquareConfusion()) { - YaSol = Standard_True; + YaSol = Standard_True; + aCurrentFind = Standard_True; P2d = P1[i1]; U1 = fl1[i1]; U2 = (extr.Point(IndexMin)).Parameter(); @@ -2437,6 +2440,7 @@ void BRepOffset_Tool::Inter2d (const TopoDS_Face& F, if (Dist2Min <= Precision::SquareConfusion()) { YaSol = Standard_True; + aCurrentFind = Standard_True; P2d = P2[i2]; U2 = fl2[i2]; U1 = (extr.Point(IndexMin)).Parameter(); @@ -2450,13 +2454,15 @@ void BRepOffset_Tool::Inter2d (const TopoDS_Face& F, Geom2dInt_GInter Inter (AC1,AC2,TolConf,TolConf); if (!Inter.IsEmpty() && Inter.NbPoints() > 0) { - YaSol = Standard_True; + YaSol = Standard_True; + aCurrentFind = Standard_True; U1 = Inter.Point(1).ParamOnFirst(); U2 = Inter.Point(1).ParamOnSecond(); P2d = Inter.Point(1).Value(); } else if (!Inter.IsEmpty() && Inter.NbSegments() > 0) { - YaSol = Standard_True; + YaSol = Standard_True; + aCurrentFind = Standard_True; IntRes2d_IntersectionSegment Seg = Inter.Segment(1); IntRes2d_IntersectionPoint IntP1 = Seg.FirstPoint(); IntRes2d_IntersectionPoint IntP2 = Seg.LastPoint(); @@ -2479,7 +2485,7 @@ void BRepOffset_Tool::Inter2d (const TopoDS_Face& F, P2d.SetY( (P2d1.Y() + P2d2.Y()) / 2.); } } - if (YaSol) { + if (aCurrentFind) { gp_Pnt P = S->Value(P2d.X(),P2d.Y()); TopoDS_Vertex V = BRepLib_MakeVertex(P); V.Orientation(TopAbs_INTERNAL); diff --git a/tests/bugs/modalg_7/bug25930 b/tests/bugs/modalg_7/bug25930 index 5d3fd177b2..540cc7fb05 100755 --- a/tests/bugs/modalg_7/bug25930 +++ b/tests/bugs/modalg_7/bug25930 @@ -1,5 +1,3 @@ -puts "TODO OCC25930 ALL: Faulty shapes in variables faulty_1 to faulty_" - puts "============" puts "OCC25930" puts "============" diff --git a/tests/bugs/modalg_7/bug27784 b/tests/bugs/modalg_7/bug27784 index d89e1f38c3..39c13131df 100644 --- a/tests/bugs/modalg_7/bug27784 +++ b/tests/bugs/modalg_7/bug27784 @@ -1,7 +1,3 @@ -puts "TODO OCC27784 ALL: An exception was caught" -puts "TODO OCC27784 ALL: \\*\\* Exception \\*\\*.*" -puts "TODO OCC27784 ALL: TEST INCOMPLETE" - puts "========" puts "OCC27784" puts "========"