I have a set of 3D points which I am trying to interpolate using a pth-degree B-Spline. I have implemented the algorithm described here https://pages.mtu.edu/~shene/COURSES/cs3621/NOTES/INT-APP/CURVE-INT-global.html so that the curve passes through the datapoints. Also, the curve I have has the 1st point equal to the last points, since it is a closed curve.
Now, I have implemented the interpolation algorithm for the clamped case, where the 1st p and last p knots are 0 and 1, respectively, and have p+1 multiplicity. However, I am struggling to do the same for the closed case, where I want the curve to be periodic.
I have successfully transformed the clamped (or open) curve representation I obtained into a closed representation by modifying the knots, according to the Control Point Wrapping algorithm described here: https://pages.mtu.edu/~shene/COURSES/cs3621/NOTES/spline/B-spline/bspline-curve-closed.html
However, I have tried to do the same with the Knot Wrapping algorithm, but with no success. They say to wrap the last knots with the first ones, but the knot vector is supposed to be a sequence of nondecreasing real numbers, so that can't be. I have also tried to do the wrapping by extending the knot vector past 1 for the knots corresponding to the wrapped control points, while keeping the knot deltas in the beginning of the knot vector, but that didn't work either.
Now I am wondering if I should solve the system of equations already knowing the final curve has to be closed, instead of trying to transform the clamped curve into a closed one. Would anyone know how to correctly implement this, or know where to point me in the right direction?
Any help would be appreciated.
In my opinion, it adds a new b-spline, instead of moving one part of the old to make it closed.