From a4200a04bd3a38ace649981aaa93871b82bab354 Mon Sep 17 00:00:00 2001 From: Arthur Moore Date: Sun, 21 Apr 2024 22:25:48 -0400 Subject: [PATCH] Simplify refined_hole() --- gridfinity-rebuilt-holes.scad | 25 +++++++++++++------------ gridfinity-rebuilt-utility.scad | 32 ++++++++++++++------------------ standard.scad | 4 ---- 3 files changed, 27 insertions(+), 34 deletions(-) diff --git a/gridfinity-rebuilt-holes.scad b/gridfinity-rebuilt-holes.scad index 25f3c5c..29d4c25 100644 --- a/gridfinity-rebuilt-holes.scad +++ b/gridfinity-rebuilt-holes.scad @@ -17,22 +17,23 @@ module refined_hole() { // Poke through - For removing a magnet using a toothpick ptl = refined_offset + LAYER_HEIGHT; // Additional layer just in case - poke_through_height = REFINED_HOLE_HEIGHT+ptl; // Poke Through Height - poke_hole_radius = 2.5; // Poke Through Radius + poke_through_height = REFINED_HOLE_HEIGHT + ptl; + poke_hole_radius = 2.5; magic_constant = 5.60; poke_hole_center = [-12.53 + magic_constant, 0, -ptl]; + translate([0, 0, refined_offset]) union() { - hull() { - // Magnet hole - smaller than the magnet to keep it squeezed - translate([10, -REFINED_HOLE_RADIUS, 0]) cube([1, REFINED_HOLE_RADIUS*2, REFINED_HOLE_HEIGHT]); - cylinder(1.9, r=REFINED_HOLE_RADIUS); - } - hull() { - // Poke hole - translate([-9+magic_constant, -poke_hole_radius/2, -ptl]) cube([1, poke_hole_radius, poke_through_height]); - translate(poke_hole_center) cylinder(poke_through_height, d=poke_hole_radius); - } + // Magnet hole + translate([0, -REFINED_HOLE_RADIUS, 0]) + cube([11, REFINED_HOLE_RADIUS*2, REFINED_HOLE_HEIGHT]); + cylinder(REFINED_HOLE_HEIGHT, r=REFINED_HOLE_RADIUS); + + // Poke hole + translate([poke_hole_center.x, -poke_hole_radius/2, poke_hole_center.z]) + cube([10 - magic_constant, poke_hole_radius, poke_through_height]); + translate(poke_hole_center) + cylinder(poke_through_height, d=poke_hole_radius); } } diff --git a/gridfinity-rebuilt-utility.scad b/gridfinity-rebuilt-utility.scad index 8caef04..1a75828 100644 --- a/gridfinity-rebuilt-utility.scad +++ b/gridfinity-rebuilt-utility.scad @@ -231,24 +231,21 @@ module gridfinityBase(gx, gy, l, dx, dy, style_hole, off=0, final_cut=true, only difference(){ pattern_linear(gx/dbnx, gy/dbny, dbnx*l, dbny*l) block_base(gx, gy, l, dbnx, dbny, 0, off); - if (style_hole == 4) { - translate([(gx/2)*l_grid - d_hole_from_side, (gy/2) * l_grid - d_hole_from_side, LAYER_HEIGHT*REFINED_HOLE_BOTTOM_LAYERS]) - refined_hole(); - mirror([1, 0, 0]) - translate([(gx/2)*l_grid - d_hole_from_side, (gy/2) * l_grid - d_hole_from_side, LAYER_HEIGHT*REFINED_HOLE_BOTTOM_LAYERS]) - refined_hole(); - mirror([0, 1, 0]) { - translate([(gx/2)*l_grid - d_hole_from_side, (gy/2) * l_grid - d_hole_from_side, LAYER_HEIGHT*REFINED_HOLE_BOTTOM_LAYERS]) - refined_hole(); - mirror([1, 0, 0]) - translate([(gx/2)*l_grid - d_hole_from_side, (gy/2) * l_grid - d_hole_from_side, LAYER_HEIGHT*REFINED_HOLE_BOTTOM_LAYERS]) - refined_hole(); + + copy_mirror([0, 1, 0]) { + copy_mirror([1, 0, 0]) { + translate([ + (gx/2)*l_grid - d_hole_from_side, + (gy/2) * l_grid - d_hole_from_side, + 0 + ]) + if (style_hole == 4) { + refined_hole(); + }else { + block_base_hole(style_hole, off); + } } } - else { - pattern_linear(2, 2, (gx-1)*l_grid+d_hole, (gy-1)*l_grid+d_hole) - block_base_hole(style_hole, off); - } } } else { @@ -275,11 +272,10 @@ module block_base(gx, gy, l, dbnx, dbny, style_hole, off) { if (style_hole > 0) pattern_circular(abs(l-d_hole_from_side/2)<0.001?1:4) + translate([l/2-d_hole_from_side, l/2-d_hole_from_side, 0]) if (style_hole == 4) - translate([l/2-d_hole_from_side, l/2-d_hole_from_side, LAYER_HEIGHT*REFINED_HOLE_BOTTOM_LAYERS]) refined_hole(); else - translate([l/2-d_hole_from_side, l/2-d_hole_from_side, 0]) block_base_hole(style_hole, off); } } diff --git a/standard.scad b/standard.scad index 8b2b4df..e86b2da 100644 --- a/standard.scad +++ b/standard.scad @@ -35,10 +35,6 @@ MAGNET_HOLE_DEPTH = MAGNET_HEIGHT + (LAYER_HEIGHT * 2); d_hole = 26; // distance of hole from side of bin d_hole_from_side=8; -// magnet hole depth -h_hole = 2.4; -// slit depth (printer layer height) -h_slit = 0.2; // Meassured diameter in Fusion360. // Smaller than the magnet to keep it squeezed.