Grasshopper

algorithmic modeling for Rhino

Hi guys!

I was trying to do a random selection of a fixed number of non-repeatable elements in a list. I mean that every randomly chosen element must be unique.

In the screenshot attached you'll see how I was genereting the list that I would use as list of indexes for the list of elements...

But there is often (and obviously...) at least one index repeated.

Any idea?

Thanks so much,

Filippo

Views: 1078

Attachments:

Replies to This Discussion

It's typically a better idea to generate a non-random list of unique values (that is easy after all) and then randomize it. Either use RandomReduce if you have too many values and you can use Jitter to randomize the order of the values.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Thanks, It works!

Sorry, for re-post David :p

I don't see your post before

Hi Filippo,

Try using Jitter component. 

Thanks! It is exactly what I was looking for.

Thanks again!

You're welcome

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service