Skip to content

spencertipping/wumber

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wumber: CAD in Haskell

build status

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.

What Wumber isn't

Like most things I write, this project is pure dogfood so it's unlikely to have a number of things people might care about:

  1. An easy-to-use, accessible frontend like OpenSCAD
  2. Any sort of GUI beyond previewing
  3. AVX support (my main compute server runs pre-AVX Xeons)
  4. LLVM support (I wanted practice writing JIT compilers)
  5. 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.

Code spelunking guide

Things under active construction:

Code that's going away or will be unrecognizably refactored:

Some places to start:

System libraries

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.

Releases

No releases published

Packages

No packages published

Languages