feat(site): interactive 3D blueprint viewer for hardware diagrams#102
feat(site): interactive 3D blueprint viewer for hardware diagrams#102AndrewAltimit merged 9 commits intomainfrom
Conversation
Data-driven Three.js blueprint viewer at site/blueprint.html with ?diagram= URL param. Two diagrams: psp-relay (H-bridge actuator wiring) and psp-usb-adapter (passive USB-C bridge with upright PSP model). Journal entries 05 and 08 link to interactive versions from their static diagram images. Includes headless screenshot test script. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nents
Split 880-line monolith into 4 focused files:
- blueprint.html (73 lines) — thin HTML shell, loads scripts
- blueprint-engine.js (410 lines) — reusable engine: orbit controls,
explode slider, hover tooltips, tabs, render loop, shared PSP body
component (buildPSP), and drawing helpers
- blueprints/psp-relay.js (154 lines) — relay diagram data + build
- blueprints/psp-usb-adapter.js (154 lines) — adapter diagram, uses
shared buildPSP() component
Adding a new diagram is now: create js/blueprints/foo.js, call
BlueprintEngine.register('foo', {...}), add a <script> tag.
Also fixes Three.js group.add().position.set() bug where add() returns
the parent group, not the child — was silently shifting the PSP group.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…leanup
1. Add geometry helpers: plane(), ring(), circle(), sphere(), v() —
diagram authors no longer need raw Three.js for common shapes
2. Make tab system data-driven: tabStates now declares {explode: N}
per tab instead of hardcoding 'assembled'/'exploded' IDs in engine
3. Validate diagram.build() return with defaults + try/catch error display
4. Scene lifecycle cleanup(): removes old canvas, resize listener, tabs
on re-init — prevents accumulation if init() called twice
5. DRY: v() helper in engine, diagram files delegate to h.v()
6. Document PSP unit system (1 unit = 10mm) and spec source
7. Document dims group skip in explode controller
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Load a real PSP-3001 3D model (converted from FBX to GLB) and render as wireframe + dark fill in the blueprint viewer. The model has proper curved grips, button indentations, screen bezel depth, speaker grilles, and UMD slot detail — far more accurate than the procedural wireBox approximation which is kept as fallback. Pipeline: FBX → puppeteer + Three.js FBXLoader → merged GLB (2.7MB geometry only, no textures). Rotation calibrated via interactive test grid (PI/2 - 0.75 compensates for FBX export tilt). Model height measured from bbox to position adapter correctly on top edge. Includes GLTFLoader.js (r128), FBX→GLB conversion scripts, and Git LFS tracking for .glb files. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Replace all billboard sprite labels with fixed 3D world-space text (tag() now uses PlaneGeometry with canvas-measured text sizing) - Fix relay H-bridge wiring to match real hardware: 12V+ to NC1/NO2, GND to NO1/NC2, COM1/COM2 to actuator (from reference photos) - Center Micro-USB port on relay PCB (was in corner) - Match PSP top-edge connector spacing to real hardware photos: one 5V power pad per side, screw holes at outer edges - Fix HUD layout spacing (back-link, title, tabs, dims no longer overlap) - Default to fully compact view (explode slider starts at 0) - Add model comparison and rotation test scripts for iterating on 3D model orientation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Gemini AI Code ReviewIssues (if any)
Previous Issues (for incremental reviews)(none) Suggestions (if any)
Notes
Generated by Gemini AI (gemini-3.1-pro-preview). Supplementary to human reviews. |
Automated fix by Claude in response to Gemini/Codex review. Iteration: 1/5 Co-Authored-By: AI Review Agent <noreply@anthropic.com>
Review Response Agent (Iteration 1)Status: Changes committed, pushing... Commit: Fixed Issues
Ignored Issues
Deferred to Human
Notes
Automated summary of agent fixes. |
Gemini AI Incremental ReviewThis is an incremental review focusing on changes since the last review. Issues (if any)
Previous Issues (for incremental reviews)
Suggestions (if any)(none) Notes
Generated by Gemini AI (gemini-3.1-pro-preview). Supplementary to human reviews. |
Automated fix by Claude in response to Gemini/Codex review. Iteration: 2/5 Co-Authored-By: AI Review Agent <noreply@anthropic.com>
Review Response Agent (Iteration 2)Status: Changes committed, pushing... Commit: Fixed Issues
Ignored Issues
Deferred to Human
Notes
Automated summary of agent fixes. |
Gemini AI Incremental ReviewThis is an incremental review focusing on changes since the last review. Issues (if any)
Previous Issues (for incremental reviews)
Suggestions (if any)(none) Notes
Generated by Gemini AI (gemini-3.1-pro-preview). Supplementary to human reviews. |
Store the rAF ID and cancel it in cleanup() so re-initializing the engine doesn't leave orphaned render loops running with references to old WebGL contexts, scenes, and renderers. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Gemini AI Incremental ReviewThis is an incremental review focusing on changes since the last review. Issues (if any)
Previous Issues (for incremental reviews)
Suggestions (if any)
Notes
Generated by Gemini AI (gemini-3.1-pro-preview). Supplementary to human reviews. |
Automated fix by Claude in response to Gemini/Codex review. Iteration: 3/5 Co-Authored-By: AI Review Agent <noreply@anthropic.com>
Review Response Agent (Iteration 3)Status: Changes committed, pushing... Commit: Fixed Issues
Ignored Issues
Deferred to Human
Notes
Automated summary of agent fixes. |
Gemini AI Incremental ReviewThis is an incremental review focusing on changes since the last review. Issues (if any)(none) Previous Issues (for incremental reviews)
Suggestions (if any)(none) Notes
Generated by Gemini AI (gemini-3.1-pro-preview). Supplementary to human reviews. |
Review Response Agent (Iteration 4)Status: No changes needed
Fixed Issues
Ignored Issues
Deferred to Human
Notes
The agent reviewed feedback but no file modifications were detected. |

Summary
site/blueprint.htmlwith?diagram=URL param, powered by Three.jsblueprint-engine.js) + per-diagram files (blueprints/*.js) -- adding a new diagram is one JS file + one<script>tagscripts/blueprint-screenshot.js) for automated visual testingArchitecture
Key decisions
{explode: N}per tab state, no hardcoded IDs in engineTest plan
blueprint.html?diagram=psp-usb-adapter-- PSP model renders upright, adapter sits on topblueprint.html?diagram=psp-relay-- relay, PSU, PC, actuator with correct H-bridge wiringnode scripts/blueprint-screenshot.js psp-usb-adapterproduces 6 screenshotsGenerated with Claude Code