Repository navigation
Conversation
A face-vertex mesh with full adjacency in flat typed arrays (BMesh's disk and radial cycles, flattened), pure JS with no three.js import in the core, so it runs in node, a Worker and the page. Stable vertex / edge / face IDs (slots, never reused until compact(), which returns old -> new maps), n-gons, per-corner attributes (uv, normal, colour, any attribute), material slot per face, a CSR spatial hash, and triangulation only as output (a per-face cache in local corner indices with an order key, so an imported mesh re-emits its source triangles). Euler-style edits for K4 to build on: splitEdge, splitFace, dissolveEdge, mergeVertices, collapseEdge, flipFace, remove*, weldByDistance (neighbour cells, so pairs across a cell wall merge). validate() checks every invariant. Adapters: plain arrays <-> kernel (lossless: exact weld, stored partition -> n-gons, source order kept), BufferGeometry by duck type, kernel -> BufferGeometry (three.js, the one file importing it), the CSR face packing and the meshgeo payload, with optional vertex / face ID channels so a receiver rebuilds the sender's IDs. Nothing in the app imports it yet: no editor behaviour change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
meshKernelScenes: every geometry of every .tpscene in the templates, the fixtures and SCENES_DIR goes geometry -> kernel -> geometry and must come back value-identical (every attribute de-indexed, per-triangle material slot, the stored partition), then through the meshgeo wire with IDs. Scenes repo 3d3c99c + templates + fixtures: 50 scenes, 1818 meshes, 245138 triangles, all equal. meshKernelGltfTopo: measured answer to "does __topo survive the GLTF autosave path": YES for a single-material mesh (geometry.userData rides as primitive extras and validates on load); a multi-slot mesh is split into per-group primitives whose copies fail validation and are dropped (never trusted), and autosave restores those from the toJSON multiMaterial sidecar, which keeps it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tests/bench/: one bench module run by node (vitest bench config, outside the unit run) and by the browser through the vite dev server. Sphere soups and quad grids at 10k / 67k / 100k / 1M triangles; kernel build, weld 1e-4, one-ring, output, quad-topo import, dissolve-to-quads, spatial hash, against today's readTriangles + groupFaces + pairQuads. Kernel: import weld via the SpatialHash, trim() after import, allocation-free bucket dedupe. src/lib/meshKernel/API.md: the one-page API. CLAUDE.md: GLTF autosave DOES carry __topo for a single-material mesh (measured); meshKernel entry; index regenerated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # CLAUDE-index.md
…fuses tests/) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Roadmap 99 K1: a headless mesh kernel in
src/lib/meshKernel/. Nothing imports it yet: no editor behaviour changes, nothing insrc/outside the new folder. It rides the next int and has no release of its own.What it is
three.jsis the one adapter that imports three.compact(), which returns old→new maps.__topopacking, and themeshgeopayload, with optional ID channels.src/lib/meshKernel/API.md.Findings
__toposurvives GLTF autosave for a single-material mesh (GLTFExporter writes userData as primitive extras and GLTFLoader reads them back). A multi-slot mesh is split per group; those copies failfacesValidForand are dropped, and the toJSON sidecar keeps the partition. CLAUDE.md said the opposite and is corrected.__topotoday.Node bench (Ryzen Z2 Extreme, node 24)
"today enter-edit" is
readTriangles+groupFaces+pairQuadson the same sphere soup. The full table (one-ring, output, quad-topo import, dissolve to quads, spatial hash) is printed byNODE_OPTIONS='--expose-gc' npx vitest run --config tests/bench/vitest.bench.config.js. The browser runner (tests/bench/meshKernelBrowser.cjs) runs the same module on a dev server through a Playwright route, since vite does not servetests/.Deck browser bench (HeadlessChrome 156, same module)
Test plan
tests/unit/meshKernel.test.js: 53 tests. Seeded property tests (Euler characteristic, manifold check, ID stability across random edits,validate()after every step), plus a 300-seed × 300-step stress run (green).tests/unit/meshKernelScenes.test.js: round trip of every scene mesh (SCENES_DIR).tests/unit/meshKernelGltfTopo.test.js: GLTFExporter → GLTFLoader.npm run buildgreen.🤖 Generated with Claude Code