#bezier #curve #geometry #2d #graphics


Computational geometry algorithms for Bézier segments and shapes useful in the context of 2D graphics

1 unstable release

0.1.0 Dec 18, 2022

#633 in Math

Download history 14/week @ 2022-12-12 15/week @ 2022-12-19 1/week @ 2022-12-26 1/week @ 2023-01-02 106/week @ 2023-01-09 17/week @ 2023-01-16 9/week @ 2023-01-23 13/week @ 2023-01-30 244/week @ 2023-02-06 78/week @ 2023-02-13 170/week @ 2023-02-20 54/week @ 2023-02-27 39/week @ 2023-03-13

267 downloads per month


2.5K SLoC


Computational geometry algorithms for Bézier segments and shapes useful in the context of 2D graphics.

Play with the interactive documentation which visualizes each API function in a fun manner.

Bezier-rs is built for the needs of Graphite, an open source 2D vector graphics editor. We hope it may be useful to others, but presently Graphite is its primary user. Pull requests are welcomed for new features, code cleanup, ergonomics enhancements, performance improvements, and documentation clarifications.

The library currently provides functions dealing with single Bézier curve segments, as well as open-or-closed multi-segment paths (which we call subpaths). In the future, the library will be expanded to include compound paths (multiple subpaths forming a single shape, where the winding order determines inside-or-outside-ness) and operations between paths (e.g. boolean functions).

Bezier-rs is inspired by Bezier.js and A Primer on Bézier Curves by Pomax. Bezier-rs is not a port of Bezier.js so the API for single-segment Bézier curves has some differences, and the intention is to offer a broader scope that provides algorithms beyond single curve segments (as noted above) to eventually service full vector shapes.


Graphite and Bezier-rs use the following terminology for vector data. These depictions are given for cubic Bézier curves.

Handle and Anchor Manipulator Manipulator Group

Curve Segment Bezier Segment

Subpath Compound Path Open and Closed


~81K SLoC