3dtiles-inspector
v0.1.7
Published
Inspect, align, and save local 3D Tiles root transforms in an interactive browser session.
Maintainers
Readme
3DTiles-Inspector
3dtiles-inspector is a Node.js package and CLI for opening a local 3D Tiles tileset in a browser inspector, adjusting the root transform, tuning the effective geometric error scale, and saving the result back to disk.
Requires Node.js 18 or newer.
Install
npm install 3dtiles-inspectorCLI
3dtiles-inspector <tileset_json>npx 3dtiles-inspector <tileset_json>From a cloned repository:
npm run cli -- <tileset_json>The CLI starts a localhost HTTP server, copies the built inspector assets into a temporary directory, opens the default browser, and keeps running until you stop it with Ctrl+C.
<tileset_json> can be either:
- the root tileset JSON file, for example
out_tiles/tileset.json - a directory that contains
tileset.json
Node API
const { runInspector } = require('3dtiles-inspector');
(async () => {
await runInspector('./out_tiles/tileset.json');
})();If you need to control the browser launch or manage the session lifecycle yourself:
const {
resolveAndValidateTilesetPath,
startInspectorSession,
} = require('3dtiles-inspector');
(async () => {
const tilesetPath = resolveAndValidateTilesetPath('./out_tiles/tileset.json');
const session = await startInspectorSession(tilesetPath, {
openBrowser: false,
handleSignals: false,
});
console.log(session.url);
await session.close();
})();Inspector Features
Translate,Rotate, andResetfor root transform editsMove Camerato a WGS84 latitude / longitude / heightMove Tilesto relocate the tileset root with an ENU-aligned transformSet Positionto click the globe, terrain, or loaded tiles and place the tileset thereTerrainto toggle Cesium World Terrain while keeping satellite imageryGeometric Errorscaling from1/16xto16xLayer Multiplierscaling from1/8xto8xfor each tile's geometric-error difference from the tileset's global leaf baselineSaveto persist the updated root transform and geometric-error scale back to disk
If build_summary.json exists next to the root tileset, Save also updates:
root_transformroot_transform_sourceroot_coordinateviewer_geometric_error_scaleviewer_geometric_error_layer_scale
Package Surface
src/index.jsexports the public Node APIsrc/cli.jsimplements the standalone CLIsrc/viewer/session.jsmanages the local server, temporary assets, browser launch, and save handlingsrc/viewer/app.jscontains the browser runtime sourcedist/inspector-assets/viewer/contains the generated browser bundle and local decoder assets built bynpm run build:viewersrc/viewer/cameraController.jscontains the vendored camera controller used by the runtime
Development
npm install
npm test
npm run pack:checkError Handling
Runtime and validation failures throw InspectorError from the Node API and print a concise error message in the CLI.
