Marking Gauge
A pencil marking gauge for scribing a line parallel to the edge of a board. The fence rides along the edge, the square beam reaches over the face and a pencil in the end of the beam draws the line. The fence slides on the beam and is locked by a tapered wedge pushed into a slot that crosses the beam hole, so there are no screws, and the beam carries a millimetre scale whose zero is the pencil axis, so the distance is read directly at the fence face. A slit in the beam end lets the pencil hole grip a standard pencil. The default 150 mm beam with a 60 mm fence lays out as 158 x 66 x 22 mm. Three parts, no supports: the beam flat on the bed, the fence standing on its fence face so the beam hole and wedge slot need no support, and the wedge on its side. Parameters: beam length and section, fence width, height and thickness, pencil diameter and sliding clearance.
# Marking Gauge - pencil gauge with a wedge-locked fence and a mm scale on the beam
#
# A marking gauge for scribing a line parallel to the edge of a board: the fence rides
# along the edge, the beam reaches over the face, and a pencil in the end of the beam draws
# the line. The fence slides on the square beam and is locked by a tapered wedge pushed into
# a slot that crosses the beam hole; no screws. The beam carries a millimetre scale whose
# zero is the pencil axis, so the distance is read at the fence face. A slit in the beam end
# lets the pencil hole grip a standard pencil.
# Three parts, no supports: beam flat on the bed, fence standing on its fence face (beam hole
# and wedge slot then need no support), wedge on its side.
@param 100..250 step:10 desc:"Beam length (mm)"
$beam_l = 150
@param 8..14 desc:"Beam section (square, mm)"
$beam = 10
@param 40..90 desc:"Fence width (mm)"
$fence_w = 60
@param 20..40 desc:"Fence height, across the beam (mm)"
$fence_h = 30
@param 18..30 desc:"Fence thickness along the beam (mm)"
$fence_t = 22
@param 7..8 step:0.1 desc:"Pencil diameter (mm)"
$pencil_d = 7.4
@param 0.15..0.4 step:0.05 desc:"Sliding clearance per side (mm)"
$fit = 0.2
# --- Beam: square bar, a pad at the end with the pencil hole and a grip slit ------------
$pad = 16
$bar = box $beam_l $beam $beam center:(false, true, false)
$pad_blk = box $pad $pad $beam center:(false, true, false) | translate (-$pad / 2) 0 0
$pencil_x = 0 # pencil axis = scale zero
$pencil = cylinder ($pencil_d / 2) ($beam + 2) center:(true, true, false) | translate $pencil_x 0 -1
$slit = box ($pad / 2 + 1) 1.0 ($beam + 2) center:(false, true, false) | translate (-$pad / 2 - 1) 0 -1
$beam0 = $bar + $pad_blk
$beam1 = $beam0 - $pencil
$beam2 = $beam1 - $slit
# scale on the top face: ticks every mm from the pad, numbers every 10
$x_first = ceil($pad / 2 + 1)
$n_tick = $beam_l - $x_first
def tl($n) = if $n % 10 == 0 then $beam * 0.6 else if $n % 5 == 0 then $beam * 0.4 else $beam * 0.25
$ticks = union [box 0.35 tl($x_first + $k) 1 center:(true, false, false) | translate ($x_first + $k) ($beam / 2 - tl($x_first + $k)) ($beam - 0.4) for $k in range($n_tick)]
$nums = union [text ("" + ($n * 10)) 2.6 | rotate 90 | extrude 1 | translate ($n * 10 + 1.8) (-$beam / 2 + 0.6) ($beam - 0.4) for $n in range(1, $beam_l // 10)]
$beam3 = $beam2 - $ticks
$beam_part = $beam3 - $nums
assert $beam_part.solids == 1
# --- Fence: block standing on its fence face; beam hole vertical; wedge slot from one side
$hole = $beam + 2 * $fit
$fence0 = box $fence_w $fence_h $fence_t center:(true, true, false)
$beam_hole = box $hole $hole ($fence_t + 2) center:(true, true, false) | translate 0 0 -1
# slot: from the +X face to the beam hole, on the +Y side of the beam, mid height
$slot_y0 = $hole / 2 - 0.6
$slot_h = 7
$wedge_room = 6.5
$slot = box ($fence_w / 2 - $hole / 2 + 2) $wedge_room $slot_h center:(false, false, true)
| translate ($hole / 2 - 1) $slot_y0 ($fence_t / 2)
$fence1 = $fence0 - $beam_hole
$fence_part = $fence1 - $slot
assert $fence_part.solids == 1
assert $slot_y0 + $wedge_room < $fence_h / 2 - 3 # wall left outside the slot
# --- Wedge: tapers in thickness (Y) from loose at the tip to a jam, lying on its side ----
$wl = $fence_w / 2 - $hole / 2 + 16
$tip = $wedge_room - 2.2
$fat = $wedge_room + 0.4
$wedge_prof = polyline [(0, 0), ($wl, 0), ($wl, $fat), (0, $tip)]
$wedge_part = $wedge_prof | extrude ($slot_h - 0.6)
assert $fat > $wedge_room
# --- Print layout ----------------------------------------------------------------------
$fence_p = $fence_part | translate ($beam_l / 2) ($beam / 2 + $fence_h / 2 + 8) 0
$wedge_p = $wedge_part | translate (-$pad / 2) ($beam / 2 + $fence_h + 16) 0
$out = union [$beam_part, $fence_p, $wedge_p]
assert $out.solids == 3
assert clear($beam_part, $fence_p)
assert clear($fence_p, $wedge_p)
assert $beam_part.bbox.x ~ ($beam_l + $pad / 2)
assert $fence_part.bbox.z ~ $fence_t
print "scale to (mm)" $beam_l
$out