From 548f3d011e1af82a5e6f3be7f17f891423c19a32 Mon Sep 17 00:00:00 2001 From: Rocka84 Date: Sat, 18 May 2024 16:33:54 +0200 Subject: [PATCH] use cut_indent() for depth of cylindrical compartments --- gridfinity-rebuilt-bins.scad | 4 +++- gridfinity-rebuilt-utility.scad | 26 +++++++++++--------------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/gridfinity-rebuilt-bins.scad b/gridfinity-rebuilt-bins.scad index 3e46932..164e922 100644 --- a/gridfinity-rebuilt-bins.scad +++ b/gridfinity-rebuilt-bins.scad @@ -54,6 +54,8 @@ cd = 10; ch = 1; // spacing to lid c_depth = 1; +// fillet between indentation and walls +c_fillet = false; // chamfer around the top rim of the holes c_chamfer = 0.5; @@ -95,7 +97,7 @@ gridfinityInit(gridx, gridy, height(gridz, gridz_define, style_lip, enable_zsnap } else if (cdivx > 0 && cdivy > 0) { - cutCylinders(n_divx=cdivx, n_divy=cdivy, cylinder_diameter=cd, cylinder_height=ch, coutout_depth=c_depth, orientation=c_orientation, chamfer=c_chamfer); + cutCylinders(n_divx=cdivx, n_divy=cdivy, cylinder_diameter=cd, cylinder_height=ch, cutout_depth=c_depth, orientation=c_orientation, chamfer=c_chamfer,cutout_fillet=c_fillet); } } 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 4a7e3d0..0ddb5f2 100644 --- a/gridfinity-rebuilt-utility.scad +++ b/gridfinity-rebuilt-utility.scad @@ -85,10 +85,10 @@ module cutEqual(n_divx=1, n_divy=1, style_tab=1, scoop_weight=1) { // 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 +// cutout_depth: offset from top to solid part of container // orientation: orientation of cylinder cutouts (0 = x direction, 1 = y direction, 2 = z direction) // chamfer: chamfer around the top rim of the holes -module cutCylinders(n_divx=1, n_divy=1, cylinder_diameter=1, cylinder_height=1, coutout_depth=0, orientation=0, chamfer=0.5) { +module cutCylinders(n_divx=1, n_divy=1, cylinder_diameter=1, cylinder_height=1, cutout_depth=0, orientation=0, chamfer=0.5, cutout_fillet=false) { rotation = (orientation == 0) ? [0,90,0] : (orientation == 1) @@ -101,19 +101,15 @@ module cutCylinders(n_divx=1, n_divy=1, cylinder_diameter=1, cylinder_height=1, 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 - padding)/n_divx, sy=(gridy_mm - padding)/n_divy) - rotate(rotation) - union() { - cylinder(d=cylinder_diameter, h=cylinder_height*2, center=true); - if (chamfer > 0) { - translate([0,0,-chamfer]) cylinder(d1=cylinder_diameter, d2=cylinder_diameter+4*chamfer, h=2*chamfer); - } - }; - } + cut_indent(cutout_depth,x=0, y=0, w=$gxx, h=$gyy, enable_fillet=cutout_fillet) { + pattern_linear(x=n_divx, y=n_divy, sx=(gridx_mm - padding)/n_divx, sy=(gridy_mm - padding)/n_divy) + rotate(rotation) + union() { + cylinder(d=cylinder_diameter, h=cylinder_height*2, center=true); + if (chamfer > 0) { + translate([0,0,-chamfer]) cylinder(d1=cylinder_diameter, d2=cylinder_diameter+4*chamfer, h=2*chamfer); + } + }; } }