true that! what would you recomend?
Not a recommendation, just providing some prior research into the problem prior to settling on using KD Trees.Calculating a unique hash for a given 3D point is really about finding a 1D value that represents the point. The mathematician Giuseppe Peano,
http://en.wikipedia.org/wiki/Giuseppe_Peano, figured out such a method and it is called Peano Coordinate encoding which has the properties of a nearest neighbor problem.
To encode a 2D point of say, x=1234 and y = 5678 the Peano encoded 1D value is 15263748, which can also be decoded back to the original value. When multiple 2D values are encoded and sorted then they will fall naturally into a nearest neighbor when traversed.
The internal storage of a 64 bit double complicates the implementation of Peano encoding for these types. It may not be practical to use?