#vector-graphics #builder #point #lyon #2d-graphics #iterator #path

no-std lyon_path

Types and utilities to store, build and iterate over 2D paths

38 releases (5 stable)

1.0.4 Jul 15, 2023
1.0.3 Dec 7, 2022
1.0.2 Nov 6, 2022
1.0.0 Jul 11, 2022
0.3.2 Sep 22, 2016

#19 in Images

Download history 17734/week @ 2023-11-20 17263/week @ 2023-11-27 18428/week @ 2023-12-04 19898/week @ 2023-12-11 15636/week @ 2023-12-18 8304/week @ 2023-12-25 14105/week @ 2024-01-01 17636/week @ 2024-01-08 20466/week @ 2024-01-15 19653/week @ 2024-01-22 18603/week @ 2024-01-29 22257/week @ 2024-02-05 19195/week @ 2024-02-12 23082/week @ 2024-02-19 19858/week @ 2024-02-26 17369/week @ 2024-03-04

81,448 downloads per month
Used in 299 crates (32 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
~28K SLoC