Grasshopper

algorithmic modeling for Rhino

Hi

Can anyone help me with generating quasi random numbers? Or with generating random numbers that are in some way weighted?

I am trying to generate a series of points within a fixed domain with random co-ordinates, but such that it is 'weighted' towards an even spacing.

Please refer to the diagrams half way down the page in the link below

http://www.mathworks.com/help/stats/generating-quasi-random-numbers...

- I have something similar to the 'uniform random scatter' (blue dots) and I want something similar to the 'quasi random scatter' (red dots)

Thank you

Alex

Views: 2761

Attachments:

Replies to This Discussion

The Populate2D component outputs distributed values. But it's 2D only. There's also a Populate3D but no Populate1D. If you want random numbers that are well spaced along the numberline, there are some approaches you can take:

  1. Generate equally spaced numbers (Series or Range components), then pertubate each number using a random amount.
  2. Recursively subdivide a numeric domain into smaller domains, taking care never to split a domain too close near the ends. By always subdividing the longest domain first, instead of subdividing all domains equally often, you can get to an exact number count.

Here is an example of just the regular Populate2d, and also a chunk of a example given here by David Stasiuk... There is a slider where you can control the range of movement out of the starting grid. this example doesn't account for what David Rutten refers to in 2. above. Maybe if I have time later I will try that out.

There is also a overview of the current Random generator issues in GH found here

Attachments:

Here's a c# script doing what's explained in bullet item #2.

A third approach is to generate a random sequence, then smooth it out.

Attachments:

And that third approach can be done with Blur Numbers

Attachments:

Hi David and AB

Thanks so much for all the responses, apologies for getting back so slowly

I'll let you know how it goes!

Alex

for distributing numbers in a domain I prefer to use another method instead of blurring number, because in blurring number we need iteration in to approach a more equal division set , we just need to get progressive addition of set of random number and remap it to assumed interval, that i can share its code if you want but now embed this code in Careless-range component as I decried Here  ;

but in case of point generating there are a lots of methods for different purposes.

the image bellow show three different way to approach different random points.

and the result would be like this :

Attachments:

I try to explain the logic of Careless-range code by definition

Here are few ways 2 control density. which will also show up as attractors in case of voronoi and Quadtree.

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