linebender / linebender/vello

Further numerical robustness issue in path rendering

Open
#775 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
4.3k
Forks
300
Avg merge
2d 13h
Merged PRs (30d)
61

Description

Hello, I've quietly followed this project for quite some time, and thank you for this great work!

I am aware the path rendering algorithm is numerically tricky, and many numeric issues have already been resolved in the past. But unfortunately I still run into one issue here. The following incorrectly rendered image is produced by latest vello on the main branch (8a84a4abf7aaabdb7de82e3d9d86ed427ad21638); the correct image should be a white filled square.

![20241223-234728](https://github.com/user-attachments/assets/709b7503-6093-4c04-b535-05003db9d30d)

To reproduce, replace the function `add_shapes_to_scene` in `examples/simple/src/main.rs` with the following code:

```
fn add_shapes_to_scene(scene: &mut Scene) {
use vello::kurbo::PathEl::*;

let path = [
MoveTo((0.0, 0.0).into()),
LineTo((1000., 0.).into()),
LineTo((1000., 1000.).into()),
LineTo((0., 1000.).into()),
LineTo((-1.87016292e-06, 923.848633).into()),
LineTo((1.87016292e-06, 156.151367).into()),
ClosePath,
];

scene.fill(
vello::peniko::Fill::NonZero,
Affine::IDENTITY,
Color::new([1.,1.,1.,1.]),
None,
&path,
);
}
```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by replacing add_shapes_to_scene in examples/simple/src/main.rs with the supplied path and run the simple example to reproduce the incorrect rendering. Trace the numerical path-rendering behavior responsible for the result; done means this path renders as the expected white filled square.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.