Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
feat(cookbook): posters from the recipes' own output, working nav, and an end-to-end tutorial
nirholasa48a0851fe2e
diff --git a/data/pages.json b/data/pages.jsonindex af6d4f9f1..c5a98c1dc 100644--- a/data/pages.json+++ b/data/pages.json@@ -2880,6 +2880,14 @@"changefreq": "monthly","added": "2026-06-12"},+ {+ "path": "/tutorials/build-a-3d-asset-pipeline",+ "title": "Tutorial: build a 3D asset pipeline",+ "description": "Four stages from one prompt to a CI gate: generate a model on the command line, fan a prompt list out in parallel with a manifest and a gallery, refuse to ship anything over its triangle or size budget, then hand the whole pipeline to an AI assistant as an MCP tool. Standard library only, no API key.",+ "priority": 0.6,+ "changefreq": "monthly",+ "added": "2026-07-30"+ },{"path": "/tutorials/add-a-3d-assistant","title": "Tutorial · Add a 3D Avatar Assistant",diff --git a/docs/3d-api.md b/docs/3d-api.mdindex d655c9b0a..db1b7120b 100644--- a/docs/3d-api.md+++ b/docs/3d-api.md@@ -488,6 +488,8 @@ mesh-optimization routes. See## Related+- [Cookbook](/cookbook) - runnable recipes built on these endpoints: a command-line client,+ a parallel asset-pack builder, an MCP server, and a CI quality gate- [API Reference](/docs/api-reference) - the full three.ws HTTP API surface- [3D Studio MCP endpoint](/docs/mcp-studio) - the same free generation lane as MCP tools- [x402 Paid Endpoints](/docs/x402-endpoints) - the paid catalog Forge Pro belongs todiff --git a/docs/cookbook/asset-quality-gate.md b/docs/cookbook/asset-quality-gate.mdnew file mode 100644index 000000000..606bbd404--- /dev/null+++ b/docs/cookbook/asset-quality-gate.md@@ -0,0 +1,155 @@+# Gate 3D assets in CI++Generated geometry fails quietly. A model downloads fine, validates against the+glTF spec perfectly, and is still a 400k-triangle monster that drops a phone to+8fps. Nothing in the pipeline complains, because nothing in the pipeline was+asked to.++**[Download `asset_gate.py`](/cookbook/recipes/asset_gate.py)** and point it at+anything:++```bash+python3 asset_gate.py model.glb # a local file+python3 asset_gate.py https://example.com/model.glb # or a URL+python3 asset_gate.py assets/*.glb --max-triangles 50000+```++```+PASS 176ed971-0be5-4fc6-b2ff-3370aa499e13.glb 19,074 tris 1.6 MB 1 mat 1 tex++1/1 assets passed the budget+```++Exit codes are the whole point: **0** everything passed, **1** at least one asset+busted its budget, **2** the gate itself could not run. Wire it into CI and a bad+asset fails the build instead of the launch.++## What it checks++| Check | Default | Flag |+|---|---|---|+| Valid glTF/GLB container | required | |+| Khronos validator errors | zero | |+| Triangle ceiling | 100,000 | `--max-triangles` |+| Triangle floor (collapsed generation) | 100 | `--min-triangles` |+| File size | 8 MB | `--max-size-mb` |+| Material count | 16 | `--max-materials` |+| Has materials | advisory | `--require-materials` |+| Has textures | advisory | `--require-textures` |++The floor matters more than it looks. When generation partially collapses you+get a valid GLB containing almost nothing, which passes every other check on the+list. A minimum triangle count is the cheapest way to catch it.++## The bug this recipe had, and why it is in the docs++The first version of this gate failed any model with zero materials, on the+reasoning that a model with no material renders untextured. Run against three+freshly generated models, it failed all three:++```+FAIL a-brass-watering-can.glb 46,348 tris 0.6 MB 0 mat 0 tex+ fail: no materials: the model would render untextured+```++Except the renders were in full color. The models were **vertex-colored**: color+lives in a `COLOR_0` mesh attribute rather than a PBR material, which the free+draft lane produces routinely. The gate was not catching a bad asset, it was+inventing one, and a gate that cries wolf gets switched off within a week.++The fix is to say what is true and let the caller decide:++```python+if materials == 0:+ if budget["require_materials"]:+ report.failures.append("no materials, and --require-materials was set")+ else:+ report.advisories.append(+ "no materials: likely vertex-colored geometry, which renders in color "+ "but ignores your lighting setup. Pass --require-materials to fail on it."+ )+```++If your scene has a carefully built lighting rig, vertex colors ignoring it may+genuinely be a defect, so `--require-materials` is there. It is just not the+default, because for most uses it is not a defect at all.++## Failures versus advisories++The distinction runs through the whole script. A **failure** blocks the build. An+**advisory** prints and is recorded in the JSON report, but exits zero:++```+PASS a-woven-wicker-basket.glb 147,617 tris 2.8 MB 0 mat 0 tex+ note: no materials: likely vertex-colored geometry ...+```++Validator warnings and the inspect API's own optimization recommendations land+in the same bucket. They are worth reading and they are not worth blocking on.++## In a CI job++```yaml+- name: Gate 3D assets+ run: |+ python3 asset_gate.py assets/**/*.glb \+ --max-triangles 80000 \+ --max-size-mb 5 \+ --json asset-report.json+```++When it fails and `GITHUB_STEP_SUMMARY` is set, the gate writes a readable+summary of exactly which assets busted which limits, so the failure is legible+from the run page without opening logs:++```python+if failed and os.environ.get("GITHUB_STEP_SUMMARY"):+ with open(os.environ["GITHUB_STEP_SUMMARY"], "a", encoding="utf-8") as summary:+ summary.write(f"### 3D asset gate: {len(failed)} failed\n")+```++`--json` writes the full report including the budget it was judged against,+which is the artifact you want when someone asks why a model that passed last+month fails today.++## Local files and URLs take different paths++A URL is inspected by reference, so nothing is uploaded:++```+GET /api/3d/inspect?url=https://example.com/model.glb+```++A local file is sent as raw bytes in the request body. The endpoint treats any+non-JSON POST body as the model itself, so there is no multipart envelope:++```python+content_type = "model/gltf+json" if filename.endswith(".gltf") else "model/gltf-binary"+req = urllib.request.Request(url, data=payload, headers={"content-type": content_type})+```++Both paths return byte-identical statistics for the same model, which is worth+knowing: you can gate a URL in staging and the same file locally in CI and trust+the numbers to match.++## What the inspect API gives you++Beyond the counts the gate reads, every response carries prioritized+recommendations with a concrete fix:++```jsonc+{+ "severity": "info",+ "issue": "Apply Draco compression to geometry for ~60-80% smaller vertex buffers. (~869 KB potential savings)",+ "fix": "Apply KHR_draco_mesh_compression to the geometry buffers."+}+```++Those are advisories here, but they are a good backlog for whatever ships the+assets.++## Where to go next++- **Generate the assets this gates** → [Build a whole asset pack in parallel](/cookbook/parallel-asset-pack)+- **Gate with a vision model instead of numbers** → [A self-correcting 3D collectible set](/cookbook/self-correcting-3d)+- **The full endpoint reference** → [3D API docs](/docs/3d-api)diff --git a/docs/tutorials/build-a-3d-asset-pipeline.md b/docs/tutorials/build-a-3d-asset-pipeline.mdnew file mode 100644index 000000000..d2aa2f818--- /dev/null+++ b/docs/tutorials/build-a-3d-asset-pipeline.md@@ -0,0 +1,190 @@+# Build a 3D asset pipeline++Generating one 3D model is a party trick. Shipping a hundred of them, on a+schedule, without a bad one reaching a user, is a pipeline. This tutorial builds+that pipeline in four stages, each one a working command by the end of its+section.++You will finish with a folder you can regenerate at any time, a manifest that+records exactly what was built, and a CI check that refuses to let a broken model+through.++**Prerequisites:** Python 3.10 or newer. That is the whole list. The+[3D API](/docs/3d-api) is free and keyless, so there is no account to make and no+key to store.++Every stage uses a file from the [Cookbook](/cookbook). Download them into one+working directory as you go.++---++## Stage 1: one model, from the command line++Grab [`text_to_3d.py`](/cookbook/recipes/text_to_3d.py) and run it:++```bash+python3 text_to_3d.py "a wooden treasure chest with iron bands"+```++```+prompt: a wooden treasure chest with iron bands+ glb: https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/forge/.../176ed971.glb+ viewer: https://three.ws/viewer?src=...+ ar: https://three.ws/api/ar?src=... (open on a phone to place it in your room)+saved 1651 KB to a-wooden-treasure-chest-with-iron-bands.glb+```++Open the viewer URL to look at it, or the AR URL on a phone to stand it on your+desk.++**What to learn here:** the API answers in two shapes, not one. It returns the+finished model inline when the draft is quick, and a job handle when the shared+GPU lane is busy. Any client you write has to handle both, and has to respect the+`retryAfter` hint that comes back with a queued job. The+[recipe page](/cookbook/text-to-3d-cli) walks through exactly why, and what+happens when you ignore it.++**Prompting for this tier.** The free lane is single-subject. "a brass watering+can" produces a watering can. "a kitchen with a table, three chairs and a window"+produces a blob. Describe one object, with material and shape, and stop there.++---++## Stage 2: a whole pack, in parallel++One at a time does not scale. Add+[`asset_pack.py`](/cookbook/recipes/asset_pack.py) to the same folder (it imports+`text_to_3d.py`, so they must sit together) and write your prompt list:++```text+# props.txt+a clay flower pot with a saucer+a woven wicker basket+a brass watering can+```++```bash+python3 asset_pack.py --prompts-file props.txt --out ./garden-pack+```++```+building 3 models with 3 workers into garden-pack/+ [ok ] a clay flower pot with a saucer 82s+ [ok ] a woven wicker basket 85s+ [ok ] a brass watering can 101s++3/3 built in 101s+open garden-pack/index.html+```++101 seconds instead of 268. Open `garden-pack/index.html` and you have an+interactive gallery you can send to someone.++**What to learn here:** concurrency is deliberately low, at three. The free lane+is a shared GPU pool, so twenty simultaneous jobs do not finish faster, they+queue behind each other and burn poll requests. Details, plus the failure-handling+rules, live on the [recipe page](/cookbook/parallel-asset-pack).++The file that matters most is `garden-pack/manifest.json`. It records every+prompt, its URL, its local path, its duration, and its error if it failed. That+file is what makes the next two stages possible.++---++## Stage 3: refuse to ship a bad model++Here is the failure this stage exists for: a model downloads fine, validates+against the glTF spec perfectly, and is a 147,617-triangle monster that will drop+a phone to single-digit frame rates. Nothing so far has complained, because+nothing so far was asked to.++Add [`asset_gate.py`](/cookbook/recipes/asset_gate.py) and point it at the pack:++```bash+python3 asset_gate.py garden-pack/models/*.glb --max-triangles 100000+```++```+PASS a-brass-watering-can.glb 46,348 tris 0.6 MB 0 mat 0 tex+ note: no materials: likely vertex-colored geometry ...+PASS a-clay-flower-pot-with-a-saucer.glb 76,555 tris 1.0 MB 0 mat 0 tex+FAIL a-woven-wicker-basket.glb 147,617 tris 2.8 MB 0 mat 0 tex+ fail: 147,617 triangles exceeds the budget of 100,000+```++Exit code 1. In CI, that fails the build.++**What to learn here:** the difference between a failure and an advisory. The+basket busting the triangle budget is a failure, because it will visibly hurt a+user. Zero materials is an advisory, because the free lane routinely produces+vertex-colored geometry that renders in full color without a material at all. A+gate that treats the second case as a failure cries wolf and gets switched off+within a week. The [recipe page](/cookbook/asset-quality-gate) tells the story of+that exact bug, because this gate had it.++Wire it into CI:++```yaml+- name: Gate 3D assets+ run: python3 asset_gate.py assets/**/*.glb --max-triangles 80000 --max-size-mb 5+```++---++## Stage 4: put the pipeline in the hands of an agent++The three stages above are yours to run. The last one hands them to an assistant.++[`mcp_3d_server.mjs`](/cookbook/recipes/mcp_3d_server.mjs) is a Model Context+Protocol server exposing two tools: generate a model, and render one to an image.++```bash+npm install @modelcontextprotocol/sdk zod+claude mcp add three-ws-3d -- node /absolute/path/to/mcp_3d_server.mjs+```++Now your assistant can build a model when you ask for one, and, because the+render tool returns the PNG inline as image content, it can actually look at the+result before showing it to you.++**What to learn here:** a tool's description is its real interface. The model+never reads your code, so "takes roughly 60 to 120 seconds" in the description is+what stops a client from firing a duplicate call because it assumed the first+had hung. The [recipe page](/cookbook/mcp-3d-tool) covers annotations and the+smoke test that saves you from debugging a dead server from inside a chat client.++---++## Closing the loop: let the model judge its own output++Stage 3 gates on numbers: triangles, bytes, materials. Numbers cannot tell you+that you asked for a cactus and got a shrub.++The [self-correcting 3D collectible set](/cookbook/self-correcting-3d) recipe+closes that gap. An art director model designs a themed set, issues parallel+function calls to generate every prop, renders each one, inspects the render with+vision, grades it against the original brief into a strict structured-output+schema, and rebuilds anything that missed, once, from the critic's own revised+prompt.++That is the same pipeline you just built, with a vision model where your+judgement used to be. It needs an OpenAI API key, and it is the natural next+step once the mechanical stages are running.++---++## What you built++| Stage | File | What it guarantees |+|---|---|---|+| 1 | `text_to_3d.py` | One prompt reliably becomes one downloaded model |+| 2 | `asset_pack.py` | Many prompts finish in parallel, with a manifest recording each |+| 3 | `asset_gate.py` | No model over budget reaches a user |+| 4 | `mcp_3d_server.mjs` | Your assistant can run stages 1 and 2 on request |++## Where to go next++- **Every recipe, with the reasoning** → [Cookbook](/cookbook)+- **The endpoints underneath** → [3D API reference](/docs/3d-api)+- **Higher quality and rigged output** → the paid tiers linked in every API response+- **Put a model on your page** → [Share and embed](/docs/share-and-embed)diff --git a/pages/cookbook.html b/pages/cookbook.htmlindex f65666864..7132cabf0 100644--- a/pages/cookbook.html+++ b/pages/cookbook.html@@ -55,17 +55,12 @@<script defer src="/nav.js"></script><script defer src="/footer-newsletter.js"></script><script defer src="/cookbook-manifest.js"></script>- <script- type="module"- src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"- integrity="sha384-sr9b4Ux0WhAUGclJ0ym0FSY2zSOMmNSn0bP/SA0e6bNCrpn/5W3QL8mm+LdlQMKw"- crossorigin="anonymous"- ></script></head><body><div class="cb-page">- <header></header>+ <header><div id="nav-container"></div></header>+ <main id="main-content"><section class="cb-hero"><div class="cb-hero-inner"><span class="cb-eyebrow">Cookbook</span>@@ -83,7 +78,7 @@</div></section>- <main class="cb-main">+ <div class="cb-main"><div class="cb-toolbar" role="group" aria-label="Filter recipes by level"><button class="cb-filter" type="button" data-level="all" aria-pressed="true">All@@ -130,6 +125,7 @@<a class="cb-btn" href="/tutorials">Browse tutorials</a></div></section>+ </div></main><footer id="site-footer"></footer>@@ -159,26 +155,18 @@);}- /* A poster image is cheaper and sharper than a live canvas, so it wins when- a recipe has one. The rotating model is the fallback, and it is paused- for anyone who asked for reduced motion. */+ /* Every poster is a render of a model the recipe itself produced, made with+ the platform renderer. A still beats a live canvas here: five WebGL+ contexts on one listing page is a real cost, and the alt text can then+ say what the reader is actually looking at. */function media(recipe) {- if (recipe.poster) {- return (- '<img src="' +- escapeHtml(recipe.poster) +- '" alt="" loading="lazy" decoding="async" width="640" height="360">'- );- }- if (!recipe.previewModel) return '';- const still = window.matchMedia('(prefers-reduced-motion: reduce)').matches;+ if (!recipe.poster) return '';return (- '<model-viewer src="' +- escapeHtml(recipe.previewModel) +- '" camera-controls disable-zoom touch-action="pan-y"' +- (still ? '' : ' auto-rotate rotation-per-second="16deg"') +- ' interaction-prompt="none" shadow-intensity="0.6" exposure="0.9"' +- ' alt="" aria-hidden="true"></model-viewer>'+ '<img src="' ++ escapeHtml(recipe.poster) ++ '" alt="' ++ escapeHtml(recipe.posterAlt || '') ++ '" loading="lazy" decoding="async" width="640" height="360">');}diff --git a/pages/recipe.html b/pages/recipe.htmlindex e6d806aa9..3efdb7b9c 100644--- a/pages/recipe.html+++ b/pages/recipe.html@@ -52,9 +52,9 @@</head><body><div class="cb-page">- <header></header>+ <header><div id="nav-container"></div></header>- <main class="cb-main">+ <main class="cb-main" id="main-content"><nav class="cb-crumbs" aria-label="Breadcrumb"><a href="/cookbook">Cookbook</a> <span aria-hidden="true">/</span><span id="cb-crumb-title">Recipe</span>diff --git a/public/cookbook-manifest.js b/public/cookbook-manifest.jsindex 87d97a4b5..371a7ae82 100644--- a/public/cookbook-manifest.js+++ b/public/cookbook-manifest.js@@ -30,6 +30,8 @@href: '/cookbook/text_to_3d_with_function_calling.ipynb',},poster: '/cookbook/houseplant-set.png',+ posterAlt:+ 'Six potted houseplants generated from one brief, after the vision critic rebuilt the three that failed',alsoOn: {label: 'OpenAI Cookbook',href: 'https://github.com/openai/openai-cookbook/pull/2874',@@ -48,7 +50,9 @@tags: ['text to 3d', 'cli', 'no dependencies'],href: '/cookbook/text-to-3d-cli',download: { label: 'text_to_3d.py', href: '/cookbook/recipes/text_to_3d.py' },- previewModel: '/animations/robotexpressive.glb',+ poster: '/cookbook/posters/text-to-3d-cli.png',+ posterAlt:+ 'A wooden treasure chest with iron bands, generated by this recipe and rendered with the platform renderer',},{slug: 'parallel-asset-pack',@@ -63,7 +67,8 @@tags: ['batch', 'concurrency', 'gallery'],href: '/cookbook/parallel-asset-pack',download: { label: 'asset_pack.py', href: '/cookbook/recipes/asset_pack.py' },- previewModel: '/animations/soldier.glb',+ poster: '/cookbook/posters/parallel-asset-pack.png',+ posterAlt: 'A clay flower pot with a saucer, one of three models this recipe built in parallel',},{slug: 'mcp-3d-tool',@@ -78,7 +83,8 @@tags: ['mcp', 'agents', 'tools'],href: '/cookbook/mcp-3d-tool',download: { label: 'mcp_3d_server.mjs', href: '/cookbook/recipes/mcp_3d_server.mjs' },- previewModel: '/avatars/mannequin.glb',+ poster: '/cookbook/posters/mcp-3d-tool.png',+ posterAlt: 'A small friendly desk robot, generated through this MCP server itself',},{slug: 'asset-quality-gate',@@ -93,7 +99,8 @@tags: ['ci', 'validation', 'performance'],href: '/cookbook/asset-quality-gate',download: { label: 'asset_gate.py', href: '/cookbook/recipes/asset_gate.py' },- previewModel: '/animations/robotexpressive.glb',+ poster: '/cookbook/posters/asset-quality-gate.png',+ posterAlt: 'A woven wicker basket at 147,617 triangles, the model that busted the default budget',},];diff --git a/public/cookbook.css b/public/cookbook.cssindex 55fb198a1..ec76983ad 100644--- a/public/cookbook.css+++ b/public/cookbook.css@@ -220,8 +220,7 @@ html.cookbook-page body {overflow: hidden;}-.cb-card-media img,-.cb-card-media model-viewer {+.cb-card-media img {width: 100%;height: 100%;display: block;diff --git a/public/cookbook/posters/asset-quality-gate.png b/public/cookbook/posters/asset-quality-gate.pngnew file mode 100644index 000000000..c6161913bBinary files /dev/null and b/public/cookbook/posters/asset-quality-gate.png differdiff --git a/public/cookbook/posters/mcp-3d-tool.png b/public/cookbook/posters/mcp-3d-tool.pngnew file mode 100644index 000000000..334854d8aBinary files /dev/null and b/public/cookbook/posters/mcp-3d-tool.png differdiff --git a/public/cookbook/posters/parallel-asset-pack.png b/public/cookbook/posters/parallel-asset-pack.pngnew file mode 100644index 000000000..0f5f055f7Binary files /dev/null and b/public/cookbook/posters/parallel-asset-pack.png differdiff --git a/public/cookbook/posters/text-to-3d-cli.png b/public/cookbook/posters/text-to-3d-cli.pngnew file mode 100644index 000000000..e914d8d25Binary files /dev/null and b/public/cookbook/posters/text-to-3d-cli.png differdiff --git a/public/cookbook/recipes/README.md b/public/cookbook/recipes/README.mdnew file mode 100644index 000000000..f7d3d89bd--- /dev/null+++ b/public/cookbook/recipes/README.md@@ -0,0 +1,70 @@+# Cookbook recipes++The runnable half of the [three.ws Cookbook](https://three.ws/cookbook). Each+file here is served verbatim at `https://three.ws/cookbook/recipes/<file>` and is+what the "Download" button on a recipe page hands you. The prose that explains+each one lives in [`docs/cookbook/`](../../../docs/cookbook).++Every file in this directory was executed against the live API before it was+published. Nothing here is illustrative pseudocode.++| File | What it does | Needs |+|---|---|---|+| [`text_to_3d.py`](text_to_3d.py) | Prompt in, downloaded `.glb` out | Python 3.10+ |+| [`asset_pack.py`](asset_pack.py) | Many prompts in parallel, plus stills, a manifest, and a gallery | Python 3.10+, `text_to_3d.py` beside it |+| [`asset_gate.py`](asset_gate.py) | Fails CI when a model busts a triangle, size, or material budget | Python 3.10+ |+| [`mcp_3d_server.mjs`](mcp_3d_server.mjs) | An MCP server exposing text-to-3D and rendering as tools | Node 18+, `@modelcontextprotocol/sdk`, `zod` |++None of them need an API key. They call the free, keyless+[3D API](https://three.ws/docs/3d-api).++## Run them++```bash+# One model+python3 text_to_3d.py "a wooden treasure chest with iron bands"++# A themed pack, three at a time+python3 asset_pack.py "a clay flower pot" "a woven wicker basket" --out ./pack++# Budget check, exits non-zero on a bust+python3 asset_gate.py ./pack/models/*.glb --max-triangles 100000++# The MCP server, over stdio+npm install @modelcontextprotocol/sdk zod+node mcp_3d_server.mjs+```++`asset_pack.py` imports `text_to_3d.py` (for `generate`, `download`, and+`slugify`) rather than restating the client, so the two cannot drift. Keep them+in the same directory.++## Conventions these files follow++They are meant to be copied into other people's projects, so they hold a+consistent shape:++- **Standard library only** for the Python recipes. A recipe that needs a+ `pip install` before it can prove anything is a worse recipe.+- **Honor `retryAfter`.** Every pending response from the generation lane carries+ a poll-cadence hint. Ignoring it trips the flood guard and slows the shared GPU+ pool for everyone. Each client clamps the hint to a sane window rather than+ replacing it.+- **Bound every loop.** No recipe polls forever. A tool that hangs is harder to+ debug than one that fails with a clear message.+- **Degrade, do not abort.** A missing thumbnail does not fail an asset; a+ missing model does. The distinction is explicit in the code.+- **Surface the API's own error text.** `urllib` and `fetch` both hide the+ response body on an error status. Every recipe reads it and re-raises with the+ server's message attached.++## Adding a recipe++1. Write the file here and actually run it.+2. Write the prose at `docs/cookbook/<slug>.md`.+3. Add an entry to [`public/cookbook-manifest.js`](../../cookbook-manifest.js).+4. Add the page to `data/pages.json` so it reaches the sitemap and `llms.txt`.+5. Add a `data/changelog.json` entry.++[`tests/cookbook.test.js`](../../../tests/cookbook.test.js) checks steps 1+through 4 agree with each other, so a recipe cannot ship half-wired.diff --git a/public/cookbook/self-correcting-3d/index.html b/public/cookbook/self-correcting-3d/index.htmlindex 6cfc1d99a..7a2cb0e6b 100644--- a/public/cookbook/self-correcting-3d/index.html+++ b/public/cookbook/self-correcting-3d/index.html@@ -7794,15 +7794,15 @@ a.anchor-link {white-space: normal;}</style>-<!-- End of mermaid configuration --> <link rel="canonical" href="https://three.ws/cookbook">+<!-- End of mermaid configuration --> <link rel="canonical" href="https://three.ws/cookbook/self-correcting-3d"><meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1"><meta property="og:type" content="website"><meta property="og:site_name" content="three.ws"><meta property="og:locale" content="en_US"><meta property="og:title" content="Cookbook: self-correcting 3D with function calling · three.ws" data-i18n-attr="content:cookbook_index.meta_og_title"><meta property="og:description" content="An executable tutorial: an AI art director turns a one-line brief into a themed set of real 3D props with parallel function calls, inspects each render with vision, and rebuilds what fails. Read it with interactive galleries, or download the notebook and run it." data-i18n-attr="content:cookbook_index.meta_og_description">- <meta property="og:url" content="https://three.ws/cookbook">- <meta property="og:image" content="https://three.ws/api/page-og?s=learn&t=Cookbook%3A+self-correcting+3D+with+function+calling&d=An+executable+tutorial%3A+an+AI+art+director+turns+a+one-line+brief+into+a+themed+set+of+real+3D+props+with+parallel+function+calls%2C+inspects+each+render+with&p=%2Fcookbook">+ <meta property="og:url" content="https://three.ws/cookbook/self-correcting-3d">+ <meta property="og:image" content="https://three.ws/api/page-og?s=learn&t=Cookbook%3A+self-correcting+3D+with+function+calling&d=An+executable+tutorial%3A+an+AI+art+director+turns+a+one-line+brief+into+a+themed+set+of+real+3D+props+with+parallel+function+calls%2C+inspects+each+render+with&p=%2Fcookbook%2Fself-correcting-3d"><meta property="og:image:width" content="1200"><meta property="og:image:height" content="630"><meta property="og:image:type" content="image/png">@@ -7811,8 +7811,8 @@ a.anchor-link {<meta name="twitter:site" content="@trythreews"><meta name="twitter:title" content="Cookbook: self-correcting 3D with function calling · three.ws" data-i18n-attr="content:cookbook_index.meta_twitter_title"><meta name="twitter:description" content="An executable tutorial: an AI art director turns a one-line brief into a themed set of real 3D props with parallel function calls, inspects each render with vision, and rebuilds what fails. Read it with interactive galleries, or download the notebook and run it." data-i18n-attr="content:cookbook_index.meta_twitter_description">- <meta name="twitter:image" content="https://three.ws/api/page-og?s=learn&t=Cookbook%3A+self-correcting+3D+with+function+calling&d=An+executable+tutorial%3A+an+AI+art+director+turns+a+one-line+brief+into+a+themed+set+of+real+3D+props+with+parallel+function+calls%2C+inspects+each+render+with&p=%2Fcookbook">- <script type="application/ld+json">{"@context":"https://schema.org","@graph":[{"@type":"WebPage","name":"Cookbook: self-correcting 3D with function calling","description":"An executable tutorial: an AI art director turns a one-line brief into a themed set of real 3D props with parallel function calls, inspects each render with vision, and rebuilds what fails. Read it with interactive galleries, or download the notebook and run it.","url":"https://three.ws/cookbook","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"},"primaryImageOfPage":"https://three.ws/api/page-og?s=learn&t=Cookbook%3A+self-correcting+3D+with+function+calling&d=An+executable+tutorial%3A+an+AI+art+director+turns+a+one-line+brief+into+a+themed+set+of+real+3D+props+with+parallel+function+calls%2C+inspects+each+render+with&p=%2Fcookbook"}]}</script>+ <meta name="twitter:image" content="https://three.ws/api/page-og?s=learn&t=Cookbook%3A+self-correcting+3D+with+function+calling&d=An+executable+tutorial%3A+an+AI+art+director+turns+a+one-line+brief+into+a+themed+set+of+real+3D+props+with+parallel+function+calls%2C+inspects+each+render+with&p=%2Fcookbook%2Fself-correcting-3d">+ <script type="application/ld+json">{"@context":"https://schema.org","@graph":[{"@type":"WebPage","name":"Cookbook: self-correcting 3D with function calling","description":"An executable tutorial: an AI art director turns a one-line brief into a themed set of real 3D props with parallel function calls, inspects each render with vision, and rebuilds what fails. Read it with interactive galleries, or download the notebook and run it.","url":"https://three.ws/cookbook/self-correcting-3d","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"},"primaryImageOfPage":"https://three.ws/api/page-og?s=learn&t=Cookbook%3A+self-correcting+3D+with+function+calling&d=An+executable+tutorial%3A+an+AI+art+director+turns+a+one-line+brief+into+a+themed+set+of+real+3D+props+with+parallel+function+calls%2C+inspects+each+render+with&p=%2Fcookbook%2Fself-correcting-3d"}]}</script></head><body class="jp-Notebook" data-jp-theme-light="true" data-jp-theme-name="JupyterLab Light"><div id="tws-cookbook-bar" style="position:sticky;top:0;z-index:9999;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 18px;background:#0b0d12;border-bottom:1px solid #232838;font-family:ui-sans-serif,-apple-system,'Segoe UI',Roboto,sans-serif;">@@ -7821,6 +7821,7 @@ a.anchor-link {<span style="font-family:ui-monospace,Menlo,monospace;font-size:11px;letter-spacing:.14em;text-transform:uppercase;color:#8b7bf7;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" data-i18n="cookbook_index.executable_tutorial_function_calling_text_to">// executable tutorial · function calling × text-to-3D</span></div><div style="display:flex;gap:8px;flex:none;">+ <a href="/cookbook" style="font-size:12px;color:#8b93a7;text-decoration:none;border:1px solid #232838;padding:4px 12px;border-radius:999px;">all recipes</a><a href="/cookbook/text_to_3d_with_function_calling.ipynb" download style="font-size:12px;color:#8b93a7;text-decoration:none;border:1px solid #232838;padding:4px 12px;border-radius:999px;" data-i18n="cookbook_index.download_ipynb">download .ipynb</a><a href="/api/3d" style="font-size:12px;color:#8b93a7;text-decoration:none;border:1px solid #232838;padding:4px 12px;border-radius:999px;" data-i18n="cookbook_index.3d_api">3D API</a></div>diff --git a/public/features.json b/public/features.jsonindex 40a4bcb0b..4521c928a 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-30T23:07:12.622Z",+ "generated_at": "2026-07-30T23:22:36.222Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",@@ -3637,6 +3637,16 @@"tags": [],"showcase": false},+ {+ "path": "/tutorials/build-a-3d-asset-pipeline",+ "title": "Tutorial: build a 3D asset pipeline",+ "description": "Four stages from one prompt to a CI gate: generate a model on the command line, fan a prompt list out in parallel with a manifest and a gallery, refuse to ship anything over its triangle or size budget, then hand the whole pipeline to an AI assistant as an MCP tool. Standard library only, no API key.",+ "added": "2026-07-30",+ "auth": null,+ "indexable": true,+ "tags": [],+ "showcase": false+ },{"path": "/tutorials/add-a-3d-assistant","title": "Tutorial · Add a 3D Avatar Assistant",diff --git a/public/llms-full.txt b/public/llms-full.txtindex 6294ed55b..75cb48d92 100644--- a/public/llms-full.txt+++ b/public/llms-full.txt@@ -2213,6 +2213,12 @@ URL: https://three.ws/tutorials/text-to-3dFive-minute beginner walkthrough of the Forge: type a sentence, pick a quality tier, and download a textured GLB model.+### Tutorial: build a 3D asset pipeline++URL: https://three.ws/tutorials/build-a-3d-asset-pipeline++Four stages from one prompt to a CI gate: generate a model on the command line, fan a prompt list out in parallel with a manifest and a gallery, refuse to ship anything over its triangle or size budget, then hand the whole pipeline to an AI assistant as an MCP tool. Standard library only, no API key.+### Tutorial · Add a 3D Avatar AssistantURL: https://three.ws/tutorials/add-a-3d-assistantdiff --git a/public/llms.txt b/public/llms.txtindex 2b1c1c1c8..4cc060d6f 100644--- a/public/llms.txt+++ b/public/llms.txt@@ -384,6 +384,7 @@ Docs, tutorials, and reference.- [Tutorials](https://three.ws/tutorials): Step-by-step build guides.- [Examples](https://three.ws/examples): Runnable three.ws examples: copy-paste snippets that execute on the page against the production CDN bundle, plus every example that ships in the repository, generated by scanning it. Each one lists the files it contains and the command that runs it.- [Tutorial · Text Prompt to 3D Model](https://three.ws/tutorials/text-to-3d): Five-minute beginner walkthrough of the Forge: type a sentence, pick a quality tier, and download a textured GLB model.+- [Tutorial: build a 3D asset pipeline](https://three.ws/tutorials/build-a-3d-asset-pipeline): Four stages from one prompt to a CI gate: generate a model on the command line, fan a prompt list out in parallel with a manifest and a gallery, refuse to ship anything over its triangle or size budget, then hand the whole pipeline to an AI assistant as an MCP tool. Standard library only, no API key.- [Tutorial · Add a 3D Avatar Assistant](https://three.ws/tutorials/add-a-3d-assistant): Step-by-step: add a floating 3D avatar assistant to any website with one script tag, configure the avatar, background, and brand, drive it from your own code, or have an AI agent generate the embed via MCP.- [Tutorial · Photos to 3D Model](https://three.ws/tutorials/image-to-3d): Photograph a real object from up to four angles and reconstruct it as a textured 3D model: photo tips, guidance prompts, troubleshooting.- [Tutorial · Prompt Recipes for 3D Generation](https://three.ws/tutorials/prompts-for-3d): A copy-paste prompt cookbook for 3D generation: game props, furniture, characters, vehicles, food: and the four rules behind every good prompt.diff --git a/public/locales/localized-pages.json b/public/locales/localized-pages.jsonindex 651c0a78a..909e2d53d 100644--- a/public/locales/localized-pages.json+++ b/public/locales/localized-pages.json@@ -1,6 +1,6 @@{"generated": true,- "count": 349,+ "count": 350,"paths": ["/","/3d",@@ -62,6 +62,7 @@"/concierge","/constellation","/converter",+ "/cookbook/self-correcting-3d","/cosmos","/create","/create-agent",diff --git a/public/sitemap/index.html b/public/sitemap/index.htmlindex 7deb671db..e31d187cb 100644--- a/public/sitemap/index.html+++ b/public/sitemap/index.html@@ -79,7 +79,7 @@<main class="sm-wrap"><div class="sm-hero"><h1>Sitemap</h1>- <p>All 740 pages on three.ws, grouped by purpose. Looking for the machine-readable versions?</p>+ <p>All 741 pages on three.ws, grouped by purpose. Looking for the machine-readable versions?</p><div class="sm-formats"><a href="/sitemap.xml"><code>sitemap.xml</code> · for search engines</a><a href="/llms.txt"><code>llms.txt</code> · for AI agents</a>@@ -91,7 +91,7 @@</div><div class="sm-filter"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m21 21-4.3-4.3"/></svg>- <input id="sm-filter-input" type="search" placeholder="Filter 740 pages by name, path, or description…" aria-label="Filter pages" autocomplete="off" spellcheck="false" />+ <input id="sm-filter-input" type="search" placeholder="Filter 741 pages by name, path, or description…" aria-label="Filter pages" autocomplete="off" spellcheck="false" /><kbd aria-hidden="true">/</kbd></div><p class="sm-filter-count" id="sm-filter-count" role="status" aria-live="polite"></p>@@ -2069,7 +2069,7 @@<section class="sm-section" id="learn"><header>- <h2>Learn<span class="sm-count" data-count>316</span></h2>+ <h2>Learn<span class="sm-count" data-count>317</span></h2><p class="sm-section-desc">Docs, tutorials, and reference.</p></header><ul class="sm-list">@@ -2752,6 +2752,13 @@<span class="sm-desc">Five-minute beginner walkthrough of the Forge: type a sentence, pick a quality tier, and download a textured GLB model.</span></a></li>+ <li>+ <a href="/tutorials/build-a-3d-asset-pipeline">+ <span class="sm-title">Tutorial: build a 3D asset pipeline</span>+ <span class="sm-path">/tutorials/build-a-3d-asset-pipeline</span>+ <span class="sm-desc">Four stages from one prompt to a CI gate: generate a model on the command line, fan a prompt list out in parallel with a manifest and a gallery, refuse to ship anything over its triangle or size budget, then hand the whole pipeline to an AI assistant as an MCP tool. Standard library only, no API key.</span>+ </a>+ </li><li><a href="/tutorials/add-a-3d-assistant"><span class="sm-title">Tutorial · Add a 3D Avatar Assistant</span>diff --git a/public/tutorials-manifest.js b/public/tutorials-manifest.jsindex 88adc7501..9340612b6 100644--- a/public/tutorials-manifest.js+++ b/public/tutorials-manifest.js@@ -514,6 +514,16 @@previewModel: '/avatars/cz.glb',ctaPrimary: { label: 'Run the example', href: 'https://github.com/nirholas/three.ws/tree/main/examples/wallet-sign-in' },},+ {+ slug: 'build-a-3d-asset-pipeline',+ tier: 'middle',+ title: 'Build a 3D asset pipeline',+ blurb: 'Four stages from one prompt to a CI gate: generate a model on the command line, fan a prompt list out in parallel with a manifest and a gallery, refuse to ship anything over budget, then hand the whole pipeline to an AI assistant as an MCP tool. Standard library only, no API key.',+ builds: 'A regenerable asset folder plus a CI check that blocks bad models',+ time: '25 min',+ previewModel: '/animations/robotexpressive.glb',+ ctaPrimary: { label: 'Open the Cookbook', href: '/cookbook' },+ },{slug: 'agent-spending-envelope',tier: 'advanced',diff --git a/tests/cookbook.test.js b/tests/cookbook.test.jsindex 17988ee19..ad86d9f2c 100644--- a/tests/cookbook.test.js+++ b/tests/cookbook.test.js@@ -114,14 +114,16 @@ describe('every recipe is fully wired', () => {}});- it('has a poster or a preview model that exists', () => {+ it('has a poster that exists, with alt text', () => {for (const recipe of recipes) {- const asset = recipe.poster || recipe.previewModel;- if (!asset) continue;+ expect(recipe.poster, `${recipe.slug} needs a poster`).toBeTruthy();expect(- existsSync(resolve(root, `public${asset}`)),- `${recipe.slug} points at ${asset}, which does not exist`,+ existsSync(resolve(root, `public${recipe.poster}`)),+ `${recipe.slug} points at ${recipe.poster}, which does not exist`,).toBe(true);+ // The poster carries meaning (it is the recipe's own output), so empty alt+ // would be wrong here even though decorative images take alt="".+ expect(recipe.posterAlt, `${recipe.slug} poster needs alt text`).toBeTruthy();}});