Remix.run Logo
Syzygies 3 days ago

I'm hoping to code Bezier animation in OCaml/F# in four dimensional space time, with a moving vantage point. Offload rendering each time slice frame to worker threads.

I'm surprised Bezier-rs is all about curves. Sure, fonts, but I can't be alone here in seeing curves as a special case.

It's easy as a pure mathematician to write off Bezier theory as "specialized" but it's simply the right way to work with polynomials on a simplex.

ttd 3 days ago | parent [-]

If you're not restricted to Bezier for graphics (it's a very common choice as the path primitive for vector graphics), there are other classes of curves that you may find are a better fit. In particular, I think animations typically feel better if they move at constant speed - which is nontrivial with Bezier curves because they do not have an exact closed-form arc length parameterization. Something like pythagorean hodographs could be a better fit for your application.

I am not a mathematician though, so if you have other insight I'd be glad to hear it.

ttoinou 3 days ago | parent [-]

Instead of using closed form, they can easily computed with the approximation of the curve with segments, and you place the points where there is most curvature or where the 1st derivative isn't close to zero

ttd 3 days ago | parent [-]

Yes - but there are other curve classes (like P-H) that have an exact solution and don't need approximation. Bezier curves have tons of nice properties but also a lot of shortcomings, for example not being able represent conic sections like circles and ellipses without introducing weighting (rationals), which complicate computations even further. So, depending on what you're doing with them, it's worth exploring other curve types IMO.

ttoinou 2 days ago | parent [-]

Great, I'm looking at P-H and it's very interesting and useful