A 1.2 MB pure-Rust rewrite of headless Blender built for AI agents — 3D B-rep modeling engine, CLI, and MCP server
Core Craftsmanship & Agent Piloting Blueprint
- Status: Milestone #1 Implemented (Milestones #2–#5 Help Wanted)
- Target: Core (
forma-core&forma-lang) - Core Impact: Strictly zero ML weights,
< 5 msdeterministic checks,0extra output tokens on clean--critiquebuilds - Design Review: Required per feature PR (see
CONTRIBUTING.md)
Architectural Principle
Do not bundle a local neural critique model into core forma — that would destroy the ~1.7–1.8 MB native / ~0.8 MB WASM / zero-GPU footprint while still having weaker 3D spatial judgment than the host frontier model.
Instead, split quality feedback into:
- Layer A (Deterministic, inside
forma-core, 0 KB weights,< 5 ms): Fast geometric linting, spatial assertions, and cutaway/wireframe diagnostic views. - Layer B (Host VLM visual loop): The calling agent inspects the 4-view render and deterministic lint notes to refine geometry.
Prioritized Craftsmanship Features
Deterministic Geometric Craftsmanship Critic (
forma lint/--critique,invariants.rs&spatial.rs) — ✅ Implemented:- Emits 0 extra tokens on clean
--critiquebuilds (0.0%FPR /100.0%recall verified across 28 reference + failure models; median8.8 msend-to-end incl. eval). - Flags
INVALID_SOLID,FLOATING_SHELL,DEGENERATE_FACES(> 0.5%),THIN_WALL(wall_proxy < 0.005),EXTREME_ASPECT(> 20:1),GRAZING_GAP(scale-relative5e-4 × pair_diag),PART_INTERSECTION, and opt-inRAW_BOX(--raw-box). - Next refinements: upgrade
THIN_WALLto build onWallThicknessReport's inward-raymin/p01infeatures.rs(separating localized chamfer/lip knife-edges from true thin walls), reuseboolean::check_self_intersections, and add center-of-mass stability/tipping overhang checks. - BVH-Accelerated Assembly Contact Graph (
spatial.rs): Computes exact pairwise part contacts (INTERSECTING,CONTACT,NEAR_GAP,DISJOINT) usingSpatialBvh+ strict-interior piercing witness & inward face-centroid winding disambiguation (distinguishing flush mating / exact pin-in-boreCONTACTfrom volumetricINTERSECTING). Exposed viaforma lint [--json] [--raw-box],forma eval --critique, MCPinspect({ lint: true }), and WASM/JSsession.lint(). Semantic "missing hardware" judgment intentionally stays in Layer B (the host frontier LLM).
- Emits 0 extra tokens on clean
Declarative Spatial Assertions & Stateless Articulation Sweeps (
assertinForma-Pipe):- 1-line engineering contracts that auto-rollback with exact deltas on failure:
assert clearance(shaft, bore) >= 0.005 assert connected(assembly) assert grounded(base, z=0) assert section_loops(flange, z=0) == 6 assert swing_clear(lid, housing, origin=(0,-0.05,0.04), axis=(1,0,0), deg=110, tol=2) >= 0.0003 assert slide_clear(drawer, chassis, dir=(0,-1,0), dist=0.08, tol=0.002) >= 0.0003 - Stateless Articulation Clearance (
swing_clear/slide_clear): Inspired by the geometric swing-collision testing and motion rectification stage of Functionalization / GraFu (Zhao et al., SIGGRAPH Asia 2026,arXiv:2605.18010), samples rigid-transform poses along a revolute arc or prismatic travel with AABB pruning +spatial::clearance(), reporting the exact collision angle/distance and hit centroid in< 5 mswithout introducing persistent rigging or animation state into coreScene. Always evaluates exact range endpoints (0andmax) plus an optionaltolovertravel / tolerance-extreme margin so nominal-only sweeps cannot hide collisions at worst-case stroke.
- 1-line engineering contracts that auto-rollback with exact deltas on failure:
Pure Parametric Macros (
def) + Lazy Industrial-Design Stdlib (inspect(topic="stdlib")):- Reusable sub-assemblies (
def standoff(r_out, r_in, h) = ...). - On-demand high-craft detail recipes (counterbored bosses, gusset ribs, snap-fit lips, flanged collars, knuckle hinges, sliding rails, Gothic arches) loaded lazily via
inspect(topic=...)at 0 base-schema tokens.
- Reusable sub-assemblies (
Visual-Critique Renderer Modes (
render.rs):mode="section|wire|scale"— mid-plane cutaways (exposing internal walls and clearances), clay+wireframe overlays, and orthographic ruler ticks for a tight 2-pass visual refinement loop.
Actionable Grazing-Boolean Diagnostics (
boolean.rs):- Pinpoint the exact offending edge centroid
(x, y, z)and suggest a concrete overlap/extension fix whenever--strictrolls back a grazing coplanar boolean.
- Pinpoint the exact offending edge centroid
Agent Workflow Guardrails & Plugin Ergonomics (
forma-mcp/forma-cli):- Purpose-upfront & interfaces-before-cosmetics: encourage deciding
render-onlyvs.print/bothbefore detailing (lockingunits("mm"), highersegson printed bores, and real wall thickness up front), modeling mating faces/bores before aesthetic bevels, and taking atx(checkpoint)before optional cleanup ops (remesh/decimate). - Zero-token MCP Prompts/Resources &
forma doctor: expose starter workflow prompts/resources alongsideforma-mcp's 4 tools (0extra tool-schema tokens), plus a lightweight offlineforma doctorcheck for plugin/CLI installs.
- Purpose-upfront & interfaces-before-cosmetics: encourage deciding