X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=blobdiff_plain;f=src%2FBSplCLib%2FBSplCLib.cxx;h=f41a8937260586bbb99797caf3f14208d3a364df;hb=c1c03615f606465893a832f4748a636c66607dfd;hpb=34028c1ff39e3b9e5e4e21c7afb954a85f469de0 diff --git a/src/BSplCLib/BSplCLib.cxx b/src/BSplCLib/BSplCLib.cxx index 345e3c6c1b..f41a893726 100644 --- a/src/BSplCLib/BSplCLib.cxx +++ b/src/BSplCLib/BSplCLib.cxx @@ -1702,6 +1702,7 @@ Standard_Boolean BSplCLib::PrepareInsertKnots ak++; } + Standard_Integer aLastKnotMult = Mults (Knots.Upper()); Standard_Real au,oldau = AddKnots(ak),Eps; while (ak <= AddKnots.Upper()) { @@ -1741,7 +1742,15 @@ Standard_Boolean BSplCLib::PrepareInsertKnots } else if (amult > mult) { if (amult > Degree) amult = Degree; - sigma += amult - mult; + if (k == Knots.Upper () && Periodic) + { + aLastKnotMult = Max (amult, mult); + sigma += 2 * (aLastKnotMult - mult); + } + else + { + sigma += amult - mult; + } } /* // on periodic curves if this is the last knot @@ -1779,7 +1788,7 @@ Standard_Boolean BSplCLib::PrepareInsertKnots //instance); //respectively AddMults() must meet this requirement if AddKnots() contains //knot(s) coincident with first or last - NbPoles = sigma - Mults(Knots.Upper()); + NbPoles = sigma - aLastKnotMult; } else { NbPoles = sigma - Degree - 1; @@ -1968,7 +1977,8 @@ void BSplCLib::InsertKnots if (Periodic) { // on periodic curve the first and last knot are delayed to the end if (curk == Knots.Lower() || (curk == Knots.Upper())) { - firstmult += depth; + if (firstmult == 0) // do that only once + firstmult += depth; depth = 0; } }