E.g. for moving an object at constant speed along the curve.
[1]: https://docs.rs/bezier-rs/latest/bezier_rs/struct.Bezier.htm...
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)
https://github.com/GraphiteEditor/Graphite/tree/master/libra...
I could do with python bindings for this.
This would be such a pain in the ass to implement with good precision and performance.
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.
But I agree with the OP, artists might only need new tools that use quadratic bezier curves in a different ways
For Beziér curves remember the basics:
- put nodes at extrema and points of inflection (extreme left/right, top/bottom, middle of _S_ curve)
- rule of 30 --- off curve nodes should be ~30% away from the matching on curve node for smoothest appearance unless the shape one is trying to achieve dictates a different placement
If you just do a start/end point it will create a cubic with 2 endpoints and 2 control points. But if you drop a whole series of points (up to 12 I think) it will create a curve that passes though all of them. This is done by internally creating a bunch of cubic splines where the control points are automatically positioned and not shown. You still get 2 control points for the derivatives at the ends, unless you create a closed loop.
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/
https://github.com/solvespace/solvespace/blob/master/src/srf...
https://www.youtube.com/watch?v=jvPPXbo87ds (73 minutes)
https://www.youtube.com/watch?v=aVwxzDHniEw (24 minutes)
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.
[0] https://github.com/GraphiteEditor/Graphite/blob/master/libra...
Syzygies•14h ago
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•5h ago
I am not a mathematician though, so if you have other insight I'd be glad to hear it.
ttoinou•4h ago
ttd•1h ago