@loaders.gl/tile-converter 5.0.0-alpha.12 → 5.0.0-alpha.14

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 (132) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +4 -4
  3. package/dist/converter.min.cjs +149 -158
  4. package/dist/i3s-server/bin/i3s-server.min.cjs +113 -158
  5. package/dist/index.cjs +17486 -17479
  6. package/dist/index.js +25572 -25560
  7. package/dist/v5/adapters.cjs +540 -190
  8. package/dist/v5/adapters.d.ts +4 -0
  9. package/dist/v5/adapters.js +501 -151
  10. package/dist/v5/archive-source.d.ts +1 -1
  11. package/dist/v5/browser.d.ts +1 -1
  12. package/dist/v5/conversion-api.d.ts +25 -0
  13. package/dist/v5/converter-cli.js +23 -7
  14. package/dist/v5/core.cjs +76 -17
  15. package/dist/v5/core.d.ts +1 -1
  16. package/dist/v5/core.js +69 -10
  17. package/dist/v5/feature-arrow.d.ts +1 -1
  18. package/dist/v5/i3s-mesh-conversion.d.ts +1 -1
  19. package/dist/v5/i3s-mesh-source-features.d.ts +2 -2
  20. package/dist/v5/i3s-mesh-source-material.d.ts +1 -1
  21. package/dist/v5/i3s-mesh-source.d.ts +2 -2
  22. package/dist/v5/i3s-selection-source.d.ts +3 -3
  23. package/dist/v5/index.cjs +11 -6
  24. package/dist/v5/index.d.ts +5 -1
  25. package/dist/v5/index.js +8 -0
  26. package/dist/v5/mesh-conversion.d.ts +3 -3
  27. package/dist/v5/mesh-draco.d.ts +2 -2
  28. package/dist/v5/mesh-features.d.ts +2 -2
  29. package/dist/v5/mesh-source-features.d.ts +4 -4
  30. package/dist/v5/mesh-source-schema.d.ts +2 -2
  31. package/dist/v5/mesh-source-texture.d.ts +3 -3
  32. package/dist/v5/mesh-source.d.ts +5 -5
  33. package/dist/v5/mesh-tileset-sink.d.ts +1 -1
  34. package/dist/v5/mesh.d.ts +1 -1
  35. package/dist/v5/node-conversion.d.ts +2 -0
  36. package/dist/v5/node-i3s-source.d.ts +3 -3
  37. package/dist/v5/node-source.d.ts +1 -1
  38. package/dist/v5/node.cjs +19 -6
  39. package/dist/v5/node.js +19 -6
  40. package/dist/v5/point-cloud-attributes.d.ts +19 -0
  41. package/dist/v5/point-cloud-conversion.d.ts +1 -1
  42. package/dist/v5/point-cloud-copc.d.ts +44 -0
  43. package/dist/v5/point-cloud-file.d.ts +4 -4
  44. package/dist/v5/point-cloud-potree.d.ts +3 -3
  45. package/dist/v5/point-cloud-source-encoder.d.ts +1 -1
  46. package/dist/v5/point-cloud-source.d.ts +1 -1
  47. package/dist/v5/point-cloud-tileset.d.ts +3 -3
  48. package/dist/v5/point-cloud.d.ts +1 -1
  49. package/dist/v5/spatial-conversion.d.ts +1 -1
  50. package/dist/v5/tileset-source.d.ts +1 -1
  51. package/package.json +17 -32
  52. package/src/v4/3d-tiles-converter/3d-tiles-converter.ts +11 -12
  53. package/src/v4/3d-tiles-converter/helpers/3d-tiles-content-converter.ts +7 -3
  54. package/src/v4/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.ts +2 -2
  55. package/src/v4/3d-tiles-converter/helpers/load-i3s.ts +3 -3
  56. package/src/v4/3d-tiles-converter/helpers/texture-atlas.ts +1 -1
  57. package/src/v4/3d-tiles-converter/helpers/validate-i3s-spatial-reference.ts +2 -2
  58. package/src/v4/3d-tiles-converter/json-templates/tileset.ts +58 -39
  59. package/src/v4/converter-cli.ts +3 -3
  60. package/src/v4/deps-installer/deps-installer.ts +3 -3
  61. package/src/v4/i3s-converter/helpers/attribute-metadata-info.ts +1 -1
  62. package/src/v4/i3s-converter/helpers/batch-ids-extensions.ts +9 -10
  63. package/src/v4/i3s-converter/helpers/conversion-gltf.ts +108 -0
  64. package/src/v4/i3s-converter/helpers/coordinate-converter.ts +6 -5
  65. package/src/v4/i3s-converter/helpers/create-scene-server-path.ts +5 -6
  66. package/src/v4/i3s-converter/helpers/feature-attributes.ts +4 -4
  67. package/src/v4/i3s-converter/helpers/geometry-attributes.ts +1 -1
  68. package/src/v4/i3s-converter/helpers/geometry-converter.ts +69 -77
  69. package/src/v4/i3s-converter/helpers/gltf-attributes.ts +58 -74
  70. package/src/v4/i3s-converter/helpers/load-3d-tiles.ts +5 -5
  71. package/src/v4/i3s-converter/helpers/node-debug.ts +7 -3
  72. package/src/v4/i3s-converter/helpers/node-index-document.ts +6 -7
  73. package/src/v4/i3s-converter/helpers/node-pages.ts +3 -4
  74. package/src/v4/i3s-converter/helpers/preprocess-3d-tiles.ts +1 -1
  75. package/src/v4/i3s-converter/helpers/tileset-traversal.ts +1 -1
  76. package/src/v4/i3s-converter/i3s-converter.ts +29 -31
  77. package/src/v4/i3s-converter/json-templates/geometry-definitions.ts +71 -66
  78. package/src/v4/i3s-converter/json-templates/layers.ts +97 -132
  79. package/src/v4/i3s-converter/json-templates/metadata.ts +31 -21
  80. package/src/v4/i3s-converter/json-templates/node.ts +60 -74
  81. package/src/v4/i3s-converter/json-templates/scene-server.ts +36 -27
  82. package/src/v4/i3s-converter/json-templates/shared-resources.ts +62 -123
  83. package/src/v4/i3s-converter/json-templates/store.ts +39 -58
  84. package/src/v4/i3s-converter/types.ts +4 -4
  85. package/src/v4/i3s-server/controllers/slpk-controller.ts +3 -3
  86. package/src/v4/i3s-server/utils/create-scene-server.ts +3 -3
  87. package/src/v4/lib/utils/builder-input.ts +8 -0
  88. package/src/v4/lib/utils/conversion-dump.ts +5 -1
  89. package/src/v4/lib/utils/file-utils.ts +1 -1
  90. package/src/v4/lib/utils/hash-string.ts +21 -0
  91. package/src/v4/lib/utils/lod-conversion-utils.ts +3 -3
  92. package/src/v4/pgm-loader.ts +2 -2
  93. package/src/v5/adapters.ts +5 -0
  94. package/src/v5/archive-source.ts +4 -4
  95. package/src/v5/browser.ts +1 -0
  96. package/src/v5/conversion-api.ts +115 -8
  97. package/src/v5/conversion-archive.ts +2 -2
  98. package/src/v5/core.ts +1 -0
  99. package/src/v5/feature-arrow.ts +2 -2
  100. package/src/v5/i3s-mesh-conversion.ts +2 -2
  101. package/src/v5/i3s-mesh-source-features.ts +3 -3
  102. package/src/v5/i3s-mesh-source-material.ts +18 -11
  103. package/src/v5/i3s-mesh-source.ts +2 -2
  104. package/src/v5/i3s-selection-source.ts +4 -4
  105. package/src/v5/index.ts +15 -0
  106. package/src/v5/mesh-conversion.ts +4 -4
  107. package/src/v5/mesh-draco.ts +2 -2
  108. package/src/v5/mesh-features.ts +3 -3
  109. package/src/v5/mesh-hierarchy.ts +1 -1
  110. package/src/v5/mesh-source-features.ts +137 -55
  111. package/src/v5/mesh-source-schema.ts +10 -4
  112. package/src/v5/mesh-source-texture.ts +49 -19
  113. package/src/v5/mesh-source.ts +65 -46
  114. package/src/v5/mesh-tileset-archive.ts +1 -1
  115. package/src/v5/mesh-tileset-sink.ts +1 -1
  116. package/src/v5/mesh.ts +1 -1
  117. package/src/v5/node-cli.ts +4 -0
  118. package/src/v5/node-conversion.ts +19 -2
  119. package/src/v5/node-source.ts +2 -2
  120. package/src/v5/point-cloud-attributes.ts +113 -0
  121. package/src/v5/point-cloud-conversion.ts +1 -1
  122. package/src/v5/point-cloud-copc.ts +289 -0
  123. package/src/v5/point-cloud-file.ts +8 -8
  124. package/src/v5/point-cloud-potree.ts +8 -4
  125. package/src/v5/point-cloud-source-encoder.ts +1 -1
  126. package/src/v5/point-cloud-source.ts +1 -1
  127. package/src/v5/point-cloud-spatial.ts +2 -2
  128. package/src/v5/point-cloud-tileset.ts +4 -4
  129. package/src/v5/point-cloud.ts +3 -3
  130. package/src/v5/selected-mesh-source.ts +4 -4
  131. package/src/v5/spatial-conversion.ts +2 -2
  132. package/src/v5/tileset-source.ts +2 -2
@@ -0,0 +1,289 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+
5
+ import {COPCWriter, type COPCWriterOptions} from '@loaders.gl/tiles-3d/copc';
6
+ import type {Mesh, MeshArrowTable} from '@loaders.gl/core/schema';
7
+ import {TileConversionError, type TileConversionCodec} from '@loaders.gl/tile-converter/v5/core';
8
+ import {
9
+ getPointCloudMesh,
10
+ mapPointCloudAttributes,
11
+ type PointCloudAttributeMapping
12
+ } from './point-cloud-attributes.js';
13
+
14
+ /** Bounded, explicitly placed COPC batch authoring. */
15
+ export interface EncodePointCloudCOPCOptions {
16
+ /** All attribute aliases and semantic omissions must be explicit. */
17
+ readonly mapping: PointCloudAttributeMapping;
18
+ /** LAS axis scales; positions must already be absolute coordinates in the declared CRS. */
19
+ readonly scale: readonly [number, number, number];
20
+ /** LAS axis offsets used for signed int32 quantization. */
21
+ readonly offset: readonly [number, number, number];
22
+ /** Explicit OGC WKT CRS declaration; no inference or reprojection is performed. */
23
+ readonly wkt: string;
24
+ /** Maximum Euclidean quantization error in source units. */
25
+ readonly maxPositionError: number;
26
+ /** Maximum distinct retained source buffer bytes; default 64 MiB. */
27
+ readonly maxInputBytes?: number;
28
+ /** Maximum rows in one batch; default 1000000. */
29
+ readonly maxPoints?: number;
30
+ /** Maximum completed encoded bytes; default 128 MiB. Writer temporary memory is additional. */
31
+ readonly maxOutputBytes?: number;
32
+ /** Explicit LAS Extra Bytes names for custom typed attributes, including exact 64-bit IDs. */
33
+ readonly extraBytes?: NonNullable<COPCWriterOptions['copc']>['extraBytes'];
34
+ /** Optional octree organization forwarded to the owning COPC writer. */
35
+ readonly organization?: Pick<
36
+ NonNullable<COPCWriterOptions['copc']>,
37
+ 'nodePointLimit' | 'maximumDepth' | 'hierarchyPageDepth' | 'spacing'
38
+ >;
39
+ /** Cancellation before validation and before/after synchronous writer execution. */
40
+ readonly signal?: AbortSignal;
41
+ }
42
+
43
+ /** A complete COPC file and its explicit precision/loss report. */
44
+ export interface EncodedPointCloudCOPC {
45
+ /** Range-readable COPC 1.0 / LAZ 1.4 bytes. */
46
+ readonly copc: ArrayBuffer;
47
+ /** Exact encoded point count. */
48
+ readonly pointCount: number;
49
+ /** Maximum reconstructed Euclidean position error. */
50
+ readonly maximumPositionError: number;
51
+ /** Authorized attribute omissions and reasons. */
52
+ readonly droppedAttributes: Readonly<Record<string, string>>;
53
+ }
54
+
55
+ /** Standard scalar attributes qualified for PDRF 6/7/8, with integer bounds. */
56
+ const SCALAR_RANGES: Readonly<Record<string, readonly [number, number]>> = {
57
+ intensity: [0, 65535],
58
+ classification: [0, 255],
59
+ nir: [0, 65535],
60
+ gpsTime: [-Infinity, Infinity],
61
+ scanAngle: [-32768, 32767],
62
+ userData: [0, 255],
63
+ pointSourceId: [0, 65535],
64
+ returnNumber: [1, 15],
65
+ numberOfReturns: [1, 15],
66
+ scannerChannel: [0, 3],
67
+ scanDirectionFlag: [0, 1],
68
+ edgeOfFlightLine: [0, 1],
69
+ synthetic: [0, 1],
70
+ keyPoint: [0, 1],
71
+ withheld: [0, 1],
72
+ overlap: [0, 1]
73
+ };
74
+
75
+ /** Encodes one decoded point batch as COPC with explicit mappings, CRS and precision gates. */
76
+ export async function encodePointCloudCOPC(
77
+ input: Mesh | MeshArrowTable,
78
+ options: EncodePointCloudCOPCOptions
79
+ ): Promise<EncodedPointCloudCOPC> {
80
+ const maxInputBytes = options.maxInputBytes ?? 64 * 1024 * 1024;
81
+ const maxPoints = options.maxPoints ?? 1000000;
82
+ const maxOutputBytes = options.maxOutputBytes ?? 128 * 1024 * 1024;
83
+ if (
84
+ [maxInputBytes, maxPoints, maxOutputBytes].some(
85
+ value => !Number.isSafeInteger(value) || value < 1
86
+ ) ||
87
+ options.scale.length !== 3 ||
88
+ options.scale.some(value => !Number.isFinite(value) || value <= 0) ||
89
+ options.offset.length !== 3 ||
90
+ options.offset.some(value => !Number.isFinite(value)) ||
91
+ typeof options.wkt !== 'string' ||
92
+ !options.wkt.trim() ||
93
+ !Number.isFinite(options.maxPositionError) ||
94
+ options.maxPositionError < 0
95
+ )
96
+ throw new TileConversionError(
97
+ 'POINT_CLOUD_COPC_OPTIONS_INVALID',
98
+ 'COPC requires explicit finite scale, offset, CRS, precision and positive budgets'
99
+ );
100
+ options.signal?.throwIfAborted();
101
+ const source = getPointCloudMesh(input, maxInputBytes);
102
+ const {mesh, droppedAttributes} = mapPointCloudAttributes(source, options.mapping);
103
+ const position = mesh.attributes.POSITION;
104
+ const pointCount = mesh.header?.vertexCount ?? position.value.length / 3;
105
+ if (!Number.isSafeInteger(pointCount) || pointCount < 1 || pointCount > maxPoints)
106
+ throw new TileConversionError(
107
+ 'POINT_CLOUD_POINT_BUDGET',
108
+ 'COPC requires a nonempty batch within the point limit'
109
+ );
110
+ if (
111
+ !(position.value instanceof Float32Array || position.value instanceof Float64Array) ||
112
+ position.size !== 3 ||
113
+ position.normalized
114
+ )
115
+ throw new TileConversionError(
116
+ 'POINT_CLOUD_POSITION_INVALID',
117
+ 'COPC requires decoded floating XYZ'
118
+ );
119
+ const extraNames = new Set(options.extraBytes?.map(field => field.attribute) || []);
120
+ const descriptorNames = new Set(
121
+ options.extraBytes?.map(field => field.name || field.attribute) || []
122
+ );
123
+ if (
124
+ extraNames.size !== (options.extraBytes?.length || 0) ||
125
+ descriptorNames.size !== extraNames.size ||
126
+ options.extraBytes?.some(field => {
127
+ const name = field.name || field.attribute;
128
+ const description = field.description || '';
129
+ return (
130
+ !mesh.attributes[field.attribute] ||
131
+ !field.attribute ||
132
+ !name.length ||
133
+ name.length > 32 ||
134
+ description.length > 32 ||
135
+ /[^\x20-\x7e]/.test(name) ||
136
+ /[^\x20-\x7e]/.test(description)
137
+ );
138
+ })
139
+ )
140
+ throw new TileConversionError(
141
+ 'POINT_CLOUD_EXTRA_BYTES_INVALID',
142
+ 'Extra Bytes descriptors require unique mapped attributes and names/descriptions within 32 printable ASCII bytes'
143
+ );
144
+ for (const name of extraNames)
145
+ if (name === 'POSITION' || name === 'COLOR_0' || Object.hasOwn(SCALAR_RANGES, name))
146
+ throw new TileConversionError(
147
+ 'POINT_CLOUD_EXTRA_BYTES_INVALID',
148
+ 'Map standard attributes directly instead of duplicating them as Extra Bytes'
149
+ );
150
+ for (const [name, attribute] of Object.entries(mesh.attributes)) {
151
+ const color = name === 'COLOR_0';
152
+ const extra = extraNames.has(name);
153
+ if (name !== 'POSITION' && !color && !extra && !Object.hasOwn(SCALAR_RANGES, name))
154
+ throw new TileConversionError(
155
+ 'POINT_CLOUD_ATTRIBUTE_UNSUPPORTED',
156
+ `COPC cannot preserve ${name}; supply an explicit supported mapping or drop reason`
157
+ );
158
+ if (
159
+ attribute.transform ||
160
+ attribute.byteOffset ||
161
+ attribute.byteStride ||
162
+ attribute.componentType === 'float16' ||
163
+ attribute.value.length !== pointCount * attribute.size ||
164
+ (!color && attribute.normalized) ||
165
+ (name !== 'POSITION' &&
166
+ !color &&
167
+ (extra ? ![1, 3].includes(attribute.size) : attribute.size !== 1))
168
+ )
169
+ throw new TileConversionError(
170
+ 'POINT_CLOUD_ATTRIBUTE_INVALID',
171
+ `COPC requires packed decoded attributes: ${name}`
172
+ );
173
+ if (color) {
174
+ if (
175
+ attribute.size !== 3 ||
176
+ !(attribute.value instanceof Uint8Array || attribute.value instanceof Uint16Array)
177
+ )
178
+ throw new TileConversionError(
179
+ 'POINT_CLOUD_COLOR_INVALID',
180
+ 'COPC requires explicitly mapped uint8/uint16 RGB'
181
+ );
182
+ } else if (extra) {
183
+ for (const value of attribute.value)
184
+ if (typeof value !== 'bigint' && !Number.isFinite(value))
185
+ throw new TileConversionError(
186
+ 'POINT_CLOUD_ATTRIBUTE_RANGE',
187
+ `Nonfinite Extra Bytes value: ${name}`
188
+ );
189
+ } else if (name !== 'POSITION') {
190
+ const [minimum, maximum] = SCALAR_RANGES[name];
191
+ for (const value of attribute.value) {
192
+ if (
193
+ typeof value !== 'number' ||
194
+ !Number.isFinite(value) ||
195
+ value < minimum ||
196
+ value > maximum ||
197
+ (name !== 'gpsTime' && !Number.isInteger(value))
198
+ )
199
+ throw new TileConversionError(
200
+ 'POINT_CLOUD_ATTRIBUTE_RANGE',
201
+ `COPC value outside the qualified range: ${name}`
202
+ );
203
+ }
204
+ }
205
+ }
206
+ let maximumPositionError = 0;
207
+ const minimum = [Infinity, Infinity, Infinity];
208
+ const maximum = [-Infinity, -Infinity, -Infinity];
209
+ const errors = [0, 0, 0];
210
+ for (let row = 0; row < pointCount; row++) {
211
+ for (let axis = 0; axis < 3; axis++) {
212
+ const value = position.value[row * 3 + axis];
213
+ const encoded = Math.round((value - options.offset[axis]) / options.scale[axis]);
214
+ if (
215
+ !Number.isFinite(value) ||
216
+ !Number.isSafeInteger(encoded) ||
217
+ encoded < -2147483648 ||
218
+ encoded > 2147483647
219
+ )
220
+ throw new TileConversionError(
221
+ 'POINT_CLOUD_POSITION_RANGE',
222
+ 'COPC position exceeds signed int32 quantization'
223
+ );
224
+ minimum[axis] = Math.min(minimum[axis], value);
225
+ maximum[axis] = Math.max(maximum[axis], value);
226
+ errors[axis] = encoded * options.scale[axis] + options.offset[axis] - value;
227
+ }
228
+ maximumPositionError = Math.max(maximumPositionError, Math.hypot(...errors));
229
+ if (maximumPositionError > options.maxPositionError)
230
+ throw new TileConversionError(
231
+ 'POINT_CLOUD_PRECISION_EXCEEDED',
232
+ 'COPC position rounding exceeds the declared error gate'
233
+ );
234
+ if (row % 16384 === 0) {
235
+ await new Promise<void>(resolve => setTimeout(resolve, 0));
236
+ options.signal?.throwIfAborted();
237
+ }
238
+ }
239
+ const width = Math.max(...maximum.map((value, axis) => value - minimum[axis]), ...options.scale);
240
+ const radius = width / 2;
241
+ if (
242
+ !Number.isFinite(Math.hypot(radius, radius, radius)) ||
243
+ minimum.some((value, axis) => {
244
+ const center = value + (maximum[axis] - value) / 2;
245
+ return (
246
+ !Number.isFinite(value + maximum[axis]) ||
247
+ !Number.isFinite(center - radius) ||
248
+ !Number.isFinite(center + radius)
249
+ );
250
+ })
251
+ )
252
+ throw new TileConversionError('POINT_CLOUD_BOUNDS_INVALID', 'COPC coordinate extent overflow');
253
+ // The owning writer executes synchronously; cancellation cannot interrupt its compression call.
254
+ options.signal?.throwIfAborted();
255
+ const color = mesh.attributes.COLOR_0;
256
+ const copc = COPCWriter.encodeSync(mesh, {
257
+ copc: {
258
+ ...options.organization,
259
+ scale: [...options.scale],
260
+ offset: [...options.offset],
261
+ wkt: options.wkt,
262
+ pointDataRecordFormat: mesh.attributes.nir ? 8 : color ? 7 : 6,
263
+ colorDepth: color?.value instanceof Uint16Array ? 16 : 8,
264
+ extraBytes: options.extraBytes
265
+ }
266
+ });
267
+ options.signal?.throwIfAborted();
268
+ if (copc.byteLength > maxOutputBytes)
269
+ throw new TileConversionError(
270
+ 'POINT_CLOUD_OUTPUT_BUDGET',
271
+ 'Completed COPC output exceeds the byte budget'
272
+ );
273
+ return {copc, pointCount, maximumPositionError, droppedAttributes};
274
+ }
275
+
276
+ /** Creates a v5 codec for one independently authored COPC file per decoded input batch. */
277
+ export function createCOPCConversionCodec(
278
+ options: EncodePointCloudCOPCOptions
279
+ ): TileConversionCodec<unknown, Mesh | MeshArrowTable, EncodedPointCloudCOPC> {
280
+ return {
281
+ async *convert(input, _inspection, signal) {
282
+ const combinedSignal =
283
+ options.signal && signal
284
+ ? AbortSignal.any([options.signal, signal])
285
+ : options.signal || signal;
286
+ yield await encodePointCloudCOPC(input, {...options, signal: combinedSignal});
287
+ }
288
+ };
289
+ }
@@ -2,19 +2,19 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
- import {COPCSourceLoader} from '@loaders.gl/copc';
6
- import type {COPCTileSource, COPCSourceLoaderOptions} from '@loaders.gl/copc';
7
- import {PotreeSourceLoader, encodePotreeDataset} from '@loaders.gl/potree';
5
+ import {COPCSourceLoader} from '@loaders.gl/tiles-3d/copc';
6
+ import type {COPCTileSource, COPCSourceLoaderOptions} from '@loaders.gl/tiles-3d/copc';
7
+ import {PotreeSourceLoader, encodePotreeDataset} from '@loaders.gl/tiles-3d/potree';
8
8
  import type {
9
9
  PotreeDataset,
10
10
  PotreeWriterNode,
11
11
  PotreeWriterOptions,
12
12
  PotreeSourceLoaderOptions
13
- } from '@loaders.gl/potree';
14
- import type {Mesh, MeshArrowTable, MeshGeometry} from '@loaders.gl/schema';
15
- import {deduceMeshSchema} from '@loaders.gl/schema-utils';
16
- import {encodeZip, openZipArchive} from '@loaders.gl/zip';
17
- import type {ZipArchive, ZipEntry} from '@loaders.gl/zip';
13
+ } from '@loaders.gl/tiles-3d/potree';
14
+ import type {Mesh, MeshArrowTable, MeshGeometry} from '@loaders.gl/core/schema';
15
+ import {deduceMeshSchema} from '@loaders.gl/core/schema-utils';
16
+ import {encodeZip, openZipArchive} from '@loaders.gl/archives/zip';
17
+ import type {ZipArchive, ZipEntry} from '@loaders.gl/archives/zip';
18
18
 
19
19
  /** Explicit local-file input; no format is inferred from an extension. */
20
20
  export type OpenPointCloudFileOptions = {
@@ -2,10 +2,14 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
- import type {Mesh, MeshArrowTable} from '@loaders.gl/schema';
6
- import {PointCloudTiler, type PointCloudTilerOptions} from '@loaders.gl/schema-utils';
7
- import {encodePotreeDataset} from '@loaders.gl/potree';
8
- import type {PotreeDataset, PotreeWriterNode, PotreeWriterOptions} from '@loaders.gl/potree';
5
+ import type {Mesh, MeshArrowTable} from '@loaders.gl/core/schema';
6
+ import {PointCloudTiler, type PointCloudTilerOptions} from '@loaders.gl/core/schema-utils';
7
+ import {encodePotreeDataset} from '@loaders.gl/tiles-3d/potree';
8
+ import type {
9
+ PotreeDataset,
10
+ PotreeWriterNode,
11
+ PotreeWriterOptions
12
+ } from '@loaders.gl/tiles-3d/potree';
9
13
  import {encodePotreeDatasetArchive} from './point-cloud-file.js';
10
14
 
11
15
  /** Bounded authoring of one decoded dataset in its already placed native coordinates. */
@@ -7,7 +7,7 @@ import type {
7
7
  PointCloudCoordinateSystem,
8
8
  PointCloudTilesetSource,
9
9
  TilesetSpatialReference
10
- } from '@loaders.gl/tiles';
10
+ } from '@loaders.gl/tiles-3d';
11
11
  import {transformPointCloudSourceTile} from './point-cloud-spatial.js';
12
12
  import type {PointCloudSpatialOptions} from './point-cloud-spatial.js';
13
13
  import {encodePointCloudTileWithMetadata} from './point-cloud.js';
@@ -6,7 +6,7 @@ import type {
6
6
  PointCloudTileContent,
7
7
  PointCloudTileHeader,
8
8
  PointCloudTilesetSource
9
- } from '@loaders.gl/tiles';
9
+ } from '@loaders.gl/tiles-3d';
10
10
 
11
11
  /** A source tile and its decoded point content, including null content when no payload exists. */
12
12
  export type PointCloudSourceTile = {
@@ -3,8 +3,8 @@
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
5
  import {Matrix4} from '@math.gl/core';
6
- import {getSpatialCoordinateFrame, createTilesetSpatialReference} from '@loaders.gl/tiles';
7
- import {convertTableToMesh, makeMeshArrowTable} from '@loaders.gl/schema-utils';
6
+ import {getSpatialCoordinateFrame, createTilesetSpatialReference} from '@loaders.gl/tiles-3d';
7
+ import {convertTableToMesh, makeMeshArrowTable} from '@loaders.gl/core/schema-utils';
8
8
  import {TileConversionError} from '@loaders.gl/tile-converter/v5/core';
9
9
  import type {
10
10
  I3SConversionSpatialContext,
@@ -2,10 +2,10 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
- import type {Mesh, MeshArrowTable} from '@loaders.gl/schema';
6
- import type {PointCloudTilerOptions} from '@loaders.gl/schema-utils';
7
- import type {TilesetSpatialReference} from '@loaders.gl/tiles';
8
- import {PointCloudTileSource} from '@loaders.gl/tiles/point-cloud-tile-source';
5
+ import type {Mesh, MeshArrowTable} from '@loaders.gl/core/schema';
6
+ import type {PointCloudTilerOptions} from '@loaders.gl/core/schema-utils';
7
+ import type {TilesetSpatialReference} from '@loaders.gl/tiles-3d';
8
+ import {PointCloudTileSource} from '@loaders.gl/tiles-3d/point-cloud-tile-source';
9
9
  import {TileConversionError} from '@loaders.gl/tile-converter/v5/core';
10
10
  import type {
11
11
  BrowserTileConversionFile,
@@ -2,14 +2,14 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
- import {Tile3DWriter, TILE3D_TYPE} from '@loaders.gl/3d-tiles';
5
+ import {Tile3DWriter, TILE3D_TYPE} from '@loaders.gl/tiles-3d/3d-tiles';
6
6
  import type {
7
7
  Mesh,
8
8
  MeshArrowTable,
9
9
  MeshAttribute,
10
10
  MeshAttributeQuantizationTransform
11
- } from '@loaders.gl/schema';
12
- import {convertTableToMesh} from '@loaders.gl/schema-utils';
11
+ } from '@loaders.gl/core/schema';
12
+ import {convertTableToMesh} from '@loaders.gl/core/schema-utils';
13
13
  import {TileConversionError} from '@loaders.gl/tile-converter/v5/core';
14
14
 
15
15
  /** Options for encoding one Arrow or mesh point batch as a 3D Tiles point tile. */
@@ -4,14 +4,14 @@
4
4
 
5
5
  import {prepareMeshHierarchy} from './mesh-hierarchy.js';
6
6
  import {coreApi, parse} from '@loaders.gl/core';
7
- import type {Loader, LoaderOptions} from '@loaders.gl/loader-utils';
8
- import {Tiles3DLoader} from '@loaders.gl/3d-tiles';
9
- import {Tiles3DSource, Tileset3D} from '@loaders.gl/tiles';
7
+ import type {Loader, LoaderOptions} from '@loaders.gl/core/loader-utils';
8
+ import {Tiles3DLoader} from '@loaders.gl/tiles-3d/3d-tiles';
9
+ import {Tiles3DSource, Tileset3D} from '@loaders.gl/tiles-3d';
10
10
  import type {
11
11
  TilesetSourceInput,
12
12
  TilesetSourceMetadata,
13
13
  TilesetSpatialReference
14
- } from '@loaders.gl/tiles';
14
+ } from '@loaders.gl/tiles-3d';
15
15
  import type {DracoLibraryOptions} from '@loaders.gl/draco/bundled';
16
16
  import {
17
17
  createBrowserTilesetConversionSource,
@@ -7,7 +7,7 @@ import {
7
7
  I3SSpatialTransformer,
8
8
  markTilesetSpatialReferenceTransformed,
9
9
  Tiles3DSpatialTransformer
10
- } from '@loaders.gl/tiles';
10
+ } from '@loaders.gl/tiles-3d';
11
11
  import {Matrix4} from '@math.gl/core';
12
12
  import type {
13
13
  CreateTilesetSpatialReferenceOptions,
@@ -17,7 +17,7 @@ import type {
17
17
  Tiles3DSpatialBoundingVolume,
18
18
  TilesetSpatialOptions,
19
19
  TilesetSpatialReference
20
- } from '@loaders.gl/tiles';
20
+ } from '@loaders.gl/tiles-3d';
21
21
  import {TileConversionError} from './conversion-api.js';
22
22
  import type {TileConversionDiagnostic} from './conversion-api.js';
23
23
 
@@ -2,13 +2,13 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
- import {traverseTilesetContents} from '@loaders.gl/tiles';
5
+ import {traverseTilesetContents} from '@loaders.gl/tiles-3d';
6
6
  import type {
7
7
  Tileset3D,
8
8
  TilesetContentTraversalItem,
9
9
  TilesetSourceMetadata,
10
10
  TraverseTilesetContentsOptions
11
- } from '@loaders.gl/tiles';
11
+ } from '@loaders.gl/tiles-3d';
12
12
  import {TileConversionError} from './conversion-api.js';
13
13
  import type {TileConversionSource} from './conversion-api.js';
14
14