-
Notifications
You must be signed in to change notification settings - Fork 90
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
Support different fill rules (even/odd supported, add positive-only, etc) #10
Comments
Hmm, I don't know. Assuming you read my tutorial on the algorithm (here), I think changing the fill rules should only change the fill annotation logic. Then the rest of the algorithm should work fine -- all line intersection, segment selection, and segment chaining would probably work unmodified. The non-zero fill rule is harder because it uses winding of the input... that would mean you'd have to add some extra data to the segments for which direction they were facing (?). The current algorithm throws away winding information almost immediately. That's why the GeoJSON code has to reconstruct the winding. Writing the current fill annotation logic took me a while to get right -- it was hard for me to reason through how toggling segments worked, etc. I think introducing winding would make that even harder to reason about. I do suspect it's possible though, and maybe there is a clever insight that I'm missing to make it easy..? Sorry I can't be of more help. |
Thanks for the info! I will take a deeper look into it in the coming days. |
Some requirements changed and it looks like support for |
Currently, the library is specifically coded to work with even/odd fill rule. It would be nice if there was an option for other fill rules.
The text was updated successfully, but these errors were encountered: