40 releases (7 stable)

1.0.6 Oct 23, 2024
1.0.5 May 15, 2024
1.0.4 Jul 15, 2023
1.0.3 Dec 7, 2022
0.3.2 Sep 22, 2016

#481 in Graphics APIs

Download history 25581/week @ 2024-08-03 32433/week @ 2024-08-10 25739/week @ 2024-08-17 25969/week @ 2024-08-24 29393/week @ 2024-08-31 27591/week @ 2024-09-07 27525/week @ 2024-09-14 30573/week @ 2024-09-21 31538/week @ 2024-09-28 28460/week @ 2024-10-05 31994/week @ 2024-10-12 34154/week @ 2024-10-19 35102/week @ 2024-10-26 39675/week @ 2024-11-02 23894/week @ 2024-11-09 21261/week @ 2024-11-16

126,225 downloads per month
Used in 341 crates (31 directly)

MIT/Apache

485KB
12K SLoC

lyon::path

Path data structures and tools for vector graphics.

crates.io documentation

lyon_path can be used as a standalone crate or as part of lyon via the lyon::path module.


lib.rs:

Data structures and traits to work with paths (vector graphics).

To build and consume paths, see the builder and iterator modules.

This crate is reexported in lyon.

Examples

use lyon_path::Path;
use lyon_path::math::{point};
use lyon_path::builder::*;

// Create a builder object to build the path.
let mut builder = Path::builder();

// Build a simple path.
let mut builder = Path::builder();
builder.begin(point(0.0, 0.0));
builder.line_to(point(1.0, 2.0));
builder.line_to(point(2.0, 0.0));
builder.line_to(point(1.0, 1.0));
builder.close();

// Generate the actual path object.
let path = builder.build();

for event in &path {
    println!("{:?}", event);
}

lyon_path traits reexported here for convenience. f32 version of the lyon_geom types used everywhere. Most other lyon crates reexport them.

Dependencies

~1.5MB
~27K SLoC