Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add chamfers to cylindrical cutout holes #161

Merged
merged 2 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion gridfinity-rebuilt-bins.scad
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -93,7 +95,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);
cutCylinders(n_divx=cdivx, n_divy=cdivy, cylinder_diameter=cd, cylinder_height=ch, coutout_depth=c_depth, orientation=c_orientation, chamfer=c_chamfer);
}
}
gridfinityBase(gridx, gridy, l_grid, div_base_x, div_base_y, style_hole, only_corners=only_corners);
Expand Down
14 changes: 10 additions & 4 deletions gridfinity-rebuilt-utility.scad
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
rotate(rotation)
cylinder(r=cylinder_diameter/2, h=cylinder_height*2, center=true);
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);
}
};
}
}
}
Expand Down
Loading