1---
2name: verify
3description: Build, launch, and drive mesh-studio headlessly to verify a change at the browser surface (WebGL renders fine under headless Chrome + SwiftShader).
4---
6# Verifying mesh-studio
8`npm run build` only gates TS + bundling. The real surface is the browser
9(OCCT WASM + three.js WebGL), and it works headlessly:
111. `npm run dev -- --port 5199 --strictPort` (background).
122. Drive with playwright-core (install it in the scratchpad, not the repo)
13 using system Chrome — WebGL needs the SwiftShader flags:
15 ```js
16 chromium.launch({
17 executablePath: '/usr/bin/google-chrome',
18 headless: true,
19 args: ['--use-angle=swiftshader', '--enable-unsafe-swiftshader'],
20 })
21 ```
233. Cheapest end-to-end flow (no network): click the "Box" primitive button.
24 That triggers the ~50 MB OCCT WASM load (local, a few seconds) — wait for
25 `.view-overlay` to appear and `.busy` to disappear, then screenshot.
26 "Random CAD model" additionally exercises the network import path.
28## Gotchas
30- Rendering is deterministic — byte-identical screenshots across runs means
31 your change did NOT take effect, not that it's stable.
32- To pixel-check the canvas, screenshot the `.viewport canvas` locator and
33 analyze in-page via a 2D canvas; `gl.readPixels` returns blanks because the
34 renderer doesn't preserve the drawing buffer.
35- Face picking: click the canvas center and look for a sidebar `h2` matching
36 `Face #`.
37- `node_modules` reads are permission-denied here; inspect library behavior at
38 runtime (temporary `console.log` in app code + a page that captures console)
39 instead of reading vendored source.