-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
Prevent crash in epa2 and epa3 ::closest_points if all is_project #263
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, thanks!
I think I realized why
If I change the body of
Do you think this could work? |
I went ahead and pushed this change. We can always revert the commit if it doesn't make sense. |
We now check whether at least one the proj_inside computations is true, and return None if not. Also rename some variables in epa2 to match the corresponding variables in epa3.
|
EDIT: I implemented a fix for epa3 that should also make the test case work as expected
Alleviates/fixes these issues:
#253
#246
Related Discord thread:
https://discord.com/channels/507548572338880513/1274773766811160646
EPA::closest_point
crashes at linelet mut best_face_id = *self.heap.peek().unwrap();
becauseheap
is empty. This happens when we reach the second branch ofclosest_point
and all of theproj_inside
variables are false.The measure taken in this PR is to log the problem and return
None
. While the result might be incorrect, it avoids the panic.This is only a half-measure and someone who understands EPA and/or this implementation of it should write a proper fix.
The included unit test is programmed to fail because in reality there should be an intersection.