- C++ 95.7%
- Shell 2.6%
- Python 1.1%
- CMake 0.5%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
All checks were successful
Connector phase 5, ported onto the 0.2.0 connector. `anvil --mcp --headless FILE` loads FILE into a session of its own and answers every tool through the same answerAssistant the window uses: no window, no GL, no socket, and FILE is created when missing. screenshot, set_view and highlight are refused with the reason. A save tool writes the document, since headless there is no user to press Ctrl+S; with a window it is refused, because saving stays the user's. The released "Using an AI assistant" wiki page gains phase 4 (checks, export, the status-bar indicator) and headless use, and is installed to the package's doc directory and listed in the RPM's %doc. The README and --help name the new option. mcp-smoke.py runs the headless mode on a copy of the bracket: refused a screenshot, it changes a parameter, saves under a new name, and the change is in the file by --inspect, with no socket opened. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019agRhQw1WAaNBtYSyd3ajv |
||
| .github/workflows | ||
| ci | ||
| core | ||
| docs | ||
| packaging | ||
| scripts | ||
| tests | ||
| third_party | ||
| ui | ||
| .clang-format | ||
| .editorconfig | ||
| .gitignore | ||
| .gitmodules | ||
| CHANGELOG.md | ||
| CLAUDE.md | ||
| CMakeLists.txt | ||
| CMakePresets.json | ||
| LICENSE | ||
| PLAN.md | ||
| PROGRESS.md | ||
| README.md | ||
Anvil
A lightweight parametric CAD application for Linux, built for 3D printing.
User guide (wiki) — every part of the application explained for someone opening it for the first time. More screenshots in docs/screenshots.
Anvil is a native parametric solid modeller for people who design parts for their own printer: brackets, enclosures, adapters, jigs, replacement parts. The workflow is Fusion 360's — sketch, extrude, modify, change a number and watch everything follow — without the cloud, the licence or the weight. It starts in a fifth of a second and its package is two megabytes.
It is not a mesh editor, a slicer, or a general-purpose FreeCAD clone. Units are millimetres, always.
What it does
Sketching. Sketch on an origin plane, on any flat face, or on a construction plane.
Lines, rectangles, circles, arcs, slots, polygons, ellipses, points and text; trim, extend,
offset, fillet, chamfer, break, split, stretch, scale, mirror and patterns. Tools stay
armed, the way Fusion's do. Type a number while you draw and it becomes a driving
dimension; constraints are inferred as you go, with a glyph at the cursor showing what you
will get (hold Ctrl to turn that off). The palette always says how many degrees of
freedom are left, and Sketch Analysis points at the open loop when a sketch will not
extrude.
Solid features. Extrude (blind, symmetric, two-sided, to a face, through all; taper; new body, join, cut, intersect), Revolve, Loft, and Box, Cylinder, Sphere and Torus that keep an editable footprint sketch. A first-class Hole feature with a fastener table: M2 to M8 in close, normal and loose clearance, tap-drill sizes and heat-set-insert presets, as simple, counterbored, countersunk or counterdrilled holes, flat-bottomed or drill-pointed.
Modify. Fillet and Chamfer with tangent-chain and edge-loop selection, Shell, Draft, Scale, Combine, Split Body, Split Face, Move/Copy, Align, rectangular and circular patterns and Mirror -- of a whole body, or of features, so a hole is repeated across a plate and the plate stays one plate -- and Press Pull, which becomes an extrude, an offset or a fillet depending on what you pick.
Parametric all the way down. Named parameters with expressions
(wall_thickness * 2 + 0.4), usable in every field. A timeline you can reorder,
suppress, rename, edit, and roll back by dragging its marker. A persistent naming scheme so that a fillet stays on its edge when an
upstream dimension changes — and, when a reference really is gone, a feature that turns
red and says so instead of quietly rounding a different corner
(how).
Construction. Offset, angled, mid, tangent, two-edge and three-point planes; axes through a cylinder, perpendicular at a point and where two planes meet; points at a vertex, where two edges meet and where an edge meets a plane.
The printing toolkit — the part a general CAD package does not have:
- a build volume for your printer (presets, or your own), drawn in the viewport, with a warning when a body leaves it;
- a manifold check that highlights the edges at fault;
- wall-thickness analysis, as a heatmap against a minimum you set (twice the nozzle by default);
- overhang analysis, shading faces by their angle from the plate;
- hole compensation: round holes widened by a set amount when a mesh is exported, to counter the way printed holes come out small, without touching the model;
- Place on Build Plate (pick a face, it goes down) and an elephant's-foot chamfer helper.
Files. The native .anvil format is a ZIP of plain JSON you can grep and diff. Export
3MF (the default: millimetres, one object per body, names kept), STL (binary or ASCII,
with the tessellation controls and a live triangle count) and STEP AP214. Import STEP as
an editable body, STL and 3MF as reference meshes to sketch against and measure, and a
picture on a plane, to scale, for tracing the part you are replacing.
Getting around. A view cube with all 26 faces, edges and corners; a right-click
marking menu with flick gestures; S for a fuzzy command search you can pin from;
measure, section view and mass properties; dark and light themes; every shortcut
editable; autosave and crash recovery.
An AI assistant, if you want one. Turn on Edit > Assistant connection and an
assistant such as Claude Code can read the part you have open, look at the window, and make
the changes you ask for -- set a parameter, round some edges, draw and dimension a sketch
-- each one a step you can undo. It can also check the part for printing, point at what it
means, and export it (claude mcp add anvil -- anvil --mcp; the wiki's
Using an AI assistant
page has the rest). Off unless you turn it on, and only on your own computer.
Not in v1, and greyed in the toolbar with a note saying so rather than missing: sweep, splines, threads, ribs, mesh-to-solid conversion and a scripting API. Assemblies, sheet metal and surfacing are out of scope for v1 altogether and have no place in the toolbar. PROGRESS.md is the honest record of what is built, what is deferred and what still needs a person.
Install
Fedora (the current release, x86_64):
sudo dnf config-manager addrepo --from-repofile=https://git.pandanas.net/api/packages/Code-Liberation-Front/rpm.repo
sudo dnf install anvil
CachyOS and Arch (x86_64): trust the repository's key, add the repository, install.
curl -fsSO https://git.pandanas.net/api/packages/Code-Liberation-Front/arch/repository.key
sudo pacman-key --add repository.key
sudo pacman-key --lsign-key 'Code-Liberation-Front@noreply.git.pandanas.net'
printf '\n[Code-Liberation-Front.main.git.pandanas.net]\nSigLevel = Required\nServer = https://git.pandanas.net/api/packages/Code-Liberation-Front/arch/main/$arch\n' |
sudo tee -a /etc/pacman.conf
sudo pacman -Syu anvil
Each release also
attaches both packages, their checksums and the signing keys. For anything newer than the
latest release, build from source (below), or build the package with
scripts/build-rpm.sh or scripts/build-arch.sh. Anvil needs OpenGL 4.5, on Wayland or
X11.
Other distributions: packaging/flatpak/ holds a Flatpak manifest, built and run by
scripts/flatpak-build.sh.
A first part
- Parameters panel: add
width = 60,depth = 40,thick = 10. - Create Sketch, click the XY plane.
R, click the origin, click again.D, click a side, click beside it, typewidth; the same fordepth. The palette reads Fully constrained. Finish Sketch. Efor Extrude, click in Distance, typethick,Enter.Gfor the face filter, click the top face,Hfor Hole, choose M4 and Through all,Enter.Rfor the edge filter, click the four upright edges (shift-click to add),F, click in Radius, type a radius,Enter.- Change
widthto70in the Parameters panel. Everything rebuilds; the hole and the fillets are where they were. Ctrl+S, then Utilities → Export 3MF, and open it in your slicer.
That is the part tests/e2e/bracket.script models in the real application on every CI run. Your first part in the wiki is the same walk with pictures.
Building from source
Fedora:
sudo dnf install cmake ninja-build gcc-c++ git clang-tools-extra libasan libubsan \
doctest-devel opencascade-devel eigen3-devel json-devel \
minizip-ng-devel pugixml-devel zlib-ng-compat-devel \
glfw-devel libglvnd-devel mesa-libGL-devel liberation-sans-fonts
CachyOS and Arch:
sudo pacman -S --needed base-devel cmake ninja git clang doctest opencascade eigen \
nlohmann-json minizip-ng pugixml glfw libglvnd mesa ttf-liberation
Then, on either:
git clone https://git.pandanas.net/Code-Liberation-Front/Anvil.git anvil && cd anvil
git submodule update --init
cmake --preset release
cmake --build --preset release
ctest --preset release
./build/release/bin/anvil
The two submodules are Dear ImGui and SolveSpace's constraint solver. --recursive is not
needed: SolveSpace's own submodules belong to its application, and Anvil builds none of
them.
| Preset | Purpose |
|---|---|
debug-asan |
Debug with ASan + UBSan. What you develop against. |
debug |
Debug without sanitizers. |
relwithdebinfo |
Optimised with symbols, for profiling. |
release |
Optimised. The configuration the budgets are measured against. |
scripts/ci.sh is the whole gate, and what CI runs: the format check; debug-asan and
release, each built with -Werror and each running both test suites; the real binary
driven end to end through tests/e2e/ under Xvfb, with the files it exports measured by a
script that shares no code with Anvil; and the performance budgets. Without the toolchain
installed, scripts/in-container.sh scripts/ci.sh runs it in the CI image.
Command line
anvil [options] [FILE.anvil]
--inspect FILE Dump a document's JSON to stdout and exit.
--script FILE Drive the interface from a script, then exit.
--screenshot PNG Capture the window once it has settled, then exit.
--assistant Let AI assistants attach to this window.
--mcp Be an MCP server for an AI assistant, talking to the running Anvil.
--mcp --headless FILE The same with no window, on FILE.
--startup-timing Print milliseconds from launch to the first drawn frame.
--log-level LEVEL trace, debug, info, warn, error or off.
--width / --height Initial window size.
--inspect reads the document straight out of the container without building it, so it
works on a file this build cannot fully open. --script is how the end-to-end tests and
every screenshot on this page are made: docs/automation.md.
--mcp is what an assistant's client runs: docs/assistant-connector.md.
Budgets
Measured on every CI run by scripts/budgets.sh, under Xvfb with software OpenGL:
| Budget | Measured | |
|---|---|---|
| Cold start to the first frame | < 500 ms | about 150 ms |
| Memory with a 30-feature document open | < 400 MB | about 190 MB |
| CPU with the viewport static | < 1 % | 0 % |
| Full rebuild of a 50-feature document | < 300 ms | about 245 ms on the CI runner, 170–200 ms on a desktop |
| Installed size, binary and assets | < 40 MB | about 5 MB |
The sixth, 60 fps while orbiting two million triangles, needs a real GPU to measure and is listed in PROGRESS.md for a person to take.
How it is put together
core/ a static library: no OpenGL, no ImGui, no window
base/ math, Result, logging, ids
document/ expressions, parameters, the feature tree, commands and undo
sketch/ 2D entities, constraints, the solver behind ISketchSolver
features/ one class per feature
kernel/ the ONLY place OpenCASCADE headers are included
analysis/ manifold, wall thickness, overhang, measure
io/ .anvil, JSON, STL, 3MF, STEP, PNG
ui/ the executable
app/ window, main loop, session, settings, the script driver
commands/ the command registry and the toolbar layout, which is data
render/ GL loader, camera, grid, build plate, meshes, picking
panels/ theme, docked panels, dialogs, sketch view, view cube
tests/ core/ links the core alone; ui/ drives the panels through real ImGui
frames with no window; e2e/ drives the real binary
packaging/ the RPM spec, desktop entry, MIME type, AppStream data, Flatpak manifest
docs/ file format, naming scheme, script language, screenshots, the wiki's source
core/ is testable without a GPU or a window, and OpenCASCADE types never leave
core/kernel/ — the core test target compiles without OpenCASCADE's include path at all,
which is what proves it. Every change to a document is a command on the undo stack. A test
fails if a toolbar command has no test that runs it and checks what it did.
- docs/file-format.md — the
.anvilcontainer - docs/topological-naming.md — how a fillet finds its edge again
- docs/automation.md — the script language
- CLAUDE.md — the brief the application was built to
File format
.anvil is a ZIP with every entry stored uncompressed, so a saved model stays
greppable and diffable:
document.json parameters, features, sketches, print settings, named views
metadata.json application and format version, timestamps
thumbnail.png a 256 x 256 preview, rendered on save
grep -a wall_thickness bracket.anvil # works, by design
anvil --inspect bracket.anvil | jq .parameters
Roadmap
v1 is the scope in CLAUDE.md section 6, and it is built. What comes after, roughly in order: sweep and splines (the seams are there), threads, profiles with holes and guide curves for Loft, and mesh repair. Assemblies, sheet metal, CAM and anything in the cloud are not planned.
Licence
GPL-3.0-or-later. See LICENSE. Anvil links OpenCASCADE (LGPL-2.1 with an exception) and vendors Dear ImGui (MIT) and SolveSpace's solver (GPL-3.0-or-later).