Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Further numerical robustness issue in path rendering #775

Open
ChengCat opened this issue Dec 23, 2024 · 0 comments
Open

Further numerical robustness issue in path rendering #775

ChengCat opened this issue Dec 23, 2024 · 0 comments

Comments

@ChengCat
Copy link

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 (8a84a4a); the correct image should be a white filled square.

20241223-234728

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,
    );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant