Repository navigation
smart-unwrap 1.0.0: Smart (xatlas) UV unwrap module (37 R11) - #44
Merged
Merged
Conversation
…packaged wasm (37 R11)
A new installable module that registers an xatlas unwrap through
api.registerUnwrapBackend('xatlas', 'Smart (xatlas)', async run). xatlas cuts the
mesh into charts, flattens them and packs them into a single 0..1 atlas where no
charts overlap.
- The build is xatlas-wasm 0.1.3 (MIT declared, xatlas MIT). Its wasm is 177 kB with
a 6-import C API and a release glue that honours Module.instantiateWasm. watlas
1.0.1 was rejected: its 225 kB embind build ships an ASSERTIONS glue that aborts
on instantiateWasm/wasmBinary and resolves the wasm against import.meta.url.
- vendor.mjs splits the npm package's SINGLE_FILE bundle into assets/xatlas.wasm and
the glue spliced into module.js. It parses the package as text and never runs it.
- The wasm is read through api.assetUrl on the first unwrap and cached. onUnload
drops the cache, and the SDK journals the backend registration itself.
- Welding by exact position gives xatlas the mesh connectivity. Output corners are
mapped back through xref.
- rotateCharts is off because xatlas's packer rotates a chart by transposing it,
which mirrors it. With fixWinding on, every chart comes out unmirrored.
- On failure the module shows a toast and returns null, so core commits nothing.
Tests: npm run test:smart-unwrap (node, no app) covers a cube, a UV sphere, a
cylinder, a scoped half-sphere and a 12k-triangle sphere. It checks properties:
3 corners per face, every uv in [0,1], no zero-area triangle, islands that
partition the faces, no overlap between islands on a 512² raster, CCW winding and
at most 6 islands on the cube. Counterfactuals prove each check catches a broken
result. 55 pass.
Co-Authored-By: Claude Opus 5.5 (1M context) <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 37 R11 (release 1.28): smart-unwrap 1.0.0 is an installable module that adds Smart (xatlas) to the UV editor's Unwrap menu through
api.registerUnwrapBackend. xatlas places seams, flattens the charts and packs them into one 0..1 atlas with no overlaps.xatlas-wasm0.1.3.instantiateWasmhook. It ships inside the zip and is reached throughapi.assetUrl, so there is no CDN or network call.watlaswas rejected: its debug glue aborts when handed the wasm, and it resolves the wasm relative to the script's URL, which doesn't work for a module loaded from a blob URL.onUnloaddrops the cache.rotateChartsis off. With it on, xatlas mirrors any chart it turns 90°, so painted text would read backwards there.xatlas-wasmdeclares MIT but ships no license text. The notices for xatlas, thekla_atlas and Fast-BVH are inTHIRD_PARTY_LICENSES.txt, which goes into the zip.npm run test:smart-unwrap: 55/55. It runs on a cube, a sphere, a cylinder, a scoped half-sphere and a 12k-triangle sphere. Each check (in range, not degenerate, covers every face, no overlap, wound the right way) is also shown to fail on a deliberately broken result.uv-smart-unwrappasses 19/0 with two peers, using the real zip (core PR 37 R11: knife polylines, live symmetry, Smart unwrap core half (1.28) core#340).index.jsonhave new entries.🤖 Generated with Claude Code