chiark / gitweb /
toolbox-inserts: WellSurround: prep for screws
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 21 Apr 2025 10:49:07 +0000 (11:49 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 21 Apr 2025 10:49:07 +0000 (11:49 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
toolbox-inserts.scad

index 48041ce6b3401d72cb53403f6e6bb8cef27be948..2cdc6c37ce906697b99a96b6f27104b8e3ee0acf 100644 (file)
@@ -38,6 +38,20 @@ module WallMinkowskiSphere(wall=well_surround_wall) { ////toplevel
   sphere($fn=8, r=wall/2);
 }
 
+// AtScrewPositions([ screw, screw, ...]) ScrewItem();
+//
+// Each screw is [x,y] or [x,y, depth]
+// where x and y are the position in fixing stride
+//
+// ScrewItem should use $depth
+module AtScrewPositions(screws) {
+  for (screw = hull_group) {
+    $screw_depth = is_undef(screw[2]) ? screw_depth : screw[2];
+    translate(fixing_pitch * [screw[0], screw[1], 0])
+      children(0);
+  }
+}
+
 // WellSurround(...) {
 //     SomethingPositive();
 // }
@@ -50,8 +64,9 @@ module WellSurround(
   half_height,
   // gaps for picking up object, [ [ x_min, x_max ], ... ]
   gaps,
-  // screw locations in stride units, [ [ [screw_xu, screw_yu], ...], ... ]
+  // screw locations in stride units, [ [ screw, ...], ... ]
   // in hull groups (screw receptacles are hulled within each group)
+  // screw as for AtScrewPositions
   screws,
   // offset=[x,y] moves the whole thing by that amount, but not the screws
   offset,
@@ -70,7 +85,12 @@ module WellSurround(
            children(0);
        }
 
-       
+       for (hull_group = screws) {
+         hull() {
+           AtScrewPositions(screws) {
+           }
+         }
+       }
       }
 
 //     minkowski(){