Aggregation of modules

Hello everyone! I’m fairly new to Grasshopper, so I could use some help to solve a problem with my project.

I have a tower composed of lots of modules of the same dimensions. On the longest facade (where I’ve got orange modules in the file) I need to put 3 types of module’s aggregations: one with 3 modules, one with 5 modules and one with a single module. These aggregations can be random, meaning that I don’t care how the 3 and 5 modules aggregate, the important thing is that they aggregate in groups of 3 and 5 (and a single one).

I also need a random aggregation between the groups to create a random facade (it seems a sort of Tetris game), but if it’s possible I’d need to control the percentage of the groups on the facade (e.g. 50% for the groups of 3, 40% for the groups of 5 and 10% for the single ones).

I’ve attached the .gh file and a picture to explain the facade aggregations. Thanks so much to all of you who will help me! (23.0 KB)

Well … the “general” case for what you are after is exposed here (minus the motion part - or at least controlled via some user option):

Is - more or less - easy to wrire a “simplified” C# on that matter … but if you are not familiar with coding I doupt that such a “black box” could be usefull for you: for instance managing the interactive placemnt part, creating alternative new rules for the placement, void cells control (vacancy), definition of “module” combo options etc etc.

BTW: A poor man’s Plan B could be creating rnd panels/Rectangles (via a user controlled vacancy per BrepFace) and then check, sample and discard the combos that are not included in your module definition (i.e. mini Matrices sampled in a Matrix List in fact). For instance start from a state like this:

… and then pick the desired combos.

Thank you. So, you think is there no way to just divide my modules into 3 groups of 1, 3 and 5 modules and then aggregate them randomly in my tower?

Think a 5*5 Matrix (Or a bool [ , ] occupied = new bool [5,5] [that has false by default all the items]) .

Your 5 modules thingy has a lot of possible definitions (even if you focus to just one for the moment). So the whole tetris like puzzle is a bit more complex than it appears on first sight.

If you could read the code in the above link you would be able to understand the reason. Plus … what are you going to do if you deal with BrepFaces? (trimmed stuff + holes).

Anyway I work solely via code (C#) and thus I’m not the right person to think/suggest a possible(?) solution(?) using some other way (i.e native components or some sort of add-on done by someone).

Thank you so much anyway!

Anyway - just for the record - this is a very simple implementation:

But still is a freaky black box to you (maybe a good push to walk the right walk?)