@file-viewer/renderer-3d 3.2.2 → 3.3.0
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/GEO3D.md +31 -0
- package/README.en.md +2 -0
- package/README.md +14 -12
- package/README.zh-CN.md +43 -0
- package/dist/geo3d-workers/manifest.json +1 -1
- package/dist/geo3dCrs.d.ts +4 -0
- package/dist/geo3dCrs.js +33 -1
- package/dist/geo3dLasCrs.d.ts +7 -0
- package/dist/geo3dLasCrs.js +96 -0
- package/dist/geo3dPointFactories.js +5 -5
- package/dist/geo3dRuntime.d.ts +1 -0
- package/dist/geo3dRuntime.js +14 -3
- package/package.json +7 -4
package/dist/geo3dRuntime.d.ts
CHANGED
package/dist/geo3dRuntime.js
CHANGED
|
@@ -2,7 +2,8 @@ import { createGeo3dProbeRangeGetter, inspectGeo3dDataset, inspectGeoTiffRangeSo
|
|
|
2
2
|
import { disposeCityJsonGroup, parseCityJson, renderCityJsonDocument, renderCityJsonWithTextures } from './geo3dCityJson.js';
|
|
3
3
|
import { prepare3tzDataset } from './geo3dArchive.js';
|
|
4
4
|
import { byteLimit, checkAbort, createRangeGetter, readBoundedResponse } from './geo3dRange.js';
|
|
5
|
-
import { resolveGeo3dCrs } from './geo3dCrs.js';
|
|
5
|
+
import { resolveGeo3dCrs, resolveLasSourceCrs } from './geo3dCrs.js';
|
|
6
|
+
import { inspectLasCrsRangeSource } from './geo3dLasCrs.js';
|
|
6
7
|
import { createGeo3dLasWorkers } from './geo3dLasWorkers.js';
|
|
7
8
|
import { createGeo3dRasterWorkers } from './geo3dRasterWorkers.js';
|
|
8
9
|
import { runGeo3dHook } from './geo3dHooks.js';
|
|
@@ -187,6 +188,9 @@ export async function renderGeo3d(buffer, target, type, context, options = {}) {
|
|
|
187
188
|
const factories = await import('./geo3dPointFactories.js');
|
|
188
189
|
checkAbort(signal);
|
|
189
190
|
let pointSource;
|
|
191
|
+
let lasBytes;
|
|
192
|
+
const loadLasBytes = () => lasBytes ??= whole(source, maxLasBytes, signal);
|
|
193
|
+
owned.push(() => { lasBytes = undefined; });
|
|
190
194
|
if (format === 'copc') {
|
|
191
195
|
const input = {
|
|
192
196
|
url: createRangeGetter({ ...source, signal }),
|
|
@@ -198,7 +202,7 @@ export async function renderGeo3d(buffer, target, type, context, options = {}) {
|
|
|
198
202
|
}
|
|
199
203
|
else {
|
|
200
204
|
const input = {
|
|
201
|
-
url:
|
|
205
|
+
url: loadLasBytes,
|
|
202
206
|
enableWorkers: pointOptions?.enableWorkers,
|
|
203
207
|
decimate: pointOptions?.decimate,
|
|
204
208
|
compressColorsTo8Bit: pointOptions?.compressColorsTo8Bit
|
|
@@ -206,10 +210,17 @@ export async function renderGeo3d(buffer, target, type, context, options = {}) {
|
|
|
206
210
|
pointSource = factories.createLASSource(workers, input);
|
|
207
211
|
}
|
|
208
212
|
sourceObject = pointSource;
|
|
213
|
+
const lasCrs = await inspectLasCrsRangeSource(format === 'copc'
|
|
214
|
+
? createGeo3dProbeRangeGetter({ ...source, signal })
|
|
215
|
+
: async (begin, end) => (await loadLasBytes()).subarray(begin, end));
|
|
209
216
|
await pointSource.initialize();
|
|
217
|
+
lasBytes = undefined;
|
|
210
218
|
checkAbort(signal);
|
|
211
219
|
metadata = (await pointSource.getMetadata());
|
|
212
|
-
const
|
|
220
|
+
const decodedCrs = typeof metadata?.crs === 'string' ? await resolveGeo3dCrs(metadata.crs) : metadata?.crs;
|
|
221
|
+
const native = await resolveLasSourceCrs(decodedCrs, lasCrs, format === 'copc' ? undefined : options.giro3d?.sources?.las?.sourceCrs);
|
|
222
|
+
if (native && !native.isUnknown())
|
|
223
|
+
metadata = { ...metadata, crs: native };
|
|
213
224
|
const scene = await resolveGeo3dCrs(instanceCrs, native);
|
|
214
225
|
if (native && !native.isUnknown() && !scene.equals(native))
|
|
215
226
|
throw new Error('Point-cloud instance CRS must match its dataset CRS; reproject the dataset before loading.');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@file-viewer/renderer-3d",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Standalone 3D model renderer plugin for File Viewer powered by Three.js loaders and OrbitControls.",
|
|
@@ -102,6 +102,8 @@
|
|
|
102
102
|
"dist/geo3dHooks.js",
|
|
103
103
|
"dist/geo3dInspect.d.ts",
|
|
104
104
|
"dist/geo3dInspect.js",
|
|
105
|
+
"dist/geo3dLasCrs.d.ts",
|
|
106
|
+
"dist/geo3dLasCrs.js",
|
|
105
107
|
"dist/geo3dLasWorkers.d.ts",
|
|
106
108
|
"dist/geo3dLasWorkers.js",
|
|
107
109
|
"dist/geo3dOwnedWorkerPool.d.ts",
|
|
@@ -146,11 +148,12 @@
|
|
|
146
148
|
"licenses/thatopen-components-MIT.txt",
|
|
147
149
|
"licenses/thatopen-fragments-MIT.txt",
|
|
148
150
|
"README.en.md",
|
|
149
|
-
"README.md"
|
|
151
|
+
"README.md",
|
|
152
|
+
"README.zh-CN.md"
|
|
150
153
|
],
|
|
151
154
|
"dependencies": {
|
|
152
|
-
"@file-viewer/core": "3.
|
|
153
|
-
"@file-viewer/geometry-engine": "3.
|
|
155
|
+
"@file-viewer/core": "3.3.0",
|
|
156
|
+
"@file-viewer/geometry-engine": "3.3.0",
|
|
154
157
|
"@types/emscripten": "^1.41.6",
|
|
155
158
|
"three": "^0.186.0"
|
|
156
159
|
},
|