forma-3d 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Using Forma with AI Agents
2
2
 
3
- Forma is a 1.2 MB pure-Rust rewrite of headless Blender built so any LLM or coding agent can create, inspect, and export watertight 3D models in milliseconds with minimal token overhead.
3
+ Forma is a ~1.7 MB native (~0.8 MB WASM) pure-Rust headless 3D polyhedral modeling engine built so any LLM or coding agent can create, inspect, and export watertight 3D models in milliseconds with minimal token overhead.
4
4
 
5
5
  ---
6
6
 
@@ -19,7 +19,7 @@ Add to your MCP client config (Claude Code, Cursor, Codex, Antigravity, etc.)
19
19
  "mcpServers": {
20
20
  "forma": {
21
21
  "command": "npx",
22
- "args": ["-y", "forma-3d-mcp"]
22
+ "args": ["-y", "-p", "forma-3d", "forma-3d-mcp"]
23
23
  }
24
24
  }
25
25
  }
@@ -33,7 +33,7 @@ Add to your MCP client config (Claude Code, Cursor, Codex, Antigravity, etc.)
33
33
  | `eval` | Execute transactional `Forma-Pipe` code (`strict: true` auto-rolls back any non-manifold result); returns a ~100-token spatial diff (`WT`, `NM`, `g` genus, `vol`, `bbox`, `size`, tags). |
34
34
  | `inspect` | Inspect current scene invariants and bounding boxes without mutating state. |
35
35
  | `tx` | O(1) copy-on-write state control: `checkpoint`, `rollback`, `undo`, `reset`. |
36
- | `export` | Export to `.glb` (PBR + triplanar UVs), `.step`, `.3mf`, `.stl`, `.obj`, or render a zero-GPU 4-view studio `.png` preview (`~20–75 KB`). |
36
+ | `export` | Export to `.glb` (glTF 2.0 Y-up, PBR + UVs), faceted `.step` (planar faces), `.3mf`, `.stl`, `.obj`, or render a zero-GPU 4-view studio `.png` preview (`~20–75 KB`). |
37
37
 
38
38
  ---
39
39
 
@@ -94,4 +94,4 @@ forma spec --gbnf > forma_pipe.gbnf
94
94
  - **Cutting through-holes cleanly:** Make cutting cylinders slightly taller than the target plate (e.g., `cyl(0.5, 1.0)` for a `0.4` thick plate) to avoid grazing coplanar caps.
95
95
  - **Multi-hole patterns:** Pass `at=[(x1,y1,z1), (x2,y2,z2), ...]` in a single `| cut(...)` or `| add(...)` call—Forma automatically batches pairwise-disjoint booleans in one pass.
96
96
  - **Sharp revolved/mechanical subsurf:** Use `subsurf(1, crease=true)` if you want smooth curvature without shrinking sharp rims.
97
- - **Exporting for downstream tools:** Use `.glb` for web/Blender/Three.js (includes PBR materials + triplanar UVs), `.step` for SolidWorks/Fusion 360/FreeCAD, `.3mf`/`.stl` for 3D printing, `.svg` for dimensioned blueprints, and `.blend` via Blender bridge.
97
+ - **Exporting for downstream tools:** Use `.glb` for web/Blender/Three.js (glTF 2.0 Y-up, PBR materials + LSCM/triplanar UVs), faceted `.step` (watertight planar-face ISO 10303-21 solid; no analytic cylinders/NURBS) for reference/assembly import into SolidWorks/Fusion 360/FreeCAD, `.3mf`/`.stl` for 3D printing, `.svg` for dimensioned blueprints, and `.blend` via Blender bridge.
package/README.md CHANGED
@@ -1,20 +1,20 @@
1
1
  # Forma
2
2
 
3
- **A 1.2 MB pure-Rust rewrite of headless Blender built for AI agents — 3D B-rep modeling engine, CLI, and MCP server.**
3
+ **A ~1.7 MB native / ~0.8 MB WASM pure-Rust headless 3D polyhedral modeling engine built for AI agents — CLI, WASM, and MCP server.**
4
4
 
5
5
  <p align="center">
6
6
  <img src="assets/readme_hero.png" alt="Forma — Pure-Rust Rewrite of Headless Blender for AI Agents" width="100%" />
7
7
  </p>
8
8
 
9
- Forma rewrites headless Blender's 3D modeling, boolean, and studio-preview workflow from scratch in pure Rust—replacing the 953 MB desktop stack and brittle `bpy` scripting with a compact declarative pipe language (`Forma-Pipe`), semantic edge/face selectors, guaranteed-manifold CSG booleans, transactional snapshots, and a built-in zero-GPU studio renderer.
9
+ Forma replaces headless Blender's 3D mesh modeling, boolean, and studio-preview workflow for AI agents with a single pure-Rust binary—trading the 953 MB desktop stack and brittle `bpy` scripting for a compact declarative pipe language (`Forma-Pipe`), semantic edge/face selectors, strict-by-default manifold CSG booleans, transactional snapshots, and a built-in zero-GPU studio renderer.
10
10
 
11
11
  | Metric | Stock Headless Blender 5.3 (`bpy`) | **Forma** | Improvement |
12
12
  |---|---:|---:|---:|
13
13
  | **Cold-Start Eval + GLB Export** | 1,306.8 ms | **16.9 ms** (`5.4 ms` batch flange) | **~77×–89× faster** |
14
14
  | **Completion Tokens (12-model avg)** | 294,661 total | **84,551 total** | **3.49× fewer** (up to **15.5×**) |
15
15
  | **Pass Rate (12 models / 10 labs)** | 79.1% (`bpy`) | **95.5% – 100%** | **+16.4 pp** |
16
- | **Binary / Install Footprint** | 953 MB | **1.2 MB** | **~800× smaller** |
17
- | **Peak Memory RSS** | 223 MB | **2.16 MB** | **103× less RAM** |
16
+ | **Binary / Install Footprint** | 953 MB | **~1.7–1.8 MB** native (**~0.8 MB** WASM) | **~530× smaller** |
17
+ | **Peak Memory RSS** | 223 MB | **~6–14 MB** (`6.1 MB` macOS / `13.5 MB` Linux) | **~16×–36× less RAM** |
18
18
  | **MCP Tool Schema Budget** | — | **789 `o200k` tokens** (4 tools) | Strictly `< 800` |
19
19
 
20
20
  ---
@@ -22,10 +22,11 @@ Forma rewrites headless Blender's 3D modeling, boolean, and studio-preview workf
22
22
  ## Features
23
23
 
24
24
  - **Declarative `Forma-Pipe` Language:** Chain primitives and ops cleanly (`box | bevel | shell | cut`) with semantic selectors (`vertical`, `top_rim`, `bottom_rim`, `outer_rim`, `top`, `sides`)—zero fragile integer vertex indices.
25
- - **Fast, Watertight Pure-Rust Kernel:** Double-precision polyhedral B-rep, BVH-localized Möller-guarded booleans, automatic batch CSG for multi-hole patterns, zero-error Link-Condition coplanar mesh simplification, ring-preserving bevels, shell, crease-aware Catmull-Clark subsurf, `pipe`, `loft`, helical `thread`, `sweep`, `text3d`, and `pattern_linear`/`pattern_radial`.
25
+ - **Fast, Watertight Pure-Rust Kernel:** Double-precision polyhedral mesh kernel (watertight manifold polygons/triangles), BVH-localized booleans with automatic batch chunking & fallback for multi-hole patterns, Link-Condition coplanar mesh simplification, ring-preserving bevels, shell/solidify, crease-aware Catmull-Clark subsurf, `pipe`, `loft` (`segs` 8..128), helical `thread`, `sweep`, `text3d`, and `pattern_linear`/`pattern_radial`.
26
26
  - **Spatial Constraints & Queries:** Relational placement (`| on(base)`, `| align(axis, min|center|max, val)`), exact 3D `clearance(a, b)`, 2D `section(part, z)` loop/area queries, and Euler genus (`g`) diagnostics.
27
27
  - **Zero-GPU Rendering & Blueprints:** Built-in 4-view (`Front / Right / Top / Iso`) studio PNG renderer with SSAO-lite + depth silhouettes + pure-Rust Deflate compression (`~20–75 KB` PNG in ~4 ms), plus dimensioned 1200×900 vector SVG technical blueprints (`forma draw`).
28
- - **Universal Export:** Native `.glb` (PBR materials + automatic triplanar UVs), ISO 10303-21 `.step`, `.3mf`, `.stl`, `.obj`, `.svg`, `.png`, and `.blend` (via optional Blender bridge).
28
+ - **Universal Import, Decimation & Export:** Pure-Rust `.glb` (glTF 2.0 Y-up), `.obj`, and `.stl` importers (`load("item.glb")`), topology-preserving QEM mesh decimation (`| decimate(0.5)`), native `.glb` (PBR + LSCM/triplanar UVs), faceted ISO 10303-21 `.step` (watertight planar-face solid; no analytic cylinders/NURBS), `.3mf`, `.stl`, `.obj`, `.svg`, `.png`, and `.blend` (via optional Blender bridge).
29
+ - **Optional Headless Server (`forma-server`):** Separate opt-in HTTP/1.1 worker crate (`cargo build --release -p forma-server`, compact static binary, `< 5 MB` scratch `Dockerfile`) with zero impact on the core `forma` CLI, `forma-mcp`, or `forma-3d` npm/WASM bundle.
29
30
 
30
31
  ---
31
32
 
@@ -43,7 +44,7 @@ section(flange, 0.0)
43
44
  EOF
44
45
  ```
45
46
 
46
- ### Option 2 — Build Native 1.2 MB Rust Binary
47
+ ### Option 2 — Build Native Rust Binary (~1.7–1.8 MB)
47
48
 
48
49
  ```bash
49
50
  git clone https://github.com/wrong-nebula/forma.git
@@ -67,7 +68,7 @@ Forma is designed for drop-in agent use via **MCP**, **CLI**, **Agent Skills**,
67
68
  - **Full agent integration guide:** [`AGENTS.md`](AGENTS.md)
68
69
  - **Constrained-decoding grammar:** [`grammar/forma_pipe.gbnf`](grammar/forma_pipe.gbnf) (`forma spec --gbnf`)
69
70
 
70
- ### MCP Server Setup (`forma-mcp` / `npx forma-3d-mcp`)
71
+ ### MCP Server Setup (`forma-mcp` / `npx -p forma-3d forma-3d-mcp`)
71
72
 
72
73
  Add Forma's MCP server (4 tools: `eval`, `inspect`, `tx`, `export` — **789 `o200k` tokens** total) to any MCP client:
73
74
 
@@ -76,7 +77,7 @@ Add Forma's MCP server (4 tools: `eval`, `inspect`, `tx`, `export` — **789 `o2
76
77
  "mcpServers": {
77
78
  "forma": {
78
79
  "command": "npx",
79
- "args": ["-y", "forma-3d-mcp"]
80
+ "args": ["-y", "-p", "forma-3d", "forma-3d-mcp"]
80
81
  }
81
82
  }
82
83
  }
@@ -92,6 +93,28 @@ forma draw --out blueprint.svg script.forma # dimensioned vector engineerin
92
93
 
93
94
  ---
94
95
 
96
+ ## npm Package (`forma-3d`)
97
+
98
+ [![npm version](https://img.shields.io/npm/v/forma-3d?color=7ae08c&label=npm%20forma-3d)](https://www.npmjs.com/package/forma-3d)
99
+
100
+ Install or run Forma's zero-dependency WebAssembly engine directly from npm ([**npmjs.com/package/forma-3d**](https://www.npmjs.com/package/forma-3d)) on macOS, Linux, Windows, or in JavaScript/TypeScript:
101
+
102
+ ```bash
103
+ npm install forma-3d # JS/TS ESM + WASM library + CLI + MCP server
104
+ npx -y forma-3d eval --strict --out part.glb script.forma
105
+ npx -y -p forma-3d forma-3d-mcp # stdio MCP server
106
+ ```
107
+
108
+ ```js
109
+ import { evalPipe, exportMesh, renderPng } from "forma-3d";
110
+
111
+ const obs = await evalPipe(`flange = box(4, 2, 0.4) | cut(cyl(0.5, 1))`, { strict: true });
112
+ const glb = await exportMesh(`flange = box(4, 2, 0.4) | cut(cyl(0.5, 1))`, "glb");
113
+ const png = await renderPng(`flange = box(4, 2, 0.4) | cut(cyl(0.5, 1))`, 512);
114
+ ```
115
+
116
+ ---
117
+
95
118
  ## Benchmarks
96
119
 
97
120
  All models were evaluated head-to-head on stock headless **Blender 5.3.0 (`bpy`)** vs **Forma (`Forma-Pipe`)** across 6 cross-category exact-dimension tasks (`flange_plate`, `pipe_tee`, `beveled_enclosure`, `hex_nut`, `subdiv_mug`, `pedestal_bowl`), verified independently with `trimesh` + `scipy` (Chamfer distance, Hausdorff-99, Generalized Winding Number Volumetric IoU, watertight/0-non-manifold checks, and 16-layer planar sliceability).
package/SKILL.md CHANGED
@@ -1,22 +1,22 @@
1
1
  ---
2
2
  name: forma
3
- description: Create, modify, inspect, render, and export watertight 3D B-rep models in milliseconds using Forma (a 1.2 MB pure-Rust rewrite of headless Blender). Use whenever a task involves 3D CAD/mesh generation, mechanical parts, enclosures, brackets, threads, lofts, pipes, booleans, .glb/.step/.3mf/.stl/.obj/.blend export, 4-view .png studio previews, or dimensioned .svg engineering blueprints.
3
+ description: Create, modify, inspect, render, and export watertight 3D polyhedral models in milliseconds using Forma (a ~1.7 MB native / ~0.8 MB WASM pure-Rust headless 3D modeling engine). Use whenever a task involves 3D mesh/CAD generation, mechanical parts, enclosures, brackets, threads, lofts, pipes, booleans, .glb/faceted .step/.3mf/.stl/.obj/.blend export, 4-view .png studio previews, or dimensioned .svg engineering blueprints.
4
4
  ---
5
5
 
6
6
  # Forma — Headless 3D Modeling Skill
7
7
 
8
- Forma is a 1.2 MB pure-Rust rewrite of headless Blender built for AI agents. It evaluates a compact declarative pipe language (`Forma-Pipe`) into guaranteed-manifold B-rep geometry in ~5–17 ms with zero GPU required.
8
+ Forma is a lightweight pure-Rust headless 3D modeling engine (~1.7 MB native / ~0.8 MB WASM) built for AI agents. It evaluates a compact declarative pipe language (`Forma-Pipe`) into strict, watertight polyhedral solid geometry in ~5–17 ms with zero GPU required.
9
9
 
10
10
  ## 1. Choose Your Interface
11
11
 
12
12
  ### Option A — MCP Server (preferred for iterative modeling)
13
- Connect `forma-mcp` (native binary) or `npx -y forma-3d-mcp` (zero-install WASM via npm):
13
+ Connect `forma-mcp` (native binary) or `npx -y -p forma-3d forma-3d-mcp` (zero-install WASM via npm):
14
14
  ```json
15
15
  {
16
16
  "mcpServers": {
17
17
  "forma": {
18
18
  "command": "npx",
19
- "args": ["-y", "forma-3d-mcp"]
19
+ "args": ["-y", "-p", "forma-3d", "forma-3d-mcp"]
20
20
  }
21
21
  }
22
22
  }
@@ -68,11 +68,12 @@ EOF
68
68
  | `pipe(ro, ri, h)` | Hollow cylindrical tube |
69
69
  | `extrude2d([(x,y), ...], z0, z1)` | Extrude closed 2D polygon |
70
70
  | `revolve([(r,z), ...], segs=32)` | Lathe profile around Z (auto-closes at `r=0`) |
71
- | `loft([(z, [(x,y), ...]), ...])` | Multi-section smooth loft |
71
+ | `loft([(z, [(x,y), ...]), ...], segs=24)` | Multi-section smooth loft (`segs` 8..128; warns if clamped) |
72
72
  | `thread(r0, r1, pitch, turns)` | Watertight helical screw thread |
73
73
  | `arc_tube(center=(x,y,z), rx=, rz=, start=-90, end=90, r=0.08)` | Curved handle / arc sweep |
74
74
  | `tube([(x,y,z), ...], r=0.08)` | Polyline pipe sweep |
75
75
  | `text3d("TEXT", height=0.3, depth=0.08)` | Watertight 3D extruded vector text |
76
+ | `load("path.glb\|obj\|stl")` | Import existing `.glb`, `.obj`, or `.stl` mesh (or uploaded asset key in `forma-server`) |
76
77
 
77
78
  ### Operations & Selectors
78
79
  - **Booleans:** `add(b, at=)`, `cut(b, at=)`, `intersect(b)` — `at=[...]` runs fast batch CSG.
@@ -81,7 +82,7 @@ EOF
81
82
  - `shell(t, open_top=true)` — hollow solid with wall thickness `t`.
82
83
  - `subsurf(levels=1, crease=false)` — Catmull-Clark subdivision (`crease=true` preserves sharp rims).
83
84
  - `extrude(faces, d)` | `inset(faces, amt, depth=0)` — face selectors: `top`, `bottom`, `sides`, `all`.
84
- - `mirror(x|y|z)` | `pattern_linear(n, step=(dx,dy,dz))` | `pattern_radial(n, r=)`
85
+ - `mirror(x|y|z)` | `pattern_linear(n, step=(dx,dy,dz))` / `array(n, step=)` | `pattern_radial(n, r=, axis=z)` / `radial(n, r=, axis=z)` | `decimate(ratio=0.5, faces=)` (QEM LOD reduction preserving watertightness)
85
86
  - **Transforms & Relational Placement:**
86
87
  - `move(x, y, z)` | `rot(rx, ry, rz)` (degrees) | `scale(sx, sy, sz)`
87
88
  - `on(base)` (rests cleanly on top of `base`) | `align(x|y|z, min|center|max, val)` | `align_z0(z)`
package/bin/forma-mcp.mjs CHANGED
@@ -10,7 +10,7 @@ import { extname } from "node:path";
10
10
  import { performance } from "node:perf_hooks";
11
11
  import { loadForma } from "../lib/index.mjs";
12
12
 
13
- const VERSION = "0.4.0";
13
+ const VERSION = "0.4.1";
14
14
 
15
15
  function buildToolsSchema(specPipe) {
16
16
  return [
@@ -66,7 +66,8 @@ async function handleToolCall(session, name, args) {
66
66
  return [true, "ERR: missing 'code' string"];
67
67
  }
68
68
  const t0 = performance.now();
69
- const obs = session.eval(args.code, { strict: Boolean(args.strict) });
69
+ const strict = args.strict === undefined ? true : Boolean(args.strict);
70
+ const obs = session.eval(args.code, { strict });
70
71
  const ms = performance.now() - t0;
71
72
  const text = obs.text.replace("[0.00ms]", `[${ms.toFixed(2)}ms]`);
72
73
  return [false, text];
package/bin/forma.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * forma-3d CLI — cross-platform pure-WASM headless 3D B-rep modeling engine.
3
+ * forma-3d CLI — cross-platform pure-WASM headless 3D polyhedral modeling engine.
4
4
  * Supports: eval, render, draw, spec, mcp, version, --help
5
5
  */
6
6
 
@@ -9,11 +9,11 @@ import { extname } from "node:path";
9
9
  import { performance } from "node:perf_hooks";
10
10
  import { loadForma } from "../lib/index.mjs";
11
11
 
12
- const VERSION = "0.4.0";
12
+ const VERSION = "0.4.1";
13
13
 
14
14
  function printHelp() {
15
15
  process.stdout.write(
16
- `forma ${VERSION} (WASM) — 1.2 MB pure-Rust rewrite of headless Blender for AI agents\n\n` +
16
+ `forma ${VERSION} (WASM) — pure-Rust headless 3D polyhedral modeling engine for AI agents\n\n` +
17
17
  `USAGE:\n` +
18
18
  ` forma-3d eval [--dialect pipe|compact] [--strict] [--json] [--out path.(glb|obj|stl|3mf|step)] [--render preview.png] [--draw blueprint.svg] [file|-]\n` +
19
19
  ` forma-3d render [--size 512] --out preview.png [file|-]\n` +
@@ -72,7 +72,7 @@ async function main() {
72
72
  }
73
73
 
74
74
  let dialect = "pipe";
75
- let strict = false;
75
+ let strict = true;
76
76
  let asJson = false;
77
77
  let outPath = null;
78
78
  let renderPath = null;
@@ -97,6 +97,8 @@ async function main() {
97
97
  renderSize = Number.parseInt(args[++i], 10) || 512;
98
98
  } else if (a === "--strict") {
99
99
  strict = true;
100
+ } else if (a === "--no-strict") {
101
+ strict = false;
100
102
  } else if (a === "--json") {
101
103
  asJson = true;
102
104
  } else {
package/lib/index.mjs CHANGED
@@ -77,7 +77,7 @@ export class FormaSession {
77
77
  }
78
78
 
79
79
  /** Evaluate Forma-Pipe (or compact) code transactionally; returns parsed Observation. */
80
- eval(code, { dialect = "pipe", strict = false } = {}) {
80
+ eval(code, { dialect = "pipe", strict = true } = {}) {
81
81
  this._checkOpen();
82
82
  const d = dialect === "compact" ? 1 : 0;
83
83
  this._engine._withUtf8(code, (ptr, len) => {
package/llms.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  # Forma
2
2
 
3
- > A 1.2 MB pure-Rust rewrite of headless Blender built for AI agents — 3D B-rep modeling engine, Unix CLI, and minimal-schema MCP server. Single static binary, zero GPU required, guaranteed-manifold geometry, ~16.9 ms cold-start eval + export.
3
+ > A ~1.7 MB native / ~0.8 MB WASM pure-Rust headless 3D polyhedral modeling engine built for AI agents — Unix CLI, WASM library, and minimal-schema MCP server. Single static binary, zero GPU required, strict watertight solid verification, ~16.9 ms cold-start eval + export.
4
4
 
5
5
  ## Repository Map
6
6
 
@@ -8,18 +8,19 @@
8
8
  - [README.md](README.md): Overview, quickstart, npm/CLI/MCP usage, and full 12-model / 10-lab benchmarks
9
9
  - [AGENTS.md](AGENTS.md): Step-by-step integration guide for AI agents (MCP, CLI, constrained decoding, feedback loop)
10
10
  - [grammar/forma_pipe.gbnf](grammar/forma_pipe.gbnf): Formal GBNF grammar for zero-syntax-error constrained decoding (llama.cpp, vLLM, XGrammar)
11
- - [crates/forma-core](crates/forma-core): Pure-Rust double-precision B-rep kernel, BVH booleans, bevel, shell, subsurf, loft, thread, sweep, text3d, spatial queries, pure-Rust PNG/SVG renderer, GLB/STEP/3MF/STL/OBJ exporters
11
+ - [crates/forma-core](crates/forma-core): Pure-Rust double-precision polyhedral mesh kernel, BVH booleans, bevel, shell, subsurf, loft, thread, sweep, text3d, spatial queries, pure-Rust PNG/SVG renderer, GLB/faceted STEP/3MF/STL/OBJ exporters
12
12
  - [crates/forma-lang](crates/forma-lang): `Forma-Pipe` declarative modeling language evaluator
13
13
  - [crates/forma-cli](crates/forma-cli): `forma` CLI (`eval`, `render`, `draw`, `spec`)
14
14
  - [crates/forma-mcp](crates/forma-mcp): `forma-mcp` stdio JSON-RPC 2.0 MCP server (4 tools, 789 o200k tokens)
15
- - [crates/forma-wasm](crates/forma-wasm): WebAssembly browser bindings (`wasm-pack build --target web`)
15
+ - [crates/forma-server](crates/forma-server): Zero-dependency multi-threaded HTTP/1.1 headless microservice (`/health`, `/spec`, `/v1/eval`, `/v1/process`) + `Dockerfile`
16
+ - [crates/forma-wasm](crates/forma-wasm): Zero-dependency WebAssembly core (`wasm/forma.wasm`, powers `forma-3d` on npm)
16
17
  - [docs/VERIFICATION_REPORT.md](docs/VERIFICATION_REPORT.md): Independent geometric, slicer, Blender import, fuzz, and MCP verification
17
18
  - [docs/EXTENDED_BENCHMARK_REPORT.md](docs/EXTENDED_BENCHMARK_REPORT.md): Full 12-model / 10-lab cross-lab & reasoning-effort scaling study
18
19
 
19
20
  ## Quick Commands
20
21
 
21
22
  ```bash
22
- # Build release binaries (~1.2 MB each)
23
+ # Build release binaries (~1.7–1.8 MB stripped native)
23
24
  cargo build --release
24
25
 
25
26
  # Print the concise language spec (~355 tokens) or formal GBNF grammar
@@ -47,13 +48,13 @@ cargo build --release
47
48
  - `arc_tube(center=(x,y,z), rx=, rz=, start=-90, end=90, r=0.08)` (XZ elliptical arc)
48
49
  - `tube([(x,y,z), ...], r=0.08, closed=false)`
49
50
  - `extrude2d([(x,y), ...], z0=0, z1=1)`
50
- - `loft([(z, [(x,y), ...]), ...], segs=24)`
51
- - `thread(r_minor, r_major, pitch, turns, segs=28)`
51
+ - `loft([(z, [(x,y), ...]), ...], segs=24)` (`segs` 8..128)
52
+ - `thread(r_minor, r_major, pitch, turns, segs=28)` (`segs` 12..96)
52
53
  - `sweep([(x,y), ...], [(x,y,z), ...], closed=false)`
53
54
  - `text3d("TEXT", size=0.5, depth=0.1)`
54
55
  - Pipeline Ops (`mesh | op(...)` or `op(mesh, ...)`):
55
56
  - Booleans: `add(b, at=)`, `cut(b, at=)`, `intersect(b)` (batch-accelerated when `at=[...]`)
56
- - Modeling: `bevel(edges, w, segs=1)` (`vertical|top_rim|bottom_rim|outer_rim|sharp|all`), `shell(t, open_top=true)`, `extrude(faces, d)`, `inset(faces, amt, depth=0)` (`top|bottom|sides`), `subsurf(levels=1, crease=false)`, `mirror(x|y|z)`, `pattern_linear(n, step)`, `pattern_radial(n)`
57
+ - Modeling: `bevel(edges, w, segs=1)` (`vertical|top_rim|bottom_rim|outer_rim|sharp|all`), `shell(t, open_top=true)`, `extrude(faces, d)`, `inset(faces, amt, depth=0)` (`top|bottom|sides`), `subsurf(levels=1, crease=false)`, `mirror(x|y|z)`, `pattern_linear(n, step)` / `array(n, step)`, `pattern_radial(n, r=, axis=z)` / `radial(n, r=, axis=z)`
57
58
  - Placement: `move(x,y,z)`, `rot(rx,ry,rz)`, `scale(sx,sy,sz)`, `align(x|y|z, min|center|max, val)`, `on(base, gap=0)`, `align_z0(z)`
58
59
  - Materials: `mat(name, color=(r,g,b), metallic=0.1, roughness=0.5, faces=)`, `color(r,g,b)`
59
60
  - Spatial Queries (emitted in compact observation output):
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "forma-3d",
3
- "version": "0.4.0",
4
- "description": "A 1.2 MB pure-Rust rewrite of headless Blender built for AI agents — 3D B-rep modeling engine, CLI, WASM library, and MCP server.",
3
+ "version": "0.4.1",
4
+ "description": "Lightweight pure-Rust headless 3D polyhedral modeling engine built for AI agents — CLI, ~0.8 MB WASM library, and MCP server.",
5
5
  "license": "MIT",
6
6
  "author": "wrong-nebula",
7
7
  "type": "module",
@@ -31,7 +31,7 @@
31
31
  "LICENSE"
32
32
  ],
33
33
  "scripts": {
34
- "build:wasm": "RUSTFLAGS=\"--remap-path-prefix=$HOME=/home\" cargo build --profile wasm-release --target wasm32-unknown-unknown -p forma-wasm && mkdir -p wasm && cp target/wasm32-unknown-unknown/wasm-release/forma_wasm.wasm wasm/forma.wasm",
34
+ "build:wasm": "RUSTFLAGS=\"--remap-path-prefix=$HOME=/home\" cargo build --locked --profile wasm-release --target wasm32-unknown-unknown -p forma-wasm && mkdir -p wasm && cp target/wasm32-unknown-unknown/wasm-release/forma_wasm.wasm wasm/forma.wasm",
35
35
  "test": "node tests/npm_smoke.mjs"
36
36
  },
37
37
  "keywords": [
package/wasm/forma.wasm CHANGED
Binary file