back

by raphlinus·23h ago·view on hn ↗
I'll try to answer some of these questions.

Yes, there are regions of the parameter space where moving a control point has vanishing effect on the curve shape. I'm not thrilled about this and have explored alternatives, but this is the best I could come up with. Pretty much all approaches based on solving for optimal curve fit have discontinuous "flipping" behavior. Another approach would be to split

We haven't yet done the work wiring this up into a spline like the older pen tool draft. The "auto point" is not a form of subdivision but is a way of achieving G2 continuity.

Yes, hyperbeziers can be split and subdivided without much trouble at all, and being closed under subdivision is an important mathematical property that was lacking in the earlier draft. This follows directly from their formulation as polynomials. If you look into the code, you'll see that there's subdivision at the near-cusp to make the integral robust.

The P/C naming evokes Hermite but there wasn't a lot of thought into it.

Math is heavier, but this is more nuanced than you might expect. My feeling is that computers are fast, so if we can draw higher quality curves with less human effort, it's worth it. But the seeming simplicity of Béziers is deceptive; you often have to solve inverse arc length problems (for example to compute dashing), and curve fitting is really hard (I have a blog post in the pipeline on that). So I think overall the math is only slightly heavier.

The goal is human-driven interactive design, originally motivated by font design. Splitting into more Béziers obviously gives much finer control, but it's hard to avoid them getting lumpy. In most fonts you have a minimum number of Bézier segments and accept whatever fine details the Bézier math gives you. That's even more so when making variable fonts, where the control points are interpolated.

I haven't yet done a rigorous comparison with NURBS. While they're hugely popular in CAD, they're basically unused in things like font design.

Thanks for these questions, they obviously show a deeper understanding.

2 comments
Thanks! Okay this makes sense, and I have to agree interactive design with fonts & CAD does call for more control, and subdivision and resampling does often lead to lumpy, or just harder to manage curves. Personally I use splines mainly for CG hair rendering and procedural geometry, so very different goals. Do you see any major benefits to using hyperbezier curves for procedural/simulation assets like hair, or for applications like maps or auto-generated UI or other use-cases outside of manual design?

I have some modest experience with the polynomial curves but very little experience with the kind of non-polynomial curves you post about. I’m always curious but haven’t spent the time studying that I’d like to. I don’t have a lot of experience with NURBS either; it was just the rational in the hyperbezier curvature formula that made me think maybe there’s a relationship, and/or the rational in NURBS has something to do with it’s greater level of control versus the uniform B-spline.

Super good questions.

First, for hair rendering you've got a 3D trajectory, which Béziers can handle just fine, but I'm not sure about these spirals. I do have a chapter in my thesis and there has been a bit of followup from others, but I can't say anything with confidence.

That said, because of the specular reflections, applications like hair really would benefit from higher degrees of continuity. Cem Yuksel has a recent SIGGRAPH paper on how to tweak Béziers to get more continuity. In fact, seeing that was one of the motivations to take this work off the back burner.

I'm not sure about maps. But I do know of applications representing the centerline for autonomous vehicles that use polynomial spiral representations, specifically because of the extremely high degrees of continuity you can attain. For that, you don't have to represent these high-tension curvature regions.

I do think there is a specific application for drawing smooth connecting lines in autogenerated diagrams. These tend to be S-shaped, and with Béziers you tend to get curvature peaks near the endpoints. You're much better off with monotonic curvature and with spirals that's easier to achieve. And I also believe being able to get those squircle/superellipse shapes would help as well.

> because of the specular reflections, applications like hair really would benefit from higher degrees of continuity.

Oh this is interesting. So FWIW - I’ve done a bit of CG hair in production (in a previous life, for DreamWorks) - and now that everyone’s ray tracing, I like to advocate for considering quadratic B-splines for CG hair over cubics. In practice, I don’t personally think you can see anything in hair specular reflections that is based on degree or continuity beyond C1. Catmull-Rom is only C1 and people have been using Catroms for hair for a long time (and interesting side note - I’ve found that Catmull-Rom curves are pretty lumpy and ugly, even lumpier than quadratic B-splines. This is possibly very similar to the issue of designing with subdivision you mentioned).

My opinion here does not apply to surface patches - with surfaces, the continuity can be visible in the reflections. But at my work among the researchers there was a very strong assumption that cubic B-spline curves would be visibly better than quadratic, and that quadratic would suffer from reflection artifacts due to the C1 continuity, which just doesn’t seem to be true (and ignores the history of Catmull-Rom). Quadratic curves are faster and more accurate for ray intersections and bbox calculations, and they offer some interesting advantages like having an analytic rotation-minimizing frame (with the Frenet frame, even…). Of course with procedural curves, I recommend only the quadratic B-spline, not Bézier. With a uniform B-spline, the degree of the curve is essentially nothing more than a smoothing factor. Production hair/fur/sim data tends to be over-sampled already, so the smoothing factor doesn’t buy you much.

BTW, yes I know Cem and I’m familiar with his work. He also has published on some non-polynomial curve types, so your post reminded me of him as well.

re: the control points having areas where the curve is unresponsive. IIUC, whereas the control points of a Bezier have direct meaning, this is an attempt at a sensible/usable mapping of synthetic control points to the curve? Which presumably means it could be made much better with some work/exploration? Or did I misunderstand that part?