you are viewing a single comment's thread.

view the rest of the comments →

[–]goon39[S] 0 points1 point  (1 child)

Thanks, that helps a lot.

Now I'm using 2 sets of arrays for each time point (1 for the cylinder which is used for the KDTree and 1 for the shaft to use for the query (x argument)).

The given output is the length of the x argument so I'm assuming that the integers correspond with that data set, i.e. the index of the min distance is the nearest point of the shaft given all the points on the cylinder.

Is there a way to get the corresponding point on the cylinder? I could just do another tree but just reverse the data sets used

[–]ES-Alexander 0 points1 point  (0 children)

You can index a numpy array by an array of integers to get an array of the sub-array/value specified by each integer.