Hacker News new | ask | show | jobs
by bobbylarrybobby 1019 days ago
Are Bézier curves with handles “worth it”? I've always found the easiest method for drawing curves to be, simply, “give me the (cubic) spline curve that goes through these points”. You place your points and continuity conditions determine the cubic, as described in https://mathworld.wolfram.com/CubicSpline.html .
2 comments

It of course depends on what you need, what you’re doing. The cubic Bézier curves with handles are probably the best thing for animation curves, specifically because having handles allow you to break the continuity of the curve, and change direction suddenly. Animators need this when tweaking motion curves on a timeline. Think of abrupt changes in speed, like with collisions.

Splines with tangent handles are much better for font design as well, than splines without handles.

Splines defined by points and not tangents are useful for different reasons, and they’re not great if you want to have sharp changes of angle. You can do it by duplicating control points, but that causes some math mayhem in some situations.

In computer graphics people use the “Catmull-Rom” spline a lot, which is a type of interpolating spline that goes through the control points. https://en.wikipedia.org/wiki/Centripetal_Catmull–Rom_spline

People also use the B-spline as well, which is smoother and nicer than the Catmull-Rom spline, but it’s an approximating spline that doesn’t usually go exactly through the control points. https://en.wikipedia.org/wiki/B-spline

Both of these get used in CG for hair and fur - which is a good example of an application of curves that doesn’t require sharp angles along the splines.

That's exactly what I've always been curious about!

It seems vastly more intuitive to place points rather than adjust handles. (And set directions for endpoints if the curve is open.)

And obviously a practical tool will provide the capability to join separate cubic splines at sharp angles.

Does anyone know of a GUI drawing tool based on this? I've always wanted to experiment with it. Because I've always wanted to either confirm that it's a great idea that we should all be using instead of beziers, or else discover if there's an immediately obvious reason once you try it out that it's a terrible idea.

I have used this in some commercial software before (maybe Illustrator?); my experience was not positive. When you move a node, some not-so-close curves start wiggling, and you think, "I already set that part correctly, stop moving please". It behaves very poorly around rounded corners. Adding points causes the curves to shift, usually not how you want, and then you try to add more points, which causes more shifts, etc. Arc length-based interpolation might do better in this respect, as opposed to the (# of points)-based interpolation which I expect it used.

The alternative, which obeys similar principles, is the Pencil tool. This simply spams out a ton of points to match what you draw. https://news.ycombinator.com/item?id=37460009 mentions that these points can be capably reduced, which could serve your purpose.