How to fill a box with 3d modules filled inside it randomly?

this is the module which is to be filled inside the box
module.3dm (34.9 KB)

this is how it is filled.

how to script this in grasshopper??

Looks like aggregation to me. Checkout Fox and Wasp plugins from Food for Rhino.

1 Like

You mean recursion I guess:

That said the C# pictured yields ccx free rods but DOES NOT check for structural stability (i.e. you should “glue” the rods manually … meaning that is purely a recursion abstract tutorial [and a very tricky one with regard elapsed time if each rod yields more than one child per loop per previous rod]).

See here: 130K Method calls for 700 rods (ccx free check is very expensive)