GithubHelp home page GithubHelp logo

Comments (10)

dylanede avatar dylanede commented on September 22, 2024

I've also bumped into this. Given this SVG (uploaded as a zip since GitHub refuses to attach SVGs):

test_svg.zip

the following output is observed (ignore the clipped bottom of the frame):

image

The correct output should look like this (ignoring discrepancies in line joins, which pathfinder doesn't implement yet):

image

This SVG includes both closed and open paths. Observed issues:

  • Closed paths are not actually getting the last edge added to close them
  • Sometimes the right-most pair of edges in a path get badly triangulated. This doesn't seem to be affected by whether the path is created in a clockwise or anti-clockwise fashion.
  • The top-left path isn't being rendered.
  • All paths are exactly twice as thick as expected.

I have seen similar issues when using Pathfinder in an OpenGL ES renderer I'm working on, with much more complex graphics. The above SVG renders with identical problems in my renderer as well.

@pcwalton What are your thoughts?

from pathfinder.

pcwalton avatar pcwalton commented on September 22, 2024

Interesting, thanks for the report! I'll take a look.

from pathfinder.

pcwalton avatar pcwalton commented on September 22, 2024

I believe this is all fixed. Thanks for the bug report!

from pathfinder.

dylanede avatar dylanede commented on September 22, 2024

I've checked out the latest commit, and although most of the problems are fixed, the top left spiral shape is still not showing up. Also, the closed black pentagon does not appear to be joining the starting edge with the last edge. This is what I see:

image

from pathfinder.

dylanede avatar dylanede commented on September 22, 2024

On further inspection, it appears that the spiral shape only shows up when using XCAA. Under other modes it doesn't appear.

from pathfinder.

dylanede avatar dylanede commented on September 22, 2024

It appears that some new problems have appeared as a result of these fixes.

Before the fixes, this svg (a stroked and filled path generated from some text in Inkscape) looked like this (using XCAA):

image

Now it looks like this:

image

and with no anti-aliasing, it looks like this:

image

For reference, all browsers I tried it on rendered it natively like this:

image

from pathfinder.

pcwalton avatar pcwalton commented on September 22, 2024

@dylanede Did you rebuild the demo with npm run build? It was a client-side fix, not a server-side one. The top left path shows up locally for me under all AA modes.

from pathfinder.

dylanede avatar dylanede commented on September 22, 2024

Ah, it's possible that I didn't. That could explain it. When I'm back at that machine I'll check.

However with the other problem (the strokes in the "Testing" image) I have seen similar behaviour in my own renderer after updating the dependency on pathfinder, so it's not affected by changes in the client.

from pathfinder.

zimond avatar zimond commented on September 22, 2024

Seems when using the new stroke logic, every EndPoint.subpath_index is 0 no matter how many subpaths are there in the PathBuffer. Is this a bug?

from pathfinder.

zimond avatar zimond commented on September 22, 2024

Oops, it seems that I need to consume the stream once again in a new PathBuffer to make the numbers correct. Ignore my last report please

from pathfinder.

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.