Skip to content
Snippets Groups Projects
Commit b51ba049 authored by laurence's avatar laurence
Browse files

BUG: treeBoundBox: If test point is on boundBox the intersection test can

get stuck in a loop. Allow maximum of 4 iterations (3 clippings plus one
iteration to update the result).
parent d75f9636
Branches
Tags
No related merge requests found
......@@ -269,7 +269,8 @@ bool Foam::treeBoundBox::intersects
const direction endBits = posBits(end);
pt = start;
while (true)
// Allow maximum of 3 clips.
for (label i = 0; i < 4; ++i)
{
direction ptBits = posBits(pt);
......@@ -380,6 +381,9 @@ bool Foam::treeBoundBox::intersects
}
}
}
// Can end up here if the end point is on the edge of the boundBox
return true;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment