Code Monkey home page Code Monkey logo

Comments (4)

raphlinus avatar raphlinus commented on August 31, 2024 1

I have a tentative analysis and proposed fix for this particular case. Basically the tangent computed for the start cap is not bit-identical to the tangent for the parallel curves (even though mathematically it's the same). Change line 847 of flatten.rs from:

                    let tangent = cubic_start_tangent(pts.p0, pts.p1, pts.p2, pts.p3);

to

                    let tangent = pts.p3 - pts.p0;

I'm not sure this fixes everything (still investigating), but did want to send an update.

from vello.

raphlinus avatar raphlinus commented on August 31, 2024

It's very likely this is another manifestation of #644 (edit: I meant #616), which I believe is a watertightness issue in the expanded stroke outlines. It's in my queue to look at.

from vello.

raphlinus avatar raphlinus commented on August 31, 2024

I'm not able to repro directly (or #616 either) from the given example, but I do see an artifact with the following:

        let mut p: BezPath = BezPath::default();
        p.move_to((399.997, 400.0002));
        p.quad_to((399.998, 400.0002), (400., 400.));
        p.line_to((390., 390.));
        let a = Affine::translate((31.90625, 23.98875));
        scene.stroke(
            &Stroke::new(2.0).with_caps(Cap::Butt),
            a,
            Color::WHITE,
            None,
            &p,
        );

It definitely appears to be a watertightness bug, and I suspect it's the same underlying issue. I should be able to track it down now that I've got a repro.

Curious why the variation in reproducibility, but we'll most likely get to that when we have a proposed fix.

from vello.

DJMcNab avatar DJMcNab commented on August 31, 2024

I suspect the difference could be a fast-math issue.

That's my general heuristic to explain if something is different on Mac :P

from vello.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.