A Rust library for manipulating curves
Clone or download
raphlinus Bump version to 0.2.0 for release
This version breaks semver. It's an interim release, there are several
open issues that will result in more semver breakage, but there are
features needed in here to move piet forward.
Latest commit 7f9b90c Jan 11, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
benches More experiments with error metrics Dec 29, 2018
examples Add Travis CI Jan 2, 2019
src Merge pull request #8 from linebender/shape_ownership Jan 11, 2019
.gitignore Start curves crate Dec 26, 2018
.travis.yml Add Travis CI Jan 2, 2019
Cargo.toml Bump version to 0.2.0 for release Jan 11, 2019
LICENSE-APACHE Start curves crate Dec 26, 2018
LICENSE-MIT Start curves crate Dec 26, 2018
README.md Add Travis badge Jan 2, 2019

README.md

kurbo, a Rust 2D curves library

Build Status Docs Crates.io

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.

Similar crates

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 f64 for everything.

  • vek has both 2D and 3D Béziers among other things, and is tuned for game engines.

More info

To learn more about Bézier curves, A Primer on Bézier Curves by Pomax is indispensable.

Contributing

Contributions are welcome. The Rust Code of Conduct applies.