I am appending points with a modal operator & would like to check if the last point is near the other points. Any way of doing this with distance detection? or length?
This is so that if it is near other points, the raycast location changes
Well, building and balancing a kd-tree itself also takes time.What suits best here is depending on what he wants , repeating spatial searches for the nearest points, or some sort of clustering, weighting over all points, or whatever.
Awesome, I’ll look into that example & the kdtree. The points are not real mesh yet, just vectors being stored. For example: <Vector (-1.0481, 1.0129, 0.5050)>
So when I am drawing out the points, the last point has to check if it is going over an existing points and if its does, i need the raycast hit location to offset over those points so I can draw on top of them.
last_point = self.points[len(self.points)-1]
proximity = 0
for i in range(len(self.points)):
proximity += ( hit - self.points[i] ).length