/* */ include include include include /* [Params] */ platfoot_x = 50.44; platfoot_y = 25.42; platmid_x = 40.12; headpost_x = 38.08; headpost_y = 38.08; footcrossyz = 38.08; headcross_yz = 25.00; footboard_y=19; footboard_z=130; LegOff = 19; LegGap=4; /* [Render Options] */ part=""; // [both, back, head_corner_rear, head_corner_front, foot_corner_front, foot_corner_rear, head_cross_front, foot_cross_front, foot_cross_rear ] model = "none"; // ["none", "corner_leg", "center_leg"] plate = false; mate = false; render_fs=.4; render_fn=0; render_fa=.4; // Set Render Options $fs= ($preview) ? $fs : render_fs; $fn= ($preview) ? $fn : render_fn; $fa= ($preview) ? $fa : render_fa; module platfoot(x=platfoot_x, y=platfoot_y, z=260, align=V_FRONT) { cuboid([x,y,z], align=align); } module footboard(x=100, y=footboard_y, z=footboard_z, align=V_BACK+V_BOTTOM) { cuboid([x,y,z], align=align); } module headpost(x=headpost_x, y=headpost_y, z=260, align=V_FRONT) { cuboid([x,y,z], align=align); } module screw_channel() { //back(19.2)cyl(d=6, h=10, orient=ORIENT_Y,align=V_FRONT); //back(9)cyl(d=3.5, h=100, orient=ORIENT_Y, align=V_FRONT); fwd(80)rotate([-90,0,0])m4s_clear(bl=100); } module head_rear() { difference() { left(19/2+4)back(footboard_y) cuboid([platfoot_x+16+19,headpost_y+footboard_y,95], fillet=3, edges=EDGES_BACK+EDGES_Y_ALL, align=V_FRONT+V_TOP); footboard(); headpost(y=2*headpost_y); left(44)up(95/2)cuboid([50, 150,25]); // crossbar // Screw Holes rx = 5 + headpost_x/2; right(rx)up(95-10) screw_channel(); right(rx)up(95/2) screw_channel(); right(rx)up(10) screw_channel(); left(50)up(95-10) screw_channel(); left(50)up(10) screw_channel(); } fwd(10)up(95/2)right(40-4)rotate([90,0,-45])rotate_extrude(angle=360) left(18) circle(d=10); } module head_front() { blockz=95; difference() { right(19/2-4)cuboid([platfoot_x+16+LegOff,platfoot_y+footboard_y,blockz], fillet=3, edges=EDGES_FRONT+EDGES_Y_ALL, align=V_FRONT+V_TOP); back(.01)platfoot(); // Screw Holes rx= 5 + headpost_x/2; bz = -40; bl = 58 - bz; up(blockz/2)zspread(n=3, l=blockz-20) right(rx+LegOff) rotate([-90,0,0]) rotate([0,0,180]) m4s_clear(bl=bl, bz=bz, drop=true, sh=0); left(30)up(blockz-10) rotate([-90,0,0]) rotate([0,0,180]) m4s_clear(bl=bl, bz=bz, drop=true, sh=0); left(30)up(10) rotate([-90,0,0]) rotate([0,0,180]) m4s_clear(bl=bl, bz=bz, drop=true, sh=0); } } module foot_front() { blockz= footcrossyz + 2*10; // 95; difference() { right(19/2-4)cuboid([platfoot_x+16+LegOff,platfoot_y+footboard_y,blockz], fillet=3, edges=EDGES_FRONT+EDGES_Y_ALL, align=V_FRONT+V_TOP); back(.01)platfoot(); // Screw Holes rx= 5 + headpost_x/2; bz = -40; bl = 58 - bz; up(blockz/2)zspread(n=3, l=blockz-10) right(rx+LegOff) rotate([-90,0,0]) rotate([0,0,180]) m4s_clear(bl=bl, bz=bz, drop=true, sh=0); up(blockz/2)left(30) zspread(n=2, l=blockz-10) rotate([-90,0,0]) rotate([0,0,180]) m4s_clear(bl=bl, bz=bz, drop=true, sh=0); } } module foot_rear() { z = footcrossyz + 2*10; difference() { union() { left(19/2+4)back(footboard_y) cuboid([platfoot_x+16+19,headpost_y+footboard_y, z], fillet=3, edges=EDGES_BACK+EDGES_Y_ALL, align=V_FRONT+V_TOP); fwd(10)up(z/2)right(40-4)rotate([90,0,-45])rotate_extrude(angle=360) left(18) circle(d=10); } footboard(); headpost(y=2*headpost_y); left(44)up(z/2)cuboid([50, 150, footcrossyz]); // crossbar // Screw Holes rx = 5 + headpost_x/2; right(rx)up(z-5) screw_channel(); right(rx)up(z/2) screw_channel(); right(rx)up(5) screw_channel(); left(50)up(z-5) screw_channel(); left(50)up(5) screw_channel(); } } module head_cross_rear() { difference() { cuboid([platmid_x+20, 25+10, 42], fillet=3,align=V_BACK); back(50/2)cuboid([platmid_x, 50 , 70], align=V_FRONT); xspread(n=2, l=platmid_x+10) zspread(n=2, l=33) rotate([90,0,0]) m4s_clear(bl=66, bz=-34, drop=false, sh=0); } } module head_cross_front() { difference() { cuboid([platmid_x+20, 25+10, 42], fillet=3, align=V_FRONT); back(25)cuboid([71, 50 , 25], align=V_FRONT); xspread(n=2, l=platmid_x+10) zspread(n=2, l=33) rotate([90,0,0]) m4s_clear(bl=65, bz=-33, drop=false, sh=.20); } } module foot_cross_front() { z = footcrossyz + 2*10; difference() { cuboid([platmid_x+20, footcrossyz+10, z], fillet=3, align=V_FRONT); fwd(footcrossyz)cuboid([71, 50 , footcrossyz], align=V_BACK); back(0)xspread(n=2, l=platmid_x+10) zspread(n=2, l=z-10) rotate([90,0,0]) rotate([0,0,0]) m4s_clear(bl=65, bz=-20, drop=false, sh=.20); } } module foot_cross_rear() { z = footcrossyz + 2*10; difference() { cuboid([platmid_x+20, 25+10, z], fillet=3,align=V_BACK); back(50/2)cuboid([platmid_x, 50 , 70], align=V_FRONT); back(0)xspread(n=2, l=platmid_x+10) zspread(n=2, l=z-10) rotate([90,0,0]) m4s_clear(bl=67, bz=-22, drop=false, sh=0); } } module head_cross_bar(l=100, align=V_FRONT) { cuboid([l,headcross_yz, headcross_yz], align=align); } module head_plat_mid(l=100, align=V_BACK) { cuboid([platmid_x, platfoot_y, l], align=align); } if (part == "head_cross_front") { rot = (plate) ? 90 : 0; rotate([rot,0,0]) head_cross_front(); if (mate) { %head_cross_rear(); } } else if (part == "foot_cross_front") { rot = (plate) ? 90 : 0; rotate([rot,0,0]) foot_cross_front(); if (mate) { %foot_cross_rear(); } } else if (part == "foot_cross_rear") { rot = (plate) ? 90 : 0; rotate([rot,0,0]) foot_cross_rear(); if (mate) { %foot_cross_front(); } } else if (part == "head_cross_rear") { rot = (plate) ? -90 : 0; rotate([rot,0,0]) head_cross_rear(); if (mate) { %head_cross_front(); } } else if (part == "head_corner_front") { tx = (plate) ? 0 : -19; ty = (plate) ? 0 : -headpost_y-4; translate([tx, ty, 0]) head_front(); } else if (part == "head_corner_rear") { rot = plate ? -90 : 0; xrot(rot) head_rear(); } else if (part == "foot_corner_front") { rot = plate ? -90 : 0; xrot(rot) foot_front(); } else if (part == "foot_corner_rear") { rot = plate ? -90 : 0; xrot(rot) foot_rear(); if (mate) { fwd(headpost_x) left(19) %foot_front(); } } else if (part == "both") { fwd(platfoot_y+LegGap+13) left(LegOff)head_front(); head_rear(); } if (model == "corner_leg") { %footboard(); %headpost(); %left(LegOff)fwd(headpost_y+LegGap)platfoot(); } else if (model == "center_leg") { %head_cross_bar(); %head_plat_mid(); } //left(19)fwd(headpost_y+4) //head_front(); //head_rear(); //left(19)fwd(headpost_y+4)head_front(); //back(2) rotate([-90,0,0]) //back(20)head_rear(); //%platfoot(); //%cuboid([150, 25,25], align=V_BACK); // crossbar