From: aml Date: Thu, 25 Dec 2014 15:11:28 +0000 (+0300) Subject: 0025489: GCPnts_TangentialDeflection gives incorrect distribution of points X-Git-Tag: V6_9_0_beta~213 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=fe790035980fa78921ecfa19e79fccf2e4cf7350;p=occt-copy.git 0025489: GCPnts_TangentialDeflection gives incorrect distribution of points Fixed last point handling: now we try to check interval with last point instead of adding it to output set of points. Test case for issue CR25489 Correction of test case for issue CR25489 --- diff --git a/src/GCPnts/GCPnts_TangentialDeflection.gxx b/src/GCPnts/GCPnts_TangentialDeflection.gxx index c7b3c8177d..bd1353193a 100644 --- a/src/GCPnts/GCPnts_TangentialDeflection.gxx +++ b/src/GCPnts/GCPnts_TangentialDeflection.gxx @@ -438,14 +438,9 @@ void GCPnts_TangentialDeflection::PerformCurve (const TheCurve& C) Du += Min((U2-U1)*(1.-Coef), Du*Us3); U2 = U1 + Du; - //if (U2 >= lastu) U2 = UUU2; - if (U2 >= lastu) { - parameters.Append (lastu); - points .Append (LastPoint); - MorePoints = Standard_False; - Correction = Standard_False; - } - else D0 (C, U2, CurrentPoint); + if (U2 > lastu) + U2 = lastu; + D0 (C, U2, CurrentPoint); } } } diff --git a/tests/bugs/moddata_3/bug25489 b/tests/bugs/moddata_3/bug25489 new file mode 100755 index 0000000000..372d9457d8 --- /dev/null +++ b/tests/bugs/moddata_3/bug25489 @@ -0,0 +1,37 @@ +puts "============" +puts "CR25489" +puts "============" +puts "" +################################################################################### +# GCPnts_TangentialDeflection gives incorrect distribution of points +################################################################################### + +restore [locate_data_file bug25469_bad_tria.brep] a + +subshape a e 8 +mkcurve c a_8 + +set deflection 0.001 +set info [crvtpoints r c ${deflection} pi/6] + +set str1 "Nb points +: +(\[-0-9.+eE\]+)\n" +set str2 "Max defl: +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)" + +regexp "${str1}${str2}" ${info} full Nb dmax ufmax ulmax i + +#-1 +set min_Nb 4 +if { ${Nb} < ${min_Nb} } { + puts "Error : bad value of Nb points=${Nb}" +} + +#-2 +if { ${dmax} > ${deflection} } { + puts "Error : bad value of deflection=${dmax}" +} + +smallview +donly a_8 r_a_8 +fit + +set only_screen_axo 1