From: emv Date: Thu, 17 Apr 2014 15:03:12 +0000 (+0400) Subject: 0024844: Wrong result of Boolean Cut operation. X-Git-Tag: V6_8_0_beta~384 X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff_plain;h=6092c0c8c449f0c30cb642380c250de3767f909b 0024844: Wrong result of Boolean Cut operation. Small correction in intersection between Cone and Torus with collinear axes. Test case for issue CR24844 --- diff --git a/src/IntAna/IntAna_QuadQuadGeo.cxx b/src/IntAna/IntAna_QuadQuadGeo.cxx index 5567a94dd1..f1858acd82 100644 --- a/src/IntAna/IntAna_QuadQuadGeo.cxx +++ b/src/IntAna/IntAna_QuadQuadGeo.cxx @@ -2083,7 +2083,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Cone& Con, return; } // - Standard_Real anAngle, aDist, aParam[4]; + Standard_Real anAngle, aDist, aParam[4], aDt; Standard_Integer i; gp_Pnt aTorLoc, aPCT, aPN, aPt[4]; gp_Dir aDir[4]; @@ -2114,16 +2114,16 @@ void IntAna_QuadQuadGeo::Perform(const gp_Cone& Con, typeres = IntAna_Circle; // gp_XYZ aPh = aPCT.XYZ() - aDist*aConL.Normal(aPCT).Direction().XYZ(); - aDist = Sqrt(Abs(aRMin*aRMin - aDist*aDist)); + aDt = Sqrt(Abs(aRMin*aRMin - aDist*aDist)); // gp_Pnt aP; - gp_XYZ aDVal = aDist*aDL.XYZ(); + gp_XYZ aDVal = aDt*aDL.XYZ(); aP.SetXYZ(aPh + aDVal); aParam[nbint] = aLin.Distance(aP); aPt[nbint].SetXYZ(aP.XYZ() - aParam[nbint]*aXDir.XYZ()); aDir[nbint] = aTorAx.Direction(); ++nbint; - if ((aDist < aRMin) && (aDVal.Modulus() > Tol)) { + if ((aDist < aRMin) && (aDt > Tol)) { aP.SetXYZ(aPh - aDVal); aParam[nbint] = aLin.Distance(aP); aPt[nbint].SetXYZ(aP.XYZ() - aParam[nbint]*aXDir.XYZ()); diff --git a/tests/bugs/modalg_5/bug24844 b/tests/bugs/modalg_5/bug24844 new file mode 100644 index 0000000000..e86cd8d3eb --- /dev/null +++ b/tests/bugs/modalg_5/bug24844 @@ -0,0 +1,26 @@ +puts "============" +puts "OCC24844" +puts "============" +puts "" +###################################################### +# Wrong result of Boolean Cut operation +###################################################### + +restore [locate_data_file bug24844_Comp.brep] c +explode c + +bcut result c_1 c_2 + +set square 9.82018 + +set nb_v_good 5 +set nb_e_good 11 +set nb_w_good 6 +set nb_f_good 6 +set nb_sh_good 1 +set nb_sol_good 1 +set nb_compsol_good 0 +set nb_compound_good 1 +set nb_shape_good 31 + +set 2dviewer 1