Skip to content

Instantly share code, notes, and snippets.

@creationix
Last active August 1, 2020 18:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save creationix/7a8f43a6ffd8fb62227115aa84766105 to your computer and use it in GitHub Desktop.
Save creationix/7a8f43a6ffd8fb62227115aa84766105 to your computer and use it in GitHub Desktop.
w = 3;
h = 4;
thick=19/32; // Thickness of plywood.
lift = 4+1/32;
//lift = height-(h+1)*thick-h*vspace;
width = 12*w; // outer width of shelves
hspace = (width-(thick*(w+1)))/w;
vspace = 12;
height = lift + thick*(h+1)+vspace*h; // outer height of shelves.
deep = 19.5; // depth of shelves
echo("All boards thickness", thick);
echo("sides x 2", height, deep);
echo("lifts x 2", width - thick * 2, lift);
echo("top", width , deep);
echo("shelves x", h, width-thick*2,deep);
echo("verticals x", h * (w-1), vspace, deep);
echo("Total boards", 2 + 2 + 1 + h + h * (w-1));
// Top
translate([0,0,height-thick])
cube([width,deep,thick]);
// Left
cube([thick,deep,height-thick]);
// Right
translate([width-thick,0,0])
cube([thick,deep,height-thick]);
for(y=[1:1:h]) {
// Floors
translate([thick,0,height-thick-(vspace+thick)*y])
cube([width-thick*2,deep,thick]);
// Vertical spacers
for(x=[1:1:w-1]) {
translate([thick+hspace*x,0,height-(vspace+thick)*y])
cube([19/32,deep,12]);
}
}
translate([thick,deep-thick,0])
cube([width-thick*2,thick,lift]);
translate([thick,0,0])
cube([width-thick*2,thick,lift]);
@creationix
Copy link
Author

creationix commented Aug 1, 2020

image

ECHO: "All boards thickness", 0.59375
ECHO: "sides x 2", 55, 19.5
ECHO: "lifts x 2", 34.8125, 4.03125
ECHO: "top", 36, 19.5
ECHO: "shelves x", 4, 34.8125, 19.5
ECHO: "verticals x", 8, 12, 19.5
ECHO: "Total boards", 17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment