app
adom-glb2png
Public Made by Adomby adom
Render a GLB to a PNG via headless three.js. CLI sibling to step2glb / adom-pin1-truth — gives Claude (and you) a way to verify 3D component models without spinning up a webview screenshot loop.
← Commit history
page.json−1@@ -37,7 +37,6 @@ }, "readme": "# adom-glb2png\n\nRender a GLB file to a PNG via headless three.js. Useful for verifying 3D component models without spinning up a webview + screenshot loop.\n\n## Usage\n\n```\nadom-glb2png <glb-path> [--view top|iso|front|side|bottom] [--size N] [--out path]\n```\n\n- `--view` — camera direction, defaults to `iso`\n- `--size` — output image is square `size × size`, defaults to 800\n- `--out` — output PNG path, defaults to `<basename>.png`\n\nExit codes: `0` on success, `1` on render error, `2` on bad input.\n\n## How it works\n\nA small Bun-compiled binary that spins up a headless Chromium (via puppeteer) pointing at a tiny three.js viewer page, loads the GLB, frames the camera so the bbox diagonal fills ~70% of the viewport, screenshots, exits.\n\n- Camera near-plane is `0.0001` because most KiCad-pipeline GLBs use meters (a 0402 resistor's bbox diagonal is ~0.0012m).\n- Double-render with `requestAnimationFrame` between passes makes the output buffer non-empty reliably under SwiftShader.\n- First run downloads Chromium (~150 MB) into `~/.cache/puppeteer/`. Subsequent runs reuse the cache.\n\n## Source\n\ngithub.com/adom-inc/adom-glb2png\n", "author": {- "id": "695820315b5f1e4db2fcf602", "name": "Kyle Bergstedt", "email": "[email protected]" },