3dtiles-inspector 0.2.10 → 0.2.11
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/package.json +1 -1
- package/src/server/saveTransform.js +22 -2
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.2.11] - 2026-05-22
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- Fixed saved root scale edits not applying the scale delta to persisted tileset geometric errors.
|
|
14
|
+
|
|
9
15
|
## [0.2.10] - 2026-05-22
|
|
10
16
|
|
|
11
17
|
### Added
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "3dtiles-inspector",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.11",
|
|
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",
|
|
@@ -18,6 +18,19 @@ function normalizePositiveFinite(value, name) {
|
|
|
18
18
|
return number;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
function getMatrixMaxScaleOnAxis(matrix) {
|
|
22
|
+
const scaleX = Math.hypot(matrix[0], matrix[1], matrix[2]);
|
|
23
|
+
const scaleY = Math.hypot(matrix[4], matrix[5], matrix[6]);
|
|
24
|
+
const scaleZ = Math.hypot(matrix[8], matrix[9], matrix[10]);
|
|
25
|
+
const scale = Math.max(scaleX, scaleY, scaleZ);
|
|
26
|
+
if (!Number.isFinite(scale) || scale <= 0) {
|
|
27
|
+
throw new InspectorError(
|
|
28
|
+
'transform scale must be a finite number greater than 0.',
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
return scale;
|
|
32
|
+
}
|
|
33
|
+
|
|
21
34
|
function scaleGeometricErrorValue(
|
|
22
35
|
target,
|
|
23
36
|
key,
|
|
@@ -378,6 +391,13 @@ async function saveViewerTransform(
|
|
|
378
391
|
geometricErrorLayerScale,
|
|
379
392
|
'geometricErrorLayerScale',
|
|
380
393
|
);
|
|
394
|
+
const transformGeometricErrorScale =
|
|
395
|
+
getMatrixMaxScaleOnAxis(normalizedEdit);
|
|
396
|
+
const effectiveGeometricErrorScale =
|
|
397
|
+
normalizedGeometricErrorScale * transformGeometricErrorScale;
|
|
398
|
+
if (!Number.isFinite(effectiveGeometricErrorScale)) {
|
|
399
|
+
throw new InspectorError('geometricErrorScale scaled value must be finite.');
|
|
400
|
+
}
|
|
381
401
|
const tilesetPath = path.resolve(rootTilesetPath);
|
|
382
402
|
const rootDir = path.dirname(tilesetPath);
|
|
383
403
|
|
|
@@ -425,7 +445,7 @@ async function saveViewerTransform(
|
|
|
425
445
|
|
|
426
446
|
await updateTilesetJsonFile(tilesetPath, {
|
|
427
447
|
geometricErrorLayerScale: normalizedGeometricErrorLayerScale,
|
|
428
|
-
geometricErrorScale:
|
|
448
|
+
geometricErrorScale: effectiveGeometricErrorScale,
|
|
429
449
|
rootDir,
|
|
430
450
|
rootTransform: nextRoot,
|
|
431
451
|
});
|
|
@@ -449,7 +469,7 @@ async function saveViewerTransform(
|
|
|
449
469
|
summary.root_transform_source = 'transform';
|
|
450
470
|
summary.root_coordinate = null;
|
|
451
471
|
summary.viewer_geometric_error_scale =
|
|
452
|
-
previousGeometricErrorScale *
|
|
472
|
+
previousGeometricErrorScale * effectiveGeometricErrorScale;
|
|
453
473
|
const previousGeometricErrorLayerScale =
|
|
454
474
|
summary.viewer_geometric_error_layer_scale == null
|
|
455
475
|
? 1
|