Grasshopper

algorithmic modeling for Rhino

Populate geometry with single point through iterations (Anemone) produces a pattern instead of randomness

Hello forum,

I don't even know where to begin. 

In short, randomly populating a vast area (rectangle facade) with random rectangles turned out to be not so "random":

The definition works through a number of premade ("random") rectangles, picks one and places it randomly somewhere on the plane (checks the inclusion, intersection and stuff).

The loop definition was modified for the needs of this project, but originals were kindly shared here and here.

Immediately one can notice a pattern in the placing of the shapes. I'm curious to know if that is due to algorithm that component was written with (a rather rhetorical question))) and how it works through the large number of continuous seeds (1, 2, 3, ..., 2000). Is there a way to tweak it to generate "kinda sorta" something that could have looked like "randomness"?

Views: 1369

Replies to This Discussion

The seed is made with the iteration's counter.

Seems to work, perhaps you should upload your modified script for inspection.

Could it be that because the initial points seem to have a pattern the algorithm will tend to place certain size rectangles at certain points because of the way it checks inclusion, intersection etc.?

i.e. it is randomly placing the rectangles but after the inclusion / intersection rules have been applied it will more likely leave certain sized rectangles in certain places so the pattern of the initial points is reflected in the final placements.

If that makes sense?

No, it is really a stupid algorithm:

 iteration i  : seed = i+S (S=slider) ;

                  PopGeo(seed, boundary) -> point p

                  choose randomly (seed) one of the objects to pack, generate rotated and scaled versions at p, check which ones fit ok, keep the first one;

Repeat

Hi Systemiq,

Thanks for sharing the packing example back then, it really helped me grasp the looping components (although I prefer anemone in the end for its accurateness with the wires, you will see in the attached file))) 

Could you please show the centroids of the rectangles (without the rectangles), at first glance rectangles seem to be placed randomly, however pattern seeking brain can kinda spot that some of them are being placed in diagonal fashion. Again, it may be that I'm just seeing things.

I would also like to ask you about these bad guys (while I have a chance)))

I can't quite get what are they doing there? The definition seems fine without them but I'm clearly missing something here.

P.S. I've placed a piece of definition under the question, it should work just fine.

Attachments:

You forgot to take the preexisting population of points into account, in the PoPGeo component. (Thats what the D1 in anemone is made for).

 The bad guys are probably just old stuff i forgot to remove when i adapted the code from hoopsnake to anemone, or unnecessary intialization check/debug.

I love you man,

Yes, indeed, somewhere in the process I unplugged it and completely forgot about it, thanks for pointing this out. 

Now I kinda understand why it was patterned when it didn't know about the pre-existing points.

This is for someone who is new to this:

Hi there Martyn,

I get your point, but, ah, I wish I had that awesome tool for making GIFs just from your screen, it would have been so much easier.

The thing is that they start out with plenty of space around and never intersect, it is when the area is filled it starts to check stuff. But from the beginning you clearly see how definition kinda jumps randomly around but with all these rectangles being place (like a history) you notice the pattern.

Oh, you mean it does the same thing every time? It always will unless you run it with a different set of random seeds. So, for example if you make the seeds equal to the Anenome counter + a parameter you change at the start of the run then each run will be different. If the random seeds are always the same each run then the results will always be the same!

Hey Martyn,

Yes, I know, this is why, if I'm not mistaken, David called it "pseudo random" somewhere on the forum. 

However fiddling with the seed count locally won't change the picture globally, the filling of the area will still obey the pattern.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2020   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service