Work in progress: don't trust CI output
Wumber will be a programmatic CAD library for Haskell. The focus is on multidomain modeling: you describe the thing you're designing as Haskell data structures, then have your model implement Wumber typeclasses to project it into views, FEA simulations, constraint spaces, etc. My goal is to be able to have simulations that cross domains: e.g. simulate mechanical and thermal output for a given workload with respect to the microcontroller pins that drive a motor controller.
From a mechanical engineering perspective, Wumber takes a lot from colah's ImplicitCAD and SolveSpace: it uses F-Rep with dual contouring to compute boundary meshes, and both isofunctions and constraint sets are described with symbolic math that provides automatic differentiation and backs into JIT-compiled functions for numerical steps.
Wumber is designed to be fast enough for interactive use, even for large
designs. Expensive steps are cached to disk for reuse, and Wumber
supports live code reloading with hint so you can iterate without
running stack build
. The JIT compiler currently produces code that runs 5-30x
faster than compiled GHC (I assume because it avoids all memory allocation and
function calls) -- and that's without any support for SSE vector intrinsics or
AVX.
More importantly than interaction, though, I want Wumber to scale well enough that you can use it for computational optimization. For example, I'd like to be able to have it derive a part that satisfies a series of mechanical load specifications and minimizes manufacturing cost or weight, based on iterated FEA and process simulation.
Like most things I write, this project is pure dogfood so it's unlikely to have a number of things people might care about:
- An easy-to-use, accessible frontend like OpenSCAD
- Any sort of GUI beyond previewing
- AVX support (my main compute server runs pre-AVX Xeons)
- LLVM support (I wanted practice writing JIT compilers)
- G-code generation (I plan to implement custom CNC hardware)
If you want features I don't have planned, I highly recommend that you fork the project and make it your own. There's some chance I'll accept major-change PRs, but I want to keep the core code tight and maintainable more than I want it to have features that don't immediately relate to the project I'm working on.
Things under active construction:
Code that's going away or will be unrecognizably refactored:
Some places to start:
Wumber
: backend libraryWumber.Model
: all supported modeling domainsWumber.SymMath
: symbolic math expressionsWumber.SymJIT
: JIT compilation for symbolic expressionsWumber.Constraint
: constraint specification DSLWumber.EquationSolve
: algebraic + numerical solver
WumberShell
: display and interactive reloadingWumber.Element
: graphics we render (yes, they're in the wrong namespace)
On Ubuntu 18.04:
$ apt install libgsl-dev freeglut3-dev libblas-dev liblapack-dev
I'm going to try to reduce system dependencies as we go, although we'll probably always depend on some GL backend for interactive display.