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

Add segment-segment intersection (2D only) #1207

Merged
merged 3 commits into from
Feb 1, 2025

Conversation

aprokop
Copy link
Contributor

@aprokop aprokop commented Feb 1, 2025

  • Rename segment.{_start,_end} to segment.{a,b}
  • Add 2D segment-segment intersection

@aprokop aprokop added the enhancement New feature or request label Feb 1, 2025
@aprokop aprokop merged commit 166aba4 into arborx:master Feb 1, 2025
1 of 2 checks passed
@aprokop aprokop deleted the segment_intersection branch February 1, 2025 21:17
auto const &a = segment.a;
auto const &b = segment.b;
return (p[0] >= min(a[0], b[0]) && p[0] <= max(a[0], b[0])) &&
(p[1] >= min(a[1], b[1]) && p[1] <= max(a[1], b[1]));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't compile if the point coordinate type does match with the segment one?
Is that intentional? If so maybe add a static assert

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why won't it compile when point coordinate does not match the segment one? The stuff inside min and max are coming from the segment, which means same types.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FTAD will fail for Kokkos::min/max

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants