lyon 0.4.1

2D Graphics rendering on the GPU using tessellation.


GPU-based 2D graphics rendering in rust.


For now the goal is to provide efficient SVG-compliant path tessellation tools to help with rendering vector graphics on the GPU. For now think of this library as a way to turn complex paths into triangles for use in your own rendering engine.

The intent is for this library to be useful in projects like Servo and games.


    // Build a Path.
    let mut builder = SvgPathBuilder::new(Path::builder());
    builder.move_to(point(0.0, 0.0));
    builder.line_to(point(1.0, 0.0));
    builder.quadratic_bezier_to(point(2.0, 0.0), point(2.0, 1.0));
    builder.cubic_bezier_to(point(1.0, 1.0), point(0.0, 1.0), point(0.0, 0.0));
    let path =;

    // Will contain the result of the tessellation.
    let mut geometry_cpu: VertexBuffers<Vec2> = VertexBuffers::new();

    let mut tessellator = FillTessellator::new();

        // The simple builder uses the tessellator's vertex type.
        // You can implement the GeometryBuilder trait to create custom vertices.
        let mut vertex_builder = simple_builder(&mut geometry_cpu);

        // Compute the tessellation.
            &mut vertex_builder

    // The tessellated geometry is ready to be uploaded to the GPU.
    println!(" -- {} vertices {} indices",


The project is split into small crates:

There is also a toy command-line tool to tessellate SVG path from your favorite terminal.

Have a look at the gfx-rs example to see how integrating the tessellators in a renderer can look like.


There's a rough list of things to do in the wiki. If you are interested in contributing, please let me know on twitter (@nicalsilva) or by e-mail.


Licensed under either of

at your option.


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.