Grasshopper

algorithmic modeling for Rhino

Hi all,

 

How can I randomly select a bunch of geometry (circles)?

 

Thanks


A

Views: 3405

Attachments:

Replies to This Discussion

Method 1.

Use the Random Reduce component.

 

Method 2.

If you have N circles, generate N random numbers between zero and one, then use the Smaller Than (or Larger Than) component to compare these values to a constant (say 0.5). This will give you a list of Booleans (True = random value is smaller than threshold, False = random value is larger than threshold) which you can then use to Cull your list of circles.

This method does not guarantee an exact number of remaining items. It is however quite easy to 'add' local properties to the culling. You could make sure that circles near a curve get randomly deleted somewhat less often than those far away from example.

 

Method 3.

Jitter you list of circles (using full strength jittering), then split the jittered list at a given index. This method does give you exact control over how many items you end up with, but it will screw with the order of items.

 

Method 4.

Generate a list of indices (0, 1, 2, 3, 5, ..., N-2, N-1), jitter this list, split it, then sort it again and use the integers to extract circles from your original list. Better than Method 3 as it retains list order.

 

I'm sure there are many, many other methods.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Some of what David says above, with pictures:

 

http://www.grasshopper3d.com/forum/topics/random-component-1

Only one suggestion: be carefull with seeds numbers...if you have more than one path in your data tree. You will need the same number of seeds and Paths (and put that numbers in paths ----> In some cases Graft could help) to make a really random stuff.

 

Best Regards.

finally working...thanks for all your comments

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service