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

There is no Way to Gather All Intersections on a Ray in a Robust Manner #188

Open
aurelw opened this issue Apr 16, 2018 · 3 comments
Open

Comments

@aurelw
Copy link

aurelw commented Apr 16, 2018

With RTC_SCENE_FLAG_ROBUST enabled, I intersect a single ray and use an intersection filter to record all intersections. However, when I hit exactly an edge, I sometimes get two intersections rather than one. I don't hit a convex part of my mesh, where the two intersection points would just be very close together. I get two intersections where in a strict geometric manner I should only get one.

So It seems like RTC_SCENE_FLAG_ROBUST only guarantees that I always get intersections on a watertight mesh. However, with multiple intersections on a single edge, it is difficult to do things like gathering transparency or in my case to determine sections inside and outside of the mesh, without checking the triangle normals.

If I introduce an epsilon, which two intersections must be at least apart, I fear of dropping valid intersections.

For my usecase it would be sufficient to get just one random intersection of the two.

I use v3.0.0

@svenwoop
Copy link
Collaborator

This is a known issue. There are also very tiny cracks at the vertices with current robust mode. We will close the cracks soon by adding some epsilon, but this will not fix your problem of hitting two primitives at an edge. Can you workaround this issue by looking at the triangle normal for now?

@aurelw
Copy link
Author

aurelw commented Apr 17, 2018

I use a minimum distance between two intersections for now. I did some analysis and testing to make the distance as short as possible. I would be glad tho, if this is fixed in a future version of embree.

@loopless
Copy link

I am using 2.17 with RTC_SCENE_FLAG_ROBUST and also find that if the ray perfectly hits a triangle edge of a watertight geometry ( not just a vertex) the ray can sometimes be marked as "missing" the geometry. Which for my use-case is even more of an issue. Attached is a picture of a sneaky ray escaping.
capture

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

No branches or pull requests

3 participants