Push-On Lens Cap
A front lens cap that pushes into the filter thread instead of screwing in, for 49, 52, 55, 58, 62, 67, 72 and 77 mm threads. The skirt is split into spring tabs, each with a small bead that rides over the thread crests and settles in the thread, and the flange stops on the front rim and gives a finger hold; the thread size is engraved on the inside. A plain style without beads holds by friction alone as a quick dust cover. The default 52 mm cap measures 56 x 56 x 9.8 mm. Print with the outer face on the bed and the skirt pointing up; no supports are needed. Adjustable parameters: thread size, style, skirt height, number of tabs and the engraving.
# Lens Cap - push-on front cap that grips the filter thread, by thread diameter
#
# How it is used: push the cap into the filter thread at the front of the lens.
# The skirt is split into spring tabs; each tab carries a small bead that rides
# over the thread crests and settles in the thread, so the cap holds without
# being screwed. The flange stops on the front rim of the lens and gives a
# finger hold for pulling the cap off. The thread size is engraved inside.
# The "plain" style has no beads: a slightly oversize split skirt that holds by
# friction alone, for a quick dust cover.
#
# Print orientation: as modeled, the outer face of the cap on the bed and the
# skirt pointing up. The bead flanks are steeper than 45 deg: no supports.
@param choices:[49, 52, 55, 58, 62, 67, 72, 77] group:"Lens" desc:"Filter thread diameter (mm)"
$size = 52
@param choices:["spring tabs", "plain"] group:"Cap" desc:"Spring tabs with a thread bead, or a plain friction skirt"
$style = "spring tabs"
@param 6..12 step:0.5 group:"Cap" desc:"Skirt height = tab length (mm)"
$skirt_h = 8
@param 4..10 group:"Cap" desc:"Number of tabs"
$tabs = 6
@param group:"Cap" desc:"Engrave the thread size inside"
$engrave = true
# --- Derived ---
$t = 1.8 # disc thickness
$wall = 1.2 # tab thickness
$minor = $size / 2 - 0.4 # crest radius of the M-size x 0.75 filter thread
$major = $size / 2 # root radius of the thread
$rd = $major + 2 # flange radius
$snap = if $style == "spring tabs" then 1 else 0
$ro = if $snap == 1 then $minor - 0.1 else $minor + 0.1 # skirt: clear of the crests, or 0.1 mm tight
$ri = $ro - $wall
$rb = $major - 0.1 # bead radius: 0.3 mm past the crests, inside the roots
$zt = $t + $skirt_h # top of the skirt
# --- Disc and skirt (revolved profiles) ---
$disc = cylinder $rd $t | floor
$tab_ring = workplane XZ | polyline [($ri, $t - 0.2), ($ro, $t - 0.2), ($ro, $zt - 2.2), ($rb, $zt - 1.6), ($rb, $zt - 1), ($ro - 0.3, $zt), ($ri, $zt)] | revolve Z
$plain_ring = workplane XZ | polyline [($ri, $t - 0.2), ($ro, $t - 0.2), ($ro, $zt - 0.6), ($ro - 0.4, $zt), ($ri, $zt)] | revolve Z
$skirt = if $snap == 1 then $tab_ring else $plain_ring
$slit = box ($wall + 3) 2 ($skirt_h + 1) center:false | translate ($ri - 1) -1 ($t + 0.01)
$slits = union [$slit | rotate 0 0 (360 / $tabs * $i) for $i in range($tabs)]
$body = ($disc + $skirt) - $slits
# --- Size engraved on the inside of the disc, 0.5 mm deep, between the tabs' ring ---
$label = text ("" + $size) ($size * 0.22) | extrude 1 | translate 0 0 ($t - 0.5)
$marked = $body - $label
$cap = if $engrave then $marked else $body
# --- Checks ---
assert $cap.solids == 1
assert $cap.valid
assert $cap.bbox.x ~ 2 * $rd tol:0.01
assert $cap.bbox.z ~ $zt tol:0.01
assert $cap.bbox.min[2] ~ 0 tol:0.001
assert $label.bbox.x < 2 * $ri - 4 # the label lies inside the skirt
assert $body.volume > $marked.volume # and is really engraved
# Fit in the thread: a tube bored to the thread root is clear of the whole skirt,
# a tube 1.5 mm tighter than the crests is not.
$root_tube = (cylinder ($major + 3) 5) - (cylinder ($major + 0.02) 6)
$tight_tube = (cylinder ($major + 3) 5) - (cylinder ($minor - 1.5) 6)
assert clear($cap, $root_tube | translate 0 0 ($t + 0.05 + 2.5 + $skirt_h - 5))
assert clear($cap, $tight_tube | translate 0 0 ($t + 0.05 + 2.5 + $skirt_h - 5)) == false
assert $ro - $minor <= 0.11 # never more than 0.1 mm tight
assert $rb < $major
# Spring tabs: the bead stands past the crests, and pushing it in by that much bends a
# tab of length skirt_h (to the bead) by 1.5 x wall x deflection / length^2.
$push = $rb - $minor
$len = $skirt_h - 1.3
$strain = 100 * 1.5 * $wall * $push / ($len * $len)
assert $push > 0.2
assert $strain <= 2
# The flange is wider than the thread, so the cap stops on the front rim.
assert $rd >= $major + 1.5
print "thread" $size "skirt diameter (mm)" (2 * $ro) "bead diameter (mm)" (2 * $rb)
print "tab strain when pushed in (%)" $strain
print "size" $cap.bbox
$cap