name: verify description: Build, launch, and drive mesh-studio headlessly to verify a change at the browser surface (WebGL renders fine under headless Chrome + SwiftShader).#
Verifying mesh-studio#
npm run build only gates TS + bundling. The real surface is the browser
(OCCT WASM + three.js WebGL), and it works headlessly:
-
npm run dev -- --port 5199 --strictPort(background). -
Drive with playwright-core (install it in the scratchpad, not the repo) using system Chrome — WebGL needs the SwiftShader flags:
chromium.launch({ executablePath: '/usr/bin/google-chrome', headless: true, args: ['--use-angle=swiftshader', '--enable-unsafe-swiftshader'], }) -
Cheapest end-to-end flow (no network): click the "Box" primitive button. That triggers the ~50 MB OCCT WASM load (local, a few seconds) — wait for
.view-overlayto appear and.busyto disappear, then screenshot. "Random CAD model" additionally exercises the network import path.
Gotchas#
- Rendering is deterministic — byte-identical screenshots across runs means your change did NOT take effect, not that it's stable.
- To pixel-check the canvas, screenshot the
.viewport canvaslocator and analyze in-page via a 2D canvas;gl.readPixelsreturns blanks because the renderer doesn't preserve the drawing buffer. - Face picking: click the canvas center and look for a sidebar
h2matchingFace #. node_modulesreads are permission-denied here; inspect library behavior at runtime (temporaryconsole.login app code + a page that captures console) instead of reading vendored source.