-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Update PolyPartition / Triangulator library #45125
Conversation
Why? We shouldn't modify thirdparty code if we don't have to, and that's a very intrusive change to thirdparty code, making it difficult to do any future update. |
@akien-mga Well, because the existing version in Godot was using Godot's types, so I kept that part the same. It should be easy to change it back to using the standard library by just copying the upstream version again, though in the case of |
I see. Then I guess it's fine for this PR, but yeah I think a follow-up could try to undo all these Godot-specific changes and use the unmodified thirdparty code. If we need to write a Could you update |
Could you also add a |
I will do that, keeping a I looked into what it would take to keep |
In Goost, I've exposed quite a bunch of hidden PolyPartition functionality, and discovered that there's actually a hidden bug in This is also something which #16423 proposed to enable over ear-clipping which is currently the default (would mostly avoid "Bad Polygon!" errors while drawing polygons). So, I'm just saying that I'd be careful modifying thirdparty code, and yeah I'd certainly prefer to undo those Godot-specific changes because there's a high chance of breaking things that way, especially when the library is updated.
That's how Clipper library is currently used in Godot for polygon boolean methods (mainly due to the way how points needs to be scaled up and down to achieve robust computations), and it's quite fast even with conversion going on. This is something which can be done via dedicated PR though. |
@Xrayez If you would like to add onto this PR, that would be nice too. It would result in fewer diffs than if this PR was accepted as it is now and then these files were changed and the patch deleted. |
I'd certainly work on this but unfortunately I'm not using Godot 4.0 currently so it seems like such a low-priority task to be honest... I think it's fine to have those Godot types for now. Perhaps this update may fix the crash with |
Thanks! |
This PR updates the PolyPartition library (previously the files were called "triangulator") to commit 7bdffb4.
The only difference between the version in the repo and the version in this PR is that this PR uses Godot's types (
List
,Set
,Vector
,Vector2
) instead of the standard library (std::list
,std::set
,std::vector
) and PolyPartition'sTPPLPoint
.