From e8feb725a40a7af9bf9b6065919d17f2b8919e9b Mon Sep 17 00:00:00 2001 From: nbv Date: Thu, 4 Dec 2014 11:23:14 +0300 Subject: [PATCH] 0025465: Excess vertex in the result of CUT operation Branches CR25465 and CR25488 were squashed and rebased on the current MASTER (12/01/2014) --- .../IntPatch_ImpImpIntersection_4.gxx | 437 ++++++++++++++---- src/IntPatch/IntPatch_WLine.cdl | 16 +- src/IntPatch/IntPatch_WLine.lxx | 24 + src/IntSurf/IntSurf_PntOn2S.cdl | 1 - tests/bugs/begin | 11 +- tests/bugs/modalg_1/bug16517_1 | 8 +- tests/bugs/modalg_1/bug16517_2 | 8 +- tests/bugs/modalg_2/bug22864 | 12 +- tests/bugs/modalg_2/bug22967 | 4 +- tests/bugs/modalg_2/bug23218 | 2 +- tests/bugs/modalg_5/bug24798 | 8 +- tests/bugs/modalg_5/bug24825_common | 8 +- tests/bugs/modalg_5/bug24825_cut | 6 +- tests/bugs/modalg_5/bug24825_fuse | 6 +- tests/bugs/modalg_5/bug24981 | 6 +- tests/bugs/modalg_5/bug25292_11 | 143 +++--- tests/bugs/modalg_5/bug25292_12 | 149 ++---- tests/bugs/modalg_5/bug25292_13 | 6 +- tests/bugs/modalg_5/bug25292_14 | 10 +- tests/bugs/modalg_5/bug25292_15 | 124 ++++- tests/bugs/modalg_5/bug25292_16 | 127 ++++- tests/bugs/modalg_5/bug25292_21 | 92 ++-- tests/bugs/modalg_5/bug25292_22 | 94 ++-- tests/bugs/modalg_5/bug25292_23 | 7 +- tests/bugs/modalg_5/bug25292_24 | 12 +- tests/bugs/modalg_5/bug25292_25 | 126 ++++- tests/bugs/modalg_5/bug25292_26 | 130 +++++- tests/bugs/modalg_5/bug25292_31 | 77 ++- tests/bugs/modalg_5/bug25292_32 | 79 +++- tests/bugs/modalg_5/bug25292_33 | 125 ++++- tests/bugs/modalg_5/bug25292_34 | 125 ++++- tests/bugs/modalg_5/bug25292_35 | 126 ++++- tests/bugs/modalg_5/bug25292_36 | 126 ++++- tests/bugs/modalg_5/bug25465_1 | 31 ++ tests/bugs/modalg_5/bug25465_2 | 31 ++ 35 files changed, 1786 insertions(+), 511 deletions(-) create mode 100644 tests/bugs/modalg_5/bug25465_1 create mode 100644 tests/bugs/modalg_5/bug25465_2 diff --git a/src/IntPatch/IntPatch_ImpImpIntersection_4.gxx b/src/IntPatch/IntPatch_ImpImpIntersection_4.gxx index c73f08db6e..228c4de6bd 100644 --- a/src/IntPatch/IntPatch_ImpImpIntersection_4.gxx +++ b/src/IntPatch/IntPatch_ImpImpIntersection_4.gxx @@ -1151,6 +1151,7 @@ static Standard_Boolean AddPointIntoWL( const IntSurf_Quadric& theQuad1, const Standard_Real theUlSurf1, const Standard_Real thePeriodOfSurf1, const Handle(IntSurf_LineOn2S)& theLine, + const Standard_Real theTol3D, const Standard_Real theTol2D, const Standard_Boolean theFlForce) { @@ -1177,6 +1178,32 @@ static Standard_Boolean AddPointIntoWL( const IntSurf_Quadric& theQuad1, thePntOnSurf2.X(), thePntOnSurf2.Y()); } + const Standard_Integer aNbPnts = theLine->NbPoints(); + if(aNbPnts > 0) + { + Standard_Real aUl = 0.0, aVl = 0.0; + const IntSurf_PntOn2S aPlast = theLine->Value(aNbPnts); + if(isTheReverse) + aPlast.ParametersOnS2(aUl, aVl); + else + aPlast.ParametersOnS1(aUl, aVl); + + if(anUpar <= aUl) + {//Parameter value will be always increased. + return Standard_False; + } + + //theTol2D is minimal step along parameter changed. + //Therefore, if we apply this minimal step two + //neighbour points will be always "same". Consequently, + //we should reduce tolerance for IsSame checking. + const Standard_Real aDTol = 1.0-Epsilon(1.0); + if(aPnt.IsSame(aPlast, theTol3D*aDTol, theTol2D*aDTol)) + { + theLine->RemovePoint(aNbPnts); + } + } + theLine->Add(aPnt); return Standard_True; } @@ -1191,6 +1218,7 @@ static Standard_Boolean AddBoundaryPoint( const IntSurf_Quadric& theQuad1, const stCoeffsValue& theCoeffs, const Bnd_Box2d& theUVSurf1, const Bnd_Box2d& theUVSurf2, + const Standard_Real theTol3D, const Standard_Real theTol2D, const Standard_Real thePeriod, const Standard_Real theNulValue, @@ -1281,7 +1309,7 @@ static Standard_Boolean AddBoundaryPoint( const IntSurf_Quadric& theQuad1, AddPointIntoWL(theQuad1, theQuad2, isTheReverse, gp_Pnt2d(anUpar1, aV1), gp_Pnt2d(aU2, aV2), aUSurf1f, aUSurf1l, thePeriod, - theWL->Curve(), theTol2D, theFlForce); + theWL->Curve(), theTol3D, theTol2D, theFlForce); } else { @@ -1313,7 +1341,7 @@ static Standard_Boolean AddBoundaryPoint( const IntSurf_Quadric& theQuad1, AddPointIntoWL(theQuad1, theQuad2, isTheReverse, gp_Pnt2d(anUpar2, aV1), gp_Pnt2d(aU2, aV2), aUSurf1f, aUSurf1l, thePeriod, - theWL->Curve(), theTol2D, theFlForce); + theWL->Curve(),theTol3D, theTol2D, theFlForce); } else { @@ -1346,7 +1374,7 @@ static Standard_Boolean AddBoundaryPoint( const IntSurf_Quadric& theQuad1, AddPointIntoWL(theQuad1, theQuad2, isTheReverse, gp_Pnt2d(anUpar2, aV1), gp_Pnt2d(aU2, aV2), aUSurf1f, aUSurf1l, thePeriod, - theWL->Curve(), theTol2D, theFlForce); + theWL->Curve(), theTol3D, theTol2D, theFlForce); } else { @@ -1376,7 +1404,7 @@ static Standard_Boolean AddBoundaryPoint( const IntSurf_Quadric& theQuad1, AddPointIntoWL(theQuad1, theQuad2, isTheReverse, gp_Pnt2d(anUpar1, aV1), gp_Pnt2d(aU2, aV2), aUSurf1f, aUSurf1l, thePeriod, - theWL->Curve(), theTol2D, theFlForce); + theWL->Curve(), theTol3D, theTol2D, theFlForce); } else { @@ -1545,7 +1573,8 @@ static void CriticalPointsComputing(const stCoeffsValue& theCoeffs, { Standard_Real &a = theU1crit[i], &b = theU1crit[i-1]; - if(Abs(a - b) < theTol2D) + const Standard_Real aRemain = fmod(Abs(a - b), thePeriod); // >= 0, because Abs(a - b) >= 0 + if((Abs(a - b) < theTol2D) || (aRemain < theTol2D) || (Abs(aRemain - thePeriod) < theTol2D)) { a = (a + b)/2.0; b = Precision::Infinite(); @@ -1817,6 +1846,7 @@ Standard_Boolean IntCyCyTrim( const IntSurf_Quadric& theQuad1, Standard_Boolean isAddedIntoWL1 = Standard_False, isAddedIntoWL2 = Standard_False; Standard_Real anUf = aU1f[aCurInterval], anUl = aU1l[aCurInterval]; + const Standard_Boolean isDeltaPeriod = IsEqual(anUl-anUf, aPeriod); //Inscribe and sort critical points InscribeAndSortArray(anU1crit, aNbCritPointsMax, anUf, anUl, theTol2D, aPeriod); @@ -1830,6 +1860,8 @@ Standard_Boolean IntCyCyTrim( const IntSurf_Quadric& theQuad1, Handle(IntPatch_WLine) aWLine2 = new IntPatch_WLine(aL2S2, Standard_False); Standard_Integer aWL1FindStatus = 0, aWL2FindStatus = 0; + Standard_Boolean isAddingWL1Enabled = Standard_True, + isAddingWL2Enabled = Standard_True; Standard_Real anU1 = anUf; @@ -1845,6 +1877,23 @@ Standard_Boolean IntCyCyTrim( const IntSurf_Quadric& theQuad1, while(anU1 <= anUl) { + if(isDeltaPeriod) + { + if(IsEqual(anU1, anUl)) + { + //if isAddedIntoWL* == TRUE WLine contains only one point + //(which was end point of previous WLine). If we will + //add point found on the current step WLine will contain only + //two points. At that both these points will be equal to the + //points found earlier. Therefore, new WLine will repeat + //already existing WLine. Consequently, it is necessary + //to forbid building new line in this case. + + isAddingWL1Enabled = !isAddedIntoWL1; + isAddingWL2Enabled = !isAddedIntoWL2; + } + } + for(Standard_Integer i = 0; i < aNbCritPointsMax; i++) { if((anU1 - anU1crit[i])*aCriticalDelta[i] < 0.0) @@ -1995,123 +2044,129 @@ Standard_Boolean IntCyCyTrim( const IntSurf_Quadric& theQuad1, isFirst = Standard_False; } - if( ((aUSurf2f-aU21) <= theTol2D) && - ((aU21-aUSurf2l) <= theTol2D) && - ((aVSurf1f - aV11) <= theTol2D) && - ((aV11 - aVSurf1l) <= theTol2D) && - ((aVSurf2f - aV21) <= theTol2D) && ((aV21 - aVSurf2l) <= theTol2D)) + if(isAddingWL1Enabled) { - Standard_Boolean isForce = Standard_False; - if(!aWL1FindStatus) + if( ((aUSurf2f-aU21) <= theTol2D) && + ((aU21-aUSurf2l) <= theTol2D) && + ((aVSurf1f - aV11) <= theTol2D) && + ((aV11 - aVSurf1l) <= theTol2D) && + ((aVSurf2f - aV21) <= theTol2D) && ((aV21 - aVSurf2l) <= theTol2D)) { - Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False; - - if(((aUSurf2l - aUSurf2f) >= aPeriod) && (Abs(anU1-aUSurf1l) < theTol2D)) + Standard_Boolean isForce = Standard_False; + if(!aWL1FindStatus) { - isForce = Standard_True; - } + 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, isForce, isFound1, isFound2); + if(((aUSurf2l - aUSurf2f) >= aPeriod) && (Abs(anU1-aUSurf1l) < theTol2D)) + { + isForce = Standard_True; + } + + AddBoundaryPoint(theQuad1, theQuad2, aWLine1, anEquationCoeffs, + theUVSurf1, theUVSurf2, theTol3D, theTol2D, aPeriod, + aNulValue, anU1, aU21, aV11, aV11Prev, + aV21, aV21Prev, isTheReverse, + 1.0, isForce, isFound1, isFound2); - if(isFound1 || isFound2) - { - aWL1FindStatus = 1; - } - } - - 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, isForce)) - { - if(!aWL1FindStatus) + if(isFound1 || isFound2) { aWL1FindStatus = 1; } } + + if((aWL1FindStatus != 2) || (aWLine1->NbPnts() >= 1)) + { + if(AddPointIntoWL(theQuad1, theQuad2, isTheReverse, + gp_Pnt2d(anU1, aV11), gp_Pnt2d(aU21, aV21), + aUSurf1f, aUSurf1l, aPeriod, + aWLine1->Curve(), theTol3D, theTol2D, isForce)) + { + if(!aWL1FindStatus) + { + aWL1FindStatus = 1; + } + } + } } - } - else - { - if(aWL1FindStatus == 1) + else { - Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False; + if(aWL1FindStatus == 1) + { + 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, Standard_False, isFound1, isFound2); + AddBoundaryPoint(theQuad1, theQuad2, aWLine1, anEquationCoeffs, + theUVSurf1, theUVSurf2, theTol3D, theTol2D, aPeriod, + aNulValue, anU1, aU21, aV11, aV11Prev, + aV21, aV21Prev, isTheReverse, + 1.0, Standard_False, isFound1, isFound2); - if(isFound1 || isFound2) - aWL1FindStatus = 2; //start a new line + if(isFound1 || isFound2) + aWL1FindStatus = 2; //start a new line + } } } - if( ((aUSurf2f-aU22) <= theTol2D) && - ((aU22-aUSurf2l) <= theTol2D) && - ((aVSurf1f - aV12) <= theTol2D) && - ((aV12 - aVSurf1l) <= theTol2D) && - ((aVSurf2f - aV22) <= theTol2D) && - ((aV22 - aVSurf2l) <= theTol2D)) + if(isAddingWL2Enabled) { - Standard_Boolean isForce = Standard_False; - - if(!aWL2FindStatus) + if( ((aUSurf2f-aU22) <= theTol2D) && + ((aU22-aUSurf2l) <= theTol2D) && + ((aVSurf1f - aV12) <= theTol2D) && + ((aV12 - aVSurf1l) <= theTol2D) && + ((aVSurf2f - aV22) <= theTol2D) && + ((aV22 - aVSurf2l) <= theTol2D)) { - Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False; + Standard_Boolean isForce = Standard_False; - if(((aUSurf2l - aUSurf2f) >= aPeriod) && (Abs(anU1-aUSurf1l) < theTol2D)) + if(!aWL2FindStatus) { - isForce = Standard_True; - } + 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, isForce, isFound1, isFound2); + if(((aUSurf2l - aUSurf2f) >= aPeriod) && (Abs(anU1-aUSurf1l) < theTol2D)) + { + isForce = Standard_True; + } + + AddBoundaryPoint(theQuad1, theQuad2, aWLine2, anEquationCoeffs, + theUVSurf1, theUVSurf2, theTol3D, theTol2D, aPeriod, + aNulValue, anU1, aU22, aV12, aV12Prev, + aV22, aV22Prev, isTheReverse, + -1.0, isForce, isFound1, isFound2); - if(isFound1 || isFound2) - { - aWL2FindStatus = 1; - } - } - - 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, isForce)) - { - if(!aWL2FindStatus) + if(isFound1 || isFound2) { aWL2FindStatus = 1; } } + + if((aWL2FindStatus != 2) || (aWLine2->NbPnts() >= 1)) + { + if(AddPointIntoWL(theQuad1, theQuad2, isTheReverse, + gp_Pnt2d(anU1, aV12), gp_Pnt2d(aU22, aV22), + aUSurf1f, aUSurf1l, aPeriod, + aWLine2->Curve(), theTol3D, theTol2D, isForce)) + { + if(!aWL2FindStatus) + { + aWL2FindStatus = 1; + } + } + } } - } - else - { - if(aWL2FindStatus == 1) + else { - Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False; + if(aWL2FindStatus == 1) + { + 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, Standard_False, isFound1, isFound2); + AddBoundaryPoint(theQuad1, theQuad2, aWLine2, anEquationCoeffs, + theUVSurf1, theUVSurf2, theTol3D, theTol2D, aPeriod, + aNulValue, anU1, aU22, aV12, aV12Prev, + aV22, aV22Prev, isTheReverse, + -1.0, Standard_False, isFound1, isFound2); - if(isFound1 || isFound2) - aWL2FindStatus = 2; //start a new line + if(isFound1 || isFound2) + aWL2FindStatus = 2; //start a new line + } } } @@ -2252,7 +2307,6 @@ Standard_Boolean IntCyCyTrim( const IntSurf_Quadric& theQuad1, { isTheEmpty = Standard_False; isAddedIntoWL1 = Standard_True; - SeekAdditionalPoints( theQuad1, theQuad2, aWLine1->Curve(), anEquationCoeffs, aNbPoints, aUSurf2f, aUSurf2l, theTol2D, aPeriod, 1.0, isTheReverse); @@ -2311,6 +2365,203 @@ Standard_Boolean IntCyCyTrim( const IntSurf_Quadric& theQuad1, } } + if(theSlin.Length() > 0) + { + for(Standard_Integer aNumOfLine = 2; aNumOfLine <= theSlin.Length(); aNumOfLine++) + { + const Handle(IntPatch_WLine)& aWLine = Handle(IntPatch_WLine)::DownCast(theSlin.Value(aNumOfLine)); + + const IntSurf_PntOn2S& aPntFWL = aWLine->Point(1); + + Standard_Real aU1 = 0.0, aU2 = 0.0, aV1 = 0.0, aV2 = 0.0; + aPntFWL.Parameters(aU1, aV1, aU2, aV2); + + if( IsEqual(aU1, 0.0) || IsEqual(aU1, aPeriod)) + { + theSlin.Exchange(1, aNumOfLine); + break; + } + } + + for(Standard_Integer aNumOfLine1 = 1; aNumOfLine1 <= theSlin.Length(); aNumOfLine1++) + { + const Handle(IntPatch_WLine)& aWLine1 = Handle(IntPatch_WLine)::DownCast(theSlin.Value(aNumOfLine1)); + + const Standard_Integer aNbPntsWL1 = aWLine1->NbPnts(); + const IntSurf_PntOn2S& aPntFWL1 = aWLine1->Point(1); + const IntSurf_PntOn2S& aPntLWL1 = aWLine1->Point(aNbPntsWL1); + + for(Standard_Integer aNPt = 1; aNPt <= theSPnt.Length(); aNPt++) + { + const IntSurf_PntOn2S aPntCur = theSPnt.Value(aNPt).PntOn2S(); + + if( aPntCur.IsSame(aPntFWL1, Precision::Confusion()) || + aPntCur.IsSame(aPntLWL1, Precision::Confusion())) + { + theSPnt.Remove(aNPt); + aNPt--; + } + } + + Standard_Boolean hasBeenRemoved = Standard_False; + for(Standard_Integer aNumOfLine2 = aNumOfLine1 + 1; aNumOfLine2 <= theSlin.Length(); aNumOfLine2++) + { + const Handle(IntPatch_WLine)& aWLine2 = Handle(IntPatch_WLine)::DownCast(theSlin.Value(aNumOfLine2)); + + const Standard_Integer aNbPntsWL1 = aWLine1->NbPnts(); + const Standard_Integer aNbPntsWL2 = aWLine2->NbPnts(); + + const IntSurf_PntOn2S& aPntFWL1 = aWLine1->Point(1); + const IntSurf_PntOn2S& aPntLWL1 = aWLine1->Point(aNbPntsWL1); + + const IntSurf_PntOn2S& aPntFWL2 = aWLine2->Point(1); + const IntSurf_PntOn2S& aPntLWL2 = aWLine2->Point(aNbPntsWL2); + + if(aPntFWL1.IsSame(aPntFWL2, Precision::Confusion())) + { + Standard_Real aU11 = 0.0, aU12 = 0.0, aV11 = 0.0, aV12 = 0.0; + Standard_Real aU21 = 0.0, aU22 = 0.0, aV21 = 0.0, aV22 = 0.0; + + aPntFWL1.Parameters(aU11, aV11, aU12, aV12); + aPntFWL2.Parameters(aU21, aV21, aU22, aV22); + + if( !(IsEqual(fmod(aU11, aPeriod), 0.0) || + IsEqual(fmod(aU12, aPeriod), 0.0) || + IsEqual(fmod(aU21, aPeriod), 0.0) || + IsEqual(fmod(aU22, aPeriod), 0.0) || + IsEqual(aU11, aUSurf1f) || IsEqual(aU11, aUSurf1l) || + IsEqual(aU21, aUSurf1f) || IsEqual(aU21, aUSurf1l) || + IsEqual(aU12, aUSurf2f) || IsEqual(aU12, aUSurf2l) || + IsEqual(aU22, aUSurf2f) || IsEqual(aU22, aUSurf2l))) + { + aWLine1->ClearVertexes(); + for(Standard_Integer aNPt = 1; aNPt <= aNbPntsWL2; aNPt++) + { + const IntSurf_PntOn2S& aPt = aWLine2->Point(aNPt); + aWLine1->Curve()->InsertBefore(1, aPt); + } + + aWLine1->ComputeVertexParameters(theTol3D); + + theSlin.Remove(aNumOfLine2); + aNumOfLine2--; + hasBeenRemoved = Standard_True; + + continue; + } + } + + if(aPntFWL1.IsSame(aPntLWL2, Precision::Confusion())) + { + Standard_Real aU11 = 0.0, aU12 = 0.0, aV11 = 0.0, aV12 = 0.0; + Standard_Real aU21 = 0.0, aU22 = 0.0, aV21 = 0.0, aV22 = 0.0; + + aPntFWL1.Parameters(aU11, aV11, aU12, aV12); + aPntLWL2.Parameters(aU21, aV21, aU22, aV22); + + if( !(IsEqual(fmod(aU11, aPeriod), 0.0) || + IsEqual(fmod(aU12, aPeriod), 0.0) || + IsEqual(fmod(aU21, aPeriod), 0.0) || + IsEqual(fmod(aU22, aPeriod), 0.0) || + IsEqual(aU11, aUSurf1f) || IsEqual(aU11, aUSurf1l) || + IsEqual(aU21, aUSurf1f) || IsEqual(aU21, aUSurf1l) || + IsEqual(aU12, aUSurf2f) || IsEqual(aU12, aUSurf2l) || + IsEqual(aU22, aUSurf2f) || IsEqual(aU22, aUSurf2l))) + { + aWLine1->ClearVertexes(); + for(Standard_Integer aNPt = aNbPntsWL2; aNPt >= 1; aNPt--) + { + const IntSurf_PntOn2S& aPt = aWLine2->Point(aNPt); + aWLine1->Curve()->InsertBefore(1, aPt); + } + + aWLine1->ComputeVertexParameters(theTol3D); + + theSlin.Remove(aNumOfLine2); + aNumOfLine2--; + hasBeenRemoved = Standard_True; + + continue; + } + } + + if(aPntLWL1.IsSame(aPntFWL2, Precision::Confusion())) + { + Standard_Real aU11 = 0.0, aU12 = 0.0, aV11 = 0.0, aV12 = 0.0; + Standard_Real aU21 = 0.0, aU22 = 0.0, aV21 = 0.0, aV22 = 0.0; + + aPntLWL1.Parameters(aU11, aV11, aU12, aV12); + aPntFWL2.Parameters(aU21, aV21, aU22, aV22); + + if( !(IsEqual(fmod(aU11, aPeriod), 0.0) || + IsEqual(fmod(aU12, aPeriod), 0.0) || + IsEqual(fmod(aU21, aPeriod), 0.0) || + IsEqual(fmod(aU22, aPeriod), 0.0) || + IsEqual(aU11, aUSurf1f) || IsEqual(aU11, aUSurf1l) || + IsEqual(aU21, aUSurf1f) || IsEqual(aU21, aUSurf1l) || + IsEqual(aU12, aUSurf2f) || IsEqual(aU12, aUSurf2l) || + IsEqual(aU22, aUSurf2f) || IsEqual(aU22, aUSurf2l))) + { + aWLine1->ClearVertexes(); + for(Standard_Integer aNPt = 1; aNPt <= aNbPntsWL2; aNPt++) + { + const IntSurf_PntOn2S& aPt = aWLine2->Point(aNPt); + aWLine1->Curve()->Add(aPt); + } + + aWLine1->ComputeVertexParameters(theTol3D); + + theSlin.Remove(aNumOfLine2); + aNumOfLine2--; + hasBeenRemoved = Standard_True; + + continue; + } + } + + if(aPntLWL1.IsSame(aPntLWL2, Precision::Confusion())) + { + Standard_Real aU11 = 0.0, aU12 = 0.0, aV11 = 0.0, aV12 = 0.0; + Standard_Real aU21 = 0.0, aU22 = 0.0, aV21 = 0.0, aV22 = 0.0; + + aPntLWL1.Parameters(aU11, aV11, aU12, aV12); + aPntLWL2.Parameters(aU21, aV21, aU22, aV22); + + if( !(IsEqual(fmod(aU11, aPeriod), 0.0) || + IsEqual(fmod(aU12, aPeriod), 0.0) || + IsEqual(fmod(aU21, aPeriod), 0.0) || + IsEqual(fmod(aU22, aPeriod), 0.0) || + IsEqual(aU11, aUSurf1f) || IsEqual(aU11, aUSurf1l) || + IsEqual(aU21, aUSurf1f) || IsEqual(aU21, aUSurf1l) || + IsEqual(aU12, aUSurf2f) || IsEqual(aU12, aUSurf2l) || + IsEqual(aU22, aUSurf2f) || IsEqual(aU22, aUSurf2l))) + { + aWLine1->ClearVertexes(); + for(Standard_Integer aNPt = aNbPntsWL2; aNPt >= 1; aNPt--) + { + const IntSurf_PntOn2S& aPt = aWLine2->Point(aNPt); + aWLine1->Curve()->Add(aPt); + } + + aWLine1->ComputeVertexParameters(theTol3D); + + theSlin.Remove(aNumOfLine2); + aNumOfLine2--; + hasBeenRemoved = Standard_True; + + continue; + } + } + } + + if(hasBeenRemoved) + aNumOfLine1--; + + //aWLine1->ComputeVertexParameters(theTol3D); + } + }//if(theSlin.Length() > 0) + + return Standard_True; } diff --git a/src/IntPatch/IntPatch_WLine.cdl b/src/IntPatch/IntPatch_WLine.cdl index eec3ec1805..9bf5921737 100644 --- a/src/IntPatch/IntPatch_WLine.cdl +++ b/src/IntPatch/IntPatch_WLine.cdl @@ -309,9 +309,21 @@ is ---C++: return const& returns HCurve2d from Adaptor2d; - Dump(me) + ClearVertexes(me: mutable) + is static; - is static; + RemoveVertex(me: mutable; + theIndex : Integer from Standard) + is static; + + InsertVertexBefore(me: mutable; + theIndex : Integer from Standard; + thePnt : Point from IntPatch) + is static; + + Dump(me) + + is static; fields diff --git a/src/IntPatch/IntPatch_WLine.lxx b/src/IntPatch/IntPatch_WLine.lxx index ed1c128fce..123bd2f1f8 100644 --- a/src/IntPatch/IntPatch_WLine.lxx +++ b/src/IntPatch/IntPatch_WLine.lxx @@ -97,3 +97,27 @@ inline const IntPatch_Point& IntPatch_WLine::Vertex (const Standard_Integer Inde { return svtx(Index); } + +inline void IntPatch_WLine::ClearVertexes() +{ + svtx.Clear(); +} + +inline void IntPatch_WLine::RemoveVertex(const Standard_Integer theIndex) +{ + if((theIndex < 1) || (theIndex > NbVertex())) + Standard_OutOfRange::Raise("Cannot delete not existing vertex"); + svtx.Remove(theIndex); +} + +inline void IntPatch_WLine::InsertVertexBefore( const Standard_Integer theIndex, + const IntPatch_Point& thePnt) +{ + const Standard_Integer aNbVertexes = NbVertex(); + Standard_Integer anIndex = Max(theIndex, 1); + + if(anIndex > aNbVertexes) + svtx.Append(thePnt); + else + svtx.InsertBefore(theIndex, thePnt); +} diff --git a/src/IntSurf/IntSurf_PntOn2S.cdl b/src/IntSurf/IntSurf_PntOn2S.cdl index f3943d3eb3..04764c3c91 100644 --- a/src/IntSurf/IntSurf_PntOn2S.cdl +++ b/src/IntSurf/IntSurf_PntOn2S.cdl @@ -128,7 +128,6 @@ is returns Boolean from Standard; - fields pt : Pnt from gp; diff --git a/tests/bugs/begin b/tests/bugs/begin index 10c93fc92d..a32272142e 100755 --- a/tests/bugs/begin +++ b/tests/bugs/begin @@ -253,7 +253,7 @@ proc CheckTriArea {shape {eps 0}} { } # Check if list of xdistcs-command is valid -proc checkList {List Tolerance D_good} { +proc checkList {List Tolerance D_good Limit_Tol} { set L1 [llength ${List}] set L2 10 set L3 5 @@ -266,7 +266,14 @@ proc checkList {List Tolerance D_good} { set D [lindex ${List} ${j2}] #puts "i=${i} j1=${j1} j2=${j2} T=${T} D=${D}" if { [expr abs(${D} - ${D_good})] > ${Tolerance} } { - puts "Error: i=${i} T=${T} D=${D}" + puts "Error : T=${T} D=${D}" + } + + if { ${Tolerance} > ${Limit_Tol} } { + if { [expr abs(${D} - ${D_good})] > ${Limit_Tol} + && [expr abs(${D} - ${D_good})] <= ${Tolerance} } { + puts "Attention (critical value of tolerance) : T=${T} D=${D}" + } } } } diff --git a/tests/bugs/modalg_1/bug16517_1 b/tests/bugs/modalg_1/bug16517_1 index e8c776d4c5..bb2ddb036b 100755 --- a/tests/bugs/modalg_1/bug16517_1 +++ b/tests/bugs/modalg_1/bug16517_1 @@ -22,16 +22,16 @@ if { ${Result_Numbers} != 2 } { renamevar p_1 result set status 0 - set length 110.161 - set nb_v_good 4 - set nb_e_good 4 + set length 110.167 + set nb_v_good 1 + set nb_e_good 1 set nb_w_good 1 set nb_f_good 0 set nb_sh_good 0 set nb_sol_good 0 set nb_compsol_good 0 set nb_compound_good 0 - set nb_shape_good 9 + set nb_shape_good 3 } if { ${mistake} != 0 } { diff --git a/tests/bugs/modalg_1/bug16517_2 b/tests/bugs/modalg_1/bug16517_2 index db0aec0ec6..6a1e214c0c 100755 --- a/tests/bugs/modalg_1/bug16517_2 +++ b/tests/bugs/modalg_1/bug16517_2 @@ -22,16 +22,16 @@ if { ${Result_Numbers} != 2 } { renamevar p_2 result set status 0 - set length 110.171 - set nb_v_good 4 - set nb_e_good 4 + set length 110.167 + set nb_v_good 1 + set nb_e_good 1 set nb_w_good 1 set nb_f_good 0 set nb_sh_good 0 set nb_sol_good 0 set nb_compsol_good 0 set nb_compound_good 0 - set nb_shape_good 9 + set nb_shape_good 3 } # Resume diff --git a/tests/bugs/modalg_2/bug22864 b/tests/bugs/modalg_2/bug22864 index eb0569f0e7..a6162db40d 100755 --- a/tests/bugs/modalg_2/bug22864 +++ b/tests/bugs/modalg_2/bug22864 @@ -18,15 +18,15 @@ add f2 aShape # set status 0 # -set nb_v_good 8 -set nb_e_good 12 -set nb_w_good 4 -set nb_f_good 4 +set nb_v_good 2 +set nb_e_good 3 +set nb_w_good 1 +set nb_f_good 1 set nb_sh_good 0 set nb_sol_good 0 set nb_compsol_good 0 set nb_compound_good 1 -set nb_shape_good 29 +set nb_shape_good 8 # set Numbers 11 # @@ -95,7 +95,7 @@ if {${status} == 0} { puts "Faulty ${BugNumber}" } -set square 8444.76 +set square 6606.88 set 2dviewer 0 diff --git a/tests/bugs/modalg_2/bug22967 b/tests/bugs/modalg_2/bug22967 index b650a34805..08115ced95 100755 --- a/tests/bugs/modalg_2/bug22967 +++ b/tests/bugs/modalg_2/bug22967 @@ -7,7 +7,7 @@ puts "" ########################################################################################################### set BugNumber OCC22967 -set check_value 3.46945e-006 +set check_value 8.46459e-006 restore [locate_data_file bug22967_Cylinder_1.brep] b1 restore [locate_data_file bug22967_Scale_1.brep] b2 @@ -54,6 +54,6 @@ if {${status} > 0} { puts "OK ${BugNumber}" } -set square 669221 +set square 668843 set 2dviewer 0 diff --git a/tests/bugs/modalg_2/bug23218 b/tests/bugs/modalg_2/bug23218 index 4801d16559..7039562cca 100755 --- a/tests/bugs/modalg_2/bug23218 +++ b/tests/bugs/modalg_2/bug23218 @@ -19,7 +19,7 @@ set result [bopcurves b1 b2] puts $result puts "Finish project operation ..." -set GoodToleranceReached 2.4950140688989345e-006 +set GoodToleranceReached 6.3315853638232248e-007 regexp {Tolerance Reached=([-0-9.+eE]+)} $result full ToleranceReached proc GetPercent {Value GoodValue} { diff --git a/tests/bugs/modalg_5/bug24798 b/tests/bugs/modalg_5/bug24798 index 6b40a0a1a8..916a5b28e1 100644 --- a/tests/bugs/modalg_5/bug24798 +++ b/tests/bugs/modalg_5/bug24798 @@ -12,17 +12,17 @@ restore [locate_data_file bug24798_rectBranch.brep] b2 bop b1 b2 bopcut result -set square 1826.15 +set square 1826.16 # Analysis of "nbshapes res" -set nb_v_good 49 -set nb_e_good 72 +set nb_v_good 44 +set nb_e_good 67 set nb_w_good 29 set nb_f_good 22 set nb_sh_good 1 set nb_sol_good 1 set nb_compsol_good 0 set nb_compound_good 1 -set nb_shape_good 175 +set nb_shape_good 165 set 2dviewer 1 diff --git a/tests/bugs/modalg_5/bug24825_common b/tests/bugs/modalg_5/bug24825_common index 2ab24c6a34..d66bc41dc6 100644 --- a/tests/bugs/modalg_5/bug24825_common +++ b/tests/bugs/modalg_5/bug24825_common @@ -43,16 +43,16 @@ baddctools b7 bfillds bbop result 0 -set square 10008.5 +set square 10008.9 -set nb_v_good 260 -set nb_e_good 306 +set nb_v_good 140 +set nb_e_good 186 set nb_w_good 126 set nb_f_good 126 set nb_sh_good 40 set nb_sol_good 40 set nb_compsol_good 0 set nb_compound_good 1 -set nb_shape_good 899 +set nb_shape_good 659 set 2dviewer 1 diff --git a/tests/bugs/modalg_5/bug24825_cut b/tests/bugs/modalg_5/bug24825_cut index 311d737808..a36b052b1f 100644 --- a/tests/bugs/modalg_5/bug24825_cut +++ b/tests/bugs/modalg_5/bug24825_cut @@ -45,14 +45,14 @@ bbop result 2 set square 103838 -set nb_v_good 280 -set nb_e_good 338 +set nb_v_good 160 +set nb_e_good 218 set nb_w_good 142 set nb_f_good 80 set nb_sh_good 3 set nb_sol_good 3 set nb_compsol_good 0 set nb_compound_good 1 -set nb_shape_good 847 +set nb_shape_good 607 set 2dviewer 1 diff --git a/tests/bugs/modalg_5/bug24825_fuse b/tests/bugs/modalg_5/bug24825_fuse index b9e5b38451..f9ce0fdfa5 100644 --- a/tests/bugs/modalg_5/bug24825_fuse +++ b/tests/bugs/modalg_5/bug24825_fuse @@ -46,14 +46,14 @@ bbop result 1 set square 157211 -set nb_v_good 280 -set nb_e_good 338 +set nb_v_good 160 +set nb_e_good 218 set nb_w_good 142 set nb_f_good 80 set nb_sh_good 1 set nb_sol_good 1 set nb_compsol_good 0 set nb_compound_good 1 -set nb_shape_good 843 +set nb_shape_good 603 set 2dviewer 1 diff --git a/tests/bugs/modalg_5/bug24981 b/tests/bugs/modalg_5/bug24981 index 3abc5dfb35..42daa4eea3 100644 --- a/tests/bugs/modalg_5/bug24981 +++ b/tests/bugs/modalg_5/bug24981 @@ -20,14 +20,14 @@ baddtools b_1 b_2 b_3 b_4 b_5 b_6 b_7 b_8 b_9 b_10 b_11 b_12 b_13 b_14 b_15 b_16 bfillds bbuild result -set nb_v_good 268 -set nb_e_good 366 +set nb_v_good 170 +set nb_e_good 268 set nb_w_good 243 set nb_f_good 195 set nb_sh_good 75 set nb_sol_good 75 set nb_compsol_good 0 set nb_compound_good 1 -set nb_shape_good 1223 +set nb_shape_good 1027 set 2dviewer 1 diff --git a/tests/bugs/modalg_5/bug25292_11 b/tests/bugs/modalg_5/bug25292_11 index 5bc75c410e..cd6294ed86 100644 --- a/tests/bugs/modalg_5/bug25292_11 +++ b/tests/bugs/modalg_5/bug25292_11 @@ -6,6 +6,12 @@ puts "" # Face/Face intersection algorithm gives different results for different order of the arguments ####################################################################### +puts "##############################" +puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!" +puts "##############################" +puts "" +puts "" + # bopcurves command restore [locate_data_file bug25292_Input_0.brep] b1 @@ -21,11 +27,17 @@ set log [bopcurves f1 f2 -2d] ############################# regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv + +#This value must be equal to the analogical value in bug25292_11 and bug25292_12 of "bugs modalg_5" testgrid. set MaxTol 1.e-7 + +#This value must be equal to the analogical value in bug25292_11, bug25292_12, bug25292_15 and bug25292_16 of "bugs modalg_5" testgrid. +set GoodNbCurv 4 + if {${Toler} > ${MaxTol}} { puts "Error: Tolerance is too big!" } -set GoodNbCurv 7 + if {${NbCurv} != ${GoodNbCurv}} { puts "Error: Curve Number is bad!" } @@ -34,105 +46,54 @@ if {${NbCurv} != ${GoodNbCurv}} { # 1 puts "" -puts "First curve" mksurface s1 f1 mksurface s2 f2 -dlog reset -dlog on -xdistcs c_1 s1 0 1 10 -set Log1 [dlog get] +for {set i 1} {$i <= ${NbCurv}} {incr i} { + set log [dump c_$i] + + regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles + puts "Degree=${Degree}" + puts "Poles=${Poles}" + puts "KnotsPoles=${KnotsPoles}" + puts "" -set List1 [split ${Log1} {TD= \t\n}] -set Tolerance 1.0e-7 -set D_good 0. -checkList ${List1} ${Tolerance} ${D_good} + set Knot 1 + set exp_string "Knots :\n\n +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)" + regexp ${exp_string} ${log} full U1 Mult1 -# 2 -puts "" -puts "Second curve" + set Knot ${KnotsPoles} + set exp_string " +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)" + regexp ${exp_string} ${log} full U2 Mult2 -dlog reset -dlog on -xdistcs c_2 s1 0 1 10 -set Log2 [dlog get] + puts "U1=${U1}" + puts "U2=${U2}" + + if {[expr {$U2 - $U1}] < 1.0e-20} { + puts "Error: Wrong curve's range!" + } -set List2 [split ${Log2} {TD= \t\n}] -set Tolerance 1.0e-7 -set D_good 0. -checkList ${List2} ${Tolerance} ${D_good} - -# 3 -puts "" -puts "Third curve" - -dlog reset -dlog on -xdistcs c_3 s1 0 1 10 -set Log3 [dlog get] - -set List3 [split ${Log3} {TD= \t\n}] -set Tolerance 1.0e-7 -set D_good 0. -checkList ${List3} ${Tolerance} ${D_good} - -# 4 -puts "" -puts "Fourth curve" - -dlog reset -dlog on -xdistcs c_4 s1 0 1 10 -set Log4 [dlog get] - -set List4 [split ${Log4} {TD= \t\n}] -set Tolerance 1.0e-7 -set D_good 0. -checkList ${List4} ${Tolerance} ${D_good} - -# 5 -puts "" -puts "Fifth curve" - -dlog reset -dlog on -xdistcs c_5 s1 0 1 10 -set Log5 [dlog get] - -set List5 [split ${Log5} {TD= \t\n}] -set Tolerance 1.0e-7 -set D_good 0. -checkList ${List5} ${Tolerance} ${D_good} - -# 6 -puts "" -puts "Sixth curve" - -dlog reset -dlog on -xdistcs c_6 s1 0 1 10 -set Log6 [dlog get] - -set List6 [split ${Log6} {TD= \t\n}] -set Tolerance 1.0e-7 -set D_good 0. -checkList ${List6} ${Tolerance} ${D_good} - -# 7 -puts "" -puts "Seventh curve" - -dlog reset -dlog on -xdistcs c_7 s1 0 1 10 -set Log7 [dlog get] - -set List7 [split ${Log7} {TD= \t\n}] -set Tolerance 1.0e-7 -set D_good 0. -checkList ${List7} ${Tolerance} ${D_good} + dlog reset + dlog on + xdistcs c_$i s1 ${U1} ${U2} 10 + set Log2 [dlog get] + set List2 [split ${Log2} {TD= \t\n}] + set Tolerance 1.0e-7 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol} + dlog reset + dlog on + xdistcs c_$i s2 ${U1} ${U2} 10 + set Log2 [dlog get] + set List2 [split ${Log2} {TD= \t\n}] + set Tolerance 1.0e-7 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol} +} v2d 2dfit diff --git a/tests/bugs/modalg_5/bug25292_12 b/tests/bugs/modalg_5/bug25292_12 index 98e21c5776..f9fdf520ee 100644 --- a/tests/bugs/modalg_5/bug25292_12 +++ b/tests/bugs/modalg_5/bug25292_12 @@ -1,5 +1,3 @@ -puts "TODO OCC225404 Debian60-64 Windows: Error: Curve Number is bad!" - puts "================" puts "OCC25292" puts "================" @@ -8,6 +6,12 @@ puts "" # Face/Face intersection algorithm gives different results for different order of the arguments ####################################################################### +puts "##############################" +puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!" +puts "##############################" +puts "" +puts "" + # bopcurves command restore [locate_data_file bug25292_Input_0.brep] b1 @@ -23,11 +27,17 @@ set log [bopcurves f2 f1 -2d] ############################# regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv + +#This value must be equal to the analogical value in bug25292_11 and bug25292_12 of "bugs modalg_5" testgrid. set MaxTol 1.e-7 + +#This value must be equal to the analogical value in bug25292_11, bug25292_12, bug25292_15 and bug25292_16 of "bugs modalg_5" testgrid. +set GoodNbCurv 4 + if {${Toler} > ${MaxTol}} { puts "Error: Tolerance is too big!" } -set GoodNbCurv 7 + if {${NbCurv} != ${GoodNbCurv}} { puts "Error: Curve Number is bad!" } @@ -36,112 +46,55 @@ if {${NbCurv} != ${GoodNbCurv}} { # 1 puts "" -puts "First curve" mksurface s1 f1 mksurface s2 f2 -dlog reset -dlog on -xdistcs c_1 s1 0 1 10 -set Log1 [dlog get] +for {set i 1} {$i <= ${NbCurv}} {incr i} { + set log [dump c_$i] + + regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles + puts "Degree=${Degree}" + puts "Poles=${Poles}" + puts "KnotsPoles=${KnotsPoles}" + puts "" -set List1 [split ${Log1} {TD= \t\n}] -set Tolerance 1.0e-7 -set D_good 0. -checkList ${List1} ${Tolerance} ${D_good} + set Knot 1 + set exp_string "Knots :\n\n +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)" + regexp ${exp_string} ${log} full U1 Mult1 -# 2 -puts "" -puts "Second curve" + set Knot ${KnotsPoles} + set exp_string " +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)" + regexp ${exp_string} ${log} full U2 Mult2 -dlog reset -dlog on -xdistcs c_2 s1 0 1 10 -set Log2 [dlog get] + puts "U1=${U1}" + puts "U2=${U2}" + + if {[expr {$U2 - $U1}] < 1.0e-20} { + puts "Error: Wrong curve's range!" + } -set List2 [split ${Log2} {TD= \t\n}] -set Tolerance 1.0e-7 -set D_good 0. -checkList ${List2} ${Tolerance} ${D_good} + dlog reset + dlog on + xdistcs c_$i s1 ${U1} ${U2} 10 + set Log2 [dlog get] + set List2 [split ${Log2} {TD= \t\n}] + set Tolerance 1.0e-7 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol} -# 3 -puts "" -puts "Third curve" - -dlog reset -dlog on -xdistcs c_3 s1 0 1 10 -set Log3 [dlog get] - -set List3 [split ${Log3} {TD= \t\n}] -set Tolerance 1.0e-7 -set D_good 0. -checkList ${List3} ${Tolerance} ${D_good} - -# 4 -puts "" -puts "Fourth curve" - -dlog reset -dlog on -xdistcs c_4 s1 0 1 10 -set Log4 [dlog get] - -set List4 [split ${Log4} {TD= \t\n}] -set Tolerance 1.0e-7 -set D_good 0. -checkList ${List4} ${Tolerance} ${D_good} - -# 5 -if { [info exist c_5] } { -puts "" -puts "Fifth curve" - -dlog reset -dlog on -xdistcs c_5 s1 0 1 10 -set Log5 [dlog get] - -set List5 [split ${Log5} {TD= \t\n}] -set Tolerance 1.0e-7 -set D_good 0. -checkList ${List5} ${Tolerance} ${D_good} + dlog reset + dlog on + xdistcs c_$i s2 ${U1} ${U2} 10 + set Log2 [dlog get] + set List2 [split ${Log2} {TD= \t\n}] + set Tolerance 1.0e-7 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol} } -# 6 -if { [info exist c_6] } { -puts "" -puts "Sixth curve" - -dlog reset -dlog on -xdistcs c_6 s1 0 1 10 -set Log6 [dlog get] - -set List6 [split ${Log6} {TD= \t\n}] -set Tolerance 1.0e-7 -set D_good 0. -checkList ${List6} ${Tolerance} ${D_good} -} - -# 7 -if { [info exist c_7] } { -puts "" -puts "Seventh curve" - -dlog reset -dlog on -xdistcs c_7 s1 0 1 10 -set Log7 [dlog get] - -set List7 [split ${Log7} {TD= \t\n}] -set Tolerance 1.0e-7 -set D_good 0. -checkList ${List7} ${Tolerance} ${D_good} -} - - v2d 2dfit set only_screen_axo 1 diff --git a/tests/bugs/modalg_5/bug25292_13 b/tests/bugs/modalg_5/bug25292_13 index e949eb601d..823e87c3fc 100644 --- a/tests/bugs/modalg_5/bug25292_13 +++ b/tests/bugs/modalg_5/bug25292_13 @@ -23,14 +23,14 @@ bbuild result set square 289.348 -set nb_v_good 12 -set nb_e_good 18 +set nb_v_good 9 +set nb_e_good 15 set nb_w_good 10 set nb_f_good 10 set nb_sh_good 3 set nb_sol_good 3 set nb_compsol_good 0 set nb_compound_good 1 -set nb_shape_good 57 +set nb_shape_good 51 set 3dviewer 1 diff --git a/tests/bugs/modalg_5/bug25292_14 b/tests/bugs/modalg_5/bug25292_14 index 4038ca060f..ad96d3bf41 100644 --- a/tests/bugs/modalg_5/bug25292_14 +++ b/tests/bugs/modalg_5/bug25292_14 @@ -1,7 +1,3 @@ -puts "TODO OCC225404 Debian60-64 Windows: Error : Result shape is WRONG because it must contains 12 vertices instead of 9" -puts "TODO OCC225404 Debian60-64 Windows: Error : Result shape is WRONG because it must contains 18 edges instead of 15" -puts "TODO OCC225404 Debian60-64 Windows: Error : Result shape is WRONG because it must contains 57 shapes instead of 51" - puts "================" puts "OCC25292" puts "================" @@ -27,14 +23,14 @@ bbuild result set square 289.348 -set nb_v_good 12 -set nb_e_good 18 +set nb_v_good 9 +set nb_e_good 15 set nb_w_good 10 set nb_f_good 10 set nb_sh_good 3 set nb_sol_good 3 set nb_compsol_good 0 set nb_compound_good 1 -set nb_shape_good 57 +set nb_shape_good 51 set 3dviewer 1 diff --git a/tests/bugs/modalg_5/bug25292_15 b/tests/bugs/modalg_5/bug25292_15 index e0dfc911cc..12b386fc1a 100644 --- a/tests/bugs/modalg_5/bug25292_15 +++ b/tests/bugs/modalg_5/bug25292_15 @@ -6,8 +6,37 @@ puts "" # Face/Face intersection algorithm gives different results for different order of the arguments ####################################################################### +proc GetRange { curve } { + global U1 + global U2 + + set log [uplevel dump $curve] + + regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles + puts "Degree=${Degree}" + puts "Poles=${Poles}" + puts "KnotsPoles=${KnotsPoles}" + puts "" + + set Knot 1 + set exp_string "Knots :\n\n +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)" + regexp ${exp_string} ${log} full U1 Mult1 + + set Knot ${KnotsPoles} + set exp_string " +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)" + regexp ${exp_string} ${log} full U2 Mult2 +} + +puts "##############################" +puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!" +puts "##############################" +puts "" + # intersect command +#This value must be equal to the analogical value in bug25292_11, bug25292_12, bug25292_15 and bug25292_16 of "bugs modalg_5" testgrid. +set GoodNbCurv 4 + restore [locate_data_file bug25292_Input_0.brep] b1 restore [locate_data_file bug25292_Input_1.brep] b2 @@ -20,11 +49,98 @@ mksurface s1 f1 mksurface s2 f2 ################# -intersect i s1 s2 +intersect res s1 s2 ################# +set che [whatis res] +set ind [string first "3d curve" $che] +if {${ind} >= 0} { + #Only variable "res" exists + + if { $GoodNbCurv == 1 } { + puts "OK: Curve Number is good!" + } else { + puts "Error: Curve Number is bad!" + } + + set U1 0.0 + set U2 0.0 + + GetRange res -if { [info exist i_7] } { - puts "OK: Curve Number is good!" + puts "U1 = ${U1}" + puts "U2 = ${U2}" + + if {[expr {$U2 - $U1}] < 1.0e-20} { + puts "Error: Wrong curve's range!" + } + + dlog reset + dlog on + xdistcs res s1 ${U1} ${U2} 10 + set Log1 [dlog get] + set List1 [split ${Log1} {TD= \t\n}] + set Tolerance 3.0e-7 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + + dlog reset + dlog on + xdistcs res s2 ${U1} ${U2} 10 + set Log1 [dlog get] + set List1 [split ${Log1} {TD= \t\n}] + set Tolerance 3.0e-7 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} } else { - puts "Error: Curve Number is bad!" + set ic 1 + set AllowRepeate 1 + while { $AllowRepeate != 0 } { + set che [whatis res_$ic] + set ind [string first "3d curve" $che] + if {${ind} < 0} { + set AllowRepeate 0 + } else { + set U1 0.0 + set U2 0.0 + + GetRange res_$ic + + puts "U1 = ${U1}" + puts "U2 = ${U2}" + + if {[expr {$U2 - $U1}] < 1.0e-20} { + puts "Error: Wrong curve's range!" + } + + dlog reset + dlog on + xdistcs res_$ic s1 ${U1} ${U2} 10 + set Log1 [dlog get] + set List1 [split ${Log1} {TD= \t\n}] + set Tolerance 3.0e-7 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + + dlog reset + dlog on + xdistcs res_$ic s2 0 1 10 + set Log1 [dlog get] + set List1 [split ${Log1} {TD= \t\n}] + set Tolerance 3.0e-7 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + + incr ic + } + } + + if {[expr {$ic - 1}] == $GoodNbCurv} { + puts "OK: Curve Number is good!" + } else { + puts "Error: Curve Number is bad!" + } } diff --git a/tests/bugs/modalg_5/bug25292_16 b/tests/bugs/modalg_5/bug25292_16 index 961b699758..4cacd66e1a 100644 --- a/tests/bugs/modalg_5/bug25292_16 +++ b/tests/bugs/modalg_5/bug25292_16 @@ -1,5 +1,3 @@ -puts "TODO OCC225404 Debian60-64 Windows: Error: Curve Number is bad!" - puts "================" puts "OCC25292" puts "================" @@ -8,8 +6,37 @@ puts "" # Face/Face intersection algorithm gives different results for different order of the arguments ####################################################################### +proc GetRange { curve } { + global U1 + global U2 + + set log [uplevel dump $curve] + + regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles + puts "Degree=${Degree}" + puts "Poles=${Poles}" + puts "KnotsPoles=${KnotsPoles}" + puts "" + + set Knot 1 + set exp_string "Knots :\n\n +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)" + regexp ${exp_string} ${log} full U1 Mult1 + + set Knot ${KnotsPoles} + set exp_string " +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)" + regexp ${exp_string} ${log} full U2 Mult2 +} + +puts "##############################" +puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!" +puts "##############################" +puts "" + # intersect command +#This value must be equal to the analogical value in bug25292_11, bug25292_12, bug25292_15 and bug25292_16 of "bugs modalg_5" testgrid. +set GoodNbCurv 4 + restore [locate_data_file bug25292_Input_0.brep] b1 restore [locate_data_file bug25292_Input_1.brep] b2 @@ -22,11 +49,99 @@ mksurface s1 f1 mksurface s2 f2 ################# -intersect i s2 s1 +intersect res s2 s1 ################# -if { [info exist i_7] } { - puts "OK: Curve Number is good!" +set che [whatis res] +set ind [string first "3d curve" $che] +if {${ind} >= 0} { + #Only variable "res" exists + + if { $GoodNbCurv == 1 } { + puts "OK: Curve Number is good!" + } else { + puts "Error: Curve Number is bad!" + } + + set U1 0.0 + set U2 0.0 + + GetRange res + + puts "U1 = ${U1}" + puts "U2 = ${U2}" + + if {[expr {$U2 - $U1}] < 1.0e-20} { + puts "Error: Wrong curve's range!" + } + + dlog reset + dlog on + xdistcs res s1 ${U1} ${U2} 10 + set Log1 [dlog get] + set List1 [split ${Log1} {TD= \t\n}] + set Tolerance 3.0e-7 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + + dlog reset + dlog on + xdistcs res s2 ${U1} ${U2} 10 + set Log1 [dlog get] + set List1 [split ${Log1} {TD= \t\n}] + set Tolerance 3.0e-7 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} } else { - puts "Error: Curve Number is bad!" + set ic 1 + set AllowRepeate 1 + while { $AllowRepeate != 0 } { + set che [whatis res_$ic] + set ind [string first "3d curve" $che] + if {${ind} < 0} { + set AllowRepeate 0 + } else { + set U1 0.0 + set U2 0.0 + + GetRange res_$ic + + puts "U1 = ${U1}" + puts "U2 = ${U2}" + + if {[expr {$U2 - $U1}] < 1.0e-20} { + puts "Error: Wrong curve's range!" + } + + dlog reset + dlog on + xdistcs res_$ic s1 ${U1} ${U2} 10 + set Log1 [dlog get] + set List1 [split ${Log1} {TD= \t\n}] + set Tolerance 3.0e-7 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + + dlog reset + dlog on + xdistcs res_$ic s2 0 1 10 + set Log1 [dlog get] + set List1 [split ${Log1} {TD= \t\n}] + set Tolerance 3.0e-7 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + + incr ic + } + } + + if {[expr {$ic - 1}] == $GoodNbCurv} { + puts "OK: Curve Number is good!" + } else { + puts "Error: Curve Number is bad!" + } } diff --git a/tests/bugs/modalg_5/bug25292_21 b/tests/bugs/modalg_5/bug25292_21 index 22ace81d02..73af821249 100644 --- a/tests/bugs/modalg_5/bug25292_21 +++ b/tests/bugs/modalg_5/bug25292_21 @@ -6,6 +6,12 @@ puts "" # Face/Face intersection algorithm gives different results for different order of the arguments ####################################################################### +puts "##############################" +puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!" +puts "##############################" +puts "" +puts "" + # bopcurves command restore [locate_data_file bug25292_Input_3.brep] b1 @@ -17,66 +23,74 @@ explode b2 f copy b2_1 f2 ######################### -set log [bopcurves f1 f2] +set log [bopcurves f1 f2 -2d] ######################### regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv + +#This value must be equal to the analogical value in bug25292_21 and bug25292_22 of "bugs modalg_5" testgrid. set MaxTol 1.e-7 + +#This value must be equal to the analogical value in bug25292_21, bug25292_22, bug25292_25 and bug25292_26 of "bugs modalg_5" testgrid. +set GoodNbCurv 2 + if {${Toler} > ${MaxTol}} { puts "Error: Tolerance is too big!" } -set GoodNbCurv 3 + if {${NbCurv} != ${GoodNbCurv}} { puts "Error: Curve Number is bad!" } #------------- -# 1 -puts "" -puts "First curve" - mksurface s1 f1 mksurface s2 f2 -dlog reset -dlog on -xdistcs c_1 s1 0 1 10 -set Log1 [dlog get] +for {set i 1} {$i <= ${NbCurv}} {incr i} { + set log [dump c_$i] + + regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles + puts "Degree=${Degree}" + puts "Poles=${Poles}" + puts "KnotsPoles=${KnotsPoles}" + puts "" -set List1 [split ${Log1} {TD= \t\n}] -set Tolerance 1.0e-7 -set D_good 0. -checkList ${List1} ${Tolerance} ${D_good} + set Knot 1 + set exp_string "Knots :\n\n +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)" + regexp ${exp_string} ${log} full U1 Mult1 -# 2 -puts "" -puts "Second curve" + set Knot ${KnotsPoles} + set exp_string " +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)" + regexp ${exp_string} ${log} full U2 Mult2 -dlog reset -dlog on -xdistcs c_2 s1 0 1 10 -set Log2 [dlog get] + puts "U1=${U1}" + puts "U2=${U2}" + + if {[expr {$U2 - $U1}] < 1.0e-20} { + puts "Error: Wrong curve's range!" + } -set List2 [split ${Log2} {TD= \t\n}] -set Tolerance 1.0e-7 -set D_good 0. -checkList ${List2} ${Tolerance} ${D_good} - -# 3 -puts "" -puts "Third curve" - -dlog reset -dlog on -xdistcs c_3 s1 0 1 10 -set Log3 [dlog get] - -set List3 [split ${Log3} {TD= \t\n}] -set Tolerance 1.0e-7 -set D_good 0. -checkList ${List3} ${Tolerance} ${D_good} + dlog reset + dlog on + xdistcs c_$i s1 ${U1} ${U2} 10 + set Log2 [dlog get] + set List2 [split ${Log2} {TD= \t\n}] + set Tolerance 1.0e-7 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol} + dlog reset + dlog on + xdistcs c_$i s2 ${U1} ${U2} 10 + set Log2 [dlog get] + set List2 [split ${Log2} {TD= \t\n}] + set Tolerance 1.0e-7 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol} +} smallview fit diff --git a/tests/bugs/modalg_5/bug25292_22 b/tests/bugs/modalg_5/bug25292_22 index 1845de5e8c..6f9aa87781 100644 --- a/tests/bugs/modalg_5/bug25292_22 +++ b/tests/bugs/modalg_5/bug25292_22 @@ -1,5 +1,3 @@ -puts "TODO OCC225404 Debian60-64 Windows: Error: Curve Number is bad!" - puts "================" puts "OCC25292" puts "================" @@ -8,6 +6,12 @@ puts "" # Face/Face intersection algorithm gives different results for different order of the arguments ####################################################################### +puts "##############################" +puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!" +puts "##############################" +puts "" +puts "" + # bopcurves command restore [locate_data_file bug25292_Input_3.brep] b1 @@ -19,69 +23,75 @@ explode b2 f copy b2_1 f2 ######################### -set log [bopcurves f2 f1] +set log [bopcurves f2 f1 -2d] ######################### regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv + +#This value must be equal to the analogical value in bug25292_21 and bug25292_22 of "bugs modalg_5" testgrid. set MaxTol 1.e-7 + +#This value must be equal to the analogical value in bug25292_21, bug25292_22, bug25292_25 and bug25292_26 of "bugs modalg_5" testgrid. +set GoodNbCurv 2 + if {${Toler} > ${MaxTol}} { puts "Error: Tolerance is too big!" } -set GoodNbCurv 3 + if {${NbCurv} != ${GoodNbCurv}} { puts "Error: Curve Number is bad!" } #------------- -# 1 -puts "" -puts "First curve" - mksurface s1 f1 mksurface s2 f2 -dlog reset -dlog on -xdistcs c_1 s1 0 1 10 -set Log1 [dlog get] +for {set i 1} {$i <= ${NbCurv}} {incr i} { + set log [dump c_$i] + + regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles + puts "Degree=${Degree}" + puts "Poles=${Poles}" + puts "KnotsPoles=${KnotsPoles}" + puts "" -set List1 [split ${Log1} {TD= \t\n}] -set Tolerance 1.0e-7 -set D_good 0. -checkList ${List1} ${Tolerance} ${D_good} + set Knot 1 + set exp_string "Knots :\n\n +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)" + regexp ${exp_string} ${log} full U1 Mult1 -# 2 -puts "" -puts "Second curve" + set Knot ${KnotsPoles} + set exp_string " +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)" + regexp ${exp_string} ${log} full U2 Mult2 -dlog reset -dlog on -xdistcs c_2 s1 0 1 10 -set Log2 [dlog get] + puts "U1=${U1}" + puts "U2=${U2}" + + if {[expr {$U2 - $U1}] < 1.0e-20} { + puts "Error: Wrong curve's range!" + } -set List2 [split ${Log2} {TD= \t\n}] -set Tolerance 1.0e-7 -set D_good 0. -checkList ${List2} ${Tolerance} ${D_good} + dlog reset + dlog on + xdistcs c_$i s1 ${U1} ${U2} 10 + set Log2 [dlog get] + set List2 [split ${Log2} {TD= \t\n}] + set Tolerance 1.0e-7 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol} -# 3 -if { [info exist c_3] } { -puts "" -puts "Third curve" - -dlog reset -dlog on -xdistcs c_3 s1 0 1 10 -set Log3 [dlog get] - -set List3 [split ${Log3} {TD= \t\n}] -set Tolerance 1.0e-7 -set D_good 0. -checkList ${List3} ${Tolerance} ${D_good} + dlog reset + dlog on + xdistcs c_$i s2 ${U1} ${U2} 10 + set Log2 [dlog get] + set List2 [split ${Log2} {TD= \t\n}] + set Tolerance 1.0e-7 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol} } - smallview fit set only_screen_axo 1 diff --git a/tests/bugs/modalg_5/bug25292_23 b/tests/bugs/modalg_5/bug25292_23 index 348266cd48..935340c2a7 100644 --- a/tests/bugs/modalg_5/bug25292_23 +++ b/tests/bugs/modalg_5/bug25292_23 @@ -21,16 +21,17 @@ baddobjects b1 b2 bfillds bbuild result +#These values must be equal to the analogical values in bug25292_23 and bug25292_24 of "bugs modalg_5" testgrid. set square 31.6797 -set nb_v_good 11 -set nb_e_good 20 +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 64 +set nb_shape_good 62 set 3dviewer 1 diff --git a/tests/bugs/modalg_5/bug25292_24 b/tests/bugs/modalg_5/bug25292_24 index 6198ce9f0a..69ba43e8af 100644 --- a/tests/bugs/modalg_5/bug25292_24 +++ b/tests/bugs/modalg_5/bug25292_24 @@ -1,8 +1,3 @@ -puts "TODO OCC225404 Debian60-64 Windows: Error : Result shape is WRONG because it must contains 11 vertices instead of 10" -puts "TODO OCC225404 Debian60-64 Windows: Error : Result shape is WRONG because it must contains 20 edges instead of 19" -puts "TODO OCC225404 Debian60-64 Windows: Error : Result shape is WRONG because it must contains 64 shapes instead of 62" - - puts "================" puts "OCC25292" puts "================" @@ -26,16 +21,17 @@ baddobjects b2 b1 bfillds bbuild result +#These values must be equal to the analogical values in bug25292_23 and bug25292_24 of "bugs modalg_5" testgrid. set square 31.6797 -set nb_v_good 11 -set nb_e_good 20 +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 64 +set nb_shape_good 62 set 3dviewer 1 diff --git a/tests/bugs/modalg_5/bug25292_25 b/tests/bugs/modalg_5/bug25292_25 index f4a72d3b02..3e4f25f5bc 100644 --- a/tests/bugs/modalg_5/bug25292_25 +++ b/tests/bugs/modalg_5/bug25292_25 @@ -6,8 +6,37 @@ puts "" # Face/Face intersection algorithm gives different results for different order of the arguments ####################################################################### +proc GetRange { curve } { + global U1 + global U2 + + set log [uplevel dump $curve] + + regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles + puts "Degree=${Degree}" + puts "Poles=${Poles}" + puts "KnotsPoles=${KnotsPoles}" + puts "" + + set Knot 1 + set exp_string "Knots :\n\n +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)" + regexp ${exp_string} ${log} full U1 Mult1 + + set Knot ${KnotsPoles} + set exp_string " +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)" + regexp ${exp_string} ${log} full U2 Mult2 +} + +puts "##############################" +puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!" +puts "##############################" +puts "" + # intersect command +#This value must be equal to the analogical value in bug25292_21, bug25292_22, bug25292_25 and bug25292_26 of "bugs modalg_5" testgrid. +set GoodNbCurv 2 + restore [locate_data_file bug25292_Input_3.brep] b1 restore [locate_data_file bug25292_Input_11.brep] b2 @@ -20,11 +49,100 @@ mksurface s1 f1 mksurface s2 f2 ################# -intersect i s1 s2 +intersect res s1 s2 ################# -if { [info exist i_3] } { - puts "OK: Curve Number is good!" +set che [whatis res] +set ind [string first "3d curve" $che] +if {${ind} >= 0} { + #Only variable "res" exists + + if { $GoodNbCurv == 1 } { + puts "OK: Curve Number is good!" + } else { + puts "Error: Curve Number is bad!" + } + + set U1 0.0 + set U2 0.0 + + GetRange res + + puts "U1 = ${U1}" + puts "U2 = ${U2}" + + if {[expr {$U2 - $U1}] < 1.0e-20} { + puts "Error: Wrong curve's range!" + } + + dlog reset + dlog on + xdistcs res s1 ${U1} ${U2} 10 + set Log1 [dlog get] + set List1 [split ${Log1} {TD= \t\n}] + set Tolerance 1.1e-7 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + + dlog reset + dlog on + xdistcs res s2 ${U1} ${U2} 10 + set Log1 [dlog get] + set List1 [split ${Log1} {TD= \t\n}] + set Tolerance 1.1e-7 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} } else { - puts "Error: Curve Number is bad!" + set ic 1 + set AllowRepeate 1 + while { $AllowRepeate != 0 } { + set che [whatis res_$ic] + set ind [string first "3d curve" $che] + if {${ind} < 0} { + set AllowRepeate 0 + } else { + set U1 0.0 + set U2 0.0 + + GetRange res_$ic + + puts "U1 = ${U1}" + puts "U2 = ${U2}" + + if {[expr {$U2 - $U1}] < 1.0e-20} { + puts "Error: Wrong curve's range!" + } + + dlog reset + dlog on + xdistcs res_$ic s1 ${U1} ${U2} 10 + set Log1 [dlog get] + set List1 [split ${Log1} {TD= \t\n}] + set Tolerance 1.1e-7 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + + dlog reset + dlog on + xdistcs res_$ic s2 0 1 10 + set Log1 [dlog get] + set List1 [split ${Log1} {TD= \t\n}] + set Tolerance 1.1e-7 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + + incr ic + } + } + + if {[expr {$ic - 1}] == $GoodNbCurv} { + puts "OK: Curve Number is good!" + } else { + puts "Error: Curve Number is bad!" + } } + diff --git a/tests/bugs/modalg_5/bug25292_26 b/tests/bugs/modalg_5/bug25292_26 index 97d49c6930..9415b69007 100644 --- a/tests/bugs/modalg_5/bug25292_26 +++ b/tests/bugs/modalg_5/bug25292_26 @@ -1,5 +1,3 @@ -puts "TODO OCC225404 Debian60-64 Windows: Error: Curve Number is bad!" - puts "================" puts "OCC25292" puts "================" @@ -8,8 +6,37 @@ puts "" # Face/Face intersection algorithm gives different results for different order of the arguments ####################################################################### +proc GetRange { curve } { + global U1 + global U2 + + set log [uplevel dump $curve] + + regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles + puts "Degree=${Degree}" + puts "Poles=${Poles}" + puts "KnotsPoles=${KnotsPoles}" + puts "" + + set Knot 1 + set exp_string "Knots :\n\n +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)" + regexp ${exp_string} ${log} full U1 Mult1 + + set Knot ${KnotsPoles} + set exp_string " +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)" + regexp ${exp_string} ${log} full U2 Mult2 +} + +puts "##############################" +puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!" +puts "##############################" +puts "" + # intersect command +#This value must be equal to the analogical value in bug25292_21, bug25292_22, bug25292_25 and bug25292_26 of "bugs modalg_5" testgrid. +set GoodNbCurv 2 + restore [locate_data_file bug25292_Input_3.brep] b1 restore [locate_data_file bug25292_Input_11.brep] b2 @@ -22,12 +49,99 @@ mksurface s1 f1 mksurface s2 f2 ################# -intersect i s2 s1 +intersect res s2 s1 ################# -if { [info exist i_3] } { - puts "OK: Curve Number is good!" -} else { - puts "Error: Curve Number is bad!" -} +set che [whatis res] +set ind [string first "3d curve" $che] +if {${ind} >= 0} { + #Only variable "res" exists + + if { $GoodNbCurv == 1 } { + puts "OK: Curve Number is good!" + } else { + puts "Error: Curve Number is bad!" + } + + set U1 0.0 + set U2 0.0 + + GetRange res + puts "U1 = ${U1}" + puts "U2 = ${U2}" + + if {[expr {$U2 - $U1}] < 1.0e-20} { + puts "Error: Wrong curve's range!" + } + + dlog reset + dlog on + xdistcs res s1 ${U1} ${U2} 10 + set Log1 [dlog get] + set List1 [split ${Log1} {TD= \t\n}] + set Tolerance 1.1e-7 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + + dlog reset + dlog on + xdistcs res s2 ${U1} ${U2} 10 + set Log1 [dlog get] + set List1 [split ${Log1} {TD= \t\n}] + set Tolerance 1.1e-7 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} +} else { + set ic 1 + set AllowRepeate 1 + while { $AllowRepeate != 0 } { + set che [whatis res_$ic] + set ind [string first "3d curve" $che] + if {${ind} < 0} { + set AllowRepeate 0 + } else { + set U1 0.0 + set U2 0.0 + + GetRange res_$ic + + puts "U1 = ${U1}" + puts "U2 = ${U2}" + + if {[expr {$U2 - $U1}] < 1.0e-20} { + puts "Error: Wrong curve's range!" + } + + dlog reset + dlog on + xdistcs res_$ic s1 ${U1} ${U2} 10 + set Log1 [dlog get] + set List1 [split ${Log1} {TD= \t\n}] + set Tolerance 1.1e-7 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + + dlog reset + dlog on + xdistcs res_$ic s2 0 1 10 + set Log1 [dlog get] + set List1 [split ${Log1} {TD= \t\n}] + set Tolerance 1.1e-7 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + + incr ic + } + } + + if {[expr {$ic - 1}] == $GoodNbCurv} { + puts "OK: Curve Number is good!" + } else { + puts "Error: Curve Number is bad!" + } +} diff --git a/tests/bugs/modalg_5/bug25292_31 b/tests/bugs/modalg_5/bug25292_31 index e4b87e0b1f..36499ea553 100644 --- a/tests/bugs/modalg_5/bug25292_31 +++ b/tests/bugs/modalg_5/bug25292_31 @@ -6,6 +6,12 @@ puts "" # Face/Face intersection algorithm gives different results for different order of the arguments ####################################################################### +puts "##############################" +puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!" +puts "##############################" +puts "" +puts "" + # bopcurves command restore [locate_data_file bug25292_f1.brep] f1 @@ -16,48 +22,69 @@ set log [bopcurves f1 f2 -2d] ############################# regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv -set MaxTol 1.e-3 + +#This value must be equal to the analogical value in bug25292_31 and bug25292_32 of "bugs modalg_5" testgrid. +set MaxTol 3.e-4 + +#This value must be equal to the analogical value in bug25292_31 and bug25292_32 of "bugs modalg_5" testgrid. +set GoodNbCurv 1 + if {${Toler} > ${MaxTol}} { puts "Error: Tolerance is too big!" } -set GoodNbCurv 2 if {${NbCurv} != ${GoodNbCurv}} { puts "Error: Curve Number is bad!!" } #------------- -# 1 -puts "" -puts "First curve" - mksurface s1 f1 mksurface s2 f2 -dlog reset -dlog on -xdistcs c_1 s1 0 1 10 -set Log1 [dlog get] +for {set i 1} {$i <= ${NbCurv}} {incr i} { + set log [dump c_$i] + + regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles + puts "Degree=${Degree}" + puts "Poles=${Poles}" + puts "KnotsPoles=${KnotsPoles}" + puts "" -set List1 [split ${Log1} {TD= \t\n}] -set Tolerance 1.0e-4 -set D_good 0. -checkList ${List1} ${Tolerance} ${D_good} + set Knot 1 + set exp_string "Knots :\n\n +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)" + regexp ${exp_string} ${log} full U1 Mult1 -# 2 -puts "" -puts "Second curve" + set Knot ${KnotsPoles} + set exp_string " +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)" + regexp ${exp_string} ${log} full U2 Mult2 -dlog reset -dlog on -xdistcs c_2 s1 0 1 10 -set Log2 [dlog get] + puts "U1=${U1}" + puts "U2=${U2}" + + if {[expr {$U2 - $U1}] < 1.0e-20} { + puts "Error: Wrong curve's range!" + } -set List2 [split ${Log2} {TD= \t\n}] -set Tolerance 1.0e-4 -set D_good 0. -checkList ${List2} ${Tolerance} ${D_good} + dlog reset + dlog on + xdistcs c_$i s1 ${U1} ${U2} 10 + set Log2 [dlog get] + set List2 [split ${Log2} {TD= \t\n}] + set Tolerance MaxTol + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol} + dlog reset + dlog on + xdistcs c_$i s2 ${U1} ${U2} 10 + set Log2 [dlog get] + set List2 [split ${Log2} {TD= \t\n}] + set Tolerance MaxTol + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol} +} smallview fit diff --git a/tests/bugs/modalg_5/bug25292_32 b/tests/bugs/modalg_5/bug25292_32 index 8fabda3d67..cca229e95b 100644 --- a/tests/bugs/modalg_5/bug25292_32 +++ b/tests/bugs/modalg_5/bug25292_32 @@ -1,3 +1,5 @@ +puts "TODO OCC25331 Debian60-64: Error: Tolerance is too big!" + puts "================" puts "OCC25292" puts "================" @@ -6,6 +8,12 @@ puts "" # Face/Face intersection algorithm gives different results for different order of the arguments ####################################################################### +puts "##############################" +puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!" +puts "##############################" +puts "" +puts "" + # bopcurves command restore [locate_data_file bug25292_f1.brep] f1 @@ -16,48 +24,69 @@ set log [bopcurves f2 f1 -2d] ############################# regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv -set MaxTol 1.e-3 + +#This value must be equal to the analogical value in bug25292_31 and bug25292_32 of "bugs modalg_5" testgrid. +set MaxTol 3.e-4 + +#This value must be equal to the analogical value in bug25292_31 and bug25292_32 of "bugs modalg_5" testgrid. +set GoodNbCurv 1 + if {${Toler} > ${MaxTol}} { puts "Error: Tolerance is too big!" } -set GoodNbCurv 2 if {${NbCurv} != ${GoodNbCurv}} { puts "Error: Curve Number is bad!!" } #------------- -# 1 -puts "" -puts "First curve" - mksurface s1 f1 mksurface s2 f2 -dlog reset -dlog on -xdistcs c_1 s1 0 1 10 -set Log1 [dlog get] +for {set i 1} {$i <= ${NbCurv}} {incr i} { + set log [dump c_$i] + + regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles + puts "Degree=${Degree}" + puts "Poles=${Poles}" + puts "KnotsPoles=${KnotsPoles}" + puts "" -set List1 [split ${Log1} {TD= \t\n}] -set Tolerance 1.0e-4 -set D_good 0. -checkList ${List1} ${Tolerance} ${D_good} + set Knot 1 + set exp_string "Knots :\n\n +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)" + regexp ${exp_string} ${log} full U1 Mult1 -# 2 -puts "" -puts "Second curve" + set Knot ${KnotsPoles} + set exp_string " +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)" + regexp ${exp_string} ${log} full U2 Mult2 -dlog reset -dlog on -xdistcs c_2 s1 0 1 10 -set Log2 [dlog get] + puts "U1=${U1}" + puts "U2=${U2}" + + if {[expr {$U2 - $U1}] < 1.0e-20} { + puts "Error: Wrong curve's range!" + } -set List2 [split ${Log2} {TD= \t\n}] -set Tolerance 1.0e-4 -set D_good 0. -checkList ${List2} ${Tolerance} ${D_good} + dlog reset + dlog on + xdistcs c_$i s1 ${U1} ${U2} 10 + set Log2 [dlog get] + set List2 [split ${Log2} {TD= \t\n}] + set Tolerance MaxTol + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol} + dlog reset + dlog on + xdistcs c_$i s2 ${U1} ${U2} 10 + set Log2 [dlog get] + set List2 [split ${Log2} {TD= \t\n}] + set Tolerance MaxTol + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol} +} smallview fit diff --git a/tests/bugs/modalg_5/bug25292_33 b/tests/bugs/modalg_5/bug25292_33 index 86939aabd9..e089f70b76 100644 --- a/tests/bugs/modalg_5/bug25292_33 +++ b/tests/bugs/modalg_5/bug25292_33 @@ -6,8 +6,37 @@ puts "" # Face/Face intersection algorithm gives different results for different order of the arguments ####################################################################### +proc GetRange { curve } { + global U1 + global U2 + + set log [uplevel dump $curve] + + regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles + puts "Degree=${Degree}" + puts "Poles=${Poles}" + puts "KnotsPoles=${KnotsPoles}" + puts "" + + set Knot 1 + set exp_string "Knots :\n\n +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)" + regexp ${exp_string} ${log} full U1 Mult1 + + set Knot ${KnotsPoles} + set exp_string " +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)" + regexp ${exp_string} ${log} full U2 Mult2 +} + +puts "##############################" +puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!" +puts "##############################" +puts "" + # intersect command +#This value must be equal to the analogical value in bug25292_33 and bug25292_34 of "bugs modalg_5" testgrid. +set GoodNbCurv 1 + restore [locate_data_file bug25292_f1.brep] f1 restore [locate_data_file bug25292_f2.brep] f2 @@ -15,11 +44,99 @@ mksurface s1 f1 mksurface s2 f2 ################# -intersect i s1 s2 +intersect res s1 s2 ################# -if { [info exist i] } { - puts "OK: Curve Number is good!" +set che [whatis res] +set ind [string first "3d curve" $che] +if {${ind} >= 0} { + #Only variable "res" exists + + if { $GoodNbCurv == 1 } { + puts "OK: Curve Number is good!" + } else { + puts "Error: Curve Number is bad!" + } + + set U1 0.0 + set U2 0.0 + + GetRange res + + puts "U1 = ${U1}" + puts "U2 = ${U2}" + + if {[expr {$U2 - $U1}] < 1.0e-20} { + puts "Error: Wrong curve's range!" + } + + dlog reset + dlog on + xdistcs res s1 ${U1} ${U2} 10 + set Log1 [dlog get] + set List1 [split ${Log1} {TD= \t\n}] + set Tolerance 1.0e-6 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + + dlog reset + dlog on + xdistcs res s2 ${U1} ${U2} 10 + set Log1 [dlog get] + set List1 [split ${Log1} {TD= \t\n}] + set Tolerance 1.0e-6 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} } else { - puts "Error: Curve Number is bad!" + set ic 1 + set AllowRepeate 1 + while { $AllowRepeate != 0 } { + set che [whatis res_$ic] + set ind [string first "3d curve" $che] + if {${ind} < 0} { + set AllowRepeate 0 + } else { + set U1 0.0 + set U2 0.0 + + GetRange res_$ic + + puts "U1 = ${U1}" + puts "U2 = ${U2}" + + if {[expr {$U2 - $U1}] < 1.0e-20} { + puts "Error: Wrong curve's range!" + } + + dlog reset + dlog on + xdistcs res_$ic s1 ${U1} ${U2} 10 + set Log1 [dlog get] + set List1 [split ${Log1} {TD= \t\n}] + set Tolerance 1.0e-6 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + + dlog reset + dlog on + xdistcs res_$ic s2 0 1 10 + set Log1 [dlog get] + set List1 [split ${Log1} {TD= \t\n}] + set Tolerance 1.0e-6 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + + incr ic + } + } + + if {[expr {$ic - 1}] == $GoodNbCurv} { + puts "OK: Curve Number is good!" + } else { + puts "Error: Curve Number is bad!" + } } diff --git a/tests/bugs/modalg_5/bug25292_34 b/tests/bugs/modalg_5/bug25292_34 index a9508336b3..536cb00872 100644 --- a/tests/bugs/modalg_5/bug25292_34 +++ b/tests/bugs/modalg_5/bug25292_34 @@ -6,8 +6,37 @@ puts "" # Face/Face intersection algorithm gives different results for different order of the arguments ####################################################################### +proc GetRange { curve } { + global U1 + global U2 + + set log [uplevel dump $curve] + + regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles + puts "Degree=${Degree}" + puts "Poles=${Poles}" + puts "KnotsPoles=${KnotsPoles}" + puts "" + + set Knot 1 + set exp_string "Knots :\n\n +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)" + regexp ${exp_string} ${log} full U1 Mult1 + + set Knot ${KnotsPoles} + set exp_string " +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)" + regexp ${exp_string} ${log} full U2 Mult2 +} + +puts "##############################" +puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!" +puts "##############################" +puts "" + # intersect command +#This value must be equal to the analogical value in bug25292_33 and bug25292_34 of "bugs modalg_5" testgrid. +set GoodNbCurv 1 + restore [locate_data_file bug25292_f1.brep] f1 restore [locate_data_file bug25292_f2.brep] f2 @@ -15,11 +44,99 @@ mksurface s1 f1 mksurface s2 f2 ################# -intersect i s2 s1 +intersect res s2 s1 ################# -if { [info exist i] } { - puts "OK: Curve Number is good!" +set che [whatis res] +set ind [string first "3d curve" $che] +if {${ind} >= 0} { + #Only variable "res" exists + + if { $GoodNbCurv == 1 } { + puts "OK: Curve Number is good!" + } else { + puts "Error: Curve Number is bad!" + } + + set U1 0.0 + set U2 0.0 + + GetRange res + + puts "U1 = ${U1}" + puts "U2 = ${U2}" + + if {[expr {$U2 - $U1}] < 1.0e-20} { + puts "Error: Wrong curve's range!" + } + + dlog reset + dlog on + xdistcs res s1 ${U1} ${U2} 10 + set Log1 [dlog get] + set List1 [split ${Log1} {TD= \t\n}] + set Tolerance 1.0e-6 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + + dlog reset + dlog on + xdistcs res s2 ${U1} ${U2} 10 + set Log1 [dlog get] + set List1 [split ${Log1} {TD= \t\n}] + set Tolerance 1.0e-6 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} } else { - puts "Error: Curve Number is bad!" + set ic 1 + set AllowRepeate 1 + while { $AllowRepeate != 0 } { + set che [whatis res_$ic] + set ind [string first "3d curve" $che] + if {${ind} < 0} { + set AllowRepeate 0 + } else { + set U1 0.0 + set U2 0.0 + + GetRange res_$ic + + puts "U1 = ${U1}" + puts "U2 = ${U2}" + + if {[expr {$U2 - $U1}] < 1.0e-20} { + puts "Error: Wrong curve's range!" + } + + dlog reset + dlog on + xdistcs res_$ic s1 ${U1} ${U2} 10 + set Log1 [dlog get] + set List1 [split ${Log1} {TD= \t\n}] + set Tolerance 1.0e-6 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + + dlog reset + dlog on + xdistcs res_$ic s2 0 1 10 + set Log1 [dlog get] + set List1 [split ${Log1} {TD= \t\n}] + set Tolerance 1.0e-6 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + + incr ic + } + } + + if {[expr {$ic - 1}] == $GoodNbCurv} { + puts "OK: Curve Number is good!" + } else { + puts "Error: Curve Number is bad!" + } } diff --git a/tests/bugs/modalg_5/bug25292_35 b/tests/bugs/modalg_5/bug25292_35 index cfedf6f95a..910a61ccbd 100644 --- a/tests/bugs/modalg_5/bug25292_35 +++ b/tests/bugs/modalg_5/bug25292_35 @@ -6,8 +6,38 @@ puts "" # Face/Face intersection algorithm gives different results for different order of the arguments ####################################################################### +proc GetRange { curve } { + global U1 + global U2 + + set log [uplevel dump $curve] + + regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles + puts "Degree=${Degree}" + puts "Poles=${Poles}" + puts "KnotsPoles=${KnotsPoles}" + puts "" + + set Knot 1 + set exp_string "Knots :\n\n +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)" + regexp ${exp_string} ${log} full U1 Mult1 + + set Knot ${KnotsPoles} + set exp_string " +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)" + regexp ${exp_string} ${log} full U2 Mult2 +} + +puts "##############################" +puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!" +puts "##############################" +puts "" +puts "" + # intersect command for trimmed surfaces +#This value must be equal to the analogical value in bug25292_35 and bug25292_36 of "bugs modalg_5" testgrid. +set GoodNbCurv 2 + restore [locate_data_file bug25292_f1.brep] f1 restore [locate_data_file bug25292_f2.brep] f2 @@ -21,11 +51,99 @@ trimv s1t s1 19.1600000005 19.6600000005 trim s2t s2 0. 1.570796326795 -275 275 ################### -intersect k s1t s2t +intersect res s1t s2t ################### -if { [info exist k_2] } { - puts "OK: Curve Number is good!" +set che [whatis res] +set ind [string first "3d curve" $che] +if {${ind} >= 0} { + #Only variable "res" exists + + if { $GoodNbCurv == 1 } { + puts "OK: Curve Number is good!" + } else { + puts "Error: Curve Number is bad!" + } + + set U1 0.0 + set U2 0.0 + + GetRange res + + puts "U1 = ${U1}" + puts "U2 = ${U2}" + + if {[expr {$U2 - $U1}] < 1.0e-20} { + puts "Error: Wrong curve's range!" + } + + dlog reset + dlog on + xdistcs res s1 ${U1} ${U2} 10 + set Log1 [dlog get] + set List1 [split ${Log1} {TD= \t\n}] + set Tolerance 3.0e-4 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + + dlog reset + dlog on + xdistcs res s2 ${U1} ${U2} 10 + set Log1 [dlog get] + set List1 [split ${Log1} {TD= \t\n}] + set Tolerance 3.0e-4 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} } else { - puts "Error: Curve Number is bad!" + set ic 1 + set AllowRepeate 1 + while { $AllowRepeate != 0 } { + set che [whatis res_$ic] + set ind [string first "3d curve" $che] + if {${ind} < 0} { + set AllowRepeate 0 + } else { + set U1 0.0 + set U2 0.0 + + GetRange res_$ic + + puts "U1 = ${U1}" + puts "U2 = ${U2}" + + if {[expr {$U2 - $U1}] < 1.0e-20} { + puts "Error: Wrong curve's range!" + } + + dlog reset + dlog on + xdistcs res_$ic s1 ${U1} ${U2} 10 + set Log1 [dlog get] + set List1 [split ${Log1} {TD= \t\n}] + set Tolerance 3.0e-4 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + + dlog reset + dlog on + xdistcs res_$ic s2 0 1 10 + set Log1 [dlog get] + set List1 [split ${Log1} {TD= \t\n}] + set Tolerance 3.0e-4 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + + incr ic + } + } + + if {[expr {$ic - 1}] == $GoodNbCurv} { + puts "OK: Curve Number is good!" + } else { + puts "Error: Curve Number is bad!" + } } diff --git a/tests/bugs/modalg_5/bug25292_36 b/tests/bugs/modalg_5/bug25292_36 index 95cdcfac97..f1011277f5 100644 --- a/tests/bugs/modalg_5/bug25292_36 +++ b/tests/bugs/modalg_5/bug25292_36 @@ -6,8 +6,38 @@ puts "" # Face/Face intersection algorithm gives different results for different order of the arguments ####################################################################### +proc GetRange { curve } { + global U1 + global U2 + + set log [uplevel dump $curve] + + regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles + puts "Degree=${Degree}" + puts "Poles=${Poles}" + puts "KnotsPoles=${KnotsPoles}" + puts "" + + set Knot 1 + set exp_string "Knots :\n\n +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)" + regexp ${exp_string} ${log} full U1 Mult1 + + set Knot ${KnotsPoles} + set exp_string " +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)" + regexp ${exp_string} ${log} full U2 Mult2 +} + +puts "##############################" +puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!" +puts "##############################" +puts "" +puts "" + # intersect command for trimmed surfaces +#This value must be equal to the analogical value in bug25292_35 and bug25292_36 of "bugs modalg_5" testgrid. +set GoodNbCurv 2 + restore [locate_data_file bug25292_f1.brep] f1 restore [locate_data_file bug25292_f2.brep] f2 @@ -21,11 +51,99 @@ trimv s1t s1 19.1600000005 19.6600000005 trim s2t s2 0. 1.570796326795 -275 275 ################### -intersect k s2t s1t +intersect res s2t s1t ################### -if { [info exist k_2] } { - puts "OK: Curve Number is good!" +set che [whatis res] +set ind [string first "3d curve" $che] +if {${ind} >= 0} { + #Only variable "res" exists + + if { $GoodNbCurv == 1 } { + puts "OK: Curve Number is good!" + } else { + puts "Error: Curve Number is bad!" + } + + set U1 0.0 + set U2 0.0 + + GetRange res + + puts "U1 = ${U1}" + puts "U2 = ${U2}" + + if {[expr {$U2 - $U1}] < 1.0e-20} { + puts "Error: Wrong curve's range!" + } + + dlog reset + dlog on + xdistcs res s1 ${U1} ${U2} 10 + set Log1 [dlog get] + set List1 [split ${Log1} {TD= \t\n}] + set Tolerance 3.0e-4 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + + dlog reset + dlog on + xdistcs res s2 ${U1} ${U2} 10 + set Log1 [dlog get] + set List1 [split ${Log1} {TD= \t\n}] + set Tolerance 3.0e-4 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} } else { - puts "Error: Curve Number is bad!" + set ic 1 + set AllowRepeate 1 + while { $AllowRepeate != 0 } { + set che [whatis res_$ic] + set ind [string first "3d curve" $che] + if {${ind} < 0} { + set AllowRepeate 0 + } else { + set U1 0.0 + set U2 0.0 + + GetRange res_$ic + + puts "U1 = ${U1}" + puts "U2 = ${U2}" + + if {[expr {$U2 - $U1}] < 1.0e-20} { + puts "Error: Wrong curve's range!" + } + + dlog reset + dlog on + xdistcs res_$ic s1 ${U1} ${U2} 10 + set Log1 [dlog get] + set List1 [split ${Log1} {TD= \t\n}] + set Tolerance 3.0e-4 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + + dlog reset + dlog on + xdistcs res_$ic s2 0 1 10 + set Log1 [dlog get] + set List1 [split ${Log1} {TD= \t\n}] + set Tolerance 3.0e-4 + set Limit_Tol 1.0e-7 + set D_good 0. + checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + + incr ic + } + } + + if {[expr {$ic - 1}] == $GoodNbCurv} { + puts "OK: Curve Number is good!" + } else { + puts "Error: Curve Number is bad!" + } } diff --git a/tests/bugs/modalg_5/bug25465_1 b/tests/bugs/modalg_5/bug25465_1 new file mode 100644 index 0000000000..af86af14c3 --- /dev/null +++ b/tests/bugs/modalg_5/bug25465_1 @@ -0,0 +1,31 @@ +puts "========" +puts "OCC25465" +puts "========" +puts "" +################################################ +# Excess vertex in the result of CUT operation +################################################ + +restore [locate_data_file OCC25465_Gorivo.brep] b1 +restore [locate_data_file OCC25465_Translation_1.brep] b2 + +explode b1 f +explode b2 f +set bug_info [bopcurves b1_3 b2_4] +bop b1 b2 +bopcut result + +# It is strictly forbidden to change nb_v_good and nb_e_good values (see OCC25465) +set nb_v_good 11 +set nb_e_good 17 +set nb_w_good 8 +set nb_f_good 8 +set nb_sh_good 1 +set nb_sol_good 1 +set nb_compsol_good 0 +set nb_compound_good 1 +set nb_shape_good 47 + +if {[lindex $bug_info 2] != 3} { + puts "ERROR: OCC25465 is reproduced." +} diff --git a/tests/bugs/modalg_5/bug25465_2 b/tests/bugs/modalg_5/bug25465_2 new file mode 100644 index 0000000000..fdf55c1971 --- /dev/null +++ b/tests/bugs/modalg_5/bug25465_2 @@ -0,0 +1,31 @@ +puts "========" +puts "OCC25465" +puts "========" +puts "" +################################################ +# Excess vertex in the result of CUT operation +################################################ + +restore [locate_data_file OCC25465_t_boite1.brep] b1 +restore [locate_data_file OCC25465_c_cyl.brep] b2 + +explode b1 f +explode b2 f +set bug_info [bopcurves b1_6 b2_1] +bop b1 b2 +bopcut result + +# It is strictly forbidden to change nb_v_good and nb_e_good values (see OCC25465) +set nb_v_good 13 +set nb_e_good 20 +set nb_w_good 11 +set nb_f_good 8 +set nb_sh_good 1 +set nb_sol_good 1 +set nb_compsol_good 0 +set nb_compound_good 1 +set nb_shape_good 55 + +if {[lindex $bug_info 2] != 2} { + puts "ERROR: OCC25465 is reproduced." +}