From: nbv Date: Thu, 11 Sep 2014 12:41:07 +0000 (+0400) Subject: 0025224: The section curve between two cylindrical faces is incomplete X-Git-Tag: V6_8_0_beta~112 X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff_plain;h=e6cd097703fd8687372a756ba2b7c2f0c26fad73 0025224: The section curve between two cylindrical faces is incomplete Algorithm of seeking point on boundaries is amended. Test case for issue CR25224 --- diff --git a/src/IntPatch/IntPatch_ImpImpIntersection_4.gxx b/src/IntPatch/IntPatch_ImpImpIntersection_4.gxx index 3e99f6a14b..3556bcd4bb 100644 --- a/src/IntPatch/IntPatch_ImpImpIntersection_4.gxx +++ b/src/IntPatch/IntPatch_ImpImpIntersection_4.gxx @@ -1834,14 +1834,19 @@ Standard_Boolean IntCyCyTrim( const IntSurf_Quadric& theQuad1, isFirst = Standard_False; } - if(((aUSurf2f-aU21) <= theTol2D) && ((aU21-aUSurf2l) <= theTol2D) && (aVSurf1f <= aV11) && (aV11 <= aVSurf1l) && (aVSurf2f <= aV21) && (aV21 <= aVSurf2l)) + if( ((aUSurf2f-aU21) <= theTol2D) && + ((aU21-aUSurf2l) <= theTol2D) && + ((aVSurf1f - aV11) <= theTol2D) && + ((aV11 - aVSurf1l) <= theTol2D) && + ((aVSurf2f - aV21) <= theTol2D) && ((aV21 - aVSurf2l) <= theTol2D)) { if(!aWL1FindStatus) { Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False; AddBoundaryPoint(theQuad1, theQuad2, aWLine1, anEquationCoeffs, theUVSurf1, theUVSurf2, - theTol2D, aPeriod, aNulValue, anU1, aU21, aV11, aV11Prev, aV21, aV21Prev, isTheReverse, 1.0, isFound1, isFound2); + theTol2D, aPeriod, aNulValue, anU1, aU21, + aV11, aV11Prev, aV21, aV21Prev, isTheReverse, 1.0, isFound1, isFound2); if(isFound1 || isFound2) { @@ -1851,7 +1856,8 @@ Standard_Boolean IntCyCyTrim( const IntSurf_Quadric& theQuad1, if((aWL1FindStatus != 2) || (aWLine1->NbPnts() >= 1)) { - if(AddPointIntoWL(theQuad1, theQuad2, isTheReverse, gp_Pnt2d(anU1, aV11), gp_Pnt2d(aU21, aV21), aUSurf1f, aUSurf1l, aPeriod, aWLine1->Curve(), theTol2D)) + if(AddPointIntoWL(theQuad1, theQuad2, isTheReverse, gp_Pnt2d(anU1, aV11), + gp_Pnt2d(aU21, aV21), aUSurf1f, aUSurf1l, aPeriod, aWLine1->Curve(), theTol2D)) { if(!aWL1FindStatus) { @@ -1874,14 +1880,20 @@ Standard_Boolean IntCyCyTrim( const IntSurf_Quadric& theQuad1, } } - if(((aUSurf2f-aU22) <= theTol2D) && ((aU22-aUSurf2l) <= theTol2D) && (aVSurf1f <= aV12) && (aV12 <= aVSurf1l)&& (aVSurf2f <= aV22) && (aV22 <= aVSurf2l)) + if( ((aUSurf2f-aU22) <= theTol2D) && + ((aU22-aUSurf2l) <= theTol2D) && + ((aVSurf1f - aV12) <= theTol2D) && + ((aV12 - aVSurf1l) <= theTol2D) && + ((aVSurf2f - aV22) <= theTol2D) && + ((aV22 - aVSurf2l) <= theTol2D)) { if(!aWL2FindStatus) { Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False; AddBoundaryPoint(theQuad1, theQuad2, aWLine2, anEquationCoeffs, theUVSurf1, theUVSurf2, - theTol2D, aPeriod, aNulValue, anU1, aU22, aV12, aV12Prev, aV22, aV22Prev, isTheReverse, -1.0, isFound1, isFound2); + theTol2D, aPeriod, aNulValue, anU1, aU22, + aV12, aV12Prev, aV22, aV22Prev, isTheReverse, -1.0, isFound1, isFound2); if(isFound1 || isFound2) { @@ -1891,7 +1903,8 @@ Standard_Boolean IntCyCyTrim( const IntSurf_Quadric& theQuad1, if((aWL2FindStatus != 2) || (aWLine2->NbPnts() >= 1)) { - if(AddPointIntoWL(theQuad1, theQuad2, isTheReverse, gp_Pnt2d(anU1, aV12), gp_Pnt2d(aU22, aV22), aUSurf1f, aUSurf1l, aPeriod, aWLine2->Curve(), theTol2D)) + if(AddPointIntoWL(theQuad1, theQuad2, isTheReverse, gp_Pnt2d(anU1, aV12), + gp_Pnt2d(aU22, aV22), aUSurf1f, aUSurf1l, aPeriod, aWLine2->Curve(), theTol2D)) { if(!aWL2FindStatus) { @@ -1907,7 +1920,8 @@ Standard_Boolean IntCyCyTrim( const IntSurf_Quadric& theQuad1, Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False; AddBoundaryPoint(theQuad1, theQuad2, aWLine2, anEquationCoeffs, theUVSurf1, theUVSurf2, - theTol2D, aPeriod, aNulValue, anU1, aU22, aV12, aV12Prev, aV22, aV22Prev, isTheReverse, -1.0, isFound1, isFound2); + theTol2D, aPeriod, aNulValue, anU1, aU22, + aV12, aV12Prev, aV22, aV22Prev, isTheReverse, -1.0, isFound1, isFound2); if(isFound1 || isFound2) aWL2FindStatus = 2; //start a new line diff --git a/tests/bugs/modalg_5/bug25224 b/tests/bugs/modalg_5/bug25224 new file mode 100755 index 0000000000..c4ad521ca7 --- /dev/null +++ b/tests/bugs/modalg_5/bug25224 @@ -0,0 +1,51 @@ +puts "================" +puts "OCC25224" +puts "================" +puts "" +####################################################################### +# The section curve between two cylindrical faces is incomplete +####################################################################### + +restore [locate_data_file bug25224_Input_5.brep] b1 +restore [locate_data_file bug25224_Input_21.brep] b2 + +# 1. bopcurves +explode b1 f +explode b2 f + +set log [bopcurves b1_1 b2_1] + +regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv +set MaxTol 1.e-7 +if {${Toler} > ${MaxTol}} { + puts "Error: Tolerance is too big!" +} + +regexp {The length c_1 is ([-0-9.+eE]+)} [length c_1] full Curve_Length + +set expected_length 0.52377379499528021 +set tol_abs_length 1.e-7 +set tol_rel_length 0.01 +checkreal "Curve length" ${Curve_Length} ${expected_length} ${tol_abs_length} ${tol_rel_length} + +# 2. BOP +bclearobjects +bcleartools +baddobjects b1 +baddtools b2 +bfillds +bbuild result + +set square 21.4983 + +set nb_v_good 10 +set nb_e_good 19 +set nb_w_good 13 +set nb_f_good 13 +set nb_sh_good 3 +set nb_sol_good 3 +set nb_compsol_good 0 +set nb_compound_good 1 +set nb_shape_good 62 + +set 3dviewer 1