Rice Measure Set
Kitchen measures whose volumes are computed, not guessed: a 1 go rice cup (180 ml, the standard cup of a Japanese rice cooker), a half cup (90 ml), a 15 ml tablespoon and a 5 ml teaspoon, chosen with the item parameter. The file builds each cavity as its own solid and checks its measured volume against the target, so a change of diameter or wall gives a cup of the right height. The cups are straight cylinders with a rounded inner bottom and a groove inside at the half-volume line; the spoons are hemispherical bowls on a flat handle with the volume engraved on it. The 1 go cup measures 65 x 65 x 62 mm and the tablespoon 100 x 42 x 21 mm. Cups print upright with no supports; spoons print rim down, so the bowl is a dome that needs no supports. Adjustable parameters: item, cup inner diameter, wall thickness, inner bottom radius and handle length.
# Rice Measure Set - 1 go (180 ml) rice cup, half cup, tablespoon and teaspoon, volumes proven
#
# Kitchen measures whose cavity volume is computed from the target, not guessed: the
# file builds the cavity as its own solid and asserts its measured volume. The cups are
# straight cylinders with a rounded inner bottom and a half-volume groove inside; the
# spoons are hemispherical bowls on a flat handle with the volume engraved on it.
# Choose the piece with `item`. Cups print upright (floor on the bed); spoons print
# rim down, so the bowl is a dome and needs no supports.
@param choices:["cup", "half-cup", "tablespoon", "teaspoon"] desc:"Which measure"
$item = "cup"
@param 50..75 step:1 group:"Cups" desc:"Inner diameter of the 1 go cup (mm)"
$cup_d = 62
@param 1.2..2.5 step:0.1 group:"Cups" desc:"Wall thickness (mm)"
$wall = 1.6
@param 2..4 step:0.5 group:"Cups" desc:"Inner bottom radius (mm)"
$fil = 3
@param 40..90 step:5 group:"Spoons" desc:"Handle length (mm)"
$handle_len = 60
$go = 180000 # 1 go in cubic mm (180 ml)
$floor_t = 2
# --- Cup: cylinder of radius r; the inner fillet removes a ring of volume, so the height
# --- is computed for the target volume with that ring added back (Pappus on the spandrel)
def cup_height($v, $r) = ($v + 2 * pi * ($r - 0.2234 * $fil) * (1 - pi / 4) * $fil * $fil) / (pi * $r * $r)
# cavity(h, r, z): the inner volume as a solid; cup(h, hh, r): the cup with a half-volume groove at hh
def cavity($h, $r, $z) = cylinder $r $h center:(true, true, false) | edges <Z | fillet $fil | translate 0 0 $z
def groove($hh, $r) = cylinder ($r + 0.4) 0.8 center:(true, true, false) | translate 0 0 ($floor_t + $hh - 0.4)
def outer($h, $r) = cylinder ($r + $wall) ($h + $floor_t) center:(true, true, false) | edges <Z | chamfer 0.8
def cup($h, $hh, $r) = outer($h, $r) - cavity($h, $r, $floor_t) - groove($hh, $r)
$r1 = $cup_d / 2
$r2 = $cup_d / 2 * 0.85
$h1 = cup_height($go, $r1)
$h1_half = cup_height($go / 2, $r1)
$h2 = cup_height($go / 2, $r2)
$h2_half = cup_height($go / 4, $r2)
$cup_cavity = cavity($h1, $r1, 0)
$half_cavity = cavity($h2, $r2, 0)
assert $cup_cavity.volume ~ $go tol:0.3%
assert $half_cavity.volume ~ ($go / 2) tol:0.3%
$cup_1 = cup($h1, $h1_half, $r1)
$cup_half = cup($h2, $h2_half, $r2)
assert $cup_1.solids == 1
assert $cup_half.solids == 1
assert $cup_1.bbox.z ~ ($h1 + $floor_t)
print "1 go cup: inner height (mm)" $h1
print "half cup: inner height (mm)" $h2
# --- Spoons: hemispherical bowl, rim at Z = 0, dome up; the handle lies on the bed ---
def bowl_r($v) = ($v * 3 / (2 * pi)) ** (1 / 3)
$upper = box 400 400 100 center:(true, true, false)
def bowl($r) = ((sphere ($r + $wall)) - (sphere $r)) | inter $upper
def handle($r, $label) = (box $handle_len 14 3 center:(false, true, false) | translate ($r + $wall - 2) 0 0 | edges =Z | fillet 3)
- (text $label 4 at:($r + $wall + $handle_len / 2 - 2, 0) | extrude 1 | translate 0 0 2.5)
def spoon($r, $label) = bowl($r) + handle($r, $label)
def spoon_cavity($r) = (sphere $r) | inter $upper
$rb1 = bowl_r(15000)
$rb2 = bowl_r(5000)
$tbsp_cavity = spoon_cavity($rb1)
$tsp_cavity = spoon_cavity($rb2)
assert $tbsp_cavity.volume ~ 15000 tol:0.3%
assert $tsp_cavity.volume ~ 5000 tol:0.3%
$tbsp = spoon($rb1, "15 ml")
$tsp = spoon($rb2, "5 ml")
assert $tbsp.solids == 1
assert $tsp.solids == 1
assert $tbsp.bbox.z ~ ($rb1 + $wall)
print "tablespoon bowl radius (mm)" $rb1
print "teaspoon bowl radius (mm)" $rb2
$out = if $item == "cup" then $cup_1 else if $item == "half-cup" then $cup_half else if $item == "tablespoon" then $tbsp else $tsp
print "part" $out.bbox
$out