-
Notifications
You must be signed in to change notification settings - Fork 62
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
Winding number fill rule with multiple colors #207
Comments
You could probably hack something like this into the rasterific backend On Fri, Aug 8, 2014 at 6:23 AM, Pontus Granström notifications@github.com
|
Hmm, I'm not so sure about how easy this would be in rasterific. |
I think most of the things needed would be confined to this file: The On Fri, Aug 8, 2014 at 10:36 AM, Jeffrey Rosenbluth <
|
I "just want to color something that happens to have overlaps in interesting ways" :) Maybe the best thing is to instead write a function that splits a path into regions with associated winding numbers? It's not really a generally useful thing, so it's probably not worth integrating into |
Splitting a path into its loops is a very useful thing that we would like On Fri, Aug 8, 2014 at 12:50 PM, Pontus Granström notifications@github.com
|
I have a feeling we'd need some way of finding intersections for that, and IIRC, there's no such thing in Diagrams. Should I create a new issue? |
We have path intersection testing now. See #226 . And since the intersection code gives you path parameters, not just locations, it should be possible to use it to split a path into loops. Though come to think of it I am not sure if it directly supports finding self-intersections of a path. If not I imagine that would not be hard to add. |
Hmm, looks like I was wrong, the high-level intersection-finding API gives you no way to get the path parameters of intersections (though the low-level API for intersecting two segments does). It also looks like there is no way currently to find self-intersection points of a single trail. It should certainly be possible to have these features, but they will require some nontrivial design & coding. |
I could add a windingrule to my boolean intersection code in cubicbezier to keep only a specific winding number. You could then call the overlap removal several times with different winding numbers, and color each one appropriately. |
I'd like a fill rule that fills each region with a different color depending on the winding number. The current
fillRule Winding
is binary: either the winding number is zero and it doesn't fill the region, or it's non-zero and it does. I want something likewhich would cycle the colors like this
(with winding number zero having no color).
I realise this might be a tall order, since it's not a standard graphics setting (there is no such thing in the SVG spec, for example). I'm posting it here anyway, since I think the idea is neat. :)
The text was updated successfully, but these errors were encountered: