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

Feature request: an "overlapRemoved" state or "wouldRemoveOverlap" check #55

Open
skef opened this issue Apr 6, 2022 · 3 comments
Open

Comments

@skef
Copy link

skef commented Apr 6, 2022

pathops seems to be both much faster and more accurate than booleanOperations and seems far preferable for instancing a glyph. However, there are other cases where one wants to remove overlap from a glyph for purposes of analysis rather than final product, and one may only want to do so when there is overlap to be removed. For that, one would either want a state passed back with the output or -- given how fast the library is -- a method that can be called first to ask whether overlap will be removed.

(Simple analysis of the result doesn't answer the question because of the other changes -- combined lines, added inflection points, and so on.)

I haven't entirely convinced myself but I suspect this question is close enough to the question "Are there any inter-segment intersections?" that the latter could serve for the former. If that's accurate then maybe one could replicate the non-debugging portions of SkPathOpsSimplify.cpp:SimplifyDebug() up to before HandleCoincidence() and query the coincidence object.

I don't really expect the maintainers to do this work themselves -- I'm filing to track a desirable thing that I may try to implement in the future.

@anthrotype
Copy link
Member

thanks, that would be desirable indeed. I'm thinking this could be useful for google/fonts#4405

@skef
Copy link
Author

skef commented Apr 7, 2022

Thinking about this, I suppose what just testing for intersections would miss is a contour with the same direction entirely within another contour. There might be corner cases in VF instances where such a thing could happen in a production font. However, maybe its a small enough concern to be ignored.

@behdad
Copy link
Member

behdad commented Apr 29, 2024

Thinking about this, I suppose what just testing for intersections would miss is a contour with the same direction entirely within another contour. There might be corner cases in VF instances where such a thing could happen in a production font. However, maybe its a small enough concern to be ignored.

Yeah but I don't think those cases are problematic. So, fine with me.

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

3 participants