How to divide length randomly

im trying to make the random louvers, but i don’t know how to divide the length randomly like 100,150,200,100,200,150,100…(in the script i just divide by 100)
does anyone know how to do that?

Best, Keisuke

20240620_wood kanna .gh (48.2 KB)



This has been done many times on this forum. Did you look? There are many flaws in your code. (8.9 KB)


I agree. The script OP posted is useless to decipher. It would help if it was cleaned up for troubleshooting.

Nice use of the Jitter. I hadn’t thought of that.
Here is a slightly more convoluted solution @KeisukeAikawa may want to explore as well.

The issue with the random spacing logic is that lots of times the end segment of the curve gets an undesirable length. Exploring the different seeds I found a random sequence which has a sum equal to the input curve length. This may be important when considering module lengths.

Divide Curve Random (12.0 KB)

1 Like

Yes, random lengths may rarely fill an arbitrary length curve. Unlike yours, @KeisukeAikawa’s curve was 10198.039027 units long.

Jitter is useful when there is a list of specific lengths to choose from.


Thank you !
Joseph ,Baileydw
Sorry for the not cheking other forums,
I can understand perfectly and need to use Jitter intstead of Random

1 Like