From 4355f260b009aa4b00e57ee385e1add85e959165 Mon Sep 17 00:00:00 2001 From: emv Date: Thu, 29 Aug 2013 13:30:41 +0400 Subject: [PATCH] 0024065: Wrong intersection point Adding test case for issue CR24065 Small corrections of test cases --- src/IntAna/IntAna_QuadQuadGeo.cxx | 3 ++- tests/bugs/modalg_1/bug10232 | 2 +- tests/bugs/modalg_2/bug239_2 | 2 +- tests/bugs/moddata_3/bug24065 | 30 ++++++++++++++++++++++++++++++ 4 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 tests/bugs/moddata_3/bug24065 diff --git a/src/IntAna/IntAna_QuadQuadGeo.cxx b/src/IntAna/IntAna_QuadQuadGeo.cxx index a951b78d11..e803a1ccb9 100755 --- a/src/IntAna/IntAna_QuadQuadGeo.cxx +++ b/src/IntAna/IntAna_QuadQuadGeo.cxx @@ -326,7 +326,8 @@ gp_Ax2 DirToAx2(const gp_Pnt& P,const gp_Dir& D) Standard_Real denom2 = denom*denom; Standard_Real ddenom = 1. - denom2; - denom = ( Abs(ddenom) <= 1.e-9 ) ? 1.e-9 : ddenom; + //denom = ( Abs(ddenom) <= 1.e-9 ) ? 1.e-9 : ddenom; + denom = ( Abs(ddenom) <= 1.e-16 ) ? 1.e-16 : ddenom; Standard_Real par1 = dist1/denom; Standard_Real par2 = -dist2/denom; diff --git a/tests/bugs/modalg_1/bug10232 b/tests/bugs/modalg_1/bug10232 index 38ceba48e6..9ac6f1985d 100755 --- a/tests/bugs/modalg_1/bug10232 +++ b/tests/bugs/modalg_1/bug10232 @@ -22,7 +22,7 @@ puts "Start boolean operation ..." bopsection result puts "Finish boolean operation ..." -set length 3210.71 +set length 3385.0 set nb_v_good 1197 set nb_e_good 1182 diff --git a/tests/bugs/modalg_2/bug239_2 b/tests/bugs/modalg_2/bug239_2 index ddacd399c9..aa2558a1c9 100755 --- a/tests/bugs/modalg_2/bug239_2 +++ b/tests/bugs/modalg_2/bug239_2 @@ -14,6 +14,6 @@ puts [boptuc result] set nb_v_good 18 set nb_e_good 11 -set length 2481.26 +set length 2434.21 set 2dviewer 0 \ No newline at end of file diff --git a/tests/bugs/moddata_3/bug24065 b/tests/bugs/moddata_3/bug24065 new file mode 100644 index 0000000000..7cc11f8a58 --- /dev/null +++ b/tests/bugs/moddata_3/bug24065 @@ -0,0 +1,30 @@ +puts "========" +puts "OCC24065" +puts "========" +puts "" +####################################################################### +# Wrong intersection point +####################################################################### + +restore [locate_data_file bug24065_f.brep] f +restore [locate_data_file bug24065_e.brep] e + +# 1 +set CMP_TOL 1.e-7 +set facetolmax [tolmax f] +regexp {max tol = ([-0-9.+eE]+)} ${facetolmax} full FaceMaxTolerance +if { ${FaceMaxTolerance} > ${CMP_TOL} } { + puts "Error: invalid tolerance of face" +} + +mksurface s f +mkcurve c e +intersect i c s + +# 2 +set CMP_DIST 1.86835288e-8 +set distmax [projponf f i_2] +regexp {proj dist = ([-0-9.+eE]+)} ${distmax} full MaxDist +if { [expr abs(${MaxDist} - ${CMP_DIST})] > ${CMP_TOL} } { + puts "Error: Wrong intersection point" +}