diff --git a/box.scad b/box.scad index 8a89120..d97b853 100644 --- a/box.scad +++ b/box.scad @@ -9,7 +9,7 @@ include /* [Part] */ -PART = ""; // [ all_corners, corner_top, corner_bottom, edge_back, edge_side_foot, edge_test, full_box, joiner_top, joiner_bottom, profile, side_edge, rbfoot ] +PART = ""; // [ all_corners, corner_top, corner_bottom, edge_back, edge_side_top, edge_side_foot, edge_top_front, edge_top_back, edge_test, full_box, joiner_top, joiner_bottom, profile, side_edge, rbfoot ] /* [Dimensions] */ @@ -108,8 +108,9 @@ module hinge_mount(bz=WIN_THICK, bl=10) { } } -module box_edge(ps=PROFILE_SIZE, l=10, orient=ORIENT_Z, jh = JOINER_H,jw = JOINER_W, jb=5, jup = false, jdown=false, flx=false, ft=FLOOR_THICK, wl=WIN_LIP, wx=true, wt=WIN_THICK, wtr = WIN_TRIM, hm=false, tubepass=false, tn = 2, ix=true, iy=true, rbfoot=false, align=V_CENTER) { - joiner_off = ps/2 + wt - jb/sqrt(2); +module box_edge(ps=PROFILE_SIZE, l=10, orient=ORIENT_Z, jh = JOINER_H,jw = JOINER_W, jb=5, jup = false, jdown=false, flx=false, ft=FLOOR_THICK, wl=WIN_LIP, wx=true, wt=WIN_THICK, wtr = WIN_TRIM, hm=false, tubepass=false, tn = 2, ix=true, iy=true, rbfoot=false, cm=false, align=V_CENTER) { + inner_off = ps/2 + wt; + joiner_off = inner_off - jb/sqrt(2); jzoff = l/2-jw/2; psoff = ps/2 - wl - wt; face_off = ((ps+psoff)/4); @@ -117,7 +118,7 @@ module box_edge(ps=PROFILE_SIZE, l=10, orient=ORIENT_Z, jh = JOINER_H,jw = JOINE difference() { linear_extrude(height=l, center=true) profile(flx=flx, fly=true, wx=wx, wy=true); - if (jup) up(jzoff)back(joiner_off)right(joiner_off)zrot(45)boxjoiner_clear(orient=ORIENT_Y_90, align=V_CENTER, cl="green"); + if (jup) up(jzoff) back(joiner_off)right(joiner_off)zrot(45)boxjoiner_clear(orient=ORIENT_Y_90, align=V_CENTER, cl="green"); if (jdown) down(jzoff)back(joiner_off)right(joiner_off)zrot(45)boxjoiner_clear(orient=ORIENT_Y_90, align=V_CENTER, cl="brown"); if (tubepass) zspread(l=l/2, n=tn) zrot(-45)back(face_off*sqrt(2)-.01)pc4M10_clear(orient=ORIENT_Y,align=V_BACK); if (hm) right(face_off)back(face_off)zrot(45)hinge_mount(); @@ -126,6 +127,10 @@ module box_edge(ps=PROFILE_SIZE, l=10, orient=ORIENT_Z, jh = JOINER_H,jw = JOINE right(ps-wl/2)back(ps/2-ft-1)xrot(-90) thread_insertM3(bl=ft+3, bz=-ft, $die=true); if (ix && wx) right(ps-wl/2)back(wt)xrot(90) thread_insertM3(bl=5+wt, bz=-wt-2, $die=true); + if (cm) zspread(n=2, l=20) right(inner_off)back(inner_off)zrot(-45)xrot(-90){ + thread_insertM3(bl=6, bz=-4, $die=true); + %thread_insertM3(bl=6, bz=-4, $die=false); + } } if (tubepass) zspread(l=l/2, n=tn) right(0)zrot(-45)back(face_off*sqrt(2))pc4M10(orient=ORIENT_Y,align=V_BACK); if (jup) up(l/2 - jw/2)back(joiner_off)right(joiner_off)zrot(45)boxjoiner(orient=ORIENT_Y_90, align=V_CENTER); @@ -139,7 +144,6 @@ module box_corner(ps = PROFILE_SIZE, l=0, zfl = true, zw = false, wl=WIN_LIP, w coff = ps + psoff; sz = 3*ps/2 + psoff; orient_and_align([sz,sz,sz], orient=orient, align=align) { - // %up(2.5+psoff)back(2.5+psoff)left(2.5+psoff)cuboid([sz,sz,sz]); intersection() { // Cap fwd(ps)right(psoff)down(psoff)right(ps/2)box_edge(l=PROFILE_SIZE, orient=ORIENT_Y, align=V_BACK+V_LEFT, flx=zfl, wx=zw); @@ -212,7 +216,10 @@ if (PART == "corner_bottom") box_corner(zw=false, zfl=true); if (PART == "edge_back") { xrot(90) zrot(0) box_edge(l=lx/3, jup=true, jdown=true, flx=true, wx=false, tubepass=true, orient=ORIENT_Z); } -if (PART == "edge_side_foot") box_edge(l=ly, rbfoot=true, flx=true, wx=false, jup=true, jdown=true, orient=ORIENT_Y); +if (PART == "edge_side_foot") box_edge(l=ly, rbfoot=true, flx=true, wx=false, jup=true, jdown=true, cm=true, orient=ORIENT_Y); +if (PART == "edge_side_top") box_edge(l=ly, rbfoot=false, flx=true, wx=false, jup=true, jdown=true, cm=true, orient=ORIENT_Y); +if (PART == "edge_top_front") box_edge(l=lx/3, rbfoot=false, hm=true, flx=false, iy=false, wx=true, jup=true, jdown=true, cm=true, orient=ORIENT_XNEG_180); +if (PART == "edge_top_back") box_edge(l=lx/3, rbfoot=false, hm=false, flx=false, iy=false, wx=true, jup=true, jdown=true, cm=true, orient=ORIENT_XNEG_180); if (PART == "full_box") { up(lz/2+ps) { // Top Corners: