I have created the attached grasshopper graph that creates a stack of bricks kind of like a chimney.
I am using this simple concept to practice my grasshopper skills in the arena of patterns and repetition. Brick,Chimney_v1.gh (91.4 KB)
I have sliders for the number of brick courses and dimensions etc.
The screenshot example shows 440 bricks and on my laptop this took approx 6.0 seconds to compute the graph. . . t u m b l e w e e d
The graph creates a pattern of bricks for a single course (vertical layer) and alternates the brick pattern for odd and even courses.
This computation is multiplied by number of courses via a āseriesā component that turfs out an integer (1-10) for each course of brickwork in my example.
Is there some way that I could only compute the first course and the second course (alternate brick pattern) once each ā and then reuse those results but shifted up to the correct elevation to create layers 3-10 ??
Any advice on this would be appreciated.
regards
dan
HeHeHe - thatās cheating !! Itās good though - iām keeping it
And I appreciate such a quick helpful tip.
Using a faster boolean difference component sure helps but I still have the scalability performance problem that is what I am really interested in understanding how to solve. Even using that much faster component if I double the brick stack to 20 courses its gonna chug.
Iād like to think grasshopper has a strategy for this type of thing that I could be pointed to read up on.
Your code seems to work without those plugins? I see a MASSIVE cluster used four times that has two SDiff components inside. Iāve done many brick models in GH and never used SDiff. Search the forum, many people have done bricks.
the missing plugins are indeed only cosmetic. They keep the canvas less cluttered.
I think you might be right that it is the SDiff component that is performed for every line of bricks x 4 sides x the 10 courses. I havenāt yet investigated the example you attached but I notice from the image that every brick appears full length - hence no trimming required and it is fast.
So on point 2 I am ultimately interpreting your advice to be : āavoid SDiff componentā as much as possible. So in my case where I am currently trimming a rounded up line of bricks where it extends beyond the desired length I could change this to calculate a bespoke small brick that completes the line without any use of SDiff.
Although the above would be an acceptable solution in this example it doesnāt really shed any light on the scalability performance issue that I am curious about ā in other words sometimes in life there WILL be an unavoidable expensive computation in a grasshopper script - how do we ācacheā and reuse that result n times without re-computing it n times?
generally speaking, any solid boolean operation might consume A LOT of time, so itās very good practice to use them only if they are truly needed
I didnāt check your file yet -but I will in the coming hours/this weekend- but I just wanted to point out that in a situation where you are dealing with bricks (aka āperfect boxesā, perfect vertical extrusions of a contour curve) most of the times you can treat them as 2D curves in a 3D space, and extrude them to the final brick height only as the very very very last step
on this matter, as bricks are basically polylines, and you might need to deal with planar curve boolean operations in certain cases, I very much advocate for installing the plugin Clipper or Clipper2 (I think they are both available with PackageManager, for sure you can find both on food4rhino) which allows for -even super complex- polyline booleans in a matter of milliseconds
when dealing with bricks, the most time consuming component in your canvas should be the final extrusion to transform 2D brick-curve-contours into real 3D bricks
Yes. In addition to the 2D approach discussed by @inno, you can split and cap breps with relatively low overhead compared to SDiff, especially bricks. I donāt think Iāve ever tried to āturn cornersā on a row of bricks. Ideally a full brick turned 90 degrees is the same (or better) than a half brick because it ties together around corners. I didnāt look closely at your code.