From: Ian Jackson Date: Mon, 21 Apr 2025 10:49:07 +0000 (+0100) Subject: toolbox-inserts: WellSurround: prep for screws X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=ed10a297143e33cee3378de340be1f99eff0f1bd;p=reprap-play.git toolbox-inserts: WellSurround: prep for screws Signed-off-by: Ian Jackson --- diff --git a/toolbox-inserts.scad b/toolbox-inserts.scad index 48041ce..2cdc6c3 100644 --- a/toolbox-inserts.scad +++ b/toolbox-inserts.scad @@ -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(){