Skip to content

[bboxtree] add lower bound on eps

Dennis Gläser requested to merge cleanup/bboxtree-lower-eps-bound into master

Adds a lower bound for the eps used for testing bounding box intersections. This fixed an issue I had with intersecting two 1d grids in 2d space, that were both axis-aligned auch that the dimension of the bounding box is 0 in one coordinate direction. This change fixed it for me.

The idea is to have a lower bound on the epsilon, which is computed from the maximum bbox extent. The minimum eps is then maxExtent*minBaseEps, where minBaseEps = std::numeric_limits<T>::epsilon()*10.0. That is, we limit the precision in one coordinate direction by 10 times what is numerically possible in the direction with the maximum size.

Ideally, we would introduce a unit test for this that would fail before this commit but passes with this change...

Closes #1422 (closed)

Edited by Dennis Gläser

Merge request reports

Loading