Add chamfers to cylindrical cutout holes

This commit is contained in:
Timothy Stranex 2024-02-03 21:49:44 +00:00 committed by Ruud
parent 0fdb10526f
commit d6eb8402e9
2 changed files with 12 additions and 4 deletions

View file

@ -54,6 +54,8 @@ cd = 10;
ch = 1;
// spacing to lid
c_depth = 1;
// chamfer around the top rim of the holes
c_chamfer = 0.5;
/* [Height] */
// determine what the variable "gridz" applies to based on your use case

View file

@ -31,7 +31,8 @@ module cutEqual(n_divx=1, n_divy=1, style_tab=1, scoop_weight=1) {
// 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) {
// 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) {
rotation = (orientation == 0)
? [0,90,0]
: (orientation == 1)
@ -48,9 +49,14 @@ module cutCylinders(n_divx=1, n_divy=1, cylinder_diameter=1, cylinder_height=1,
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)
pattern_linear(x=n_divx, y=n_divy, sx=(gridx_mm - padding)/n_divx, sy=(gridy_mm - padding)/n_divy)
rotate(rotation)
cylinder(r=cylinder_diameter/2, h=cylinder_height*2, center=true);
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);
}
};
}
}
}