Depth Gauge
A two-part depth gauge: a bridge that rests across the mouth of a hole, mortise or groove, and a flat rod with a millimetre scale that slides through it. Push the rod down to the bottom and read the depth on the rod at the top face of the bridge; the scale is offset by the bridge thickness, so the reading is the true depth below the bridge's underside. A leaf spring in the slot wall, cut free by a slit, presses on the rod so it keeps its position when the gauge is lifted out, and a T head keeps the rod from falling through. The default 100 mm range lays out as 120 x 42 x 10 mm. Prints flat with no supports: bridge on its base with the slot vertical, rod on its back. Parameters: measuring range, bridge length, rod width and thickness, sliding clearance and spring preload.
# Depth Gauge - sliding rod with a mm scale through a bridge, held by a printed leaf spring
#
# Two parts: a bridge that rests across the mouth of a hole or groove, and a flat rod that
# slides through it. Push the rod down to the bottom and read the depth on the rod's scale at
# the top face of the bridge; the scale is offset by the bridge thickness so that reading is
# the true depth below the bridge's underside. A leaf spring in the slot wall, cut free by a
# slit, presses on the rod so it holds its position when the gauge is lifted out.
# A T head on the rod keeps it from falling through and gives the thumb something to push.
# Prints flat, no supports: bridge on its base (slot and slit vertical), rod on its back.
@param 50..200 step:10 desc:"Measuring range (mm)"
$range = 100
@param 40..100 desc:"Bridge length (mm)"
$bridge_l = 60
@param 6..12 desc:"Rod width (mm)"
$rod_w = 8
@param 2.5..4 step:0.5 desc:"Rod thickness (mm)"
$rod_t = 3
@param 0.1..0.4 step:0.05 desc:"Sliding clearance per side (mm)"
$fit = 0.15
@param 0.2..0.6 step:0.1 desc:"Spring preload: how far the leaf bulges into the slot (mm)"
$bulge = 0.3
# --- Bridge -------------------------------------------------------------------------
$bh = 10 # bridge thickness (the rod passes through it vertically)
$bw = $rod_w + 2 * 5 # across the rod
$slot_w = $rod_w + 2 * $fit
$slot_t = $rod_t + 2 * $fit
$body = box $bridge_l $bw $bh center:(true, true, false)
$slot = box $slot_t $slot_w ($bh + 2) center:(true, true, false) | translate 0 0 -1
# leaf spring: a wall 1.2 thick on the +X side of the slot, freed by a slit behind it
$leaf_t = 1.2
$slit_w = 1.0
$slit = box $slit_w ($slot_w - 2) ($bh + 2) center:(true, true, false)
| translate ($slot_t / 2 + $leaf_t + $slit_w / 2) 0 -1
# the bulge: the slot is made narrower by the bulge over the leaf's middle, by adding a thin pad
$pad = box $bulge ($slot_w * 0.4) $bh center:(false, true, false) | translate ($slot_t / 2 - $bulge) 0 0
$bridge0 = $body - $slot
$bridge1 = $bridge0 + $pad
$bridge = $bridge1 - $slit
assert $bridge.solids == 1
# --- Rod: scale from the tip, offset by the bridge thickness -------------------------
$head_w = $rod_w + 10
$head_l = 6
$rod_l = $range + $bh + $head_l + 4
$rod0 = box $rod_l $rod_w $rod_t center:(false, true, false)
$head = box $head_l $head_w ($rod_t + 2) center:(false, true, false) | translate ($rod_l - $head_l) 0 0
$rod1 = $rod0 + $head
# tip is at x = 0; the "0" mark is at x = bh (the bridge top when the tip is flush with its underside)
def tl($n) = if $n % 10 == 0 then $rod_w * 0.6 else if $n % 5 == 0 then $rod_w * 0.4 else $rod_w * 0.25
$ticks = union [box 0.35 tl($n) 1 center:(true, false, false) | translate ($bh + $n) ($rod_w / 2 - tl($n)) ($rod_t - 0.4) for $n in range($range + 1)]
$nums = union [text ("" + ($n * 10)) 2.4 | rotate 90 | extrude 1 | translate ($bh + $n * 10 + 1.8) (-($rod_w / 2) + 0.8) ($rod_t - 0.4) for $n in range(1, $range // 10 + 1)]
$rod2 = $rod1 - $ticks
$rod = $rod2 - $nums
assert $rod.solids == 1
# --- Print layout --------------------------------------------------------------------
$rod_p = $rod | translate (-($rod_l / 2)) ($bw / 2 + $head_w / 2 + 6) 0
$out = union [$bridge, $rod_p]
assert $out.solids == 2
assert clear($bridge, $rod_p)
assert $bridge.bbox.x ~ $bridge_l
assert $rod.bbox.x ~ $rod_l
assert $slot_t > $rod_t and $slot_w > $rod_w
print "rod length (mm)" $rod_l
$out