coffee-caddy-lid.hs
I own a Sage coffee grinder.
A while back, I purchased a separate “bean caddy” for it, so I could conveniently swap between regular, and novelty high-caffeine beans.
It turns out, that when you buy a new sage caddy, it doesn’t come with a lid, those are sold separately.
I figure; that’s a pain, but no biggie, I can print that.
The lid uses plumber’s tape to form a seal with the caddy.
I think if I was being super serious about iterating on the design, I’d probably add a recess for an o-ring, but the plumbers tape works.
#!/usr/bin/env stack
{- stack script --resolver lts-22.6
--package linear
--package waterfall-cad
--extra-dep waterfall-cad-0.4.0.0
--extra-dep opencascade-hs-0.4.0.0
-}
-- short-description: Lid for a coffee grinder.
-- description:
-- description: I own a Sage coffee grinder.
-- description:
-- description: A while back, I purchased a separate "bean caddy" for it, so I could conveniently swap between regular, and [novelty high-caffeine](https://cannonballcoffee.co.uk) beans.
-- description:
-- description: It turns out, that when you buy a new sage caddy, it doesn't come with a lid, those are sold separately.
-- description:
-- description: I figure; that's a pain, but no biggie, I can print that.
-- description:
-- description: The lid uses plumber's tape to form a seal with the caddy.
-- description:
-- description: I think if I was being super serious about iterating on the design, I'd probably add a recess for an o-ring, but the plumbers tape _works_.
--
--
-- image: https://doscienceto.it/blog/photos/coffee-lid-01.jpg
import qualified Waterfall
import Linear
lid :: Waterfall.Solid
=
lid let rInner = 143/2
= 5
hInner = Waterfall.scale (V3 rInner rInner hInner) $ Waterfall.unitCylinder
inner = rInner + 3
rOuter = 5
hOuter =
outer ^* hInner) $
Waterfall.translate (unit _z V3 rOuter rOuter hOuter) $
Waterfall.scale (<> (Waterfall.translate (unit _z) Waterfall.unitSphere))
(Waterfall.unitCylinder = 15
rHook = 8
tHook = rHook + tHook
rHookOuter = 10
hHook = rHookOuter * 2
wHookCube = rHook + tHook +hHook
lHookCube =
hookCube ^* (0.5 * lHookCube)) $
Waterfall.translate (unit _x V3 lHookCube wHookCube tHook) $
Waterfall.scale (
Waterfall.centeredCube=
hook V3 0 (rOuter - rHookOuter) hInner) $
Waterfall.translate (3 $
Waterfall.roundFillet pi/2) $ Waterfall.translate (negate $ unit _x ^* lHookCube) $
Waterfall.rotate (unit _y) (<> (Waterfall.scale (V3 rHookOuter rHookOuter tHook ) $ Waterfall.centeredCylinder)) `Waterfall.difference`
(hookCube V3 rHook rHook (tHook*2)) Waterfall.centeredCylinder)
(Waterfall.scale (
in inner <> outer <> hook
main :: IO ()
= do
main let stlRes = 0.1
"coffee-caddy-lid.stl" lid
Waterfall.writeSTL stlRes