Bit Holder
A stepped rack for 1/4 inch hex screwdriver bits. Each row sits higher than the one in front and every socket leans back 15 degrees, so the tips and labels of all the bits are visible at once and a bit lifts straight out without touching the row behind. The sockets are hexagons with clearance for standard 6.35 mm bits, and the common labels (PH1 to PH3, PZ1 to PZ3, T10 to T40, H3 to H6, SL4, SL6) are engraved in front of each socket; they can be turned off for a plain rack. The default of three rows of six measures 78 x 60 x 32 mm. Prints flat on its base with no supports. Parameters: sockets per row, rows, pitch, step depth and rise, socket depth, tilt, clearance and labels.
# Bit Holder - stepped rack for 1/4 inch hex screwdriver bits, tilted sockets, labelled
#
# A stadium-stepped block that holds screwdriver bits in rows: each row sits higher than
# the one in front, and every socket leans back 15 deg, so the tips and labels of all the
# bits are visible at once and a bit is picked straight out without hitting the row behind.
# Sockets are 1/4 inch (6.35 mm) hexagons with clearance, and the usual labels (PH, PZ,
# Torx, hex, slotted) are engraved in front of each socket; turn them off for a plain rack.
# Prints flat on its base with no supports (the sockets lean 15 deg, well under 45).
@param 3..10 desc:"Sockets per row"
$cols = 6
@param 1..4 desc:"Rows"
$rows = 3
@param 10..16 desc:"Socket pitch along the row (mm)"
$pitch = 12
@param 16..26 desc:"Step depth per row (mm)"
$step_d = 20
@param 6..14 desc:"Step rise per row (mm)"
$rise = 8
@param 10..16 desc:"Socket depth (mm)"
$socket_d = 12
@param 0..25 desc:"Socket tilt, leaning back (deg)"
$tilt = 15
@param 0.2..0.8 step:0.1 desc:"Socket clearance across flats (mm)"
$fit = 0.5
@param desc:"Engrave bit labels"
$labels = true
# --- Block: one box per row, each from its front edge to the back, taller by one rise -----
$hex_af = 6.35 + $fit
$hex_r = $hex_af / 2 / cos(30)
$W = $cols * $pitch + 6
$D = $rows * $step_d
$h0 = $socket_d + 4 # first row top: socket depth plus floor
$H = $h0 + ($rows - 1) * $rise
def zk($k) = $h0 + $k * $rise
def yk($k) = -($D / 2) + $k * $step_d # front edge of row k
$steps = union [box $W ($D - $k * $step_d) zk($k) center:(true, false, false) | translate 0 yk($k) 0 for $k in range($rows)]
# --- Sockets: hex prism hanging from the step top, tilted back about its top centre ------
$sock0 = polygon 6 $hex_r | rotate 30 | extrude ($socket_d + 1) | translate 0 0 (-($socket_d + 1))
$sock = $sock0 | rotate $tilt 0 0 | translate 0 0 0.01
def sx($i) = ($i - ($cols - 1) / 2) * $pitch
$socket_y = $step_d * 0.62 # sockets toward the back of each step, labels in front
$sockets = union [$sock | translate sx(i % $cols) (yk(i // $cols) + $socket_y) zk(i // $cols) for i in range($cols * $rows)]
# --- Labels, engraved 0.5 mm into the step top in front of each socket --------------------
def lab($i) = if $i == 0 then "PH1" else if $i == 1 then "PH2" else if $i == 2 then "PH3" else if $i == 3 then "PZ1" else if $i == 4 then "PZ2" else if $i == 5 then "PZ3" else if $i == 6 then "T10" else if $i == 7 then "T15" else if $i == 8 then "T20" else if $i == 9 then "T25" else if $i == 10 then "T30" else if $i == 11 then "T40" else if $i == 12 then "H3" else if $i == 13 then "H4" else if $i == 14 then "H5" else if $i == 15 then "H6" else if $i == 16 then "SL4" else if $i == 17 then "SL6" else if $i == 18 then "SQ1" else if $i == 19 then "SQ2" else if $i == 20 then "T8" else if $i == 21 then "T27" else if $i == 22 then "H2" else if $i == 23 then "H8" else ("" + ($i + 1))
# the socket's front edge after tilting: ~hex_r in front of its centre, plus the lean
$lab_y = $socket_y / 2 - 1.5
$lab_h = min(3.4, $socket_y - $hex_r - 3)
$label_cut = union [text lab(i) $lab_h | extrude 1 | translate sx(i % $cols) (yk(i // $cols) + $lab_y) (zk(i // $cols) - 0.5) for i in range($cols * $rows)]
$rack0 = $steps - $sockets
$rack = if $labels then $rack0 - $label_cut else $rack0
# --- Checks ------------------------------------------------------------------------------
assert $rack.solids == 1
assert $rack.bbox.x ~ $W
assert $rack.bbox.y ~ $D
assert $rack.bbox.z ~ $H
assert $rack.volume < $steps.volume
assert $lab_h >= 2.5 # label has room in front of the socket
assert $socket_d * sin($tilt) + $hex_r < $step_d * 0.62 + $step_d * 0.38 # tilted socket stays inside its row
print "size" $rack.bbox.x
$rack