I’m trying to show a Cvalue of a stadium bowl which I already modeled. Given each spectator point,

there are some value to put into a formula, of which values the only I can’t easily get form the model is the height of the stand beam. It basically corresponds to the difference in Z between one row and the one underneath, so the easiest way to determine it is to extract from each analized point, the row it belong to and then get the Z difference with the one right on the lower row. I then need to do it through the data tree

by extracting the index of the row, can someone tell me ho to achieve that? Or even better ways to do the task i guess.

You can “flip matrix”, to get all the seats with increment in one list (you’ll have a tree of those lists). Then you can “shift list” to compare the Z of each beam to the next one. Make sure to set False to Wrap and use two shifted lists with (1 and -1), otherwise you will get also the difference of the last item to the first one. You can post the file in here as well.

Thanks for replying.

I understand the flip matrix but I am not sure how to put it into the script.

I need to sort all the points at the same time in order to have a mesh colored with gradient.

So the flow would be = divide all lines by the same segment, exrtract all the points and get from each its eight and distance form the pitchside and subtract the height of the point on the next. With all these value the formula gives a number that is used to color the mesh. So at which point would you insert the flip matrix component?

You should upload your .gh definition with necessary data internalised.

Help others to help you.