Rotate geometry based on height

I have a gird of hexagons that i wish to rotate depending on their Z position. Lets say the boundary of rotaion angle is 0 to 45 degrees, and the higher the panel is the more it will rotate. Panels with the lowest Z with have no rotation and panels with the highest z will have 45 degrees of rotation. Preferibly in the z rototional direction as well. At the moment I can only make them all rotate in one angle around the xy plane. What whould be the most effecient way of doing this?

hexagon grid rotation.gh (11.6 KB)

Like this?


hexagon grid rotation_re.gh (10.9 KB)

2 Likes

yes, thank you:)