Crates.io | bezier-rs |
lib.rs | bezier-rs |
version | 0.5.0 |
created_at | 2022-12-18 06:18:31.640785+00 |
updated_at | 2025-08-15 23:11:52.895264+00 |
description | Computational geometry algorithms for Bézier segments and shapes useful in the context of 2D graphics |
homepage | https://github.com/Keavon/Bezier-rs |
repository | https://github.com/Keavon/Bezier-rs |
max_upload_size | |
id | 740260 |
size | 763,264 |
repo • crates.io • docs.rs • interactive docs
Computational geometry algorithms for Bézier segments and paths useful in the context of 2D graphics.
Play with the interactive documentation which visualizes each API function in a fun, graphical manner:
Bezier-rs was built for the needs of Graphite, an open source 2D graphics editor. The library is now deprecated and has been archived in this repository by extracting its development history from Graphite's monorepo, with some cleanup in support of its standalone archival.
Graphite has moved to Kurbo as of 2025, which offers superior performance and correctness compared to the naïve and unoptimized algorithms implemented here. However, some algorithms offered by Bezier-rs are not yet available in Kurbo. Note also that Bezier-rs is anchor-centric while Kurbo (like SVG) is segment-centric, meaning paths in Bezier-rs are defined by their anchor points and incoming/outgoing handles, while Kurbo paths are defined by segment commands like move-to, line-to, quadratic-to, and cubic-to.
No further development will continue and 0.5 is the last major version. Interested contributors are encouraged to submit missing algorithms to Kurbo instead.
Bezier-rs is inspired by Bezier.js and A Primer on Bézier Curves by Pomax. It is not a port, so its API differs and additionally covers paths, not only single Bézier segments. View the interactive documentation or the docs.rs documentation for more feature details.
Bezier-rs uses the following terminology for vector data. These depictions are given for cubic Bézier curves.