Skip to content

Architecture

CivilKit is a clean-room rebuild with a deliberately small, composable stack: a Rust finite-element core, compiled to both native and WebAssembly, behind a JSON interface, with a vanilla-JS + three.js browser studio on top.

Components

LayerTechWhere
Solver coreRust (fem-core) - direct stiffness: beam/truss/4-node shell, P-Delta, buckling, modal, load combosrust_solver/fem-core
WASM bridgeRust (fem-wasm) - solve_model(json)->json etc. via wasm-bindgenrust_solver/fem-wasm
CLIRust (fem-cli)rust_solver/fem-cli
Studio (GUI)vanilla JS + vendored three.js (WebGL2), offlineweb_demo/studio

Why this stack

  • Rust core, native + WASM from one source - the same solver runs in the browser and in CI.
  • WASM-friendly numerics (pure-Rust dense + sparse) - chosen early so the browser target stays viable (MKL/PARDISO would have foreclosed it).
  • Headless JSON interface - the solver knows nothing about the UI, so it is reusable (embeddable, agents, CI) and testable in isolation.
  • No app build step - the Studio is dependency-free (vendored three.js + font), served as static files.

Deeper design notes live in the repo:

  • docs/cross-platform-stack.md - the desktop/web stack rationale (Tauri, wgpu, OCCT considered).
  • docs/studio-roadmap.md - UI roadmap + architecture seams.
  • docs/validation-roadmap.md - the path to a trustworthy design tool.

Working lanes

The solver/WASM (Rust) and the Studio/tests/docs (JS) are developed in separate lanes to avoid collisions on shared files - see kimi_delegated.md.