I assumed that the first panel id in that array represents the topmost panel in the respective slice, but it looks like it's not. Is it related to rotation? I didn't understand that part very well, but nevertheless, the "layoutData->globalOrientation" is "0" so it shouldn't influence it, right?
For example, having a configuration like in the Fig 1 from the docs (https://forum.nanoleaf.me/assets/sdk-images/fig1.png), I'd like a way to find out that "48" is the id of the topmost panel in the slice "3", and that "57" is the id of the second panel from the top, and "61" the third.
Once you get the layout, you could do the following steps:
Rotate the layout by the rotation specified in LayoutData::globalOrientation
Get the frameSlices
sort the panels in the 3rd frame slice with the sorting key as the y position of the centroid of the triangles. You could use std::sort and provide a comparator function that takes in the two ids of the panels being compared, looks up the value of the Y position of the centroid of the two triangles and sorts according to that.