Alternative fill tessellation implementation using libtess2.
Lyon libtess2 wrapper
This crate provides an alternative path fill tessellator implemented as a wrapper of the libtess2 C library.
The goal of this crate is to provide an alternative tessellator for the potential cases where lyon_tessellation::FillTessellator is lacking in features or robustness, and have something to compare the latter against.
Comparison with lyon_tessellation::FillTessellator
Advantages:
- Supports the
NonZerofill rule. - More robust against precision errors when paths have many self intersections very close to each other.
Disadvantages:
- About twice slower than lyon_tessellation's fill tessellator.
- Does not support computing vertex normals.
- Wrapper around a C library (as opposed to pure rust with no unsafe code).
API
In order to avoid any overhead, this crate introduces the
FlattenedPath type which stores already-flattened paths
in the memory layout expected by libtess2.
Instead of working with a GeometryBuilder like the tessellators
in lyon_tessellation, this tessellator uses a GeometryReceiver
trait that corresponds to the way libtess2 exposes its output.
Example
extern crate lyon_tess2 as tess2;
use ;
use ;
use Path;
use *;
use *;