Finding where an item was before being sorted by distance

If I have a list of 20 coordinates, and I sort them using the [sort points by distance] node it sorts them perfectly ;)
Say we take the first item in the sorted list, is there a way to find out what item/where it was in the original list?
Cant work it out ;( ;)


Basically yeah would be good if Sort Points By Distance had an “index” output port, like @MartinusMagneson did for his custom list nodes (link) (already suggested lower on that topic for stock nodes too related to a question by Kewl). But the amazing Sort With Index node by Martinus works for 1D values (and no minus values).

Also if the dictionary nodes allowed more data type beside text (or if they were more text conversion node possibilities, f.e. “2D list To Text list”, or if Merge XY list allowed to merge 2 texts lists into 1) they could I guess be used for this pretty fast, (see Editor Support For Dictionaries request)

Otherwise, methods would for example be to still use dictionaries but to convert the 2D points into texts using Process List (see attached composition & screenshot), or convert points to text & split text etc (joined composition 2).

Hope this helps though

Capture d’écran 2019-05-19 à 03.01.29.png  

Sort 2D Points With Index - Process List.vuo (7.83 KB)

Sort 2D Points With Index - Text Split.vuo (9.65 KB)

1 Like

This is really useful, thanks for this @Bodysoulspirit
I’ve never used the dictionary nodes :) Cant wait to take a look.
My coordinates are actually 3d points but I see how I could adapt.
Much appreciated!

1 Like