20 comments

[ 3.1 ms ] story [ 39.6 ms ] thread
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.

Is the documentation using the library itself for visualizations?
Very neat. I'm not sure if I missed it, but is there any way to get n equidistant points on the curve?

E.g. for moving an object at constant speed along the curve.

Great example, this is the kind of stuff that we could make use of interactive documents for, and not bend them into applications.
Almost even more interesting is the Bezier Boolean-Operations lib they use (it’s a rewrite of Pathbool.js (https://github.com/r-flash/PathBool.js) in Rust)

https://github.com/GraphiteEditor/Graphite/tree/master/libra...

There’s not a ton of robust curve boolean libs out there that aren’t just part of some huge package of tools. This is the only one I know of that isn’t Js.

(Edit: added a link)

Bezier curves in painting software never gave me the results I wanted. And I mean never. I sincerely wonder who succeeds at using them?

From these graphs I see that I always wanted the simple Quadratic version, and would use 2 of them in sequence to approximate a Cubic version. That would be so much easier. But if the software could allow me to adjust the midpoint, and maintain a smooth transition, that would be perfect. I think.

So I basically wish for a different interface, one that has more thought put into it. Now it's a "give access to the parameters, and be done with it" kind. As if novices don't have the need for a nice smooth curve between known points.

This looks really nice!

I’m currently looking for a nice implementation of stroke expansion (here called outlining) that I can run in the browser, this seems like a good option besides skia (pathkit)[0] and vello/kurbo[1].

Ideally I’d love to be able to expand in a non-uniform way, similar to what Metafont does for bitmap fonts, or what Inkscape allows with its power stroke effect, or even just with a non-uniform ‘nib’ as is possible with FontForge[2].

This doesn’t seem to be something that these bezier libraries generally offer which is understandable, probably a rather niche goal.

[0] https://skia.org/docs/user/modules/pathkit/

[1] https://doc.servo.org/kurbo/stroke/index.html

[2] https://fontforge.org/docs/techref/stroke.html

So this is a long shot but, as a software engineer lacking in the math department who has slowly been trying to improve calculus and geometry, what are some good resources/requirements to get to a point where I can implement something like that ?
Pomax's primer on bézier curves is the reference they used: https://pomax.github.io/bezierinfo/

They do a pretty good job introducing the mathematics gently I think. But maybe work backwards from whatever you don't understand?

This library has a very interesting algorithm for computing the curve point closest to a given point, seemingly based on a root-finder that doesn't need any complex numbers. Does anyone know of any resources about such an algorithm?
The library only solves up to cubic equations, and the comments have a link to the following page: https://momentsingraphics.de/CubicRoots.html

For general polynomials, it matters a great deal in what basis it is represented. The typical monomial basis is usually not the best from a numerical standpoint. I am aware of some modern methods such as this: https://arxiv.org/pdf/1611.02435

For polynomials expressed in e.g. a Bernstein basis, there are often much faster and stable tailored methods working solving for the eigenvalues of a companion matrix of a different form.

If only you could make a perfect circle out of bezier curves.. then P=NP
I'm particularly impressed with the Offsetting - very nice looking library.
Is there anything interesting about this package beyond the fact that it's written in Rust?
"The library is now deprecated and has been archived in this repository" "Graphite has moved to Kurbo as of 2025,"