Skip to content

Instantly share code, notes, and snippets.

@kernelp4nic
Forked from creationix/shed.scad
Created May 3, 2021 20:57
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 kernelp4nic/7b3f1f076fb1f3ead72182a872269a9a to your computer and use it in GitHub Desktop.
Save kernelp4nic/7b3f1f076fb1f3ead72182a872269a9a to your computer and use it in GitHub Desktop.
Shed design. Open in OpenScad to view 3d model.
windows = false; // show windows
stuff = false; // Show bikes, table, mower
l = 32; // Length of building in feet (16, 20, 24, 28, 32, ...)
h = 8*12-4.5+.5;
rl=6*12+1.375+.1; // cut to 73.5" long with 22.5 degree angles
tl = 68.7; // Used to tweak headers on top walls
// 2x6 concrete forms for foundation
// 10" wide grid
// rebarb reinforced. 3/8
module Foundation() {
color([.9,.9,.9]) {
cube([16*12,l*12,12]);
}
}
module FloorRafters(ll) {
color([.95,.8,.6]) {
translate([0, 0, 0])
cube([16*12, 1.5, 9.5]);
for (i = [1:ll*12/24-1]) {
translate([1.5, 24 * i - .75, 0])
cube([16*12-3, 1.5, 9.5]);
}
translate([0, ll*12-1.5, 0])
cube([16*12, 1.5, 9.5]);
translate([0, 1.5, 0])
cube([1.5, ll*12-3, 9.5]);
translate([16*12-1.5,1.5,0])
cube([1.5,ll*12-3,9.5]);
}
};
module LowerSubfloor() color([.9, .8, .7]) {
for (x = [0:4:16-4]) {
for (y = [0:8:l-8]) {
if (x % 8 == 0) {
translate([x*12,y*12,0])
cube([4*12, 8*12, .703]);
}
else {
if (y <= l - 12) {
translate([x*12,(y+4)*12,0])
cube([4*12, 8*12, .703]);
}
else {
translate([x*12,(y+4)*12,0])
cube([4*12, 4*12, .703]);
translate([x*12,0,0])
cube([4*12, 4*12, .703]);
}
}
}
}
}
module UpperSubFloor() color([.9, .8, .7]) {
for (x = [0:4:16-4]) {
for (y = [0:8:l-8]) {
difference() {
if (x % 8 == 0) {
translate([x*12,y*12,0])
cube([4*12, 8*12, .703]);
}
else {
if (y <= l - 12) {
translate([x*12,(y+4)*12,0])
cube([4*12, 8*12, .703]);
}
else {
translate([x*12,(y+4)*12,0])
cube([4*12, 4*12, .703]);
translate([x*12,0,0])
cube([4*12, 4*12, .703]);
}
}
translate([5.5,5.5,-.01]) {
cube([119.5-11.5,48,3]);
cube([48,113.75,3]);
}
}
}
}
}
module SideWall(w, ll, ac, e) {
// Window
if (windows && w) %translate([-1, w*24+.75+1.5, 34+12])
cube([5, 36, 36]);
// Air conditioner.
if (windows && ac) %translate([-1, ac*24+.75+1.5, 64])
cube([23, 23+7/8, 18]);
// Bottom Plate
cube([5.5,ll*12,1.5]);
// Top Double Plate
translate([0, 0, h+1.5])
cube([5.5, ll*12, 1.5]);
if (e) {
translate([0, 5.5, h+3])
cube([5.5, ll*12, 1.5]);
}
else {
translate([0, 5.5, h + 3])
cube([5.5, ll*12-11, 1.5]);
}
// Studs
translate([0,0,1.5])
cube([5.5, 1.5, h]);
if (e) translate([0,5.5,1.5])
cube([5.5, 1.5, h]);
if (w) {
if (w >= 1) for (i = [1:w]) {
if (i != ac + 1)
translate([0,24*i-.75,1.5])
cube([5.5, 1.5, h]);
}
translate([0, w*24, 0])
lowerWindow();
if (ll*12/24-1 >= w + 2) for (i = [w+2:ll*12/24-1]) {
if (i != ac)
translate([0,i*24-.75,1.5])
cube([5.5, 1.5, h]);
}
}
else for (i = [1:ll*12/24-1]) {
if (i!= ac + 1)
translate([0,24*i-.75,1.5])
cube([5.5, 1.5, h]);
}
if (ac) translate([0, ac*24, 0])
ac();
// Corner studs
translate([0,ll*12-1.5, 1.5])
cube([5.5, 1.5, h]);
if (!e) translate([0,ll*12-7, 1.5])
cube([5.5, 1.5, h]);
}
module UpperFloor() color([.95,.8,.6]) {
// First
cube([16*12, 1.5, 9.5]);
// Short
for (i = [1:2]) {
translate([126.5, 24 * i - .75, 0])
cube([64, 1.5, 9.5]);
}
// Medium
for (i = [3:4]) {
translate([55, 24 * i - .75, 0])
cube([135.5, 1.5, 9.5]);
}
// Full width
for (i = [5:7]) {
translate([1.5, 24 * i - .75, 0])
cube([16*12-3, 1.5, 9.5]);
}
// Last
translate([0, 16*12-1.5, 0])
cube([16*12, 1.5, 9.5]);
translate([5.5+48,53.5, 0]) // Medium cap
cube([1.5, 41.75+24, 9.5]);
translate([55,55-1.5, 0]) // med-to-small
cube([70.25, 1.5, 9.5]);
translate([125,1.5, 0]) // small cap
cube([1.5, 69.75, 9.5]);
translate([5.5,4, 0])
cube([119.75, 1.5, 9.5]);
translate([4, 1.5, 0])
cube([1.5, 93.75+24, 9.5]);
// Edges
translate([0,1.5, 0])
cube([1.5, 16*12-3, 9.5]);
translate([12*16-1.5,1.5, 0])
cube([1.5, 16*12-3, 9.5]);
}
module Back() {
// Bottom Plate
translate([5.5,0,0])
cube([16*12-11,5.5,1.5]);
// Back Wall
translate([5.5,0,1.5])
cube([1.5, 5.5, h]);
for (i = [1:7]) {
translate([24*i-.75,0,1.5])
cube([1.5, 5.5, h]);
}
translate([16*12-5.5-1.5,0,1.5])
cube([1.5, 5.5, h]);
// Top double plate
translate([5.5,0,h + 1.5])
cube([16*12-11,5.5,1.5]);
translate([0,0,h + 3])
cube([16*12,5.5,1.5]);
}
module lowerWindow() {
translate([0,.75,1.5]) // Jack Stud
cube([5.5, 1.5, 80.5]);
translate([0,.75,82]) // Header 0
cube([5.5, 36+3, 1.5]);
translate([0,.75,83.5]) // Header 1
cube([5.5, 36+3, 1.5]);
translate([0,2.25,32.5+12]) // Sill
cube([5.5, 36, 1.5]);
translate([0,24-.75,85]) // Upper Cripple
cube([5.5, 1.5, h-83.5]);
translate([0,24-.75,1.5]) // Lower Cripple
cube([5.5, 1.5, 34-3+12]);
translate([0,36+2.25,1.5]) // Jack Stud
cube([5.5, 1.5, 80.5]);
translate([0,36++3.75,1.5]) // King Stud
cube([5.5, 1.5, h]);
}
module ac() {
translate([0,.75,1.5]) // Jack Stud
cube([5.5, 1.5, 80.5]);
translate([0,.75,82]) // Header 0
cube([5.5, 23+7/8+3, 1.5]);
translate([0,.75,83.5]) // Header 0
cube([5.5, 23+7/8+3, 1.5]);
translate([0,2.25,62.5]) // Sill
cube([5.5, 23+7/8, 1.5]);
translate([0,24-.75,85]) // Upper Cripple
cube([5.5, 1.5, h-83.5]);
translate([0,24-.75,1.5]) // Lower Cripple
cube([5.5, 1.5, 61]);
translate([0,23+7/8+.75+1.5,1.5]) // Jack Stud
cube([5.5, 1.5, 80.5]);
translate([0,23+7/8+.75+3,1.5]) // King Stud
cube([5.5, 1.5, h]);
}
module Front() {
// Big Door
if (windows) %translate([58.5,-1,0])
cube([75,7,83.5]);
// Bottom Plate
translate([5.5,0,0])
cube([60-5.5-1.5,5.5,1.5]);
translate([133.5,0,0])
cube([60-5.5-1.5,5.5,1.5]);
// Studs and Frames
translate([5.5,0,1.5])
cube([1.5, 5.5, h]);
translate([24-.75,0,1.5])
cube([1.5, 5.5, h]);
translate([48-.75,0,1.5])
cube([1.5, 5.5, h]);
translate([60-4.5,0,1.5]) // King Stud
cube([1.5, 5.5, h]);
translate([60-3,0,1.5]) // Jack Stud
cube([1.5, 5.5, 82]);
translate([60-3,0, 83.5]) // header 0
cube([78, 5.5, 1.5]);
translate([60-3,0, 85]) // header 1
cube([78, 5.5, 1.5]);
for (i = [3:5]) { // Cripples
translate([24*i-.75,0, 90.5-4])
cube([1.5, 5.5, h-89+4]);
}
translate([133.5,0,1.5]) // Jack Stud
cube([1.5, 5.5, 82]);
translate([132+3,0,1.5]) // King Stud
cube([1.5, 5.5, h]);
translate([144-.75,0,1.5])
cube([1.5, 5.5, h]);
translate([168-.75,0,1.5])
cube([1.5, 5.5, h]);
translate([192-7,0,1.5])
cube([1.5, 5.5, h]);
// Top Double Plate
translate([5.5, 0, h + 1.5])
cube([181,5.5,1.5]);
translate([0, 0, h + 3])
cube([192,5.5,1.5]);
}
module TopWall() {
if (windows) %translate([72,-1,24])
cube([48,5,48]);
// Base plate
translate([5.5,0,0])
cube([16*12-11,5.5,1.5]);
// Top Plate
t = .5;
s = 5.7;
translate([s, 0, t])
rotate([0,22.5,0])
cube([1.5,5.5,tl]);
translate([s + sin(22.5)*tl, 0, t+cos(22.5)*tl])
rotate([0,67.5,0])
cube([1.5,5.5,tl]);
translate([16*12,0,0]) mirror([1,0,0]) {
translate([s, 0, t])
rotate([0,22.5,0])
cube([1.5,5.5,tl]);
translate([s + sin(22.5)*tl, 0, t+cos(22.5)*tl])
rotate([0,67.5,0])
cube([1.5,5.5,tl]);
}
translate([24-.75,0, 1.5])
cube([1.5, 5.5, 8*12]);
translate([48-.75,0, 1.5])
cube([1.5, 5.5, 8*12]);
translate([72-3,0, 1.5]) // King Stud
cube([1.5, 5.5, 8*12]);
translate([72-1.5,0, 1.5]) // Jack Stud
cube([1.5, 5.5, 6*12-1.5]);
translate([72-1.5,0, 73.5]) // Header 1
cube([48+3, 5.5, 1.5]);
translate([72-1.5,0, 72]) // Header 2
cube([48+3, 5.5, 1.5]);
translate([72-1.5,0, 22.5]) // Sill 1
cube([48+3, 5.5, 1.5]);
translate([96-.75,0, 75]) // Cripple Top
cube([1.5, 5.5, 2*12]);
translate([96-.75-24,0, 75]) // Cripple Top
cube([1.5, 5.5, 2*12]);
translate([96-.75+24,0, 75]) // Cripple Top
cube([1.5, 5.5, 2*12]);
translate([96-.75,0, 1.5]) // Cripple Bottom
cube([1.5, 5.5, 24-3]);
translate([120,0, 1.5]) // Jack Stud
cube([1.5, 5.5, 6*12-1.5]);
translate([120+1.5,0, 1.5]) // Jack Stud
cube([1.5, 5.5, 8*12]); // King Stud
translate([144-.75,0, 1.5])
cube([1.5, 5.5, 8*12]);
translate([168-.75,0, 1.5])
cube([1.5, 5.5, 8*12]);
}
module Inner() {
// Lower wall
translate([5.5+48, 53.5,0]) // base plate
cube([5.5, 43.25+24, 1.5]);
for (i = [3:5]) {
translate([5.5+48, i*24-.75,1.5])
cube([5.5, 1.5, h]);
}
// Inner ends
translate([5.5+48, 53.5,1.5])
cube([5.5, 1.5, h]);
translate([5.5+48, 59,1.5])
cube([5.5, 1.5, h]);
//top plates
translate([5.5+48, 53.5, h + 1.5])
cube([5.5, 43.25+24, 1.5]);
translate([5.5+48, 59, h + 3])
cube([5.5, 37.75+24, 1.5]);
// Mid wall
translate([59, 53.5,0]) // base plate
cube([67.5, 5.5, 1.5]);
// Top plates
translate([59, 53.5, h + 1.5])
cube([67.5, 5.5, 1.5]);
translate([53.5, 53.5, h + 3])
cube([73, 5.5, 1.5]);
translate([59, 53.5, 1.5]) // inner end
cube([1.5, 5.5, h]);
for (i = [3:5]) {
translate([i*24-.75, 53.5, 1.5])
cube([1.5, 5.5, h]);
translate([125, 53.5, 1.5]) // outer end
cube([1.5, 5.5, h]);
}
}
module Steps() {
for (i = [0:6]) {
translate([0, 10*i-1.5, 7.5*i+6])
cube([48,11.5,1.5]);
translate([0, 10*i-1.5, 7.5*i])
cube([48,1.5,6]);
}
difference() {
translate([.01, -2.85, 3.85])
rotate([-53,0,0])
union() {
cube([1.5,11.5,8*12]);
translate([24-.75,0,0])
cube([1.5,11.5,8*12]);
translate([48-1.5,0,0])
cube([1.5,11.5,8*12]);
}
for (i = [0:6]) {
translate([-1, 10*i-1.51, 7.5*i+6-.01])
cube([50,11.5,10]);
translate([-1, 10*i-10.01, 7.5*i-.01])
cube([50,10,6]);
}
translate([-1, 10*7-.02, 7.5*6-10])
cube([50,30,30]);
translate([-1, -1, -30.0])
cube([50,30,30.01]);
}
}
module Stairs() {
/*
Stairs
rise 105"
run 140"
14 risers (including top floor)
7.5" rise for each
run 10"
headroom opening for all but bottom 2 steps
4' wide (3 stringers at 16" centers, 2"x12"x16')
*/
translate([0,0,1.5]) {
translate([5.5+48,123.5,0])
rotate([0,0,180]) {
translate([0,-1.5,-1.5]) cube([48, 11.5,1.5]);
Steps();
}
translate([5.5,5.5,105/2-9]) {
translate([0,0,0])
cube([60, 1.5, 7.5]);
translate([0,48-1.5,0])
cube([60, 1.5, 7.5]);
translate([1.5,48-.75-24,0])
cube([60-3, 1.5, 7.5]);
translate([0,1.5,0])
cube([1.5, 48-3, 7.5]);
translate([60-1.5,1.5,0])
cube([1.5, 48-3, 7.5]);
for (i = [0:7]) {
translate([7.5*i,0,7.5])
cube([7.5,48,1.5]);
}
}
translate([5.5+48+1.5, 5.5+48, 105/2])
rotate([0,0,-90])
Steps();
}
}
module Top() {
// Walls clipped to rafter shape
r = 8*12-5.5;
intersection() {
translate([8*12,(l+.5) *12,0])
rotate([90,0,0])
cylinder(h=(l+1)*12, r1=r,r2=r,$fn=8);
union() {
TopWall();
translate([0,l*12-3.5,0]) TopWall();
}
}
}
module Rafter() {
translate([0, 0, 0])
rotate([0,22.5,0])
cube([5.5, 1.5, rl]);
translate([sin(22.5)*rl, 0, cos(22.5)*rl])
rotate([0,67.5,0])
cube([5.5, 1.5, rl]);
translate([16*12,0,0]) mirror([1,0,0]) {
translate([0, 0, 0])
rotate([0,22.5,0])
cube([5.5, 1.5, rl]);
translate([sin(22.5)*rl, 0, cos(22.5)*rl])
rotate([0,67.5,0])
cube([5.5, 1.5, rl]);
}
}
module Rafters() {
// Base Plates
cube([5.5,l*12,1.5]);
translate([16*12-5.5,0,0])
cube([5.5,l*12,1.5]);
Rafter();
translate([0, 5.5, 0])
Rafter();
for (i = [1:l*12/24-1]) {
translate([0, 24*i-.75, 0])
Rafter();
}
translate([0, l*12-7, 0])
Rafter();
translate([0, l*12-1.5, 0])
Rafter();
}
module long() {
cube([1.5,16*12,5.5]);
translate([0,16*12,0])
cube([1.5,16*12,5.5]);
}
translate([0,0,-12]) Foundation();
// Lower Walls
translate([16*12-5.5,0,0]) SideWall(false, 16, 3, true);
translate([16*12-5.5,16*12,0]) SideWall(1, 16);
SideWall(5, 16, false, true);
translate([0,16*12,0]) SideWall(false, 16);
Back();
translate([0,l*12-5.5]) Front();
Inner();
Stairs();
translate([0,0,h+4.5]) UpperFloor();
translate([0,16*12,h+4.5]) FloorRafters(l-16);
translate([0,0,h+4.5+9.5]) UpperSubFloor();
translate([0,0,97.125 + 7.5]) {
Top();
Rafters();
RoofSheathing();
}
if (stuff) {
// Lawn Mower
%translate([(16-6)*12,(l-6)*12,1])
cube([5*12,5*12,5*12]);
// Work Table
%translate([11.5*12,7*12,1])
cube([4*12,8*12,3*12]);
// Tim Fat Bike
%translate([5,l*12-30-5,12])
cube([46,30,76]);
// Tim Mission Bike
%translate([5,l*12-56-5,21])
cube([46,25,67]);
// Mir Bike
%translate([5,l*12-82-5,22])
cube([44,25,66]);
// Charlotte Trailer
%translate([5,l*12-101,34])
cube([30, 13, 54]);
// Green Trailer
%translate([5,l*12-125,10])
cube([25,23,38]);
// Green Trailer
%translate([5,l*12-125,50])
cube([25,23,38]);
// Double Trailer
%translate([16*12-5-20,l*12-105,48])
cube([20, 30,40]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment