CR23683: Geom_BSplineSurface incorrectly determines continuity for periodic cases
[occt.git] / src / Geom2d / Geom2d_BSplineCurve.cxx
index 8fd69af..c696f3e 100755 (executable)
@@ -71,63 +71,6 @@ static void CheckCurveData
     Standard_ConstructionError::Raise("BSpline curve : # Poles and degree mismatch");
 }
 
-//=======================================================================
-//function : KnotAnalysis
-//purpose  : Internal use only
-//=======================================================================
-
-static void KnotAnalysis
-(const Standard_Integer           Degree,
- const Standard_Boolean           Periodic,
- const TColStd_Array1OfReal&      CKnots,
- const TColStd_Array1OfInteger&   CMults,
- GeomAbs_BSplKnotDistribution&    KnotForm,
- Standard_Integer&                MaxKnotMult)
-{
-  KnotForm = GeomAbs_NonUniform;
-
-  BSplCLib_KnotDistribution KSet = 
-    BSplCLib::KnotForm (CKnots, 1, CKnots.Length());
-  
-
-  if (KSet == BSplCLib_Uniform) {
-    BSplCLib_MultDistribution MSet =
-      BSplCLib::MultForm (CMults, 1, CMults.Length());
-    switch (MSet) {
-    case BSplCLib_NonConstant   :       
-      break;
-    case BSplCLib_Constant      : 
-      if (CKnots.Length() == 2) {
-       KnotForm = GeomAbs_PiecewiseBezier;
-      }
-      else {
-       if (CMults (1) == 1)  KnotForm = GeomAbs_Uniform;   
-      }
-      break;
-    case BSplCLib_QuasiConstant :   
-      if (CMults (1) == Degree + 1) {
-       Standard_Real M = CMults (2);
-       if (M == Degree )   KnotForm = GeomAbs_PiecewiseBezier;
-       else if  (M == 1)   KnotForm = GeomAbs_QuasiUniform;
-      }
-      break;
-    }
-  }
-
-  Standard_Integer FirstKM = 
-    Periodic ? CKnots.Lower() :  BSplCLib::FirstUKnotIndex (Degree,CMults);
-  Standard_Integer LastKM =
-    Periodic ? CKnots.Upper() :  BSplCLib::LastUKnotIndex (Degree,CMults);
-  MaxKnotMult = 0;
-  if (LastKM - FirstKM != 1) {
-    Standard_Integer Multi;
-    for (Standard_Integer i = FirstKM + 1; i < LastKM; i++) {
-      Multi = CMults (i);
-      MaxKnotMult = Max (MaxKnotMult, Multi);
-    }
-  }
-}
-
 //=======================================================================
 //function : Rational
 //purpose  : check rationality of an array of weights
@@ -1298,7 +1241,7 @@ void Geom2d_BSplineCurve::UpdateKnots()
   rational = !weights.IsNull();
 
   Standard_Integer MaxKnotMult = 0;
-  KnotAnalysis (deg,
+  BSplCLib::KnotAnalysis (deg,
                periodic,
                knots->Array1(), 
                mults->Array1(),