From: emv Date: Thu, 14 Nov 2013 11:03:06 +0000 (+0400) Subject: 0024290: BOP Section produces incorrect result. X-Git-Tag: V6_7_0~73 X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff_plain;h=df32346f5f3f4e8f335ac46310ac43b0579b2f61 0024290: BOP Section produces incorrect result. Smaller coefficients are used for shrunk range definition for the edge with big tolerance value of its vertices. Test cases for issue CR24290 --- diff --git a/src/BOPInt/BOPInt_ShrunkRange.cxx b/src/BOPInt/BOPInt_ShrunkRange.cxx index 396e45dbf7..7071a4c509 100644 --- a/src/BOPInt/BOPInt_ShrunkRange.cxx +++ b/src/BOPInt/BOPInt_ShrunkRange.cxx @@ -121,7 +121,7 @@ void BOPInt_ShrunkRange::Perform() { Standard_Real aCF, aCL, aTolE, aTolV1, aTolV2, t1, t11, t1C, t2, t12, t2C; - Standard_Real aCoeff, dt1, dt2, aR, anEps; + Standard_Real aCoeff1, aCoeff2, aTol1, aTol2, dt1, dt2, aR, anEps; Standard_Integer pri; Standard_Boolean bInf1, bInf2, bAppr; GeomAbs_CurveType aCurveType; @@ -170,9 +170,17 @@ return; } // - aCoeff=(aTolE>0.05) ? 1. : 2.; + aTol1 = aTolV1+aTolE; + aTol2 = aTolV2+aTolE; + // + aCoeff1 = (aTolE>0.05) ? 1. : 2.; + aCoeff2 = aCoeff1; + if (aCoeff1 == 2.) { + aCoeff1=(aTol1>0.05) ? 1.5 : 2.; + aCoeff2=(aTol2>0.05) ? 1.5 : 2.; + } // xf - if (aCurveType==GeomAbs_Line) { + if (aCurveType==GeomAbs_Line && (aCoeff1 != 1 || aCoeff2 != 1)) { Standard_Real aTV1, aTV2, aEps; gp_Pnt aPV1, aPV2, aPC1, aPC2; gp_Lin aL; @@ -187,13 +195,16 @@ aPV2=BRep_Tool::Pnt(myV2); aTV2=ElCLib::Parameter(aL, aPV2); // - if (fabs(aTV1-aCF)1.99465e+000 +# maxtolerance b_5_2 =>6.77349e+000 +# distmini d b_5_1 b_5_2 =>2.64549 +# Problem: +# The shape tool_1.brep is self-interfered shape. +# In accordance with specification it can not be used as the argument for Boolean Operation Algorithm +# +# Proposals: +# The case should be removed. + +puts "TODO ?OCC22911 ALL: Error : The area of the resulting shape is" + +puts "" +puts "Problem:" +puts " The shape tool_1.brep is self-interfered shape." +puts " In accordance with specification it can not be used as the argument for Boolean Operation Algorithm" +puts "" restore [locate_data_file CTO909_shape.brep] a restore [locate_data_file tool_1.brep] b bfuse result a b -set square 898457 +set square 656459 diff --git a/tests/bugs/modalg_5/bug24290_1 b/tests/bugs/modalg_5/bug24290_1 new file mode 100755 index 0000000000..6279990b7a --- /dev/null +++ b/tests/bugs/modalg_5/bug24290_1 @@ -0,0 +1,13 @@ +puts "================" +puts "OCC24290" +puts "================" +puts "" +####################################################################### +# BOP Section produces incorrect result +####################################################################### + +restore [locate_data_file bug24290_TheFace.brep] b1 +restore [locate_data_file bug24290_TheShape.brep] b2 + +bopcheck b1 +bopcheck b2 diff --git a/tests/bugs/modalg_5/bug24290_2 b/tests/bugs/modalg_5/bug24290_2 new file mode 100755 index 0000000000..493de2f0fc --- /dev/null +++ b/tests/bugs/modalg_5/bug24290_2 @@ -0,0 +1,25 @@ +puts "================" +puts "OCC24290" +puts "================" +puts "" +####################################################################### +# BOP Section produces incorrect result +####################################################################### + +restore [locate_data_file bug24290_TheFace.brep] b1 +restore [locate_data_file bug24290_TheShape.brep] b2 + +bop b1 b2 +bopsection result + +set nb_v_good 6 +set nb_e_good 6 +set nb_w_good 0 +set nb_f_good 0 +set nb_sh_good 0 +set nb_sol_good 0 +set nb_compsol_good 0 +set nb_compound_good 1 +set nb_shape_good 13 + +set 2dviewer 1