diff --git a/bracket.scad b/bracket.scad index cfb2868..c9443aa 100644 --- a/bracket.scad +++ b/bracket.scad @@ -7,12 +7,21 @@ 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_cross_front, foot_cross_rear, head_cross_front, head_cross_rear ] +model = "none"; // ["none", "corner_leg", "center_leg"] +plate = false; +mate = false; render_fs=.4; render_fn=0; render_fa=.4; @@ -34,45 +43,135 @@ module headpost(x=headpost_x, y=headpost_y, z=260, align=V_FRONT) { } 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); + //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() { - back(footboard_y) cuboid([platfoot_x+2*12,headpost_y+footboard_y+4,95], fillet=3, edges=EDGES_BACK+EDGES_Y_ALL, align=V_FRONT+V_TOP); + 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 - right(40-10)up(95-10) screw_channel(); - right(40-10)up(95/2) screw_channel(); - right(40-10)up(10) screw_channel(); - left(40-10)up(95-10) screw_channel(); - left(40-10)up(10) screw_channel(); + 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)rotate([90,0,-45])rotate_extrude(angle=360) left(18) circle(d=10); + 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() { - cuboid([platfoot_x+2*12,platfoot_y+footboard_y,95], fillet=3, edges=EDGES_FRONT+EDGES_Y_ALL, align=V_FRONT+V_TOP); + 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 - right(40-10)up(95-10) rotate([-90,0,0]) rotate([0,0,180]) m4s_clear(bl=30, bz=-15, drop=true, sh=0); - right(40-10)up(95/2) rotate([-90,0,0]) rotate([0,0,180]) m4s_clear(bl=30, bz=-15, drop=true, sh=0); - right(40-10)up(10) rotate([-90,0,0]) rotate([0,0,180]) m4s_clear(bl=30, bz=-15, drop=true, sh=0); - left(40-10)up(95-10) rotate([-90,0,0]) rotate([0,0,180]) m4s_clear(bl=30, bz=-15, drop=true, sh=0); - left(40-10)up(10) rotate([-90,0,0]) rotate([0,0,180]) m4s_clear(bl=30, bz=-15, drop=true, sh=0); + 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); } } -//fwd(headpost_y+4) head_front(); + +module head_cross_rear() { + difference() { + cuboid([platmid_x+20, 25+5, 42], 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=33) rotate([90,0,0]) rotate([0,0,0]) m4s_clear(bl=40, bz=-11, drop=false, sh=0); + } +} + +module head_cross_front() { + difference() { + cuboid([platmid_x+20, 30, 42], fillet=3, align=V_FRONT); + back(25)cuboid([71, 50 , 25], align=V_FRONT); + back(2)xspread(n=2, l=platmid_x+10) zspread(n=2, l=33) rotate([90,0,0]) rotate([0,0,0]) m4s_clear(bl=40, bz=-11, 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(); +} 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(); +} 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 == "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(); -//%footboard(); -//%headpost(); -//%fwd(headpost_y+4)platfoot(); -fwd(2)head_front(); -back(2) rotate([-90,0,0]) fwd(footboard_y) 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 +