41 releases (8 stable)

1.0.7 Feb 27, 2025
1.0.6 Oct 23, 2024
1.0.5 May 15, 2024
1.0.4 Jul 15, 2023
0.3.2 Sep 22, 2016

#209 in Graphics APIs

Download history 26315/week @ 2024-11-20 26406/week @ 2024-11-27 25310/week @ 2024-12-04 26358/week @ 2024-12-11 20298/week @ 2024-12-18 11177/week @ 2024-12-25 16182/week @ 2025-01-01 24796/week @ 2025-01-08 27562/week @ 2025-01-15 21437/week @ 2025-01-22 26321/week @ 2025-01-29 34284/week @ 2025-02-05 28759/week @ 2025-02-12 28013/week @ 2025-02-19 31265/week @ 2025-02-26 27812/week @ 2025-03-05

120,248 downloads per month
Used in 354 crates (33 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