From 744ff09aaa63664ef7b1c552e555e2c27afb36f1 Mon Sep 17 00:00:00 2001 From: Rui Carmo Date: Sat, 15 Oct 2022 18:34:04 +0100 Subject: [PATCH 1/6] Merge block_base_cutout from @JakeWorrel --- gridfinity-rebuilt-utility.scad | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/gridfinity-rebuilt-utility.scad b/gridfinity-rebuilt-utility.scad index 73493c8..5e9eaf1 100644 --- a/gridfinity-rebuilt-utility.scad +++ b/gridfinity-rebuilt-utility.scad @@ -141,6 +141,30 @@ module block_base_hole(style_hole) { } } +module block_base_cutout(){ + squidge=-2.5; + translate([0,0,h_base-2.5]) + //rounded_rectangle(gridx*length-0.5+0.002, gridy*length-0.5+0.002, h_bot/1.5, r_fo1/2+0.001); + pattern_linear(gridx, gridy, length) + + render() + difference() { + translate([0,0,h_base]) + mirror([0,0,1]) + union() { + hull() { + rounded_square(squidge+length-0.5-2*r_c2-2*r_c1, h_base+0.5, r_fo3/2); + rounded_square(squidge+length-0.5-2*r_c2, h_base-r_c1+0.5, r_fo2/2); + } + hull() { + rounded_square(squidge+length-0.5-2*r_c2, r_c2, r_fo2/2); + mirror([0,0,1]) + rounded_square(squidge+length-0.5, h_bot/2, r_fo1/2); + } + } + } +} + module profile_wall_sub_sub() { polygon([ [0,0], @@ -231,7 +255,7 @@ module block_cutter(x,y,w,h,t,s) { cut = (zsmall || t == 5) ? (ycutlast?v_cut_lip:0) : v_cut_tab; style = (t > 1 && t < 5) ? t-3 : (x == 0 ? -1 : xcutlast ? 1 : 0); - translate([0,ylen/2,h_base+h_bot]) + translate([0,ylen/2,h_base+h_bot+0.8]) rotate([90,0,-90]) { if (!zsmall && xlen - d_tabw > 4*r_f2 && t != 0) { From 4e2ae56300b2c98b8420812701b54002f5a15067 Mon Sep 17 00:00:00 2001 From: Rui Carmo Date: Sat, 15 Oct 2022 19:43:17 +0100 Subject: [PATCH 2/6] Revert slight offset --- gridfinity-rebuilt-utility.scad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gridfinity-rebuilt-utility.scad b/gridfinity-rebuilt-utility.scad index 5e9eaf1..c4412a5 100644 --- a/gridfinity-rebuilt-utility.scad +++ b/gridfinity-rebuilt-utility.scad @@ -255,7 +255,7 @@ module block_cutter(x,y,w,h,t,s) { cut = (zsmall || t == 5) ? (ycutlast?v_cut_lip:0) : v_cut_tab; style = (t > 1 && t < 5) ? t-3 : (x == 0 ? -1 : xcutlast ? 1 : 0); - translate([0,ylen/2,h_base+h_bot+0.8]) + translate([0,ylen/2,h_base+h_bot]) rotate([90,0,-90]) { if (!zsmall && xlen - d_tabw > 4*r_f2 && t != 0) { From 8fa09b0541e8323db174b00d0efd4bacac0aca83 Mon Sep 17 00:00:00 2001 From: Rui Carmo Date: Sat, 15 Oct 2022 19:43:35 +0100 Subject: [PATCH 3/6] add lite_mode --- gridfinity-rebuilt-bins.scad | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/gridfinity-rebuilt-bins.scad b/gridfinity-rebuilt-bins.scad index 46216cd..6486d30 100644 --- a/gridfinity-rebuilt-bins.scad +++ b/gridfinity-rebuilt-bins.scad @@ -48,6 +48,8 @@ enable_scoop = true; enable_zsnap = false; // enable upper lip for stacking other bins enable_lip = true; +// remove flat bottom +lite_mode = true; /* [Other] */ // determine what the variable "gridz" applies to based on your use case @@ -69,8 +71,8 @@ div_base_y = 0; // ===== Commands ===== // -color("tomato") { - +/* +*color("tomato") { gridfinityInit(gridx, gridy, height(gridz, gridz_define, enable_lip, enable_zsnap), height_internal, length) { cutEqual(n_divx = divx, n_divy = divy, style_tab = style_tab, enable_scoop = enable_scoop); @@ -78,6 +80,25 @@ gridfinityInit(gridx, gridy, height(gridz, gridz_define, enable_lip, enable_zsna gridfinityBase(gridx, gridy, length, div_base_x, div_base_y, style_hole); } +*/ + +color("tomato") +gridfinityInit(gridx, gridy, height(gridz, gridz_define, enable_lip, enable_zsnap), height_internal, length) { + cutEqual(n_divx = divx, n_divy = divy, style_tab = style_tab, enable_scoop = enable_scoop); + if(lite_mode) + block_base_cutout(); +} + +if(lite_mode) { + difference() { + gridfinityBase(gridx, gridy, length, div_base_x, div_base_y, style_hole); + block_base_cutout(); + } +} +else { +gridfinityBase(gridx, gridy, length, div_base_x, div_base_y, style_hole); +} + // ===== Examples ===== From fd301a8da6f5e7b6429dcb5125eb5a6e9c6d145c Mon Sep 17 00:00:00 2001 From: Rui Carmo Date: Sat, 15 Oct 2022 19:47:51 +0100 Subject: [PATCH 4/6] add batch script --- gererate-gridfinity-lite.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 gererate-gridfinity-lite.py diff --git a/gererate-gridfinity-lite.py b/gererate-gridfinity-lite.py new file mode 100644 index 0000000..2e069bc --- /dev/null +++ b/gererate-gridfinity-lite.py @@ -0,0 +1,17 @@ +#!/bin/env python3 + +# Generate Gridfinity Lite bin sets + +from os import makedirs, system +from os.path import exists, join + +for h in range(3, 12, 3): + for w in range(1,6): + for d in range(w, 6): + out_path = join("stl", f"{h}h") + if not exists(out_path): + makedirs(out_path) + out_file = join(out_path, f"gridfinity-lite-{w}x{d}x{h}.stl"); + if not exists(out_file): + print(f"-> {out_file}") + system(f"openscad gridfinity-rebuilt-bins.scad --export-format binstl -o {out_file} -Dgridx={w} -Dgridy={d} -Dgridz={h} -Dstyle_tab=5 -Denable_scoop=false -Dstyle_hole=0 -Dlite_mode=true"); \ No newline at end of file From 189795a23f87502ac326649f7f62eebcf5583d82 Mon Sep 17 00:00:00 2001 From: Rui Carmo Date: Wed, 26 Oct 2022 19:25:46 +0100 Subject: [PATCH 5/6] Delete gererate-gridfinity-lite.py --- gererate-gridfinity-lite.py | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 gererate-gridfinity-lite.py diff --git a/gererate-gridfinity-lite.py b/gererate-gridfinity-lite.py deleted file mode 100644 index 2e069bc..0000000 --- a/gererate-gridfinity-lite.py +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/env python3 - -# Generate Gridfinity Lite bin sets - -from os import makedirs, system -from os.path import exists, join - -for h in range(3, 12, 3): - for w in range(1,6): - for d in range(w, 6): - out_path = join("stl", f"{h}h") - if not exists(out_path): - makedirs(out_path) - out_file = join(out_path, f"gridfinity-lite-{w}x{d}x{h}.stl"); - if not exists(out_file): - print(f"-> {out_file}") - system(f"openscad gridfinity-rebuilt-bins.scad --export-format binstl -o {out_file} -Dgridx={w} -Dgridy={d} -Dgridz={h} -Dstyle_tab=5 -Denable_scoop=false -Dstyle_hole=0 -Dlite_mode=true"); \ No newline at end of file From 705ab42ff3c20c4fe2f7c8cd06ae4f87a03c0e06 Mon Sep 17 00:00:00 2001 From: kennetek <40445044+kennetek@users.noreply.github.com> Date: Sat, 5 Nov 2022 23:19:56 -0700 Subject: [PATCH 6/6] generalized lite version --- gridfinity-rebuilt-bins.scad | 30 +++---------- gridfinity-rebuilt-lite.scad | 79 +++++++++++++++++++++++++++++++++ gridfinity-rebuilt-utility.scad | 51 +++++++-------------- 3 files changed, 100 insertions(+), 60 deletions(-) create mode 100644 gridfinity-rebuilt-lite.scad diff --git a/gridfinity-rebuilt-bins.scad b/gridfinity-rebuilt-bins.scad index 6486d30..4fe3a94 100644 --- a/gridfinity-rebuilt-bins.scad +++ b/gridfinity-rebuilt-bins.scad @@ -27,9 +27,9 @@ $fs = 0.25; /* [General Settings] */ // number of bases along x-axis -gridx = 2; +gridx = 1; // number of bases along y-axis -gridy = 2; +gridy = 1; // bin height. See bin height information and "gridz_define" below. gridz = 6; // base unit @@ -48,7 +48,7 @@ enable_scoop = true; enable_zsnap = false; // enable upper lip for stacking other bins enable_lip = true; -// remove flat bottom +// remove flat bottom to save material lite_mode = true; /* [Other] */ @@ -61,7 +61,7 @@ style_tab = 1; //[0:Full,1:Auto,2:Left,3:Center,4:Right,5:None] height_internal = 0; /* [Base] */ -style_hole = 1; // [0:no holes, 1:magnet holes only, 2: magnet and screw holes - no printable slit, 3: magnet and screw holes - printable slit] +style_hole = 3; // [0:no holes, 1:magnet holes only, 2: magnet and screw holes - no printable slit, 3: magnet and screw holes - printable slit] // number of divisions per 1 unit of base along the X axis. (default 1, only use integers. 0 means automatically guess the right division) div_base_x = 0; // number of divisions per 1 unit of base along the Y axis. (default 1, only use integers. 0 means automatically guess the right division) @@ -71,8 +71,7 @@ div_base_y = 0; // ===== Commands ===== // -/* -*color("tomato") { +color("tomato") { gridfinityInit(gridx, gridy, height(gridz, gridz_define, enable_lip, enable_zsnap), height_internal, length) { cutEqual(n_divx = divx, n_divy = divy, style_tab = style_tab, enable_scoop = enable_scoop); @@ -80,25 +79,6 @@ gridfinityInit(gridx, gridy, height(gridz, gridz_define, enable_lip, enable_zsna gridfinityBase(gridx, gridy, length, div_base_x, div_base_y, style_hole); } -*/ - -color("tomato") -gridfinityInit(gridx, gridy, height(gridz, gridz_define, enable_lip, enable_zsnap), height_internal, length) { - cutEqual(n_divx = divx, n_divy = divy, style_tab = style_tab, enable_scoop = enable_scoop); - if(lite_mode) - block_base_cutout(); -} - -if(lite_mode) { - difference() { - gridfinityBase(gridx, gridy, length, div_base_x, div_base_y, style_hole); - block_base_cutout(); - } -} -else { -gridfinityBase(gridx, gridy, length, div_base_x, div_base_y, style_hole); -} - // ===== Examples ===== diff --git a/gridfinity-rebuilt-lite.scad b/gridfinity-rebuilt-lite.scad new file mode 100644 index 0000000..965442e --- /dev/null +++ b/gridfinity-rebuilt-lite.scad @@ -0,0 +1,79 @@ +include + +/* [Setup Parameters] */ +$fa = 8; +$fs = 0.25; + +/* [General Settings] */ +// number of bases along x-axis +gridx = 3; +// number of bases along y-axis +gridy = 3; +// bin height. See bin height information and "gridz_define" below. +gridz = 6; +// base unit +length = 42; + +/* [Compartments] */ +// number of X Divisions +divx = 2; +// number of y Divisions +divy = 2; + +/* [Toggles] */ +// snap gridz height to nearest 7mm increment +enable_zsnap = false; +// enable upper lip for stacking other bins +enable_lip = true; + +/* [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] +// the type of tabs +style_tab = 1; //[0:Full,1:Auto,2:Left,3:Center,4:Right,5:None] + +/* [Base] */ +style_hole = 3; // [0:no holes, 1:magnet holes only, 2: magnet and screw holes - no printable slit, 3: magnet and screw holes - printable slit] +// number of divisions per 1 unit of base along the X axis. (default 1, only use integers. 0 means automatically guess the right division) +div_base_x = 0; +// number of divisions per 1 unit of base along the Y axis. (default 1, only use integers. 0 means automatically guess the right division) +div_base_y = 0; + + + +// Input all the cutter types in here +module cutterInput() { + cutEqual(n_divx = divx, n_divy = divy, style_tab = style_tab, enable_scoop = false); +} + +// Does the necessary operations to get the base geometry +color("tomato") +difference() { + union() { + gridfinityInit(gridx, gridy, height(gridz, gridz_define, enable_lip, enable_zsnap), 0, length) { + cutterInput(); + } + gridfinityBase(gridx, gridy, length, div_base_x, div_base_y, style_hole); + } + + difference() { + union() { + intersection() { + difference() { + gridfinityBase(gridx, gridy, length, div_base_x, div_base_y, style_hole, -d_wall*2, false); + translate([-gridx*length/2,-gridy*length/2,2*h_base]) + cube([gridx*length,gridy*length,1000]); + } + translate([0,0,-1]) + rounded_rectangle(gridx*length-0.5005-d_wall*2, gridy*length-0.5005-d_wall*2, 1000, r_f2); + } + translate([0,0,h_base+d_clear]) + rounded_rectangle(gridx*length-0.5005-d_wall*2, gridy*length-0.5005-d_wall*2, h_base, r_f2); + } + + translate([0,0,-4*h_base]) + gridfinityInit(gridx, gridy, height(20,0), 0, length) + cutterInput(); + } + +} \ No newline at end of file diff --git a/gridfinity-rebuilt-utility.scad b/gridfinity-rebuilt-utility.scad index d812f67..8db2132 100644 --- a/gridfinity-rebuilt-utility.scad +++ b/gridfinity-rebuilt-utility.scad @@ -27,6 +27,7 @@ module gridfinityInit(gx, gy, h, h0 = 0, l) { $gxx = gx; $gyy = gy; $dh = h; + $dh0 = h0; color("tomato") { difference() { color("firebrick") @@ -61,7 +62,7 @@ module cut(x=0, y=0, w=1, h=1, t=1, s=true) { // Translates an object from the origin point to the center of the requested compartment block, can be used to add custom cuts in the bin // See cut() module for parameter descriptions module cut_move(x, y, w, h) { - translate([0,0,height_internal==0?$dh+h_base:height_internal+h_base]) + translate([0,0,$dh0==0?$dh+h_base:$dh0+h_base]) cut_move_unsafe(clp(x,0,$gxx), clp(y,0,$gyy), clp(w,0,$gxx-x), clp(h,0,$gyy-y)) children(); } @@ -87,6 +88,7 @@ module gridfinityBase(gx, gy, l, dx, dy, style_hole, off=0, final_cut=true) { xx = gx*l-0.5; yy = gy*l-0.5; + if (final_cut) translate([0,0,h_base]) rounded_rectangle(xx+0.002, yy+0.002, h_bot/1.5, r_fo1/2+0.001); @@ -102,12 +104,12 @@ module gridfinityBase(gx, gy, l, dx, dy, style_hole, off=0, final_cut=true) { if (style_hole > 0) pattern_linear(gx, gy, l) - block_base_hole(style_hole); + block_base_hole(style_hole, off); } } } -module block_base_solid(dbnx, dbny, l, o) { +module block_base_solid(dbnx, dbny, l, o) { xx = dbnx*l-0.05; yy = dbny*l-0.05; oo = (o/2)*(sqrt(2)-1); @@ -115,58 +117,37 @@ module block_base_solid(dbnx, dbny, l, o) { mirror([0,0,1]) union() { hull() { - rounded_rectangle(xx-2*r_c2-2*r_c1+o,yy-2*r_c2-2*r_c1+o, h_base+oo, r_fo3/2); + rounded_rectangle(xx-2*r_c2-2*r_c1+o, yy-2*r_c2-2*r_c1+o, h_base+oo, r_fo3/2); rounded_rectangle(xx-2*r_c2+o, yy-2*r_c2+o, h_base-r_c1+oo, r_fo2/2); } + translate([0,0,oo]) hull() { - rounded_rectangle(xx-2*r_c2+o, yy-2*r_c2+o,r_c2+oo, r_fo2/2); + rounded_rectangle(xx-2*r_c2+o, yy-2*r_c2+o, r_c2, r_fo2/2); mirror([0,0,1]) - rounded_rectangle(xx+o, yy+o, h_bot/2+oo, r_fo1/2); + rounded_rectangle(xx+o, yy+o, h_bot/2+abs(10*o), r_fo1/2); } } } -module block_base_hole(style_hole) { +module block_base_hole(style_hole, o) { + r1 = r_hole1-o/2; + r2 = r_hole2-o/2; pattern_circular(4) translate([d_hole/2, d_hole/2, 0]) union() { difference() { - cylinder(h = 2*(h_hole+(style_hole==3?0.2:0)), r=r_hole2, center=true); + cylinder(h = 2*(h_hole-o+(style_hole==3?0.2:0)), r=r2, center=true); if (style_hole==3) copy_mirror([0,1,0]) - translate([-1.5*r_hole2,r_hole1+0.1,h_hole]) - cube([r_hole2*3,r_hole2*3, 0.4]); + translate([-1.5*r2,r1+0.1,h_hole-o]) + cube([r2*3,r2*3, 0.4]); } if (style_hole > 1) - cylinder(h = 3*h_base, r = r_hole1, center=true); + cylinder(h = 2*h_base-o, r = r1, center=true); } } -module block_base_cutout(){ - squidge=-2.5; - translate([0,0,h_base-2.5]) - //rounded_rectangle(gridx*length-0.5+0.002, gridy*length-0.5+0.002, h_bot/1.5, r_fo1/2+0.001); - pattern_linear(gridx, gridy, length) - - render() - difference() { - translate([0,0,h_base]) - mirror([0,0,1]) - union() { - hull() { - rounded_square(squidge+length-0.5-2*r_c2-2*r_c1, h_base+0.5, r_fo3/2); - rounded_square(squidge+length-0.5-2*r_c2, h_base-r_c1+0.5, r_fo2/2); - } - hull() { - rounded_square(squidge+length-0.5-2*r_c2, r_c2, r_fo2/2); - mirror([0,0,1]) - rounded_square(squidge+length-0.5, h_bot/2, r_fo1/2); - } - } - } -} - module profile_wall_sub_sub() { polygon([ [0,0],