Grasshopper

algorithmic modeling for Rhino

# Random Selected Points aren't really Random

Hi!

I just tried to select one random point on each curve. Therefor i divided the curves by length and then I tried to select one point via list item by a random index input. At least, the selection is not really random.

Thanks,

benjamin

Views: 643

Attachments:

### Replies to This Discussion

Hi Benjamin, can you post a file? it's hard to tell what the problem is only looking at the image.

If you want to select random points on a curve, a better approach could be to generate random numbers from 0 to 1 and use them as the t input of the evaluate curve component, you would have to reparameterize the curves as well.

Also, I would recommend that you keep the Draw Fancy Wires option under the display menu on, it will help you understand better what type of data flows from a component to the other, and make it easier for other people to help when looking at a screenshot. Have a look here for more information

Hi Mire,

The problem is that I want to move one point (controll point) of the original curve outside to create some discontinutis and then rebuild the curve. So I divided the curve to get the points to interpolate it later again with the one moved point.

Attachments:

Hi Benjamin,

The issue was in the seed of the random component as David mentioned. You need to provide a different seed for every domain, in this case I made a series of numbers that are used as different seeds, but you could use another random component for this purpose

Attachments:

Thank you so much Mire, now it works perfectly!

Best regards

I suspect the problem is that you're using the same Seed values for both random components. That'll give you the same random sequence every time. But as mire said, without a file it's difficult to be sure.

I don't think [Random] can handle multiple domains.
get a list of random numbers equal to the number of curves, then Remap them to the domains.
also, subtracting the domain by 1 makes the probabilities unequal, for 5 items remap them to a domain of 0 to 5 say, then round down.

Also, seconding the fancy wires option, took me a while to figure out, especially as parts of the definition are off-screen :/

Edit: posted before you posted the .gh, but hopefully no other complications, havent checked

Attachments:

• View All