-
Notifications
You must be signed in to change notification settings - Fork 1
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
Path structure #1
Comments
|
Added the "core" builds here. |
Thanks a lot! I already started to use your library at www.photopea.com ! As you know a lot about bézier curves and you have quad trees for acceleration, could you implement hitTesting?
It would find a point on a path that is closest to [pX,pY]. You can return the index of a path segment, where it is located, a location T:[0..1] of that point on that segment, and the actual absolute coordinate of that point. It can also test whether a point is inside or outside a path, but I think it can be done already by intersecting a path with a tiny square. But if you can add it easily, it would be nice, too. |
If you think hitTest() does not fit this library, I will jsut turn my curves into a polygon with 1 pixel edges and will find the closest vertex, I think it should work fine for my case. |
I think it's not entirely out of the scope of this project. Let me see if I can implement it during the next weekend 🙂. |
Your path representation seems a bit too complicated. Could you maybe switch to something like this: https://github.com/photopea/Typr.js?tab=readme-ov-file#typrushapetopathfont-shape . It has two arrays: array of strings and array of numbers, while you have an array for each coordinate.
BTW. it seems like your library contains an SVG path parser. Your library could be smaller without it, I already have it on my side.
Does your library relly work with Lines and Arcs? I would expect that you convert everything to cubic bézier splines to simplify your algorithms.
The text was updated successfully, but these errors were encountered: