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

microphone-stand.stl

raw haskell source

#!/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
        c1 = circle r1
        c2 = circle r2 
            & 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 
                (\(a, b) -> if (a ^. _z == b ^. _z) && (a ^. _z > 0) then Just 5 else Nothing ) 
        centralColumn = Waterfall.unitCylinder
            & Waterfall.scale (V3 17 17 centralHeight)
            & fillet
        joiner = Waterfall.unitCube 
            & Waterfall.translate (negate 0.5 * unit _y)
            & Waterfall.scale (V3 0 10 centralHeight + micClampOffset)
        micClampOffset = 35 *^ unit _x
        r1 = 23/2
        r2 = 28/2
        micClampOuter = coneSegment (r1 + 6) (r2 + 6) 50
            & Waterfall.translate micClampOffset

        micClampInner = coneSegment (r1 + 2) (r2 + 2) 51
            & Waterfall.translate (micClampOffset - 0.5 *^ unit _z) 

        micClampGap = Waterfall.centeredCube 
            & Waterfall.translate (0.5 *^ unit _x)
            & Waterfall.scale (V3 (r2*2) 20 100)
            & Waterfall.translate micClampOffset
        
        in ((centralColumn <> joiner <> micClampOuter)
            `Waterfall.difference` 
                (micClampInner <> micClampGap <> tripodScrewHole))


main :: IO ()
main = Waterfall.writeSTL 0.01 "microphone-stand.stl" microphoneStand