feat: port S2EdgeCrosser and edge crossing predicates from C++#103
Merged
Conversation
ports the robust spherical edge intersection algorithms from the C++ s2edge_crossings and s2edge_crosser headers notable details: - Omitted the C++ implementation's exact float fallbacks - Translated the C++ function overloads into chain_* functions - Skipped the S2CopyingEdgeCrosser - instead just natively copy Points - Strongly type Direction instead of using -1 0 1 integers
Closed
Contributor
Author
|
note that it currently links to a crate::s2::contains_vertex_query::ContainsVertexQuery which doesn't exist (yet), which i'd hopefully port aswell |
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.
hey, i've been using the s2 library for a solid bit but i needed edge crossing, so i ported the c++ version. aside from arbitrary precision floats. the rust version behaves like the c++ (tested by porting the c++ unit tests (unless otherwise noted in the test mods) and running a quick script comparing the outputs of c++ vs. this rust one)
few notes:
please note the addition of Clone & Copy on Direction so i can store it in a Copy (and Clone) type
fixes #78