Graphite/libraries/bezier-rs
Dennis Kobert 0dfddd529b
Refactor document node type lookup function to fix performance degradation over time (#1878)
* Refactor document_node_types function

* Fix node introspection

* Implement diff based type updates

* Fix missing monitor nodes

* Improve docs and fix warings

* Fix wrongful removal of node paths

* Remove code examples for non pub methodsü

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-08-08 17:37:28 -07:00
..
src Refactor document node type lookup function to fix performance degradation over time (#1878) 2024-08-08 17:37:28 -07:00
Cargo.toml Update dependencies and lock files (#1841) 2024-07-22 02:56:29 -07:00
LICENSE-APACHE Move bezier-rs into libraries folder and deploy its interactive docs 2022-08-14 16:17:27 -07:00
LICENSE-MIT Move bezier-rs into libraries folder and deploy its interactive docs 2022-08-14 16:17:27 -07:00
README.md Bezier-rs: Release version 0.2 2023-03-28 12:37:52 -07:00

crates.iodocs.rsrepo

Bezier-rs

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:

View the interactive API


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, ergonomic enhancements, performance improvements, and documentation clarifications.

The library currently provides functions dealing with single Bézier curve segments and 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 operations, convex hull). Pull requests for these additional features would be highly desirable.

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.

Terminology

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

Manipulators Curve/Bezier Segment Subpath/Path Open/Closed