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).
This commit is contained in:
laurence
2013-09-19 16:18:11 +01:00
parent d75f9636e0
commit b51ba049aa

View File

@ -269,7 +269,8 @@ bool Foam::treeBoundBox::intersects
const direction endBits = posBits(end); const direction endBits = posBits(end);
pt = start; pt = start;
while (true) // Allow maximum of 3 clips.
for (label i = 0; i < 4; ++i)
{ {
direction ptBits = posBits(pt); 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;
} }