mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user