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

How to ignore fill rule to fill entire path #2080

Open
marcopaivaf opened this issue Jun 14, 2024 · 0 comments
Open

How to ignore fill rule to fill entire path #2080

marcopaivaf opened this issue Jun 14, 2024 · 0 comments

Comments

@marcopaivaf
Copy link

Description/Steps to reproduce

Hey guys, sorry if this is not the right place this question. I was wondering if someone with more PaperJS experience could help me with this. I'm trying to fill the an entire Path, including its holes and negative spaces.
I understand that I can call resolveCrossings to break the path at all self-intersections, but that doesn't seem to account for negative spaces between self-intersections.

For example, the below pathData produces this path:

var path = new Path("M284.16424,537l251.83576,-251.83576l251.83576,251.83576l-503.67153,-251.83576l251.83576,251.83576l251.83576,-251.83576z");

After calling resolveCrossings the resulted CompoundPath have 6 paths (one of each filled section).

Screenshot 2024-06-14 at 12 58 53

But what I'm looking to achieve is fill every everything, including those two negative spaces, resulting in something like this:

Screenshot 2024-06-14 at 12 57 27

Link to reproduction test-case

http://sketch.paperjs.org/#V/0.12.17/S/hVDLbsIwEPyVlS9QKTHNwwkCceJcqWqPuAeTLsSKWSOvS9VW/XecIrUckHqbHc3OzuyXIHNAsRDPA8auF5no/Os4n0yAo4k9rIDwHR4TnGrxUM5rWTR1WWeqal2pCjmvVNtk+S+8Iv+4XN1XsmkLVf2nvGX5qcXdUpOm2QyekL07IRj6AEa3yy1FDIxdtJ4YLEHs8Se5prFDQH5zMbUYKRku2+vgmS3teTr6XiRyZ51be+dDEk+2znTDJL1jG9AMR5+usFhsXr7P

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