error when tracing ray very close to a geometry instance

In my program, i move ray origin to a hit and then trace from that position with direction unchanged.
Sometimes, the ray should leave the geometry but optix gives a hit with t_hit~0.001.

I’ve relaxed epsilon to 1e-4 and successfully avoided t_hit in the order of 1e-5. But further relaxation is unacceptable.

Any ideas in treating that?
Thanks!

This can happen due to floating point precision errors when your geometry is far away from the origin. Is there any way for you move the geometry closer to the origin?

I can move geometry closer if using transform node. But currently I’m making structure shallower.
Now I suppose the unit is cm. If I transform to m, the numbers will be smaller. Is that counted as closer?

If you have only triangles in your intersection program, you can store object id and primitive id. When you trace from this triangle, you can ignore intersection with same object and primitive id (you can do it at the beginning of intersection program).

Possibly, but not guaranteed. Because it’s floating point arithmetic, scaling is only guaranteed to help if it changes the distance relative to the epsilon.

I transform cm to m and it helps a lot. But I still get a few wrong results.
Another alternative is to use transform nodes. My scene aims to have thousands of cylinders, tens of which are grouped into an ‘assembly’. Now I’m using no transform node to get the shallowest structure. Is it worth putting the ‘assembly’ into a geometry group and then add to a transform node?

According to Table 7 from the OptiX Programming Guide, the Intersection program uses object coordinates. That suggests that using a transform node will help.

My point is whether the accuracy will be obtained at cost of performance. Programming guide also suggests against transform node to avoid deep structure.