3dtiles-inspector 0.1.8 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +20 -12
  3. package/dist/inspector-assets/viewer/app.js +62952 -59563
  4. package/package.json +3 -3
  5. package/src/cli.js +1 -1
  6. package/src/index.js +11 -2
  7. package/src/server/fileUtils.js +81 -0
  8. package/src/server/httpHelpers.js +91 -0
  9. package/src/server/httpServer.js +172 -0
  10. package/src/server/matrix4.js +49 -0
  11. package/src/server/openBrowser.js +47 -0
  12. package/src/server/saveTransform.js +481 -0
  13. package/src/server/saveTransformHandler.js +199 -0
  14. package/src/server/session.js +197 -0
  15. package/src/server/splatCrop/gaussianPrimitives.js +250 -0
  16. package/src/server/splatCrop/gltfResource.js +417 -0
  17. package/src/server/splatCrop/index.js +113 -0
  18. package/src/server/splatCrop/normalize.js +124 -0
  19. package/src/server/splatCrop/traversal.js +953 -0
  20. package/src/server/splatCrop/worker.js +397 -0
  21. package/src/server/splatCrop/workerPool.js +182 -0
  22. package/src/server/staticFileReadGate.js +79 -0
  23. package/src/server/viewerAssets.js +85 -0
  24. package/src/server/viewerHtml.js +775 -0
  25. package/src/viewer/app.js +447 -1587
  26. package/src/viewer/config.js +49 -0
  27. package/src/viewer/dom/coordinateInputs.js +47 -0
  28. package/src/viewer/dom/cropUi.js +101 -0
  29. package/src/viewer/dom/elements.js +53 -0
  30. package/src/viewer/dom/events.js +159 -0
  31. package/src/viewer/dom/runtimeStats.js +119 -0
  32. package/src/viewer/dom/statusPanel.js +39 -0
  33. package/src/viewer/dom/viewerToggles.js +87 -0
  34. package/src/viewer/io/saveTransformRequest.js +86 -0
  35. package/src/viewer/io/setPositionController.js +72 -0
  36. package/src/viewer/io/setPositionPointerTracker.js +95 -0
  37. package/src/viewer/io/shutdown.js +27 -0
  38. package/src/viewer/navigation/flyTo.js +152 -0
  39. package/src/viewer/{cameraController.js → scene/cameraController.js} +13 -0
  40. package/src/viewer/scene/globeController.js +47 -0
  41. package/src/viewer/scene/sceneSetup.js +89 -0
  42. package/src/viewer/scene/tiles.js +162 -0
  43. package/src/viewer/scene/transformControls.js +73 -0
  44. package/src/viewer/screenSelection/cropController.js +451 -0
  45. package/src/viewer/screenSelection/farHandle.js +318 -0
  46. package/src/viewer/screenSelection/geometry.js +516 -0
  47. package/src/viewer/screenSelection/index.js +134 -0
  48. package/src/viewer/screenSelection/pointerTracker.js +113 -0
  49. package/src/viewer/screenSelection/sdf.js +95 -0
  50. package/src/viewer/screenSelection/state.js +149 -0
  51. package/src/viewer/transform/geoCamera.js +265 -0
  52. package/src/viewer/transform/geometricError.js +246 -0
  53. package/src/viewer/transform/rootTransformController.js +244 -0
  54. package/src/viewer/transform/tilesetTransform.js +120 -0
  55. package/src/viewer/transform/transformModeController.js +78 -0
  56. package/src/viewer/utils.js +127 -0
  57. package/src/viewer/session.js +0 -1612
  58. package/src/viewer-core.js +0 -16
package/CHANGELOG.md CHANGED
@@ -6,6 +6,32 @@ The format is based on Keep a Changelog and this project follows Semantic Versio
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.2.1] - 2026-05-03
10
+
11
+ ### Changed
12
+
13
+ - Renamed the crop selection action to `Select Region` and show pending or newest crop regions first in the list.
14
+ - Kept the Save/status controls fixed at the bottom of the sidebar, moved `Reset` into the Transform controls, and tightened sidebar behavior on narrow screens.
15
+
16
+ ## [0.2.0] - 2026-05-03
17
+
18
+ ### Added
19
+
20
+ - Added `Crop Regions` for 3D Gaussian Splat tilesets, with screen-space rectangle selection, pending/confirmed region controls, preview overlays, and adjustable far-plane depth handles.
21
+ - Added save-time Gaussian Splat cropping for supported local `.gltf` and `.glb` resources using `KHR_gaussian_splatting_compression_spz_2`, including multi-resource writes, multi-bufferView rewrites, empty tile pruning, and progress updates.
22
+ - Added README documentation, a crop-region screenshot, and smoke-test fixtures for the 3DGS crop workflow.
23
+
24
+ ### Changed
25
+
26
+ - Moved inspector session, HTTP server, save handling, viewer asset generation, and splat-crop logic into focused `src/server/` modules.
27
+ - Refactored the browser viewer into focused DOM, IO, scene, navigation, screen-selection, and transform modules.
28
+ - Updated the public `./session` export to `src/server/session.js` and routed the CLI through the package entrypoint.
29
+ - Updated `3d-tiles-rendererjs-3dgs-plugin` from `0.1.4` to `0.1.5`.
30
+
31
+ ### Fixed
32
+
33
+ - Fixed repeated saves on Windows failing with `EPERM` when replacing recently streamed `.glb`, `.gltf`, `.bin`, or `.json` files, including races with active tile requests.
34
+
9
35
  ## [0.1.8] - 2026-05-03
10
36
 
11
37
  ### Added
package/README.md CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
  </div>
12
12
 
13
- `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.
13
+ `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.
14
14
 
15
15
  Requires Node.js 18 or newer.
16
16
 
@@ -83,7 +83,7 @@ const {
83
83
 
84
84
  ## Inspector Features
85
85
 
86
- <img src="https://raw.githubusercontent.com/WilliamLiu-1997/3DTiles-Inspector/main/screenshot.png" alt="screenshot" width="960" />
86
+ <img src="https://raw.githubusercontent.com/WilliamLiu-1997/3DTiles-Inspector/main/screenshot.png" alt="screenshot" />
87
87
 
88
88
  - `Translate`, `Rotate`, and `Reset` for root transform edits
89
89
  - `Move Camera` to a WGS84 latitude / longitude / height
@@ -92,7 +92,24 @@ const {
92
92
  - `Terrain` to toggle Cesium World Terrain while keeping satellite imagery
93
93
  - `Geometric Error` scaling from `1/16x` to `16x`
94
94
  - `Layer Multiplier` scaling from `1/8x` to `8x` for each tile's geometric-error difference from the tileset's global leaf baseline
95
- - `Save` to persist the updated root transform and geometric-error scale back to disk
95
+ - `Crop Regions` for drawing screen-space exclude regions on 3D Gaussian Splat tilesets
96
+ - `Save` to persist root transform edits, geometric-error scaling, and confirmed crop regions back to disk
97
+
98
+ ### Crop Regions
99
+
100
+ `Crop Regions` appears when the loaded tileset contains 3D Gaussian Splat content. It lets you draw one or more screen-space exclude rectangles, preview them in the viewer, then apply the crop when you click `Save`.
101
+
102
+ The basic workflow is:
103
+
104
+ 1. Click `Select Region` and drag a rectangle over the splats to remove.
105
+ 2. Drag the far-plane handle to set how deep the crop region extends into the scene.
106
+ 3. Click `Confirm` to add the region to the save list, or `Cancel` to discard the pending rectangle.
107
+ 4. Select a confirmed region row if you need to adjust its 3D far plane with the transform handle.
108
+ 5. Click `Save` to persist the root transform and delete splats inside the confirmed crop regions.
109
+
110
+ <img src="https://raw.githubusercontent.com/WilliamLiu-1997/3DTiles-Inspector/main/region.png" alt="Crop Regions" />
111
+
112
+ 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.
96
113
 
97
114
  If `build_summary.json` exists next to the root tileset, `Save` also updates:
98
115
 
@@ -102,15 +119,6 @@ If `build_summary.json` exists next to the root tileset, `Save` also updates:
102
119
  - `viewer_geometric_error_scale`
103
120
  - `viewer_geometric_error_layer_scale`
104
121
 
105
- ## Package Surface
106
-
107
- - `src/index.js` exports the public Node API
108
- - `src/cli.js` implements the standalone CLI
109
- - `src/viewer/session.js` manages the local server, temporary assets, browser launch, and save handling
110
- - `src/viewer/app.js` contains the browser runtime source
111
- - `dist/inspector-assets/viewer/` contains the generated browser bundle and local decoder assets built by `npm run build:viewer`
112
- - `src/viewer/cameraController.js` contains the vendored camera controller used by the runtime
113
-
114
122
  ## Development
115
123
 
116
124
  ```bash