# Itoo Software Forum

## RailClone => RailClone Pro (*) => Topic started by: JTP Vis on July 23, 2014, 12:10:45 PM

Title: randomisation... in order!
Post by: JTP Vis on July 23, 2014, 12:10:45 PM
Hi,

Following on from my last thread (here: http://forum.itoosoft.com/index.php?topic=2277.msg8519#msg8519 (http://forum.itoosoft.com/index.php?topic=2277.msg8519#msg8519)) where I achieved a random order of 3 block sizes, where every other row is offset by 50mm so that the blocks don't line up in the rows, I want to add another piece to the puzzle.

In the image below I have every course/row set to the same size blocks.
(http://forum.itoosoft.com/index.php?action=dlattach;topic=2277.0;attach=2895;image)

I now want to add, randomly, another size of row, also randomly arranged as they are here. So,to explain, there might be one row of 160mm blocks followed by one row of 240mm blocks, followed by two rows of 160mm blocks, followed by one row of 240mm blocks followed by three rows of 160mm blocks... etc.

What I am not sure is where to put the sequences and where to put the randomisations. I hope someone can help.
I'm going to have a go, and post more if I get anywhere.

EDIT: I have tried so many combinations now, but I always get random blocks all over the place, not in rows of the same sized blocks. It seems that I need to randomise linear arrays somehow, but I'm not sure how to do that.

Cheers,

Bill
Title: Re: randomisation... in order!
Post by: Rokas on July 23, 2014, 12:36:37 PM
i would like to help, but i didn`t understand your described pattern
Title: Re: randomisation... in order!
Post by: JTP Vis on July 23, 2014, 12:54:22 PM
Here is a diagram of what I am trying to achieve. The red lines are 160mm wide rows of randomly selected different length blocks (as in the render in the first post) and the blue lines are 240mm wide rows of randomly selected different length blocks. Does that help?
Title: Re: randomisation... in order!
Post by: Paul Roberts on July 23, 2014, 01:11:07 PM
Hi Bill,

A setup like this should give you what you're looking for. I've used a selector operator, exported the index and connected a random node. This is then set to generate a new number for each row.

(http://lonelymonk.com/forum_images/e0040edd0f364c9683face98008ae312.jpg)

This give you something like this, changing the seed will yield different results.

(http://lonelymonk.com/forum_images/232ecf635365466b913905cd2b8c9181.jpg)

Hope that helps,

Thanks,

Paul
Title: Re: randomisation... in order!
Post by: JTP Vis on July 23, 2014, 01:20:41 PM
HiPaul,

that is interesting! Will that work with different length of boxes added into the equation? All your red boxes and your blue boxes are the same length in your example.

I'll look into that.

Cheers,

Bill
Title: Re: randomisation... in order!
Post by: Paul Roberts on July 23, 2014, 01:23:56 PM
Hi Bill,

I've updated that post. It should be what you need now ;)

Thanks,

Paul
Title: Re: randomisation... in order!
Post by: JTP Vis on July 23, 2014, 01:26:35 PM
Paul, that is genius. Thanks. I'll apply and post the result.

Cheers,

Bill
Title: Re: randomisation... in order!
Post by: JTP Vis on July 23, 2014, 01:44:27 PM
Hi Paul,

that is extremely close actually, and here is the result, but as you can see some courses line up. What I need to do now is introduce an offset of say 40mm to every second row; is that possible?

EDIT: is it possible to then add a conditional formula so that if the y row value is an even number then use the x transform of -40mm?

Bill
Title: Re: randomisation... in order!
Post by: Paul Roberts on July 23, 2014, 02:06:05 PM
Hi Bill,

Please see the attached. I've added two conditional operators so that the first segment of every other row can be given a negative padding value to create the offset. The only disadvantage of this technique is that you have to use clipping splines to determine the area.

(http://lonelymonk.com/forum_images/fbf60a983d8a4a9bb37221dbd519eb84.jpg)

Thanks,

Paul
Title: Re: randomisation... in order!
Post by: JTP Vis on July 23, 2014, 02:44:51 PM
Thanks to everyone for their help. See attached for the result. They still seem to align themselves sometimes, but I suppose that is what happens with randomization: sometimes they are aligned.
:)
Title: Re: randomisation... in order!
Post by: Paul Roberts on July 23, 2014, 03:36:22 PM
Looks great!  :)