From 134f1e8d5fdef7ec15d26eb8dc3c45ba9ac684ec Mon Sep 17 00:00:00 2001 From: aml Date: Mon, 8 Feb 2016 11:39:54 +0300 Subject: [PATCH] 0027133: Incorrect result of the normal projection algorithm Topological tolerances changed to geometric tolerances. Test case added. --- src/ProjLib/ProjLib_CompProjectedCurve.cxx | 11 ++++++----- tests/bugs/moddata_3/bug27133 | 23 ++++++++++++++++++++++ 2 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 tests/bugs/moddata_3/bug27133 diff --git a/src/ProjLib/ProjLib_CompProjectedCurve.cxx b/src/ProjLib/ProjLib_CompProjectedCurve.cxx index 6b2535eaed..1d5cc6e470 100644 --- a/src/ProjLib/ProjLib_CompProjectedCurve.cxx +++ b/src/ProjLib/ProjLib_CompProjectedCurve.cxx @@ -611,7 +611,7 @@ void ProjLib_CompProjectedCurve::Init() gp_Pnt Triple, prevTriple; - //Basic loop + //Basic loop while(t <= LastU) { //Search for the begining a new continuous part @@ -660,7 +660,8 @@ void ProjLib_CompProjectedCurve::Init() #ifdef OCCT_DEBUG_CHRONO InitChron(chr_init_point); #endif - initpoint=InitialPoint(CPoint, t,myCurve,mySurface, myTolU, myTolV, U, V); + // PConfusion - use geometric tolerances in extrema / optimization. + initpoint=InitialPoint(CPoint, t,myCurve,mySurface, Precision::PConfusion(), Precision::PConfusion(), U, V); #ifdef OCCT_DEBUG_CHRONO ResultChron(chr_init_point,t_init_point); init_point_count++; @@ -855,10 +856,10 @@ void ProjLib_CompProjectedCurve::Init() (Abs (Triple.Z() - mySurface->FirstVParameter()) < Precision::Confusion() || Abs (Triple.Z() - mySurface->LastVParameter() ) < Precision::Confusion() )) { - // Go out from possible attraktor. - + // Go out from possible attractor. Standard_Real U,V; - InitialPoint(myCurve->Value(t), t, myCurve, mySurface, myTolU, myTolV, U, V); + // PConfusion - use geometric tolerances in extrema / optimization. + InitialPoint(myCurve->Value(t), t, myCurve, mySurface, Precision::PConfusion(), Precision::PConfusion(), U, V); if (Abs (Abs(U - Triple.Y()) - mySurface->UPeriod()) < Precision::Confusion()) { // Handle period jump. diff --git a/tests/bugs/moddata_3/bug27133 b/tests/bugs/moddata_3/bug27133 new file mode 100644 index 0000000000..d988795397 --- /dev/null +++ b/tests/bugs/moddata_3/bug27133 @@ -0,0 +1,23 @@ +puts "================" +puts "0027133" +puts "================" +puts "" +############################################################## +# Incorrect result of the normal projection algorithm +# Oscillation at the edge end +############################################################## + +restore [locate_data_file bug27133_aE.brep] aE +restore [locate_data_file bug27133_aF.brep] aF + +nproject result aE aF + +# Result length check. +checkprops result -l 0.0037337 + +# Visual check. +donly result +smallview +fit +display aE aF +checkview -screenshot -2d -path ${imagedir}/${test_image}.png -- 2.39.5