Repository navigation
feat(view): show a local .glb/.gltf in a browser viewer - #54
Merged
Merged
Conversation
`meshy view <model>` serves one local model read-only on 127.0.0.1 and opens a three.js viewer page with a neutral studio look (Neutral tone mapping, a studio environment, key light and soft ground shadow). `--detach` serves from a background process and returns the URL in the envelope at once; `--no-open` skips the browser. Local only: no API call, no credential. The server stops after 30 minutes without a request. three.js 0.170 loads from jsDelivr with SRI hashes in the import map; the lighting environment ships in the package (assets/viewer-env.hdr, built from Poly Haven's CC0 "Decor Shop" by scripts/make-viewer-env.mjs). See D-094.
A file without materials got glTF's default material (white, fully metallic), and a mesh without normals had no shading, so untextured previews showed as a flat, overexposed shape. Such files now render as matte grey clay, and missing normals are computed. The fill lights are lowered so a white surface stays below clipping.
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.
Adds
meshy view, a local 3D viewer for a delivered model. Agents can use it to show the model in hosts whose file view cannot display a.glb, such as a browser panel next to the chat.Added
meshy view <model>: serves one local.glbor.gltfread-only on 127.0.0.1 and opens a three.js viewer page in the browser (rotate, zoom, first animation clip).--detachruns the server in a background process and returnsresult.urlandresult.pidat once.--no-openprints the URL without opening a browser..gltfthe buffers and textures inside its folder. It never reads sidecars, other files or links that point out of the folder. It answers only GET and HEAD with a loopback Host header.assets/viewer-env.hdr(about 0.5 MB, built from Poly Haven's CC0 "Decor Shop" byscripts/make-viewer-env.mjs).docs/decisions.md, plustests/view.test.ts. README,meshy resourcesand the bundled skill mention the command.Testing
npm run typecheckandnpm testpass: 709, 0 failed.