From: jgv Date: Fri, 12 Jul 2013 08:39:06 +0000 (+0400) Subject: 0024032: An exception raised during projection of the curve on the surface X-Git-Tag: V6_7_0_beta~208 X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff_plain;h=f7e3c52fcc542980d87ad6973cf54b78bdae7485;hp=302f96fb0d24aba0d37f967d3a5425a8ef7b1517 0024032: An exception raised during projection of the curve on the surface Added test case bugs/moddata_3/bug24032 --- diff --git a/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx b/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx index 207a523c0e..7f6bc8f088 100755 --- a/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx +++ b/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx @@ -868,6 +868,26 @@ Handle(Adaptor2d_HCurve2d) Curve->D0(Param.Value(1), pntproj) ; Extrema_ExtPS aExtPS(pntproj, Surf->Surface(), TolU, TolV) ; + Standard_Real aMinSqDist = RealLast(); + if (aExtPS.IsDone()) + { + for (i = 1; i <= aExtPS.NbExt(); i++) + { + Standard_Real aSqDist = aExtPS.SquareDistance(i); + if (aSqDist < aMinSqDist) + aMinSqDist = aSqDist; + } + } + if (aMinSqDist > DistTol3d * DistTol3d) //try to project with less tolerance + { + TolU = Min(TolU, Precision::PConfusion()); + TolV = Min(TolV, Precision::PConfusion()); + aExtPS.Initialize(Surf->Surface(), + Surf->Surface().FirstUParameter(), Surf->Surface().LastUParameter(), + Surf->Surface().FirstVParameter(), Surf->Surface().LastVParameter(), + TolU, TolV); + aExtPS.Perform(pntproj); + } if( aExtPS.IsDone() && aExtPS.NbExt() >= 1 ) { diff --git a/tests/bugs/moddata_3/bug24032 b/tests/bugs/moddata_3/bug24032 new file mode 100644 index 0000000000..1360de42cb --- /dev/null +++ b/tests/bugs/moddata_3/bug24032 @@ -0,0 +1,17 @@ +puts "========" +puts "OCC24032" +puts "========" +puts "" +####################################################################### +# An exception raised during projection of the curve on the surface +####################################################################### + +restore [locate_data_file bug24032_f.brep] f +restore [locate_data_file bug24032_c.draw] c + +mksurface s f +project c2d c s + +v2d +2dfit +set only_screen_axo 1