Fix fragments order after Surface Split

Hi,

After splitting a surface using Surface Split, the resulting fragments are out of order (see red group in example gh).

From other posts it looks like it’s just expected behaviour from Surface Split. In this case the ordering matters because the resulting meshes need to be saved in sequential stl files.

How can I re-sort the fragments so they follow the natural order (i.e. distance from the orgin?)

surface-split-sorting.gh (31.9 KB)

Here are a couple of options:
surface-split-sorting_v2.gh (42.5 KB)

Thanks Adam,

Both solutions work. I’m going to go with sorting by centre as it’s easier to read.