handle k-nearest neighbours search

update DocstrumBB with kd-tree
This commit is contained in:
BobLd
2020-03-10 13:36:44 +00:00
committed by Eliot Jones
parent 8cafda3577
commit 5b8a2f2e38
6 changed files with 296 additions and 99 deletions

View File

@@ -382,9 +382,15 @@
}
else
{
if (!rectangle.Normalise().IntersectsWith(other.Normalise()))
var r1 = rectangle.Normalise();
var r2 = other.Normalise();
if (Math.Abs(r1.Rotation) < epsilon && Math.Abs(r2.Rotation) < epsilon)
{
return false;
// check rotation to avoid stackoverflow
if (!r1.IntersectsWith(r2))
{
return false;
}
}
if (rectangle.Contains(other.BottomLeft)) return true;