Lyon
GPU-based 2D graphics rendering in rust.
Motivation
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.
Example
// Build a Path.
let mut builder = new;
builder.move_to;
builder.line_to;
builder.quadratic_bezier_to;
builder.cubic_bezier_to;
builder.close;
let path = builder.build;
// Will contain the result of the tessellation.
let mut geometry_cpu: = new;
let mut tessellator = new;
// The tessellated geometry is ready to be uploaded to the GPU.
println!;
Structure
The project is split into small crates:
- lyon_tessellation - Path tessellation routines.
- lyon_path_builder - Tools to facilitate building paths.
- lyon_path_iterator - Tools to facilitate iteratring over paths.
- lyon_path - A simple optional path data structure, provided for convenience.
- lyon_bezier - Cubic and quadratic 2d bezier math.
- lyon_bezier - Create paths using SVG's path syntax.
- lyon_extra - Additional testing and debugging tools.
- lyon_core - Common types to most lyon crates.
There is also a toy command-line tool to tessellate SVG path from your favorite terminal.
Have a look at the basic and advanced gfx-rs examples to see how integrating the tessellators in a renderer can look like.
TODO
There's a rough list of things to do on the wiki as well as the github issues, some of which are tagged as easy. If you are interested in contributing, don't hesitate to comment on the gihub issues or contact me. Need help ? File an issue or contact me on twitter (@nicalsilva) or by e-mail.
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
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.