4 ms·
This is very interesting! I'm mostly familiar with b-splines and NURBS and such, and there's some behaviour in this demo that I don't understand. If I create a
by spiralganglion 8y ago
This is very interesting!
I'm mostly familiar with b-splines and NURBS and such, and there's some behaviour in this demo that I don't understand. If I create a round control point, and spin that point's handles around, sometimes the curve coming in and out of the point is a beautifully smooth tangent, coming in one side and out the other, and sometimes it forms a spike, doubling back on itself. Is there a term for that? Why does it happen? I find it fascinating and would like to learn more.
- raphlinus 8y agoIt's likely it could be reworked to not make those spikes. The reason it happens is tricky. The basic curve family (what you get when you don't add explicit tangents) has a π-periodicity in the angles. Essentially it cares about the slope of the tangent but not the signed direction, and reverses the sign as needed. The curvature blending uses the same family but the sign reversals don't always "make sense" in terms of producing a smooth result. It's not obvious it would be better, as what you'd get would be more "twisty," and it's also possible the twistiness would snap as you rotated the handles. So making a direction reversal might be one of the less visually objectionable ways to handle the problem. This is one of those "deep UX" questions I find fascinating.
- spiralganglion 8y agoMakes sense. Personally, I like it, though it does make the curve slightly less predictable.
- strainer 8y agoWhen the bar is turned through 360 degrees its adjustment effect seems to go through 2 complete cycles. A single ended adjustment line which begins perpendicular in a default orientation and goes through just 1 complete adjustment cycle when turned 360 might be easier to control and understand, even though it would be less like the familiar bezier tweak lines.
- jacobolus 8y agoThis spline only depends on the orientation of the tangent line, not on the direction of the tangent ray. i.e. it is periodic every half turn, as you found. That’s actually the whole point of this type of curve (and also Adobe’s recent “k-curve” tool) – knots are more or less at the curvature extremes; pulling a knot outward will make first a ruffle shape, then a sharp cusp, then a loop; the curve in general doesn’t extend far outside the rough shape of a polygon through the knots; and the solver is robust. There exist plenty of curve primitives more like what you are suggesting here (see Raph’s PhD thesis), with a full-turn periodicity. But they end up creating shapes which loop out past the knots, and they also tend to not have unique solutions all the time, with the result that they sometimes will discretely jump from one local minimum to another as you make slight changes in the inputs.
- strainer 8y ago> There exist plenty of curve primitives more like what you are suggesting here. The only thing difference I suggest is the control. Its the difference between: effect = control_angle mod PI ,or effect = control_angle / 2 When a full turn of the control produces a full cycle of effect a better ergonomic relationship might result.
- jacobolus 8y agoYes, but the generated shapes are based on the curve primitives used. The whole point of this particular curve primitive is that the “default” shape of the spline (if you don’t try to set the tangents explicitly) doesn’t extend much past the knots, because of the half-turn periodicity. As you drag a knot away from the spline, you will get a cusp shape with the knot at the cusp, and if you drag further it will turn into a loop with the knot at the peak of the loop. If you instead had a full-turn periodicity, you would have substantially different properties for the curve shape. Several such curve primitives exist, you can use one of those if you want. This is one of the trade-offs involved in the choice of tool. With this particular type of curve primitive, the primary way to change the spline is by adding and moving control points, not by trying to manually specify tangents. The latter should not be used for general shape design but should be seen as a specialty tool to support niche technical requirements (such as straight segment to curve interfaces), and tangent adjustments should be sparing because large tangent adjustments will create lumpy shapes.