From 3b90df14f58d51734a4b3ff2e53b6b8c31ecfcdc Mon Sep 17 00:00:00 2001 From: Ruud Swinkels Date: Wed, 26 Apr 2023 19:05:37 +0200 Subject: [PATCH] fix dynamic hole location on grid length --- gridfinity-constants.scad | 4 +++- gridfinity-rebuilt-utility.scad | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gridfinity-constants.scad b/gridfinity-constants.scad index 7e93649..29c40c2 100644 --- a/gridfinity-constants.scad +++ b/gridfinity-constants.scad @@ -21,7 +21,9 @@ r_hole1 = 1.5; // magnet hole radius r_hole2 = 3.25; // center-to-center distance between holes -d_hole = 26; +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) diff --git a/gridfinity-rebuilt-utility.scad b/gridfinity-rebuilt-utility.scad index 8bc7cbe..a18affc 100644 --- a/gridfinity-rebuilt-utility.scad +++ b/gridfinity-rebuilt-utility.scad @@ -112,8 +112,8 @@ module block_base(gx, gy, l, dbnx, dbny, style_hole, off) { pattern_linear(2, 2, (gx-1)*length+d_hole, (gy-1)*length+d_hole) block_base_hole(style_hole / p_corn, off); else - pattern_circular(abs(d_hole)<0.001?1:4) - translate([d_hole/2, d_hole/2, 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]) block_base_hole(style_hole, off); } }