How to rotate elements randomly?

hi everyone i still learn grasshopper and kinda confused to how to rotate each elements that ive already duplicate it, i moved my elements to x and y and also want them to rotate in randomly way but i cant figure it out… i would apreciate for anyone who wanted to help :slight_smile:

WEEK 4 HOMEWORK 2.gh (13.8 KB)

this is the basic components

Hi @flonako,

I’m not at my computer but generally speaking…

You will be wanting to use the Rotate3D and Random nodes.

Give the Random node an input of the range of rotation you want (such as 0-270) and plug the Random node output into the Rotation number input on the Rotate3D node.

You’ll want to be setting the rotation axis to the Z Axis bottom center of your geometry “cluster” I would assume.

Alternatively, you can rotate everything first and then move them as well.

Good luck on your homework, make sure to search the forms for “Rotation” or Random Rotation if you get stuck.

Is this your module? you want to rotate each module ?
Or each box should rotate individually ?


WEEK 4 HOMEWORK 2 (1).gh (20.5 KB) This rotates all your boxes along their central axis randomly ..

BUT , as I reviewed your script again , I think you wanted to group each module geometries into branches :

So , I guess this can be your result : ( rotating each module around its center axis )


WEEK 4 HOMEWORK 2 (2).gh (21.1 KB)

@Ali_Najmaei has asked important questions that are not clear in your description.

This effort assumes you want to rotate only one of the ten boxes in your “basic components” (the Merge component), which you have replicated twelve times (3 * 4).

To simplify the data tree that results from using two Linear Array components, I added Group and Ungroup (yellow groups). The ‘Index’ slider (blue group) chooses one of the ten boxes to rotate, shown in Magenta before random rotation and in green after rotation.


HOMEWORK 2_2025Sep24a.gh (26.7 KB)

“other blocks” (boxes, purple group) in green preview color:

This is my interpretation of the request:

sorry for the late reply i havent opened this forum for a while TT, at first i wanted my result to be like the second one but since i saw your first result i think that would be much more better than the second one, anyway thank u so much for helping me!