0025531: Difference in intersection result on Windows and Linux platform is very...
authornbv <nbv@opencascade.com>
Thu, 25 Dec 2014 15:04:55 +0000 (18:04 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 25 Dec 2014 15:06:15 +0000 (18:06 +0300)
1. Dump of WLine is shown with more precise.
2. Equation solving with more precise.
3. Dump of Multy-line.
4. Code optimization.

Some test cases were updated in accordance with their new behaviour.

Correction of test cases for issue CR25531

19 files changed:
src/ApproxInt/ApproxInt_Approx.gxx
src/ApproxInt/ApproxInt_MultiLine.cdl
src/ApproxInt/ApproxInt_MultiLine.gxx
src/ApproxInt/ApproxInt_MultiLineTool.cdl
src/ApproxInt/ApproxInt_MultiLineTool.lxx
src/IntPatch/IntPatch_ImpImpIntersection_4.gxx
src/IntPatch/IntPatch_WLine.cxx
tests/bugs/modalg_1/bug16517_1
tests/bugs/modalg_1/bug16517_2
tests/bugs/modalg_5/bug24915
tests/bugs/modalg_5/bug25292_15
tests/bugs/modalg_5/bug25292_16
tests/bugs/modalg_5/bug25292_25
tests/bugs/modalg_5/bug25292_26
tests/bugs/modalg_5/bug25292_31
tests/bugs/modalg_5/bug25292_32
tests/bugs/modalg_5/bug25292_35
tests/bugs/modalg_5/bug25292_36
tests/bugs/modalg_5/bug25488

index 23d4b03..6b90d71 100644 (file)
@@ -936,7 +936,6 @@ void ApproxInt_Approx::Perform(const TheISurface& ISurf,
   ApproxInt_TheImpPrmSvSurfaces myImpPrmSvSurfaces(ISurf,PSurf);
   Standard_Integer nbpntbez = indicemax-indicemin;
   
-  Standard_Address ptrsvsurf = NULL;
   Standard_Boolean cut = Standard_True;
   if(nbpntbez < LimRajout) 
     myApproxBez = Standard_False;
@@ -947,7 +946,7 @@ void ApproxInt_Approx::Perform(const TheISurface& ISurf,
     cut = Standard_False;
     //-- cout<<" ApproxInt : Nb de points = "<<nbpntbez<<" Pas de rajout "<<endl;
   }
-  ptrsvsurf = &myImpPrmSvSurfaces;
+  Standard_Address ptrsvsurf = &myImpPrmSvSurfaces;
   
   if(nbpntbez < LimRajout) myApproxBez = Standard_False;
   
@@ -1057,6 +1056,11 @@ void ApproxInt_Approx::Perform(const TheISurface& ISurf,
                                       imax);
     if(myApproxBez) { 
       myComputeLineBezier.Perform(myMultiLine);
+
+#ifdef OCCT_DEBUG
+      //myMultiLine.Dump();
+#endif
+
       if (myComputeLineBezier.NbMultiCurves() == 0)
        return;
       myTolReached&=myComputeLineBezier.IsToleranceReached();
index a049911..8b00c88 100644 (file)
@@ -116,6 +116,9 @@ is
 
     MakeMLBetween(me; Low,High,NbPointsToInsert: Integer from Standard) 
        returns MultiLine from ApproxInt is static;
+      
+    Dump(me);
+       ---Purpose: Dump of the current multi-line.
 
 --------------------------------------------------------------------------------
 
index 5b2de67..c6ee083 100644 (file)
@@ -613,3 +613,16 @@ const {
 }
   //======================================================================
 
+void ApproxInt_MultiLine::Dump() const
+{
+  TColgp_Array1OfPnt anArr1(1, 1);
+  TColgp_Array1OfPnt2d anArr2(1, 2);
+        
+  for(Standard_Integer ind = FirstPoint(); ind <= LastPoint(); ind++)
+  {
+    Value(ind, anArr1, anArr2);
+    printf("%4d  [%+10.20f %+10.20f %+10.20f]  [%+10.20f %+10.20f]  [%+10.20f %+10.20f]\n",
+      ind, anArr1(1).X(), anArr1(1).Y(), anArr1(1).Z(), anArr2(1).X(),anArr2(1).Y(),anArr2(2).X(),anArr2(2).Y());
+  }
+}
+
index 4770b32..6876658 100644 (file)
@@ -127,5 +127,8 @@ is
        ---C++:inline
     returns Status from Approx;
     
+    Dump(myclass;  ML:  TheMultiLine);
+       ---Purpose: Dump of the current multi-line.
+    
 end MultiLineTool;    
 
index aee1c21..a14a07e 100644 (file)
@@ -115,4 +115,9 @@ inline TheMultiLine ApproxInt_MultiLineTool::MakeMLBetween(const TheMultiLine& M
   
   return(ML.MakeMLBetween(I1,I2,NbPMin));
 }
+
+inline void ApproxInt_MultiLineTool::Dump(const TheMultiLine& ML)
+{ 
+  ML.Dump();
+}
 //================================================================================
index 228c4de..6812cd7 100644 (file)
@@ -750,31 +750,45 @@ stCoeffsValue::stCoeffsValue( const gp_Cylinder& theCyl1,
   }aFoundCouple = COENONE;
 
 
-  Standard_Real aDetV1V2 = mVecC1.X()*mVecC2.Y()-mVecC1.Y()*mVecC2.X();
-
-  if(Abs(aDetV1V2) < aNulValue)
+  Standard_Real aDetV1V2 = 0.0;
+  
+  const Standard_Real aDelta1 = mVecC1.X()*mVecC2.Y()-mVecC1.Y()*mVecC2.X(); //1-2
+  const Standard_Real aDelta2 = mVecC1.Y()*mVecC2.Z()-mVecC1.Z()*mVecC2.Y(); //2-3
+  const Standard_Real aDelta3 = mVecC1.X()*mVecC2.Z()-mVecC1.Z()*mVecC2.X(); //1-3
+  const Standard_Real anAbsD1 = Abs(aDelta1); //1-2
+  const Standard_Real anAbsD2 = Abs(aDelta2); //2-3
+  const Standard_Real anAbsD3 = Abs(aDelta3); //1-3
+
+  if(anAbsD1 >= anAbsD2)
   {
-    aDetV1V2 = mVecC1.Y()*mVecC2.Z()-mVecC1.Z()*mVecC2.Y();
-    if(Abs(aDetV1V2) < aNulValue)
+    if(anAbsD3 > anAbsD1)
     {
-      aDetV1V2 = mVecC1.X()*mVecC2.Z()-mVecC1.Z()*mVecC2.X();
-      if(Abs(aDetV1V2) < aNulValue)
-      {
-        Standard_Failure::Raise("Error. Exception in divide by zerro (IntCyCyTrim)!!!!");
-      }
-      else
-      {
-        aFoundCouple = COE13;
-      }
+      aFoundCouple = COE13;
+      aDetV1V2 = aDelta3;
     }
     else
     {
-      aFoundCouple = COE23;
+      aFoundCouple = COE12;
+      aDetV1V2 = aDelta1;
     }
   }
   else
   {
-    aFoundCouple = COE12;
+    if(anAbsD3 > anAbsD2)
+    {
+      aFoundCouple = COE13;
+      aDetV1V2 = aDelta3;
+    }
+    else
+    {
+      aFoundCouple = COE23;
+      aDetV1V2 = aDelta2;
+    }
+  }
+
+  if(Abs(aDetV1V2) < aNulValue)
+  {
+    Standard_Failure::Raise("Error. Exception in divide by zerro (IntCyCyTrim)!!!!");
   }
 
   switch(aFoundCouple)
@@ -1504,6 +1518,10 @@ static void SeekAdditionalPoints( const IntSurf_Quadric& theQuad1,
 
       gp_Pnt aPInt(0.5*(aP1.XYZ() + aP2.XYZ()));
 
+#ifdef OCCT_DEBUG
+      //cout << "|P1Pi| = " << aP1.SquareDistance(aPInt) << "; |P2Pi| = " << aP2.SquareDistance(aPInt) << endl;
+#endif
+
       IntSurf_PntOn2S anIP;
       if(isTheReverse)
       {
@@ -1632,11 +1650,15 @@ Standard_Boolean IntCyCyTrim( const IntSurf_Quadric& theQuad1,
     
   theSlin.Clear();
   theSPnt.Clear();
-  const Standard_Integer aNbPoints = Min(Max(200, RealToInt(20.0*aCyl1.Radius())), 2000);
+  const Standard_Integer aNbMaxPoints = 2000;
+  const Standard_Integer aNbMinPoints = 200;
+  const Standard_Integer aNbPoints = Min(Max(aNbMinPoints, 
+                      RealToInt(20.0*aCyl1.Radius())), aNbMaxPoints);
   const Standard_Real aPeriod = 2.0*M_PI;
   const Standard_Real aStepMin = theTol2D, 
                       aStepMax = (aUSurf1l-aUSurf1f)/IntToReal(aNbPoints);
-  
+  const Standard_Integer aNbWLines = 2;
+
   const stCoeffsValue anEquationCoeffs(aCyl1, aCyl2);
 
   //Boundaries
@@ -1843,7 +1865,9 @@ Standard_Boolean IntCyCyTrim( const IntSurf_Quadric& theQuad1,
     if(Precision::IsInfinite(aU1f[aCurInterval]) && Precision::IsInfinite(aU1l[aCurInterval]))
       continue;
 
-    Standard_Boolean isAddedIntoWL1 = Standard_False, isAddedIntoWL2 = Standard_False;
+    Standard_Boolean isAddedIntoWL[aNbWLines];
+    for(Standard_Integer i = 0; i < aNbWLines; i++)
+      isAddedIntoWL[i] = Standard_False;
 
     Standard_Real anUf = aU1f[aCurInterval], anUl = aU1l[aCurInterval];
     const Standard_Boolean isDeltaPeriod  = IsEqual(anUl-anUf, aPeriod);
@@ -1853,26 +1877,30 @@ Standard_Boolean IntCyCyTrim( const IntSurf_Quadric& theQuad1,
 
     while(anUf < anUl)
     {
-      Handle(IntSurf_LineOn2S) aL2S1 = new IntSurf_LineOn2S();
-      Handle(IntSurf_LineOn2S) aL2S2 = new IntSurf_LineOn2S();
-
-      Handle(IntPatch_WLine) aWLine1 = new IntPatch_WLine(aL2S1, Standard_False);
-      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 aU2[aNbWLines], aV1[aNbWLines], aV2[aNbWLines];
+      Standard_Integer aWLFindStatus[aNbWLines];
+      Standard_Real aV1Prev[aNbWLines], aV2Prev[aNbWLines];
+      Standard_Real anArccosFactor[aNbWLines] = {1.0, -1.0};
+      Standard_Boolean isAddingWLEnabled[aNbWLines];
+
+      Handle(IntSurf_LineOn2S) aL2S[aNbWLines];
+      Handle(IntPatch_WLine) aWLine[aNbWLines];
+      for(Standard_Integer i = 0; i < aNbWLines; i++)
+      {
+        aL2S[i] = new IntSurf_LineOn2S();
+        aWLine[i] = new IntPatch_WLine(aL2S[i], Standard_False);
+        aWLFindStatus[i] = 0;
+        isAddingWLEnabled[i] = Standard_True;
+        aU2[i] = aV1[i] = aV2[i] = 0.0;
+        aV1Prev[i] = aV2Prev[i] = 0.0;
+      }
+      
       Standard_Real anU1 = anUf;
 
       Standard_Real aCriticalDelta[aNbCritPointsMax];
       for(Standard_Integer i = 0; i < aNbCritPointsMax; i++)
         aCriticalDelta[i] = anU1 - anU1crit[i];
 
-      Standard_Real aV11Prev = 0.0,
-                    aV12Prev = 0.0,
-                    aV21Prev = 0.0,
-                    aV22Prev = 0.0;
       Standard_Boolean isFirst = Standard_True;
 
       while(anU1 <= anUl)
@@ -1889,8 +1917,8 @@ Standard_Boolean IntCyCyTrim( const IntSurf_Quadric& theQuad1,
             //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 < aNbWLines; i++)
+              isAddingWLEnabled[i] = !isAddedIntoWL[i];
           }
         }
 
@@ -1899,8 +1927,10 @@ Standard_Boolean IntCyCyTrim( const IntSurf_Quadric& theQuad1,
           if((anU1 - anU1crit[i])*aCriticalDelta[i] < 0.0)
           {
             anU1 = anU1crit[i];
-            aWL1FindStatus = 2;
-            aWL2FindStatus = 2;
+
+            for(Standard_Integer i = 0; i < aNbWLines; i++)
+              aWLFindStatus[i] = 2;
+
             break;
           }
         }
@@ -1913,211 +1943,108 @@ Standard_Boolean IntCyCyTrim( const IntSurf_Quadric& theQuad1,
         if(anArg + 1.0 < aNulValue)
           anArg = -1.0;
 
-        Standard_Real aU21 = anEquationCoeffs.mFI2 + acos(anArg);
-        InscribePoint(aUSurf2f, aUSurf2l, aU21, theTol2D, aPeriod, Standard_False);
+        for(Standard_Integer i = 0; i < aNbWLines; i++)
+        {
+          const Standard_Integer aNbPntsWL =  aWLine[i].IsNull() ? 0 :
+                                              aWLine[i]->Curve()->NbPoints();
+          aU2[i] = anEquationCoeffs.mFI2 + anArccosFactor[i]*acos(anArg);
 
+          InscribePoint(aUSurf2f, aUSurf2l, aU2[i], theTol2D, aPeriod, Standard_False);
 
-        const Standard_Integer aNbPntsWL1 = aWLine1.IsNull() ? 0 :
-                                            aWLine1->Curve()->NbPoints();
-        if(aNbPntsWL1 == 0)
-        {//the line have not contained any points yet
-          if(((aUSurf2l - aUSurf2f) >= aPeriod) && 
-              ((Abs(aU21-aUSurf2f) < theTol2D) || (Abs(aU21-aUSurf2l) < theTol2D)))
-          {
-            const Standard_Real anU1Temp = anU1 + aStepMin;
-            Standard_Real anArgTemp = anEquationCoeffs.mB * 
-              cos(anU1Temp - anEquationCoeffs.mFI1) + anEquationCoeffs.mC;
-
-            if(aNulValue > 1.0 - anArg)
-              anArg = 1.0;
-            if(anArg + 1.0 < aNulValue)
-              anArg = -1.0;
-
-            Standard_Real aU2Temp = anEquationCoeffs.mFI2 + acos(anArgTemp);
-            InscribePoint(aUSurf2f, aUSurf2l, aU2Temp, theTol2D, aPeriod, Standard_False);
-            if(2.0*Abs(aU2Temp - aU21) > aPeriod)
+          if(aNbPntsWL == 0)
+          {//the line has not contained any points yet
+            if(((aUSurf2l - aUSurf2f) >= aPeriod) && 
+                ((Abs(aU2[i] - aUSurf2f) < theTol2D) ||
+                  (Abs(aU2[i]-aUSurf2l) < theTol2D)))
             {
-              if(aU2Temp > aU21)
-                aU21 += aPeriod;
-              else
-                aU21 -= aPeriod;
-            }
-          }
-        }
+              const Standard_Real anU1Temp = anU1 + aStepMin;
+              Standard_Real anArgTemp = anEquationCoeffs.mB * 
+                                        cos(anU1Temp - anEquationCoeffs.mFI1) +
+                                        anEquationCoeffs.mC;
 
-        if(aNbPntsWL1 > 0)
-        {//end of the line
-          if(((aUSurf2l - aUSurf2f) >= aPeriod) && 
-              ((Abs(aU21-aUSurf2f) < theTol2D) || (Abs(aU21-aUSurf2l) < theTol2D)))
-          {
-            Standard_Real aU2prev = 0.0, aV2prev = 0.0;
-            if(isTheReverse)
-              aWLine1->Curve()->Value(aNbPntsWL1).ParametersOnS1(aU2prev, aV2prev);
-            else
-              aWLine1->Curve()->Value(aNbPntsWL1).ParametersOnS2(aU2prev, aV2prev);
+              if(aNulValue > 1.0 - anArgTemp)
+                anArgTemp = 1.0;
 
-            if(2.0*Abs(aU2prev - aU21) > aPeriod)
-            {
-              if(aU2prev > aU21)
-                aU21 += aPeriod;
-              else
-                aU21 -= aPeriod;
+              if(anArgTemp + 1.0 < aNulValue)
+                anArgTemp = -1.0;
+
+              Standard_Real aU2Temp = anEquationCoeffs.mFI2 +
+                                      anArccosFactor[i]*acos(anArgTemp);
+
+              InscribePoint(aUSurf2f, aUSurf2l, aU2Temp, theTol2D, aPeriod, Standard_False);
+
+              if(2.0*Abs(aU2Temp - aU2[i]) > aPeriod)
+              {
+                if(aU2Temp > aU2[i])
+                  aU2[i] += aPeriod;
+                else
+                  aU2[i] -= aPeriod;
+              }
             }
           }
-        }
-      
-        Standard_Real aU22 = anEquationCoeffs.mFI2 - acos(anArg);
-        InscribePoint(aUSurf2f, aUSurf2l, aU22, theTol2D, aPeriod, Standard_False);
-
-        const Standard_Integer aNbPntsWL2 = aWLine2.IsNull() ? 0 : 
-                                            aWLine2->Curve()->NbPoints();
-        if(aNbPntsWL2 == 0)
-        {//the line have not contained any points yet
-          if(((aUSurf2l - aUSurf2f) >= aPeriod) && 
-              ((Abs(aU22-aUSurf2f) < theTol2D) || (Abs(aU22-aUSurf2l) < theTol2D)))
+
+          if(aNbPntsWL > 0)
           {
-            const Standard_Real anU1Temp = anU1 + aStepMin;
-            Standard_Real anArgTemp = anEquationCoeffs.mB * 
-              cos(anU1Temp - anEquationCoeffs.mFI1) + anEquationCoeffs.mC;
-
-            if(aNulValue > 1.0 - anArg)
-              anArg = 1.0;
-            if(anArg + 1.0 < aNulValue)
-              anArg = -1.0;
-
-            Standard_Real aU2Temp = anEquationCoeffs.mFI2 - acos(anArgTemp);
-            InscribePoint(aUSurf2f, aUSurf2l, aU2Temp, theTol2D, aPeriod, Standard_False);
-            if(2.0*Abs(aU2Temp - aU22) > aPeriod)
-            {
-              if(aU2Temp > aU21)
-                aU22 += aPeriod;
+            if(((aUSurf2l - aUSurf2f) >= aPeriod) && 
+                ((Abs(aU2[i] - aUSurf2f) < theTol2D) ||
+                  (Abs(aU2[i]-aUSurf2l) < theTol2D)))
+            {//end of the line
+              Standard_Real aU2prev = 0.0, aV2prev = 0.0;
+              if(isTheReverse)
+                aWLine[i]->Curve()->Value(aNbPntsWL).ParametersOnS1(aU2prev, aV2prev);
               else
-                aU22 -= aPeriod;
+                aWLine[i]->Curve()->Value(aNbPntsWL).ParametersOnS2(aU2prev, aV2prev);
+
+              if(2.0*Abs(aU2prev - aU2[i]) > aPeriod)
+              {
+                if(aU2prev > aU2[i])
+                  aU2[i] += aPeriod;
+                else
+                  aU2[i] -= aPeriod;
+              }
             }
           }
-        }
 
-        if(aNbPntsWL2 > 0)
-        {//end of the line
-          if(((aUSurf2l - aUSurf2f) >= aPeriod) && 
-              ((Abs(aU22-aUSurf2f) < theTol2D) || (Abs(aU22-aUSurf2l) < theTol2D)))
-          {
-            Standard_Real aU2prev = 0.0, aV2prev = 0.0;
-            if(isTheReverse)
-              aWLine2->Curve()->Value(aNbPntsWL2).ParametersOnS1(aU2prev, aV2prev);
-            else
-              aWLine2->Curve()->Value(aNbPntsWL2).ParametersOnS2(aU2prev, aV2prev);
+          aV1[i] =  anEquationCoeffs.mK21 * sin(aU2[i]) + 
+                    anEquationCoeffs.mK11 * sin(anU1) +
+                    anEquationCoeffs.mL21 * cos(aU2[i]) +
+                    anEquationCoeffs.mL11 * cos(anU1) + anEquationCoeffs.mM1;
 
-            if(2.0*Abs(aU2prev - aU22) > aPeriod)
-            {
-              if(aU2prev > aU22)
-                aU22 += aPeriod;
-              else
-                aU22 -= aPeriod;
-            }
+          aV2[i] =  anEquationCoeffs.mK22 * sin(aU2[i]) +
+                    anEquationCoeffs.mK12 * sin(anU1) +
+                    anEquationCoeffs.mL22 * cos(aU2[i]) +
+                    anEquationCoeffs.mL12 * cos(anU1) + anEquationCoeffs.mM2;
+
+          if(isFirst)
+          {
+            aV1Prev[i] = aV1[i];
+            aV2Prev[i] = aV2[i];
           }
-        }
+        }//for(Standard_Integer i = 0; i < aNbWLines; i++)
 
-        const Standard_Real aV11 = anEquationCoeffs.mK21 * sin(aU21) + 
-                                    anEquationCoeffs.mK11 * sin(anU1) +
-                                    anEquationCoeffs.mL21 * cos(aU21) +
-                                    anEquationCoeffs.mL11 * cos(anU1) + anEquationCoeffs.mM1;
-        const Standard_Real aV12 = anEquationCoeffs.mK21 * sin(aU22) +
-                                    anEquationCoeffs.mK11 * sin(anU1) +
-                                    anEquationCoeffs.mL21 * cos(aU22) +
-                                    anEquationCoeffs.mL11 * cos(anU1) + anEquationCoeffs.mM1;
-        const Standard_Real aV21 = anEquationCoeffs.mK22 * sin(aU21) +
-                                    anEquationCoeffs.mK12 * sin(anU1) +
-                                    anEquationCoeffs.mL22 * cos(aU21) +
-                                    anEquationCoeffs.mL12 * cos(anU1) + anEquationCoeffs.mM2;
-        const Standard_Real aV22 = anEquationCoeffs.mK22 * sin(aU22) +
-                                    anEquationCoeffs.mK12 * sin(anU1) +
-                                    anEquationCoeffs.mL22 * cos(aU22) +
-                                    anEquationCoeffs.mL12 * cos(anU1) + anEquationCoeffs.mM2;
-
-        if(isFirst)
-        {
-          aV11Prev = aV11;
-          aV12Prev = aV12;
-          aV21Prev = aV21;
-          aV22Prev = aV22;
-          isFirst = Standard_False;
-        }
+        isFirst = Standard_False;
 
-        if(isAddingWL1Enabled)
+        //Looking for points into WLine
+        Standard_Boolean isBroken = Standard_False;
+        for(Standard_Integer i = 0; i < aNbWLines; i++)
         {
-          if( ((aUSurf2f-aU21) <= theTol2D) && 
-              ((aU21-aUSurf2l) <= theTol2D) &&
-              ((aVSurf1f - aV11) <= theTol2D) && 
-              ((aV11 - aVSurf1l) <= theTol2D) &&
-              ((aVSurf2f - aV21) <= theTol2D) && ((aV21 - aVSurf2l) <= theTol2D))
+          if(!isAddingWLEnabled[i])
           {
-            Standard_Boolean isForce = Standard_False;
-            if(!aWL1FindStatus)
-            {
-              Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False;
+            aV1Prev[i] = aV1[i];
+            aV2Prev[i] = aV2[i];
 
-              if(((aUSurf2l - aUSurf2f) >= aPeriod) && (Abs(anU1-aUSurf1l) < theTol2D))
-              {
-                isForce = Standard_True;
-              }
+            if(aWLFindStatus[i] == 2)
+              isBroken = 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(), theTol3D, theTol2D, isForce))
-              {
-                if(!aWL1FindStatus)
-                {
-                  aWL1FindStatus = 1;
-                }
-              }
-            }
+            continue;
           }
-          else
-          {
-            if(aWL1FindStatus == 1)
-            {
-              Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False;
-
-              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(isAddingWL2Enabled)
-        {
-          if( ((aUSurf2f-aU22) <= theTol2D) &&
-              ((aU22-aUSurf2l) <= theTol2D) && 
-              ((aVSurf1f - aV12) <= theTol2D) &&
-              ((aV12 - aVSurf1l) <= theTol2D) &&
-              ((aVSurf2f - aV22) <= theTol2D) &&
-              ((aV22 - aVSurf2l) <= theTol2D))
+          if( ((aUSurf2f-aU2[i]) <= theTol2D) && ((aU2[i]-aUSurf2l) <= theTol2D) &&
+              ((aVSurf1f - aV1[i]) <= theTol2D) && ((aV1[i] - aVSurf1l) <= theTol2D) &&
+              ((aVSurf2f - aV2[i]) <= theTol2D) && ((aV2[i] - aVSurf2l) <= theTol2D))
           {
             Standard_Boolean isForce = Standard_False;
-
-            if(!aWL2FindStatus)
+            if(!aWLFindStatus[i])
             {
               Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False;
 
@@ -2126,241 +2053,177 @@ Standard_Boolean IntCyCyTrim( const IntSurf_Quadric& theQuad1,
                 isForce = Standard_True;
               }
 
-              AddBoundaryPoint(theQuad1, theQuad2, aWLine2, anEquationCoeffs,
+              AddBoundaryPoint( theQuad1, theQuad2, aWLine[i], anEquationCoeffs,
                                 theUVSurf1, theUVSurf2, theTol3D, theTol2D, aPeriod,
-                                aNulValue, anU1, aU22, aV12, aV12Prev,
-                                aV22, aV22Prev, isTheReverse,
-                                -1.0, isForce, isFound1, isFound2);
+                                aNulValue, anU1, aU2[i], aV1[i], aV1Prev[i],
+                                aV2[i], aV2Prev[i], isTheReverse,
+                                anArccosFactor[i], isForce, isFound1, isFound2);
               
               if(isFound1 || isFound2)
               {
-                aWL2FindStatus = 1;
+                aWLFindStatus[i] = 1;
               }
             }
 
-            if((aWL2FindStatus != 2) || (aWLine2->NbPnts() >= 1))
+            if(( aWLFindStatus[i] != 2) || (aWLine[i]->NbPnts() >= 1))
             {
-              if(AddPointIntoWL(theQuad1, theQuad2, isTheReverse,
-                    gp_Pnt2d(anU1, aV12), gp_Pnt2d(aU22, aV22),
-                    aUSurf1f, aUSurf1l, aPeriod,
-                    aWLine2->Curve(), theTol3D, theTol2D, isForce))
+              if(AddPointIntoWL(theQuad1, theQuad2, isTheReverse, 
+                                gp_Pnt2d(anU1, aV1[i]), gp_Pnt2d(aU2[i], aV2[i]),
+                                aUSurf1f, aUSurf1l, aPeriod,
+                                aWLine[i]->Curve(), theTol3D, theTol2D, isForce))
               {
-                if(!aWL2FindStatus)
+                if(!aWLFindStatus[i])
                 {
-                  aWL2FindStatus = 1;
+                  aWLFindStatus[i] = 1;
                 }
               }
             }
           }
           else
           {
-            if(aWL2FindStatus == 1)
+            if(aWLFindStatus[i] == 1)
             {
               Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False;
 
-              AddBoundaryPoint(theQuad1, theQuad2, aWLine2, anEquationCoeffs,
+              AddBoundaryPoint( theQuad1, theQuad2, aWLine[i], anEquationCoeffs,
                                 theUVSurf1, theUVSurf2, theTol3D, theTol2D, aPeriod,
-                                aNulValue, anU1, aU22, aV12, aV12Prev,
-                                aV22, aV22Prev, isTheReverse,
-                                -1.0, Standard_False, isFound1, isFound2);
+                                aNulValue, anU1, aU2[i], aV1[i], aV1Prev[i],
+                                aV2[i], aV2Prev[i], isTheReverse,
+                                anArccosFactor[i], Standard_False, isFound1, isFound2);
 
               if(isFound1 || isFound2)
-                aWL2FindStatus = 2; //start a new line
+                aWLFindStatus[i] = 2; //start a new line
             }
           }
-        }
 
-        aV11Prev = aV11;
-        aV12Prev = aV12;
-        aV21Prev = aV21;
-        aV22Prev = aV22;
+          aV1Prev[i] = aV1[i];
+          aV2Prev[i] = aV2[i];
+
+          if(aWLFindStatus[i] == 2)
+            isBroken = Standard_True;
+        }//for(Standard_Integer i = 0; i < aNbWLines; i++)
 
-        if((aWL1FindStatus == 2) || (aWL2FindStatus == 2))
+        if(isBroken)
         {//current lines are filled. Go to the next lines
           anUf = anU1;
           break;
         }
 
-        Standard_Real aFact1 = !IsEqual(sin(aU21 - anEquationCoeffs.mFI2), 0.0) ? 
-                                  anEquationCoeffs.mK1 * sin(anU1 - anEquationCoeffs.mFIV1) +
-                                  anEquationCoeffs.mL1 * anEquationCoeffs.mB * sin(aU21 - anEquationCoeffs.mPSIV1) *
-                                  sin(anU1 - anEquationCoeffs.mFI1)/sin(aU21-anEquationCoeffs.mFI2) : 0.0,
-                      aFact2 = !IsEqual(sin(aU22-anEquationCoeffs.mFI2), 0.0) ?
-                                  anEquationCoeffs.mK1 * sin(anU1 - anEquationCoeffs.mFIV1) + 
-                                  anEquationCoeffs.mL1 * anEquationCoeffs.mB * sin(aU22 - anEquationCoeffs.mPSIV1) *
-                                  sin(anU1 - anEquationCoeffs.mFI1)/sin(aU22-anEquationCoeffs.mFI2) : 0.0;
-
-        Standard_Real aDeltaV1 = (aVSurf1l - aVSurf1f)/IntToReal(aNbPoints);
-
-        if((aV11 < aVSurf1f) && (aFact1 < 0.0))
-        {//Make close to aVSurf1f by increasing anU1 (for the 1st line)
-          aDeltaV1 = Min(aDeltaV1, Abs(aV11-aVSurf1f));
-        }
-
-        if((aV12 < aVSurf1f) && (aFact2 < 0.0))
-        {//Make close to aVSurf1f by increasing anU1 (for the 2nd line)
-          aDeltaV1 = Min(aDeltaV1, Abs(aV12-aVSurf1f));
-        }
+        //Step computing
 
-        if((aV11 > aVSurf1l) && (aFact1 > 0.0))
-        {//Make close to aVSurf1l by increasing anU1 (for the 1st line)
-          aDeltaV1 = Min(aDeltaV1, Abs(aV11-aVSurf1l));
-        }
-      
-        if((aV12 > aVSurf1l) && (aFact2 > 0.0))
-        {//Make close to aVSurf1l by increasing anU1 (for the 1st line)
-          aDeltaV1 = Min(aDeltaV1, Abs(aV12-aVSurf1l));
-        }
+        Standard_Real aStepU1 = aStepMax;
 
-        Standard_Real aDeltaU1L1 = !IsEqual(aFact1,0.0)? Abs(aDeltaV1/aFact1) : aStepMax,
-                      aDeltaU1L2 = !IsEqual(aFact2,0.0)? Abs(aDeltaV1/aFact2) : aStepMax;
-      
-        const Standard_Real aDeltaU1V1 = Min(aDeltaU1L1, aDeltaU1L2);
+        for(Standard_Integer i = 0; i < aNbWLines; i++)
+        {
+          Standard_Real aDeltaU1V1 = aStepU1, aDeltaU1V2 = aStepU1;
 
-        ///////////////////////////
-        aFact1 = !IsEqual(sin(aU21-anEquationCoeffs.mFI2), 0.0) ? 
-                                  anEquationCoeffs.mK2 * sin(anU1 - anEquationCoeffs.mFIV2) + 
-                                  anEquationCoeffs.mL2 * anEquationCoeffs.mB * sin(aU21 - anEquationCoeffs.mPSIV2) *
-                                  sin(anU1 - anEquationCoeffs.mFI1)/sin(aU21 - anEquationCoeffs.mFI2) : 0.0;
-        aFact2 = !IsEqual(sin(aU22-anEquationCoeffs.mFI2), 0.0) ? 
+          Standard_Real aFact1 = !IsEqual(sin(aU2[i] - anEquationCoeffs.mFI2), 0.0) ? 
+                                  anEquationCoeffs.mK1 * sin(anU1 - anEquationCoeffs.mFIV1) +
+                                  anEquationCoeffs.mL1 * anEquationCoeffs.mB * sin(aU2[i] - anEquationCoeffs.mPSIV1) *
+                                  sin(anU1 - anEquationCoeffs.mFI1)/sin(aU2[i]-anEquationCoeffs.mFI2) : 0.0,
+                        aFact2 = !IsEqual(sin(aU2[i]-anEquationCoeffs.mFI2), 0.0) ? 
                                   anEquationCoeffs.mK2 * sin(anU1 - anEquationCoeffs.mFIV2) + 
-                                  anEquationCoeffs.mL2 * anEquationCoeffs.mB * sin(aU22 - anEquationCoeffs.mPSIV2) *
-                                  sin(anU1 - anEquationCoeffs.mFI1)/sin(aU22 - anEquationCoeffs.mFI2) : 0.0;
-      
-        Standard_Real aDeltaV2 = (aVSurf2l - aVSurf2f)/IntToReal(aNbPoints);
+                                  anEquationCoeffs.mL2 * anEquationCoeffs.mB * sin(aU2[i] - anEquationCoeffs.mPSIV2) *
+                                  sin(anU1 - anEquationCoeffs.mFI1)/sin(aU2[i] - anEquationCoeffs.mFI2) : 0.0;
 
-        if((aV21 < aVSurf2f) && (aFact1 < 0.0))
-        {//Make close to aVSurf2f by increasing anU1 (for the 1st line)
-          aDeltaV2 = Min(aDeltaV2, Abs(aV21-aVSurf2f));
-        }
+          Standard_Real aDeltaV1 = (aVSurf1l - aVSurf1f)/IntToReal(aNbPoints),
+                        aDeltaV2 = (aVSurf2l - aVSurf2f)/IntToReal(aNbPoints);
 
-        if((aV22 < aVSurf2f) && (aFact2 < 0.0))
-        {//Make close to aVSurf1f by increasing anU1 (for the 2nd line)
-          aDeltaV2 = Min(aDeltaV2, Abs(aV22-aVSurf2f));
-        }
+          if((aV1[i] < aVSurf1f) && (aFact1 < 0.0))
+          {//Make close to aVSurf1f by increasing anU1
+            aDeltaV1 = Min(aDeltaV1, Abs(aV1[i]-aVSurf1f));
+          }
 
-        if((aV21 > aVSurf2l) && (aFact1 > 0.0))
-        {//Make close to aVSurf1l by increasing anU1 (for the 1st line)
-          aDeltaV2 = Min(aDeltaV2, Abs(aV21-aVSurf2l));
-        }
+          if((aV1[i] > aVSurf1l) && (aFact1 > 0.0))
+          {//Make close to aVSurf1l by increasing anU1
+            aDeltaV1 = Min(aDeltaV1, Abs(aV1[i]-aVSurf1l));
+          }
 
-        if((aV22 > aVSurf2l) && (aFact2 > 0.0))
-        {//Make close to aVSurf1l by increasing anU1 (for the 1st line)
-          aDeltaV2 = Min(aDeltaV2, Abs(aV22-aVSurf1l));
-        }
+          if((aV2[i] < aVSurf2f) && (aFact2 < 0.0))
+          {//Make close to aVSurf2f by increasing anU1
+            aDeltaV2 = Min(aDeltaV2, Abs(aV2[i]-aVSurf2f));
+          }
+
+          if((aV2[i] > aVSurf2l) && (aFact2 > 0.0))
+          {//Make close to aVSurf2l by increasing anU1
+            aDeltaV2 = Min(aDeltaV2, Abs(aV2[i]-aVSurf1l));
+          }
 
-        aDeltaU1L1 = !IsEqual(aFact1,0.0)? Abs(aDeltaV2/aFact1) : aStepMax;
-        aDeltaU1L2 = !IsEqual(aFact2,0.0)? Abs(aDeltaV2/aFact2) : aStepMax;
+          aDeltaU1V1 = !IsEqual(aFact1,0.0)? Abs(aDeltaV1/aFact1) : aStepMax;
+          aDeltaU1V2 = !IsEqual(aFact2,0.0)? Abs(aDeltaV2/aFact2) : aStepMax;
 
-        const Standard_Real aDeltaU1V2 = Min(aDeltaU1L1, aDeltaU1L2);
+          if(aDeltaU1V1 < aStepU1)
+            aStepU1 = aDeltaU1V1;
 
-        Standard_Real aDeltaU1 = Min(aDeltaU1V1, aDeltaU1V2);
+          if(aDeltaU1V2 < aStepU1)
+            aStepU1 = aDeltaU1V2;
+        }
 
-        if(aDeltaU1 < aStepMin)
-          aDeltaU1 = aStepMin;
+        if(aStepU1 < aStepMin)
+          aStepU1 = aStepMin;
       
-        if(aDeltaU1 > aStepMax)
-          aDeltaU1 = aStepMax;
+        if(aStepU1 > aStepMax)
+          aStepU1 = aStepMax;
 
-        anU1 += aDeltaU1;
+        anU1 += aStepU1;
 
         const Standard_Real aDiff = anU1 - anUl;
-        if((0.0 < aDiff) && (aDiff < aDeltaU1-Precision::PConfusion()))
+        if((0.0 < aDiff) && (aDiff < aStepU1-Precision::PConfusion()))
           anU1 = anUl;
 
         anUf = anU1;
 
-        if(aWLine1->NbPnts() != 1)
-          isAddedIntoWL1 = Standard_False;
-
-        if(aWLine2->NbPnts() != 1)
-          isAddedIntoWL2 = Standard_False;
-      }
-
-      if((aWLine1->NbPnts() == 1) && (!isAddedIntoWL1))
-      {
-        isTheEmpty = Standard_False;
-        Standard_Real u1, v1, u2, v2;
-        aWLine1->Point(1).Parameters(u1, v1, u2, v2);
-        IntPatch_Point aP;
-        aP.SetParameter(u1);
-        aP.SetParameters(u1, v1, u2, v2);
-        aP.SetTolerance(theTol3D);
-        aP.SetValue(aWLine1->Point(1).Value());
-
-        theSPnt.Append(aP);
-      }
-      else if(aWLine1->NbPnts() > 1)
-      {
-        Standard_Boolean isGood = Standard_True;
-
-        if(aWLine1->NbPnts() == 2)
-        {
-          const IntSurf_PntOn2S& aPf = aWLine1->Point(1);
-          const IntSurf_PntOn2S& aPl = aWLine1->Point(2);
-
-          if(aPf.IsSame(aPl, Precision::Confusion()))
-            isGood = Standard_False;
-        }
-
-        if(isGood)
+        for(Standard_Integer i = 0; i < aNbWLines; i++)
         {
-          isTheEmpty = Standard_False;
-          isAddedIntoWL1 = Standard_True;
-          SeekAdditionalPoints( theQuad1, theQuad2, aWLine1->Curve(), 
-                                anEquationCoeffs, aNbPoints, aUSurf2f, aUSurf2l,
-                                theTol2D, aPeriod, 1.0, isTheReverse);
-
-          aWLine1->ComputeVertexParameters(theTol3D);
-          theSlin.Append(aWLine1);
+          if(aWLine[i]->NbPnts() != 1)
+            isAddedIntoWL[i] = Standard_False;
         }
       }
-      else
-      {
-        isAddedIntoWL1 = Standard_False;
-      }
 
-      if((aWLine2->NbPnts() == 1) && (!isAddedIntoWL2))
+      for(Standard_Integer i = 0; i < aNbWLines; i++)
       {
-        isTheEmpty = Standard_False;
-        Standard_Real u1, v1, u2, v2;
-        aWLine2->Point(1).Parameters(u1, v1, u2, v2);
-        IntPatch_Point aP;
-        aP.SetParameter(u1);
-        aP.SetParameters(u1, v1, u2, v2);
-        aP.SetTolerance(theTol3D);
-        aP.SetValue(aWLine2->Point(1).Value());
-
-        theSPnt.Append(aP);
-      }
-      else if(aWLine2->NbPnts() > 1)
-      {
-        Standard_Boolean isGood = Standard_True;
-        if(aWLine2->NbPnts() == 2)
+        if((aWLine[i]->NbPnts() == 1) && (!isAddedIntoWL[i]))
         {
-          const IntSurf_PntOn2S& aPf = aWLine2->Point(1);
-          const IntSurf_PntOn2S& aPl = aWLine2->Point(2);
-
-          if(aPf.IsSame(aPl, Precision::Confusion()))
-            isGood = Standard_False;
+          isTheEmpty = Standard_False;
+          Standard_Real u1, v1, u2, v2;
+          aWLine[i]->Point(1).Parameters(u1, v1, u2, v2);
+          IntPatch_Point aP;
+          aP.SetParameter(u1);
+          aP.SetParameters(u1, v1, u2, v2);
+          aP.SetTolerance(theTol3D);
+          aP.SetValue(aWLine[i]->Point(1).Value());
+
+          theSPnt.Append(aP);
         }
-
-        if(isGood)
+        else if(aWLine[i]->NbPnts() > 1)
         {
-          isTheEmpty = Standard_False;
-          isAddedIntoWL2 = Standard_True;
+          Standard_Boolean isGood = Standard_True;
 
-          SeekAdditionalPoints(theQuad1, theQuad2, aWLine2->Curve(),
-                                anEquationCoeffs, aNbPoints, aUSurf2f, aUSurf2l,
-                                theTol2D, aPeriod, -1.0, isTheReverse);
+          if(aWLine[i]->NbPnts() == 2)
+          {
+            const IntSurf_PntOn2S& aPf = aWLine[i]->Point(1);
+            const IntSurf_PntOn2S& aPl = aWLine[i]->Point(2);
+            
+            if(aPf.IsSame(aPl, Precision::Confusion()))
+              isGood = Standard_False;
+          }
 
-          aWLine2->ComputeVertexParameters(theTol3D);
-          theSlin.Append(aWLine2);
+          if(isGood)
+          {
+            isTheEmpty = Standard_False;
+            isAddedIntoWL[i] = Standard_True;
+            SeekAdditionalPoints( theQuad1, theQuad2, aWLine[i]->Curve(), 
+                                  anEquationCoeffs, aNbPoints, aUSurf2f, aUSurf2l,
+                                  theTol2D, aPeriod, anArccosFactor[i], isTheReverse);
+
+            aWLine[i]->ComputeVertexParameters(theTol3D);
+            theSlin.Append(aWLine[i]);
+          }
+        }
+        else
+        {
+          isAddedIntoWL[i] = Standard_False;
         }
-      }
-      else
-      {
-        isAddedIntoWL2 = Standard_False;
       }
     }
   }
@@ -2556,8 +2419,6 @@ Standard_Boolean IntCyCyTrim( const IntSurf_Quadric& theQuad1,
 
       if(hasBeenRemoved)
         aNumOfLine1--;
-
-      //aWLine1->ComputeVertexParameters(theTol3D);
     }
   }//if(theSlin.Length() > 0)
 
index 28a313f..e82ffda 100644 (file)
@@ -1071,7 +1071,7 @@ void IntPatch_WLine::Dump() const {
   for(i=1;i<=nbp;i++) {
     Standard_Real u1,v1,u2,v2;
     Point(i).Parameters(u1,v1,u2,v2);
-    printf("%4d  [%+5.8e %+5.8e %+5.8e]  [%+5.8e %+5.8e]  [%+5.8e %+5.8e]\n",
+    printf("%4d  [%+10.20f %+10.20f %+10.20f]  [%+10.20f %+10.20f]  [%+10.20f %+10.20f]\n",
           i,
           Point(i).Value().X(),
           Point(i).Value().Y(),
index bb2ddb0..1f38705 100755 (executable)
@@ -40,5 +40,8 @@ if { ${mistake} != 0 } {
   puts "OK ${BugNumber}"
 }
 
-set 2dviewer 0
+vinit
+vdisplay c s result p_2
+vfit
 
+set only_screen 1
index 6a1e214..d09cfe3 100755 (executable)
@@ -42,5 +42,8 @@ if { ${mistake} != 0 } {
   puts "OK ${BugNumber}"
 }
 
-set 2dviewer 0
+vinit
+vdisplay c s result p_1
+vfit
 
+set only_screen 1
index 1b2951c..adba90f 100755 (executable)
@@ -22,7 +22,7 @@ bbuild r
 checkshape r
 
 # 2. geometry
-set MaxTol 3.0e-6
+set MaxTol 5.0e-7
 set log [bopcurves b1 b2]
 
 mksurface s1 b1
@@ -52,7 +52,7 @@ for {set i 1} {$i <= ${NbCurv}} {incr i} {
   xdistcs c_$i s1 ${U1} ${U2} 100
   set Log2 [dlog get]
   set List2 [split ${Log2} {TD= \t\n}]
-  set Tolerance 1.6e-5
+  set Tolerance 1.6e-6
   set Limit_Tol 1.0e-7
   set D_good 0.
   catch {checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}}
@@ -62,7 +62,7 @@ for {set i 1} {$i <= ${NbCurv}} {incr i} {
   xdistcs c_$i s2 ${U1} ${U2} 100
   set Log2 [dlog get]
   set List2 [split ${Log2} {TD= \t\n}]
-  set Tolerance 1.6e-5
+  set Tolerance 1.6e-6
   set Limit_Tol 1.0e-7
   set D_good 0.
   catch {checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}}
index 12b386f..5d4d3d1 100644 (file)
@@ -79,7 +79,7 @@ if {${ind} >= 0} {
   xdistcs res s1 ${U1} ${U2} 10
   set Log1 [dlog get]
   set List1 [split ${Log1} {TD= \t\n}]
-  set Tolerance 3.0e-7
+  set Tolerance 1.0e-7
   set Limit_Tol 1.0e-7
   set D_good 0.
   checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
@@ -89,7 +89,7 @@ if {${ind} >= 0} {
   xdistcs res s2 ${U1} ${U2} 10
   set Log1 [dlog get]
   set List1 [split ${Log1} {TD= \t\n}]
-  set Tolerance 3.0e-7
+  set Tolerance 1.0e-7
   set Limit_Tol 1.0e-7
   set D_good 0.
   checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
@@ -119,7 +119,7 @@ if {${ind} >= 0} {
       xdistcs res_$ic s1 ${U1} ${U2} 10
       set Log1 [dlog get]
       set List1 [split ${Log1} {TD= \t\n}]
-      set Tolerance 3.0e-7
+      set Tolerance 1.0e-7
       set Limit_Tol 1.0e-7
       set D_good 0.
       checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
@@ -129,7 +129,7 @@ if {${ind} >= 0} {
       xdistcs res_$ic s2 0 1 10
       set Log1 [dlog get]
       set List1 [split ${Log1} {TD= \t\n}]
-      set Tolerance 3.0e-7
+      set Tolerance 1.0e-7
       set Limit_Tol 1.0e-7
       set D_good 0.
       checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
index 4cacd66..62fb6b0 100644 (file)
@@ -80,7 +80,7 @@ if {${ind} >= 0} {
   xdistcs res s1 ${U1} ${U2} 10
   set Log1 [dlog get]
   set List1 [split ${Log1} {TD= \t\n}]
-  set Tolerance 3.0e-7
+  set Tolerance 1.0e-7
   set Limit_Tol 1.0e-7
   set D_good 0.
   checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
@@ -90,7 +90,7 @@ if {${ind} >= 0} {
   xdistcs res s2 ${U1} ${U2} 10
   set Log1 [dlog get]
   set List1 [split ${Log1} {TD= \t\n}]
-  set Tolerance 3.0e-7
+  set Tolerance 1.0e-7
   set Limit_Tol 1.0e-7
   set D_good 0.
   checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
@@ -120,7 +120,7 @@ if {${ind} >= 0} {
       xdistcs res_$ic s1 ${U1} ${U2} 10
       set Log1 [dlog get]
       set List1 [split ${Log1} {TD= \t\n}]
-      set Tolerance 3.0e-7
+      set Tolerance 1.0e-7
       set Limit_Tol 1.0e-7
       set D_good 0.
       checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
@@ -130,7 +130,7 @@ if {${ind} >= 0} {
       xdistcs res_$ic s2 0 1 10
       set Log1 [dlog get]
       set List1 [split ${Log1} {TD= \t\n}]
-      set Tolerance 3.0e-7
+      set Tolerance 1.0e-7
       set Limit_Tol 1.0e-7
       set D_good 0.
       checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
index 3e4f25f..1ca2d19 100644 (file)
@@ -80,7 +80,7 @@ if {${ind} >= 0} {
   xdistcs res s1 ${U1} ${U2} 10
   set Log1 [dlog get]
   set List1 [split ${Log1} {TD= \t\n}]
-  set Tolerance 1.1e-7
+  set Tolerance 1.0e-7
   set Limit_Tol 1.0e-7
   set D_good 0.
   checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
@@ -90,7 +90,7 @@ if {${ind} >= 0} {
   xdistcs res s2 ${U1} ${U2} 10
   set Log1 [dlog get]
   set List1 [split ${Log1} {TD= \t\n}]
-  set Tolerance 1.1e-7
+  set Tolerance 1.0e-7
   set Limit_Tol 1.0e-7
   set D_good 0.
   checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
@@ -120,7 +120,7 @@ if {${ind} >= 0} {
       xdistcs res_$ic s1 ${U1} ${U2} 10
       set Log1 [dlog get]
       set List1 [split ${Log1} {TD= \t\n}]
-      set Tolerance 1.1e-7
+      set Tolerance 1.0e-7
       set Limit_Tol 1.0e-7
       set D_good 0.
       checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
@@ -130,7 +130,7 @@ if {${ind} >= 0} {
       xdistcs res_$ic s2 0 1 10
       set Log1 [dlog get]
       set List1 [split ${Log1} {TD= \t\n}]
-      set Tolerance 1.1e-7
+      set Tolerance 1.0e-7
       set Limit_Tol 1.0e-7
       set D_good 0.
       checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
index 9415b69..eb41d95 100644 (file)
@@ -80,7 +80,7 @@ if {${ind} >= 0} {
   xdistcs res s1 ${U1} ${U2} 10
   set Log1 [dlog get]
   set List1 [split ${Log1} {TD= \t\n}]
-  set Tolerance 1.1e-7
+  set Tolerance 1.0e-7
   set Limit_Tol 1.0e-7
   set D_good 0.
   checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
@@ -90,7 +90,7 @@ if {${ind} >= 0} {
   xdistcs res s2 ${U1} ${U2} 10
   set Log1 [dlog get]
   set List1 [split ${Log1} {TD= \t\n}]
-  set Tolerance 1.1e-7
+  set Tolerance 1.0e-7
   set Limit_Tol 1.0e-7
   set D_good 0.
   checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
@@ -120,7 +120,7 @@ if {${ind} >= 0} {
       xdistcs res_$ic s1 ${U1} ${U2} 10
       set Log1 [dlog get]
       set List1 [split ${Log1} {TD= \t\n}]
-      set Tolerance 1.1e-7
+      set Tolerance 1.0e-7
       set Limit_Tol 1.0e-7
       set D_good 0.
       checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
@@ -130,7 +130,7 @@ if {${ind} >= 0} {
       xdistcs res_$ic s2 0 1 10
       set Log1 [dlog get]
       set List1 [split ${Log1} {TD= \t\n}]
-      set Tolerance 1.1e-7
+      set Tolerance 1.0e-7
       set Limit_Tol 1.0e-7
       set D_good 0.
       checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
index 36499ea..ed1b9da 100644 (file)
@@ -24,7 +24,7 @@ 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_31 and bug25292_32 of "bugs modalg_5" testgrid. 
-set MaxTol 3.e-4
+set MaxTol 1.0e-8
 
 #This value must be equal to the analogical value in bug25292_31 and bug25292_32 of "bugs modalg_5" testgrid. 
 set GoodNbCurv 1
@@ -70,8 +70,8 @@ for {set i 1} {$i <= ${NbCurv}} {incr i} {
   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 Tolerance 1.0e-7
+  set Limit_Tol 1.0e-8
   set D_good 0.
   checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}
 
@@ -80,8 +80,8 @@ for {set i 1} {$i <= ${NbCurv}} {incr i} {
   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 Tolerance 1.0e-7
+  set Limit_Tol 1.0e-8
   set D_good 0.
   checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}
 }
index cca229e..5dad932 100644 (file)
@@ -1,5 +1,3 @@
-puts "TODO OCC25331 Debian60-64: Error: Tolerance is too big!"
-
 puts "================"
 puts "OCC25292"
 puts "================"
@@ -26,7 +24,7 @@ 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_31 and bug25292_32 of "bugs modalg_5" testgrid. 
-set MaxTol 3.e-4
+set MaxTol 1.0e-8
 
 #This value must be equal to the analogical value in bug25292_31 and bug25292_32 of "bugs modalg_5" testgrid. 
 set GoodNbCurv 1
@@ -72,8 +70,8 @@ for {set i 1} {$i <= ${NbCurv}} {incr i} {
   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 Tolerance 1.0e-7
+  set Limit_Tol 1.0e-8
   set D_good 0.
   checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}
 
@@ -82,8 +80,8 @@ for {set i 1} {$i <= ${NbCurv}} {incr i} {
   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 Tolerance 1.0e-7
+  set Limit_Tol 1.0e-8
   set D_good 0.
   checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}
 }
index 910a61c..31e9287 100644 (file)
@@ -82,7 +82,7 @@ if {${ind} >= 0} {
   xdistcs res s1 ${U1} ${U2} 10
   set Log1 [dlog get]
   set List1 [split ${Log1} {TD= \t\n}]
-  set Tolerance 3.0e-4
+  set Tolerance 1.0e-7
   set Limit_Tol 1.0e-7
   set D_good 0.
   checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
@@ -92,7 +92,7 @@ if {${ind} >= 0} {
   xdistcs res s2 ${U1} ${U2} 10
   set Log1 [dlog get]
   set List1 [split ${Log1} {TD= \t\n}]
-  set Tolerance 3.0e-4
+  set Tolerance 1.0e-7
   set Limit_Tol 1.0e-7
   set D_good 0.
   checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
@@ -122,7 +122,7 @@ if {${ind} >= 0} {
       xdistcs res_$ic s1 ${U1} ${U2} 10
       set Log1 [dlog get]
       set List1 [split ${Log1} {TD= \t\n}]
-      set Tolerance 3.0e-4
+      set Tolerance 1.0e-7
       set Limit_Tol 1.0e-7
       set D_good 0.
       checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
@@ -132,7 +132,7 @@ if {${ind} >= 0} {
       xdistcs res_$ic s2 0 1 10
       set Log1 [dlog get]
       set List1 [split ${Log1} {TD= \t\n}]
-      set Tolerance 3.0e-4
+      set Tolerance 1.0e-7
       set Limit_Tol 1.0e-7
       set D_good 0.
       checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
index f101127..340567c 100644 (file)
@@ -82,7 +82,7 @@ if {${ind} >= 0} {
   xdistcs res s1 ${U1} ${U2} 10
   set Log1 [dlog get]
   set List1 [split ${Log1} {TD= \t\n}]
-  set Tolerance 3.0e-4
+  set Tolerance 1.0e-7
   set Limit_Tol 1.0e-7
   set D_good 0.
   checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
@@ -92,7 +92,7 @@ if {${ind} >= 0} {
   xdistcs res s2 ${U1} ${U2} 10
   set Log1 [dlog get]
   set List1 [split ${Log1} {TD= \t\n}]
-  set Tolerance 3.0e-4
+  set Tolerance 1.0e-7
   set Limit_Tol 1.0e-7
   set D_good 0.
   checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
@@ -122,7 +122,7 @@ if {${ind} >= 0} {
       xdistcs res_$ic s1 ${U1} ${U2} 10
       set Log1 [dlog get]
       set List1 [split ${Log1} {TD= \t\n}]
-      set Tolerance 3.0e-4
+      set Tolerance 1.0e-7
       set Limit_Tol 1.0e-7
       set D_good 0.
       checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
@@ -132,7 +132,7 @@ if {${ind} >= 0} {
       xdistcs res_$ic s2 0 1 10
       set Log1 [dlog get]
       set List1 [split ${Log1} {TD= \t\n}]
-      set Tolerance 3.0e-4
+      set Tolerance 1.0e-7
       set Limit_Tol 1.0e-7
       set D_good 0.
       checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
index 4a937ac..d3fb0b8 100644 (file)
@@ -6,10 +6,16 @@ puts ""
 # Wrong result of two trimmed cylinders intersection
 ######################################################
 
-set Tolerance 3.0e-7
+set Tolerance 1.1e-7
 set D_good 0.
 set Limit_Tol 1.0e-7
 
+puts "##############################"
+puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!"
+puts "##############################"
+puts ""
+puts ""
+
 restore [locate_data_file OCC25488_sb1_1t.draw] sb1
 restore [locate_data_file OCC25488_sb2_1t.draw] sb2