[Closed] Speed up finding closest vertex?
if you have only couple hundred target points it’s very cheap to use 3D grid. you can make a small grid (20x20x20) for example. with maximum bbox for source and target points… the defining bbox will be faster than find closest vert for one point.
after that every source point will be searched against maximum 10-20 targets… which means we will have not 10000×200 but 10000×20… you we get 10 times faster solution.
but you have to understand that a grid solution needs fixed minimum distance where a search still make sense… it means that bbox of source points almost contains bbox of targets
I suppose it is now that I think about it!. I was so focused on thinking of that as checking vertices against other vertices, but checking arbitrary point3 values against them is effectively really is the same…
Okay, so what can we do with this one?
a grid.
but we have to find bbox for points (search area), and specify maximum distance…
so the minimum size of grid cell is (maximum distance)/(2*(square root of 3))
ps… hopefully i still remember middle school math