Hi @arendvw
I noticed that the the results are different, so I looked into trying to understand what was going on. Sorry I don’t have time to debug this. There’s something to fix, as simple cases do not work. I also tried inverting the C and P inputs, but results are even more wrong.
test-kd-trees-arend.gh (10.1 KB)
Definitely not needed! The code is structured so that’s not needed, but it’s possible to inadvertently make it work that way.
Regarding your pictures, @rawitscher-torres, there is an additional detail to consider. For making a good comparison, you need to pass the data structures in the same way (if you search many small buckets with many small buckets, it’s not the same as searching a big haystack of points for a big amounts of needles).