PLANNING UPDATE: 25 September 2022
I'm still in the process of fixing known issues in the tangent at knot constraint. But I wanted to quickly talk about a case where the constraint does work, yet does not give us the results we need. This in turn can shed some light on what the next steps should be for better B-spline support.

**NOTE:** this post is very much on the technical side.
The case is this: Let's say we want to make a vase with a given maximum and minimum diameter, and say we also constrain the heights where we want these diameters. Let us say the base should be a certain diameter and the side should be C1-continuous at that, and the mouth should have a certain angle. Let's still further say we want the side of the vase to be C2-smooth from the base to mouth. We can make a B-spline like shown below, with knots at those positions, and set tangent to the vertical.

- vase-planned-cross-section.png (14.89 KiB) Viewed 789 times

This is a schematic I drew in Inkscape, but it is possible to represent the side as a

Hermite spline, which is just another way to represent a spline, like B-spline is.

Let us also restrict ourselves to non-rational B-splines. So we start with a B-spline and start constraining the knots as described.

- vase-base-sketch-with-bspline.png (35.73 KiB) Viewed 789 times

Right now, The exact values are not very important (apart from the fact they should work well with each other). We built this and are at the last stage: 2 DOFs left, which will go away when we apply tangent constraint at the free knot (select spline, knot and line and press tangent). However, we see that this doesn't work well (go ahead, try with the following file).

*<technical part begins here>*
Now, there are a number of ways this issue can be solved, say by inserting a knot. But let's try a method that does not involve that.

Let's try building something with joining "Bezier Curves" (the value of the minimum diameter is different, but this is the value I prefer and in the previous case if I enter this value the result is horrible).

- Screenshot from 2022-09-25 13-42-07.png (29.89 KiB) Viewed 789 times

Now, provided we choose the right shapes to ensure proper continuity, this gives us a solution to our case. However, this is not complete because we want a B-spline and we have a set of Bezier curves, so let us start joining them. After ensuring the curves are continuous, we have 6 remaining degrees of freedom (compare this with the zero in the first case). Of these, 2 have to be to ensure curvature continuity at the middle knots. I don't really have an answer right now for how to restrict the last four, but I have an idea for two of them.

Basically what might be happening is that the "non-uniform" part of "NURBS" may be coming into picture. Every knot point has a parameter value associated with it (that is, technically, what is called the

*knot*), and the difference between these can change the shape of the spline. If we restrict the first and last knots to be 0 and 1(for scaling), we have the freedom to choose the values at the remaining knots, here 2. There is some precedence to this, for example the

centripetal Catmull-Rom splines. Currently the knots are hardcoded, but if we are able to make that as another variable as well, this example could become possible.

This actually also gives one possibility of implementing point-on-B-spline: create a "zero multiplicity knot" constraint (I don't believe such a concept exists, so perhaps a better terminology should be used). This constraint will say that the point should remain on the curve, but the parameter where it sits can change. Then, follow the same routine as with the previous knot constraints, and in theory we are done. I also imagine that the math might be slightly simpler here as compared to the possibility of changing "non-zero multiplicity knots" (I still owe people an explanation of what the math really is

). If it works it would also be significantly simpler than the previous idea I had, which would involve numerical methods to compute the minimum distance from a the spline and how it changes with change in every relevant variable.

*<technical part ends here>*
So I think that would be my next step once I finish what I have on my table right now (which may take slightly longer because of IRL stuff). Once knot tangency is completed, I will start on the "curve at parameter" constraint, and look at the possibility to make that parameter itself variable.