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 tolerance to avoid empty CGAL intersections due to roundoff #14353
base: master
Are you sure you want to change the base?
Conversation
Question: how does |
|
a2aae75
to
138cfcf
Compare
Renaming would definitely make sense. But I still a bit unsure if it really makes sense to use the number of digits. Do we have other places where we do this like this? I guess in most cases we use absolute or relative tolerances!? |
The problem is that there is no way to hand over a tolerance to CGAL as far as I know. So the input already has to be in a form such that CGAL detects the intersection. If you have any better idea how to achieve this, I am curious. I don't like the solution a lot, but it worked (in a slightly modified way) in all of my use-cases by now. |
ee0c165
to
2ef7e03
Compare
I rewrote the routines such that the use can give a tolerance instead of n_digits. Still, the backend uses n_digits to achieve the rounding. I think this is a good compromise, since I can not think about a different way to achieve described behavior. |
2ef7e03
to
713bab5
Compare
713bab5
to
9c50839
Compare
During testing the functionality of the PR, I stumbled across a bug #14359. This is, however, not related to this PR. From my point of view, this PR is ready to review and should be safe to merge. We could however also wait before merging, since for the rest of the implementations I am planning to do, the additional tolerance is just one additional parameter to pass. However, if you could still give me a review, I would be happy :) |
I think this should be merged after #14360 |
I agree with your choice. Depending on the field, someone could say that if cells are not intersecting up to eps, then no intersection is expected, while in other scenarios (like the one you have), one really wants it to be found. From a user's perspective, I just think |
@mfeder Thanks for the input. I couldn't think about a meaningful sketch, but I extended the documentation :) |
Let's put this on hold while I try https://stackoverflow.com/a/54303150 |
Dependent on the element configuration, it might happen that intersections are not found. Therefore, I would like to introduce a parameter to be able to truncate vertices if needed. I still have to write a test and check if the implementation actually resolves this behavior in any case.
@fdrmrc @peterrum