local variations of the density of a random point distribution

Hi everybody!

Sorry to bother you with such a simple issue, but I can't figure out how to create a random distribution of points which local density would be based on some sort of "mapping"...

For example:

I wish to populate a rectangle with some random points, but I need them to be more dense at the base of the rectangle and then linearly getting more and more sparse towards the top.

This is how I worked it around:

1) first I have created a triangular prism,

2) then I've populated its volume with some random points

3) and finally I've projected them on the plane I'm wishing to populate.

But I don't really like the final result since the points are not as nicely spaced as if they were produced by the "Populate 2d" command. They look kind of "clumpy":

Do you have any better idea?

The best thing would be to be able to put a grayscale bitmap underneath and use it as a "density map"...

Here you have the .gh file I made:

prism.gh

Thank you very very much for the help! :)

 

By the way:

While I was preparing my 3d random distribution of points I've spotted a weird behaviour of the random command:

Even if the seeds are all different, for some values of them the points still belong to some common planes...

To solve that I had to jitter the output of one of the Random components.

I suppose this is a weakness of the pseudorandom generator implemented in the random component, isn't it?

  • up

    David Rutten

    The non-randomness of the pseudo-random numbers has been remarked upon. I might implement a random generator that performs better than the standard one at some point, not sure.

    As for your points, it will be very difficult to not have them clump together. I think the best approach would be to create a full density distribution using the Populate components and then remove points from this set. I attached a file which show-cases three ways of removing points from a collection. It may give you some hints as to an approach that does what you want.

    Another approach would be to unclump your points once you've made them. Delaunay meshing + smoothing would be a good way and I think the Kangaroo plug-in offers a whole range of exciting options.

    --

    David Rutten

    david@mcneel.com

    Poprad, Slovakia

    7