Random selection of cells in a grid, how to adjust weight of each group

using only GH components (no scripting) I would approach it like this:


Random tiling_1.gh (21.3 KB)

the gene pool allows you to weight the different cell groups

consider that the A part of definition is sort of bad :slight_smile:
somehow when doubles are transformed into integers and some rounding happens, we need to find a culprit to make the final total number of cells to be = to the total number we have generated

in this case the culprit is item at index 0, that gets recalculated as (total number of cells) - (sum of all the other used cells)… there for sure will be smarter methods, this was the fastest shortcut I could think about

this slider allows you to shuffle the cells differently:

B is probably the only thing that matters: it outputs a tree with 10 branches, each branch containing the cells that belong to each different group

1 Like