From b8bfd1841bf0008230b5027c596251c923776ac7 Mon Sep 17 00:00:00 2001 From: Stephen J Carpenter Date: Sun, 7 Apr 2024 15:42:24 -0400 Subject: [PATCH] Hinge door plate work setup inserts and correct hinge motion. --- box.scad | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/box.scad b/box.scad index d574434..61a8a46 100644 --- a/box.scad +++ b/box.scad @@ -100,18 +100,18 @@ module hinge_mount(bz=WIN_THICK, bl=10) { zspread(l=40) { zrot(-90)xrot(90)right(5) { up(3+2) cyl(d1=7, d2=9,h=7, align=V_TOP); - thread_insertM3(bl=10,bz=-7, $die=true); + thread_insertM3(bl=bl,bz=-(bl-3), $die=true); //%thread_insertM3(bl=10,bz=-7); } } zrot(-90)xrot(90)left(5) { up(3+2) cyl(d1=7, d2=9,h=7, align=V_TOP); - thread_insertM3(bl=10,bz=-7, $die=true); + thread_insertM3(bl=bl,bz=-(bl-3), $die=true); //%thread_insertM3(bl=10,bz=-7); } } -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) { +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, ht=0, 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; @@ -130,7 +130,7 @@ module box_edge(ps=PROFILE_SIZE, l=10, orient=ORIENT_Z, jh = JOINER_H,jw = JOINE 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(); + if (hm) right(face_off)back(face_off)zrot(45) color("gold") hinge_mount(); if (iy) back(ps-wl/2)right(wt)yrot(-90) thread_insertM3(bl=5+wt, bz=-wt-2, $die=true); if (ix && flx ) right(ps-wl/2)back(ps/2-ft-1)xrot(-90) thread_insertM3(bl=ft+3, bz=-ft, $die=true); @@ -141,7 +141,7 @@ module box_edge(ps=PROFILE_SIZE, l=10, orient=ORIENT_Z, jh = JOINER_H,jw = JOINE %thread_insertM3(bl=6, bz=-4, $die=false); } } - if (hm) zrot(45) right(face_off*sqrt(2)) %hinge(); + if (hm) zrot(45) right(face_off*sqrt(2)) %hinge(theta=ht); if (tubepass) { if (tn > 1) { zspread(l=l/2, n=tn) right(0)zrot(-45)back(face_off*sqrt(2))pc4M10(orient=ORIENT_Y,align=V_BACK); @@ -212,13 +212,21 @@ module boxjoiner_clear(inset=5, slop=.01, jh=JOINER_H, jw=JOINER_W, align=V_FRON module hinge(theta=90) { x=7; + py=20; difference() { left(x/2)cuboid([x,20,50], fillet=2, edges=EDGES_X_ALL); hinge_mount($die=true); } - zrot(theta)back(11+5){ + left(5.5)back(py/2 + 5)zrot(theta){ cylinder(r=5, h=6); - back(10+5)cuboid([x,20,50], fillet=2, edges=EDGES_X_ALL); + difference() { + left((x)/2-5)back(10+5)cuboid([x,20,50], fillet=2, edges=EDGES_X_ALL); + right(5)back(10+5)zrot(180) { + hinge_mount(bl=9, $die=true); + %hinge_mount(bl=9,$die=false); + } + //right(2)back(10+5)zrot(180)hinge_mount(bl=6.5,$die=true); + } } } @@ -263,10 +271,12 @@ if (PART == "edge_side_top") { up((wt+wl)/sqrt(2))yrot(45)box_edge(l=ly, rbfoot=false, flx=false, wx=true, 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); + //r = $t *90 - 45; + r=-45; + box_edge(l=lx/3, rbfoot=false, hm=true, ht=r, flx=false, iy=false, wx=true, jup=true, jdown=true, cm=true, orient=ORIENT_XNEG_180); face_off = ((ps+psoff)/4); //xrot(45)yrot(-90)right(face_off+7/2)zrot(180)hinge(); - } +} if (PART == "edge_top_back") { left(coff/2-2*psoff) back(lx/3/2)zrot(315)ear(thick=.2, dis=-2); right(coff/2-2*psoff) back(lx/3/2)zrot(225)ear(thick=.2, dis=-2); @@ -332,8 +342,8 @@ if (PART == "rbfoot") rb_foot(); if (PART == "edge_test") box_edge(l=35, tubepass=true, jup=true, jdown=true, tn=1, flx=true, wx = false, orient=ORIENT_Y); if (PART == "hinge") { - box_edge(l=lx/3, rbfoot=false, hm=true, flx=false, iy=false, wx=true, jup=true, jdown=true, cm=true); - //hinge(); + r = $t *90; + hinge(theta=r); } //down(BOX_Y/2 + 40)color("red") cube([BOX_X-22, BOX_Y, 1], center=true); //down(BOX_Y/2 + 0*40)color("blue") cube([BOX_X, BOX_Y/2, 1], center=true);