Generic interface for both integer and floating-point triangulation#14
Open
mikwielgus wants to merge 6 commits into
Open
Generic interface for both integer and floating-point triangulation#14mikwielgus wants to merge 6 commits into
mikwielgus wants to merge 6 commits into
Conversation
We will support both integer and float coordinates.
Instead of two generics.
…atable` actually use `Adapter` Moved `*_as` methods to new `*TriangulatableAs` traits. Made some more changes.
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
mikwielgus
force-pushed
the
generic_api_attempt_3
branch
2 times, most recently
from
July 24, 2026 21:48
a7d2253 to
c804a60
Compare
mikwielgus
force-pushed
the
generic_api_attempt_3
branch
from
July 24, 2026 21:55
c804a60 to
6d33d04
Compare
Member
|
I checked this PR, but unfortunately, I still think the API should be separate. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR makes the current floating-point API a more generic interface that works both on floats and integers, while still using the same currently used integer-only code internally. This is done by creating a new
PointAdaptertrait that generalizesFloatPointAdapterto also work on integers, through a newIntPointAdapterstruct whose methods are just identity maps..triangulate_as(),.unchecked_triangulate_as(),custom_triangulate_as()are still float-only and are moved to their own traits to maintain the current interface, but I'm not sure if they are still needed on this branch.The proposal for this change was discussed on #11. I understand that this change is controversial and may be unlikely to be merged. I have created this because I need this for myself, as I tend to write geometric code that is generic over both integers and floats, and I'm PR-ing this just in case you might be interested in taking a look and reconsidering.
If there is a different way you would prefer this implemented, let me know, I can rewrite.