✓ Uses Rust 2018 edition
|0.6.2||Jun 26, 2020|
|0.5.11||Mar 17, 2020|
|0.5.6||Dec 9, 2019|
|0.5.4||Nov 1, 2019|
|0.1.0||Dec 27, 2018|
#9 in Graphics APIs
16,489 downloads per month
Used in 48 crates (6 directly)
The kurbo library contains data structures and algorithms for curves and vector paths. It is probably most appropriate for creative tools, but is general enough it might be useful for other applications.
The name "kurbo" is Esperanto for "curve".
There is a focus on accuracy and good performance in high-accuracy conditions. Thus, the library might be useful in engineering and science contexts as well, as opposed to visual arts where rough approximations are often sufficient. Many approximate functions come with an accuracy parameter, and analytical solutions are used where they are practical. An example is area calculation, which is done using Green's theorem.
The library is still in fairly early development stages. There are traits intended to be useful for general curves (not just Béziers), but these will probably be reorganized.
Here we mention a few other curves libraries and touch on some of the decisions made differently here.
lyon_geom has a lot of very good vector algorithms. It's most focused on rendering.
flo_curves has good Bézier primitives, and seems tuned for animation. It's generic on the coordinate type, while we use
vek has both 2D and 3D Béziers among other things, and is tuned for game engines.
Some code has been copied from lyon_geom with adaptation, thus the author of lyon_geom, Nicolas Silva, is credited in the AUTHORS file.
To learn more about Bézier curves, A Primer on Bézier Curves by Pomax is indispensable.