3dtiles-inspector 0.1.6 → 0.1.7
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.
- package/CHANGELOG.md +6 -0
- package/README.md +3 -1
- package/dist/inspector-assets/viewer/app.js +14 -3
- package/package.json +1 -1
- package/src/viewer/app.js +23 -3
- package/src/viewer/session.js +18 -23
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,12 @@ The format is based on Keep a Changelog and this project follows Semantic Versio
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.1.7] - 2026-04-27
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- Changed `Layer Multiplier` to use the tileset-wide minimum leaf geometric error as the baseline, so non-minimum leaf tiles are scaled too.
|
|
14
|
+
|
|
9
15
|
## [0.1.6] - 2026-04-27
|
|
10
16
|
|
|
11
17
|
### Changed
|
package/README.md
CHANGED
|
@@ -76,13 +76,15 @@ const {
|
|
|
76
76
|
|
|
77
77
|
## Inspector Features
|
|
78
78
|
|
|
79
|
+
<img src="https://raw.githubusercontent.com/WilliamLiu-1997/3DTiles-Inspector/main/screenshot.png" alt="screenshot" width="960" />
|
|
80
|
+
|
|
79
81
|
- `Translate`, `Rotate`, and `Reset` for root transform edits
|
|
80
82
|
- `Move Camera` to a WGS84 latitude / longitude / height
|
|
81
83
|
- `Move Tiles` to relocate the tileset root with an ENU-aligned transform
|
|
82
84
|
- `Set Position` to click the globe, terrain, or loaded tiles and place the tileset there
|
|
83
85
|
- `Terrain` to toggle Cesium World Terrain while keeping satellite imagery
|
|
84
86
|
- `Geometric Error` scaling from `1/16x` to `16x`
|
|
85
|
-
- `Layer Multiplier` scaling from `1/8x` to `8x` for each tile's geometric-error difference from
|
|
87
|
+
- `Layer Multiplier` scaling from `1/8x` to `8x` for each tile's geometric-error difference from the tileset's global leaf baseline
|
|
86
88
|
- `Save` to persist the updated root transform and geometric-error scale back to disk
|
|
87
89
|
|
|
88
90
|
If `build_summary.json` exists next to the root tileset, `Save` also updates:
|
|
@@ -65888,9 +65888,19 @@ function getKnownTileLeafGeometricError(tile, visited = /* @__PURE__ */ new Set(
|
|
|
65888
65888
|
visited.delete(tile);
|
|
65889
65889
|
return leafGeometricError === null ? originalGeometricError : leafGeometricError;
|
|
65890
65890
|
}
|
|
65891
|
-
function
|
|
65891
|
+
function getGlobalTileLeafGeometricError(tile) {
|
|
65892
|
+
const rootLeafGeometricError = tiles?.root ? getKnownTileLeafGeometricError(tiles.root) : null;
|
|
65893
|
+
const tileLeafGeometricError = getKnownTileLeafGeometricError(tile);
|
|
65894
|
+
if (rootLeafGeometricError === null) {
|
|
65895
|
+
return tileLeafGeometricError;
|
|
65896
|
+
}
|
|
65897
|
+
if (tileLeafGeometricError === null) {
|
|
65898
|
+
return rootLeafGeometricError;
|
|
65899
|
+
}
|
|
65900
|
+
return Math.min(rootLeafGeometricError, tileLeafGeometricError);
|
|
65901
|
+
}
|
|
65902
|
+
function applyGeometricErrorLayerScaleToTile(tile, leafGeometricError = getGlobalTileLeafGeometricError(tile)) {
|
|
65892
65903
|
const originalGeometricError = getOriginalTileGeometricError(tile);
|
|
65893
|
-
const leafGeometricError = getKnownTileLeafGeometricError(tile);
|
|
65894
65904
|
if (originalGeometricError === null || leafGeometricError === null) {
|
|
65895
65905
|
return;
|
|
65896
65906
|
}
|
|
@@ -65900,9 +65910,10 @@ function applyGeometricErrorLayerScaleToTileset() {
|
|
|
65900
65910
|
if (!tiles) {
|
|
65901
65911
|
return;
|
|
65902
65912
|
}
|
|
65913
|
+
const leafGeometricError = getGlobalTileLeafGeometricError(tiles.root);
|
|
65903
65914
|
tiles.traverse(
|
|
65904
65915
|
(tile) => {
|
|
65905
|
-
applyGeometricErrorLayerScaleToTile(tile);
|
|
65916
|
+
applyGeometricErrorLayerScaleToTile(tile, leafGeometricError);
|
|
65906
65917
|
return false;
|
|
65907
65918
|
},
|
|
65908
65919
|
null,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "3dtiles-inspector",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Inspect, align, and save local 3D Tiles root transforms in an interactive browser session.",
|
|
5
5
|
"author": "William Liu <lyz15972107087@gmail.com>",
|
|
6
6
|
"license": "Apache-2.0",
|
package/src/viewer/app.js
CHANGED
|
@@ -580,9 +580,28 @@ function getKnownTileLeafGeometricError(tile, visited = new Set()) {
|
|
|
580
580
|
: leafGeometricError;
|
|
581
581
|
}
|
|
582
582
|
|
|
583
|
-
function
|
|
583
|
+
function getGlobalTileLeafGeometricError(tile) {
|
|
584
|
+
const rootLeafGeometricError = tiles?.root
|
|
585
|
+
? getKnownTileLeafGeometricError(tiles.root)
|
|
586
|
+
: null;
|
|
587
|
+
const tileLeafGeometricError = getKnownTileLeafGeometricError(tile);
|
|
588
|
+
|
|
589
|
+
if (rootLeafGeometricError === null) {
|
|
590
|
+
return tileLeafGeometricError;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
if (tileLeafGeometricError === null) {
|
|
594
|
+
return rootLeafGeometricError;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
return Math.min(rootLeafGeometricError, tileLeafGeometricError);
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
function applyGeometricErrorLayerScaleToTile(
|
|
601
|
+
tile,
|
|
602
|
+
leafGeometricError = getGlobalTileLeafGeometricError(tile),
|
|
603
|
+
) {
|
|
584
604
|
const originalGeometricError = getOriginalTileGeometricError(tile);
|
|
585
|
-
const leafGeometricError = getKnownTileLeafGeometricError(tile);
|
|
586
605
|
if (originalGeometricError === null || leafGeometricError === null) {
|
|
587
606
|
return;
|
|
588
607
|
}
|
|
@@ -598,9 +617,10 @@ function applyGeometricErrorLayerScaleToTileset() {
|
|
|
598
617
|
return;
|
|
599
618
|
}
|
|
600
619
|
|
|
620
|
+
const leafGeometricError = getGlobalTileLeafGeometricError(tiles.root);
|
|
601
621
|
tiles.traverse(
|
|
602
622
|
(tile) => {
|
|
603
|
-
applyGeometricErrorLayerScaleToTile(tile);
|
|
623
|
+
applyGeometricErrorLayerScaleToTile(tile, leafGeometricError);
|
|
604
624
|
return false;
|
|
605
625
|
},
|
|
606
626
|
null,
|
package/src/viewer/session.js
CHANGED
|
@@ -344,9 +344,7 @@ function scaleTilesetGeometricErrors(
|
|
|
344
344
|
tile,
|
|
345
345
|
geometricErrorScale,
|
|
346
346
|
geometricErrorLayerScale,
|
|
347
|
-
|
|
348
|
-
rootDir,
|
|
349
|
-
leafGeometricErrorCache,
|
|
347
|
+
leafGeometricError,
|
|
350
348
|
pathLabel = 'tileset.root',
|
|
351
349
|
) {
|
|
352
350
|
if (!tile || typeof tile !== 'object') {
|
|
@@ -358,13 +356,7 @@ function scaleTilesetGeometricErrors(
|
|
|
358
356
|
'geometricError',
|
|
359
357
|
geometricErrorScale,
|
|
360
358
|
geometricErrorLayerScale,
|
|
361
|
-
|
|
362
|
-
tile,
|
|
363
|
-
baseDir,
|
|
364
|
-
rootDir,
|
|
365
|
-
leafGeometricErrorCache,
|
|
366
|
-
new Set(),
|
|
367
|
-
),
|
|
359
|
+
leafGeometricError,
|
|
368
360
|
`${pathLabel}.geometricError`,
|
|
369
361
|
);
|
|
370
362
|
|
|
@@ -377,9 +369,7 @@ function scaleTilesetGeometricErrors(
|
|
|
377
369
|
child,
|
|
378
370
|
geometricErrorScale,
|
|
379
371
|
geometricErrorLayerScale,
|
|
380
|
-
|
|
381
|
-
rootDir,
|
|
382
|
-
leafGeometricErrorCache,
|
|
372
|
+
leafGeometricError,
|
|
383
373
|
`${pathLabel}.children[${index}]`,
|
|
384
374
|
);
|
|
385
375
|
});
|
|
@@ -428,6 +418,7 @@ function updateTilesetJsonFile(
|
|
|
428
418
|
rootDir,
|
|
429
419
|
rootTransform = null,
|
|
430
420
|
leafGeometricErrorCache = new Map(),
|
|
421
|
+
globalLeafGeometricError = null,
|
|
431
422
|
},
|
|
432
423
|
visited = new Set(),
|
|
433
424
|
) {
|
|
@@ -455,27 +446,30 @@ function updateTilesetJsonFile(
|
|
|
455
446
|
}
|
|
456
447
|
|
|
457
448
|
const tilesetDir = path.dirname(resolvedPath);
|
|
449
|
+
const effectiveLeafGeometricError =
|
|
450
|
+
globalLeafGeometricError == null
|
|
451
|
+
? getTileLeafGeometricError(
|
|
452
|
+
tileset.root,
|
|
453
|
+
tilesetDir,
|
|
454
|
+
rootDir,
|
|
455
|
+
leafGeometricErrorCache,
|
|
456
|
+
new Set(),
|
|
457
|
+
)
|
|
458
|
+
: globalLeafGeometricError;
|
|
459
|
+
|
|
458
460
|
scaleGeometricErrorValue(
|
|
459
461
|
tileset,
|
|
460
462
|
'geometricError',
|
|
461
463
|
geometricErrorScale,
|
|
462
464
|
geometricErrorLayerScale,
|
|
463
|
-
|
|
464
|
-
tileset.root,
|
|
465
|
-
tilesetDir,
|
|
466
|
-
rootDir,
|
|
467
|
-
leafGeometricErrorCache,
|
|
468
|
-
new Set(),
|
|
469
|
-
),
|
|
465
|
+
effectiveLeafGeometricError,
|
|
470
466
|
`${resolvedPath}.geometricError`,
|
|
471
467
|
);
|
|
472
468
|
scaleTilesetGeometricErrors(
|
|
473
469
|
tileset.root,
|
|
474
470
|
geometricErrorScale,
|
|
475
471
|
geometricErrorLayerScale,
|
|
476
|
-
|
|
477
|
-
rootDir,
|
|
478
|
-
leafGeometricErrorCache,
|
|
472
|
+
effectiveLeafGeometricError,
|
|
479
473
|
`${resolvedPath}.root`,
|
|
480
474
|
);
|
|
481
475
|
writeJsonAtomic(resolvedPath, tileset);
|
|
@@ -489,6 +483,7 @@ function updateTilesetJsonFile(
|
|
|
489
483
|
geometricErrorLayerScale,
|
|
490
484
|
geometricErrorScale,
|
|
491
485
|
leafGeometricErrorCache,
|
|
486
|
+
globalLeafGeometricError: effectiveLeafGeometricError,
|
|
492
487
|
rootDir,
|
|
493
488
|
},
|
|
494
489
|
visited,
|