Hello, I am trying to create a script for a brick wall in Grasshopper that spaces the bricks according to an attractor curve.
Here is a link to an image of an example of the brick spacing: http://ogawa-studio.com/ogawa/wp-content/uploads/kit_house.jpg
Though that example has very regular spacing, I was hoping an attractor curve could create a more interesting pattern.
Assuming I use a standard brick length of 8", the spacing could range from 1" to 7" based on each brick’s distance from the curve.
Any idea how I can go about doing this?
Thanks!
It’s tricky because it’s a cumulative property. It’s easy enough to lay out a brick pattern where the gaps follow a preset sequence of widths, but it’s a lot harder to lay out the pattern such that the gap in any given location has a specific width. Gap width along the left edge of the pattern will affect where the bricks are in the middle and right of the pattern and vice versa.
In order to figure out the width of a gap next to brick i
, you need to know the cumulative width of all the bricks+gaps that came before. This sort of algorithm is difficult to implement in Grasshopper, because it involves growing a sequence based on the current sum-total of that sequence.
Of course if your gap widths are the result of a neat mathematical equation, you may be able to use the integral of that function to compute the exact positioning of each brick without first solving all previous bricks. However it is unlikely that an attractor field based on several points will yield a such a neat equation.
There are variations that may be easier to implement, but will not give the same result. For example you could choose to space all bricks equally, but move them slightly left or right depending on the local conditions.
There is of course also the problem that if each row of bricks has variable gap-widths, then two adjacent rows may no longer stack properly. In fact bricks and gaps may end up being (nearly) identical, which would (a) look weird and (b) not be structural. This is an issue you’ll have to deal with in any case.
So here is a quick script that does something you may be interested in. You’ll have to set up additional rules about minimum gap and maximum gap for my script to work the way you want. You can see in screenshot that some of the “bricks” don’t stack on each other.
What David says is very true. I’m avoiding any recursive or cumulative scripting but it may be the best way.
fromCrv.gh (15.3 KB)
Hi David, thanks for your response. I see the issue with using an attractor curve. You said it’s easy enough to lay out a brick pattern where the bricks follow a preset sequence of widths, but I’m having trouble figuring out how to even do that without scaling the bricks, which I don’t want to do. So how would I create gaps in the way you’re suggesting?
You first combine each brick with the adjacent gap size, then you use [Mass Addition] on that list of numbers. The partial output of that component will give you the positions of each brick, although you will have to prepend a zero to that partial list.
bricks.gh (15.3 KB)
what mass addition does? in what kind of data could be applied? sorry for this noob question
Mass addition adds together all the values in a list. It returns both the sum-total and the partial results.
So for example if you have a list of numbers (3,7,2,6,5)
, the sum-total is 3+7+2+6+5=23
, and the partial results will be (3, 10, 12, 18, 23)
because (3, 3+7, 3+7+2, 3+7+2+6, 3+7+2+6+5)
.
Mass addition also works for other data types, you can for example add a list of vectors as well.