-
Notifications
You must be signed in to change notification settings - Fork 26
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
Impossible to make closed PathComponent #97
Comments
This is listing of
Strange. |
@typoland If I'm understanding your data correctly it looks like your issue may be with minuscule differences in the y coordinate of the ending point of your first curve and starting point of your second. They need to be exactly equal, which I'd recommend forcing one way or the other or taking an average.
versus
|
Oh! In the world of CGFloats it could be difficult sometimes ;) . This time I assigned values from previous curve to the next and result is the same:
This listings made by:
|
I suspect those lines in
|
(Sorry for spamming here, I have to learn how to use this "issues". And markdown). |
it's definitely coming from this assert ... but strange you would hit this even when forcing the start and end points to be equal (I can't see how this would logically happen). Can you reproduce the issue with a code snippet I could run? |
I will. Give me some time. (I'm curious, maybe it's on my side somehow) |
OK. I rounded x and y of all points to third place after comma - no issue anymore. BTW: Is it possible to automatically reverse inner PathComponent to maka a hole somehow? |
One way you can accomplish this is not by modifying the path, but when you go to render the path you can use the But if you must modify the path itself so that it works with the |
Super! I will try, thank you! BTW: good job! |
After almost a year I still don't know how to close a path. This is a small app showing a problem: https://github.com/typoland/HowToCloseCurveInBezierKit |
edit: this comment was wrong. I should have run the actual app |
But
Should be OK, but it isn't :( |
this looks like it should work, what goes wrong in this case? |
Paths are not closed. First point is not connected with a last one. It’s why I made this small app. I must close those shapes and I don’t know how. |
I see what's going on now. I was wrong in my initial assessment of what was going on in your app. Here is a workaround for you.
What's going on is that CoreGraphics did not consider the paths closed for the purpose of stroking because they didn't have a |
Thank you! Seems to work now. :) |
Basically the workaround I gave you checks if BezierKit considers the path closed, and if so adds the missing At some point I'll fix the issue so that the workaround won't be needed. |
Great! |
Hi, maybe this is not a issue, but I don't know make closed
PathComponent
. I havevar curves : [CubicCurve]
array wherelast.endingPoint == first.startPoint
. I expect to get closedPathComponent
, formPathComponent(curves: curves)
but I receive"curves are not contiguous."
error.The text was updated successfully, but these errors were encountered: