Last active
October 13, 2025 16:30
-
-
Save joe-warren/d3b4db57b01f8bb51636761925df5e51 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env stack | |
| {- stack script --resolver lts-23.15 | |
| --package linear | |
| --package waterfall-cad | |
| --extra-dep waterfall-cad-0.6.0.0 | |
| --extra-dep opencascade-hs-0.6.0.0 | |
| -} | |
| import Linear | |
| import qualified Waterfall as W | |
| keyAdaptor :: W.Solid | |
| keyAdaptor = | |
| let | |
| tolerance = 0.5 | |
| xSection = W.uScale2D 8.5 $ W.unitPolygon 6 | |
| r = (9.3 + tolerance)/2 | |
| centerHole = W.scale (V3 r r (6.2 + tolerance)) $ W.unitCylinder | |
| nutR = (3.6 + tolerance)/2 | |
| nutH = 0.9 + nutR | |
| nutHole = W.translate (nutH *^ unit _z). W.rotate (unit _x) (pi/2) . W.scale (V3 nutR nutR 10) $ W.unitCylinder | |
| in W.prism 35 xSection `W.difference` (centerHole <> nutHole) | |
| main :: IO () | |
| main = W.writeSTL 0.01 "key_adaptor.stl" keyAdaptor |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment