Depth Sorting

Structure subtlety

yanomano's picture

This is probably an idiotic question but, in a structure of structures, is there a way to retrieve the name of an index when the structure has been reordered ?

See the jpeg as example : The first index (0) is named "9" : how to retrieve this number/name ?

A method without javascript would be ideal because the work is done inside an iterator !

Thanks for the kind help !

Depth Sorting with javascript

yanomano's picture

I'am trying to re-order an array of points according to the z component for depth sorting with javascript. There is an easy way to to manage the order with array.sort(), but it seems more complicated with an array of arrays...

My idea was to apply the array.sort() only on the Z component and find a way to return an array of int[] that represents the order of the original array with indices. Then re-order the original array of point according to these indices.

Is there an easy way to return the original indices of the array re-ordered with array.sort() ?

Thanks for your help !