From a92c740c0d7fba24e3a936ab4b5b45275f9019d9 Mon Sep 17 00:00:00 2001 From: Jannes Magnusson Date: Mon, 23 Oct 2023 21:38:02 +0200 Subject: [PATCH 1/2] 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/2] 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);