kurbo 0.13.1's stroker can give a cubic that is nearly a line (all control points within a rounding error of its chord) a NaN join, and vello_common's `flatten::fill` drops any path containing NaN, so the whole outline vanished. An Illustrator outline ending in `73.763 -0.536 l 73.764 -0.536 73.764 -0.536 73.764 -0.536 c` did (#4907). kurbo tracks the bug class in linebender/kurbo#617 and #519; #610 is unreleased. Vendored vello_common patch (2): when the expanded stroke is not finite, `flatten::stroke` strokes the path again with every quadratic or cubic whose control points lie within the tolerance of its chord replaced by a line, one element out per element in. A finite outline is unchanged, and a path with non-finite input is still dropped. `stroke` and `StripGenerator::generate_stroked_path` take a `Clone` path; vello_cpu's callers pass `&BezPath` and a copied slice iterator. Tests: `flatten::tests::a_tiny_degenerate_cubic_does_not_drop_the_stroke` and the render crate's `stroke_degenerate_cubic` pixel test fail with the fallback disabled; `a_finite_outline_is_stroked_as_before` and `a_path_with_nan_is_still_dropped` are guards. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SqmHYx8FiWM5PcsoiErgp9
This crate includes common geometry representations, tiling logic, and other fundamental components used by both Vello CPU and Vello Hybrid.
Usage
This crate should not be used on its own, and you should instead use one of the renderers which use it. At the moment, only Vello CPU is published, and you probably want to use that.
We also develop Vello, which makes use of the GPU for 2D rendering and has higher performance than Vello CPU. Vello CPU is being developed as part of work to address shortcomings in Vello. Vello does not use this crate.
Features
std(enabled by default): Get floating point functions from the standard library (likely using your target's libc).libm: Use floating point implementations from libm.png(enabled by default): Allow loadingPixmaps from PNG images. Also required for rendering glyphs with an embedded PNG. Impliesstd.
At least one of std and libm is required; std overrides libm.
Contents
- Shared data structures for paths, tiles, and strips
- Geometry processing utilities
- Common logic for rendering stages
This crate acts as a foundation for vello_cpu and vello_hybrid, providing essential components to minimize duplication.
Minimum supported Rust Version (MSRV)
This version of Vello Common has been verified to compile with Rust 1.92 and later.
Future versions of Vello Common might increase the Rust version requirement. It will not be treated as a breaking change and as such can even happen with small patch releases.
Click here if compiling fails.
As time has passed, some of Vello Common's dependencies could have released versions with a higher Rust requirement. If you encounter a compilation issue due to a dependency and don't want to upgrade your Rust toolchain, then you could downgrade the dependency.
# Use the problematic dependency's name and version
cargo update -p package_name --precise 0.1.1
Community
Discussion of Vello Common development happens in the Linebender Zulip, specifically the #vello channel. All public content can be read without logging in.
Contributions are welcome by pull request. The Rust code of conduct applies.
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.