From a8eff8370c830ce0fc6a40ea21a2f71cc17b5907 Mon Sep 17 00:00:00 2001 From: Stephen J Carpenter Date: Wed, 23 Jul 2025 14:35:02 -0400 Subject: [PATCH] Tube pass Support and cleanup Added support for tube pass. Small cleanup of ear placement for edges. --- box.scad | 79 +++++++++++++++++++++++++++++++------------------------- 1 file changed, 44 insertions(+), 35 deletions(-) diff --git a/box.scad b/box.scad index 5a79e17..a04727e 100644 --- a/box.scad +++ b/box.scad @@ -10,7 +10,7 @@ include /* [Part] */ -PART = ""; // [ all_corners, corner_top, corner_bottom, edge_back_bottom_a, edge_back_bottom_b, edge_back_bottom_c, edge_back_bottom_d, edge_front_bottom, edge_side_top, edge_side_foot_left, edge_side_foot_right, edge_top_front, edge_top_back, edge_test, full_box, joiner_top, joiner_bottom, joiner_slop, profile, side_edge, rbfoot, hinge, new_joiner, rear_mount, grid_mount ] +PART = ""; // [ all_corners, corner_top_rear, corner_top_front_l, corner_top_front_r, corner_bottom, edge_back_bottom_a, edge_back_bottom_b, edge_back_bottom_c, edge_back_bottom_d, edge_front_bottom, edge_side_top, edge_side_foot_left, edge_side_foot_right, edge_top_front, edge_top_back, edge_test, full_box, joiner_top, joiner_bottom, joiner_slop, profile, side_edge, rbfoot, hinge, new_joiner, rear_mount, grid_mount ] /* [Profile Dimensions] */ @@ -31,7 +31,7 @@ FLOOR_THICK = 5; //JOINER_W = 10; JOINER_H = 10; JOINER_W = 8; -JOINER_SLOP = .2; +JOINER_SLOP = .1; RB_MOUNT_INSET=17; RB_MOUNT_WIDTH=9; @@ -236,7 +236,18 @@ module box_edge(ps=PROFILE_SIZE, l=10, orient=ORIENT_Z, jh = JOINER_H,jw = JOINE 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); } else { - right(0)zrot(-45)back(face_off*sqrt(2))pc4M10(orient=ORIENT_Y,align=V_BACK); + right(0)zrot(-45)back(face_off*sqrt(2)) { + pc4M10(orient=ORIENT_Y,align=V_BACK); + difference() { + cyl(h=2.28, r=1.7, orient=ORIENT_Y, align=V_BACK); + cyl(h=2.28, r=1.4, orient=ORIENT_Y, align=V_BACK); + } + difference() { + cyl(h=2.28, r=3.3, orient=ORIENT_Y, align=V_BACK); + cyl(h=2.28, r=3, orient=ORIENT_Y, align=V_BACK); + } + cyl(r=3.4, h=.2, orient=ORIENT_Y, align=V_BACK); + } } } if (jup) up(l/2)back(joiner_off)right(joiner_off)zrot(-45)new_joiner(slop=slop, orient=ORIENT_Y, align=V_CENTER); @@ -278,10 +289,10 @@ module beam_joiner(jw=JOINER_W, jh=JOINER_H, fl=false, slop=JOINER_SLOP) { module box_all_corners(ex=0) { // top - up(ex) fwd(ex) left(ex) box_corner(zfl=false, zw=true,align=V_UP+V_FRONT+V_LEFT, orient=ORIENT_ZNEG); - up(ex) back(ex) left(ex) box_corner(zfl=false, zw=true,align=V_UP+V_BACK+V_LEFT, orient=ORIENT_ZNEG_90); - up(ex) back(ex) right(ex) box_corner(zfl=false, zw=true, align=V_UP+V_BACK+V_RIGHT, orient=ORIENT_ZNEG_180); - up(ex) fwd(ex) right(ex) box_corner(zfl=false,zw=true,align=V_UP+V_FRONT+V_RIGHT, orient=ORIENT_ZNEG_270); + up(ex) fwd(ex) left(ex) box_corner(cl=true, zfl=false, zw=true, align=V_UP+V_FRONT+V_LEFT, orient=ORIENT_ZNEG); + up(ex) back(ex) left(ex) box_corner(zfl=false, zw=true, align=V_UP+V_BACK+V_LEFT, orient=ORIENT_ZNEG_90); + up(ex) back(ex) right(ex) box_corner(zfl=false, zw=true, align=V_UP+V_BACK+V_RIGHT, orient=ORIENT_ZNEG_180); + up(ex) fwd(ex) right(ex) box_corner(cr=true, zfl=false, zw=true, align=V_UP+V_FRONT+V_RIGHT, orient=ORIENT_ZNEG_270); // bottom down(ex) fwd(ex) right(ex) box_corner(align=V_DOWN+V_FRONT+V_RIGHT, orient=ORIENT_Z); down(ex) back(ex) right(ex) box_corner(align=V_DOWN+V_BACK+V_RIGHT, orient=ORIENT_Z_90); @@ -314,7 +325,7 @@ module new_joiner2(spacing=0, slop=JOINER_SLOP, align=V_FRONT, jh=JOINER_H, jw=J spread = jw + spacing; color(cl) orient_and_align([2*jw+spacing,0,jh], orig_align=V_FRONT, align=align, orient=orient) { - left(0*spread/2) half_joiner2(slop=slop, h=jh, w=jw, l=l, screwsize=$preview ? undef : undef); + left(spread/2) half_joiner2(slop=slop, h=jh, w=jw, l=l, screwsize=$preview ? undef : undef); //right(spread/2) half_joiner2(h=jh, w=jw, l=l, screwsize=$preview ? undef : undef); } } @@ -323,7 +334,7 @@ module new_joiner_clear(spacing=0, slop=JOINER_SLOP, align=V_FRONT, jh=JOINER_H, color(cl) orient_and_align([2*jw+spacing,0,jh], orig_align=V_FRONT, align=align, orient=orient) { left(spread/2) half_joiner_clear(h=jh, w=jw); - //right(spread/2) half_joiner_clear(h=jh, w=jw); + right(spread/2) half_joiner_clear(h=jh, w=jw); } } @@ -338,6 +349,9 @@ lx = BOX_X - 2* sz - 2*psoff; ly = BOX_Y - sz; lz = BOX_Z - sz; ioff = 4*lx/50; +// edge ears +ear_sy = 2*(coff/2-2*psoff); +ear_sx = lx/5; echo(str("Edge Len X: ", lx, " (3 x ", lx/3, ")")); echo(str("Edge Len Y: ", ly, " (1 x ", ly, ")")); @@ -350,13 +364,17 @@ if (PART == "profile") { } if (PART == "all_corners") box_all_corners(ex=30); -if (PART == "corner_top") box_corner(zw=true, zfl=false, top=true); +if (PART == "corner_top_rear") box_corner(zw=true, zfl=false, top=true); +if (PART == "corner_top_front_l") box_corner(cl=true, zw=true, zfl=false, top=true); +if (PART == "corner_top_front_r") box_corner(cr=true, zw=true, zfl=false, top=true); if (PART == "corner_bottom") box_corner(zw=false, zfl=true); if (PART == "edge_front_bottom") { - 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); - left(coff/2-2*psoff) fwd(lx/3/2)zrot(45)ear(thick=.2, dis=-2); - right(coff/2-2*psoff) fwd(lx/3/2)zrot(135)ear(thick=.2, dis=-2); + if (Print_Ears) { + 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); + left(coff/2-2*psoff) fwd(lx/3/2)zrot(45)ear(thick=.2, dis=-2); + right(coff/2-2*psoff) fwd(lx/3/2)zrot(135)ear(thick=.2, dis=-2); + } difference() { up((wt+wl)/sqrt(2))xrot(90) zrot(45) box_edge(l=lx/3, jup=true, jdown=true, flx=true, wx=false, my=true, iy=false, tubepass=false, orient=ORIENT_Z); @@ -370,39 +388,30 @@ if (PART == "edge_front_bottom") { } if (PART == "edge_back_bottom_a") { if (Print_Ears) { - left(coff/2-2*psoff) back(lx/5/2)zrot(315)ear(thick=.2, dis=-2); - right(coff/2-2*psoff) back(lx/5/2)zrot(225)ear(thick=.2, dis=-2); - left(coff/2-2*psoff) fwd(lx/5/2)zrot(45)ear(thick=.2, dis=-2); - right(coff/2-2*psoff) fwd(lx/5/2)zrot(135)ear(thick=.2, dis=-2); + xspread(n=2, l=ear_sx) yspread(n=2, l=ear_sy) ear(thick=.2, dis=-2); } - up((wt+wl)/sqrt(2))xrot(90) zrot(45) box_edge(l=lx/5, jup=true, jdown=true, ioff=ioff, flx=true, wx=false, tubepass=true, tn=1, orient=ORIENT_Z); + up((wt+wl)/sqrt(2)) + xrot(45) { + box_edge(l=lx/5, jup=true, jdown=true, ioff=ioff, flx=true, wx=false, tubepass=true, tn=1, orient=ORIENT_X); + } } if (PART == "edge_back_bottom_b") { if (Print_Ears) { - left(coff/2-2*psoff) back(lx/5/2)zrot(315)ear(thick=.2, dis=-2); - right(coff/2-2*psoff) back(lx/5/2)zrot(225)ear(thick=.2, dis=-2); - left(coff/2-2*psoff) fwd(lx/5/2)zrot(45)ear(thick=.2, dis=-2); - right(coff/2-2*psoff) fwd(lx/5/2)zrot(135)ear(thick=.2, dis=-2); + xspread(n=2, l=ear_sx) yspread(n=2, l=ear_sy) ear(thick=.2, dis=-2); } - up((wt+wl)/sqrt(2))xrot(90) zrot(45) box_edge(l=lx/5, jup=true, jdown=true, ix=false, iy=false, flx=true, wx=false, tubepass=true, tn=1, orient=ORIENT_Z); + up((wt+wl)/sqrt(2)) xrot(45) box_edge(l=lx/5, jup=true, jdown=true, ix=false, iy=false, flx=true, wx=false, tubepass=true, tn=1, orient=ORIENT_X); } if (PART == "edge_back_bottom_c") { if (Print_Ears) { - left(coff/2-2*psoff) back(lx/5/2)zrot(315)ear(thick=.2, dis=-2); - right(coff/2-2*psoff) back(lx/5/2)zrot(225)ear(thick=.2, dis=-2); - left(coff/2-2*psoff) fwd(lx/5/2)zrot(45)ear(thick=.2, dis=-2); - right(coff/2-2*psoff) fwd(lx/5/2)zrot(135)ear(thick=.2, dis=-2); + xspread(n=2, l=ear_sx) yspread(n=2, l=ear_sy) ear(thick=.2, dis=-2); } - up((wt+wl)/sqrt(2))xrot(90) zrot(45) box_edge(l=lx/5, jup=true, jdown=true, ix=true, iy=true, flx=true, wx=false, tubepass=true, tn=1, orient=ORIENT_Z); + up((wt+wl)/sqrt(2)) xrot(45) box_edge(l=lx/5, jup=true, jdown=true, ix=true, iy=true, flx=true, wx=false, tubepass=true, tn=1, orient=ORIENT_X); } if (PART == "edge_back_bottom_d") { if (Print_Ears) { - left(coff/2-2*psoff) back(lx/5/2)zrot(315)ear(thick=.2, dis=-2); - right(coff/2-2*psoff) back(lx/5/2)zrot(225)ear(thick=.2, dis=-2); - left(coff/2-2*psoff) fwd(lx/5/2)zrot(45)ear(thick=.2, dis=-2); - right(coff/2-2*psoff) fwd(lx/5/2)zrot(135)ear(thick=.2, dis=-2); + xspread(n=2, l=ear_sx) yspread(n=2, l=ear_sy) ear(thick=.2, dis=-2); } - up((wt+wl)/sqrt(2))xrot(90) zrot(45) box_edge(l=lx/5, jup=true, jdown=true, ix=true, iy=true, ioff=-ioff, flx=true, wx=false, tubepass=true, tn=1, orient=ORIENT_Z); + up((wt+wl)/sqrt(2)) xrot(45) box_edge(l=lx/5, jup=true, jdown=true, ix=true, iy=true, ioff=-ioff, flx=true, wx=false, tubepass=true, tn=1, orient=ORIENT_X); } if (PART == "edge_side_foot_left") { box_edge(l=ly, rbfoot=true, rbleft=true, flx=true, wx=false, jup=true, jdown=true, gm=true, orient=ORIENT_Y); @@ -501,7 +510,7 @@ if (PART == "rbfoot") rb_foot(); if (PART == "edge_test") yrot(45) //box_edge(l=35, tubepass=true, jup=true, jdown=true, tn=1, flx=true, wx = false, orient=ORIENT_Y); - box_edge(l=25, tubepass=false, jup=true, jdown=true, tn=1, flx=false, wx = true, ix = false , my=true, iy = false, orient=ORIENT_Y); + box_edge(l=18, tubepass=false, jup=true, jdown=true, tn=1, flx=false, wx = true, ix = false , my=false, iy = false, orient=ORIENT_Y); if (PART == "hinge") { r = $t *90;