3dtiles-inspector

中文文档
0.3.3发布于 2026/08/31Apache-2.0CommonJS构建来源已验证近 30 天下载 2138

Inspect, align, and save local 3D Tiles root transforms in an interactive browser session.

原始使用文档
文档目录8 节
  1. Built On
  2. Install
  3. CLI
  4. Node API
  5. Inspector Features
  6. Crop Regions
  7. Development
  8. Error Handling

3DTiles-Inspector

npm version CI License

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 geometric-error scaling, cropping supported 3D Gaussian Splat tilesets, and saving the result back to disk.

Requires Node.js 18 or newer.

Built On

This project is based on and integrates work from:

Install

npm install 3dtiles-inspector

CLI

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

screenshot
  • Translate, Rotate, infinite Scale track/value input, and Reset for root transform edits
  • Move Camera to a WGS84 latitude / longitude / height
  • Move Tiles to relocate the tileset root with an ENU-aligned transform
  • Set Position to click the globe, terrain, or loaded tiles and place the tileset there
  • Terrain, off by default, to toggle Cesium World Terrain after entering a Cesium ion token, while keeping satellite imagery
  • Render on demand, enabled by default, to pause canvas rendering while the scene is idle
  • Geometric Error scaling from 1/16x to 16x
  • Layer Multiplier scaling from 1/8x to 8x for each tile's geometric-error difference from the tileset's global leaf baseline
  • Crop Regions for drawing screen-space exclude regions or a crop sphere on 3D Gaussian Splat tilesets
  • Save to persist root transform edits, geometric-error scaling, and confirmed crop selections back to disk

Crop Regions

Crop Regions appears when the loaded tileset contains 3D Gaussian Splat content. It lets you draw one or more screen-space exclude rectangles or define a single crop sphere, preview them in the viewer, then apply the crop when you click Save.

For screen regions:

  1. Click Draw Region and drag a rectangle over the splats to remove.
  2. Before moving the camera, drag pending corner points or side handles if the screen region needs adjustment; the pending shape must stay a convex four-sided screen quadrilateral.
  3. Rotate, pan, or zoom the camera to fix the pending screen shape in 3D, then drag the far-plane handle to set how deep the crop region extends into the scene.
  4. Click Confirm to add the region to the save list, or Cancel to discard the pending rectangle.
  5. Select a confirmed region row if you need to adjust its 3D far plane with the transform handle.
  6. Click Save to persist the root transform and delete splats inside the confirmed crop regions.

For the crop sphere:

  1. Click Create Sphere to place one sphere at the current tileset center.
  2. Adjust its radius with the radius track, or select its row and move it with the sphere-center local-coordinate transform handle.
  3. Click Confirm to hide splats outside the sphere, or Cancel to discard it.
  4. Click Save to remove splats outside the confirmed sphere.
Crop Regions

Crop saving rewrites supported local .gltf / .glb Gaussian Splat resources that use KHR_gaussian_splatting_compression_spz_2. Fully deleted splat primitives are removed from their glTF, and empty tile content can be pruned from the tileset JSON. Remote content and unsupported Gaussian Splat encodings are rejected instead of being modified.

If build_summary.json exists next to the root tileset, Save also updates:

  • root_transform
  • root_transform_source
  • root_coordinate
  • viewer_geometric_error_scale
  • viewer_geometric_error_layer_scale

Development

npm install
npm test
npm run pack:check

Error Handling

Runtime and validation failures throw InspectorError from the Node API and print a concise error message in the CLI.

版本与发布记录

3dtiles-inspector 共发布 35 个版本,首次发布于 2026/04/23;过去 12 个月发布了 35 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.3.3latest2026/08/312 个月前
0.3.22026/08/312 个月前
0.3.12026/08/302 个月前
0.3.02026/08/282 个月前
0.2.212026/08/063 个月前
0.2.202026/08/053 个月前

关于 3dtiles-inspector 的常见问题

3dtiles-inspector 是什么?

Inspect, align, and save local 3D Tiles root transforms in an interactive browser session.

如何安装 3dtiles-inspector?

在项目目录运行 npm install 3dtiles-inspector,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 3dtiles-inspector,可以用 npx 3dtiles-inspector 直接运行。

3dtiles-inspector 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/3dtiles-inspector 是否存在。

3dtiles-inspector 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

3dtiles-inspector 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

3dtiles-inspector 可以商用吗?

3dtiles-inspector 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

3dtiles-inspector 的下载量有多少?

根据 npm 官方下载统计,3dtiles-inspector 在 2026/10/04 – 2026/11/02 这 30 天内被下载 2,138 次,日均约 71 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

3dtiles-inspector 还在维护吗?

最新版本 0.3.3 发布于 2026/08/31(2 个月前);至今共发布 35 个版本,其中过去 12 个月发布了 35 个;首次发布于 2026/04/23。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。