fix: automate GLB compression and real viewport smoke

This commit is contained in:
2026-07-10 13:19:47 +08:00
parent 78ec1fbdcc
commit cab4d320c0
6 changed files with 43 additions and 10 deletions

View File

@@ -18,6 +18,8 @@ Deliver three variants for Web/digital-twin presentation:
Generate them with `build_showcase_variants.py` or `cad_showcase.py run`. Validate `variants_manifest.json` and every variant spec. Keep `source_file==site` floors intact across variants.
The Trimesh branch of `cad_showcase.py run` writes a retained `.raw.glb` and then runs `tools/compress.mjs` (weld, dedup, prune, Draco) to produce each delivered `.glb`. The Blender branch uses Blender's Draco export. `verify_showcase.py --strict` must see `draco=True` and every delivered variant within the size budget.
Both GLB backends consume versioned `building_spec.json`. They must preserve `<floor>__<category>` names and glTF Y-up. `floor.caps` is canonical; exporters must not independently infer different cap groups.
## Served Viewer
@@ -45,7 +47,7 @@ node scripts/web_smoke_test.mjs \
--screenshots-dir outputs/<project>/browser_smoke
```
Install Playwright/Chromium first when needed. The script checks desktop/mobile control visibility, console/page/request failures, and idle render behavior. Feed the report to final verification with `--browser-report`. Supplying `--web-dir` makes the report mandatory: no report is `BLOCKED`, never PASS.
Install Playwright/Chromium first when needed. The script checks real 1440×900/390×844 viewport dimensions, desktop/mobile control visibility, console/page/request failures, and idle render behavior. Feed the report to final verification with `--browser-report`. Supplying `--web-dir` makes the report mandatory: no report is `BLOCKED`, never PASS.
When an execution tool already has a `run_in_background` option, launch `python3 -m http.server ...` as the foreground command of that background process. Do not append shell `&`; the child server can die with the wrapper. Before presenting the viewer, probe the URL and keep that server process alive. Present the formal `web/index.html` URL when Web was requested; `viewer.html` is a separate offline fallback, not a substitute.