Skip to content

feat: draw a coarse proxy of huge scans while the camera moves - #72

Open
Jozkah wants to merge 1 commit into
CNCKitchen:mainfrom
Jozkah:feat/lod-viewer
Open

Jozkah wants to merge 1 commit into
CNCKitchen:mainfrom
Jozkah:feat/lod-viewer

Conversation

@Jozkah

@Jozkah Jozkah commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Orbiting or zooming a huge scan re-draws every triangle each frame, so the view stutters on multi-million-triangle meshes.

Scans over 400k triangles now get a coarse proxy: a vertex-clustered index buffer over the scan's own vertices (src/viewer/lod.ts), drawn while the camera moves. Full detail comes back once the camera holds still for 180 ms. The proxy shares the vertex buffer, so colours and deviation still show on it, and picking, measuring, deviation and paint always use the full mesh.

  • src/viewer/lod.ts: the clustering
  • src/viewer/SceneManager.ts: swap to the proxy while the view moves, back when it settles
  • tests/lod.test.ts: proxy size, index validity, small meshes left alone

Checks:

  • npm run build: built
  • npx vitest run --maxWorkers=8: pass
  • check-plugin-boundary, check-units: hold
  • npm run e2e:ci: all pass (e2e-patch-network skipped, needs a real scan)

Not yet tried by hand on a multi-GB scan.

…amera moves

Scans over 400k triangles get a vertex-clustered index buffer over their
own vertices, drawn while the view is in motion; full detail returns once
the camera holds still for 180 ms. Picking, colours, deviation and paint
still use the full mesh.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant