#vector-graphics #vector #geometry #graphics

bezier-nd

Bezier curve implementations using N-dimensional vectors

6 releases

0.5.0 Feb 19, 2023
0.1.4 Jun 23, 2021

#119 in Rendering

Download history 296/week @ 2024-07-21 35/week @ 2024-07-28 1755/week @ 2024-08-04 376/week @ 2024-08-11 29/week @ 2024-08-18 153/week @ 2024-08-25 161/week @ 2024-09-01 108/week @ 2024-09-08 47/week @ 2024-09-15 656/week @ 2024-09-22 40/week @ 2024-09-29 988/week @ 2024-10-06 181/week @ 2024-10-13 89/week @ 2024-10-20 118/week @ 2024-10-27 361/week @ 2024-11-03

752 downloads per month
Used in 2 crates

MIT/Apache

46KB
473 lines

bezier-nd

A Bezier curve class supporting linear, quadratic and cubic Bezier curves, using an arbitrary point class.

Example uses would be for 2-dimensional Bezier curves whose coordinates are [f64; 2], or for 3-dimensional Bezier curves using coordinates of [f32; 3].

The Bezier curve supports bisection, and then splitting into straight lines within a given straightness bound; iterators are provided to automatically trace a Bezier as lines or points within such a straightness, for rendering puroses.

The Bezier type also supports rounding of corners and circular arc generation, utilizing a very accurate function for any angle of rounding up to 180 degrees, derived from a curve-fit from experimental data, rather than an explicit mathematical function for the control point generation (the standard analytical approach).

This crate is in beta; it is used in a small number of applications, and the functionality is mature; the API is stable, but may be enhanced.

Usage

Add this to your Cargo.toml:

[dependencies]
bezier-nd = "0.5"

Releases

Release notes are available in RELEASES.md.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~0.6–1.2MB
~27K SLoC