From 7e78edc14b2ca4cc963d7978d977bf690978154b Mon Sep 17 00:00:00 2001 From: rpedde Date: Wed, 19 Jul 2023 22:32:43 -0500 Subject: [PATCH] first pass at generating stacking tabs This is a bit hacky, but represents a proof of concept for trying to make the sort of stacking tabs discussed in #81 --- gridfinity-rebuilt-bins.scad | 4 ++++ gridfinity-rebuilt-lite.scad | 3 ++- gridfinity-rebuilt-utility.scad | 34 +++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/gridfinity-rebuilt-bins.scad b/gridfinity-rebuilt-bins.scad index ea176a9..ac07d2c 100644 --- a/gridfinity-rebuilt-bins.scad +++ b/gridfinity-rebuilt-bins.scad @@ -70,6 +70,10 @@ enable_zsnap = false; style_tab = 1; //[0:Full,1:Auto,2:Left,3:Center,4:Right,5:None] // how should the top lip act style_lip = 0; //[0: Regular lip, 1:remove lip subtractively, 2: remove lip and retain height] + +// generate tabs on the lid to help align stacked bins +stacking_tabs = false; + // scoop weight percentage. 0 disables scoop, 1 is regular scoop. Any real number will scale the scoop. scoop = 1; //[0:0.1:1] // only cut magnet/screw holes at the corners of the bin to save uneccesary print time diff --git a/gridfinity-rebuilt-lite.scad b/gridfinity-rebuilt-lite.scad index 4f5195c..5fe4e29 100644 --- a/gridfinity-rebuilt-lite.scad +++ b/gridfinity-rebuilt-lite.scad @@ -33,7 +33,8 @@ divy = 2; enable_zsnap = false; // how should the top lip act style_lip = 0; //[0: Regular lip, 1:remove lip subtractively, 2: remove lip and retain height] - +// generate tabs on the lid to help align stacked bins +stacking_tabs = false; /* [Other] */ // determine what the variable "gridz" applies to based on your use case gridz_define = 0; // [0:gridz is the height of bins in units of 7mm increments - Zack's method,1:gridz is the internal height in millimeters, 2:gridz is the overall external height of the bin in millimeters] diff --git a/gridfinity-rebuilt-utility.scad b/gridfinity-rebuilt-utility.scad index 6404080..35c6b0b 100644 --- a/gridfinity-rebuilt-utility.scad +++ b/gridfinity-rebuilt-utility.scad @@ -136,6 +136,8 @@ module gridfinityInit(gx, gy, h, h0 = 0, l = l_grid, sl = 0) { if ($style_lip == 0) profile_wall(h); else profile_wall2(h); } + + if ((style_lip == 0) && stacking_tabs) generate_tabs(); } // Function to include in the custom() module to individually slice bins // Will try to clamp values to fit inside the provided base size @@ -624,3 +626,35 @@ module profile_cutter_tab(h, tab, ang) { polygon([[0,h],[tab,h],[0,h-tab*tan(ang)]]); } + +module lip_tab(x, y) { + // I can't figure out what the wall thickness is, I'll assume 2.15 + + wall_thickness = 2.15; + + // how much of the first outer bevel sits "above" the lip when these mate properly + // This is an odd unit of measure. + percent_over = .33; + distance_offset = (1 - percent_over) * wall_thickness; + + rot = (x == $gxx) ? 180 : ((x == 0) ? 0 : ((y == $gyy) ? 270 : 90)); + + translate( + [(x * l_grid) - ((l_grid * $gxx / 2)), + (y * l_grid) - ((l_grid * $gyy / 2)), + $dh + h_lip + distance_offset]) { + rotate([0, 0, rot]) { + difference() { + translate([d_clear, 2 * r_c2, 0]) + rotate([90, 0, 0]) + hull() { + cube([r_f1, r_f1, 4 * r_c2]); + translate([wall_thickness - d_clear - r_f1, 0]) cube([r_f1, r_f1, 4 * r_c2]); + translate([wall_thickness - d_clear - r_f1, h_base - distance_offset - r_f1]) cube([r_f1, r_f1, 4 * r_c2]); + translate([r_f1, h_base - distance_offset - r_f1]) cylinder(r=r_f1, h=4* r_c2); + } + gridfinityBase(2, 2, l_grid, 1, 1, 0, 0.5, false); + } + } + } +}