From 5520ae9665d06e5c161a254b61d7a574f40a15d4 Mon Sep 17 00:00:00 2001
From: azv <azv@opencascade.com>
Date: Thu, 28 May 2015 13:36:57 +0300
Subject: [PATCH] Extract of fixes from 0024682: Move out B-spline cache from
 curves and surfaces to dedicated classes BSplCLib_Cache and BSplSLib_Cache

4. Precised calculation of derivatives of surface of revolution is implemented for the points of surface placed on the axis of revolution (Geom_SurfaceOfRevolution.cxx)

5. Small modifications are made to adjust algorithms to new behavior of B-spline calculation.

6. Test cases were modified according to the modern behavior.

7. Changes in BRepLib_CheckCurveOnSurface to use adaptors instead of geometric entities

9. Added methods to access directly poles, knots, multiplicities of BSpline curves and surfaces
---
 src/BOPTools/BOPTools_AlgoTools_1.cxx        | 10 ++--
 src/BRepFill/BRepFill_OffsetWire.cxx         |  4 +-
 src/BRepLib/BRepLib_CheckCurveOnSurface.cxx  | 13 +++---
 src/BRepLib/BRepLib_MakeEdge.cxx             | 24 ++++++----
 src/BSplCLib/BSplCLib.cxx                    |  1 +
 src/CSLib/CSLib.cxx                          |  8 +++-
 src/Extrema/Extrema_GExtPC.gxx               | 28 ++++++++++++
 src/Geom/Geom_BSplineCurve.cdl               | 30 ++++++++++++
 src/Geom/Geom_BSplineCurve.cxx               |  2 +-
 src/Geom/Geom_BSplineCurve_1.cxx             | 27 +++++++++++
 src/Geom/Geom_BSplineSurface.cdl             | 48 ++++++++++++++++++++
 src/Geom/Geom_BSplineSurface_1.cxx           | 42 +++++++++++++++++
 src/Geom/Geom_SurfaceOfRevolution.cxx        | 27 +++++++++++
 src/Geom2d/Geom2d_BSplineCurve.cdl           | 29 ++++++++++++
 src/Geom2d/Geom2d_BSplineCurve_1.cxx         | 27 +++++++++++
 src/GeomInt/GeomInt_IntSS_1.cxx              | 18 +++++---
 src/GeomLib/GeomLib.cxx                      |  4 ++
 src/IntCurve/IntCurve_IntPolyPolyGen.gxx     | 21 +++++----
 src/IntPatch/IntPatch_ImpPrmIntersection.cxx |  2 +-
 src/ShapeFix/ShapeFix_EdgeProjAux.cxx        |  2 +-
 src/ShapeFix/ShapeFix_Face.cxx               | 10 ++++
 src/ShapeFix/ShapeFix_Wire.cxx               |  6 ++-
 src/math/math_FunctionRoots.cxx              |  3 +-
 src/math/math_TrigonometricFunctionRoots.cxx |  2 +-
 tests/boolean/bfuse_complex/F5               |  1 -
 tests/boolean/bfuse_complex/Q2               |  1 -
 tests/boolean/bsection/M9                    |  5 +-
 tests/boolean/bsection/N4                    |  5 +-
 tests/boolean/volumemaker/F8                 |  2 +-
 tests/bugs/modalg_2/bug5805_21               |  2 +-
 tests/bugs/modalg_2/bug5805_22               |  2 +-
 tests/bugs/modalg_2/bug5805_23               |  2 +-
 tests/bugs/modalg_2/bug5805_24               |  2 +-
 tests/bugs/modalg_4/bug714                   |  2 -
 tests/bugs/modalg_5/bug24303                 |  6 +--
 tests/bugs/modalg_6/bug25908                 |  6 +--
 tests/bugs/moddata_2/bug36                   |  2 +-
 tests/bugs/moddata_2/bug498                  |  2 -
 tests/de/iges_1/F9                           |  2 -
 tests/de/iges_1/J3                           |  6 +--
 tests/de/iges_1/J9                           |  6 +--
 tests/de/iges_1/K3                           | 14 +++---
 tests/de/iges_1/M7                           |  1 -
 tests/de/iges_1/O3                           |  1 -
 tests/de/iges_1/P5                           | 11 +++--
 tests/de/iges_1/P9                           |  4 +-
 tests/de/iges_1/R8                           | 15 +++---
 tests/de/iges_2/B6                           |  4 +-
 tests/de/iges_2/B8                           | 19 ++++----
 tests/de/iges_2/C2                           |  6 +--
 tests/de/iges_2/F1                           |  2 +-
 tests/de/iges_3/A4                           |  2 +-
 tests/de/iges_3/B2                           | 10 ++--
 tests/de/step_1/A3                           |  2 +-
 tests/de/step_1/D9                           |  2 +-
 tests/de/step_1/G9                           |  2 +-
 tests/de/step_1/J6                           |  4 +-
 tests/de/step_1/J8                           |  6 +--
 tests/de/step_2/B5                           |  2 +-
 tests/de/step_2/B6                           |  3 --
 tests/de/step_2/E7                           |  8 ++--
 tests/de/step_2/F4                           |  2 +-
 tests/de/step_2/M4                           |  2 +-
 tests/de/step_2/S1                           |  2 +-
 tests/de/step_2/Y5                           |  4 +-
 tests/de/step_3/A4                           |  4 +-
 tests/de/step_3/A8                           |  2 +-
 tests/de/step_3/A9                           |  1 -
 tests/de/step_3/D3                           |  2 -
 tests/de/step_3/D8                           |  3 +-
 tests/heal/split_angle/F2                    |  2 -
 tests/heal/split_closed_faces/G5             |  1 -
 72 files changed, 439 insertions(+), 146 deletions(-)

diff --git a/src/BOPTools/BOPTools_AlgoTools_1.cxx b/src/BOPTools/BOPTools_AlgoTools_1.cxx
index 1bfcdfc332..10efe77184 100644
--- a/src/BOPTools/BOPTools_AlgoTools_1.cxx
+++ b/src/BOPTools/BOPTools_AlgoTools_1.cxx
@@ -111,7 +111,7 @@ static
 static 
   Standard_Real IntersectCurves2d(const gp_Pnt& aPV,
                                   const TopoDS_Face& aF,
-                                  const Handle(Geom_Surface)& aS,
+                                  const GeomAdaptor_Surface& aS,
                                   const TopoDS_Edge& aE1,
                                   const TopoDS_Edge& aE2);
 
@@ -558,7 +558,7 @@ void CorrectWires(const TopoDS_Face& aFx)
       aT=BRep_Tool::Parameter(aV, aE);
       //
       aC2D->D0(aT, aP2D);
-      aS->D0(aP2D.X(), aP2D.Y(), aP);
+      aGAS.D0(aP2D.X(), aP2D.Y(), aP);
       aD2=aPV.SquareDistance(aP);
       if (aD2>aD2max) {
         aD2max=aD2;
@@ -586,7 +586,7 @@ void CorrectWires(const TopoDS_Face& aFx)
           continue;
         }
         //
-        aD2=IntersectCurves2d(aPV, aF, aS, aE, aE1);
+        aD2=IntersectCurves2d(aPV, aF, aGAS, aE, aE1);
         if (aD2>aD2max) {
           aD2max=aD2;
         }
@@ -606,7 +606,7 @@ void CorrectWires(const TopoDS_Face& aFx)
 //=======================================================================
 Standard_Real IntersectCurves2d(const gp_Pnt& aPV,
                                 const TopoDS_Face& aF,
-                                const Handle(Geom_Surface)& aS,
+                                const GeomAdaptor_Surface& aGAS,
                                 const TopoDS_Edge& aE1,
                                 const TopoDS_Edge& aE2)
 {
@@ -650,7 +650,7 @@ Standard_Real IntersectCurves2d(const gp_Pnt& aPV,
         }          
         //
         aP2D = aPoint.Value();
-        aS->D0(aP2D.X(), aP2D.Y(), aP);
+        aGAS.D0(aP2D.X(), aP2D.Y(), aP);
         aD=aPV.SquareDistance(aP);
         if (aD > aDist) {
           aDist = 1.01 * aD;
diff --git a/src/BRepFill/BRepFill_OffsetWire.cxx b/src/BRepFill/BRepFill_OffsetWire.cxx
index 5d216732b8..926c880dc0 100644
--- a/src/BRepFill/BRepFill_OffsetWire.cxx
+++ b/src/BRepFill/BRepFill_OffsetWire.cxx
@@ -2232,10 +2232,10 @@ void TrimEdge (const TopoDS_Edge&              E,
   // otherwise preserve only one of its representations.
   //----------------------------------------------------------
   if (!BRep_Tool::Degenerated(E)) {
+    Standard_Real aParTol = 2.0 * Precision::PConfusion();
     for (Standard_Integer k = 1; k < TheVer.Length(); k ++) {
       if (TheVer.Value(k).IsSame(TheVer.Value(k+1)) || 
-
-        Abs(ThePar.Value(k)-ThePar.Value(k+1)) <= Precision::PConfusion()) {
+          Abs(ThePar.Value(k)-ThePar.Value(k+1)) <= aParTol) {
 
           if(k+1 == TheVer.Length()) {
             StoreInMap(TheVer(k), TheVer(k+1), MapVV);
diff --git a/src/BRepLib/BRepLib_CheckCurveOnSurface.cxx b/src/BRepLib/BRepLib_CheckCurveOnSurface.cxx
index d8556a4178..321995977e 100644
--- a/src/BRepLib/BRepLib_CheckCurveOnSurface.cxx
+++ b/src/BRepLib/BRepLib_CheckCurveOnSurface.cxx
@@ -26,6 +26,7 @@
 
 #include <GeomAdaptor_HSurface.hxx>
 #include <GeomAdaptor_HCurve.hxx>
+#include <Geom2dAdaptor_HCurve.hxx>
 
 #include <GeomProjLib.hxx>
 
@@ -56,12 +57,12 @@ class BRepLib_CheckCurveOnSurface_GlobOptFunc :
      const Standard_Real theFirst,
      const Standard_Real theLast)
     :
-      myCurve(theC3D),
-      myPCurve(theC2D),
-      mySurf(theSurf),
       myFirst(theFirst),
       myLast(theLast)
   {
+    myCurve = new GeomAdaptor_HCurve(theC3D);
+    myPCurve = new Geom2dAdaptor_HCurve(theC2D);
+    mySurf = new GeomAdaptor_HSurface(theSurf);
   }
   //
   virtual Standard_Integer NbVariables() const {
@@ -160,9 +161,9 @@ class BRepLib_CheckCurveOnSurface_GlobOptFunc :
     return ((myFirst <= theParam) && (theParam <= myLast));
   }
 
-  Handle(Geom_Curve) myCurve;
-  Handle(Geom2d_Curve) myPCurve;
-  Handle(Geom_Surface) mySurf;
+  Handle(GeomAdaptor_HCurve) myCurve;
+  Handle(Geom2dAdaptor_HCurve) myPCurve;
+  Handle(GeomAdaptor_HSurface) mySurf;
   Standard_Real myFirst;
   Standard_Real myLast;
 };
diff --git a/src/BRepLib/BRepLib_MakeEdge.cxx b/src/BRepLib/BRepLib_MakeEdge.cxx
index 74e99407ac..13fc409092 100644
--- a/src/BRepLib/BRepLib_MakeEdge.cxx
+++ b/src/BRepLib/BRepLib_MakeEdge.cxx
@@ -773,7 +773,7 @@ void  BRepLib_MakeEdge::Init(const Handle(Geom_Curve)& CC,
   Standard_Real cl = C->LastParameter();
   Standard_Real epsilon = Precision::PConfusion();
   Standard_Boolean periodic = C->IsPeriodic();
-
+  GeomAdaptor_Curve aCA(C);
 
   TopoDS_Vertex V1,V2;
   if (periodic) {
@@ -813,14 +813,15 @@ void  BRepLib_MakeEdge::Init(const Handle(Geom_Curve)& CC,
   Standard_Boolean p1inf = Precision::IsNegativeInfinite(p1);
   Standard_Boolean p2inf = Precision::IsPositiveInfinite(p2);
   gp_Pnt P1,P2;
-  if (!p1inf) P1 = C->Value(p1);
-  if (!p2inf) P2 = C->Value(p2);
+  if (!p1inf) P1 = aCA.Value(p1);
+  if (!p2inf) P2 = aCA.Value(p2);
 
   Standard_Real preci = BRepLib::Precision();
   BRep_Builder B;
 
   // check for closed curve
   Standard_Boolean closed = Standard_False;
+  Standard_Boolean degenerated = Standard_False;
   if (!p1inf && !p2inf)
     closed = (P1.Distance(P2) <= preci);
 
@@ -836,13 +837,19 @@ void  BRepLib_MakeEdge::Init(const Handle(Geom_Curve)& CC,
       V2 = V1;
     else {
       if (!V1.IsSame(V2)) {
-	myError = BRepLib_DifferentPointsOnClosedCurve;
-	return;
+        myError = BRepLib_DifferentPointsOnClosedCurve;
+        return;
       }
       else if (P1.Distance(BRep_Tool::Pnt(V1)) > 
-	       Max(preci,BRep_Tool::Tolerance(V1))) {
-	myError = BRepLib_DifferentPointsOnClosedCurve;
-	return;
+        Max(preci,BRep_Tool::Tolerance(V1))) {
+        myError = BRepLib_DifferentPointsOnClosedCurve;
+        return;
+      }
+      else
+      {
+        gp_Pnt PM = aCA.Value((p1+p2)/2);
+        if (P1.Distance(PM) < preci)
+          degenerated = Standard_True;
       }
     }
   }
@@ -898,6 +905,7 @@ void  BRepLib_MakeEdge::Init(const Handle(Geom_Curve)& CC,
     B.Add(E,V2);
   }
   B.Range(E,p1,p2);
+  B.Degenerated(E, degenerated);
 
   myError = BRepLib_EdgeDone;
   Done();
diff --git a/src/BSplCLib/BSplCLib.cxx b/src/BSplCLib/BSplCLib.cxx
index 0357c7e31d..c87c5b76c8 100644
--- a/src/BSplCLib/BSplCLib.cxx
+++ b/src/BSplCLib/BSplCLib.cxx
@@ -73,6 +73,7 @@ void BSplCLib::Hunt (const Array1OfReal& XX,
 {
   // replaced by simple dichotomy (RLE)
   Ilc = XX.Lower();
+  if (XX.Length() <= 1) return;
   const Standard_Real *px = &XX(Ilc);
   px -= Ilc;
 
diff --git a/src/CSLib/CSLib.cxx b/src/CSLib/CSLib.cxx
index 77c35067db..f2f341470a 100644
--- a/src/CSLib/CSLib.cxx
+++ b/src/CSLib/CSLib.cxx
@@ -165,7 +165,13 @@ gp_Dir&              Normal
 //     if (D1UMag <= MagTol || D1VMag <= MagTol && NMag > MagTol) MagTol = 2* NMag;
 }
   else
-     { Normal = gp_Dir (D1UvD1V);   Status = Defined; }
+  {
+    // Firstly normalize tangent vectors D1U and D1V (this method is more stable)
+    gp_Dir aD1U(D1U);
+    gp_Dir aD1V(D1V);
+    Normal = gp_Dir(aD1U.Crossed(aD1V));
+    Status = Defined;
+  }
   
 
 }
diff --git a/src/Extrema/Extrema_GExtPC.gxx b/src/Extrema/Extrema_GExtPC.gxx
index 5828922412..5a0d0bf69c 100644
--- a/src/Extrema/Extrema_GExtPC.gxx
+++ b/src/Extrema/Extrema_GExtPC.gxx
@@ -146,6 +146,34 @@ void Extrema_GExtPC::Perform(const ThePoint& P)
         IntExtIsDone = IntExtIsDone || mydone;
       }
       mydone = IntExtIsDone;
+
+      // Additional checking if the point is on the first or last point of the curve and does not added yet
+      if (mydist1 < Precision::SquareConfusion() || mydist2 < Precision::SquareConfusion())
+      {
+        Standard_Boolean isFirstAdded = Standard_False;
+        Standard_Boolean isLastAdded  = Standard_False;
+        Standard_Integer aNbPoints = mypoint.Length();
+        for (i = 1; i <= aNbPoints; i++)
+        {
+          U = mypoint.Value(i).Parameter();
+          if (Abs(U - myuinf) < mytolu)
+            isFirstAdded = Standard_True;
+          else if (Abs(myusup - U) < mytolu)
+            isLastAdded = Standard_True;
+        }
+        if (!isFirstAdded && mydist1 < Precision::SquareConfusion())
+        {
+          mySqDist.Prepend(mydist1);
+          myismin.Prepend(Standard_True);
+          mypoint.Prepend(ThePOnC(myuinf, Pf));
+        }
+        if (!isLastAdded && mydist2 < Precision::SquareConfusion())
+        {
+          mySqDist.Append(mydist2);
+          myismin.Append(Standard_True);
+          mypoint.Append(ThePOnC(myusup, Pl));
+        }
+      }
       return;
     }
   }
diff --git a/src/Geom/Geom_BSplineCurve.cdl b/src/Geom/Geom_BSplineCurve.cdl
index 40ba005ce4..37ab870949 100644
--- a/src/Geom/Geom_BSplineCurve.cdl
+++ b/src/Geom/Geom_BSplineCurve.cdl
@@ -789,6 +789,15 @@ is
      raises DimensionError;
         ---Purpose :
         --  Raised if the length of K is not equal to the number of knots.
+  Knots (me)
+  returns Array1OfReal from TColStd
+        ---Purpose : returns the knot values of the B-spline curve; 
+    	-- Warning
+    	-- A knot with a multiplicity greater than 1 is not
+    	-- repeated in the knot table. The Multiplicity function
+    	-- can be used to obtain the multiplicity of each knot.
+        ---C++ : return const &
+  is static;
 
 
   KnotSequence (me; K : out Array1OfReal from TColStd)
@@ -845,6 +854,12 @@ is
     	-- Standard_DimensionError if the array K is not of
     	-- the appropriate length.Returns the knots sequence.
              raises DimensionError;
+  KnotSequence (me)
+  returns Array1OfReal from TColStd
+        ---Purpose : returns the knots of the B-spline curve. 
+    	-- Knots with multiplicit greater than 1 are repeated
+        ---C++ : return const &
+  is static;
        
 
 
@@ -910,6 +925,11 @@ is
      raises DimensionError;
         ---Purpose :
         --  Raised if the length of M is not equal to NbKnots.
+  Multiplicities (me)
+  returns Array1OfInteger from TColStd
+        ---Purpose : returns the multiplicity of the knots of the curve.
+        ---C++ : return const &
+  is static;
 
 
   NbKnots (me)  returns Integer;
@@ -933,6 +953,11 @@ is
      raises DimensionError;
         ---Purpose : 
         --  Raised if the length of P is not equal to the number of poles.
+  Poles (me)
+  returns Array1OfPnt from TColgp
+        ---Purpose : Returns the poles of the B-spline curve;
+        ---C++ : return const &
+  is static;
 
 
   StartPoint (me)  returns Pnt;
@@ -954,6 +979,11 @@ is
      raises DimensionError;
         ---Purpose :
         --  Raised if the length of W is not equal to NbPoles.
+  Weights (me)
+  returns Array1OfReal from TColStd
+        ---Purpose : Returns the weights of the B-spline curve;
+        ---C++ : return const &
+  is static;
 
 
 
diff --git a/src/Geom/Geom_BSplineCurve.cxx b/src/Geom/Geom_BSplineCurve.cxx
index 01a3a06394..a6104085c4 100644
--- a/src/Geom/Geom_BSplineCurve.cxx
+++ b/src/Geom/Geom_BSplineCurve.cxx
@@ -598,7 +598,7 @@ void Geom_BSplineCurve::Segment(const Standard_Real U1,
 
   BSplCLib::LocateParameter(deg,knots->Array1(),mults->Array1(),
 			    NewU2,periodic,FromU1,ToU2,index2,U);
-  if ( Abs(knots->Value(index2+1)-U) <= Eps)
+  if ( Abs(knots->Value(index2+1)-U) <= Eps || index2 == index1)
     index2++;
   
   Standard_Integer nbknots = index2 - index1 + 1;
diff --git a/src/Geom/Geom_BSplineCurve_1.cxx b/src/Geom/Geom_BSplineCurve_1.cxx
index ec08ce5a43..7cc8d4f803 100644
--- a/src/Geom/Geom_BSplineCurve_1.cxx
+++ b/src/Geom/Geom_BSplineCurve_1.cxx
@@ -437,6 +437,11 @@ void Geom_BSplineCurve::Knots (TColStd_Array1OfReal& K) const
   K = knots->Array1();
 }
 
+const TColStd_Array1OfReal& Geom_BSplineCurve::Knots() const
+{
+  return knots->Array1();
+}
+
 //=======================================================================
 //function : KnotSequence
 //purpose  : 
@@ -449,6 +454,11 @@ void Geom_BSplineCurve::KnotSequence (TColStd_Array1OfReal& K) const
   K = flatknots->Array1();
 }
 
+const TColStd_Array1OfReal& Geom_BSplineCurve::KnotSequence() const
+{
+  return flatknots->Array1();
+}
+
 //=======================================================================
 //function : LastUKnotIndex
 //purpose  : 
@@ -668,6 +678,11 @@ void Geom_BSplineCurve::Multiplicities (TColStd_Array1OfInteger& M) const
   M = mults->Array1();
 }
 
+const TColStd_Array1OfInteger& Geom_BSplineCurve::Multiplicities() const
+{
+  return mults->Array1();
+}
+
 //=======================================================================
 //function : NbKnots
 //purpose  : 
@@ -708,6 +723,11 @@ void Geom_BSplineCurve::Poles (TColgp_Array1OfPnt& P) const
   P = poles->Array1();
 }
 
+const TColgp_Array1OfPnt& Geom_BSplineCurve::Poles() const
+{
+  return poles->Array1();
+}
+
 //=======================================================================
 //function : StartPoint
 //purpose  : 
@@ -757,6 +777,13 @@ void Geom_BSplineCurve::Weights
   }
 }
 
+const TColStd_Array1OfReal& Geom_BSplineCurve::Weights() const
+{
+  if (IsRational())
+    return weights->Array1();
+  return BSplCLib::NoWeights();
+}
+
 //=======================================================================
 //function : IsRational
 //purpose  : 
diff --git a/src/Geom/Geom_BSplineSurface.cdl b/src/Geom/Geom_BSplineSurface.cdl
index d1ddf3e147..bbe47667f9 100644
--- a/src/Geom/Geom_BSplineSurface.cdl
+++ b/src/Geom/Geom_BSplineSurface.cdl
@@ -1017,6 +1017,11 @@ is
        ---Purpose :
        --  Raised if the length of P in the U and V direction
        --  is not equal to NbUpoles and NbVPoles.
+  Poles (me)
+  returns Array2OfPnt from TColgp
+       ---Purpose : Returns the poles of the B-spline surface.
+       ---C++ : return const &
+  is static;
 
 
   UDegree (me)  returns Integer;
@@ -1055,6 +1060,11 @@ is
        	---Purpose :
        	--  Raised if the length of Ku is not equal to the number of knots
        	--  in the U direction.
+  UKnots (me)
+  returns Array1OfReal from TColStd
+       ---Purpose : Returns the knots in the U direction.
+       ---C++ : return const &
+  is static;
 
 
   UKnotSequence (me; Ku : out Array1OfReal from TColStd)
@@ -1066,6 +1076,15 @@ is
      raises DimensionError;
         ---Purpose :
         --  Raised if the length of Ku is not equal to NbUPoles + UDegree + 1
+  UKnotSequence (me)
+  returns Array1OfReal from TColStd
+        ---Purpose : Returns the uknots sequence.
+        --  In this sequence the knots with a multiplicity greater than 1
+        --  are repeated.
+        --- Example :
+        --  Ku = {k1, k1, k1, k2, k3, k3, k4, k4, k4}
+        ---C++ : return const &
+  is static;
 
 
   UMultiplicity (me; UIndex : Integer)   returns Integer
@@ -1083,6 +1102,11 @@ is
        	---Purpose :
        	--  Raised if the length of Mu is not equal to the number of
        	--  knots in the U direction.
+  UMultiplicities (me)
+  returns Array1OfInteger from TColStd
+       ---Purpose : Returns the multiplicities of the knots in the U direction.
+       ---C++ : return const &
+  is static;
 
 
   VDegree (me)  returns Integer;
@@ -1120,6 +1144,11 @@ is
        ---Purpose :
        --  Raised if the length of Kv is not equal to the number of 
        --  knots in the V direction.
+  VKnots (me)
+  returns Array1OfReal from TColStd
+       ---Purpose : Returns the knots in the V direction.
+       ---C++ : return const &
+  is static;
 
 
   VKnotSequence (me; Kv : out Array1OfReal from TColStd)
@@ -1131,6 +1160,15 @@ is
      raises DimensionError;
         ---Purpose :
         --  Raised if the length of Kv is not equal to NbVPoles + VDegree + 1
+  VKnotSequence (me)
+  returns Array1OfReal from TColStd
+        ---Purpose : Returns the vknots sequence.
+        --  In this sequence the knots with a multiplicity greater than 1
+        --  are repeated.
+        --- Example :
+        --  Ku = {k1, k1, k1, k2, k3, k3, k4, k4, k4}
+        ---C++ : return const &
+  is static;
 
 
   VMultiplicity (me; VIndex : Integer)   returns Integer
@@ -1148,6 +1186,11 @@ is
        ---Purpose :
        --  Raised if the length of Mv is not equal to the number of 
        --  knots in the V direction.
+  VMultiplicities (me)
+  returns Array1OfInteger from TColStd
+       ---Purpose : Returns the multiplicities of the knots in the V direction.
+       ---C++ : return const &
+  is static;
 
 
   Weight (me; UIndex, VIndex : Integer)   returns Real
@@ -1164,6 +1207,11 @@ is
         ---Purpose :
         --  Raised if the length of W in the U and V direction is 
         --  not equal to NbUPoles and NbVPoles.
+  Weights (me)
+  returns Array2OfReal from TColStd
+        ---Purpose : Returns the weights of the B-spline surface.
+        ---C++ : return const &
+  is static;
 
 
 
diff --git a/src/Geom/Geom_BSplineSurface_1.cxx b/src/Geom/Geom_BSplineSurface_1.cxx
index 20ea22e5b4..8b7fec2ebf 100644
--- a/src/Geom/Geom_BSplineSurface_1.cxx
+++ b/src/Geom/Geom_BSplineSurface_1.cxx
@@ -542,6 +542,11 @@ void Geom_BSplineSurface::Poles (TColgp_Array2OfPnt& P) const
   P = poles->Array2();
 }
 
+const TColgp_Array2OfPnt& Geom_BSplineSurface::Poles() const
+{
+  return poles->Array2();
+}
+
 //=======================================================================
 //function : UIso
 //purpose  : 
@@ -645,6 +650,11 @@ void Geom_BSplineSurface::UKnots (TColStd_Array1OfReal& Ku) const
   Ku = uknots->Array1();
 }
 
+const TColStd_Array1OfReal& Geom_BSplineSurface::UKnots() const
+{
+  return uknots->Array1();
+}
+
 //=======================================================================
 //function : VKnots
 //purpose  : 
@@ -656,6 +666,11 @@ void Geom_BSplineSurface::VKnots (TColStd_Array1OfReal& Kv) const
   Kv = vknots->Array1();
 }
 
+const TColStd_Array1OfReal& Geom_BSplineSurface::VKnots() const
+{
+  return vknots->Array1();
+}
+
 //=======================================================================
 //function : UKnotSequence
 //purpose  : 
@@ -667,6 +682,11 @@ void Geom_BSplineSurface::UKnotSequence (TColStd_Array1OfReal& Ku) const
   Ku = ufknots->Array1();
 }
 
+const TColStd_Array1OfReal& Geom_BSplineSurface::UKnotSequence() const
+{
+  return ufknots->Array1();
+}
+
 //=======================================================================
 //function : VKnotSequence
 //purpose  : 
@@ -678,6 +698,11 @@ void Geom_BSplineSurface::VKnotSequence (TColStd_Array1OfReal& Kv) const
   Kv = vfknots->Array1();
 }
 
+const TColStd_Array1OfReal& Geom_BSplineSurface::VKnotSequence() const
+{
+  return vfknots->Array1();
+}
+
 //=======================================================================
 //function : UMultiplicity
 //purpose  : 
@@ -701,6 +726,11 @@ void Geom_BSplineSurface::UMultiplicities (TColStd_Array1OfInteger& Mu) const
   Mu = umults->Array1();
 }
 
+const TColStd_Array1OfInteger& Geom_BSplineSurface::UMultiplicities() const
+{
+  return umults->Array1();
+}
+
 //=======================================================================
 //function : VIso
 //purpose  : 
@@ -798,6 +828,11 @@ void Geom_BSplineSurface::VMultiplicities (TColStd_Array1OfInteger& Mv) const
   Mv = vmults->Array1();
 }
 
+const TColStd_Array1OfInteger& Geom_BSplineSurface::VMultiplicities() const
+{
+  return vmults->Array1();
+}
+
 //=======================================================================
 //function : Weight
 //purpose  : 
@@ -826,6 +861,13 @@ void Geom_BSplineSurface::Weights (TColStd_Array2OfReal& W) const
   W = weights->Array2();
 }
 
+const TColStd_Array2OfReal& Geom_BSplineSurface::Weights() const
+{
+  if (urational || vrational)
+    return weights->Array2();
+  return BSplSLib::NoWeights();
+}
+
 //=======================================================================
 //function : Transform
 //purpose  : 
diff --git a/src/Geom/Geom_SurfaceOfRevolution.cxx b/src/Geom/Geom_SurfaceOfRevolution.cxx
index 2f28155511..b2fc9ba9c1 100644
--- a/src/Geom/Geom_SurfaceOfRevolution.cxx
+++ b/src/Geom/Geom_SurfaceOfRevolution.cxx
@@ -397,6 +397,10 @@ void Geom_SurfaceOfRevolution::D1
       XYZ Vdir = direction.XYZ();                        //Vdir
       Q.Subtract(C);                                     //CQ
       XYZ VcrossCQ  = Vdir.Crossed (Q);                  //Vdir^CQ
+      // If the point is placed on the axis of revolution then derivatives on U are undefined.
+      // Manually set them to zero.
+      if (VcrossCQ.SquareModulus() < Precision::SquareConfusion())
+        VcrossCQ.SetCoord(0.0, 0.0, 0.0);
       XYZ VcrossDQv = Vdir.Crossed (DQv);                //(Vdir^Q')
       XYZ VdotCQ    = Vdir.Multiplied (Vdir.Dot(Q));     //(Vdir.CQ)Vdir
       XYZ VdotDQv   = Vdir.Multiplied (Vdir.Dot(DQv));   //(Vdir.Q')Vdir
@@ -463,6 +467,10 @@ void Geom_SurfaceOfRevolution::D2
       XYZ Vdir  = direction.XYZ();                          //Vdir
       Q.Subtract(C);                                        //CQ
       XYZ VcrossCQ   = Vdir.Crossed (Q);                    //Vdir^CQ
+      // If the point is placed on the axis of revolution then derivatives on U are undefined.
+      // Manually set them to zero.
+      if (VcrossCQ.SquareModulus() < Precision::SquareConfusion())
+        VcrossCQ.SetCoord(0.0, 0.0, 0.0);
       XYZ VcrossD1Qv = Vdir.Crossed (D1Qv);                 //(Vdir^Q')
       XYZ VcrossD2Qv = Vdir.Crossed (D2Qv);                 //(Vdir^Q")
       XYZ VdotCQ     = Vdir.Multiplied (Vdir.Dot(Q));       //(Vdir.CQ)Vdir
@@ -558,6 +566,10 @@ void Geom_SurfaceOfRevolution::D3
       XYZ Vdir  = direction.XYZ();                          //Vdir
       Q.Subtract(C);                                        //CQ
       XYZ VcrossCQ   = Vdir.Crossed (Q);                    //Vdir^CQ
+      // If the point is placed on the axis of revolution then derivatives on U are undefined.
+      // Manually set them to zero.
+      if (VcrossCQ.SquareModulus() < Precision::SquareConfusion())
+        VcrossCQ.SetCoord(0.0, 0.0, 0.0);
       XYZ VcrossD1Qv = Vdir.Crossed (D1Qv);                 //(Vdir^Q')
       XYZ VcrossD2Qv = Vdir.Crossed (D2Qv);                 //(Vdir^Q")
       XYZ VcrossD3Qv = Vdir.Crossed (D3Qv);                 //(Vdir^Q''')
@@ -763,6 +775,11 @@ void Geom_SurfaceOfRevolution::LocalD1 (const Standard_Real    U,
 	 XYZ Vdir = direction.XYZ();                        //Vdir
 	 Q.Subtract(C);                                     //CQ
 	 XYZ VcrossCQ  = Vdir.Crossed (Q);                  //Vdir^CQ
+      // If the point is placed on the axis of revolution then derivatives on U are undefined.
+      // Manually set them to zero.
+      if (VcrossCQ.SquareModulus() < Precision::SquareConfusion())
+        VcrossCQ.SetCoord(0.0, 0.0, 0.0);
+
 	 XYZ VcrossDQv = Vdir.Crossed (DQv);                //(Vdir^Q')
 	 XYZ VdotCQ    = Vdir.Multiplied (Vdir.Dot(Q));     //(Vdir.CQ)Vdir
 	 XYZ VdotDQv   = Vdir.Multiplied (Vdir.Dot(DQv));   //(Vdir.Q')Vdir
@@ -818,6 +835,11 @@ void Geom_SurfaceOfRevolution::LocalD2 (const Standard_Real    U,
 	  XYZ Vdir  = direction.XYZ();                           //Vdir
 	  Q.Subtract(C);                                         //CQ
 	  XYZ VcrossCQ   = Vdir.Crossed (Q);                     //Vdir^CQ
+      // If the point is placed on the axis of revolution then derivatives on U are undefined.
+      // Manually set them to zero.
+      if (VcrossCQ.SquareModulus() < Precision::SquareConfusion())
+        VcrossCQ.SetCoord(0.0, 0.0, 0.0);
+
 	  XYZ VcrossD1Qv = Vdir.Crossed (D1Qv);                  //(Vdir^Q')
 	  XYZ VcrossD2Qv = Vdir.Crossed (D2Qv);                  //(Vdir^Q")
 	  XYZ VdotCQ     = Vdir.Multiplied (Vdir.Dot(Q));        //(Vdir.CQ)Vdir
@@ -896,6 +918,11 @@ void Geom_SurfaceOfRevolution::LocalD3 (const Standard_Real    U,
 	  XYZ Vdir  = direction.XYZ();                          //Vdir
 	  Q.Subtract(C);                                        //CQ
 	  XYZ VcrossCQ   = Vdir.Crossed (Q);                    //Vdir^CQ
+      // If the point is placed on the axis of revolution then derivatives on U are undefined.
+      // Manually set them to zero.
+      if (VcrossCQ.SquareModulus() < Precision::SquareConfusion())
+        VcrossCQ.SetCoord(0.0, 0.0, 0.0);
+
 	  XYZ VcrossD1Qv = Vdir.Crossed (D1Qv);                 //(Vdir^Q')
 	  XYZ VcrossD2Qv = Vdir.Crossed (D2Qv);                 //(Vdir^Q")
 	  XYZ VcrossD3Qv = Vdir.Crossed (D3Qv);                 //(Vdir^Q''')
diff --git a/src/Geom2d/Geom2d_BSplineCurve.cdl b/src/Geom2d/Geom2d_BSplineCurve.cdl
index 0196187a54..64c93263c9 100644
--- a/src/Geom2d/Geom2d_BSplineCurve.cdl
+++ b/src/Geom2d/Geom2d_BSplineCurve.cdl
@@ -843,6 +843,11 @@ is
      raises DimensionError;
         --- Purpose :
         --  Raised if the length of K is not equal to the number of knots.
+  Knots (me)
+  returns Array1OfReal from TColStd
+        ---Purpose : returns the knot values of the B-spline curve;
+        ---C++ : return const &
+  is static;
 
 
   KnotSequence (me; K : out Array1OfReal from TColStd)
@@ -854,6 +859,15 @@ is
      raises DimensionError;
         --- Purpose :
         --  Raised if the length of K is not equal to NbPoles + Degree + 1
+  KnotSequence (me)
+  returns Array1OfReal from TColStd
+        ---Purpose : Returns the knots sequence.
+        --  In this sequence the knots with a multiplicity greater than 1
+        --  are repeated. 
+        -- Example :
+        --  K = {k1, k1, k1, k2, k3, k3, k4, k4, k4}
+        ---C++ : return const &
+  is static;
 
 
 
@@ -919,6 +933,11 @@ is
      raises DimensionError;
         --- Purpose :
         --  Raised if the length of M is not equal to NbKnots.
+  Multiplicities (me)
+  returns Array1OfInteger from TColStd
+        ---Purpose : returns the multiplicity of the knots of the curve.
+        ---C++ : return const &
+  is static;
 
 
   NbKnots (me)  returns Integer;
@@ -942,6 +961,11 @@ is
      raises DimensionError;
         --- Purpose : 
         --  Raised if the length of P is not equal to the number of poles.
+  Poles (me)
+  returns Array1OfPnt2d from TColgp
+        ---Purpose : Returns the poles of the B-spline curve;
+        ---C++ : return const &
+  is static;
 
 
   StartPoint (me)  returns Pnt2d;
@@ -963,6 +987,11 @@ is
      raises DimensionError;
         --- Purpose :
         --  Raised if the length of W is not equal to NbPoles.
+  Weights (me)
+  returns Array1OfReal from TColStd
+        ---Purpose : Returns the weights of the B-spline curve;
+        ---C++ : return const &
+  is static;
 
 
 
diff --git a/src/Geom2d/Geom2d_BSplineCurve_1.cxx b/src/Geom2d/Geom2d_BSplineCurve_1.cxx
index b80b4151e2..3541ed8e97 100644
--- a/src/Geom2d/Geom2d_BSplineCurve_1.cxx
+++ b/src/Geom2d/Geom2d_BSplineCurve_1.cxx
@@ -440,6 +440,11 @@ void Geom2d_BSplineCurve::Knots (TColStd_Array1OfReal& K) const
   K = knots->Array1();
 }
 
+const TColStd_Array1OfReal& Geom2d_BSplineCurve::Knots() const
+{
+  return knots->Array1();
+}
+
 //=======================================================================
 //function : KnotSequence
 //purpose  : 
@@ -452,6 +457,11 @@ void Geom2d_BSplineCurve::KnotSequence (TColStd_Array1OfReal& K) const
   K = flatknots->Array1();
 }
 
+const TColStd_Array1OfReal& Geom2d_BSplineCurve::KnotSequence() const
+{
+  return flatknots->Array1();
+}
+
 //=======================================================================
 //function : LastUKnotIndex
 //purpose  : 
@@ -676,6 +686,11 @@ void Geom2d_BSplineCurve::Multiplicities (TColStd_Array1OfInteger& M) const
   M = mults->Array1();
 }
 
+const TColStd_Array1OfInteger& Geom2d_BSplineCurve::Multiplicities() const
+{
+  return mults->Array1();
+}
+
 //=======================================================================
 //function : NbKnots
 //purpose  : 
@@ -716,6 +731,11 @@ void Geom2d_BSplineCurve::Poles (TColgp_Array1OfPnt2d& P) const
   P = poles->Array1();
 }
 
+const TColgp_Array1OfPnt2d& Geom2d_BSplineCurve::Poles() const
+{
+  return poles->Array1();
+}
+
 //=======================================================================
 //function : StartPoint
 //purpose  : 
@@ -764,6 +784,13 @@ void Geom2d_BSplineCurve::Weights
   }
 }
 
+const TColStd_Array1OfReal& Geom2d_BSplineCurve::Weights() const
+{
+  if (IsRational())
+    return weights->Array1();
+  return BSplCLib::NoWeights();
+}
+
 //=======================================================================
 //function : IsRational
 //purpose  : 
diff --git a/src/GeomInt/GeomInt_IntSS_1.cxx b/src/GeomInt/GeomInt_IntSS_1.cxx
index c6a164b9f9..90b8db746e 100644
--- a/src/GeomInt/GeomInt_IntSS_1.cxx
+++ b/src/GeomInt/GeomInt_IntSS_1.cxx
@@ -958,13 +958,19 @@ void GeomInt_IntSS::MakeCurve(const Standard_Integer Index,
               Standard_Real aDist = Max(BS->StartPoint().XYZ().SquareModulus(),
                 BS->EndPoint().XYZ().SquareModulus());
               Standard_Real eps = Epsilon(aDist);
-              if(BS->StartPoint().SquareDistance(BS->EndPoint()) < 2.*eps &&
-                !BS->IsClosed() && !BS->IsPeriodic())
+              if(BS->StartPoint().SquareDistance(BS->EndPoint()) < 2.*eps)
               {
-                //force Closed()
-                gp_Pnt aPm((BS->Pole(1).XYZ() + BS->Pole(BS->NbPoles()).XYZ()) / 2.);
-                BS->SetPole(1, aPm);
-                BS->SetPole(BS->NbPoles(), aPm);
+                // Avoid creating B-splines containing two coincident poles only
+                if (mbspc.Degree() == 1 && nbpoles == 2)
+                  continue;
+
+                if (!BS->IsClosed() && !BS->IsPeriodic())
+                {
+                  //force Closed()
+                  gp_Pnt aPm((BS->Pole(1).XYZ() + BS->Pole(BS->NbPoles()).XYZ()) / 2.);
+                  BS->SetPole(1, aPm);
+                  BS->SetPole(BS->NbPoles(), aPm);
+                }
               }
               sline.Append(BS);
 
diff --git a/src/GeomLib/GeomLib.cxx b/src/GeomLib/GeomLib.cxx
index c504dbc0ed..41d00b2327 100644
--- a/src/GeomLib/GeomLib.cxx
+++ b/src/GeomLib/GeomLib.cxx
@@ -1705,6 +1705,8 @@ void GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)& Surface,
 	  NewP(ii,jj).SetCoord(3,PRes(indice+2));
 	  if (rational) {
 	    ww =  PRes(indice+3);
+	    if (Abs(ww - 1.0) < EpsW)
+	      ww = 1.0;
 	    if (ww < EpsW) {
 	      NullWeight = Standard_True;
 	    }
@@ -1725,6 +1727,8 @@ void GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)& Surface,
 	  NewP(ii,jj).SetCoord(3,PRes(indice+2));
 	  if (rational) {
 	    ww =  PRes(indice+3);
+	    if (Abs(ww - 1.0) < EpsW)
+	      ww = 1.0;
 	    if (ww < EpsW) {
 	      NullWeight = Standard_True;
 	    }
diff --git a/src/IntCurve/IntCurve_IntPolyPolyGen.gxx b/src/IntCurve/IntCurve_IntPolyPolyGen.gxx
index e63dc3212d..31308b2463 100644
--- a/src/IntCurve/IntCurve_IntPolyPolyGen.gxx
+++ b/src/IntCurve/IntCurve_IntPolyPolyGen.gxx
@@ -679,20 +679,25 @@ void IntCurve_IntPolyPolyGen::Perform( const TheCurve& C1
     aPoly1 = new IntCurve_ThePolygon2d(C1,nbsamplesOnC1,D1,Tol),
     aPoly2 = new IntCurve_ThePolygon2d(C2,nbsamplesOnC2,D2,Tol);
 
-  if( (aPoly1->DeflectionOverEstimation() > TolConf) ||
+  if( (aPoly1->DeflectionOverEstimation() > TolConf) &&
       (aPoly2->DeflectionOverEstimation() > TolConf))
   {
     const Standard_Real aDeflectionSum = 
       Max(aPoly1->DeflectionOverEstimation(), TolConf) + 
       Max(aPoly2->DeflectionOverEstimation(), TolConf);
 
-    aPoly2->SetDeflectionOverEstimation(aDeflectionSum);
-    aPoly1->SetDeflectionOverEstimation(aDeflectionSum);
-
-    const Bnd_Box2d aB1 = aPoly1->Bounding(), aB2 = aPoly2->Bounding();
-
-    aPoly1->ComputeWithBox(C1, aB2);
-    aPoly2->ComputeWithBox(C2, aB1);
+    if (nbsamplesOnC2 > nbsamplesOnC1)
+    {
+      aPoly2->ComputeWithBox(C2, aPoly1->Bounding());
+      aPoly1->SetDeflectionOverEstimation(aDeflectionSum);
+      aPoly1->ComputeWithBox(C1, aPoly2->Bounding());
+    }
+    else
+    {
+      aPoly1->ComputeWithBox(C1, aPoly2->Bounding());
+      aPoly2->SetDeflectionOverEstimation(aDeflectionSum);
+      aPoly2->ComputeWithBox(C2, aPoly1->Bounding());
+    }
   }
 
   //----------------------------------------------------------------------
diff --git a/src/IntPatch/IntPatch_ImpPrmIntersection.cxx b/src/IntPatch/IntPatch_ImpPrmIntersection.cxx
index 032031fbea..ddf71a7bc8 100644
--- a/src/IntPatch/IntPatch_ImpPrmIntersection.cxx
+++ b/src/IntPatch/IntPatch_ImpPrmIntersection.cxx
@@ -569,7 +569,7 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
     Standard_Real rvalf = Sign(1.,Valf(1));
     for(Standard_Integer i = 2; i <= aNbSamples; ++i)
     {
-      D1->SamplePoint(i,s2d, s3d);
+      T->SamplePoint(i,s2d, s3d);
       UVap(1)=s2d.X(); 
       UVap(2)=s2d.Y();
       Func.Value(UVap,Valf);
diff --git a/src/ShapeFix/ShapeFix_EdgeProjAux.cxx b/src/ShapeFix/ShapeFix_EdgeProjAux.cxx
index b13e073832..644118bcba 100644
--- a/src/ShapeFix/ShapeFix_EdgeProjAux.cxx
+++ b/src/ShapeFix/ShapeFix_EdgeProjAux.cxx
@@ -426,7 +426,7 @@ void ShapeFix_EdgeProjAux::Init2d (const Standard_Real preci)
     Standard_Real wmid;
     sac.Project(COnS,mid,preci,pnt,wmid,Standard_False);
     wmid+=ShapeAnalysis::AdjustToPeriod(wmid,0,period);
-    if(w1>w2) {
+    if(w1>=w2) {
       if(w2 > wmid) myFirstParam -= period;
       else if (w1 > wmid)
         UpdateParam2d(theCurve2d);
diff --git a/src/ShapeFix/ShapeFix_Face.cxx b/src/ShapeFix/ShapeFix_Face.cxx
index fa94e53884..acce19f1fd 100644
--- a/src/ShapeFix/ShapeFix_Face.cxx
+++ b/src/ShapeFix/ShapeFix_Face.cxx
@@ -1281,6 +1281,16 @@ Standard_Boolean ShapeFix_Face::FixOrientation(TopTools_DataMapOfShapeListOfShap
                   found = (staout != clas.Perform (unp1,Standard_False));
                 }
               }
+              // Additional check of diagonal steps for toroidal surfaces
+              if (!found && uclosed && vclosed)
+              {
+                for (Standard_Real dX = -1.0; dX <= 1.0 && !found; dX += 2.0)
+                  for (Standard_Real dY = -1.0; dY <= 1.0 && !found; dY += 2.0)
+                  {
+                    unp1.SetCoord(unp.X() + uRange * dX, unp.Y() + vRange * dY);
+                    found = (staout != clas.Perform(unp1, Standard_False));
+                  }
+              }
             }
             if(found) {
               if(stb==TopAbs_IN) stb = TopAbs_OUT;
diff --git a/src/ShapeFix/ShapeFix_Wire.cxx b/src/ShapeFix/ShapeFix_Wire.cxx
index 19fc9ab7ad..f3f05d68f2 100644
--- a/src/ShapeFix/ShapeFix_Wire.cxx
+++ b/src/ShapeFix/ShapeFix_Wire.cxx
@@ -3132,7 +3132,11 @@ Standard_Boolean ShapeFix_Wire::FixNotchedEdges()
 	myLastFixStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE2 );
       }
       else 
-	FixDummySeam(n1);
+      {
+        FixDummySeam(n1);
+        // The seam edge is removed from the list. So, need to step back to avoid missing of edge processing
+        i--;
+      }
   
       i--;
       if(!Context().IsNull()) //skl 07.03.2002 for OCC180
diff --git a/src/math/math_FunctionRoots.cxx b/src/math/math_FunctionRoots.cxx
index 3d743d37db..d084ac8a84 100644
--- a/src/math/math_FunctionRoots.cxx
+++ b/src/math/math_FunctionRoots.cxx
@@ -440,7 +440,8 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F,
 	  F.Value(x1,f1); f1-=K;
 	  F.Value(x2,f2); f2-=K;
 	  //-- printf("\n *************** RECHERCHE MINIMUM **********\n");
-	  while(Abs(x3-x0) > tolCR*(Abs(x1)+Abs(x2)) && (Abs(x1 -x2) > 0)) { 
+	  Standard_Real tolX = 0.001 * NEpsX;
+	  while(Abs(x3-x0) > tolCR*(Abs(x1)+Abs(x2)) && (Abs(x1 -x2) > tolX)) { 
 	    //-- printf("\n (%10.5g,%10.5g) (%10.5g,%10.5g) (%10.5g,%10.5g) (%10.5g,%10.5g) ", 
 	    //--    x0,f0,x1,f1,x2,f2,x3,f3);
 	    if(recherche_minimum) {  
diff --git a/src/math/math_TrigonometricFunctionRoots.cxx b/src/math/math_TrigonometricFunctionRoots.cxx
index 4d5f4f99a4..3d5b9919c3 100644
--- a/src/math/math_TrigonometricFunctionRoots.cxx
+++ b/src/math/math_TrigonometricFunctionRoots.cxx
@@ -151,7 +151,7 @@ void math_TrigonometricFunctionRoots::Perform(const Standard_Real A,
   InfiniteStatus = Standard_False;
   Done = Standard_True;
 
-  Eps = 1.e-12;
+  Eps = 1.5e-12;
 
   Depi = M_PI+M_PI;
   if (InfBound <= RealFirst() && SupBound >= RealLast()) {
diff --git a/tests/boolean/bfuse_complex/F5 b/tests/boolean/bfuse_complex/F5
index ab90b6fb15..c075d2b074 100644
--- a/tests/boolean/bfuse_complex/F5
+++ b/tests/boolean/bfuse_complex/F5
@@ -1,6 +1,5 @@
 # Original bug : pro10658
 # Date : 24mar98
-puts "TODO #26080 ALL: Faulty shapes in variables faulty_1"
 puts "TODO ALL Error : The area of the resulting shape is"
 restore [locate_data_file CTO900_pro10658a.rle] a
 restore [locate_data_file pro10658b.rle] b
diff --git a/tests/boolean/bfuse_complex/Q2 b/tests/boolean/bfuse_complex/Q2
index 1343c8a154..45a88e0f0d 100644
--- a/tests/boolean/bfuse_complex/Q2
+++ b/tests/boolean/bfuse_complex/Q2
@@ -1,5 +1,4 @@
 # pro10658
-puts "TODO #26080 ALL: Faulty shapes in variables faulty_1"
 puts "TODO ALL Error : The area of the resulting shape is"
 restore [locate_data_file CTO900_pro10658a.rle] a
 restore [locate_data_file pro10658b.rle] b
diff --git a/tests/boolean/bsection/M9 b/tests/boolean/bsection/M9
index b3608d72c7..dd1501d700 100644
--- a/tests/boolean/bsection/M9
+++ b/tests/boolean/bsection/M9
@@ -18,7 +18,10 @@ compound result
 repeat 21 {
   plane p_$i 0 $i*100 0  0 1 0
   mkface f_$i p_$i
-  bsection s_$i b f_$i
+  set bsres [bsection s_$i b f_$i]
+  if { [regexp {Error} $bsres] } {
+    puts "Error: bsection not done"
+  }
   compound result s_$i result
   set dist [expr $i * 100]
   puts "OK Section:$dist"
diff --git a/tests/boolean/bsection/N4 b/tests/boolean/bsection/N4
index 529abd5f0c..334408334c 100644
--- a/tests/boolean/bsection/N4
+++ b/tests/boolean/bsection/N4
@@ -8,7 +8,10 @@ set i 1
 repeat 199 {
   plane p_$i 0 $i*100 0  0 1 0
   mkface f_$i p_$i
-  bsection s_$i a f_$i
+  set bsres [bsection s_$i a f_$i]
+  if { [regexp {Error} $bsres] } {
+    puts "Error: bsection not done"
+  }
   compound result s_$i result
   set dist [expr $i * 100]
   puts "OK Section:$dist"
diff --git a/tests/boolean/volumemaker/F8 b/tests/boolean/volumemaker/F8
index a2840c15ca..578fc829ac 100644
--- a/tests/boolean/volumemaker/F8
+++ b/tests/boolean/volumemaker/F8
@@ -1,7 +1,7 @@
 # test script on make volume operation
 # cone cylinder plane
 
-puts "TODO OCC26020 ALL: Error: bopcheck failed"
+puts "TODO OCC26020 Windows: Error: bopcheck failed"
 
 # planar face 
 plane pln_f1 27.577164466275352 -1038.2137499999999 27.577164466275359 0.70710678118654746 4.4408920985006262e-016 0.70710678118654768
diff --git a/tests/bugs/modalg_2/bug5805_21 b/tests/bugs/modalg_2/bug5805_21
index 01e486c994..24a683fec1 100755
--- a/tests/bugs/modalg_2/bug5805_21
+++ b/tests/bugs/modalg_2/bug5805_21
@@ -30,7 +30,7 @@ set distance -0.1
 catch { OFFSETSHAPE $distance {} $calcul $type }
 
 
-set square 253.552
+set square 253.902
 
 set nb_v_good 2
 set nb_e_good 3
diff --git a/tests/bugs/modalg_2/bug5805_22 b/tests/bugs/modalg_2/bug5805_22
index 9ea1cba1e8..bc6ae303a0 100755
--- a/tests/bugs/modalg_2/bug5805_22
+++ b/tests/bugs/modalg_2/bug5805_22
@@ -30,7 +30,7 @@ set distance -0.1
 catch { OFFSETSHAPE $distance {s_3} $calcul $type }
 
 
-set square 502.411
+set square 502.366
 
 set nb_v_good 3
 set nb_e_good 5
diff --git a/tests/bugs/modalg_2/bug5805_23 b/tests/bugs/modalg_2/bug5805_23
index 87ca0f367d..e670f809f2 100755
--- a/tests/bugs/modalg_2/bug5805_23
+++ b/tests/bugs/modalg_2/bug5805_23
@@ -30,7 +30,7 @@ set distance -0.1
 catch { OFFSETSHAPE $distance {s_2} $calcul $type }
 
 
-set square 502.411
+set square 502.366
 
 set nb_v_good 3
 set nb_e_good 5
diff --git a/tests/bugs/modalg_2/bug5805_24 b/tests/bugs/modalg_2/bug5805_24
index 11542cb0e1..4ad85530c8 100755
--- a/tests/bugs/modalg_2/bug5805_24
+++ b/tests/bugs/modalg_2/bug5805_24
@@ -30,7 +30,7 @@ set distance -0.1
 catch { OFFSETSHAPE $distance {s_3 s_2} $calcul $type }
 
 
-set square 489.812
+set square 489.372
 
 set nb_v_good 3
 set nb_e_good 5
diff --git a/tests/bugs/modalg_4/bug714 b/tests/bugs/modalg_4/bug714
index 5c34c5cff7..0100b40a24 100755
--- a/tests/bugs/modalg_4/bug714
+++ b/tests/bugs/modalg_4/bug714
@@ -7,8 +7,6 @@ puts ""
 ## After command sew in DRAW on attached shape free wires are disappeared.
 ####################################################
 
-puts "TODO OCC25593 ALL: Faulty shapes in variables faulty_1 to faulty_4"
-
 restore [locate_data_file OCC714.brep] a 
 checkshape a
 
diff --git a/tests/bugs/modalg_5/bug24303 b/tests/bugs/modalg_5/bug24303
index ec3aeb7b90..7a8d18d6de 100755
--- a/tests/bugs/modalg_5/bug24303
+++ b/tests/bugs/modalg_5/bug24303
@@ -10,12 +10,12 @@ pload QAcommands
 
 set status 0
 
-set info1 [OCC24303 4]
+set info1 [OCC24303 5]
 regexp {Solutions +([-0-9.+eE]+)} ${info1} full Solution
 regexp {Distance += +([-0-9.+eE]+)} ${info1} full Distance
 
-if { [info exists Sol4] } {
-   set info2 [dump Sol4]
+if { [info exists Sol5] } {
+   set info2 [dump Sol5]
    regexp {Center +:([-0-9.+eE]+), +([-0-9.+eE]+)} ${info2} full CenterX CenterY
    regexp {XAxis +:([-0-9.+eE]+), +([-0-9.+eE]+)} ${info2} full XAxisX XAxisY
    regexp {YAxis +:([-0-9.+eE]+), +([-0-9.+eE]+)} ${info2} full YAxisX YAxisY
diff --git a/tests/bugs/modalg_6/bug25908 b/tests/bugs/modalg_6/bug25908
index e3e368c896..7af868079b 100755
--- a/tests/bugs/modalg_6/bug25908
+++ b/tests/bugs/modalg_6/bug25908
@@ -20,15 +20,15 @@ compound vl v1l vnl vol vil result
 
 set nbshapes_expected "
 Number of shapes in shape
- VERTEX    : 169
- EDGE      : 85
+ VERTEX    : 165
+ EDGE      : 83
  WIRE      : 0
  FACE      : 0
  SHELL     : 0
  SOLID     : 0
  COMPSOLID : 0
  COMPOUND  : 1
- SHAPE     : 255
+ SHAPE     : 249
 "
 
 checknbshapes result -ref ${nbshapes_expected} -t -m "HLRToShape"
diff --git a/tests/bugs/moddata_2/bug36 b/tests/bugs/moddata_2/bug36
index e51abe82ee..49101e096b 100755
--- a/tests/bugs/moddata_2/bug36
+++ b/tests/bugs/moddata_2/bug36
@@ -26,7 +26,7 @@ if [catch { igesbrep $filepath a * } res] {
 
     checkmaxtol result 2.5472812372261969e-005
     checknbshapes result -shell 13
-    checkfreebounds result 1249
+    checkfreebounds result 1247
 }
 
 set 2dviewer 0
diff --git a/tests/bugs/moddata_2/bug498 b/tests/bugs/moddata_2/bug498
index b1be064b6e..59685b82c2 100755
--- a/tests/bugs/moddata_2/bug498
+++ b/tests/bugs/moddata_2/bug498
@@ -1,5 +1,3 @@
-puts "TODO OCC12345 ALL: Faulty OCC498: Wrong 3d point from offset surface by parameters"
-
 puts "========="
 puts " OCC498 "
 puts "========="
diff --git a/tests/de/iges_1/F9 b/tests/de/iges_1/F9
index ccf2fc95c2..b524f8243f 100644
--- a/tests/de/iges_1/F9
+++ b/tests/de/iges_1/F9
@@ -1,6 +1,4 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
-puts "TODO CR23096 ALL: TPSTAT : Faulty" 
-
 
 set filename UKI60095.igs
 
diff --git a/tests/de/iges_1/J3 b/tests/de/iges_1/J3
index a92868756a..1fecba166b 100644
--- a/tests/de/iges_1/J3
+++ b/tests/de/iges_1/J3
@@ -8,10 +8,10 @@ set ref_data {
 DATA        : Faulties = 0  ( 0 )  Warnings = 0  ( 0 )  Summary  = 0  ( 0 )
 TPSTAT      : Faulties = 0  ( 0 )  Warnings = 42  ( 1091 )  Summary  = 42  ( 1091 )
 CHECKSHAPE  : Wires    = 0  ( 0 )  Faces    = 0  ( 0 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
-NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 1038  ( 1038 )   Summary  = 22098  ( 22098 )
-STATSHAPE   : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 1038  ( 1038 )   FreeWire = 0  ( 0 )   FreeEdge  = 0 ( 0 )   SharedEdge = 10005  ( 10005 )
+NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 1038  ( 1038 )   Summary  = 22098  ( 22096 )
+STATSHAPE   : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 1038  ( 1038 )   FreeWire = 0  ( 0 )   FreeEdge  = 0 ( 0 )   SharedEdge = 10005  ( 10004 )
 TOLERANCE   : MaxTol   =   0.5433123154  (   0.5433122968 )  AvgTol   =  0.002230678782  (  0.002235663837 )
-LABELS      : N0Labels = 1038  ( 1038 )  N1Labels = 0  ( 1450 )  N2Labels = 0  ( 0 )   TotalLabels = 1038  ( 2488 )   NameLabels = 1038  ( 1038 )   ColorLabels = 1038  ( 2488 )   LayerLabels = 1038  ( 2488 )
+LABELS      : N0Labels = 1038  ( 1038 )  N1Labels = 0  ( 1449 )  N2Labels = 0  ( 0 )   TotalLabels = 1038  ( 2487 )   NameLabels = 1038  ( 1038 )   ColorLabels = 1038  ( 2487 )   LayerLabels = 1038  ( 2487 )
 PROPS       : Centroid = 0  ( 0 )  Volume   = 0  ( 0 )  Area     = 0  ( 0 )
 NCOLORS     : NColors  = 2  ( 2 )
 COLORS      : Colors   = GREEN RED  ( GREEN RED )
diff --git a/tests/de/iges_1/J9 b/tests/de/iges_1/J9
index 8d4b65b6e7..ce3d7bb641 100644
--- a/tests/de/iges_1/J9
+++ b/tests/de/iges_1/J9
@@ -7,9 +7,9 @@ set filename CTS21655.igs
 set ref_data {
 DATA        : Faulties = 0  ( 12 )  Warnings = 0  ( 1 )  Summary  = 0  ( 13 )
 TPSTAT      : Faulties = 0  ( 28 )  Warnings = 116  ( 7 )  Summary  = 116  ( 35 )
-CHECKSHAPE  : Wires    = 0  ( 0 )  Faces    = 1  ( 1 )  Shells   = 0  ( 1 )   Solids   = 0 ( 1 )
-NBSHAPES    : Solid    = 0  ( 19 )  Shell    = 0  ( 19 )  Face     = 1191  ( 1191 )   Summary  = 15092  ( 7703 )
-STATSHAPE   : Solid    = 0  ( 19 )  Shell    = 0  ( 19 )  Face     = 1191  ( 1191 )   FreeWire = 0  ( 0 )   FreeEdge  = 0 ( 0 )   SharedEdge = 6291  ( 3138 )
+CHECKSHAPE  : Wires    = 0  ( 0 )  Faces    = 0  ( 0 )  Shells   = 0  ( 1 )   Solids   = 0 ( 1 )
+NBSHAPES    : Solid    = 0  ( 18 )  Shell    = 0  ( 18 )  Face     = 1190  ( 1190 )   Summary  = 15073  ( 7693 )
+STATSHAPE   : Solid    = 0  ( 18 )  Shell    = 0  ( 18 )  Face     = 1190  ( 1190 )   FreeWire = 0  ( 0 )   FreeEdge  = 0 ( 0 )   SharedEdge = 6283  ( 3134 )
 TOLERANCE   : MaxTol   =   0.2496383637  (   0.2496258832 )  AvgTol   =   0.00219239232  (  0.004111699336 )
 LABELS      : N0Labels = 27  ( 27 )  N1Labels = 0  ( 0 )  N2Labels = 0  ( 0 )   TotalLabels = 27  ( 27 )   NameLabels = 27  ( 27 )   ColorLabels = 0  ( 0 )   LayerLabels = 0  ( 0 )
 PROPS       : Centroid = 0  ( 0 )  Volume   = 0  ( 0 )  Area     = 0  ( 0 )
diff --git a/tests/de/iges_1/K3 b/tests/de/iges_1/K3
index 160addc5a0..632d6a715b 100644
--- a/tests/de/iges_1/K3
+++ b/tests/de/iges_1/K3
@@ -1,18 +1,18 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
-puts "TODO CR25923 ALL: NBSHAPES : Faulty"
 puts "TODO CR23096 ALL: LABELS : Faulty" 
-
+puts "TODO CR23096 ALL: NBSHAPES : Faulty" 
+puts "TODO CR23096 ALL: Error : 2 differences with reference data found" 
 
 set filename FRA62468-1.igs
 
 set ref_data {
 DATA        : Faulties = 0  ( 0 )  Warnings = 0  ( 0 )  Summary  = 0  ( 0 )
-TPSTAT      : Faulties = 0  ( 0 )  Warnings = 427  ( 5255 )  Summary  = 427  ( 5255 )
+TPSTAT      : Faulties = 0  ( 0 )  Warnings = 299  ( 5226 )  Summary  = 299  ( 5226 )
 CHECKSHAPE  : Wires    = 12  ( 20 )  Faces    = 16  ( 18 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
-NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 5163  ( 5163 )   Summary  = 68354  ( 68418 )
-STATSHAPE   : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 5163  ( 5163 )   FreeWire = 10  ( 10 )   FreeEdge  = 283 ( 283 )   SharedEdge = 29043  ( 29075 )
-TOLERANCE   : MaxTol   =   0.9874083984  (   0.9875071265 )  AvgTol   =   0.01115315301  (    0.0111584608 )
-LABELS      : N0Labels = 5392  ( 5458 )  N1Labels = 18  ( 4437 )  N2Labels = 0  ( 0 )   TotalLabels = 5410  ( 9895 )   NameLabels = 5392  ( 5458 )   ColorLabels = 5391  ( 9829 )   LayerLabels = 5391  ( 9829 )
+NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 5163  ( 5163 )   Summary  = 68422  ( 68420 )
+STATSHAPE   : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 5163  ( 5163 )   FreeWire = 10  ( 10 )   FreeEdge  = 283 ( 283 )   SharedEdge = 29075  ( 29079 )
+TOLERANCE   : MaxTol   =   0.9874083984  (   0.9875071265 )  AvgTol   =   0.01114309412  (   0.01115568387 )
+LABELS      : N0Labels = 5392  ( 5458 )  N1Labels = 18  ( 4427 )  N2Labels = 0  ( 0 )   TotalLabels = 5410  ( 9885 )   NameLabels = 5392  ( 5458 )   ColorLabels = 5391  ( 9819 )   LayerLabels = 5391  ( 9819 )
 PROPS       : Centroid = 0  ( 0 )  Volume   = 0  ( 0 )  Area     = 0  ( 0 )
 NCOLORS     : NColors  = 4  ( 4 )
 COLORS      : Colors   = BLACK BLUE1 CYAN1 GREEN  ( BLACK BLUE1 CYAN1 GREEN )
diff --git a/tests/de/iges_1/M7 b/tests/de/iges_1/M7
index 89e885e4b0..8f92b92618 100644
--- a/tests/de/iges_1/M7
+++ b/tests/de/iges_1/M7
@@ -1,7 +1,6 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
 puts "TODO CR23096 ALL: LABELS : Faulty" 
 
-
 set filename 12ls328.igs
 
 set ref_data {
diff --git a/tests/de/iges_1/O3 b/tests/de/iges_1/O3
index 867eba7169..ab78fbba35 100644
--- a/tests/de/iges_1/O3
+++ b/tests/de/iges_1/O3
@@ -1,5 +1,4 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
-puts "TODO CR23096 ALL: TOLERANCE : Faulty" 
 puts "TODO CR23096 ALL: LABELS : Faulty" 
 
 set LinuxDiff 1
diff --git a/tests/de/iges_1/P5 b/tests/de/iges_1/P5
index cdeab27728..54df8aa0a5 100755
--- a/tests/de/iges_1/P5
+++ b/tests/de/iges_1/P5
@@ -1,17 +1,18 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
 puts "TODO CR23096 ALL: LABELS : Faulty" 
+puts "TODO CR23096 ALL: Error : 3 differences with reference data found" 
 
 set LinuxDiff 2
 set filename brazo1.igs
 
 set ref_data {
 DATA        : Faulties = 0  ( 2 )  Warnings = 0  ( 0 )  Summary  = 0  ( 2 )
-TPSTAT      : Faulties = 0  ( 0 )  Warnings = 148  ( 478 )  Summary  = 148  ( 478 )
+TPSTAT      : Faulties = 0  ( 0 )  Warnings = 139  ( 454 )  Summary  = 139  ( 454 )
 CHECKSHAPE  : Wires    = 6  ( 8 )  Faces    = 6  ( 8 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
-NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 223  ( 223 )   Summary  = 4666  ( 4542 )
-STATSHAPE   : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 223  ( 223 )   FreeWire = 0  ( 0 )   FreeEdge  = 0 ( 0 )   SharedEdge = 2144  ( 2074 )
-TOLERANCE   : MaxTol   =    0.991254355  (    0.991254355 )  AvgTol   =   0.01125801875  (   0.01225981249 )
-LABELS      : N0Labels = 223  ( 223 )  N1Labels = 0  ( 242 )  N2Labels = 0  ( 0 )   TotalLabels = 223  ( 465 )   NameLabels = 223  ( 388 )   ColorLabels = 223  ( 465 )   LayerLabels = 223  ( 465 )
+NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 223  ( 223 )   Summary  = 4710  ( 4574 )
+STATSHAPE   : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 223  ( 223 )   FreeWire = 0  ( 0 )   FreeEdge  = 0 ( 0 )   SharedEdge = 2166  ( 2092 )
+TOLERANCE   : MaxTol   =    0.991254355  (    0.991254355 )  AvgTol   =   0.01133191355  (   0.01225911215 )
+LABELS      : N0Labels = 223  ( 223 )  N1Labels = 0  ( 256 )  N2Labels = 0  ( 0 )   TotalLabels = 223  ( 479 )   NameLabels = 223  ( 388 )   ColorLabels = 223  ( 479 )   LayerLabels = 223  ( 479 )
 PROPS       : Centroid = 0  ( 0 )  Volume   = 0  ( 0 )  Area     = 0  ( 0 )
 NCOLORS     : NColors  = 3  ( 3 )
 COLORS      : Colors   = BLUE1 MAGENTA1 YELLOW  ( BLUE1 MAGENTA1 YELLOW )
diff --git a/tests/de/iges_1/P9 b/tests/de/iges_1/P9
index 8883a5c894..90c9522db5 100644
--- a/tests/de/iges_1/P9
+++ b/tests/de/iges_1/P9
@@ -7,10 +7,10 @@ set filename ims003.igs
 set ref_data {
 DATA        : Faulties = 0  ( 0 )  Warnings = 0  ( 0 )  Summary  = 0  ( 0 )
 TPSTAT      : Faulties = 0  ( 0 )  Warnings = 38  ( 183 )  Summary  = 38  ( 183 )
-CHECKSHAPE  : Wires    = 0  ( 0 )  Faces    = 0  ( 0 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
+CHECKSHAPE  : Wires    = 0  ( 0 )  Faces    = 0  ( 1 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
 NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 114  ( 114 )   Summary  = 2511  ( 2510 )
 STATSHAPE   : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 114  ( 114 )   FreeWire = 23  ( 23 )   FreeEdge  = 331 ( 331 )   SharedEdge = 983  ( 983 )
-TOLERANCE   : MaxTol   =   0.1829958579  (   0.1829958769 )  AvgTol   =  0.003259834421  (  0.003329232309 )
+TOLERANCE   : MaxTol   =   0.1830141575  (   0.1830141765 )  AvgTol   =  0.003295423033  (  0.003364815075 )
 LABELS      : N0Labels = 412  ( 412 )  N1Labels = 2  ( 0 )  N2Labels = 0  ( 0 )   TotalLabels = 414  ( 412 )   NameLabels = 412  ( 412 )   ColorLabels = 389  ( 410 )   LayerLabels = 389  ( 410 )
 PROPS       : Centroid = 0  ( 0 )  Volume   = 0  ( 0 )  Area     = 0  ( 0 )
 NCOLORS     : NColors  = 5  ( 5 )
diff --git a/tests/de/iges_1/R8 b/tests/de/iges_1/R8
index f7303c0561..a5e3c29795 100755
--- a/tests/de/iges_1/R8
+++ b/tests/de/iges_1/R8
@@ -1,18 +1,19 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
-puts "TODO CR25923 ALL: STATSHAPE : Faulty"
 puts "TODO CR23096 ALL: LABELS : Faulty" 
+puts "TODO CR23096 ALL: STATSHAPE : Faulty" 
+puts "TODO CR23096 ALL: Error : 3 differences with reference data found" 
 
 set LinuxDiff 5
 set filename BUC60743.igs
 
 set ref_data {
 DATA        : Faulties = 0  ( 2 )  Warnings = 0  ( 0 )  Summary  = 0  ( 2 )
-TPSTAT      : Faulties = 3  ( 59 )  Warnings = 2205  ( 4736 )  Summary  = 2208  ( 4795 )
-CHECKSHAPE  : Wires    = 7  ( 16 )  Faces    = 6  ( 12 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
-NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 3350  ( 2837 )   Summary  = 45907  ( 39191 )
-STATSHAPE   : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 3350  ( 3349 )   FreeWire = 6  ( 6 )   FreeEdge  = 67 ( 67 )   SharedEdge = 19595  ( 16764 )
-TOLERANCE   : MaxTol   =    3.742696236  (    5.769095076 )  AvgTol   =   0.01636161939  (   0.01749445935 )
-LABELS      : N0Labels = 11  ( 11 )  N1Labels = 2891  ( 6319 )  N2Labels = 0  ( 0 )   TotalLabels = 2902  ( 6330 )   NameLabels = 2900  ( 5879 )   ColorLabels = 2891  ( 6319 )   LayerLabels = 2411  ( 5257 )
+TPSTAT      : Faulties = 3  ( 59 )  Warnings = 2203  ( 4655 )  Summary  = 2206  ( 4714 )
+CHECKSHAPE  : Wires    = 7  ( 17 )  Faces    = 7  ( 12 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
+NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 3349  ( 2837 )   Summary  = 45927  ( 39202 )
+STATSHAPE   : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 3349  ( 3349 )   FreeWire = 6  ( 6 )   FreeEdge  = 67 ( 67 )   SharedEdge = 19607  ( 16774 )
+TOLERANCE   : MaxTol   =    4.854604894  (    5.769095076 )  AvgTol   =   0.01628658326  (   0.01747356296 )
+LABELS      : N0Labels = 11  ( 11 )  N1Labels = 2891  ( 6327 )  N2Labels = 0  ( 0 )   TotalLabels = 2902  ( 6338 )   NameLabels = 2900  ( 5879 )   ColorLabels = 2891  ( 6327 )   LayerLabels = 2411  ( 5258 )
 PROPS       : Centroid = 0  ( 0 )  Volume   = 0  ( 0 )  Area     = 0  ( 0 )
 NCOLORS     : NColors  = 4  ( 4 )
 COLORS      : Colors   = BLACK BLUE1 RED YELLOW  ( BLACK BLUE1 RED YELLOW )
diff --git a/tests/de/iges_2/B6 b/tests/de/iges_2/B6
index c41f7cde97..f4cd421a8c 100755
--- a/tests/de/iges_2/B6
+++ b/tests/de/iges_2/B6
@@ -5,8 +5,8 @@ set ref_data {
 DATA        : Faulties = 0  ( 0 )  Warnings = 0  ( 0 )  Summary  = 0  ( 0 )
 TPSTAT      : Faulties = 0  ( 0 )  Warnings = 88  ( 191 )  Summary  = 88  ( 191 )
 CHECKSHAPE  : Wires    = 2  ( 2 )  Faces    = 2  ( 2 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
-NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 569  ( 569 )   Summary  = 7842  ( 7836 )
-STATSHAPE   : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 569  ( 569 )   FreeWire = 0  ( 0 )   FreeEdge  = 0 ( 0 )   SharedEdge = 3353  ( 3350 )
+NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 569  ( 569 )   Summary  = 7842  ( 7833 )
+STATSHAPE   : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 569  ( 569 )   FreeWire = 0  ( 0 )   FreeEdge  = 0 ( 0 )   SharedEdge = 3353  ( 3348 )
 TOLERANCE   : MaxTol   =   0.7161069967  (   0.7585238415 )  AvgTol   =  0.006717667602  (  0.006937200018 )
 LABELS      : N0Labels = 568  ( 568 )  N1Labels = 2  ( 2 )  N2Labels = 0  ( 0 )   TotalLabels = 570  ( 570 )   NameLabels = 568  ( 568 )   ColorLabels = 569  ( 569 )   LayerLabels = 569  ( 569 )
 PROPS       : Centroid = 0  ( 0 )  Volume   = 0  ( 0 )  Area     = 0  ( 0 )
diff --git a/tests/de/iges_2/B8 b/tests/de/iges_2/B8
index 6942fba71a..305198703d 100644
--- a/tests/de/iges_2/B8
+++ b/tests/de/iges_2/B8
@@ -1,19 +1,20 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
-puts "TODO CR23096 ALL: LABELS : Faulty"
-puts "TODO CR25923 ALL: NBSHAPES : Faulty"
-#puts "TODO CR23096 ALL: Error : 1 differences with reference data found :" 
+puts "TODO CR23096 ALL: CHECKSHAPE : Faulty" 
+puts "TODO CR23096 ALL: LABELS : Faulty" 
+puts "TODO CR23096 ALL: NBSHAPES : Faulty" 
+puts "TODO CR23096 ALL: Error : 2 differences with reference data found" 
 
 set LinuxDiff 1
 set filename FRA62468-2.igs
 
 set ref_data {
 DATA        : Faulties = 0  ( 0 )  Warnings = 0  ( 0 )  Summary  = 0  ( 0 )
-TPSTAT      : Faulties = 0  ( 0 )  Warnings = 349  ( 5016 )  Summary  = 349  ( 5016 )
-CHECKSHAPE  : Wires    = 12  ( 19 )  Faces    = 12  ( 13 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
-NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 4729  ( 4729 )   Summary  = 63090  ( 63144 )
-STATSHAPE   : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 4729  ( 4729 )   FreeWire = 18  ( 18 )   FreeEdge  = 452 ( 452 )   SharedEdge = 26766  ( 26793 )
-TOLERANCE   : MaxTol   =   0.9804479161  (   0.9805459497 )  AvgTol   =   0.01154225009  (   0.01155173987 )
-LABELS      : N0Labels = 5089  ( 5165 )  N1Labels = 26  ( 3844 )  N2Labels = 0  ( 0 )   TotalLabels = 5115  ( 9009 )   NameLabels = 5089  ( 5165 )   ColorLabels = 5086  ( 8933 )   LayerLabels = 5086  ( 8933 )
+TPSTAT      : Faulties = 0  ( 0 )  Warnings = 253  ( 4993 )  Summary  = 253  ( 4993 )
+CHECKSHAPE  : Wires    = 8  ( 11 )  Faces    = 8  ( 7 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
+NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 4729  ( 4729 )   Summary  = 63158  ( 63146 )
+STATSHAPE   : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 4729  ( 4729 )   FreeWire = 18  ( 18 )   FreeEdge  = 452 ( 452 )   SharedEdge = 26798  ( 26797 )
+TOLERANCE   : MaxTol   =   0.9804479161  (   0.9805459497 )  AvgTol   =   0.01153089031  (   0.01154870945 )
+LABELS      : N0Labels = 5089  ( 5165 )  N1Labels = 26  ( 3834 )  N2Labels = 0  ( 0 )   TotalLabels = 5115  ( 8999 )   NameLabels = 5089  ( 5165 )   ColorLabels = 5086  ( 8923 )   LayerLabels = 5086  ( 8923 )
 PROPS       : Centroid = 0  ( 0 )  Volume   = 0  ( 0 )  Area     = 0  ( 0 )
 NCOLORS     : NColors  = 3  ( 3 )
 COLORS      : Colors   = BLUE1 CYAN1 GREEN  ( BLUE1 CYAN1 GREEN )
diff --git a/tests/de/iges_2/C2 b/tests/de/iges_2/C2
index edc0c660e2..c3cdd97e6b 100644
--- a/tests/de/iges_2/C2
+++ b/tests/de/iges_2/C2
@@ -3,7 +3,7 @@ puts "TODO CR23096 ALL: TPSTAT : Faulty"
 puts "TODO CR23096 ALL: NBSHAPES : Faulty" 
 puts "TODO CR23096 ALL: TOLERANCE : Faulty" 
 puts "TODO CR23096 ALL: LABELS : Faulty" 
-
+puts "TODO CR23096 ALL: Error : 3 differences with reference data found" 
 
 set filename PRO10626.igs
 
@@ -11,8 +11,8 @@ set ref_data {
 DATA        : Faulties = 0  ( 0 )  Warnings = 0  ( 0 )  Summary  = 0  ( 0 )
 TPSTAT      : Faulties = 2  ( 0 )  Warnings = 85  ( 295 )  Summary  = 87  ( 295 )
 CHECKSHAPE  : Wires    = 8  ( 13 )  Faces    = 8  ( 13 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
-NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 419  ( 419 )   Summary  = 5328  ( 5352 )
-STATSHAPE   : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 419  ( 419 )   FreeWire = 4  ( 4 )   FreeEdge  = 42 ( 42 )   SharedEdge = 2221  ( 2228 )
+NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 419  ( 419 )   Summary  = 5328  ( 5349 )
+STATSHAPE   : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 419  ( 419 )   FreeWire = 4  ( 4 )   FreeEdge  = 42 ( 42 )   SharedEdge = 2220  ( 2226 )
 TOLERANCE   : MaxTol   =    4.547932063  (    4.543567878 )  AvgTol   =   0.03466358537  (   0.03659099671 )
 LABELS      : N0Labels = 457  ( 457 )  N1Labels = 0  ( 0 )  N2Labels = 0  ( 0 )   TotalLabels = 457  ( 457 )   NameLabels = 457  ( 457 )   ColorLabels = 451  ( 455 )   LayerLabels = 453  ( 457 )
 PROPS       : Centroid = 0  ( 0 )  Volume   = 0  ( 0 )  Area     = 0  ( 0 )
diff --git a/tests/de/iges_2/F1 b/tests/de/iges_2/F1
index 894310e62e..51367769ed 100755
--- a/tests/de/iges_2/F1
+++ b/tests/de/iges_2/F1
@@ -14,7 +14,7 @@ TPSTAT      : Faulties = 44  ( 0 )  Warnings = 169  ( 1291 )  Summary  = 213  (
 CHECKSHAPE  : Wires    = 0  ( 0 )  Faces    = 1  ( 1 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
 NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 270  ( 270 )   Summary  = 8171  ( 8283 )
 STATSHAPE   : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 270  ( 270 )   FreeWire = 108  ( 108 )   FreeEdge  = 606 ( 606 )   SharedEdge = 3685  ( 3689 )
-TOLERANCE   : MaxTol   = 5.750743843e+14  ( 4.784430882e+15 )  AvgTol   =  2.722724827e+11  (  2.206755414e+12 )
+TOLERANCE   : MaxTol   = 2.113937626e+17  ( 2.113937968e+17 )  AvgTol   =  9.737589861e+13  (  9.762248147e+13 )
 LABELS      : N0Labels = 7  ( 7 )  N1Labels = 450  ( 2042 )  N2Labels = 0  ( 0 )   TotalLabels = 457  ( 2049 )   NameLabels = 457  ( 698 )   ColorLabels = 450  ( 2043 )   LayerLabels = 449  ( 2042 )
 PROPS       : Centroid = 0  ( 0 )  Volume   = 0  ( 0 )  Area     = 0  ( 0 )
 NCOLORS     : NColors  = 7  ( 7 )
diff --git a/tests/de/iges_3/A4 b/tests/de/iges_3/A4
index cb0b7c19e7..459721600c 100755
--- a/tests/de/iges_3/A4
+++ b/tests/de/iges_3/A4
@@ -5,7 +5,7 @@ puts "TODO CR23096 ALL: STATSHAPE : Faulty"
 puts "TODO CR23096 ALL: LABELS : Faulty" 
 puts "TODO CR23096 ALL: COLORS : Faulty" 
 puts "TODO CR23096 ALL: LAYERS : Faulty" 
-puts "TODO CR25013 ALL: Error : 4 differences with reference data found" 
+puts "TODO CR25013 ALL: Error : 3 differences with reference data found" 
 
 
 set filename BUC40132.igs
diff --git a/tests/de/iges_3/B2 b/tests/de/iges_3/B2
index 7ce4231e7c..af95584da6 100755
--- a/tests/de/iges_3/B2
+++ b/tests/de/iges_3/B2
@@ -7,12 +7,12 @@ set LinuxDiff 3
 set filename 1stpunch-mcsrfs.igs
 
 set ref_data {
-DATA        : Faulties = 0  ( 0 )  Warnings = 0  ( 2792 )  Summary  = 0  ( 2792 )
-TPSTAT      : Faulties = 0  ( 0 )  Warnings = 885  ( 1953 )  Summary  = 885  ( 1953 )
-CHECKSHAPE  : Wires    = 6  ( 5 )  Faces    = 3  ( 3 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
-NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 1223  ( 1223 )   Summary  = 68998  ( 68973 )
+DATA        : Faulties = 0  ( 0 )  Warnings = 0  ( 1 )  Summary  = 0  ( 1 )
+TPSTAT      : Faulties = 0  ( 0 )  Warnings = 885  ( 1951 )  Summary  = 885  ( 1951 )
+CHECKSHAPE  : Wires    = 6  ( 4 )  Faces    = 3  ( 3 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
+NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 1223  ( 1223 )   Summary  = 68996  ( 68971 )
 STATSHAPE   : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 1223  ( 1223 )   FreeWire = 0  ( 0 )   FreeEdge  = 0 ( 0 )   SharedEdge = 33290  ( 33278 )
-TOLERANCE   : MaxTol   =   0.2461173132  ( 0.001436622896 )  AvgTol   =  1.137529899e-005  (  9.779578952e-006 )
+TOLERANCE   : MaxTol   = 0.002714431471  ( 0.001436622896 )  AvgTol   =  1.636929841e-006  (  9.67254762e-006 )
 LABELS      : N0Labels = 1215  ( 1215 )  N1Labels = 0  ( 0 )  N2Labels = 0  ( 0 )   TotalLabels = 1215  ( 1215 )   NameLabels = 1215  ( 1215 )   ColorLabels = 0  ( 0 )   LayerLabels = 1207  ( 1215 )
 PROPS       : Centroid = 0  ( 0 )  Volume   = 0  ( 0 )  Area     = 0  ( 0 )
 NCOLORS     : NColors  = 0  ( 0 )
diff --git a/tests/de/step_1/A3 b/tests/de/step_1/A3
index 0241b6353f..c94a8788e0 100644
--- a/tests/de/step_1/A3
+++ b/tests/de/step_1/A3
@@ -8,7 +8,7 @@ set ref_data {
 DATA        : Faulties = 0  ( 0 )  Warnings = 0  ( 0 )  Summary  = 0  ( 0 )
 TPSTAT      : Faulties = 0  ( 0 )  Warnings = 42  ( 58 )  Summary  = 42  ( 58 )
 CHECKSHAPE  : Wires    = 0  ( 0 )  Faces    = 0  ( 0 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
-NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 49  ( 0 )  Face     = 49  ( 49 )   Summary  = 579  ( 530 )
+NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 49  ( 0 )  Face     = 49  ( 49 )   Summary  = 579  ( 529 )
 STATSHAPE   : Solid    = 0  ( 0 )  Shell    = 49  ( 0 )  Face     = 49  ( 49 )   FreeWire = 0  ( 0 )   FreeEdge  = 0 ( 0 )   SharedEdge = 220  ( 218 )
 TOLERANCE   : MaxTol   = 0.003591433268  ( 0.006121716429 )  AvgTol   =  0.0002657130942  (  0.0004625449099 )
 LABELS      : N0Labels = 1  ( 1 )  N1Labels = 0  ( 0 )  N2Labels = 0  ( 0 )   TotalLabels = 1  ( 1 )   NameLabels = 1  ( 1 )   ColorLabels = 0  ( 0 )   LayerLabels = 0  ( 0 )
diff --git a/tests/de/step_1/D9 b/tests/de/step_1/D9
index 89d3e85dd5..26ab6a1659 100644
--- a/tests/de/step_1/D9
+++ b/tests/de/step_1/D9
@@ -8,7 +8,7 @@ set ref_data {
 DATA        : Faulties = 0  ( 0 )  Warnings = 0  ( 0 )  Summary  = 0  ( 0 )
 TPSTAT      : Faulties = 0  ( 0 )  Warnings = 6  ( 6 )  Summary  = 6  ( 6 )
 CHECKSHAPE  : Wires    = 0  ( 0 )  Faces    = 0  ( 0 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
-NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 39  ( 0 )  Face     = 39  ( 39 )   Summary  = 492  ( 456 )
+NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 39  ( 0 )  Face     = 39  ( 39 )   Summary  = 492  ( 455 )
 STATSHAPE   : Solid    = 0  ( 0 )  Shell    = 39  ( 0 )  Face     = 39  ( 39 )   FreeWire = 0  ( 0 )   FreeEdge  = 0 ( 0 )   SharedEdge = 193  ( 192 )
 TOLERANCE   : MaxTol   = 0.003673630603  ( 0.003673630602 )  AvgTol   =  0.0002911716538  (  0.0002911716555 )
 LABELS      : N0Labels = 1  ( 1 )  N1Labels = 0  ( 0 )  N2Labels = 0  ( 0 )   TotalLabels = 1  ( 1 )   NameLabels = 1  ( 1 )   ColorLabels = 0  ( 0 )   LayerLabels = 0  ( 0 )
diff --git a/tests/de/step_1/G9 b/tests/de/step_1/G9
index f43c761e52..316f8192cf 100644
--- a/tests/de/step_1/G9
+++ b/tests/de/step_1/G9
@@ -10,7 +10,7 @@ set filename trj4_k1_geo-tu-214.stp
 set ref_data {
 DATA        : Faulties = 0  ( 0 )  Warnings = 0  ( 0 )  Summary  = 0  ( 0 )
 TPSTAT      : Faulties = 0  ( 0 )  Warnings = 5  ( 10 )  Summary  = 5  ( 10 )
-CHECKSHAPE  : Wires    = 1  ( 1 )  Faces    = 1  ( 1 )  Shells   = 0  ( 2 )   Solids   = 0 ( 0 )
+CHECKSHAPE  : Wires    = 0  ( 1 )  Faces    = 0  ( 2 )  Shells   = 0  ( 2 )   Solids   = 0 ( 0 )
 NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 51  ( 2 )  Face     = 51  ( 48 )   Summary  = 584  ( 569 )
 STATSHAPE   : Solid    = 0  ( 0 )  Shell    = 51  ( 2 )  Face     = 51  ( 48 )   FreeWire = 0  ( 0 )   FreeEdge  = 0 ( 0 )   SharedEdge = 220  ( 218 )
 TOLERANCE   : MaxTol   =   0.4289319668  ( 0.007688098235 )  AvgTol   =    0.0122902841  (  0.0002401295385 )
diff --git a/tests/de/step_1/J6 b/tests/de/step_1/J6
index 6c718bf420..ff12ff4bb4 100755
--- a/tests/de/step_1/J6
+++ b/tests/de/step_1/J6
@@ -10,8 +10,8 @@ set ref_data {
 DATA        : Faulties = 0  ( 0 )  Warnings = 0  ( 0 )  Summary  = 0  ( 0 )
 TPSTAT      : Faulties = 0  ( 2 )  Warnings = 19  ( 27 )  Summary  = 19  ( 29 )
 CHECKSHAPE  : Wires    = 2  ( 3 )  Faces    = 3  ( 3 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
-NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 12  ( 12 )  Face     = 15  ( 15 )   Summary  = 151  ( 151 )
-STATSHAPE   : Solid    = 0  ( 0 )  Shell    = 12  ( 12 )  Face     = 15  ( 15 )   FreeWire = 0  ( 0 )   FreeEdge  = 0 ( 0 )   SharedEdge = 59  ( 60 )
+NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 12  ( 12 )  Face     = 15  ( 15 )   Summary  = 149  ( 149 )
+STATSHAPE   : Solid    = 0  ( 0 )  Shell    = 12  ( 12 )  Face     = 15  ( 15 )   FreeWire = 0  ( 0 )   FreeEdge  = 0 ( 0 )   SharedEdge = 57  ( 58 )
 TOLERANCE   : MaxTol   =    1562.051497  (    1562.051497 )  AvgTol   =     192.5735494  (     206.7634854 )
 LABELS      : N0Labels = 1  ( 1 )  N1Labels = 0  ( 0 )  N2Labels = 0  ( 0 )   TotalLabels = 1  ( 1 )   NameLabels = 1  ( 1 )   ColorLabels = 0  ( 0 )   LayerLabels = 0  ( 0 )
 PROPS       : Centroid = 0  ( 0 )  Volume   = 0  ( 0 )  Area     = 0  ( 0 )
diff --git a/tests/de/step_1/J8 b/tests/de/step_1/J8
index ef72437008..877e9e5b8e 100644
--- a/tests/de/step_1/J8
+++ b/tests/de/step_1/J8
@@ -8,9 +8,9 @@ set filename bm1_sy_lever.stp
 set ref_data {
 DATA        : Faulties = 0  ( 3 )  Warnings = 0  ( 2 )  Summary  = 0  ( 5 )
 TPSTAT      : Faulties = 0  ( 0 )  Warnings = 11  ( 9 )  Summary  = 11  ( 9 )
-CHECKSHAPE  : Wires    = 1  ( 0 )  Faces    = 1  ( 0 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
-NBSHAPES    : Solid    = 2  ( 2 )  Shell    = 2  ( 2 )  Face     = 99  ( 99 )   Summary  = 655  ( 656 )
-STATSHAPE   : Solid    = 2  ( 2 )  Shell    = 2  ( 2 )  Face     = 99  ( 99 )   FreeWire = 0  ( 0 )   FreeEdge  = 0 ( 0 )   SharedEdge = 266  ( 266 )
+CHECKSHAPE  : Wires    = 0  ( 0 )  Faces    = 0  ( 0 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
+NBSHAPES    : Solid    = 2  ( 2 )  Shell    = 2  ( 2 )  Face     = 99  ( 99 )   Summary  = 654  ( 656 )
+STATSHAPE   : Solid    = 2  ( 2 )  Shell    = 2  ( 2 )  Face     = 99  ( 99 )   FreeWire = 0  ( 0 )   FreeEdge  = 0 ( 0 )   SharedEdge = 265  ( 266 )
 TOLERANCE   : MaxTol   =    3.000180002  (    3.000180002 )  AvgTol   =    0.1203601833  (    0.1203606739 )
 LABELS      : N0Labels = 1  ( 1 )  N1Labels = 2  ( 2 )  N2Labels = 0  ( 0 )   TotalLabels = 3  ( 3 )   NameLabels = 1  ( 1 )   ColorLabels = 2  ( 2 )   LayerLabels = 2  ( 2 )
 PROPS       : Centroid = 0  ( 0 )  Volume   = 0  ( 0 )  Area     = 0  ( 0 )
diff --git a/tests/de/step_2/B5 b/tests/de/step_2/B5
index d1f7760936..df21698164 100644
--- a/tests/de/step_2/B5
+++ b/tests/de/step_2/B5
@@ -10,7 +10,7 @@ TPSTAT      : Faulties = 0  ( 0 )  Warnings = 16  ( 364 )  Summary  = 16  ( 364
 CHECKSHAPE  : Wires    = 1  ( 0 )  Faces    = 1  ( 0 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
 NBSHAPES    : Solid    = 1  ( 1 )  Shell    = 1  ( 1 )  Face     = 257  ( 257 )   Summary  = 1770  ( 1770 )
 STATSHAPE   : Solid    = 1  ( 1 )  Shell    = 1  ( 1 )  Face     = 257  ( 257 )   FreeWire = 0  ( 0 )   FreeEdge  = 0 ( 0 )   SharedEdge = 746  ( 746 )
-TOLERANCE   : MaxTol   =    0.477874439  (    0.477874439 )  AvgTol   =  0.005726825808  (  0.007088060753 )
+TOLERANCE   : MaxTol   =    0.477874439  (    3.60548709 )  AvgTol   =  0.005726825988  (  0.01506499669 )
 LABELS      : N0Labels = 1  ( 1 )  N1Labels = 0  ( 0 )  N2Labels = 0  ( 0 )   TotalLabels = 1  ( 1 )   NameLabels = 1  ( 1 )   ColorLabels = 1  ( 1 )   LayerLabels = 0  ( 0 )
 PROPS       : Centroid = 0  ( 0 )  Volume   = 0  ( 0 )  Area     = 0  ( 0 )
 NCOLORS     : NColors  = 1  ( 1 )
diff --git a/tests/de/step_2/B6 b/tests/de/step_2/B6
index 42549ed258..4750365e2c 100644
--- a/tests/de/step_2/B6
+++ b/tests/de/step_2/B6
@@ -1,8 +1,5 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
 puts "TODO CR23096 ALL: LABELS : Faulty" 
-puts "TODO CR23096 ALL: CHECKSHAPE : Faulty" 
-
-
 
 set filename PRO20364.stp
 
diff --git a/tests/de/step_2/E7 b/tests/de/step_2/E7
index d05786ec36..4726f81efe 100644
--- a/tests/de/step_2/E7
+++ b/tests/de/step_2/E7
@@ -1,16 +1,16 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
 puts "TODO CR23096 ALL: LABELS : Faulty" 
-puts "TODO CR23096 ALL: CHECKSHAPE : Faulty" 
 puts "TODO CR23096 ALL: NBSHAPES : Faulty" 
 
+set LinuxDiff 3
 set filename r76sy.stp
 
 set ref_data {
 DATA        : Faulties = 0  ( 0 )  Warnings = 0  ( 0 )  Summary  = 0  ( 0 )
 TPSTAT      : Faulties = 1  ( 4 )  Warnings = 68  ( 103 )  Summary  = 69  ( 107 )
-CHECKSHAPE  : Wires    = 2  ( 0 )  Faces    = 2  ( 0 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
-NBSHAPES    : Solid    = 23  ( 23 )  Shell    = 47  ( 47 )  Face     = 194  ( 194 )   Summary  = 1352  ( 1357 )
-STATSHAPE   : Solid    = 23  ( 23 )  Shell    = 47  ( 47 )  Face     = 194  ( 194 )   FreeWire = 0  ( 0 )   FreeEdge  = 0 ( 0 )   SharedEdge = 504  ( 504 )
+CHECKSHAPE  : Wires    = 1  ( 0 )  Faces    = 1  ( 0 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
+NBSHAPES    : Solid    = 23  ( 23 )  Shell    = 47  ( 47 )  Face     = 194  ( 194 )   Summary  = 1350  ( 1357 )
+STATSHAPE   : Solid    = 23  ( 23 )  Shell    = 47  ( 47 )  Face     = 194  ( 194 )   FreeWire = 0  ( 0 )   FreeEdge  = 0 ( 0 )   SharedEdge = 502  ( 504 )
 TOLERANCE   : MaxTol   =   0.0205434719  (   0.0293421419 )  AvgTol   =  0.0005065999101  (   0.00138068504 )
 LABELS      : N0Labels = 3  ( 3 )  N1Labels = 69  ( 67 )  N2Labels = 0  ( 0 )   TotalLabels = 72  ( 70 )   NameLabels = 5  ( 5 )   ColorLabels = 47  ( 45 )   LayerLabels = 43  ( 45 )
 PROPS       : Centroid = 0  ( 0 )  Volume   = 0  ( 0 )  Area     = 0  ( 0 )
diff --git a/tests/de/step_2/F4 b/tests/de/step_2/F4
index ae982f4742..9e4305716d 100755
--- a/tests/de/step_2/F4
+++ b/tests/de/step_2/F4
@@ -14,7 +14,7 @@ TPSTAT      : Faulties = 0  ( 0 )  Warnings = 4  ( 1 )  Summary  = 4  ( 1 )
 CHECKSHAPE  : Wires    = 1  ( 0 )  Faces    = 1  ( 0 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
 NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 1  ( 1 )  Face     = 55  ( 54 )   Summary  = 329  ( 314 )
 STATSHAPE   : Solid    = 0  ( 0 )  Shell    = 1  ( 1 )  Face     = 55  ( 54 )   FreeWire = 0  ( 0 )   FreeEdge  = 0 ( 0 )   SharedEdge = 139  ( 130 )
-TOLERANCE   : MaxTol   =    43.63397635  ( 0.004765335881 )  AvgTol   =    0.9413185963  (  0.0005744934329 )
+TOLERANCE   : MaxTol   =    43.63397625  ( 0.004765335881 )  AvgTol   =     1.059548993  (  0.0005744934329 )
 LABELS      : N0Labels = 1  ( 1 )  N1Labels = 53  ( 54 )  N2Labels = 0  ( 0 )   TotalLabels = 54  ( 55 )   NameLabels = 1  ( 1 )   ColorLabels = 0  ( 0 )   LayerLabels = 53  ( 54 )
 PROPS       : Centroid = 0  ( 0 )  Volume   = 0  ( 0 )  Area     = 0  ( 0 )
 NCOLORS     : NColors  = 0  ( 0 )
diff --git a/tests/de/step_2/M4 b/tests/de/step_2/M4
index 1b540526c0..a4b99a4e7e 100644
--- a/tests/de/step_2/M4
+++ b/tests/de/step_2/M4
@@ -7,7 +7,7 @@ TPSTAT      : Faulties = 0  ( 0 )  Warnings = 4  ( 8 )  Summary  = 4  ( 8 )
 CHECKSHAPE  : Wires    = 2  ( 2 )  Faces    = 2  ( 2 )  Shells   = 1  ( 1 )   Solids   = 1 ( 1 )
 NBSHAPES    : Solid    = 4  ( 4 )  Shell    = 4  ( 4 )  Face     = 40  ( 40 )   Summary  = 263  ( 263 )
 STATSHAPE   : Solid    = 4  ( 4 )  Shell    = 4  ( 4 )  Face     = 40  ( 40 )   FreeWire = 0  ( 0 )   FreeEdge  = 0 ( 0 )   SharedEdge = 98  ( 98 )
-TOLERANCE   : MaxTol   =   0.7226608412  (   0.7227160437 )  AvgTol   =   0.04200651748  (   0.04200775508 )
+TOLERANCE   : MaxTol   =   0.7571968817  (    0.757178949 )  AvgTol   =   0.04326711711  (   0.04326805656 )
 LABELS      : N0Labels = 1  ( 1 )  N1Labels = 4  ( 4 )  N2Labels = 0  ( 0 )   TotalLabels = 5  ( 5 )   NameLabels = 1  ( 1 )   ColorLabels = 4  ( 4 )   LayerLabels = 0  ( 0 )
 PROPS       : Centroid = 0  ( 0 )  Volume   = 0  ( 0 )  Area     = 0  ( 0 )
 NCOLORS     : NColors  = 2  ( 2 )
diff --git a/tests/de/step_2/S1 b/tests/de/step_2/S1
index 6811c4ba78..29df69d871 100644
--- a/tests/de/step_2/S1
+++ b/tests/de/step_2/S1
@@ -10,7 +10,7 @@ set ref_data {
 DATA        : Faulties = 0  ( 0 )  Warnings = 0  ( 0 )  Summary  = 0  ( 0 )
 TPSTAT      : Faulties = 0  ( 0 )  Warnings = 39  ( 6 )  Summary  = 39  ( 6 )
 CHECKSHAPE  : Wires    = 64  ( 48 )  Faces    = 64  ( 48 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
-NBSHAPES    : Solid    = 15  ( 16 )  Shell    = 17  ( 17 )  Face     = 367  ( 366 )   Summary  = 2505  ( 2495 )
+NBSHAPES    : Solid    = 15  ( 16 )  Shell    = 17  ( 17 )  Face     = 367  ( 366 )   Summary  = 2506  ( 2495 )
 STATSHAPE   : Solid    = 71  ( 79 )  Shell    = 87  ( 87 )  Face     = 2740  ( 2732 )   FreeWire = 0  ( 0 )   FreeEdge  = 0 ( 0 )   SharedEdge = 1064  ( 1057 )
 TOLERANCE   : MaxTol   =    4.389003466  (    5.153790881 )  AvgTol   =   0.05707355423  (   0.06633632879 )
 LABELS      : N0Labels = 10  ( 10 )  N1Labels = 32  ( 32 )  N2Labels = 0  ( 0 )   TotalLabels = 42  ( 42 )   NameLabels = 22  ( 22 )   ColorLabels = 22  ( 22 )   LayerLabels = 0  ( 0 )
diff --git a/tests/de/step_2/Y5 b/tests/de/step_2/Y5
index f6a0f893b0..a36b39e710 100644
--- a/tests/de/step_2/Y5
+++ b/tests/de/step_2/Y5
@@ -9,8 +9,8 @@ set ref_data {
 DATA        : Faulties = 0  ( 9 )  Warnings = 0  ( 0 )  Summary  = 0  ( 9 )
 TPSTAT      : Faulties = 0  ( 0 )  Warnings = 77  ( 39 )  Summary  = 77  ( 39 )
 CHECKSHAPE  : Wires    = 0  ( 0 )  Faces    = 1  ( 0 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
-NBSHAPES    : Solid    = 11  ( 11 )  Shell    = 13  ( 13 )  Face     = 270  ( 270 )   Summary  = 1653  ( 1646 )
-STATSHAPE   : Solid    = 11  ( 11 )  Shell    = 13  ( 13 )  Face     = 270  ( 270 )   FreeWire = 0  ( 0 )   FreeEdge  = 0 ( 0 )   SharedEdge = 642  ( 640 )
+NBSHAPES    : Solid    = 10  ( 10 )  Shell    = 12  ( 12 )  Face     = 269  ( 269 )   Summary  = 1638  ( 1636 )
+STATSHAPE   : Solid    = 10  ( 10 )  Shell    = 12  ( 12 )  Face     = 269  ( 269 )   FreeWire = 0  ( 0 )   FreeEdge  = 0 ( 0 )   SharedEdge = 636  ( 636 )
 TOLERANCE   : MaxTol   =  0.01008857123  (  0.01008857108 )  AvgTol   =  0.0003104589496  (  0.0003616303196 )
 LABELS      : N0Labels = 3  ( 3 )  N1Labels = 2  ( 3 )  N2Labels = 0  ( 1 )   TotalLabels = 5  ( 7 )   NameLabels = 5  ( 5 )   ColorLabels = 0  ( 0 )   LayerLabels = 0  ( 0 )
 PROPS       : Centroid = 0  ( 0 )  Volume   = 0  ( 0 )  Area     = 0  ( 0 )
diff --git a/tests/de/step_3/A4 b/tests/de/step_3/A4
index f1ff540024..fbcb11a9a1 100644
--- a/tests/de/step_3/A4
+++ b/tests/de/step_3/A4
@@ -8,8 +8,8 @@ set ref_data {
 DATA        : Faulties = 0  ( 0 )  Warnings = 0  ( 0 )  Summary  = 0  ( 0 )
 TPSTAT      : Faulties = 0  ( 0 )  Warnings = 322  ( 148 )  Summary  = 322  ( 148 )
 CHECKSHAPE  : Wires    = 0  ( 0 )  Faces    = 0  ( 0 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
-NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 797  ( 797 )  Face     = 797  ( 797 )   Summary  = 11928  ( 11928 )
-STATSHAPE   : Solid    = 0  ( 0 )  Shell    = 797  ( 797 )  Face     = 797  ( 797 )   FreeWire = 0  ( 0 )   FreeEdge  = 0 ( 0 )   SharedEdge = 4821  ( 4821 )
+NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 797  ( 797 )  Face     = 797  ( 797 )   Summary  = 11927  ( 11927 )
+STATSHAPE   : Solid    = 0  ( 0 )  Shell    = 797  ( 797 )  Face     = 797  ( 797 )   FreeWire = 0  ( 0 )   FreeEdge  = 0 ( 0 )   SharedEdge = 4820  ( 4820 )
 TOLERANCE   : MaxTol   =  0.03846819732  (   0.0394709482 )  AvgTol   =  0.0008687242138  (  0.002865279517 )
 LABELS      : N0Labels = 1  ( 1 )  N1Labels = 0  ( 0 )  N2Labels = 0  ( 0 )   TotalLabels = 1  ( 1 )   NameLabels = 1  ( 1 )   ColorLabels = 0  ( 0 )   LayerLabels = 0  ( 0 )
 PROPS       : Centroid = 0  ( 0 )  Volume   = 0  ( 0 )  Area     = 0  ( 0 )
diff --git a/tests/de/step_3/A8 b/tests/de/step_3/A8
index 472110dadb..cb95fa9ece 100644
--- a/tests/de/step_3/A8
+++ b/tests/de/step_3/A8
@@ -8,7 +8,7 @@ set filename PRO10109.stp
 set ref_data {
 DATA        : Faulties = 0  ( 0 )  Warnings = 0  ( 0 )  Summary  = 0  ( 0 )
 TPSTAT      : Faulties = 0  ( 0 )  Warnings = 47  ( 41 )  Summary  = 47  ( 41 )
-CHECKSHAPE  : Wires    = 0  ( 0 )  Faces    = 1  ( 1 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
+CHECKSHAPE  : Wires    = 0  ( 1 )  Faces    = 1  ( 2 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
 NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 209  ( 129 )  Face     = 209  ( 209 )   Summary  = 3032  ( 2883 )
 STATSHAPE   : Solid    = 0  ( 0 )  Shell    = 209  ( 129 )  Face     = 209  ( 209 )   FreeWire = 0  ( 1 )   FreeEdge  = 67 ( 67 )   SharedEdge = 1152  ( 1150 )
 TOLERANCE   : MaxTol   =   0.3035246255  (   0.3035246024 )  AvgTol   =  0.001361092422  (  0.003604130581 )
diff --git a/tests/de/step_3/A9 b/tests/de/step_3/A9
index faa789f0a1..320b7cb839 100755
--- a/tests/de/step_3/A9
+++ b/tests/de/step_3/A9
@@ -1,5 +1,4 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
-puts "TODO CR25593 ALL: CHECKSHAPE : Faulty" 
 
 set filename trj7_pm5-hc-214.stp
 
diff --git a/tests/de/step_3/D3 b/tests/de/step_3/D3
index 5a4d676a83..8d39937697 100644
--- a/tests/de/step_3/D3
+++ b/tests/de/step_3/D3
@@ -1,6 +1,4 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
-puts "TODO CR25593 ALL: Error : 3 differences with reference data found :" 
-puts "TODO CR25593 ALL: TPSTAT : Faulty" 
 
 set LinuxDiff 1
 set LinuxFaulties {CHECKSHAPE}
diff --git a/tests/de/step_3/D8 b/tests/de/step_3/D8
index c283bb7cb3..3480b140ce 100755
--- a/tests/de/step_3/D8
+++ b/tests/de/step_3/D8
@@ -1,7 +1,6 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
-puts "TODO CR25593 ALL: CHECKSHAPE : Faulty" 
-
 # No checkape error on WNT in 64-bit only (after 22598 and issue 25797 was registered for that)
+puts "TODO CR23096 Linux: CHECKSHAPE : Faulty"
 
 set filename trj6_pm4-hc-214.stp
 
diff --git a/tests/heal/split_angle/F2 b/tests/heal/split_angle/F2
index 851c38719f..3a4b784619 100644
--- a/tests/heal/split_angle/F2
+++ b/tests/heal/split_angle/F2
@@ -1,3 +1 @@
-puts "TODO OCC25593 ALL: Faulty shapes in variables faulty_1 to faulty_4 "
-
 restore [locate_data_file wrong_checkshape_2.brep] a
diff --git a/tests/heal/split_closed_faces/G5 b/tests/heal/split_closed_faces/G5
index ae80cdd8c9..3a4b784619 100644
--- a/tests/heal/split_closed_faces/G5
+++ b/tests/heal/split_closed_faces/G5
@@ -1,2 +1 @@
-puts "TODO OCC24035 ALL: Faulty shapes in variables faulty_1 to faulty_"
 restore [locate_data_file wrong_checkshape_2.brep] a