Grasshopper

algorithmic modeling for Rhino

Hi everybody.

I am pretty new to Grasshopper, and i made a simple definition using random reduce and Lunchbox plugin to create a perforated brick wall.

What i would like to do now is tell grasshopper to not "remove" to adjacent items in my list of surfaces, at list until i reach a certain reduction number. Do you think it's possible? How would you approach the problem?

The goal of my definition is to abtain something like the picture below 

Thank you very much in advance

Views: 2531

Replies to This Discussion

It will be tricky to both hit an exact reduction count and prevent adjacent elements from being removed, but there are ways. Is your adjacency test two dimensional, or are you only looking at horizontal pairs?

Here are two possibilities that spring to mind:

  1. For the horizontal case only: generate a list of random numbers (integers only, ranging from a minimum of 2 to a maximum of whatever you want the longest sequence of non-removed blocks to be. Let's assume this list of random numbers looks like [2,5,3,7,2,2,4,3,...]. You then use the mass addition component to compute the partial sums, giving you [2,7,10,17,19,21,25,28,...]. These will become your culling indices, and you're guaranteed that no two of them will be adjacent numbers. You will have to make sure that the list of partial sums contains no numbers that are higher than or equal to the number of bricks in your wall. You can also random reduce this list of partial sums to achieve an exact amount of bricks to remove, assuming the number of indices is in fact larger than your removal target.
  2. For the two dimensional case: generate a point in the middle of each brick. Random reduce this collection of points somewhat. Then use the cull duplicates components to remove points that are too close together, using the 'Leave One' option. Then random reduce the resulting list of points again until you hit your target count and finally remove all bricks that contain one of the remaining points.

Does either of these approaches sound like a good idea to you?

Sounds great! Thank you. i Tried the 2 dimensional method and it seems to work very well! 

Only... i don't know how to remove the bricks that contain a point from the wall... Is there an easy system to do that too? 

Thank you again :)

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service