-
-
Notifications
You must be signed in to change notification settings - Fork 235
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
Rotational extents would be incredibly handy #156
Comments
it might be, but I must confess I'm not entirely sure what you're asking for. Can you elaborate on what you mean with "what the extents are of a bezier curve relative to a point"? (concrete use cases would probably go a long way towards helping me understand) |
Hi, thanks for getting back to me. No problem, I'm attaching an image. If your origin is at point A, and you're trying to determine the angular extents of the three (very rough) beziers, so as to know what can be shown further from the origin in the background, the only way I can work out to do it is to widen the boundaries until I get only one intersect, or to rotate the bezier and use the inflection points at the angle of the border. Either way is iterative. I suspect that there is a better way, but, the maths of it escapes me. Case 1 is easy, it's just the endpoints, but case 2 and case 3 are a lot less simple. |
Hi, Yep, that was one of the options I'd considered. But it's still iterative, as if the extrema doesn't match exactly with the angle, all you can do is rotate and solve again. Just to note: I'm not looking for help, I've solved it by moving the boundary lines until they get only one intersect (or two very close ones, depending on granularity), and the code works. I'm just trying to help with a suggestion for the library. |
Sure, but that includes ideating on how to do this, and capturing that ideation in the issue because if there's an easy way to do it: cool, but if not (and I'm leaning towards not), this might just be too niche to add to the library itself. What's the use-case here? (as in, what actual thing are you doing where this need pops up) |
The use case is simply line of sight in a game system. With an environment which includes objects built with bezier curves, it's to know what needs to be clipped from drawing, what parts of a landscape can be tagged as "known" about. The quickest solution, after trying the angle and the line iteration, seems to be iterating the angle of the border lines until you reach an acceptable level of error. |
Hopefully this is the correct method to suggest enhancements.
It would be incredibly handy to be able to say what the extents are of a bezier curve relative to a point.
The use case here is a line of sight system, where knowing the exact boundaries of a curve relative to a point is essential to knowing what to draw. I suspect that many people could find this useful.
Currently, I'm using multiple functions of the existing API, but that is going to be more expensive than doing it properly, as the existing API uses some iterative steps to get fine results when it only needs to know very coarse results for its own iterations.
I looked at doing it properly myself, but the maths is beyond me unfortunately.
Whether or not you feel this is a worthwhile addition to the api, I'll say thanks for what you've already produced, it's a great tool.
The text was updated successfully, but these errors were encountered: