Stacking units to the form similar to the input mass

Hello guys :slight_smile:

I’m a student in architecture major and have lots of interest in grasshopper.

Now I want to make an optimization process that stacks a unit(I’ll attach the photo).

What I’m thinking about is that if I input a mass, then the code stacks a units to the form similar to the input mass.

My unit looks like as the photo attached, and I’ll also attach a grasshopper code(compatible with Rhino 7) describing my unit.

Can anyone give me some clues for realizing this idea or some references for this one?

Thank so soooo much in advance :blush:

Screenshot_4

Screenshot_5
unit.gh (13.3 KB)