3dtiles-inspector 0.1.2 → 0.1.4
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 +12 -0
- package/dist/inspector-assets/viewer/app.js +12 -6
- package/package.json +1 -1
- package/src/viewer/app.js +20 -9
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,18 @@ The format is based on Keep a Changelog and this project follows Semantic Versio
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.1.4] - 2026-04-25
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- Raised the default tileset and terrain geometric-error targets to `16` for more consistent LOD behavior.
|
|
14
|
+
|
|
15
|
+
## [0.1.3] - 2026-04-25
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
|
|
19
|
+
- Reset the `Geometric Error` slider to the center after `Save` while keeping the newly applied LOD scale active.
|
|
20
|
+
|
|
9
21
|
## [0.1.2] - 2026-04-24
|
|
10
22
|
|
|
11
23
|
### Added
|
|
@@ -65490,8 +65490,8 @@ var saveButton = document.getElementById("save");
|
|
|
65490
65490
|
var GEOMETRIC_ERROR_SCALE_MIN_EXPONENT = -4;
|
|
65491
65491
|
var GEOMETRIC_ERROR_SCALE_MAX_EXPONENT = 4;
|
|
65492
65492
|
var GEOMETRIC_ERROR_SCALE_STEP = 0.1;
|
|
65493
|
-
var DEFAULT_ERROR_TARGET =
|
|
65494
|
-
var DEFAULT_TERRAIN_ERROR_TARGET =
|
|
65493
|
+
var DEFAULT_ERROR_TARGET = 16;
|
|
65494
|
+
var DEFAULT_TERRAIN_ERROR_TARGET = 16;
|
|
65495
65495
|
var RUNTIME_STATS_UPDATE_INTERVAL_MS = 250;
|
|
65496
65496
|
function normalizeLocalResourceUrl(value) {
|
|
65497
65497
|
if (typeof value !== "string" || value.length === 0) {
|
|
@@ -65824,13 +65824,16 @@ function updateTilesetErrorTarget() {
|
|
|
65824
65824
|
if (!tiles) {
|
|
65825
65825
|
return;
|
|
65826
65826
|
}
|
|
65827
|
-
tiles.errorTarget = DEFAULT_ERROR_TARGET /
|
|
65827
|
+
tiles.errorTarget = DEFAULT_ERROR_TARGET / getEffectiveGeometricErrorScale();
|
|
65828
65828
|
}
|
|
65829
65829
|
function updateGeometricErrorScaleDisplay() {
|
|
65830
65830
|
geometricErrorValueEl.textContent = `x${formatGeometricErrorScale(
|
|
65831
65831
|
geometricErrorScale
|
|
65832
65832
|
)}`;
|
|
65833
65833
|
}
|
|
65834
|
+
function getEffectiveGeometricErrorScale() {
|
|
65835
|
+
return lastSavedGeometricErrorScale * geometricErrorScale;
|
|
65836
|
+
}
|
|
65834
65837
|
function getGaussianMeshSplatCount(mesh) {
|
|
65835
65838
|
if (!mesh || typeof mesh !== "object") {
|
|
65836
65839
|
return 0;
|
|
@@ -66470,6 +66473,7 @@ function loadTileset(url) {
|
|
|
66470
66473
|
updateRuntimeStats(true);
|
|
66471
66474
|
resetEditableGroup();
|
|
66472
66475
|
lastSavedGeometricErrorScale = 1;
|
|
66476
|
+
setGeometricErrorScaleExponent(0);
|
|
66473
66477
|
savedRootMatrix.identity();
|
|
66474
66478
|
savedRootMatrixLoadError = null;
|
|
66475
66479
|
savedRootMatrixPromise = refreshSavedRootMatrix(url).then(
|
|
@@ -66548,7 +66552,8 @@ async function saveTransform() {
|
|
|
66548
66552
|
setStatus("Saving transform...");
|
|
66549
66553
|
const currentMatrix = getCurrentMatrix();
|
|
66550
66554
|
const incrementalMatrix = currentMatrix.clone().multiply(lastSavedMatrix.clone().invert());
|
|
66551
|
-
const incrementalGeometricErrorScale = geometricErrorScale
|
|
66555
|
+
const incrementalGeometricErrorScale = geometricErrorScale;
|
|
66556
|
+
const savedGeometricErrorScale = getEffectiveGeometricErrorScale();
|
|
66552
66557
|
try {
|
|
66553
66558
|
const response = await fetch(SAVE_URL, {
|
|
66554
66559
|
method: "POST",
|
|
@@ -66585,13 +66590,14 @@ async function saveTransform() {
|
|
|
66585
66590
|
throw savedRootMatrixLoadError;
|
|
66586
66591
|
}
|
|
66587
66592
|
}
|
|
66588
|
-
lastSavedGeometricErrorScale =
|
|
66593
|
+
lastSavedGeometricErrorScale = savedGeometricErrorScale;
|
|
66589
66594
|
lastSavedMatrix.copy(currentMatrix);
|
|
66595
|
+
setGeometricErrorScaleExponent(0);
|
|
66590
66596
|
syncTransformHandleFromTilesTransform();
|
|
66591
66597
|
syncCoordinateInputsFromTilesTransform();
|
|
66592
66598
|
setStatus(
|
|
66593
66599
|
`Saved transform and geometric-error scale x${formatGeometricErrorScale(
|
|
66594
|
-
|
|
66600
|
+
savedGeometricErrorScale
|
|
66595
66601
|
)} to ${ROOT_TILESET_LABEL} and build_summary.json.`
|
|
66596
66602
|
);
|
|
66597
66603
|
} catch (err2) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "3dtiles-inspector",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
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
|
@@ -106,8 +106,8 @@ const saveButton = document.getElementById('save');
|
|
|
106
106
|
const GEOMETRIC_ERROR_SCALE_MIN_EXPONENT = -4;
|
|
107
107
|
const GEOMETRIC_ERROR_SCALE_MAX_EXPONENT = 4;
|
|
108
108
|
const GEOMETRIC_ERROR_SCALE_STEP = 0.1;
|
|
109
|
-
const DEFAULT_ERROR_TARGET =
|
|
110
|
-
const DEFAULT_TERRAIN_ERROR_TARGET =
|
|
109
|
+
const DEFAULT_ERROR_TARGET = 16;
|
|
110
|
+
const DEFAULT_TERRAIN_ERROR_TARGET = 16;
|
|
111
111
|
const RUNTIME_STATS_UPDATE_INTERVAL_MS = 250;
|
|
112
112
|
|
|
113
113
|
function normalizeLocalResourceUrl(value) {
|
|
@@ -496,7 +496,7 @@ function updateTilesetErrorTarget() {
|
|
|
496
496
|
return;
|
|
497
497
|
}
|
|
498
498
|
|
|
499
|
-
tiles.errorTarget = DEFAULT_ERROR_TARGET /
|
|
499
|
+
tiles.errorTarget = DEFAULT_ERROR_TARGET / getEffectiveGeometricErrorScale();
|
|
500
500
|
}
|
|
501
501
|
|
|
502
502
|
function updateGeometricErrorScaleDisplay() {
|
|
@@ -505,6 +505,10 @@ function updateGeometricErrorScaleDisplay() {
|
|
|
505
505
|
)}`;
|
|
506
506
|
}
|
|
507
507
|
|
|
508
|
+
function getEffectiveGeometricErrorScale() {
|
|
509
|
+
return lastSavedGeometricErrorScale * geometricErrorScale;
|
|
510
|
+
}
|
|
511
|
+
|
|
508
512
|
function getGaussianMeshSplatCount(mesh) {
|
|
509
513
|
if (!mesh || typeof mesh !== 'object') {
|
|
510
514
|
return 0;
|
|
@@ -567,7 +571,10 @@ function updateRuntimeStats(force = false) {
|
|
|
567
571
|
}
|
|
568
572
|
|
|
569
573
|
const now = performance.now();
|
|
570
|
-
if (
|
|
574
|
+
if (
|
|
575
|
+
!force &&
|
|
576
|
+
now - lastRuntimeStatsUpdateTime < RUNTIME_STATS_UPDATE_INTERVAL_MS
|
|
577
|
+
) {
|
|
571
578
|
return;
|
|
572
579
|
}
|
|
573
580
|
|
|
@@ -576,7 +583,9 @@ function updateRuntimeStats(force = false) {
|
|
|
576
583
|
const cacheBytes = tiles?.lruCache?.cachedBytes ?? 0;
|
|
577
584
|
const activeSparkSplats = getActiveSparkSplatsCount();
|
|
578
585
|
const splatCount =
|
|
579
|
-
activeSparkSplats !== null
|
|
586
|
+
activeSparkSplats !== null
|
|
587
|
+
? activeSparkSplats
|
|
588
|
+
: getLoadedGaussianSplatCount();
|
|
580
589
|
|
|
581
590
|
cacheBytesValueEl.textContent = formatBytes(cacheBytes);
|
|
582
591
|
splatsCountValueEl.textContent = formatInteger(splatCount);
|
|
@@ -1315,6 +1324,7 @@ function loadTileset(url) {
|
|
|
1315
1324
|
|
|
1316
1325
|
resetEditableGroup();
|
|
1317
1326
|
lastSavedGeometricErrorScale = 1;
|
|
1327
|
+
setGeometricErrorScaleExponent(0);
|
|
1318
1328
|
savedRootMatrix.identity();
|
|
1319
1329
|
savedRootMatrixLoadError = null;
|
|
1320
1330
|
savedRootMatrixPromise = refreshSavedRootMatrix(url).then(
|
|
@@ -1402,8 +1412,8 @@ async function saveTransform() {
|
|
|
1402
1412
|
const incrementalMatrix = currentMatrix
|
|
1403
1413
|
.clone()
|
|
1404
1414
|
.multiply(lastSavedMatrix.clone().invert());
|
|
1405
|
-
const incrementalGeometricErrorScale =
|
|
1406
|
-
|
|
1415
|
+
const incrementalGeometricErrorScale = geometricErrorScale;
|
|
1416
|
+
const savedGeometricErrorScale = getEffectiveGeometricErrorScale();
|
|
1407
1417
|
|
|
1408
1418
|
try {
|
|
1409
1419
|
const response = await fetch(SAVE_URL, {
|
|
@@ -1441,13 +1451,14 @@ async function saveTransform() {
|
|
|
1441
1451
|
throw savedRootMatrixLoadError;
|
|
1442
1452
|
}
|
|
1443
1453
|
}
|
|
1444
|
-
lastSavedGeometricErrorScale =
|
|
1454
|
+
lastSavedGeometricErrorScale = savedGeometricErrorScale;
|
|
1445
1455
|
lastSavedMatrix.copy(currentMatrix);
|
|
1456
|
+
setGeometricErrorScaleExponent(0);
|
|
1446
1457
|
syncTransformHandleFromTilesTransform();
|
|
1447
1458
|
syncCoordinateInputsFromTilesTransform();
|
|
1448
1459
|
setStatus(
|
|
1449
1460
|
`Saved transform and geometric-error scale x${formatGeometricErrorScale(
|
|
1450
|
-
|
|
1461
|
+
savedGeometricErrorScale,
|
|
1451
1462
|
)} to ${ROOT_TILESET_LABEL} and build_summary.json.`,
|
|
1452
1463
|
);
|
|
1453
1464
|
} catch (err) {
|