From 6387b6606c8329ad08b1d28bb9c2017bf1c09ec7 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 14 Oct 2025 22:29:37 +0100 Subject: [PATCH] toolbox-inserts: bits: new BitAtBits, with staggered, etc. Signed-off-by: Ian Jackson --- toolbox-inserts.scad | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/toolbox-inserts.scad b/toolbox-inserts.scad index bcc143e..ad9ed6b 100644 --- a/toolbox-inserts.scad +++ b/toolbox-inserts.scad @@ -81,6 +81,8 @@ bit_mag_th = 1.0 - 0.200; bit_h = 10; bit_fixing_depth = 6.0; +bit_row_lengths = [9, 10, 11, 8]; + bit_holder_offset = fixing_pitch * [+0.0, -0.0]; bit_holder_fixings_dn = -1; bit_holder_fixings_ys = [-1, +1]; @@ -624,9 +626,11 @@ module BitMagnetHolderPlan() { BitHolderInnerPlan(); } module BitAtBits() { - for (x = [0 : bit_n_x-1]) { - for (y = [0 : bit_n_y-1]) { - xy = [x, y] - [bit_n_x-1, bit_n_y-1]/2; + ny = len(bit_row_lengths); + for (y = [0: ny-1]) { + nx = bit_row_lengths[y]; + for (x = [0: nx-1]) { + xy = [x, y] - [nx-1, ny-1]/2; translate([xy[0] * bit_pitch_x, xy[1] * bit_pitch_y]) children(0); } -- 2.30.2