# How can I truly randomize the rotation of instances that are chained?

Simply, I would like to do this procedural circuit board wire, but with Geometry Nodes:

The point being, ideally I would just increase an integer and new objects would appear at the end of the chain, rotated in -45, 0 or 45 degree angles, preferably 0 mostly (but that I can handle).

I tried multiple setups, but this is beyond me. The so-called random value seems to always be the same for all the objects, not truly random :(

How can I do it?

• Since the distance between the points should always be the same, and no loops are available in GN, this will not be easy, I fear. Let's see. Apr 9, 2022 at 10:02
• Thanks! I tried the mesh line option, but hmm, still quite far from what I'm aiming for Apr 9, 2022 at 10:03
• @quellenform ah, actually, the distance between the points don't have to be the same necessarily, if it can look like the example above somewhat Apr 9, 2022 at 10:09

Here we go!

This answer shows exactly the solution to the concern you outlined:

1. First create a line with the desired number of subdivisions.
2. Then create a random angle of $$-45°$$, $$0°$$, or $$+45°$$ per index and capture it with the Capture Attribute node
3. Next, add the coordinates resulting from the sum of the direction vectors point by point using the node Accumulate Field and set the positions of the individual points of your line.

The advantage of this solution is that the distance between the points is always the same as shown in the picture.

And here is another alternative, where you can influence the probability of an angle change:

Here is the blend file (Updated!):

• Great! I'll try this immediately! Apr 9, 2022 at 12:44
• Thanks to your question and looking for a solution, I came up with another solution to another problem: Geometry nodes line of touching circles Apr 9, 2022 at 16:21

Here's my take:

The idea is to normalize the vector so that each component is always -1, 0, or 1, as if putting the points on a grid.

• Interesting! I'll try it Apr 9, 2022 at 10:45
• Otherwise superb stuff, but... doesn't fully look like a circuit board wire :/ Can't get it to look like that Apr 9, 2022 at 11:21

This is closer, but still quite far from what I'm aiming for

AH, but with Lukas' method above I managed to do this, when altered the 'map range' node a bit and added a 'Fillet Curve' node :) Now it looks more like a circuit board wire, yay.

Try to create an array of lines which are rotated -45,0,45. All at 0,0,0 and then place them end to end using the Accumulate fields node.

• Shall be tried immediately! Haven't used Accumulate fields node at all, but I know what it's for, so let's see :) Thank you! Apr 9, 2022 at 10:25