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

Compute distance sphere-box #495

Merged
merged 2 commits into from
Mar 26, 2021
Merged

Compute distance sphere-box #495

merged 2 commits into from
Mar 26, 2021

Conversation

Rombur
Copy link
Collaborator

@Rombur Rombur commented Mar 25, 2021

We need this to use Nearest with Sphere. Right now we can only use Sphere with Intersect.

Comment on lines 99 to 100
// distance between a sphere and a box included in that sphere
BOOST_TEST(distance(sphere, Box{{0.5, 0.5, 0.5}, {0.6, 0.7, 0.8}}) == 0.f);
Copy link
Collaborator

Choose a reason for hiding this comment

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

That box is not included in the sphere, isn't it?

0.6^2+0.7^2+0.8^2=0.36+0.49+0.64=1.49 > 1

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, sorry about that. It's fixed.

Copy link
Contributor

@aprokop aprokop left a comment

Choose a reason for hiding this comment

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

Looks good. Could also rewrite intersects(Sphere, Box) to use it, if desired.

Copy link
Collaborator

@masterleinad masterleinad left a comment

Choose a reason for hiding this comment

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

Looks good.

@Rombur
Copy link
Collaborator Author

Rombur commented Mar 26, 2021

Retest this please

@aprokop aprokop added the enhancement New feature or request label Mar 26, 2021
@Rombur
Copy link
Collaborator Author

Rombur commented Mar 26, 2021

The CI fails because PGI times out on ArborX_DistributedTree_Test. I don't see how this can be related on the PR.

@dalg24 dalg24 merged commit ae19f4a into arborx:master Mar 26, 2021
@Rombur Rombur deleted the box_sphere branch April 5, 2021 12:58
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.

None yet

4 participants