Created
March 11, 2017 04:15
-
-
Save creationix/324f2d3cb43968dc3af09974cb853987 to your computer and use it in GitHub Desktop.
hex coop with pointed roof
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module timber(l=8*12) { | |
linear_extrude(l) | |
polygon([ | |
[.5,0],[3,0], | |
[3.5,1.75], | |
[3,3.5],[.5,3.5], | |
[0,1.75]]); | |
} | |
module timberr(x,y,z,r,o) { | |
rotate([0,0,r-90]) | |
translate([x,y+o,z]) | |
rotate([90,0,0]) | |
timber(y * 2); | |
} | |
module poler(x,y,z,r,o) { | |
rotate([0,0,r-90]) | |
translate([x,-y+o,z]) | |
#cube([5.5,y*2,3.5]); | |
} | |
// Walls | |
for(i=[-1:22]) { | |
for (j=[0:5]) { | |
x=8*12; | |
z=i*3.5; | |
r=j*60; | |
// base of treated 4x6 boards | |
if (i < 0) { | |
y=4*12+10.5; | |
o=0; | |
poler(x,y,z,r,o); | |
} | |
// Main walls | |
else if (i > 20 || j > 0) { | |
y=4*12; | |
o=((i%2)*2-1)*12; | |
timberr(x,y,z,r,o); | |
if (i < 10 || j == 0 && i > 20) { | |
timberr(x,9,z,r,((i%2)*2-1)*-45); | |
} | |
} | |
// Wall around door | |
else { | |
y=(i%2)*3+14.25; | |
o=(i%2)*3+39.75; | |
timberr(x,y,z,r,o); | |
y2=((i+1)%2)*3+14.25; | |
o2=((i+1)%2)*3+39.75; | |
timberr(x,y2,z,r,-o2); | |
} | |
} | |
} | |
// Door | |
translate([-2*12,-8*12-3.5,0]) { | |
// doorway studs | |
translate([-1.5,0,0]) | |
cube([1.5,5.5,6*12]); | |
translate([4*12,0,0]) | |
cube([1.5,5.5,6*12]); | |
// doorway top | |
translate([-1.5,0,6*12]) | |
cube([4*12+3,5.5,1.5]); | |
// door vertical | |
translate([.25,1.5,.25]) | |
cube([5.5,1.5,6*12-.5]); | |
translate([4*12-5.5-.25,1.5,.25]) | |
cube([5.5,1.5,6*12-.5]); | |
for(i=[1:10]) { | |
translate([i*3.65+2.25,1.5,.25]) | |
#cube([3.5,.75,3*12-2]); | |
} | |
// door horizontal | |
translate([.25,0,.5]) | |
cube([4*12-.5,1.5,5.5]); | |
translate([.25,0,6*12-5.5-.5]) | |
cube([4*12-.5,1.5,5.5]); | |
translate([.25,0,3*12-3]) | |
cube([4*12-.5,1.5,5.5]); | |
// door screen | |
translate([5.5+.25,1.5,3*12-3]) | |
%cube([3*12+1,.1,3*12+2]); | |
} | |
// Roof | |
module rooftri(r=12*12, a=29) { | |
for (i=[24:24:r]) { | |
translate([-i*sin(a),cos(a)*i-1.5,0]) | |
cube([i*sin(a)*2,1.5,5.5]); | |
} | |
rotate([0,0,90-a]) | |
cube([r,1.5,5.5]); | |
rotate([0,0,90+a]) | |
translate([0,-1.5,0]) | |
cube([r,1.5,5.5]); | |
translate([0,0,5.5]) | |
%polygon([ | |
[0,0], | |
[sin(a)*r,cos(a)*r], | |
[sin(-a)*r,cos(a)*r]]); | |
} | |
translate([0,0,23*3.5+28]) { | |
for (i=[0:5]) | |
rotate([-16,0,i*60]) | |
rooftri(); | |
} |
Author
creationix
commented
Mar 11, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment