From a92c740c0d7fba24e3a936ab4b5b45275f9019d9 Mon Sep 17 00:00:00 2001 From: Jannes Magnusson Date: Mon, 23 Oct 2023 21:38:02 +0200 Subject: [PATCH 1/8] add cylindrical cutouts --- gridfinity-rebuilt-bins.scad | 42 ++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/gridfinity-rebuilt-bins.scad b/gridfinity-rebuilt-bins.scad index fc18129..3986c8a 100644 --- a/gridfinity-rebuilt-bins.scad +++ b/gridfinity-rebuilt-bins.scad @@ -29,17 +29,29 @@ $fs = 0.25; /* [General Settings] */ // number of bases along x-axis -gridx = 5; +gridx = 3; // number of bases along y-axis -gridy = 5; +gridy = 2; // bin height. See bin height information and "gridz_define" below. gridz = 6; -/* [Compartments] */ +/* [Linear Compartments] */ // number of X Divisions (set to zero to have solid bin) -divx = 1; -// number of y Divisions (set to zero to have solid bin) -divy = 1; +divx = 0; +// number of Y Divisions (set to zero to have solid bin) +divy = 0; + +/* [Cylindrical Compartments] */ +// number of cylindrical X Divisions (mutually exclusive to Linear Compartments) +cdivx = 0; +// number of cylindrical Y Divisions (mutually exclusive to Linear Compartments) +cdivy = 0; +// orientation +c_orientation = 2; // [0: x direction, 1: y direction, 2: z direction] +// radius of cylindrical cut outs +r = 10; +// cylinder height +ch = 10; /* [Height] */ // determine what the variable "gridz" applies to based on your use case @@ -73,11 +85,23 @@ div_base_y = 0; color("tomato") { gridfinityInit(gridx, gridy, height(gridz, gridz_define, style_lip, enable_zsnap), height_internal) { - if (divx > 0 && divy > 0) - cutEqual(n_divx = divx, n_divy = divy, style_tab = style_tab, scoop_weight = scoop); + if (divx > 0 && divy > 0) { + + cutEqual(n_divx = divx, n_divy = divy, style_tab = style_tab, scoop_weight = scoop); + + } else if (cdivx > 0 && cdivy > 0) { + rotation = (c_orientation == 0) + ? [0,90,0] + : (c_orientation == 1) + ? [90,0,0] + : [0,0,0]; + cut_move(x=0, y=0, w=gridx, h=gridy) + pattern_linear(x=cdivx, y=cdivy, sx=42*gridx/cdivx, sy=42*gridy/cdivy) + rotate(rotation) + cylinder(r=r, h=ch, center=true); + } } gridfinityBase(gridx, gridy, l_grid, div_base_x, div_base_y, style_hole, only_corners=only_corners); - } From a8066f511e51af1f1ed4102b991c9e713b01b7fe Mon Sep 17 00:00:00 2001 From: Jannes Magnusson Date: Wed, 25 Oct 2023 20:58:55 +0200 Subject: [PATCH 2/8] add spacing for cylinders --- gridfinity-rebuilt-bins.scad | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/gridfinity-rebuilt-bins.scad b/gridfinity-rebuilt-bins.scad index 3986c8a..bf80489 100644 --- a/gridfinity-rebuilt-bins.scad +++ b/gridfinity-rebuilt-bins.scad @@ -48,10 +48,12 @@ cdivx = 0; cdivy = 0; // orientation c_orientation = 2; // [0: x direction, 1: y direction, 2: z direction] -// radius of cylindrical cut outs -r = 10; +// diameter of cylindrical cut outs +cd = 10; // cylinder height -ch = 10; +ch = 1; +// spacing to lid +c_depth = 1; /* [Height] */ // determine what the variable "gridz" applies to based on your use case @@ -95,10 +97,22 @@ gridfinityInit(gridx, gridy, height(gridz, gridz_define, style_lip, enable_zsnap : (c_orientation == 1) ? [90,0,0] : [0,0,0]; - cut_move(x=0, y=0, w=gridx, h=gridy) - pattern_linear(x=cdivx, y=cdivy, sx=42*gridx/cdivx, sy=42*gridy/cdivy) - rotate(rotation) - cylinder(r=r, h=ch, center=true); + + gridx_mm = gridx*l_grid; + gridy_mm = gridy*l_grid; + padding = 2; + cutout_x = [gridx_mm-d_wall*2]; + cutout_y = [gridy_mm-d_wall*2]; + + cut_move(x=0, y=0, w=gridx, h=gridy) { + translate([0,0,-c_depth]) { + rounded_rectangle(cutout_x, cutout_y, c_depth*2, r_base); + + pattern_linear(x=cdivx, y=cdivy, sx=(gridx_mm - 2)/cdivx, sy=(gridy_mm - 2)/cdivy) + rotate(rotation) + cylinder(r=cd/2, h=ch*2, center=true); + } + } } } gridfinityBase(gridx, gridy, l_grid, div_base_x, div_base_y, style_hole, only_corners=only_corners); From 41cdc2a46d9859a923e04ad61899fbf724436a8f Mon Sep 17 00:00:00 2001 From: Jannes Magnusson Date: Mon, 23 Oct 2023 21:38:02 +0200 Subject: [PATCH 3/8] add cylindrical cutouts --- gridfinity-rebuilt-bins.scad | 42 ++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/gridfinity-rebuilt-bins.scad b/gridfinity-rebuilt-bins.scad index de9dc1e..c5a1694 100644 --- a/gridfinity-rebuilt-bins.scad +++ b/gridfinity-rebuilt-bins.scad @@ -29,17 +29,29 @@ $fs = 0.25; /* [General Settings] */ // number of bases along x-axis -gridx = 5; +gridx = 3; // number of bases along y-axis -gridy = 5; +gridy = 2; // bin height. See bin height information and "gridz_define" below. gridz = 6; -/* [Compartments] */ +/* [Linear Compartments] */ // number of X Divisions (set to zero to have solid bin) -divx = 1; -// number of y Divisions (set to zero to have solid bin) -divy = 1; +divx = 0; +// number of Y Divisions (set to zero to have solid bin) +divy = 0; + +/* [Cylindrical Compartments] */ +// number of cylindrical X Divisions (mutually exclusive to Linear Compartments) +cdivx = 0; +// number of cylindrical Y Divisions (mutually exclusive to Linear Compartments) +cdivy = 0; +// orientation +c_orientation = 2; // [0: x direction, 1: y direction, 2: z direction] +// radius of cylindrical cut outs +r = 10; +// cylinder height +ch = 10; /* [Height] */ // determine what the variable "gridz" applies to based on your use case @@ -73,11 +85,23 @@ div_base_y = 0; color("tomato") { gridfinityInit(gridx, gridy, height(gridz, gridz_define, style_lip, enable_zsnap), height_internal) { - if (divx > 0 && divy > 0) - cutEqual(n_divx = divx, n_divy = divy, style_tab = style_tab, scoop_weight = scoop); + if (divx > 0 && divy > 0) { + + cutEqual(n_divx = divx, n_divy = divy, style_tab = style_tab, scoop_weight = scoop); + + } else if (cdivx > 0 && cdivy > 0) { + rotation = (c_orientation == 0) + ? [0,90,0] + : (c_orientation == 1) + ? [90,0,0] + : [0,0,0]; + cut_move(x=0, y=0, w=gridx, h=gridy) + pattern_linear(x=cdivx, y=cdivy, sx=42*gridx/cdivx, sy=42*gridy/cdivy) + rotate(rotation) + cylinder(r=r, h=ch, center=true); + } } gridfinityBase(gridx, gridy, l_grid, div_base_x, div_base_y, style_hole, only_corners=only_corners); - } From 3324c6b2a7b5089d4a06bc5fadc919b48b756741 Mon Sep 17 00:00:00 2001 From: Jannes Magnusson Date: Wed, 25 Oct 2023 20:58:55 +0200 Subject: [PATCH 4/8] add spacing for cylinders --- gridfinity-rebuilt-bins.scad | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/gridfinity-rebuilt-bins.scad b/gridfinity-rebuilt-bins.scad index c5a1694..4c4e3f2 100644 --- a/gridfinity-rebuilt-bins.scad +++ b/gridfinity-rebuilt-bins.scad @@ -48,10 +48,12 @@ cdivx = 0; cdivy = 0; // orientation c_orientation = 2; // [0: x direction, 1: y direction, 2: z direction] -// radius of cylindrical cut outs -r = 10; +// diameter of cylindrical cut outs +cd = 10; // cylinder height -ch = 10; +ch = 1; +// spacing to lid +c_depth = 1; /* [Height] */ // determine what the variable "gridz" applies to based on your use case @@ -95,10 +97,22 @@ gridfinityInit(gridx, gridy, height(gridz, gridz_define, style_lip, enable_zsnap : (c_orientation == 1) ? [90,0,0] : [0,0,0]; - cut_move(x=0, y=0, w=gridx, h=gridy) - pattern_linear(x=cdivx, y=cdivy, sx=42*gridx/cdivx, sy=42*gridy/cdivy) - rotate(rotation) - cylinder(r=r, h=ch, center=true); + + gridx_mm = gridx*l_grid; + gridy_mm = gridy*l_grid; + padding = 2; + cutout_x = [gridx_mm-d_wall*2]; + cutout_y = [gridy_mm-d_wall*2]; + + cut_move(x=0, y=0, w=gridx, h=gridy) { + translate([0,0,-c_depth]) { + rounded_rectangle(cutout_x, cutout_y, c_depth*2, r_base); + + pattern_linear(x=cdivx, y=cdivy, sx=(gridx_mm - 2)/cdivx, sy=(gridy_mm - 2)/cdivy) + rotate(rotation) + cylinder(r=cd/2, h=ch*2, center=true); + } + } } } gridfinityBase(gridx, gridy, l_grid, div_base_x, div_base_y, style_hole, only_corners=only_corners); From 6202c73b213f77c25e5b4e1be63015756b2e2517 Mon Sep 17 00:00:00 2001 From: Jannes Date: Tue, 21 Nov 2023 21:41:08 +0100 Subject: [PATCH 5/8] move cylindrical cutouts to utility --- gridfinity-rebuilt-bins.scad | 21 +------------------- gridfinity-rebuilt-utility.scad | 35 ++++++++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 21 deletions(-) diff --git a/gridfinity-rebuilt-bins.scad b/gridfinity-rebuilt-bins.scad index 4c4e3f2..51fd2d4 100644 --- a/gridfinity-rebuilt-bins.scad +++ b/gridfinity-rebuilt-bins.scad @@ -92,27 +92,8 @@ gridfinityInit(gridx, gridy, height(gridz, gridz_define, style_lip, enable_zsnap cutEqual(n_divx = divx, n_divy = divy, style_tab = style_tab, scoop_weight = scoop); } else if (cdivx > 0 && cdivy > 0) { - rotation = (c_orientation == 0) - ? [0,90,0] - : (c_orientation == 1) - ? [90,0,0] - : [0,0,0]; - gridx_mm = gridx*l_grid; - gridy_mm = gridy*l_grid; - padding = 2; - cutout_x = [gridx_mm-d_wall*2]; - cutout_y = [gridy_mm-d_wall*2]; - - cut_move(x=0, y=0, w=gridx, h=gridy) { - translate([0,0,-c_depth]) { - rounded_rectangle(cutout_x, cutout_y, c_depth*2, r_base); - - pattern_linear(x=cdivx, y=cdivy, sx=(gridx_mm - 2)/cdivx, sy=(gridy_mm - 2)/cdivy) - rotate(rotation) - cylinder(r=cd/2, h=ch*2, center=true); - } - } + cutCylinders(n_divx=cdivx, n_divy=cdivy, cylinder_diameter=cd, cylinder_height=ch, coutout_depth=c_depth, orientation=c_orientation); } } gridfinityBase(gridx, gridy, l_grid, div_base_x, div_base_y, style_hole, only_corners=only_corners); diff --git a/gridfinity-rebuilt-utility.scad b/gridfinity-rebuilt-utility.scad index 67a43e1..8bcef9d 100644 --- a/gridfinity-rebuilt-utility.scad +++ b/gridfinity-rebuilt-utility.scad @@ -22,6 +22,39 @@ module cutEqual(n_divx=1, n_divy=1, style_tab=1, scoop_weight=1) { cut((i-1)*$gxx/n_divx,(j-1)*$gyy/n_divy, $gxx/n_divx, $gyy/n_divy, style_tab, scoop_weight); } +// Creates equally divided cylindrical cutouts +// +// n_divx: number of x cutouts +// n_divy: number of y cutouts +// set n_div values to 0 for a solid bin +// cylinder_diameter: diameter of cutouts +// cylinder_height: height of cutouts +// coutout_depth: offset from top to solid part of container +// orientation: orientation of cylinder cutouts (0 = x direction, 1 = y direction, 2 = z direction) +module cutCylinders(n_divx=1, n_divy=1, cylinder_diameter=1, cylinder_height=1, coutout_depth=0, orientation=0) { + rotation = (orientation == 0) + ? [0,90,0] + : (orientation == 1) + ? [90,0,0] + : [0,0,0]; + + gridx_mm = $gxx*l_grid; + gridy_mm = $gyy*l_grid; + padding = 2; + cutout_x = gridx_mm - d_wall*2; + cutout_y = gridy_mm - d_wall*2; + + cut_move(x=0, y=0, w=$gxx, h=$gyy) { + translate([0,0,-coutout_depth]) { + rounded_rectangle(cutout_x, cutout_y, coutout_depth*2, r_base); + + pattern_linear(x=n_divx, y=n_divy, sx=(gridx_mm - 2)/n_divx, sy=(gridy_mm - 2)/n_divy) + rotate(rotation) + cylinder(r=cylinder_diameter/2, h=cylinder_height*2, center=true); + } + } +} + // initialize gridfinity module gridfinityInit(gx, gy, h, h0 = 0, l = l_grid) { $gxx = gx; @@ -65,7 +98,7 @@ module cut_move(x, y, w, h) { 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(); -} +} // ===== Modules ===== // From 084f8ed9818c91e36fffb55b9ef24c098df8bc9d Mon Sep 17 00:00:00 2001 From: schorsch3000 Date: Sat, 6 Jan 2024 02:04:01 +0100 Subject: [PATCH 6/8] Bugfix/fix fixed baseplate offest (#143) * make the baseplate xy offset configurable * rename variable to be shorter --------- Co-authored-by: Dirk Heilig --- gridfinity-rebuilt-baseplate.scad | 8 ++++---- standard.scad | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gridfinity-rebuilt-baseplate.scad b/gridfinity-rebuilt-baseplate.scad index 65271b4..0c6c954 100644 --- a/gridfinity-rebuilt-baseplate.scad +++ b/gridfinity-rebuilt-baseplate.scad @@ -72,13 +72,13 @@ module gridfinityBaseplate(gridx, gridy, length, dix, diy, sp, sm, sh, fitx, fit gx = gridx == 0 ? floor(dix/length) : gridx; gy = gridy == 0 ? floor(diy/length) : gridy; - dx = max(gx*length-0.5, dix); - dy = max(gy*length-0.5, diy); + dx = max(gx*length-bp_xy_clearence, dix); + dy = max(gy*length-bp_xy_clearence, diy); off = calculate_off(sp, sm, sh); - offsetx = dix < dx ? 0 : (gx*length-0.5-dix)/2*fitx*-1; - offsety = diy < dy ? 0 : (gy*length-0.5-diy)/2*fity*-1; + offsetx = dix < dx ? 0 : (gx*length-bp_xy_clearence-dix)/2*fitx*-1; + offsety = diy < dy ? 0 : (gy*length-bp_xy_clearence-diy)/2*fity*-1; difference() { translate([offsetx,offsety,h_base]) diff --git a/standard.scad b/standard.scad index 1987016..86a669d 100644 --- a/standard.scad +++ b/standard.scad @@ -69,6 +69,8 @@ bp_rcut_width = 8.5; bp_rcut_length = 4.25; // Baseplate bottom cutout rounded thingy depth bp_rcut_depth = 2; +// Baseplate clearence offset +bp_xy_clearence = 0.5; // countersink diameter for baseplate d_cs = 2.5; // radius of cutout for skeletonized baseplate From 7a33233ee9c877aea99619297a435ecd4225625e Mon Sep 17 00:00:00 2001 From: Brandon Gibbs Date: Wed, 18 Oct 2023 08:59:29 -0500 Subject: [PATCH 7/8] fix #126 --- gridfinity-rebuilt-lite.scad | 88 ++++++++++++++++++++++++++---------- 1 file changed, 64 insertions(+), 24 deletions(-) diff --git a/gridfinity-rebuilt-lite.scad b/gridfinity-rebuilt-lite.scad index e127e5a..f1aa19f 100644 --- a/gridfinity-rebuilt-lite.scad +++ b/gridfinity-rebuilt-lite.scad @@ -64,34 +64,74 @@ gridfinityLite(gridx, gridy, gridz, gridz_define, style_lip, enable_zsnap, l_gri module gridfinityLite(gridx, gridy, gridz, gridz_define, style_lip, enable_zsnap, length, div_base_x, div_base_y, style_hole, only_corners) { - difference() { - union() { - gridfinityInit(gridx, gridy, height(gridz, gridz_define, style_lip, enable_zsnap), 0, length) - children(); - gridfinityBase(gridx, gridy, length, div_base_x, div_base_y, style_hole, only_corners=only_corners); - } - + union() { difference() { union() { - intersection() { - difference() { - gridfinityBase(gridx, gridy, length, div_base_x, div_base_y, style_hole, -d_wall*2, false, only_corners=only_corners); - 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,bottom_layer]) - rounded_rectangle(gridx*1000, gridy*1000, 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); + gridfinityInit(gridx, gridy, height(gridz, gridz_define, style_lip, enable_zsnap), 0, length) + children(); + gridfinityBase(gridx, gridy, length, div_base_x, div_base_y, style_hole, only_corners=only_corners); } - translate([0,0,-4*h_base]) - gridfinityInit(gridx, gridy, height(20,0), 0, length) - children(); - } + difference() { + union() { + intersection() { + difference() { + gridfinityBase(gridx, gridy, length, div_base_x, div_base_y, style_hole, -d_wall*2, false, only_corners=only_corners); + 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,bottom_layer]) + rounded_rectangle(gridx*1000, gridy*1000, 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) + children(); + } + + } + difference() { + translate([0,0,-1.6]) + difference() { + difference() { + union() { + + gridfinityInit(gridx, gridy, height(gridz, gridz_define, style_lip, enable_zsnap), 0, length) + children(); + } + + difference() { + + intersection() { + difference() { + gridfinityBase(gridx, gridy, length, div_base_x, div_base_y, style_hole, -d_wall*2, false, only_corners=only_corners); + 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,bottom_layer]) + rounded_rectangle(gridx*1000, gridy*1000, 1000, r_f2); + } + + + translate([0,0,-4*h_base]) + gridfinityInit(gridx, gridy, height(20,0), 0, length) + children(); + } + + } + translate([0,0,9]) + rounded_rectangle(gridx*1000, gridy*1000, gridz*1000, gridz); + } + translate([0,0,0]) + rounded_rectangle(gridx*1000, gridy*1000, 5, r_f2); + } + } } \ No newline at end of file From 5e70a29f6fc04179e85240c97ed2a8c69a8bf703 Mon Sep 17 00:00:00 2001 From: Lowell Alleman Date: Tue, 17 Oct 2023 11:05:23 -0400 Subject: [PATCH 8/8] Update index.md Add a link back to the main github page --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index 04f729f..c94e088 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,7 +1,7 @@ ## Introduction Gridfinity rebuilt aims to remake the brilliant Gridfinity project from [Zack Freedman](https://www.youtube.com/c/ZackFreedman/about) in a more robust and open-source way than the original Fusion 360 files. Many major CAD suites struggle with making parametric models constructed from linear patterns, due to changing fillet edges and seams. Thus, a pure mathematical approach using OpenSCAD can allow a single solution for all possible bin variants. -The project has expanded into more eccentric models that use modules from the original generator. This wiki aims to document these modules in great detail. +The [project](https://github.com/kennetek/gridfinity-rebuilt-openscad/) has expanded into more eccentric models that use modules from the original generator. This wiki aims to document these modules in great detail. Models are generated subtractively. First, the solid bin and bases are constructed, and then the compartments and holes are removed. This allows for internal fillets that nearly match the originals. However, they are not exactly perfect. There are some fillets that are too small and too difficult to be worth implementing, as most printers do not have a high enough resolution for it to matter.