From: azv Date: Fri, 21 Nov 2014 12:35:44 +0000 (+0300) Subject: 0025504: Exception raised during projection curve on surface X-Git-Tag: V6_9_0_beta~281 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=c84d6e55eadc9ad8fd5b7922da379c1b567374d5;p=occt.git 0025504: Exception raised during projection curve on surface Avoid moving of projected point to a boundary of surface Test case for CR25504 --- diff --git a/src/ProjLib/ProjLib_PrjResolve.cxx b/src/ProjLib/ProjLib_PrjResolve.cxx index 24d1a6fb48..a8322021e6 100644 --- a/src/ProjLib/ProjLib_PrjResolve.cxx +++ b/src/ProjLib/ProjLib_PrjResolve.cxx @@ -92,13 +92,13 @@ ProjLib_PrjResolve::ProjLib_PrjResolve(const Adaptor3d_Curve& C,const Adaptor3d_ ExtraU = Tol2d.X(); ExtraV = Tol2d.Y(); // } - if (Abs(mySolution.X()-Inf.X()) < Tol2d.X()) mySolution.SetX(Inf.X()); - if (Abs(mySolution.X()-Sup.X()) < Tol2d.X()) mySolution.SetX(Sup.X()); - if (Abs(mySolution.Y()-Inf.Y()) < Tol2d.Y()) mySolution.SetY(Inf.Y()); - if (Abs(mySolution.Y()-Sup.Y()) < Tol2d.Y()) mySolution.SetY(Sup.Y()); - if (mySolution.X() < Inf.X() - ExtraU || + if (mySolution.X() > Inf.X() - Tol2d.X() && mySolution.X() < Inf.X()) mySolution.SetX(Inf.X()); + if (mySolution.X() > Sup.X() && mySolution.X() < Sup.X() + Tol2d.X()) mySolution.SetX(Sup.X()); + if (mySolution.Y() > Inf.Y() - Tol2d.Y() && mySolution.Y() < Inf.Y()) mySolution.SetY(Inf.Y()); + if (mySolution.Y() > Sup.Y() && mySolution.Y() < Sup.Y() + Tol2d.Y()) mySolution.SetY(Sup.Y()); + if (mySolution.X() < Inf.X() - ExtraU || mySolution.X() > Sup.X() + ExtraU || - mySolution.Y() < Inf.Y() - ExtraV || + mySolution.Y() < Inf.Y() - ExtraV || mySolution.Y() > Sup.Y() + ExtraV) myDone = Standard_False; else if (FuncTol > 0) { math_Vector X(1,2,0.), FVal(1,2,0.); diff --git a/tests/bugs/moddata_3/bug25504 b/tests/bugs/moddata_3/bug25504 new file mode 100644 index 0000000000..cbc870cbbe --- /dev/null +++ b/tests/bugs/moddata_3/bug25504 @@ -0,0 +1,12 @@ +puts "================" +puts "OCC25504" +puts "================" +puts "" +####################################################################### +# Exception raised during projection curve on surface +####################################################################### + +restore [locate_data_file bug25504_surf.draw] s +restore [locate_data_file bug25504_curve.draw] c + +project c2d c s