chiark / gitweb /
toolbox-inserts: bits: new BitAtBits, with staggered, etc.
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 14 Oct 2025 21:29:37 +0000 (22:29 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 14 Oct 2025 21:29:37 +0000 (22:29 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
toolbox-inserts.scad

index bcc143e4ca82a506c306e75459d7d342324ff284..ad9ed6bcbed895e2767e95841fe292d19a45b098 100644 (file)
@@ -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);
     }