Parametric Shelf | Cutout

Step 2 in making a parametric shelf was creating a cutout template of all the pieces. I realized very quickly that it would be easier to generate the template with a separate Grasshopper Definition that referenced the input geometry and parameters, rather than trying to dissect the pieces being generated at the end of the "Model" Definition. Before I got into the nitty-gritty of grasshopper, it was really helpful to sketch out a diagram of what I was going to be generating.

Cutout-Layout

It took a few tries to work out the most efficient layout with no waste material and fewest duplicate cuts. With this arrangement I can add as many shelves or dividers as I need just by duplicating the respective dotted box. Then I started scripting in grasshopper:

Shelf Cutout Script

In all honesty,  this script was easier to write than the Model script since it was essentially just numbers. I've also been reading through Grasshopper guides, which probably plays a role. I was also able to add a parameter for a toe-kick, the lifting of the bottom most shelf off of the ground. I decided to make this parameter a drop-down rather than a slider since there are some standard sizes. Below I've paired the two definitions together on one box to show how it all works. I haven't tried updating the Model definition to incorporate the "Kick" input.

Rows
Columns
Thickness
Kick