copy to points - variant issue

Recommended Posts

I try to use variant and each time at point 0 as always the same variant, even when I change the seed ? any idea ? thanks

copy_variant.hiplc

Share on other sites

Salut David,

it's weird indeed. I bet it's from the random function at ZERO.

Here is one way to go around the problem:

just replace the multiple by your seed (*) by an addition (+) then it should avoid the zero, and solve your problem

i@variant=int(fit01(rand(@ptnum+chf("seed")),0,3));

i@variant=int(fit01(rand(@ptnum*chf("seed")),0,3));

Edited by 6ril
Share on other sites

9 minutes ago, 6ril said:

Salut David,

it's weird indeed. I bet it's from the random function at ZERO.

Here is one way to go around the problem:

just replace the multiple by your seed (*) by an addition (+) then it should avoid the zero, and solve your problem

i@variant=int(fit01(rand(@ptnum+chf("seed")),0,3));

i@variant=int(fit01(rand(@ptnum*chf("seed")),0,3));

you're right  thanks for your help

Share on other sites

if you want to be safer and also to avoid increasing seed by increments of 1 just offseting the same random number to the next point you can use 2 dimensional rand(float, float)

`i@variant=int(fit01(rand(@ptnum,chf("seed")),0,3));`

Share on other sites

1 hour ago, anim said:

if you want to be safer and also to avoid increasing seed by increments of 1 just offseting the same random number to the next point you can use 2 dimensional rand(float, float)

```
i@variant=int(fit01(rand(@ptnum,chf("seed")),0,3));```

thanks

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×