Skip to content
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

Implement Stitch trait #1087

Merged
merged 47 commits into from
Aug 8, 2024
Merged

Commits on Jul 26, 2024

  1. feat: implement a stitch trait

    This trait is a non-panicking alternative for the `BooleanOps::union`
    and actually doesn't modify the location of any of the coordinates.
    Instead it returns an error in failing scenarios.
    
    Co-Authored-By: RobWalt <[email protected]>
    Co-Authored-By: Azorlogh <[email protected]>
    3 people committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    36539f3 View commit details
    Browse the repository at this point in the history
  2. test: add test and fixup small details of algorithm

    Co-Authored-By: RobWalt <[email protected]>
    Co-Authored-By: Azorlogh <[email protected]>
    3 people committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    0bc9a60 View commit details
    Browse the repository at this point in the history
  3. chore: add changelog entry

    RobWalt committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    e8c36a0 View commit details
    Browse the repository at this point in the history
  4. tests: add new failing tests

    RobWalt committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    183939e View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    3193aea View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    1ad39c5 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    e60b490 View commit details
    Browse the repository at this point in the history
  8. test: add further test cases

    RobWalt committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    e174944 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    e8fb3b2 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    6475a0d View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    e28848e View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    113e6a4 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    bb6c425 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    148a071 View commit details
    Browse the repository at this point in the history
  15. fix: fix doc test

    RobWalt committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    3afde3f View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    b72963c View commit details
    Browse the repository at this point in the history
  17. fix(review): doc comment formatting

    Adding a code block around a ASCII drawing to preserve monospace
    rendering in docs.
    
    Authored-by: RobWalt <[email protected]>
    RobWalt committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    854d51d View commit details
    Browse the repository at this point in the history
  18. chore(benches): add stitch benchmark

    This benchmark was added to meassure performance improvements for the
    stitching algorithm.
    
    Authored-by: RobWalt <[email protected]>
    RobWalt committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    346df1d View commit details
    Browse the repository at this point in the history
  19. perf(stitch): improve line comparison

    The previous implementation created a whole new line to check if one of
    the lines was the inverse of the other. Removing this construction and
    inlining the function got us a good performance improvement.
    
    improvement: -27%
    
    Authored-by: RobWalt <[email protected]>
    RobWalt committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    c2e4337 View commit details
    Browse the repository at this point in the history
  20. perf(stitch): n^2 loop to fold

    Instead of iterating through all n^2 possibilities we can just iterate
    through the vector once (n^1) and kick out duplicates if we find some.
    This results in the same return values as before and is significantly
    faster.
    
    improvement: -88%
    
    Authored-by: RobWalt <[email protected]>
    RobWalt committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    2e782e2 View commit details
    Browse the repository at this point in the history
  21. perf(stitch): idomatic std use

    Making the code mildly more idiomatic resulted in performance gains.
    
    improvement: -8%
    
    Authored-by: RobWalt <[email protected]>
    RobWalt committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    3e69011 View commit details
    Browse the repository at this point in the history
  22. chore(stitch): remove clones

    Minor removals of clones, but not really. It showed up as a small
    performance improvement in the benchmark but I'm not confident it's
    really an improvement.
    
    improvement: maybe -2.5%
    
    Authored-by: RobWalt <[email protected]>
    RobWalt committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    9e2f071 View commit details
    Browse the repository at this point in the history
  23. fix(review): typo for consistency

    Authored-by: RobWalt <[email protected]>
    RobWalt committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    9c4c392 View commit details
    Browse the repository at this point in the history
  24. chore(comments): add perf comments

    Leave some nice comments for the after world and also tell the future
    developers to benchmark their optimizations!
    
    Authored-by: RobWalt <[email protected]>
    RobWalt committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    4a3cefd View commit details
    Browse the repository at this point in the history
  25. docs(stitch): clarify edge cases

    In the review process we figured that this still was a bit ambiguous.
    
    Authored-by: RobWalt <[email protected]>
    RobWalt committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    32531e8 View commit details
    Browse the repository at this point in the history
  26. docs(stitch): more details

    adding more details to the `find_boundary_lines` functions since it's
    quiet important for performance to get the cencepts right there
    
    Authored-by: RobWalt <[email protected]>
    RobWalt committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    f55ebb6 View commit details
    Browse the repository at this point in the history
  27. refactor(stitch): macro function dispatch

    Factor out common code and call it directly in the `Triangle` and
    `MultiPolygon` impls to prevent needless cloning and indirection.
    
    Authored-by: RobWalt <[email protected]>
    RobWalt committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    5748e8e View commit details
    Browse the repository at this point in the history
  28. chore(cleanup): docs + simplifications

    Authored-by: RobWalt <[email protected]>
    RobWalt committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    4297322 View commit details
    Browse the repository at this point in the history
  29. fix(review): special case the algo to triangles only

    As stated in one of the review comments, the main purpose of the algo is
    to stitch together triangles that resulted from a triangulation.
    
    Although it would also be nice to generalize the algo for polygons and
    multi polygons, it makes the code harder to read. It is advised to just
    triangulate in those cases and then run the stitching on the compound
    triangulation.
    
    On another note: special casing the algorithm to triangles also gave us
    a real good performance boost again. We gained another ~50% boost from
    all of the improvements in this commit.
    
    Authored-by: RobWalt <[email protected]>
    RobWalt committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    173d7bc View commit details
    Browse the repository at this point in the history
  30. chore(cleanup): use pr suggestions

    Authored-by: RobWalt <[email protected]>
    RobWalt committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    fb958f0 View commit details
    Browse the repository at this point in the history
  31. Update geo/src/algorithm/stitch.rs

    frewsxcv authored and RobWalt committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    5dbaaa0 View commit details
    Browse the repository at this point in the history
  32. fix(test): repair doc test

    Authored-by: RobWalt <[email protected]>
    RobWalt committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    22ee4fa View commit details
    Browse the repository at this point in the history
  33. fix(review): don't use custom capacity

    Authored-by: RobWalt <[email protected]>
    RobWalt committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    95c0851 View commit details
    Browse the repository at this point in the history
  34. chore(cleanup): remove unused error variants

    Authored-by: RobWalt <[email protected]>
    RobWalt committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    47f9f28 View commit details
    Browse the repository at this point in the history
  35. feat(visibility): make it all pub(crate)

    We decided to do this since we're not sure yet about how users might use
    this functionality. In the worst case the API is still confusing and
    leads to a lot of error reports due to the implicit assumptions which
    are only documented in doc strings and not enforced by code or won't be
    caught by errors
    
    Authored-by: RobWalt <[email protected]>
    RobWalt committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    8b5e5b9 View commit details
    Browse the repository at this point in the history
  36. docs(stitch): improve doc string

    Add some notes that triangles shouldn't even overlap instead of just
    stating that duplicates are not allowed.
    
    Authored-by: RobWalt <[email protected]>
    RobWalt committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    45f14ca View commit details
    Browse the repository at this point in the history
  37. fix(test): remote pub export

    Authored-by: RobWalt <[email protected]>
    RobWalt committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    d0db3e1 View commit details
    Browse the repository at this point in the history
  38. chore(cleanup): comment benchmark out

    This benchmark needs a public export of the stitch trait which isn't
    given anymore. I added some comments for the after world.
    
    Authored-by: RobWalt <[email protected]>
    RobWalt committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    b1ae9f9 View commit details
    Browse the repository at this point in the history
  39. fix(tests): comment out failing doc test

    Authored-by: RobWalt <[email protected]>
    RobWalt committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    c08f84c View commit details
    Browse the repository at this point in the history
  40. refactor(helpers): move triangle winding function

    Authored-by: RobWalt <[email protected]>
    RobWalt committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    42d6906 View commit details
    Browse the repository at this point in the history
  41. chore: fix small typo

    Authored-by: RobWalt <[email protected]>
    RobWalt committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    9927e71 View commit details
    Browse the repository at this point in the history
  42. chore: improve wording

    Authored-by: RobWalt <[email protected]>
    RobWalt committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    c182742 View commit details
    Browse the repository at this point in the history
  43. chore: improve explaining comment

    Authored-by: RobWalt <[email protected]>
    RobWalt committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    eaa66ac View commit details
    Browse the repository at this point in the history
  44. chore(tests): use Relate for testing

    Authored-by: RobWalt <[email protected]>
    RobWalt committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    a93c511 View commit details
    Browse the repository at this point in the history
  45. Configuration menu
    Copy the full SHA
    39c0349 View commit details
    Browse the repository at this point in the history
  46. bump spade version to fix ci

    RobWalt committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    715a319 View commit details
    Browse the repository at this point in the history
  47. try to fix CI errors

    RobWalt committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    4ecbd1e View commit details
    Browse the repository at this point in the history