From 8cf42bafce9f88eab622d6ffe9023ae5b17ff410 Mon Sep 17 00:00:00 2001 From: Stephen J Carpenter Date: Sun, 7 Apr 2024 13:51:55 -0400 Subject: [PATCH] Fix compile warnings in Edge & adjust top back for print Adjusted top-back edge for printing with fdm ears. Perfect print. Added logic to not error when tn=1 to remove compile errors. --- box.scad | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/box.scad b/box.scad index 1fd0a9f..9311872 100644 --- a/box.scad +++ b/box.scad @@ -118,12 +118,20 @@ module box_edge(ps=PROFILE_SIZE, l=10, orient=ORIENT_Z, jh = JOINER_H,jw = JOINE psoff = ps/2 - wl - wt; face_off = ((ps+psoff)/4); orient_and_align([ps,ps,l], orient=orient, align=align, orig_orient=ORIENT_Z) left(ps/2) fwd(ps/2) { + echo("here"); 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 (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 (tubepass) { + if (tn > 1) { + zspread(l=l/2, n=tn) zrot(-45)back(face_off*sqrt(2)-.01)pc4M10_clear(orient=ORIENT_Y,align=V_BACK); + } else { + zrot(-45)back(face_off*sqrt(2)-.01)pc4M10_clear(orient=ORIENT_Y,align=V_BACK); + } + } + echo("here"); if (hm) right(face_off)back(face_off)zrot(45)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 ) @@ -136,7 +144,13 @@ module box_edge(ps=PROFILE_SIZE, l=10, orient=ORIENT_Z, jh = JOINER_H,jw = JOINE } } if (hm) zrot(45) right(face_off*sqrt(2)) %hinge(); - 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 (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); + } else { + 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); if (jdown) down(l/2 - jw/2)back(joiner_off)right(joiner_off)zrot(45)xrot(180)boxjoiner(orient=ORIENT_Y_90, align=V_CENTER); if (rbfoot) right(ps/2+psoff-2)zrot(180)yrot(90)rb_foot(); @@ -255,7 +269,13 @@ if (PART == "edge_top_front") { face_off = ((ps+psoff)/4); //xrot(45)yrot(-90)right(face_off+7/2)zrot(180)hinge(); } -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 == "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); + 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); + up((wt+wl)/sqrt(2)) yrot(45+90)zrot(90)box_edge(l=lx/3, rbfoot=false, hm=false, flx=false, iy=true, wx=true, jup=true, jdown=true, cm=true, orient=ORIENT_XNEG_180); +} if (PART == "full_box") { up(lz/2+ps) { // Top Corners: