1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-26 10:19:45 +03:00

0024844: Wrong result of Boolean Cut operation.

Small correction in intersection between Cone and Torus with collinear axes.

Test case for issue CR24844
This commit is contained in:
emv 2014-04-17 19:03:12 +04:00 committed by abv
parent 2a62d88323
commit 6092c0c8c4
2 changed files with 30 additions and 4 deletions

View File

@ -2083,7 +2083,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Cone& Con,
return; return;
} }
// //
Standard_Real anAngle, aDist, aParam[4]; Standard_Real anAngle, aDist, aParam[4], aDt;
Standard_Integer i; Standard_Integer i;
gp_Pnt aTorLoc, aPCT, aPN, aPt[4]; gp_Pnt aTorLoc, aPCT, aPN, aPt[4];
gp_Dir aDir[4]; gp_Dir aDir[4];
@ -2114,16 +2114,16 @@ void IntAna_QuadQuadGeo::Perform(const gp_Cone& Con,
typeres = IntAna_Circle; typeres = IntAna_Circle;
// //
gp_XYZ aPh = aPCT.XYZ() - aDist*aConL.Normal(aPCT).Direction().XYZ(); 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_Pnt aP;
gp_XYZ aDVal = aDist*aDL.XYZ(); gp_XYZ aDVal = aDt*aDL.XYZ();
aP.SetXYZ(aPh + aDVal); aP.SetXYZ(aPh + aDVal);
aParam[nbint] = aLin.Distance(aP); aParam[nbint] = aLin.Distance(aP);
aPt[nbint].SetXYZ(aP.XYZ() - aParam[nbint]*aXDir.XYZ()); aPt[nbint].SetXYZ(aP.XYZ() - aParam[nbint]*aXDir.XYZ());
aDir[nbint] = aTorAx.Direction(); aDir[nbint] = aTorAx.Direction();
++nbint; ++nbint;
if ((aDist < aRMin) && (aDVal.Modulus() > Tol)) { if ((aDist < aRMin) && (aDt > Tol)) {
aP.SetXYZ(aPh - aDVal); aP.SetXYZ(aPh - aDVal);
aParam[nbint] = aLin.Distance(aP); aParam[nbint] = aLin.Distance(aP);
aPt[nbint].SetXYZ(aP.XYZ() - aParam[nbint]*aXDir.XYZ()); aPt[nbint].SetXYZ(aP.XYZ() - aParam[nbint]*aXDir.XYZ());

View File

@ -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