microphone_adaptor.hs
This is a Microphone Stand, designed to screw onto a 1/4”-20 UNC thread such as the one’s used on camera tripods.
Thus allowing you to use a camera tripod as a microphone stand
#!/usr/bin/env stack
{- stack script --resolver lts-23.15
--package linear
--package waterfall-cad
--extra-dep waterfall-cad-0.5.0.1
--extra-dep opencascade-hs-0.5.0.1
-}
-- short-description: Microphone Stand Adaptor
--
-- description: This is a Microphone Stand, designed to screw onto a 1/4"-20 UNC thread
-- description: such as the one's used on camera tripods.
-- description:
-- description: Thus allowing you to use a camera tripod as a microphone stand
--
-- image: https://doscienceto.it/blog/photos/microphone-stand.jpg
import qualified Waterfall
import Linear
import Data.Function ((&))
import Control.Lens
coneSegment :: Double -> Double -> Double -> Waterfall.Solid
=
coneSegment r1 r2 h let circle r = Waterfall.unitCircle
& Waterfall.shapePaths
& mconcat
& Waterfall.fromPath2D
& Waterfall.uScale r
= circle r1
c1 = circle r2
c2 & Waterfall.translate (h *^ unit _z)
in Waterfall.loft [c1, c2]
tripodScrewHole :: Waterfall.Solid
=
tripodScrewHole let shaft =
Waterfall.centeredCylinder & Waterfall.scale (V3 3.5 3.5 2 )
=
nutHole
Waterfall.centeredCube & Waterfall.translate (unit _z ^* 0.5)
& Waterfall.scale (V3 11.5 11.5 5)
& Waterfall.translate (unit _z ^* 0.8)
in shaft <> nutHole
microphoneStand :: Waterfall.Solid
=
microphoneStand let centralHeight = 20
=
fillet
Waterfall.roundConditionalFillet -> if (a ^. _z == b ^. _z) && (a ^. _z > 0) then Just 5 else Nothing )
(\(a, b) = Waterfall.unitCylinder
centralColumn & Waterfall.scale (V3 17 17 centralHeight)
& fillet
= Waterfall.unitCube
joiner & Waterfall.translate (negate 0.5 * unit _y)
& Waterfall.scale (V3 0 10 centralHeight + micClampOffset)
= 35 *^ unit _x
micClampOffset = 23/2
r1 = 28/2
r2 = coneSegment (r1 + 6) (r2 + 6) 50
micClampOuter & Waterfall.translate micClampOffset
= coneSegment (r1 + 2) (r2 + 2) 51
micClampInner & Waterfall.translate (micClampOffset - 0.5 *^ unit _z)
= Waterfall.centeredCube
micClampGap & Waterfall.translate (0.5 *^ unit _x)
& Waterfall.scale (V3 (r2*2) 20 100)
& Waterfall.translate micClampOffset
in ((centralColumn <> joiner <> micClampOuter)
`Waterfall.difference`
<> micClampGap <> tripodScrewHole))
(micClampInner
main :: IO ()
= Waterfall.writeSTL 0.01 "microphone-stand.stl" microphoneStand main