### Author Topic: using and expression to increase random probability along x path  (Read 923 times)

#### Anthony Lester

• Newbie
• Posts: 31
##### using and expression to increase random probability along x path
« on: October 06, 2015, 02:02:25 PM »
Hi,

I wonder if anyone can help. I am trying to use an expression to increase the presence % of a randomize operator but for some reason it won't work.

Basically I have two objects, a solid plane and a plane with a circle cut out, the first 'column' or 'x counter' wants to have a no 'perforated panels' the last 'x counter wants to be 100% perforated panels, in between there need to be a gradual increase in the number of perforated panels but in a random 'y' order - does that make sense???

I have attached my working file as it stands

Any help would most appreciated.
Thanks Anthony

#### Anthony Lester

• Newbie
• Posts: 31
##### Re: using and expression to increase random probability along x path
« Reply #1 on: October 06, 2015, 02:35:06 PM »
I have since worked out that the randomize operator requires a percentage input, so my next question is how can I get a percentage output from an expression?

if this is not possible, is there aware of achieving the same result through a different process?

Anthony

#### Paul Roberts

• iToo Software
• Hero Member
• Posts: 1760
##### Re: using and expression to increase random probability along x path
« Reply #2 on: October 06, 2015, 03:02:17 PM »
Hi Anthony,

I came across this limitation myself recently too. Unfortunately the Presence values are used to initialize a non-uniform random number generator and this is done in an initialization process, so it cannot be changed dynamically.

I'm afraid there is not a solution that allows you to use the Randomise operator in this way, however please find attached a workaround that uses the Selector operator with an expression to create a similar effect.

It is generating a random number between 0.0 and 1.0 and checking if that is more or less that the segments current position along the X Spline. IF it is greater it will add a perforation and if less a solid segment .

I hope that helps, please let me know if you have further questions.

Many thanks,

Paul.
Paul Roberts
iToo Software

#### Anthony Lester

• Newbie
• Posts: 31
##### Re: using and expression to increase random probability along x path
« Reply #3 on: October 06, 2015, 03:04:42 PM »
Looks spot on, I will have a look at the file and see what you have done because you lost me in the explanation

Thanks

#### Anthony Lester

• Newbie
• Posts: 31
##### Re: using and expression to increase random probability along x path
« Reply #4 on: October 06, 2015, 03:12:03 PM »
Looked at it and still lost but does exactly what I wanted it to do so thanks again.