@loaders.gl/tiles-3d 5.0.0-beta.2 → 5.0.0-beta.5
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/README.md +1 -1
- package/dist/3d-tiles/3d-tiles-archive-loader.js +1 -1
- package/dist/3d-tiles/dist.dev.js +1393 -962
- package/dist/3d-tiles/dist.min.js +37 -37
- package/dist/3d-tiles/index.cjs +989 -987
- package/dist/3d-tiles/index.cjs.map +3 -3
- package/dist/3d-tiles/lib/classes/tile-3d-batch-table.d.ts.map +1 -1
- package/dist/3d-tiles/lib/classes/tile-3d-batch-table.js +12 -8
- package/dist/3d-tiles/lib/classes/tile-3d-batch-table.js.map +1 -1
- package/dist/3d-tiles/lib/parsers/parse-3d-tile-instanced-model.js +5 -1
- package/dist/3d-tiles/lib/parsers/parse-3d-tile-instanced-model.js.map +1 -1
- package/dist/3d-tiles/lib/utils/version.js +1 -1
- package/dist/3d-tiles-archive-writer.cjs +1 -1
- package/dist/cesium-ion-loader-with-parser.cjs +983 -981
- package/dist/cesium-ion-loader-with-parser.cjs.map +3 -3
- package/dist/copc/copc-source-loader.js +2 -2
- package/dist/copc/copc-source-loader.js.map +1 -1
- package/dist/copc/copc-writer.js +1 -1
- package/dist/copc/index.cjs +365 -170
- package/dist/copc/index.cjs.map +3 -3
- package/dist/dist.dev.js +231 -38
- package/dist/dist.min.js +10 -10
- package/dist/i3s/arcgis-webscene-loader.js +1 -1
- package/dist/i3s/dist.dev.js +6591 -1184
- package/dist/i3s/dist.min.js +55 -47
- package/dist/i3s/i3s-attribute-loader.js +1 -1
- package/dist/i3s/i3s-building-scene-layer-loader.js +1 -1
- package/dist/i3s/i3s-content-loader.js +1 -1
- package/dist/i3s/i3s-lepcc-loader-types.js +1 -1
- package/dist/i3s/i3s-loader.js +1 -1
- package/dist/i3s/i3s-node-page-loader.js +1 -1
- package/dist/i3s/i3s-slpk-loader.js +1 -1
- package/dist/i3s/i3s-slpk-writer.js +1 -1
- package/dist/i3s/index.cjs +4763 -1136
- package/dist/i3s/index.cjs.map +3 -3
- package/dist/i3s-content-worker-node.js +11 -11
- package/dist/i3s-content-worker-node.js.map +4 -4
- package/dist/i3s-content-worker.js +1148 -391
- package/dist/i3s-lepcc-worker-node.js +609 -44
- package/dist/i3s-lepcc-worker-node.js.map +4 -4
- package/dist/i3s-lepcc-worker.js +575 -40
- package/dist/i3s-mesh-writer.cjs +8880 -5253
- package/dist/i3s-mesh-writer.cjs.map +3 -3
- package/dist/i3s-slpk-writer.cjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/point-cloud-tile-source-loader-types.js +1 -1
- package/dist/point-cloud-tile-source-loader.cjs +1 -1
- package/dist/potree/dist.dev.js +310 -110
- package/dist/potree/dist.min.js +31 -31
- package/dist/potree/index.cjs +19 -166
- package/dist/potree/index.cjs.map +3 -3
- package/dist/potree/potree-bin-loader.js +1 -1
- package/dist/potree/potree-hierarchy-chunk-loader.js +1 -1
- package/dist/potree/potree-loader-types.js +1 -1
- package/dist/potree/potree-source-loader.js +1 -1
- package/dist/potree/potree-writer.js +1 -1
- package/dist/potree-loader.cjs +1 -1
- package/package.json +13 -13
- package/src/3d-tiles/lib/classes/tile-3d-batch-table.ts +12 -8
- package/src/3d-tiles/lib/parsers/parse-3d-tile-instanced-model.ts +4 -1
- package/src/copc/copc-source-loader.ts +1 -1
|
@@ -14,8 +14,8 @@ var __esm = (fn, res, err) => function __init() {
|
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
16
|
var __export = (target, all) => {
|
|
17
|
-
for (var
|
|
18
|
-
__defProp(target,
|
|
17
|
+
for (var name22 in all)
|
|
18
|
+
__defProp(target, name22, { get: all[name22], enumerable: true });
|
|
19
19
|
};
|
|
20
20
|
var __copyProps = (to, from, except, desc) => {
|
|
21
21
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
@@ -129,9 +129,9 @@ function registerJSModules(modules) {
|
|
|
129
129
|
globalThis.loaders.modules ||= {};
|
|
130
130
|
Object.assign(globalThis.loaders.modules, modules);
|
|
131
131
|
}
|
|
132
|
-
function getJSModuleOrNull(
|
|
132
|
+
function getJSModuleOrNull(name22) {
|
|
133
133
|
var _a, _b;
|
|
134
|
-
const module2 = (_b = (_a = globalThis.loaders) == null ? void 0 : _a.modules) == null ? void 0 : _b[
|
|
134
|
+
const module2 = (_b = (_a = globalThis.loaders) == null ? void 0 : _a.modules) == null ? void 0 : _b[name22];
|
|
135
135
|
return module2 || null;
|
|
136
136
|
}
|
|
137
137
|
var init_js_module_utils = __esm({
|
|
@@ -3219,17 +3219,17 @@ var init_gltf_scenegraph = __esm({
|
|
|
3219
3219
|
return extras[key];
|
|
3220
3220
|
}
|
|
3221
3221
|
hasExtension(extensionName) {
|
|
3222
|
-
const isUsedExtension = this.getUsedExtensions().find((
|
|
3223
|
-
const isRequiredExtension = this.getRequiredExtensions().find((
|
|
3222
|
+
const isUsedExtension = this.getUsedExtensions().find((name22) => name22 === extensionName);
|
|
3223
|
+
const isRequiredExtension = this.getRequiredExtensions().find((name22) => name22 === extensionName);
|
|
3224
3224
|
return typeof isUsedExtension === "string" || typeof isRequiredExtension === "string";
|
|
3225
3225
|
}
|
|
3226
3226
|
getExtension(extensionName) {
|
|
3227
|
-
const isExtension = this.getUsedExtensions().find((
|
|
3227
|
+
const isExtension = this.getUsedExtensions().find((name22) => name22 === extensionName);
|
|
3228
3228
|
const extensions = this.json.extensions || {};
|
|
3229
3229
|
return isExtension ? extensions[extensionName] : null;
|
|
3230
3230
|
}
|
|
3231
3231
|
getRequiredExtension(extensionName) {
|
|
3232
|
-
const isRequired = this.getRequiredExtensions().find((
|
|
3232
|
+
const isRequired = this.getRequiredExtensions().find((name22) => name22 === extensionName);
|
|
3233
3233
|
return isRequired ? this.getExtension(extensionName) : null;
|
|
3234
3234
|
}
|
|
3235
3235
|
getRequiredExtensions() {
|
|
@@ -3631,8 +3631,8 @@ var init_gltf_scenegraph = __esm({
|
|
|
3631
3631
|
assert3(bufferOffset !== void 0);
|
|
3632
3632
|
bufferView.byteOffset = bufferOffset + (bufferView.byteOffset || 0);
|
|
3633
3633
|
bufferView.buffer = 0;
|
|
3634
|
-
for (const
|
|
3635
|
-
const extension = (_b = bufferView.extensions) == null ? void 0 : _b[
|
|
3634
|
+
for (const name22 of ["EXT_meshopt_compression", "KHR_meshopt_compression"]) {
|
|
3635
|
+
const extension = (_b = bufferView.extensions) == null ? void 0 : _b[name22];
|
|
3636
3636
|
if (extension) {
|
|
3637
3637
|
const extensionOffset = bufferOffsets[extension.buffer];
|
|
3638
3638
|
assert3(extensionOffset !== void 0);
|
|
@@ -3951,7 +3951,7 @@ function iterateObjectData(objects) {
|
|
|
3951
3951
|
})();
|
|
3952
3952
|
}
|
|
3953
3953
|
function mapObjectData(objects) {
|
|
3954
|
-
return new Map(Array.from(objects, ([
|
|
3954
|
+
return new Map(Array.from(objects, ([name22, object]) => [name22, object.data]));
|
|
3955
3955
|
}
|
|
3956
3956
|
function getCollectionName(type) {
|
|
3957
3957
|
switch (type) {
|
|
@@ -4829,7 +4829,7 @@ function getPrimitiveTextureData(scenegraph, textureInfo, primitive) {
|
|
|
4829
4829
|
if (typeof imageIndex !== "undefined") {
|
|
4830
4830
|
const mimeType = (_d = (_c = json.images) == null ? void 0 : _c[imageIndex]) == null ? void 0 : _d.mimeType;
|
|
4831
4831
|
const parsedImage = (_e = scenegraph.gltf.images) == null ? void 0 : _e[imageIndex];
|
|
4832
|
-
if (parsedImage && typeof parsedImage.width !== "undefined") {
|
|
4832
|
+
if (parsedImage && typeof parsedImage.width !== "undefined" && !("compressed" in parsedImage && parsedImage.compressed)) {
|
|
4833
4833
|
const textureData = [];
|
|
4834
4834
|
for (let index = 0; index < textureCoordinates.length; index += 2) {
|
|
4835
4835
|
const value = getImageValueByCoordinates(
|
|
@@ -5403,38 +5403,56 @@ __export(KHR_gaussian_splatting_exports, {
|
|
|
5403
5403
|
getGaussianSplatPrimitives: () => getGaussianSplatPrimitives,
|
|
5404
5404
|
name: () => name6
|
|
5405
5405
|
});
|
|
5406
|
-
async function decode6(gltfData, options) {
|
|
5407
|
-
var _a, _b, _c, _d;
|
|
5406
|
+
async function decode6(gltfData, options, context) {
|
|
5407
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
5408
|
+
const loader = (_a = context == null ? void 0 : context.loaders) == null ? void 0 : _a.find((candidate) => {
|
|
5409
|
+
var _a2;
|
|
5410
|
+
return (_a2 = candidate.extensions) == null ? void 0 : _a2.includes("spz");
|
|
5411
|
+
});
|
|
5408
5412
|
const descriptors = getGaussianSplatPrimitives(gltfData);
|
|
5409
5413
|
const iterator = new GLTFIterator(gltfData);
|
|
5410
5414
|
for (const [meshIndex, mesh] of (gltfData.json.meshes || []).entries()) {
|
|
5411
5415
|
for (const [primitiveIndex, primitive] of mesh.primitives.entries()) {
|
|
5412
|
-
const extension = (
|
|
5416
|
+
const extension = (_b = primitive.extensions) == null ? void 0 : _b[name6];
|
|
5413
5417
|
if (!extension) continue;
|
|
5418
|
+
const descriptor = descriptors.find(
|
|
5419
|
+
(item) => item.meshIndex === meshIndex && item.primitiveIndex === primitiveIndex
|
|
5420
|
+
);
|
|
5421
|
+
const legacyColorSpace = (_c = options == null ? void 0 : options.gltf) == null ? void 0 : _c.legacyGaussianSplatColorSpace;
|
|
5422
|
+
const normalizedExtension = legacyColorSpace && ((_d = extension.extensions) == null ? void 0 : _d[SPZ_COMPRESSION_EXTENSION_NAME]) ? {
|
|
5423
|
+
...extension,
|
|
5424
|
+
kernel: extension.kernel ?? "ellipse",
|
|
5425
|
+
colorSpace: extension.colorSpace ?? legacyColorSpace
|
|
5426
|
+
} : extension;
|
|
5427
|
+
if (descriptor) descriptor.extension = normalizedExtension;
|
|
5414
5428
|
validateGaussianSplatPrimitive(
|
|
5415
5429
|
gltfData.json,
|
|
5416
5430
|
primitive,
|
|
5417
|
-
|
|
5431
|
+
normalizedExtension,
|
|
5418
5432
|
meshIndex,
|
|
5419
5433
|
primitiveIndex,
|
|
5420
5434
|
iterator
|
|
5421
5435
|
);
|
|
5422
|
-
const compression = (
|
|
5436
|
+
const compression = (_e = extension.extensions) == null ? void 0 : _e[SPZ_COMPRESSION_EXTENSION_NAME];
|
|
5423
5437
|
if (compression) {
|
|
5424
|
-
const descriptor = descriptors.find(
|
|
5425
|
-
(item) => item.meshIndex === meshIndex && item.primitiveIndex === primitiveIndex
|
|
5426
|
-
);
|
|
5427
5438
|
if (descriptor) {
|
|
5428
|
-
const decoder = (
|
|
5429
|
-
const bufferView = (
|
|
5439
|
+
const decoder = (_f = options == null ? void 0 : options.gltf) == null ? void 0 : _f.splatDecoder;
|
|
5440
|
+
const bufferView = (_g = gltfData.json.bufferViews) == null ? void 0 : _g[compression.bufferView];
|
|
5430
5441
|
if (bufferView && gltfData.buffers[bufferView.buffer]) {
|
|
5431
5442
|
descriptor.compressedBytes = getBufferViewBytes(gltfData, compression.bufferView);
|
|
5432
|
-
} else if (decoder) {
|
|
5443
|
+
} else if (decoder || loader) {
|
|
5433
5444
|
throw new Error(
|
|
5434
5445
|
`KHR_gaussian_splatting: bufferView ${compression.bufferView} is not loaded for SPZ2 decoding.`
|
|
5435
5446
|
);
|
|
5436
5447
|
}
|
|
5437
|
-
if (
|
|
5448
|
+
if (loader && context && descriptor.compressedBytes) {
|
|
5449
|
+
descriptor.decoded = await parseFromContext(
|
|
5450
|
+
descriptor.compressedBytes.buffer,
|
|
5451
|
+
loader,
|
|
5452
|
+
{ ...options, splats: { ...options.splats, sourceCoordinateSystem: "LUF" } },
|
|
5453
|
+
context
|
|
5454
|
+
);
|
|
5455
|
+
} else if (decoder && descriptor.compressedBytes) {
|
|
5438
5456
|
descriptor.decoded = await decoder(descriptor.compressedBytes.buffer, {
|
|
5439
5457
|
sourceCoordinateSystem: "LUF"
|
|
5440
5458
|
});
|
|
@@ -5575,6 +5593,7 @@ var name6, SPZ_COMPRESSION_EXTENSION_NAME, REQUIRED_ATTRIBUTES;
|
|
|
5575
5593
|
var init_KHR_gaussian_splatting = __esm({
|
|
5576
5594
|
"../scene/src/gltf/lib/extensions/KHR_gaussian_splatting.ts"() {
|
|
5577
5595
|
"use strict";
|
|
5596
|
+
init_loader_utils();
|
|
5578
5597
|
init_gltf_iterator();
|
|
5579
5598
|
name6 = "KHR_gaussian_splatting";
|
|
5580
5599
|
SPZ_COMPRESSION_EXTENSION_NAME = "KHR_gaussian_splatting_compression_spz_2";
|
|
@@ -6589,7 +6608,7 @@ var init_EXT_feature_metadata = __esm({
|
|
|
6589
6608
|
});
|
|
6590
6609
|
|
|
6591
6610
|
// ../scene/src/gltf/lib/types/gltf-additional-extension-schemas.ts
|
|
6592
|
-
var import_zod, indexSchema, propertyShape, GLTFKHRMaterialVariantSchema, GLTFKHRMaterialsVariantsSchema, GLTFKHRMaterialVariantMappingSchema, GLTFKHRMaterialsVariantsPrimitiveSchema, GLTFEXTMeshGPUInstancingSchema, GLTFKHRAnimationPointerSchema, GLTFKHRNodeVisibilitySchema, GLTFKHRNodeSelectabilitySchema, GLTFKHRNodeHoverabilitySchema, GLTFKHRXMPPacketSchema, GLTFKHRXMPJSONLDSchema, GLTFKHRXMPJSONLDReferenceSchema;
|
|
6611
|
+
var import_zod, indexSchema, propertyShape, GLTFKHRMaterialVariantSchema, GLTFKHRMaterialsVariantsSchema, GLTFKHRMaterialVariantMappingSchema, GLTFKHRMaterialsVariantsPrimitiveSchema, GLTFEXTMeshGPUInstancingSchema, GLTFKHRAnimationPointerSchema, GLTFKHRNodeVisibilitySchema, GLTFKHRNodeSelectabilitySchema, GLTFKHRNodeHoverabilitySchema, GLTFKHRXMPPacketSchema, GLTFKHRXMPJSONLDSchema, GLTFKHRXMPJSONLDReferenceSchema, GLTFKHRMaterialsEmissiveStrengthSchema, GLTFFBGeometryMetadataSchema;
|
|
6593
6612
|
var init_gltf_additional_extension_schemas = __esm({
|
|
6594
6613
|
"../scene/src/gltf/lib/types/gltf-additional-extension-schemas.ts"() {
|
|
6595
6614
|
"use strict";
|
|
@@ -6664,6 +6683,24 @@ var init_gltf_additional_extension_schemas = __esm({
|
|
|
6664
6683
|
/** Index into the document-level packets array. */
|
|
6665
6684
|
packet: indexSchema
|
|
6666
6685
|
});
|
|
6686
|
+
GLTFKHRMaterialsEmissiveStrengthSchema = import_zod.z.looseObject({
|
|
6687
|
+
...propertyShape,
|
|
6688
|
+
/** Unitless multiplier; defaults to one when omitted. */
|
|
6689
|
+
emissiveStrength: import_zod.z.number().nonnegative().optional()
|
|
6690
|
+
});
|
|
6691
|
+
GLTFFBGeometryMetadataSchema = import_zod.z.looseObject({
|
|
6692
|
+
...propertyShape,
|
|
6693
|
+
/** Authored count of vertices. */
|
|
6694
|
+
vertexCount: import_zod.z.number().nonnegative().optional(),
|
|
6695
|
+
/** Authored count of primitives. */
|
|
6696
|
+
primitiveCount: import_zod.z.number().nonnegative().optional(),
|
|
6697
|
+
/** Static scene-space bounding box. */
|
|
6698
|
+
sceneBounds: import_zod.z.looseObject({
|
|
6699
|
+
...propertyShape,
|
|
6700
|
+
min: import_zod.z.array(import_zod.z.number()).length(3),
|
|
6701
|
+
max: import_zod.z.array(import_zod.z.number()).length(3)
|
|
6702
|
+
}).optional()
|
|
6703
|
+
});
|
|
6667
6704
|
}
|
|
6668
6705
|
});
|
|
6669
6706
|
|
|
@@ -6815,7 +6852,7 @@ var init_gltf_audio_extension_schemas = __esm({
|
|
|
6815
6852
|
});
|
|
6816
6853
|
|
|
6817
6854
|
// ../scene/src/gltf/lib/types/gltf-extension-schemas.ts
|
|
6818
|
-
var import_zod3, GLTFPropertyExtensionsSchema, GLTFRootExtensionsSchema, GLTFNodeExtensionsSchema, GLTFSceneExtensionsSchema, GLTFMeshPrimitiveExtensionsSchema, GLTFAnimationTargetExtensionsSchema;
|
|
6855
|
+
var import_zod3, GLTFPropertyExtensionsSchema, GLTFMaterialExtensionsSchema, GLTFRootExtensionsSchema, GLTFNodeExtensionsSchema, GLTFSceneExtensionsSchema, GLTFMeshPrimitiveExtensionsSchema, GLTFAnimationTargetExtensionsSchema;
|
|
6819
6856
|
var init_gltf_extension_schemas = __esm({
|
|
6820
6857
|
"../scene/src/gltf/lib/types/gltf-extension-schemas.ts"() {
|
|
6821
6858
|
"use strict";
|
|
@@ -6826,6 +6863,10 @@ var init_gltf_extension_schemas = __esm({
|
|
|
6826
6863
|
/** Shared XMP packet reference. */
|
|
6827
6864
|
KHR_xmp_json_ld: GLTFKHRXMPJSONLDReferenceSchema.optional()
|
|
6828
6865
|
});
|
|
6866
|
+
GLTFMaterialExtensionsSchema = GLTFPropertyExtensionsSchema.extend({
|
|
6867
|
+
/** Emissive intensity multiplier. */
|
|
6868
|
+
KHR_materials_emissive_strength: GLTFKHRMaterialsEmissiveStrengthSchema.optional()
|
|
6869
|
+
});
|
|
6829
6870
|
GLTFRootExtensionsSchema = import_zod3.z.looseObject({
|
|
6830
6871
|
/** Shared material variant declarations. */
|
|
6831
6872
|
KHR_materials_variants: GLTFKHRMaterialsVariantsSchema.optional(),
|
|
@@ -6851,6 +6892,8 @@ var init_gltf_extension_schemas = __esm({
|
|
|
6851
6892
|
MPEG_audio_spatial: GLTFMPEGAudioSpatialSchema.optional()
|
|
6852
6893
|
});
|
|
6853
6894
|
GLTFSceneExtensionsSchema = GLTFPropertyExtensionsSchema.extend({
|
|
6895
|
+
/** Authored static geometry summary. */
|
|
6896
|
+
FB_geometry_metadata: GLTFFBGeometryMetadataSchema.optional(),
|
|
6854
6897
|
/** Attached global KHR audio emitters. */
|
|
6855
6898
|
KHR_audio_emitter: GLTFKHRAudioAttachmentSchema.optional()
|
|
6856
6899
|
});
|
|
@@ -7132,6 +7175,33 @@ var init_resolve_gltf_file = __esm({
|
|
|
7132
7175
|
}
|
|
7133
7176
|
});
|
|
7134
7177
|
|
|
7178
|
+
// ../scene/src/gltf/lib/extensions/KHR_accessor_float64.ts
|
|
7179
|
+
var KHR_accessor_float64_exports = {};
|
|
7180
|
+
__export(KHR_accessor_float64_exports, {
|
|
7181
|
+
name: () => name10,
|
|
7182
|
+
preprocess: () => preprocess
|
|
7183
|
+
});
|
|
7184
|
+
function preprocess(gltf) {
|
|
7185
|
+
var _a, _b, _c, _d;
|
|
7186
|
+
const { json } = gltf;
|
|
7187
|
+
if (!((_a = json.extensionsUsed) == null ? void 0 : _a.includes(name10)) && !((_b = json.extensionsRequired) == null ? void 0 : _b.includes(name10))) return;
|
|
7188
|
+
if (!((_c = json.extensionsUsed) == null ? void 0 : _c.includes(name10)) || !((_d = json.extensionsRequired) == null ? void 0 : _d.includes(name10))) {
|
|
7189
|
+
throw new Error(`${name10}: must be declared in extensionsUsed and extensionsRequired.`);
|
|
7190
|
+
}
|
|
7191
|
+
for (const [index, accessor] of (json.accessors || []).entries()) {
|
|
7192
|
+
if (accessor.componentType === 5130 && accessor.normalized) {
|
|
7193
|
+
throw new Error(`${name10}: accessor ${index} must not be normalized.`);
|
|
7194
|
+
}
|
|
7195
|
+
}
|
|
7196
|
+
}
|
|
7197
|
+
var name10;
|
|
7198
|
+
var init_KHR_accessor_float64 = __esm({
|
|
7199
|
+
"../scene/src/gltf/lib/extensions/KHR_accessor_float64.ts"() {
|
|
7200
|
+
"use strict";
|
|
7201
|
+
name10 = "KHR_accessor_float64";
|
|
7202
|
+
}
|
|
7203
|
+
});
|
|
7204
|
+
|
|
7135
7205
|
// ../scene/src/gltf/libs/meshopt-decoder.mjs
|
|
7136
7206
|
var meshopt_decoder_exports = {};
|
|
7137
7207
|
__export(meshopt_decoder_exports, {
|
|
@@ -7282,7 +7352,7 @@ var init_meshopt_decoder = __esm({
|
|
|
7282
7352
|
}
|
|
7283
7353
|
return result.buffer.slice(0, write);
|
|
7284
7354
|
}
|
|
7285
|
-
function
|
|
7355
|
+
function decode18(instance2, fun, target, count, size, source, filter) {
|
|
7286
7356
|
var sbrk = instance2.exports.sbrk;
|
|
7287
7357
|
var count4 = count + 3 & ~3;
|
|
7288
7358
|
var tp = sbrk(count4 * size);
|
|
@@ -7328,7 +7398,7 @@ var init_meshopt_decoder = __esm({
|
|
|
7328
7398
|
return worker;
|
|
7329
7399
|
}
|
|
7330
7400
|
function initWorkers(count) {
|
|
7331
|
-
var source = "self.ready = WebAssembly.instantiate(new Uint8Array([" + new Uint8Array(wasm) + "]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = " + workerProcess.name + ";" +
|
|
7401
|
+
var source = "self.ready = WebAssembly.instantiate(new Uint8Array([" + new Uint8Array(wasm) + "]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = " + workerProcess.name + ";" + decode18.toString() + workerProcess.toString();
|
|
7332
7402
|
var blob = new Blob([source], { type: "text/javascript" });
|
|
7333
7403
|
var url = URL.createObjectURL(blob);
|
|
7334
7404
|
for (var i = workers.length; i < count; ++i) {
|
|
@@ -7363,7 +7433,7 @@ var init_meshopt_decoder = __esm({
|
|
|
7363
7433
|
}
|
|
7364
7434
|
try {
|
|
7365
7435
|
var target = new Uint8Array(data.count * data.size);
|
|
7366
|
-
|
|
7436
|
+
decode18(instance2, instance2.exports[data.mode], target, data.count, data.size, data.source, instance2.exports[data.filter]);
|
|
7367
7437
|
self.postMessage({ id: data.id, count: data.count, action: "resolve", value: target }, [target.buffer]);
|
|
7368
7438
|
} catch (error) {
|
|
7369
7439
|
self.postMessage({ id: data.id, count: data.count, action: "reject", value: error });
|
|
@@ -7377,16 +7447,16 @@ var init_meshopt_decoder = __esm({
|
|
|
7377
7447
|
initWorkers(count);
|
|
7378
7448
|
},
|
|
7379
7449
|
decodeVertexBuffer: function(target, count, size, source, filter) {
|
|
7380
|
-
|
|
7450
|
+
decode18(instance, instance.exports.meshopt_decodeVertexBuffer, target, count, size, source, instance.exports[filters[filter]]);
|
|
7381
7451
|
},
|
|
7382
7452
|
decodeIndexBuffer: function(target, count, size, source) {
|
|
7383
|
-
|
|
7453
|
+
decode18(instance, instance.exports.meshopt_decodeIndexBuffer, target, count, size, source);
|
|
7384
7454
|
},
|
|
7385
7455
|
decodeIndexSequence: function(target, count, size, source) {
|
|
7386
|
-
|
|
7456
|
+
decode18(instance, instance.exports.meshopt_decodeIndexSequence, target, count, size, source);
|
|
7387
7457
|
},
|
|
7388
7458
|
decodeGltfBuffer: function(target, count, size, source, mode, filter) {
|
|
7389
|
-
|
|
7459
|
+
decode18(instance, instance.exports[decoders[mode]], target, count, size, source, instance.exports[filters[filter]]);
|
|
7390
7460
|
},
|
|
7391
7461
|
decodeGltfBufferAsync: function(count, size, source, mode, filter) {
|
|
7392
7462
|
if (workers.length > 0) {
|
|
@@ -7394,7 +7464,7 @@ var init_meshopt_decoder = __esm({
|
|
|
7394
7464
|
}
|
|
7395
7465
|
return ready.then(function() {
|
|
7396
7466
|
var target = new Uint8Array(count * size);
|
|
7397
|
-
|
|
7467
|
+
decode18(instance, instance.exports[decoders[mode]], target, count, size, source, instance.exports[filters[filter]]);
|
|
7398
7468
|
return target;
|
|
7399
7469
|
});
|
|
7400
7470
|
}
|
|
@@ -7548,17 +7618,17 @@ var init_meshopt_compression = __esm({
|
|
|
7548
7618
|
var EXT_meshopt_compression_exports = {};
|
|
7549
7619
|
__export(EXT_meshopt_compression_exports, {
|
|
7550
7620
|
decode: () => decode10,
|
|
7551
|
-
name: () =>
|
|
7621
|
+
name: () => name11
|
|
7552
7622
|
});
|
|
7553
7623
|
async function decode10(gltfData, options) {
|
|
7554
|
-
await decodeMeshoptCompression(gltfData, options,
|
|
7624
|
+
await decodeMeshoptCompression(gltfData, options, name11);
|
|
7555
7625
|
}
|
|
7556
|
-
var
|
|
7626
|
+
var name11;
|
|
7557
7627
|
var init_EXT_meshopt_compression = __esm({
|
|
7558
7628
|
"../scene/src/gltf/lib/extensions/EXT_meshopt_compression.ts"() {
|
|
7559
7629
|
"use strict";
|
|
7560
7630
|
init_meshopt_compression();
|
|
7561
|
-
|
|
7631
|
+
name11 = "EXT_meshopt_compression";
|
|
7562
7632
|
}
|
|
7563
7633
|
});
|
|
7564
7634
|
|
|
@@ -7566,28 +7636,29 @@ var init_EXT_meshopt_compression = __esm({
|
|
|
7566
7636
|
var KHR_meshopt_compression_exports = {};
|
|
7567
7637
|
__export(KHR_meshopt_compression_exports, {
|
|
7568
7638
|
decode: () => decode11,
|
|
7569
|
-
name: () =>
|
|
7639
|
+
name: () => name12
|
|
7570
7640
|
});
|
|
7571
7641
|
async function decode11(gltfData, options) {
|
|
7572
|
-
await decodeMeshoptCompression(gltfData, options,
|
|
7642
|
+
await decodeMeshoptCompression(gltfData, options, name12);
|
|
7573
7643
|
}
|
|
7574
|
-
var
|
|
7644
|
+
var name12;
|
|
7575
7645
|
var init_KHR_meshopt_compression = __esm({
|
|
7576
7646
|
"../scene/src/gltf/lib/extensions/KHR_meshopt_compression.ts"() {
|
|
7577
7647
|
"use strict";
|
|
7578
7648
|
init_meshopt_compression();
|
|
7579
|
-
|
|
7649
|
+
name12 = "KHR_meshopt_compression";
|
|
7580
7650
|
}
|
|
7581
7651
|
});
|
|
7582
7652
|
|
|
7583
7653
|
// ../scene/src/gltf/lib/extensions/EXT_texture_webp.ts
|
|
7584
7654
|
var EXT_texture_webp_exports = {};
|
|
7585
7655
|
__export(EXT_texture_webp_exports, {
|
|
7586
|
-
name: () =>
|
|
7587
|
-
preprocess: () =>
|
|
7656
|
+
name: () => name13,
|
|
7657
|
+
preprocess: () => preprocess2
|
|
7588
7658
|
});
|
|
7589
|
-
function
|
|
7659
|
+
function preprocess2(gltfData, options) {
|
|
7590
7660
|
const iterator = new GLTFIterator(gltfData);
|
|
7661
|
+
if (!iterator.hasExtension(EXT_TEXTURE_WEBP)) return;
|
|
7591
7662
|
if (!isImageFormatSupported("image/webp")) {
|
|
7592
7663
|
if (iterator.isExtensionRequired(EXT_TEXTURE_WEBP)) {
|
|
7593
7664
|
throw new Error(`gltf: Required extension ${EXT_TEXTURE_WEBP} not supported by browser`);
|
|
@@ -7603,24 +7674,24 @@ function preprocess(gltfData, options) {
|
|
|
7603
7674
|
}
|
|
7604
7675
|
iterator.removeExtension(EXT_TEXTURE_WEBP);
|
|
7605
7676
|
}
|
|
7606
|
-
var EXT_TEXTURE_WEBP,
|
|
7677
|
+
var EXT_TEXTURE_WEBP, name13;
|
|
7607
7678
|
var init_EXT_texture_webp = __esm({
|
|
7608
7679
|
"../scene/src/gltf/lib/extensions/EXT_texture_webp.ts"() {
|
|
7609
7680
|
"use strict";
|
|
7610
7681
|
init_src();
|
|
7611
7682
|
init_gltf_iterator();
|
|
7612
7683
|
EXT_TEXTURE_WEBP = "EXT_texture_webp";
|
|
7613
|
-
|
|
7684
|
+
name13 = EXT_TEXTURE_WEBP;
|
|
7614
7685
|
}
|
|
7615
7686
|
});
|
|
7616
7687
|
|
|
7617
7688
|
// ../scene/src/gltf/lib/extensions/EXT_texture_avif.ts
|
|
7618
7689
|
var EXT_texture_avif_exports = {};
|
|
7619
7690
|
__export(EXT_texture_avif_exports, {
|
|
7620
|
-
name: () =>
|
|
7621
|
-
preprocess: () =>
|
|
7691
|
+
name: () => name14,
|
|
7692
|
+
preprocess: () => preprocess3
|
|
7622
7693
|
});
|
|
7623
|
-
async function
|
|
7694
|
+
async function preprocess3(gltfData, options) {
|
|
7624
7695
|
void options;
|
|
7625
7696
|
const iterator = new GLTFIterator(gltfData);
|
|
7626
7697
|
if (!iterator.hasExtension(EXT_TEXTURE_AVIF)) return;
|
|
@@ -7640,24 +7711,72 @@ async function preprocess2(gltfData, options) {
|
|
|
7640
7711
|
}
|
|
7641
7712
|
iterator.removeExtension(EXT_TEXTURE_AVIF);
|
|
7642
7713
|
}
|
|
7643
|
-
var EXT_TEXTURE_AVIF,
|
|
7714
|
+
var EXT_TEXTURE_AVIF, name14;
|
|
7644
7715
|
var init_EXT_texture_avif = __esm({
|
|
7645
7716
|
"../scene/src/gltf/lib/extensions/EXT_texture_avif.ts"() {
|
|
7646
7717
|
"use strict";
|
|
7647
7718
|
init_src();
|
|
7648
7719
|
init_gltf_iterator();
|
|
7649
7720
|
EXT_TEXTURE_AVIF = "EXT_texture_avif";
|
|
7650
|
-
|
|
7721
|
+
name14 = EXT_TEXTURE_AVIF;
|
|
7722
|
+
}
|
|
7723
|
+
});
|
|
7724
|
+
|
|
7725
|
+
// ../scene/src/gltf/lib/extensions/MSFT_texture_dds.ts
|
|
7726
|
+
var MSFT_texture_dds_exports = {};
|
|
7727
|
+
__export(MSFT_texture_dds_exports, {
|
|
7728
|
+
decode: () => decode12,
|
|
7729
|
+
getDDSLoader: () => getDDSLoader,
|
|
7730
|
+
name: () => name15,
|
|
7731
|
+
preprocess: () => preprocess4
|
|
7732
|
+
});
|
|
7733
|
+
function getDDSLoader(context) {
|
|
7734
|
+
var _a;
|
|
7735
|
+
return (_a = context == null ? void 0 : context.loaders) == null ? void 0 : _a.find(
|
|
7736
|
+
(loader) => {
|
|
7737
|
+
var _a2, _b;
|
|
7738
|
+
return ((_a2 = loader.extensions) == null ? void 0 : _a2.includes("dds")) || ((_b = loader.mimeTypes) == null ? void 0 : _b.includes("image/vnd-ms.dds"));
|
|
7739
|
+
}
|
|
7740
|
+
);
|
|
7741
|
+
}
|
|
7742
|
+
function preprocess4(gltf, _options, context) {
|
|
7743
|
+
const iterator = new GLTFIterator(gltf);
|
|
7744
|
+
if (!iterator.hasExtension(name15)) return;
|
|
7745
|
+
if (!getDDSLoader(context)) {
|
|
7746
|
+
if (iterator.isExtensionRequired(name15)) {
|
|
7747
|
+
throw new Error("gltf: Required extension MSFT_texture_dds needs a DDS parser");
|
|
7748
|
+
}
|
|
7749
|
+
return;
|
|
7750
|
+
}
|
|
7751
|
+
for (const texture of iterator.textures) {
|
|
7752
|
+
const extension = iterator.getExtension(texture, name15);
|
|
7753
|
+
if (extension) texture.source = extension.source;
|
|
7754
|
+
}
|
|
7755
|
+
}
|
|
7756
|
+
async function decode12(gltf, options, context) {
|
|
7757
|
+
var _a;
|
|
7758
|
+
if (!getDDSLoader(context) || ((_a = options.gltf) == null ? void 0 : _a.loadImages) === false) return;
|
|
7759
|
+
const iterator = new GLTFIterator(gltf);
|
|
7760
|
+
if (!iterator.hasExtension(name15)) return;
|
|
7761
|
+
for (const texture of iterator.textures) iterator.removeExtension(texture, name15);
|
|
7762
|
+
iterator.removeExtension(name15);
|
|
7763
|
+
}
|
|
7764
|
+
var name15;
|
|
7765
|
+
var init_MSFT_texture_dds = __esm({
|
|
7766
|
+
"../scene/src/gltf/lib/extensions/MSFT_texture_dds.ts"() {
|
|
7767
|
+
"use strict";
|
|
7768
|
+
init_gltf_iterator();
|
|
7769
|
+
name15 = "MSFT_texture_dds";
|
|
7651
7770
|
}
|
|
7652
7771
|
});
|
|
7653
7772
|
|
|
7654
7773
|
// ../scene/src/gltf/lib/extensions/KHR_texture_basisu.ts
|
|
7655
7774
|
var KHR_texture_basisu_exports = {};
|
|
7656
7775
|
__export(KHR_texture_basisu_exports, {
|
|
7657
|
-
name: () =>
|
|
7658
|
-
preprocess: () =>
|
|
7776
|
+
name: () => name16,
|
|
7777
|
+
preprocess: () => preprocess5
|
|
7659
7778
|
});
|
|
7660
|
-
function
|
|
7779
|
+
function preprocess5(gltfData, options) {
|
|
7661
7780
|
void options;
|
|
7662
7781
|
const iterator = new GLTFIterator(gltfData);
|
|
7663
7782
|
for (const texture of iterator.textures) {
|
|
@@ -7669,697 +7788,109 @@ function preprocess3(gltfData, options) {
|
|
|
7669
7788
|
}
|
|
7670
7789
|
iterator.removeExtension(KHR_TEXTURE_BASISU);
|
|
7671
7790
|
}
|
|
7672
|
-
var KHR_TEXTURE_BASISU,
|
|
7791
|
+
var KHR_TEXTURE_BASISU, name16;
|
|
7673
7792
|
var init_KHR_texture_basisu = __esm({
|
|
7674
7793
|
"../scene/src/gltf/lib/extensions/KHR_texture_basisu.ts"() {
|
|
7675
7794
|
"use strict";
|
|
7676
7795
|
init_gltf_iterator();
|
|
7677
7796
|
KHR_TEXTURE_BASISU = "KHR_texture_basisu";
|
|
7678
|
-
|
|
7797
|
+
name16 = KHR_TEXTURE_BASISU;
|
|
7679
7798
|
}
|
|
7680
7799
|
});
|
|
7681
7800
|
|
|
7682
|
-
// ../core/src/
|
|
7683
|
-
function
|
|
7801
|
+
// ../core/src/arrow-worker-transport.ts
|
|
7802
|
+
function serializeArrowWorkerResult(result, options) {
|
|
7803
|
+
var _a;
|
|
7804
|
+
if (!isArrowTableWrapper(result)) {
|
|
7805
|
+
return result;
|
|
7806
|
+
}
|
|
7807
|
+
const workerOptions = options;
|
|
7808
|
+
const bufferCopyMode = ((_a = workerOptions == null ? void 0 : workerOptions.core) == null ? void 0 : _a.workerTransferBufferCopy) ?? (workerOptions == null ? void 0 : workerOptions.workerTransferBufferCopy);
|
|
7684
7809
|
return {
|
|
7685
|
-
|
|
7686
|
-
|
|
7810
|
+
...result,
|
|
7811
|
+
data: (0, import_arrow.dehydrateArrowTable)(result.data, bufferCopyMode ? { copy: bufferCopyMode } : void 0)
|
|
7687
7812
|
};
|
|
7688
7813
|
}
|
|
7689
|
-
function
|
|
7690
|
-
|
|
7691
|
-
|
|
7692
|
-
|
|
7693
|
-
);
|
|
7694
|
-
}
|
|
7695
|
-
function serializeArrowMetadata(arrowMetadata) {
|
|
7696
|
-
return Object.fromEntries(arrowMetadata);
|
|
7697
|
-
}
|
|
7698
|
-
function deserializeArrowMetadata(metadata) {
|
|
7699
|
-
return metadata ? new Map(Object.entries(metadata)) : /* @__PURE__ */ new Map();
|
|
7814
|
+
function deserializeArrowWorkerResult(result) {
|
|
7815
|
+
if (!isDehydratedArrowTableWrapper(result)) {
|
|
7816
|
+
return result;
|
|
7817
|
+
}
|
|
7818
|
+
return { ...result, data: (0, import_arrow.hydrateArrowTable)(result.data) };
|
|
7700
7819
|
}
|
|
7701
|
-
function
|
|
7702
|
-
|
|
7703
|
-
|
|
7704
|
-
|
|
7705
|
-
|
|
7706
|
-
metadata: serializeArrowMetadata(field.metadata)
|
|
7707
|
-
};
|
|
7820
|
+
function isArrowTableWrapper(value) {
|
|
7821
|
+
const table = value;
|
|
7822
|
+
return Boolean(
|
|
7823
|
+
table && table.shape === "arrow-table" && table.data && typeof table.data === "object" && "batches" in table.data
|
|
7824
|
+
);
|
|
7708
7825
|
}
|
|
7709
|
-
function
|
|
7710
|
-
|
|
7711
|
-
|
|
7712
|
-
|
|
7713
|
-
field.nullable,
|
|
7714
|
-
deserializeArrowMetadata(field.metadata)
|
|
7826
|
+
function isDehydratedArrowTableWrapper(value) {
|
|
7827
|
+
const table = value;
|
|
7828
|
+
return Boolean(
|
|
7829
|
+
table && table.shape === "arrow-table" && table.data && table.data.transport === "arrow-js" && Array.isArray(table.data.batches)
|
|
7715
7830
|
);
|
|
7716
7831
|
}
|
|
7717
|
-
|
|
7718
|
-
|
|
7719
|
-
|
|
7832
|
+
var import_arrow;
|
|
7833
|
+
var init_arrow_worker_transport = __esm({
|
|
7834
|
+
"../core/src/arrow-worker-transport.ts"() {
|
|
7835
|
+
"use strict";
|
|
7836
|
+
import_arrow = require("@math.gl/arrow");
|
|
7720
7837
|
}
|
|
7721
|
-
|
|
7722
|
-
|
|
7838
|
+
});
|
|
7839
|
+
|
|
7840
|
+
// ../scene/src/draco/lib/utils/version.ts
|
|
7841
|
+
var VERSION4;
|
|
7842
|
+
var init_version4 = __esm({
|
|
7843
|
+
"../scene/src/draco/lib/utils/version.ts"() {
|
|
7844
|
+
"use strict";
|
|
7845
|
+
VERSION4 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
7723
7846
|
}
|
|
7724
|
-
|
|
7725
|
-
|
|
7726
|
-
|
|
7727
|
-
|
|
7728
|
-
|
|
7847
|
+
});
|
|
7848
|
+
|
|
7849
|
+
// ../scene/src/draco/draco-format.ts
|
|
7850
|
+
var DracoFormat;
|
|
7851
|
+
var init_draco_format = __esm({
|
|
7852
|
+
"../scene/src/draco/draco-format.ts"() {
|
|
7853
|
+
"use strict";
|
|
7854
|
+
DracoFormat = {
|
|
7855
|
+
name: "Draco",
|
|
7856
|
+
id: "draco",
|
|
7857
|
+
module: "scene",
|
|
7858
|
+
encoding: "binary",
|
|
7859
|
+
format: "draco",
|
|
7860
|
+
extensions: ["drc"],
|
|
7861
|
+
mimeTypes: ["application/octet-stream"],
|
|
7862
|
+
binary: true,
|
|
7863
|
+
tests: ["DRACO"]
|
|
7729
7864
|
};
|
|
7730
7865
|
}
|
|
7731
|
-
|
|
7732
|
-
|
|
7733
|
-
|
|
7734
|
-
|
|
7735
|
-
|
|
7736
|
-
|
|
7737
|
-
|
|
7738
|
-
|
|
7739
|
-
|
|
7740
|
-
}
|
|
7741
|
-
|
|
7742
|
-
|
|
7743
|
-
|
|
7744
|
-
|
|
7745
|
-
|
|
7746
|
-
|
|
7747
|
-
|
|
7748
|
-
|
|
7749
|
-
|
|
7750
|
-
|
|
7751
|
-
|
|
7752
|
-
|
|
7753
|
-
|
|
7754
|
-
|
|
7755
|
-
|
|
7756
|
-
|
|
7757
|
-
|
|
7758
|
-
|
|
7759
|
-
return "uint32";
|
|
7760
|
-
case arrow.Uint64:
|
|
7761
|
-
return "uint64";
|
|
7762
|
-
case arrow.Float:
|
|
7763
|
-
const precision = arrowType.precision;
|
|
7764
|
-
switch (precision) {
|
|
7765
|
-
case arrow.Precision.HALF:
|
|
7766
|
-
return "float16";
|
|
7767
|
-
case arrow.Precision.SINGLE:
|
|
7768
|
-
return "float32";
|
|
7769
|
-
case arrow.Precision.DOUBLE:
|
|
7770
|
-
return "float64";
|
|
7771
|
-
default:
|
|
7772
|
-
return "float16";
|
|
7773
|
-
}
|
|
7774
|
-
case arrow.Float16:
|
|
7775
|
-
return "float16";
|
|
7776
|
-
case arrow.Float32:
|
|
7777
|
-
return "float32";
|
|
7778
|
-
case arrow.Float64:
|
|
7779
|
-
return "float64";
|
|
7780
|
-
case arrow.Utf8:
|
|
7781
|
-
return "utf8";
|
|
7782
|
-
case arrow.Decimal:
|
|
7783
|
-
const decimal = arrowType;
|
|
7784
|
-
return {
|
|
7785
|
-
type: "decimal",
|
|
7786
|
-
bitWidth: decimal.bitWidth,
|
|
7787
|
-
precision: decimal.precision,
|
|
7788
|
-
scale: decimal.scale
|
|
7789
|
-
};
|
|
7790
|
-
case arrow.Date_:
|
|
7791
|
-
const dateUnit = arrowType.unit;
|
|
7792
|
-
return dateUnit === arrow.DateUnit.DAY ? "date-day" : "date-millisecond";
|
|
7793
|
-
case arrow.DateDay:
|
|
7794
|
-
return "date-day";
|
|
7795
|
-
case arrow.DateMillisecond:
|
|
7796
|
-
return "date-millisecond";
|
|
7797
|
-
case arrow.Time:
|
|
7798
|
-
const timeUnit = arrowType.unit;
|
|
7799
|
-
switch (timeUnit) {
|
|
7800
|
-
case arrow.TimeUnit.SECOND:
|
|
7801
|
-
return "time-second";
|
|
7802
|
-
case arrow.TimeUnit.MILLISECOND:
|
|
7803
|
-
return "time-millisecond";
|
|
7804
|
-
case arrow.TimeUnit.MICROSECOND:
|
|
7805
|
-
return "time-microsecond";
|
|
7806
|
-
case arrow.TimeUnit.NANOSECOND:
|
|
7807
|
-
return "time-nanosecond";
|
|
7808
|
-
default:
|
|
7809
|
-
return "time-second";
|
|
7810
|
-
}
|
|
7811
|
-
case arrow.TimeMillisecond:
|
|
7812
|
-
return "time-millisecond";
|
|
7813
|
-
case arrow.TimeSecond:
|
|
7814
|
-
return "time-second";
|
|
7815
|
-
case arrow.TimeMicrosecond:
|
|
7816
|
-
return "time-microsecond";
|
|
7817
|
-
case arrow.TimeNanosecond:
|
|
7818
|
-
return "time-nanosecond";
|
|
7819
|
-
case arrow.Timestamp:
|
|
7820
|
-
const timeStampUnit = arrowType.unit;
|
|
7821
|
-
switch (timeStampUnit) {
|
|
7822
|
-
case arrow.TimeUnit.SECOND:
|
|
7823
|
-
return "timestamp-second";
|
|
7824
|
-
case arrow.TimeUnit.MILLISECOND:
|
|
7825
|
-
return "timestamp-millisecond";
|
|
7826
|
-
case arrow.TimeUnit.MICROSECOND:
|
|
7827
|
-
return "timestamp-microsecond";
|
|
7828
|
-
case arrow.TimeUnit.NANOSECOND:
|
|
7829
|
-
return "timestamp-nanosecond";
|
|
7830
|
-
default:
|
|
7831
|
-
return "timestamp-second";
|
|
7832
|
-
}
|
|
7833
|
-
case arrow.TimestampSecond:
|
|
7834
|
-
return "timestamp-second";
|
|
7835
|
-
case arrow.TimestampMillisecond:
|
|
7836
|
-
return "timestamp-millisecond";
|
|
7837
|
-
case arrow.TimestampMicrosecond:
|
|
7838
|
-
return "timestamp-microsecond";
|
|
7839
|
-
case arrow.TimestampNanosecond:
|
|
7840
|
-
return "timestamp-nanosecond";
|
|
7841
|
-
case arrow.Interval:
|
|
7842
|
-
const intervalUnit = arrowType.unit;
|
|
7843
|
-
switch (intervalUnit) {
|
|
7844
|
-
case arrow.IntervalUnit.DAY_TIME:
|
|
7845
|
-
return "interval-daytime";
|
|
7846
|
-
case arrow.IntervalUnit.YEAR_MONTH:
|
|
7847
|
-
return "interval-yearmonth";
|
|
7848
|
-
default:
|
|
7849
|
-
return "interval-daytime";
|
|
7850
|
-
}
|
|
7851
|
-
case arrow.IntervalDayTime:
|
|
7852
|
-
return "interval-daytime";
|
|
7853
|
-
case arrow.IntervalYearMonth:
|
|
7854
|
-
return "interval-yearmonth";
|
|
7855
|
-
case arrow.Map_:
|
|
7856
|
-
const mapType = arrowType;
|
|
7857
|
-
return {
|
|
7858
|
-
type: "map",
|
|
7859
|
-
keysSorted: mapType.keysSorted,
|
|
7860
|
-
children: mapType.children.map((arrowField) => serializeArrowField(arrowField))
|
|
7861
|
-
};
|
|
7862
|
-
case arrow.List:
|
|
7863
|
-
const listType = arrowType;
|
|
7864
|
-
const listField = listType.valueField;
|
|
7865
|
-
return {
|
|
7866
|
-
type: "list",
|
|
7867
|
-
children: [serializeArrowField(listField)]
|
|
7868
|
-
};
|
|
7869
|
-
case arrow.FixedSizeList:
|
|
7870
|
-
const fixedSizeList = arrowType;
|
|
7871
|
-
return {
|
|
7872
|
-
type: "fixed-size-list",
|
|
7873
|
-
listSize: fixedSizeList.listSize,
|
|
7874
|
-
children: [serializeArrowField(fixedSizeList.children[0])]
|
|
7875
|
-
};
|
|
7876
|
-
case arrow.Struct:
|
|
7877
|
-
const structType = arrowType;
|
|
7878
|
-
return {
|
|
7879
|
-
type: "struct",
|
|
7880
|
-
children: structType.children.map((arrowField) => serializeArrowField(arrowField))
|
|
7881
|
-
};
|
|
7882
|
-
case arrow.SparseUnion:
|
|
7883
|
-
case arrow.DenseUnion:
|
|
7884
|
-
const unionType = arrowType;
|
|
7885
|
-
return {
|
|
7886
|
-
type: unionType instanceof arrow.DenseUnion ? "dense-union" : "sparse-union",
|
|
7887
|
-
typeIds: unionType.typeIds,
|
|
7888
|
-
children: unionType.children.map((arrowField) => serializeArrowField(arrowField)),
|
|
7889
|
-
typeIdToChildIndex: { ...unionType.typeIdToChildIndex }
|
|
7890
|
-
};
|
|
7891
|
-
case arrow.Dictionary:
|
|
7892
|
-
const dictionaryType = arrowType;
|
|
7893
|
-
return {
|
|
7894
|
-
type: "dictionary",
|
|
7895
|
-
id: dictionaryType.id,
|
|
7896
|
-
indices: serializeArrowDictionaryKeyType(dictionaryType.indices),
|
|
7897
|
-
dictionary: serializeArrowType(dictionaryType.dictionary),
|
|
7898
|
-
isOrdered: dictionaryType.isOrdered
|
|
7899
|
-
};
|
|
7900
|
-
default:
|
|
7901
|
-
throw new Error(`arrow type not supported: ${arrowType.constructor.name}`);
|
|
7902
|
-
}
|
|
7903
|
-
}
|
|
7904
|
-
function deserializeArrowType(dataType, options) {
|
|
7905
|
-
if (typeof dataType === "object") {
|
|
7906
|
-
switch (dataType.type) {
|
|
7907
|
-
case "decimal":
|
|
7908
|
-
return new arrow.Decimal(dataType.scale, dataType.precision, dataType.bitWidth);
|
|
7909
|
-
case "map": {
|
|
7910
|
-
const children = dataType.children.map(
|
|
7911
|
-
(arrowField) => deserializeArrowField(arrowField, options)
|
|
7912
|
-
);
|
|
7913
|
-
return new arrow.Map_(children[0], dataType.keysSorted);
|
|
7914
|
-
}
|
|
7915
|
-
case "list": {
|
|
7916
|
-
const field = deserializeArrowField(dataType.children[0], options);
|
|
7917
|
-
return new arrow.List(field);
|
|
7918
|
-
}
|
|
7919
|
-
case "large-list": {
|
|
7920
|
-
const field = deserializeArrowField(dataType.children[0], options);
|
|
7921
|
-
const LargeList = getOptionalArrowConstructor("LargeList");
|
|
7922
|
-
if (!LargeList) {
|
|
7923
|
-
throw new Error(
|
|
7924
|
-
"LargeList requires an Apache Arrow runtime that exports the LargeList constructor"
|
|
7925
|
-
);
|
|
7926
|
-
}
|
|
7927
|
-
return new LargeList(field);
|
|
7928
|
-
}
|
|
7929
|
-
case "fixed-size-list": {
|
|
7930
|
-
const child = deserializeArrowField(dataType.children[0], options);
|
|
7931
|
-
return new arrow.FixedSizeList(dataType.listSize, child);
|
|
7932
|
-
}
|
|
7933
|
-
case "fixed-size-binary":
|
|
7934
|
-
return new arrow.FixedSizeBinary(dataType.byteWidth);
|
|
7935
|
-
case "struct": {
|
|
7936
|
-
const children = dataType.children.map(
|
|
7937
|
-
(arrowField) => deserializeArrowField(arrowField, options)
|
|
7938
|
-
);
|
|
7939
|
-
return new arrow.Struct(children);
|
|
7940
|
-
}
|
|
7941
|
-
case "sparse-union":
|
|
7942
|
-
case "dense-union": {
|
|
7943
|
-
const children = dataType.children.map(
|
|
7944
|
-
(arrowField) => deserializeArrowField(arrowField, options)
|
|
7945
|
-
);
|
|
7946
|
-
return dataType.type === "dense-union" ? new arrow.DenseUnion(dataType.typeIds, children) : new arrow.SparseUnion(dataType.typeIds, children);
|
|
7947
|
-
}
|
|
7948
|
-
case "dictionary": {
|
|
7949
|
-
return new arrow.Dictionary(
|
|
7950
|
-
deserializeArrowType(dataType.dictionary, options),
|
|
7951
|
-
deserializeArrowDictionaryKeyType(dataType.indices),
|
|
7952
|
-
dataType.id,
|
|
7953
|
-
dataType.isOrdered
|
|
7954
|
-
);
|
|
7955
|
-
}
|
|
7956
|
-
default:
|
|
7957
|
-
throw new Error("array type not supported");
|
|
7958
|
-
}
|
|
7959
|
-
}
|
|
7960
|
-
switch (dataType) {
|
|
7961
|
-
case "null":
|
|
7962
|
-
return new arrow.Null();
|
|
7963
|
-
case "binary":
|
|
7964
|
-
return makeVariableWidthArrowType("BinaryView", new arrow.Binary(), options);
|
|
7965
|
-
case "binary-view":
|
|
7966
|
-
return makeRequiredArrowViewType("BinaryView");
|
|
7967
|
-
case "bool":
|
|
7968
|
-
return new arrow.Bool();
|
|
7969
|
-
case "int8":
|
|
7970
|
-
return new arrow.Int8();
|
|
7971
|
-
case "int16":
|
|
7972
|
-
return new arrow.Int16();
|
|
7973
|
-
case "int32":
|
|
7974
|
-
return new arrow.Int32();
|
|
7975
|
-
case "int64":
|
|
7976
|
-
return new arrow.Int64();
|
|
7977
|
-
case "uint8":
|
|
7978
|
-
return new arrow.Uint8();
|
|
7979
|
-
case "uint16":
|
|
7980
|
-
return new arrow.Uint16();
|
|
7981
|
-
case "uint32":
|
|
7982
|
-
return new arrow.Uint32();
|
|
7983
|
-
case "uint64":
|
|
7984
|
-
return new arrow.Uint64();
|
|
7985
|
-
case "float16":
|
|
7986
|
-
return new arrow.Float16();
|
|
7987
|
-
case "float32":
|
|
7988
|
-
return new arrow.Float32();
|
|
7989
|
-
case "float64":
|
|
7990
|
-
return new arrow.Float64();
|
|
7991
|
-
case "utf8":
|
|
7992
|
-
return makeVariableWidthArrowType("Utf8View", new arrow.Utf8(), options);
|
|
7993
|
-
case "utf8-view":
|
|
7994
|
-
return makeRequiredArrowViewType("Utf8View");
|
|
7995
|
-
case "date-day":
|
|
7996
|
-
return new arrow.DateDay();
|
|
7997
|
-
case "date-millisecond":
|
|
7998
|
-
return new arrow.DateMillisecond();
|
|
7999
|
-
case "time-second":
|
|
8000
|
-
return new arrow.TimeSecond();
|
|
8001
|
-
case "time-millisecond":
|
|
8002
|
-
return new arrow.TimeMillisecond();
|
|
8003
|
-
case "time-microsecond":
|
|
8004
|
-
return new arrow.TimeMicrosecond();
|
|
8005
|
-
case "time-nanosecond":
|
|
8006
|
-
return new arrow.TimeNanosecond();
|
|
8007
|
-
case "timestamp-second":
|
|
8008
|
-
return new arrow.TimestampSecond();
|
|
8009
|
-
case "timestamp-millisecond":
|
|
8010
|
-
return new arrow.TimestampMillisecond();
|
|
8011
|
-
case "timestamp-microsecond":
|
|
8012
|
-
return new arrow.TimestampMicrosecond();
|
|
8013
|
-
case "timestamp-nanosecond":
|
|
8014
|
-
return new arrow.TimestampNanosecond();
|
|
8015
|
-
case "interval-daytime":
|
|
8016
|
-
return new arrow.IntervalDayTime();
|
|
8017
|
-
case "interval-yearmonth":
|
|
8018
|
-
return new arrow.IntervalYearMonth();
|
|
8019
|
-
default:
|
|
8020
|
-
throw new Error("array type not supported");
|
|
8021
|
-
}
|
|
8022
|
-
}
|
|
8023
|
-
function getOptionalArrowConstructor(typeName) {
|
|
8024
|
-
return arrow[typeName];
|
|
8025
|
-
}
|
|
8026
|
-
function isArrowViewType(arrowType, viewTypeName) {
|
|
8027
|
-
const constructor = getOptionalArrowConstructor(viewTypeName);
|
|
8028
|
-
if (constructor && arrowType instanceof constructor) {
|
|
8029
|
-
return true;
|
|
8030
|
-
}
|
|
8031
|
-
const guards = arrow.DataType;
|
|
8032
|
-
const guard = viewTypeName === "BinaryView" ? guards.isBinaryView : guards.isUtf8View;
|
|
8033
|
-
return Boolean(guard == null ? void 0 : guard(arrowType));
|
|
8034
|
-
}
|
|
8035
|
-
function isOptionalArrowType(arrowType, typeName) {
|
|
8036
|
-
const constructor = getOptionalArrowConstructor(typeName);
|
|
8037
|
-
return Boolean(constructor && arrowType instanceof constructor);
|
|
8038
|
-
}
|
|
8039
|
-
function makeVariableWidthArrowType(viewTypeName, fallbackType, options) {
|
|
8040
|
-
const viewTypeMode = (options == null ? void 0 : options.viewTypes) || "never";
|
|
8041
|
-
if (viewTypeMode === "never") {
|
|
8042
|
-
return fallbackType;
|
|
8043
|
-
}
|
|
8044
|
-
const constructor = getOptionalArrowConstructor(viewTypeName);
|
|
8045
|
-
if (constructor) {
|
|
8046
|
-
return new constructor();
|
|
8047
|
-
}
|
|
8048
|
-
if (viewTypeMode === "require") {
|
|
8049
|
-
throw new Error(
|
|
8050
|
-
`${viewTypeName} requires apache-arrow 21.2.0 or later; the installed runtime does not support it`
|
|
8051
|
-
);
|
|
8052
|
-
}
|
|
8053
|
-
return fallbackType;
|
|
8054
|
-
}
|
|
8055
|
-
function makeRequiredArrowViewType(viewTypeName) {
|
|
8056
|
-
const constructor = getOptionalArrowConstructor(viewTypeName);
|
|
8057
|
-
if (!constructor) {
|
|
8058
|
-
throw new Error(
|
|
8059
|
-
`${viewTypeName} requires apache-arrow 21.2.0 or later; the installed runtime does not support it`
|
|
8060
|
-
);
|
|
8061
|
-
}
|
|
8062
|
-
return new constructor();
|
|
8063
|
-
}
|
|
8064
|
-
function serializeArrowDictionaryKeyType(arrowType) {
|
|
8065
|
-
if (arrowType instanceof arrow.Int) {
|
|
8066
|
-
const prefix = arrowType.isSigned ? "int" : "uint";
|
|
8067
|
-
const keyType = `${prefix}${arrowType.bitWidth}`;
|
|
8068
|
-
if (isSchemaDictionaryKeyType(keyType)) {
|
|
8069
|
-
return keyType;
|
|
8070
|
-
}
|
|
8071
|
-
}
|
|
8072
|
-
switch (arrowType.constructor) {
|
|
8073
|
-
case arrow.Int8:
|
|
8074
|
-
return "int8";
|
|
8075
|
-
case arrow.Int16:
|
|
8076
|
-
return "int16";
|
|
8077
|
-
case arrow.Int32:
|
|
8078
|
-
return "int32";
|
|
8079
|
-
case arrow.Uint8:
|
|
8080
|
-
return "uint8";
|
|
8081
|
-
case arrow.Uint16:
|
|
8082
|
-
return "uint16";
|
|
8083
|
-
case arrow.Uint32:
|
|
8084
|
-
return "uint32";
|
|
8085
|
-
default:
|
|
8086
|
-
throw new Error(`arrow dictionary index type not supported: ${arrowType.constructor.name}`);
|
|
8087
|
-
}
|
|
8088
|
-
}
|
|
8089
|
-
function isSchemaDictionaryKeyType(keyType) {
|
|
8090
|
-
return ["int8", "int16", "int32", "uint8", "uint16", "uint32"].includes(keyType);
|
|
8091
|
-
}
|
|
8092
|
-
function deserializeArrowDictionaryKeyType(keyType) {
|
|
8093
|
-
switch (keyType) {
|
|
8094
|
-
case "int8":
|
|
8095
|
-
return new arrow.Int8();
|
|
8096
|
-
case "int16":
|
|
8097
|
-
return new arrow.Int16();
|
|
8098
|
-
case "int32":
|
|
8099
|
-
return new arrow.Int32();
|
|
8100
|
-
case "uint8":
|
|
8101
|
-
return new arrow.Uint8();
|
|
8102
|
-
case "uint16":
|
|
8103
|
-
return new arrow.Uint16();
|
|
8104
|
-
case "uint32":
|
|
8105
|
-
return new arrow.Uint32();
|
|
8106
|
-
default:
|
|
8107
|
-
throw new Error(`schema dictionary index type not supported: ${keyType}`);
|
|
8108
|
-
}
|
|
8109
|
-
}
|
|
8110
|
-
var arrow;
|
|
8111
|
-
var init_convert_arrow_schema = __esm({
|
|
8112
|
-
"../core/src/schema-utils/lib/schema/convert-arrow-schema.ts"() {
|
|
8113
|
-
"use strict";
|
|
8114
|
-
arrow = __toESM(require("apache-arrow"), 1);
|
|
8115
|
-
}
|
|
8116
|
-
});
|
|
8117
|
-
|
|
8118
|
-
// ../core/src/schema-utils/lib/arrow/split-arrow-buffers.ts
|
|
8119
|
-
function splitArrowBuffers(input, options = {}) {
|
|
8120
|
-
const context = { ...options, copies: /* @__PURE__ */ new WeakMap() };
|
|
8121
|
-
if (isArrowTable(input)) {
|
|
8122
|
-
return splitArrowTableBuffersInternal(input, context);
|
|
8123
|
-
}
|
|
8124
|
-
if (isArrowRecordBatch(input)) {
|
|
8125
|
-
return splitArrowRecordBatchBuffers(input, context);
|
|
8126
|
-
}
|
|
8127
|
-
if (isArrowVector(input)) {
|
|
8128
|
-
return splitArrowVectorBuffers(input, context);
|
|
8129
|
-
}
|
|
8130
|
-
return splitArrowDataBuffers(input, context);
|
|
8131
|
-
}
|
|
8132
|
-
function isArrowTable(input) {
|
|
8133
|
-
return "batches" in input;
|
|
8134
|
-
}
|
|
8135
|
-
function isArrowRecordBatch(input) {
|
|
8136
|
-
return "schema" in input && "data" in input && !Array.isArray(input.data);
|
|
8137
|
-
}
|
|
8138
|
-
function isArrowVector(input) {
|
|
8139
|
-
return "data" in input && Array.isArray(input.data);
|
|
8140
|
-
}
|
|
8141
|
-
function splitArrowTableBuffersInternal(table, options) {
|
|
8142
|
-
const recordBatches = table.batches.map(
|
|
8143
|
-
(recordBatch) => splitArrowRecordBatchBuffers(recordBatch, options)
|
|
8144
|
-
);
|
|
8145
|
-
return new arrow2.Table(table.schema, recordBatches);
|
|
8146
|
-
}
|
|
8147
|
-
function splitArrowRecordBatchBuffers(recordBatch, options) {
|
|
8148
|
-
return new arrow2.RecordBatch(
|
|
8149
|
-
recordBatch.schema,
|
|
8150
|
-
splitArrowDataBuffers(recordBatch.data, options)
|
|
8151
|
-
);
|
|
8152
|
-
}
|
|
8153
|
-
function splitArrowDataBuffers(data, options) {
|
|
8154
|
-
const children = data.children.map((childData) => splitArrowDataBuffers(childData, options));
|
|
8155
|
-
const dictionary = data.dictionary ? splitArrowVectorBuffers(data.dictionary, options) : void 0;
|
|
8156
|
-
const buffers = {
|
|
8157
|
-
[arrow2.BufferType.OFFSET]: splitArrowBuffer(data.buffers[arrow2.BufferType.OFFSET], options),
|
|
8158
|
-
[arrow2.BufferType.DATA]: splitArrowBuffer(data.buffers[arrow2.BufferType.DATA], options),
|
|
8159
|
-
[arrow2.BufferType.VALIDITY]: splitArrowBuffer(data.buffers[arrow2.BufferType.VALIDITY], options),
|
|
8160
|
-
[arrow2.BufferType.TYPE]: splitArrowBuffer(data.buffers[arrow2.BufferType.TYPE], options)
|
|
8161
|
-
};
|
|
8162
|
-
return new arrow2.Data(
|
|
8163
|
-
data.type,
|
|
8164
|
-
data.offset,
|
|
8165
|
-
data.length,
|
|
8166
|
-
// @ts-expect-error _nullCount is protected. Reuse it to preserve lazy null-count state.
|
|
8167
|
-
data._nullCount,
|
|
8168
|
-
buffers,
|
|
8169
|
-
children,
|
|
8170
|
-
dictionary
|
|
8171
|
-
);
|
|
8172
|
-
}
|
|
8173
|
-
function splitArrowVectorBuffers(vector, options) {
|
|
8174
|
-
return new arrow2.Vector(vector.data.map((data) => splitArrowDataBuffers(data, options)));
|
|
8175
|
-
}
|
|
8176
|
-
function splitArrowBuffer(array, options) {
|
|
8177
|
-
if (!isArrowTypedArray(array)) {
|
|
8178
|
-
return array;
|
|
8179
|
-
}
|
|
8180
|
-
if (options.copy === "none") {
|
|
8181
|
-
return array;
|
|
8182
|
-
}
|
|
8183
|
-
if (options.copy !== "all" && array.byteOffset === 0 && array.byteLength === array.buffer.byteLength) {
|
|
8184
|
-
return array;
|
|
8185
|
-
}
|
|
8186
|
-
let copy = options.copies.get(array);
|
|
8187
|
-
if (!copy) {
|
|
8188
|
-
copy = array.slice();
|
|
8189
|
-
options.copies.set(array, copy);
|
|
8190
|
-
}
|
|
8191
|
-
return copy;
|
|
8192
|
-
}
|
|
8193
|
-
function isArrowTypedArray(value) {
|
|
8194
|
-
return ArrayBuffer.isView(value) && !(value instanceof DataView);
|
|
8195
|
-
}
|
|
8196
|
-
var arrow2;
|
|
8197
|
-
var init_split_arrow_buffers = __esm({
|
|
8198
|
-
"../core/src/schema-utils/lib/arrow/split-arrow-buffers.ts"() {
|
|
8199
|
-
"use strict";
|
|
8200
|
-
arrow2 = __toESM(require("apache-arrow"), 1);
|
|
8201
|
-
}
|
|
8202
|
-
});
|
|
8203
|
-
|
|
8204
|
-
// ../core/src/schema-utils/lib/arrow/arrow-table-transport.ts
|
|
8205
|
-
function dehydrateArrowTable(table, options) {
|
|
8206
|
-
const splitTable = splitArrowBuffers(table, options);
|
|
8207
|
-
return {
|
|
8208
|
-
shape: "arrow-table",
|
|
8209
|
-
transport: "arrow-js",
|
|
8210
|
-
schema: serializeArrowSchema(splitTable.schema),
|
|
8211
|
-
batches: splitTable.batches.map((recordBatch) => dehydrateArrowRecordBatch(recordBatch))
|
|
8212
|
-
};
|
|
8213
|
-
}
|
|
8214
|
-
function hydrateArrowTable(table) {
|
|
8215
|
-
const schema = deserializeArrowSchema(table.schema);
|
|
8216
|
-
const recordBatches = table.batches.map(
|
|
8217
|
-
(recordBatch) => new arrow3.RecordBatch(schema, hydrateArrowData(recordBatch.data))
|
|
8218
|
-
);
|
|
8219
|
-
return new arrow3.Table(schema, recordBatches);
|
|
8220
|
-
}
|
|
8221
|
-
function serializeArrowWorkerResult(result, options) {
|
|
8222
|
-
var _a;
|
|
8223
|
-
if (!isArrowTableWrapper(result)) {
|
|
8224
|
-
return result;
|
|
8225
|
-
}
|
|
8226
|
-
const workerOptions = options;
|
|
8227
|
-
const bufferCopyMode = ((_a = workerOptions == null ? void 0 : workerOptions.core) == null ? void 0 : _a.workerTransferBufferCopy) ?? (workerOptions == null ? void 0 : workerOptions.workerTransferBufferCopy);
|
|
8228
|
-
return {
|
|
8229
|
-
...result,
|
|
8230
|
-
data: dehydrateArrowTable(result.data, bufferCopyMode ? { copy: bufferCopyMode } : void 0)
|
|
8231
|
-
};
|
|
8232
|
-
}
|
|
8233
|
-
function deserializeArrowWorkerResult(result) {
|
|
8234
|
-
if (!isDehydratedArrowTableWrapper(result)) {
|
|
8235
|
-
return result;
|
|
8236
|
-
}
|
|
8237
|
-
return { ...result, data: hydrateArrowTable(result.data) };
|
|
8238
|
-
}
|
|
8239
|
-
function isArrowTableWrapper(value) {
|
|
8240
|
-
const table = value;
|
|
8241
|
-
return Boolean(
|
|
8242
|
-
table && table.shape === "arrow-table" && table.data && typeof table.data === "object" && "batches" in table.data
|
|
8243
|
-
);
|
|
8244
|
-
}
|
|
8245
|
-
function isDehydratedArrowTableWrapper(value) {
|
|
8246
|
-
const table = value;
|
|
8247
|
-
return Boolean(
|
|
8248
|
-
table && table.shape === "arrow-table" && table.data && table.data.transport === "arrow-js" && Array.isArray(table.data.batches)
|
|
8249
|
-
);
|
|
8250
|
-
}
|
|
8251
|
-
function dehydrateArrowRecordBatch(recordBatch) {
|
|
8252
|
-
return { data: dehydrateArrowData(recordBatch.data) };
|
|
8253
|
-
}
|
|
8254
|
-
function dehydrateArrowData(data) {
|
|
8255
|
-
return {
|
|
8256
|
-
type: serializeArrowType(data.type),
|
|
8257
|
-
offset: data.offset,
|
|
8258
|
-
length: data.length,
|
|
8259
|
-
// @ts-expect-error _nullCount is protected. Preserve the Arrow lazy null-count state.
|
|
8260
|
-
nullCount: data._nullCount,
|
|
8261
|
-
buffers: {
|
|
8262
|
-
[arrow3.BufferType.OFFSET]: data.buffers[arrow3.BufferType.OFFSET],
|
|
8263
|
-
[arrow3.BufferType.DATA]: data.buffers[arrow3.BufferType.DATA],
|
|
8264
|
-
[arrow3.BufferType.VALIDITY]: data.buffers[arrow3.BufferType.VALIDITY],
|
|
8265
|
-
[arrow3.BufferType.TYPE]: data.buffers[arrow3.BufferType.TYPE]
|
|
8266
|
-
},
|
|
8267
|
-
children: data.children.map((childData) => dehydrateArrowData(childData)),
|
|
8268
|
-
dictionary: data.dictionary ? dehydrateArrowVector(data.dictionary) : void 0
|
|
8269
|
-
};
|
|
8270
|
-
}
|
|
8271
|
-
function dehydrateArrowVector(vector) {
|
|
8272
|
-
return { data: vector.data.map((data) => dehydrateArrowData(data)) };
|
|
8273
|
-
}
|
|
8274
|
-
function hydrateArrowData(data) {
|
|
8275
|
-
const children = data.children.map((childData) => hydrateArrowData(childData));
|
|
8276
|
-
const dictionary = data.dictionary ? hydrateArrowVector(data.dictionary) : void 0;
|
|
8277
|
-
return new arrow3.Data(
|
|
8278
|
-
deserializeArrowType(data.type),
|
|
8279
|
-
data.offset,
|
|
8280
|
-
data.length,
|
|
8281
|
-
data.nullCount,
|
|
8282
|
-
data.buffers,
|
|
8283
|
-
children,
|
|
8284
|
-
dictionary
|
|
8285
|
-
);
|
|
8286
|
-
}
|
|
8287
|
-
function hydrateArrowVector(vector) {
|
|
8288
|
-
return new arrow3.Vector(vector.data.map((data) => hydrateArrowData(data)));
|
|
8289
|
-
}
|
|
8290
|
-
var arrow3;
|
|
8291
|
-
var init_arrow_table_transport = __esm({
|
|
8292
|
-
"../core/src/schema-utils/lib/arrow/arrow-table-transport.ts"() {
|
|
8293
|
-
"use strict";
|
|
8294
|
-
arrow3 = __toESM(require("apache-arrow"), 1);
|
|
8295
|
-
init_convert_arrow_schema();
|
|
8296
|
-
init_split_arrow_buffers();
|
|
8297
|
-
}
|
|
8298
|
-
});
|
|
8299
|
-
|
|
8300
|
-
// ../core/src/schema-utils/arrow-transport.ts
|
|
8301
|
-
var init_arrow_transport = __esm({
|
|
8302
|
-
"../core/src/schema-utils/arrow-transport.ts"() {
|
|
8303
|
-
"use strict";
|
|
8304
|
-
init_arrow_table_transport();
|
|
8305
|
-
init_split_arrow_buffers();
|
|
8306
|
-
}
|
|
8307
|
-
});
|
|
8308
|
-
|
|
8309
|
-
// ../scene/src/draco/lib/utils/version.ts
|
|
8310
|
-
var VERSION4;
|
|
8311
|
-
var init_version4 = __esm({
|
|
8312
|
-
"../scene/src/draco/lib/utils/version.ts"() {
|
|
8313
|
-
"use strict";
|
|
8314
|
-
VERSION4 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
8315
|
-
}
|
|
8316
|
-
});
|
|
8317
|
-
|
|
8318
|
-
// ../scene/src/draco/draco-format.ts
|
|
8319
|
-
var DracoFormat;
|
|
8320
|
-
var init_draco_format = __esm({
|
|
8321
|
-
"../scene/src/draco/draco-format.ts"() {
|
|
8322
|
-
"use strict";
|
|
8323
|
-
DracoFormat = {
|
|
8324
|
-
name: "Draco",
|
|
8325
|
-
id: "draco",
|
|
8326
|
-
module: "scene",
|
|
8327
|
-
encoding: "binary",
|
|
8328
|
-
format: "draco",
|
|
8329
|
-
extensions: ["drc"],
|
|
8330
|
-
mimeTypes: ["application/octet-stream"],
|
|
8331
|
-
binary: true,
|
|
8332
|
-
tests: ["DRACO"]
|
|
8333
|
-
};
|
|
8334
|
-
}
|
|
8335
|
-
});
|
|
8336
|
-
|
|
8337
|
-
// ../scene/src/draco/draco-loader-options.ts
|
|
8338
|
-
var DRACO_LOADER_DEFAULT_OPTIONS;
|
|
8339
|
-
var init_draco_loader_options = __esm({
|
|
8340
|
-
"../scene/src/draco/draco-loader-options.ts"() {
|
|
8341
|
-
"use strict";
|
|
8342
|
-
DRACO_LOADER_DEFAULT_OPTIONS = {
|
|
8343
|
-
backend: typeof WebAssembly === "object" ? "wasm" : "javascript",
|
|
8344
|
-
extraAttributes: {},
|
|
8345
|
-
attributeNameEntry: void 0,
|
|
8346
|
-
shape: "arrow-table",
|
|
8347
|
-
decoderProfile: "full"
|
|
8348
|
-
};
|
|
8349
|
-
}
|
|
8350
|
-
});
|
|
8351
|
-
|
|
8352
|
-
// ../scene/src/draco/lib/draco-library-loader.ts
|
|
8353
|
-
async function loadLibrary2(libraryUrl, moduleName = null, options = {}, libraryName = null, moduleLibraryName = null) {
|
|
8354
|
-
var _a;
|
|
8355
|
-
if (isBrowser2 && options.useLocalLibraries && !options.CDN && libraryName && ((_a = options.modules) == null ? void 0 : _a[libraryName]) === void 0) {
|
|
8356
|
-
const directory = isWorker ? "./libs" : `modules/${moduleName}/dist/libs`;
|
|
8357
|
-
options = {
|
|
8358
|
-
...options,
|
|
8359
|
-
modules: {
|
|
8360
|
-
[libraryName]: `${directory}/${libraryName}`,
|
|
8361
|
-
...moduleLibraryName ? { [moduleLibraryName]: `${directory}/${moduleLibraryName}` } : {},
|
|
8362
|
-
...options.modules
|
|
7866
|
+
});
|
|
7867
|
+
|
|
7868
|
+
// ../scene/src/draco/draco-loader-options.ts
|
|
7869
|
+
var DRACO_LOADER_DEFAULT_OPTIONS;
|
|
7870
|
+
var init_draco_loader_options = __esm({
|
|
7871
|
+
"../scene/src/draco/draco-loader-options.ts"() {
|
|
7872
|
+
"use strict";
|
|
7873
|
+
DRACO_LOADER_DEFAULT_OPTIONS = {
|
|
7874
|
+
backend: typeof WebAssembly === "object" ? "wasm" : "javascript",
|
|
7875
|
+
extraAttributes: {},
|
|
7876
|
+
attributeNameEntry: void 0,
|
|
7877
|
+
shape: "arrow-table",
|
|
7878
|
+
decoderProfile: "full"
|
|
7879
|
+
};
|
|
7880
|
+
}
|
|
7881
|
+
});
|
|
7882
|
+
|
|
7883
|
+
// ../scene/src/draco/lib/draco-library-loader.ts
|
|
7884
|
+
async function loadLibrary2(libraryUrl, moduleName = null, options = {}, libraryName = null, moduleLibraryName = null) {
|
|
7885
|
+
var _a;
|
|
7886
|
+
if (isBrowser2 && options.useLocalLibraries && !options.CDN && libraryName && ((_a = options.modules) == null ? void 0 : _a[libraryName]) === void 0) {
|
|
7887
|
+
const directory = isWorker ? "./libs" : `modules/${moduleName}/dist/libs`;
|
|
7888
|
+
options = {
|
|
7889
|
+
...options,
|
|
7890
|
+
modules: {
|
|
7891
|
+
[libraryName]: `${directory}/${libraryName}`,
|
|
7892
|
+
...moduleLibraryName ? { [moduleLibraryName]: `${directory}/${moduleLibraryName}` } : {},
|
|
7893
|
+
...options.modules
|
|
8363
7894
|
}
|
|
8364
7895
|
};
|
|
8365
7896
|
}
|
|
@@ -8542,122 +8073,552 @@ function initializeDracoModule(initializer, wasmBinary) {
|
|
|
8542
8073
|
(draco) => ({ draco })
|
|
8543
8074
|
);
|
|
8544
8075
|
}
|
|
8545
|
-
function getLibraryExport(library, exportName) {
|
|
8546
|
-
if (typeof library === "function") {
|
|
8547
|
-
return library;
|
|
8076
|
+
function getLibraryExport(library, exportName) {
|
|
8077
|
+
if (typeof library === "function") {
|
|
8078
|
+
return library;
|
|
8079
|
+
}
|
|
8080
|
+
if (library && typeof library === "object") {
|
|
8081
|
+
const exports = library;
|
|
8082
|
+
const exportedInitializer = exports[exportName] || exports.default;
|
|
8083
|
+
return typeof exportedInitializer === "function" ? exportedInitializer : void 0;
|
|
8084
|
+
}
|
|
8085
|
+
return void 0;
|
|
8086
|
+
}
|
|
8087
|
+
function getInjectedDraco3DModule(options) {
|
|
8088
|
+
var _a;
|
|
8089
|
+
const module2 = (_a = options.modules) == null ? void 0 : _a.draco3d;
|
|
8090
|
+
if (!module2) {
|
|
8091
|
+
return void 0;
|
|
8092
|
+
}
|
|
8093
|
+
if (typeof module2 !== "object" && typeof module2 !== "function") {
|
|
8094
|
+
throw new Error("Invalid draco3d module");
|
|
8095
|
+
}
|
|
8096
|
+
return module2;
|
|
8097
|
+
}
|
|
8098
|
+
function validateDracoDecoderModule(module2) {
|
|
8099
|
+
const typedModule = module2;
|
|
8100
|
+
if (typeof (typedModule == null ? void 0 : typedModule.createDecoderModule) !== "function") {
|
|
8101
|
+
throw new Error("Invalid draco3d decoder module");
|
|
8102
|
+
}
|
|
8103
|
+
return typedModule;
|
|
8104
|
+
}
|
|
8105
|
+
function getLibraryCacheKey2(type, options) {
|
|
8106
|
+
const libraryOverrides = Object.entries(options.modules || {}).filter(([name22]) => name22 !== "draco3d").map(([name22, value]) => `${name22}:${String(value)}`).sort().join("|");
|
|
8107
|
+
return [
|
|
8108
|
+
type,
|
|
8109
|
+
options.useLocalLibraries ? "local" : "remote",
|
|
8110
|
+
options.CDN || "",
|
|
8111
|
+
libraryOverrides
|
|
8112
|
+
].join("|");
|
|
8113
|
+
}
|
|
8114
|
+
var libraryDecoderPromises, injectedDecoderPromises, decoderInitializationQueue;
|
|
8115
|
+
var init_draco_module_loader = __esm({
|
|
8116
|
+
"../scene/src/draco/lib/draco-module-loader.ts"() {
|
|
8117
|
+
"use strict";
|
|
8118
|
+
init_loader_utils();
|
|
8119
|
+
init_draco_library_loader();
|
|
8120
|
+
init_draco_libraries();
|
|
8121
|
+
libraryDecoderPromises = /* @__PURE__ */ new Map();
|
|
8122
|
+
injectedDecoderPromises = /* @__PURE__ */ new WeakMap();
|
|
8123
|
+
decoderInitializationQueue = Promise.resolve();
|
|
8124
|
+
}
|
|
8125
|
+
});
|
|
8126
|
+
|
|
8127
|
+
// ../core/src/schema-utils/lib/schema/data-type.ts
|
|
8128
|
+
function getDataTypeFromValue(value, defaultNumberType = "float32") {
|
|
8129
|
+
if (value instanceof Date) {
|
|
8130
|
+
return "date-millisecond";
|
|
8131
|
+
}
|
|
8132
|
+
if (typeof value === "number") {
|
|
8133
|
+
return defaultNumberType;
|
|
8134
|
+
}
|
|
8135
|
+
if (typeof value === "boolean") {
|
|
8136
|
+
return "bool";
|
|
8137
|
+
}
|
|
8138
|
+
if (typeof value === "string") {
|
|
8139
|
+
return "utf8";
|
|
8140
|
+
}
|
|
8141
|
+
if (value === null || value === "undefined") {
|
|
8142
|
+
return "null";
|
|
8143
|
+
}
|
|
8144
|
+
return "null";
|
|
8145
|
+
}
|
|
8146
|
+
function getDataTypeFromArray(array) {
|
|
8147
|
+
let type = getDataTypeFromTypedArray(array);
|
|
8148
|
+
if (type !== "null") {
|
|
8149
|
+
return { type, nullable: false };
|
|
8150
|
+
}
|
|
8151
|
+
if (array.length > 0) {
|
|
8152
|
+
type = getDataTypeFromValue(array[0]);
|
|
8153
|
+
return { type, nullable: true };
|
|
8154
|
+
}
|
|
8155
|
+
return { type: "null", nullable: true };
|
|
8156
|
+
}
|
|
8157
|
+
function getDataTypeFromTypedArray(array) {
|
|
8158
|
+
if (typeof Float16Array !== "undefined" && array instanceof Float16Array) {
|
|
8159
|
+
return "float16";
|
|
8160
|
+
}
|
|
8161
|
+
switch (array.constructor) {
|
|
8162
|
+
case Int8Array:
|
|
8163
|
+
return "int8";
|
|
8164
|
+
case Uint8Array:
|
|
8165
|
+
case Uint8ClampedArray:
|
|
8166
|
+
return "uint8";
|
|
8167
|
+
case Int16Array:
|
|
8168
|
+
return "int16";
|
|
8169
|
+
case Uint16Array:
|
|
8170
|
+
return "uint16";
|
|
8171
|
+
case Int32Array:
|
|
8172
|
+
return "int32";
|
|
8173
|
+
case Uint32Array:
|
|
8174
|
+
return "uint32";
|
|
8175
|
+
case BigInt64Array:
|
|
8176
|
+
return "int64";
|
|
8177
|
+
case BigUint64Array:
|
|
8178
|
+
return "uint64";
|
|
8179
|
+
case Float32Array:
|
|
8180
|
+
return "float32";
|
|
8181
|
+
case Float64Array:
|
|
8182
|
+
return "float64";
|
|
8183
|
+
default:
|
|
8184
|
+
return "null";
|
|
8185
|
+
}
|
|
8186
|
+
}
|
|
8187
|
+
var import_core;
|
|
8188
|
+
var init_data_type = __esm({
|
|
8189
|
+
"../core/src/schema-utils/lib/schema/data-type.ts"() {
|
|
8190
|
+
"use strict";
|
|
8191
|
+
import_core = require("@math.gl/core");
|
|
8192
|
+
}
|
|
8193
|
+
});
|
|
8194
|
+
|
|
8195
|
+
// ../core/src/schema-utils/lib/schema/convert-arrow-schema.ts
|
|
8196
|
+
function serializeArrowSchema(arrowSchema) {
|
|
8197
|
+
return {
|
|
8198
|
+
fields: arrowSchema.fields.map((arrowField) => serializeArrowField(arrowField)),
|
|
8199
|
+
metadata: serializeArrowMetadata(arrowSchema.metadata)
|
|
8200
|
+
};
|
|
8201
|
+
}
|
|
8202
|
+
function serializeArrowMetadata(arrowMetadata) {
|
|
8203
|
+
return Object.fromEntries(arrowMetadata);
|
|
8204
|
+
}
|
|
8205
|
+
function deserializeArrowMetadata(metadata) {
|
|
8206
|
+
return metadata ? new Map(Object.entries(metadata)) : /* @__PURE__ */ new Map();
|
|
8207
|
+
}
|
|
8208
|
+
function serializeArrowField(field) {
|
|
8209
|
+
return {
|
|
8210
|
+
name: field.name,
|
|
8211
|
+
type: serializeArrowType(field.type),
|
|
8212
|
+
nullable: field.nullable,
|
|
8213
|
+
metadata: serializeArrowMetadata(field.metadata)
|
|
8214
|
+
};
|
|
8215
|
+
}
|
|
8216
|
+
function deserializeArrowField(field, options) {
|
|
8217
|
+
return new arrow.Field(
|
|
8218
|
+
field.name,
|
|
8219
|
+
deserializeArrowType(field.type, options),
|
|
8220
|
+
field.nullable,
|
|
8221
|
+
deserializeArrowMetadata(field.metadata)
|
|
8222
|
+
);
|
|
8223
|
+
}
|
|
8224
|
+
function serializeArrowType(arrowType) {
|
|
8225
|
+
if (isArrowViewType(arrowType, "BinaryView")) {
|
|
8226
|
+
return "binary-view";
|
|
8548
8227
|
}
|
|
8549
|
-
if (
|
|
8550
|
-
|
|
8551
|
-
|
|
8552
|
-
|
|
8228
|
+
if (isArrowViewType(arrowType, "Utf8View")) {
|
|
8229
|
+
return "utf8-view";
|
|
8230
|
+
}
|
|
8231
|
+
if (isOptionalArrowType(arrowType, "LargeList")) {
|
|
8232
|
+
const largeListType = arrowType;
|
|
8233
|
+
return {
|
|
8234
|
+
type: "large-list",
|
|
8235
|
+
children: [serializeArrowField(largeListType.valueField)]
|
|
8236
|
+
};
|
|
8237
|
+
}
|
|
8238
|
+
switch (arrowType.constructor) {
|
|
8239
|
+
case arrow.Null:
|
|
8240
|
+
return "null";
|
|
8241
|
+
case arrow.Binary:
|
|
8242
|
+
return "binary";
|
|
8243
|
+
case arrow.FixedSizeBinary:
|
|
8244
|
+
return {
|
|
8245
|
+
type: "fixed-size-binary",
|
|
8246
|
+
byteWidth: arrowType.byteWidth
|
|
8247
|
+
};
|
|
8248
|
+
case arrow.Bool:
|
|
8249
|
+
return "bool";
|
|
8250
|
+
case arrow.Int:
|
|
8251
|
+
const intType = arrowType;
|
|
8252
|
+
return `${intType.isSigned ? "" : "u"}int${intType.bitWidth}`;
|
|
8253
|
+
case arrow.Int8:
|
|
8254
|
+
return "int8";
|
|
8255
|
+
case arrow.Int16:
|
|
8256
|
+
return "int16";
|
|
8257
|
+
case arrow.Int32:
|
|
8258
|
+
return "int32";
|
|
8259
|
+
case arrow.Int64:
|
|
8260
|
+
return "int64";
|
|
8261
|
+
case arrow.Uint8:
|
|
8262
|
+
return "uint8";
|
|
8263
|
+
case arrow.Uint16:
|
|
8264
|
+
return "uint16";
|
|
8265
|
+
case arrow.Uint32:
|
|
8266
|
+
return "uint32";
|
|
8267
|
+
case arrow.Uint64:
|
|
8268
|
+
return "uint64";
|
|
8269
|
+
case arrow.Float:
|
|
8270
|
+
const precision = arrowType.precision;
|
|
8271
|
+
switch (precision) {
|
|
8272
|
+
case arrow.Precision.HALF:
|
|
8273
|
+
return "float16";
|
|
8274
|
+
case arrow.Precision.SINGLE:
|
|
8275
|
+
return "float32";
|
|
8276
|
+
case arrow.Precision.DOUBLE:
|
|
8277
|
+
return "float64";
|
|
8278
|
+
default:
|
|
8279
|
+
return "float16";
|
|
8280
|
+
}
|
|
8281
|
+
case arrow.Float16:
|
|
8282
|
+
return "float16";
|
|
8283
|
+
case arrow.Float32:
|
|
8284
|
+
return "float32";
|
|
8285
|
+
case arrow.Float64:
|
|
8286
|
+
return "float64";
|
|
8287
|
+
case arrow.Utf8:
|
|
8288
|
+
return "utf8";
|
|
8289
|
+
case arrow.Decimal:
|
|
8290
|
+
const decimal = arrowType;
|
|
8291
|
+
return {
|
|
8292
|
+
type: "decimal",
|
|
8293
|
+
bitWidth: decimal.bitWidth,
|
|
8294
|
+
precision: decimal.precision,
|
|
8295
|
+
scale: decimal.scale
|
|
8296
|
+
};
|
|
8297
|
+
case arrow.Date_:
|
|
8298
|
+
const dateUnit = arrowType.unit;
|
|
8299
|
+
return dateUnit === arrow.DateUnit.DAY ? "date-day" : "date-millisecond";
|
|
8300
|
+
case arrow.DateDay:
|
|
8301
|
+
return "date-day";
|
|
8302
|
+
case arrow.DateMillisecond:
|
|
8303
|
+
return "date-millisecond";
|
|
8304
|
+
case arrow.Time:
|
|
8305
|
+
const timeUnit = arrowType.unit;
|
|
8306
|
+
switch (timeUnit) {
|
|
8307
|
+
case arrow.TimeUnit.SECOND:
|
|
8308
|
+
return "time-second";
|
|
8309
|
+
case arrow.TimeUnit.MILLISECOND:
|
|
8310
|
+
return "time-millisecond";
|
|
8311
|
+
case arrow.TimeUnit.MICROSECOND:
|
|
8312
|
+
return "time-microsecond";
|
|
8313
|
+
case arrow.TimeUnit.NANOSECOND:
|
|
8314
|
+
return "time-nanosecond";
|
|
8315
|
+
default:
|
|
8316
|
+
return "time-second";
|
|
8317
|
+
}
|
|
8318
|
+
case arrow.TimeMillisecond:
|
|
8319
|
+
return "time-millisecond";
|
|
8320
|
+
case arrow.TimeSecond:
|
|
8321
|
+
return "time-second";
|
|
8322
|
+
case arrow.TimeMicrosecond:
|
|
8323
|
+
return "time-microsecond";
|
|
8324
|
+
case arrow.TimeNanosecond:
|
|
8325
|
+
return "time-nanosecond";
|
|
8326
|
+
case arrow.Timestamp:
|
|
8327
|
+
const timeStampUnit = arrowType.unit;
|
|
8328
|
+
switch (timeStampUnit) {
|
|
8329
|
+
case arrow.TimeUnit.SECOND:
|
|
8330
|
+
return "timestamp-second";
|
|
8331
|
+
case arrow.TimeUnit.MILLISECOND:
|
|
8332
|
+
return "timestamp-millisecond";
|
|
8333
|
+
case arrow.TimeUnit.MICROSECOND:
|
|
8334
|
+
return "timestamp-microsecond";
|
|
8335
|
+
case arrow.TimeUnit.NANOSECOND:
|
|
8336
|
+
return "timestamp-nanosecond";
|
|
8337
|
+
default:
|
|
8338
|
+
return "timestamp-second";
|
|
8339
|
+
}
|
|
8340
|
+
case arrow.TimestampSecond:
|
|
8341
|
+
return "timestamp-second";
|
|
8342
|
+
case arrow.TimestampMillisecond:
|
|
8343
|
+
return "timestamp-millisecond";
|
|
8344
|
+
case arrow.TimestampMicrosecond:
|
|
8345
|
+
return "timestamp-microsecond";
|
|
8346
|
+
case arrow.TimestampNanosecond:
|
|
8347
|
+
return "timestamp-nanosecond";
|
|
8348
|
+
case arrow.Interval:
|
|
8349
|
+
const intervalUnit = arrowType.unit;
|
|
8350
|
+
switch (intervalUnit) {
|
|
8351
|
+
case arrow.IntervalUnit.DAY_TIME:
|
|
8352
|
+
return "interval-daytime";
|
|
8353
|
+
case arrow.IntervalUnit.YEAR_MONTH:
|
|
8354
|
+
return "interval-yearmonth";
|
|
8355
|
+
default:
|
|
8356
|
+
return "interval-daytime";
|
|
8357
|
+
}
|
|
8358
|
+
case arrow.IntervalDayTime:
|
|
8359
|
+
return "interval-daytime";
|
|
8360
|
+
case arrow.IntervalYearMonth:
|
|
8361
|
+
return "interval-yearmonth";
|
|
8362
|
+
case arrow.Map_:
|
|
8363
|
+
const mapType = arrowType;
|
|
8364
|
+
return {
|
|
8365
|
+
type: "map",
|
|
8366
|
+
keysSorted: mapType.keysSorted,
|
|
8367
|
+
children: mapType.children.map((arrowField) => serializeArrowField(arrowField))
|
|
8368
|
+
};
|
|
8369
|
+
case arrow.List:
|
|
8370
|
+
const listType = arrowType;
|
|
8371
|
+
const listField = listType.valueField;
|
|
8372
|
+
return {
|
|
8373
|
+
type: "list",
|
|
8374
|
+
children: [serializeArrowField(listField)]
|
|
8375
|
+
};
|
|
8376
|
+
case arrow.FixedSizeList:
|
|
8377
|
+
const fixedSizeList = arrowType;
|
|
8378
|
+
return {
|
|
8379
|
+
type: "fixed-size-list",
|
|
8380
|
+
listSize: fixedSizeList.listSize,
|
|
8381
|
+
children: [serializeArrowField(fixedSizeList.children[0])]
|
|
8382
|
+
};
|
|
8383
|
+
case arrow.Struct:
|
|
8384
|
+
const structType = arrowType;
|
|
8385
|
+
return {
|
|
8386
|
+
type: "struct",
|
|
8387
|
+
children: structType.children.map((arrowField) => serializeArrowField(arrowField))
|
|
8388
|
+
};
|
|
8389
|
+
case arrow.SparseUnion:
|
|
8390
|
+
case arrow.DenseUnion:
|
|
8391
|
+
const unionType = arrowType;
|
|
8392
|
+
return {
|
|
8393
|
+
type: unionType instanceof arrow.DenseUnion ? "dense-union" : "sparse-union",
|
|
8394
|
+
typeIds: unionType.typeIds,
|
|
8395
|
+
children: unionType.children.map((arrowField) => serializeArrowField(arrowField)),
|
|
8396
|
+
typeIdToChildIndex: { ...unionType.typeIdToChildIndex }
|
|
8397
|
+
};
|
|
8398
|
+
case arrow.Dictionary:
|
|
8399
|
+
const dictionaryType = arrowType;
|
|
8400
|
+
return {
|
|
8401
|
+
type: "dictionary",
|
|
8402
|
+
id: dictionaryType.id,
|
|
8403
|
+
indices: serializeArrowDictionaryKeyType(dictionaryType.indices),
|
|
8404
|
+
dictionary: serializeArrowType(dictionaryType.dictionary),
|
|
8405
|
+
isOrdered: dictionaryType.isOrdered
|
|
8406
|
+
};
|
|
8407
|
+
default:
|
|
8408
|
+
throw new Error(`arrow type not supported: ${arrowType.constructor.name}`);
|
|
8553
8409
|
}
|
|
8554
|
-
return void 0;
|
|
8555
8410
|
}
|
|
8556
|
-
function
|
|
8557
|
-
|
|
8558
|
-
|
|
8559
|
-
|
|
8560
|
-
|
|
8411
|
+
function deserializeArrowType(dataType, options) {
|
|
8412
|
+
if (typeof dataType === "object") {
|
|
8413
|
+
switch (dataType.type) {
|
|
8414
|
+
case "decimal":
|
|
8415
|
+
return new arrow.Decimal(dataType.scale, dataType.precision, dataType.bitWidth);
|
|
8416
|
+
case "map": {
|
|
8417
|
+
const children = dataType.children.map(
|
|
8418
|
+
(arrowField) => deserializeArrowField(arrowField, options)
|
|
8419
|
+
);
|
|
8420
|
+
return new arrow.Map_(children[0], dataType.keysSorted);
|
|
8421
|
+
}
|
|
8422
|
+
case "list": {
|
|
8423
|
+
const field = deserializeArrowField(dataType.children[0], options);
|
|
8424
|
+
return new arrow.List(field);
|
|
8425
|
+
}
|
|
8426
|
+
case "large-list": {
|
|
8427
|
+
const field = deserializeArrowField(dataType.children[0], options);
|
|
8428
|
+
const LargeList = getOptionalArrowConstructor("LargeList");
|
|
8429
|
+
if (!LargeList) {
|
|
8430
|
+
throw new Error(
|
|
8431
|
+
"LargeList requires an Apache Arrow runtime that exports the LargeList constructor"
|
|
8432
|
+
);
|
|
8433
|
+
}
|
|
8434
|
+
return new LargeList(field);
|
|
8435
|
+
}
|
|
8436
|
+
case "fixed-size-list": {
|
|
8437
|
+
const child = deserializeArrowField(dataType.children[0], options);
|
|
8438
|
+
return new arrow.FixedSizeList(dataType.listSize, child);
|
|
8439
|
+
}
|
|
8440
|
+
case "fixed-size-binary":
|
|
8441
|
+
return new arrow.FixedSizeBinary(dataType.byteWidth);
|
|
8442
|
+
case "struct": {
|
|
8443
|
+
const children = dataType.children.map(
|
|
8444
|
+
(arrowField) => deserializeArrowField(arrowField, options)
|
|
8445
|
+
);
|
|
8446
|
+
return new arrow.Struct(children);
|
|
8447
|
+
}
|
|
8448
|
+
case "sparse-union":
|
|
8449
|
+
case "dense-union": {
|
|
8450
|
+
const children = dataType.children.map(
|
|
8451
|
+
(arrowField) => deserializeArrowField(arrowField, options)
|
|
8452
|
+
);
|
|
8453
|
+
return dataType.type === "dense-union" ? new arrow.DenseUnion(dataType.typeIds, children) : new arrow.SparseUnion(dataType.typeIds, children);
|
|
8454
|
+
}
|
|
8455
|
+
case "dictionary": {
|
|
8456
|
+
return new arrow.Dictionary(
|
|
8457
|
+
deserializeArrowType(dataType.dictionary, options),
|
|
8458
|
+
deserializeArrowDictionaryKeyType(dataType.indices),
|
|
8459
|
+
dataType.id,
|
|
8460
|
+
dataType.isOrdered
|
|
8461
|
+
);
|
|
8462
|
+
}
|
|
8463
|
+
default:
|
|
8464
|
+
throw new Error("array type not supported");
|
|
8465
|
+
}
|
|
8561
8466
|
}
|
|
8562
|
-
|
|
8563
|
-
|
|
8467
|
+
switch (dataType) {
|
|
8468
|
+
case "null":
|
|
8469
|
+
return new arrow.Null();
|
|
8470
|
+
case "binary":
|
|
8471
|
+
return makeVariableWidthArrowType("BinaryView", new arrow.Binary(), options);
|
|
8472
|
+
case "binary-view":
|
|
8473
|
+
return makeRequiredArrowViewType("BinaryView");
|
|
8474
|
+
case "bool":
|
|
8475
|
+
return new arrow.Bool();
|
|
8476
|
+
case "int8":
|
|
8477
|
+
return new arrow.Int8();
|
|
8478
|
+
case "int16":
|
|
8479
|
+
return new arrow.Int16();
|
|
8480
|
+
case "int32":
|
|
8481
|
+
return new arrow.Int32();
|
|
8482
|
+
case "int64":
|
|
8483
|
+
return new arrow.Int64();
|
|
8484
|
+
case "uint8":
|
|
8485
|
+
return new arrow.Uint8();
|
|
8486
|
+
case "uint16":
|
|
8487
|
+
return new arrow.Uint16();
|
|
8488
|
+
case "uint32":
|
|
8489
|
+
return new arrow.Uint32();
|
|
8490
|
+
case "uint64":
|
|
8491
|
+
return new arrow.Uint64();
|
|
8492
|
+
case "float16":
|
|
8493
|
+
return new arrow.Float16();
|
|
8494
|
+
case "float32":
|
|
8495
|
+
return new arrow.Float32();
|
|
8496
|
+
case "float64":
|
|
8497
|
+
return new arrow.Float64();
|
|
8498
|
+
case "utf8":
|
|
8499
|
+
return makeVariableWidthArrowType("Utf8View", new arrow.Utf8(), options);
|
|
8500
|
+
case "utf8-view":
|
|
8501
|
+
return makeRequiredArrowViewType("Utf8View");
|
|
8502
|
+
case "date-day":
|
|
8503
|
+
return new arrow.DateDay();
|
|
8504
|
+
case "date-millisecond":
|
|
8505
|
+
return new arrow.DateMillisecond();
|
|
8506
|
+
case "time-second":
|
|
8507
|
+
return new arrow.TimeSecond();
|
|
8508
|
+
case "time-millisecond":
|
|
8509
|
+
return new arrow.TimeMillisecond();
|
|
8510
|
+
case "time-microsecond":
|
|
8511
|
+
return new arrow.TimeMicrosecond();
|
|
8512
|
+
case "time-nanosecond":
|
|
8513
|
+
return new arrow.TimeNanosecond();
|
|
8514
|
+
case "timestamp-second":
|
|
8515
|
+
return new arrow.TimestampSecond();
|
|
8516
|
+
case "timestamp-millisecond":
|
|
8517
|
+
return new arrow.TimestampMillisecond();
|
|
8518
|
+
case "timestamp-microsecond":
|
|
8519
|
+
return new arrow.TimestampMicrosecond();
|
|
8520
|
+
case "timestamp-nanosecond":
|
|
8521
|
+
return new arrow.TimestampNanosecond();
|
|
8522
|
+
case "interval-daytime":
|
|
8523
|
+
return new arrow.IntervalDayTime();
|
|
8524
|
+
case "interval-yearmonth":
|
|
8525
|
+
return new arrow.IntervalYearMonth();
|
|
8526
|
+
default:
|
|
8527
|
+
throw new Error("array type not supported");
|
|
8564
8528
|
}
|
|
8565
|
-
return module2;
|
|
8566
8529
|
}
|
|
8567
|
-
function
|
|
8568
|
-
|
|
8569
|
-
|
|
8570
|
-
|
|
8530
|
+
function getOptionalArrowConstructor(typeName) {
|
|
8531
|
+
return arrow[typeName];
|
|
8532
|
+
}
|
|
8533
|
+
function isArrowViewType(arrowType, viewTypeName) {
|
|
8534
|
+
const constructor = getOptionalArrowConstructor(viewTypeName);
|
|
8535
|
+
if (constructor && arrowType instanceof constructor) {
|
|
8536
|
+
return true;
|
|
8571
8537
|
}
|
|
8572
|
-
|
|
8538
|
+
const guards = arrow.DataType;
|
|
8539
|
+
const guard = viewTypeName === "BinaryView" ? guards.isBinaryView : guards.isUtf8View;
|
|
8540
|
+
return Boolean(guard == null ? void 0 : guard(arrowType));
|
|
8573
8541
|
}
|
|
8574
|
-
function
|
|
8575
|
-
const
|
|
8576
|
-
return
|
|
8577
|
-
type,
|
|
8578
|
-
options.useLocalLibraries ? "local" : "remote",
|
|
8579
|
-
options.CDN || "",
|
|
8580
|
-
libraryOverrides
|
|
8581
|
-
].join("|");
|
|
8542
|
+
function isOptionalArrowType(arrowType, typeName) {
|
|
8543
|
+
const constructor = getOptionalArrowConstructor(typeName);
|
|
8544
|
+
return Boolean(constructor && arrowType instanceof constructor);
|
|
8582
8545
|
}
|
|
8583
|
-
|
|
8584
|
-
|
|
8585
|
-
"
|
|
8586
|
-
|
|
8587
|
-
init_loader_utils();
|
|
8588
|
-
init_draco_library_loader();
|
|
8589
|
-
init_draco_libraries();
|
|
8590
|
-
libraryDecoderPromises = /* @__PURE__ */ new Map();
|
|
8591
|
-
injectedDecoderPromises = /* @__PURE__ */ new WeakMap();
|
|
8592
|
-
decoderInitializationQueue = Promise.resolve();
|
|
8593
|
-
}
|
|
8594
|
-
});
|
|
8595
|
-
|
|
8596
|
-
// ../core/src/schema-utils/lib/schema/data-type.ts
|
|
8597
|
-
function getDataTypeFromValue(value, defaultNumberType = "float32") {
|
|
8598
|
-
if (value instanceof Date) {
|
|
8599
|
-
return "date-millisecond";
|
|
8600
|
-
}
|
|
8601
|
-
if (typeof value === "number") {
|
|
8602
|
-
return defaultNumberType;
|
|
8603
|
-
}
|
|
8604
|
-
if (typeof value === "boolean") {
|
|
8605
|
-
return "bool";
|
|
8546
|
+
function makeVariableWidthArrowType(viewTypeName, fallbackType, options) {
|
|
8547
|
+
const viewTypeMode = (options == null ? void 0 : options.viewTypes) || "never";
|
|
8548
|
+
if (viewTypeMode === "never") {
|
|
8549
|
+
return fallbackType;
|
|
8606
8550
|
}
|
|
8607
|
-
|
|
8608
|
-
|
|
8551
|
+
const constructor = getOptionalArrowConstructor(viewTypeName);
|
|
8552
|
+
if (constructor) {
|
|
8553
|
+
return new constructor();
|
|
8609
8554
|
}
|
|
8610
|
-
if (
|
|
8611
|
-
|
|
8555
|
+
if (viewTypeMode === "require") {
|
|
8556
|
+
throw new Error(
|
|
8557
|
+
`${viewTypeName} requires apache-arrow 21.2.0 or later; the installed runtime does not support it`
|
|
8558
|
+
);
|
|
8612
8559
|
}
|
|
8613
|
-
return
|
|
8560
|
+
return fallbackType;
|
|
8614
8561
|
}
|
|
8615
|
-
function
|
|
8616
|
-
|
|
8617
|
-
if (
|
|
8618
|
-
|
|
8619
|
-
|
|
8620
|
-
|
|
8621
|
-
type = getDataTypeFromValue(array[0]);
|
|
8622
|
-
return { type, nullable: true };
|
|
8562
|
+
function makeRequiredArrowViewType(viewTypeName) {
|
|
8563
|
+
const constructor = getOptionalArrowConstructor(viewTypeName);
|
|
8564
|
+
if (!constructor) {
|
|
8565
|
+
throw new Error(
|
|
8566
|
+
`${viewTypeName} requires apache-arrow 21.2.0 or later; the installed runtime does not support it`
|
|
8567
|
+
);
|
|
8623
8568
|
}
|
|
8624
|
-
return
|
|
8569
|
+
return new constructor();
|
|
8625
8570
|
}
|
|
8626
|
-
function
|
|
8627
|
-
if (
|
|
8628
|
-
|
|
8571
|
+
function serializeArrowDictionaryKeyType(arrowType) {
|
|
8572
|
+
if (arrowType instanceof arrow.Int) {
|
|
8573
|
+
const prefix = arrowType.isSigned ? "int" : "uint";
|
|
8574
|
+
const keyType = `${prefix}${arrowType.bitWidth}`;
|
|
8575
|
+
if (isSchemaDictionaryKeyType(keyType)) {
|
|
8576
|
+
return keyType;
|
|
8577
|
+
}
|
|
8629
8578
|
}
|
|
8630
|
-
switch (
|
|
8631
|
-
case
|
|
8579
|
+
switch (arrowType.constructor) {
|
|
8580
|
+
case arrow.Int8:
|
|
8632
8581
|
return "int8";
|
|
8633
|
-
case
|
|
8634
|
-
case Uint8ClampedArray:
|
|
8635
|
-
return "uint8";
|
|
8636
|
-
case Int16Array:
|
|
8582
|
+
case arrow.Int16:
|
|
8637
8583
|
return "int16";
|
|
8638
|
-
case
|
|
8639
|
-
return "uint16";
|
|
8640
|
-
case Int32Array:
|
|
8584
|
+
case arrow.Int32:
|
|
8641
8585
|
return "int32";
|
|
8642
|
-
case
|
|
8586
|
+
case arrow.Uint8:
|
|
8587
|
+
return "uint8";
|
|
8588
|
+
case arrow.Uint16:
|
|
8589
|
+
return "uint16";
|
|
8590
|
+
case arrow.Uint32:
|
|
8643
8591
|
return "uint32";
|
|
8644
|
-
case BigInt64Array:
|
|
8645
|
-
return "int64";
|
|
8646
|
-
case BigUint64Array:
|
|
8647
|
-
return "uint64";
|
|
8648
|
-
case Float32Array:
|
|
8649
|
-
return "float32";
|
|
8650
|
-
case Float64Array:
|
|
8651
|
-
return "float64";
|
|
8652
8592
|
default:
|
|
8653
|
-
|
|
8593
|
+
throw new Error(`arrow dictionary index type not supported: ${arrowType.constructor.name}`);
|
|
8654
8594
|
}
|
|
8655
8595
|
}
|
|
8656
|
-
|
|
8657
|
-
|
|
8658
|
-
|
|
8596
|
+
function isSchemaDictionaryKeyType(keyType) {
|
|
8597
|
+
return ["int8", "int16", "int32", "uint8", "uint16", "uint32"].includes(keyType);
|
|
8598
|
+
}
|
|
8599
|
+
function deserializeArrowDictionaryKeyType(keyType) {
|
|
8600
|
+
switch (keyType) {
|
|
8601
|
+
case "int8":
|
|
8602
|
+
return new arrow.Int8();
|
|
8603
|
+
case "int16":
|
|
8604
|
+
return new arrow.Int16();
|
|
8605
|
+
case "int32":
|
|
8606
|
+
return new arrow.Int32();
|
|
8607
|
+
case "uint8":
|
|
8608
|
+
return new arrow.Uint8();
|
|
8609
|
+
case "uint16":
|
|
8610
|
+
return new arrow.Uint16();
|
|
8611
|
+
case "uint32":
|
|
8612
|
+
return new arrow.Uint32();
|
|
8613
|
+
default:
|
|
8614
|
+
throw new Error(`schema dictionary index type not supported: ${keyType}`);
|
|
8615
|
+
}
|
|
8616
|
+
}
|
|
8617
|
+
var arrow;
|
|
8618
|
+
var init_convert_arrow_schema = __esm({
|
|
8619
|
+
"../core/src/schema-utils/lib/schema/convert-arrow-schema.ts"() {
|
|
8659
8620
|
"use strict";
|
|
8660
|
-
|
|
8621
|
+
arrow = __toESM(require("apache-arrow"), 1);
|
|
8661
8622
|
}
|
|
8662
8623
|
});
|
|
8663
8624
|
|
|
@@ -8757,23 +8718,23 @@ var init_float16 = __esm({
|
|
|
8757
8718
|
});
|
|
8758
8719
|
|
|
8759
8720
|
// ../core/src/schema/categories/category-mesh.ts
|
|
8760
|
-
var
|
|
8721
|
+
var arrow2, meshArrowSchema, indexedMeshArrowSchema;
|
|
8761
8722
|
var init_category_mesh = __esm({
|
|
8762
8723
|
"../core/src/schema/categories/category-mesh.ts"() {
|
|
8763
8724
|
"use strict";
|
|
8764
|
-
|
|
8765
|
-
meshArrowSchema = new
|
|
8766
|
-
new
|
|
8725
|
+
arrow2 = __toESM(require("apache-arrow"), 1);
|
|
8726
|
+
meshArrowSchema = new arrow2.Schema([
|
|
8727
|
+
new arrow2.Field(
|
|
8767
8728
|
"POSITION",
|
|
8768
|
-
new
|
|
8729
|
+
new arrow2.FixedSizeList(3, new arrow2.Field("value", new arrow2.Float32(), false)),
|
|
8769
8730
|
false
|
|
8770
8731
|
)
|
|
8771
8732
|
]);
|
|
8772
|
-
indexedMeshArrowSchema = new
|
|
8733
|
+
indexedMeshArrowSchema = new arrow2.Schema([
|
|
8773
8734
|
...meshArrowSchema.fields,
|
|
8774
|
-
new
|
|
8735
|
+
new arrow2.Field(
|
|
8775
8736
|
"indices",
|
|
8776
|
-
new
|
|
8737
|
+
new arrow2.List(new arrow2.Field("item", new arrow2.Uint32(), false)),
|
|
8777
8738
|
true
|
|
8778
8739
|
)
|
|
8779
8740
|
]);
|
|
@@ -8792,7 +8753,7 @@ var init_schema = __esm({
|
|
|
8792
8753
|
// ../core/src/schema-utils/lib/arrow-utils/arrow-fixed-size-list-utils.ts
|
|
8793
8754
|
function getFixedSizeListVector(typedArray, stride, logicalType) {
|
|
8794
8755
|
const data = getFixedSizeListData(typedArray, stride, logicalType);
|
|
8795
|
-
return new
|
|
8756
|
+
return new arrow3.Vector([data]);
|
|
8796
8757
|
}
|
|
8797
8758
|
function getFixedSizeListData(typedArray, stride, logicalType) {
|
|
8798
8759
|
const listType = getFixedSizeListType(typedArray, stride, logicalType);
|
|
@@ -8800,13 +8761,13 @@ function getFixedSizeListData(typedArray, stride, logicalType) {
|
|
|
8800
8761
|
const storage = logicalType === "float16" && isNativeFloat16Array(typedArray) ? getFloat16Storage(typedArray) : typedArray;
|
|
8801
8762
|
const buffers = {
|
|
8802
8763
|
// valueOffsets: undefined,
|
|
8803
|
-
[
|
|
8764
|
+
[arrow3.BufferType.DATA]: storage
|
|
8804
8765
|
// values
|
|
8805
8766
|
// nullBitmap: undefined,
|
|
8806
8767
|
// typeIds: undefined
|
|
8807
8768
|
};
|
|
8808
|
-
const nestedData = new
|
|
8809
|
-
const data = new
|
|
8769
|
+
const nestedData = new arrow3.Data(nestedType, 0, storage.length, 0, buffers);
|
|
8770
|
+
const data = new arrow3.Data(
|
|
8810
8771
|
listType,
|
|
8811
8772
|
0,
|
|
8812
8773
|
storage.length / stride,
|
|
@@ -8819,15 +8780,15 @@ function getFixedSizeListData(typedArray, stride, logicalType) {
|
|
|
8819
8780
|
function getFixedSizeListType(typedArray, stride, logicalType) {
|
|
8820
8781
|
const type = logicalType || getDataTypeFromArray(typedArray).type;
|
|
8821
8782
|
const arrowType = deserializeArrowType(type);
|
|
8822
|
-
const listType = new
|
|
8783
|
+
const listType = new arrow3.FixedSizeList(stride, new arrow3.Field("value", arrowType, false));
|
|
8823
8784
|
return listType;
|
|
8824
8785
|
}
|
|
8825
|
-
var
|
|
8786
|
+
var arrow3;
|
|
8826
8787
|
var init_arrow_fixed_size_list_utils = __esm({
|
|
8827
8788
|
"../core/src/schema-utils/lib/arrow-utils/arrow-fixed-size-list-utils.ts"() {
|
|
8828
8789
|
"use strict";
|
|
8829
8790
|
init_schema();
|
|
8830
|
-
|
|
8791
|
+
arrow3 = __toESM(require("apache-arrow"), 1);
|
|
8831
8792
|
init_data_type();
|
|
8832
8793
|
init_convert_arrow_schema();
|
|
8833
8794
|
}
|
|
@@ -8887,8 +8848,8 @@ function makeMeshArrowTable(attributes, options = {}) {
|
|
|
8887
8848
|
fields.push(indicesField);
|
|
8888
8849
|
}
|
|
8889
8850
|
}
|
|
8890
|
-
const arrowSchema = new
|
|
8891
|
-
const table = ((_c = columns[attributeNames[0]]) == null ? void 0 : _c.length) === 0 ? new
|
|
8851
|
+
const arrowSchema = new arrow4.Schema(fields, getMeshArrowMetadata(options));
|
|
8852
|
+
const table = ((_c = columns[attributeNames[0]]) == null ? void 0 : _c.length) === 0 ? new arrow4.Table(arrowSchema) : new arrow4.Table(arrowSchema, columns);
|
|
8892
8853
|
const schema = serializeArrowSchema(table.schema);
|
|
8893
8854
|
return {
|
|
8894
8855
|
shape: "arrow-table",
|
|
@@ -8902,14 +8863,14 @@ function getAttributeArrowVector(value, size, componentType) {
|
|
|
8902
8863
|
if (componentType === "float16") {
|
|
8903
8864
|
const storage = isNativeFloat16Array(value) ? getFloat16Storage(value) : value;
|
|
8904
8865
|
if (size === 1) {
|
|
8905
|
-
const data = new
|
|
8906
|
-
[
|
|
8866
|
+
const data = new arrow4.Data(new arrow4.Float16(), 0, storage.length, 0, {
|
|
8867
|
+
[arrow4.BufferType.DATA]: storage
|
|
8907
8868
|
});
|
|
8908
|
-
return new
|
|
8869
|
+
return new arrow4.Vector([data]);
|
|
8909
8870
|
}
|
|
8910
8871
|
return getFixedSizeListVector(value, size, componentType);
|
|
8911
8872
|
}
|
|
8912
|
-
return size === 1 ?
|
|
8873
|
+
return size === 1 ? arrow4.makeVector(value) : getFixedSizeListVector(value, size);
|
|
8913
8874
|
}
|
|
8914
8875
|
function getOrderedAttributeNames(attributes) {
|
|
8915
8876
|
const attributeNames = Object.keys(attributes);
|
|
@@ -8936,7 +8897,7 @@ function getAttributeArrowField(schema, attributeName, column, componentType) {
|
|
|
8936
8897
|
for (const [key, value] of Object.entries(suppliedField.metadata)) {
|
|
8937
8898
|
metadata.set(key, value);
|
|
8938
8899
|
}
|
|
8939
|
-
return new
|
|
8900
|
+
return new arrow4.Field(
|
|
8940
8901
|
canonicalField.name,
|
|
8941
8902
|
canonicalField.type,
|
|
8942
8903
|
canonicalField.nullable,
|
|
@@ -8947,21 +8908,21 @@ function getAttributeArrowField(schema, attributeName, column, componentType) {
|
|
|
8947
8908
|
if (componentType === "float16") {
|
|
8948
8909
|
const metadata = new Map(Object.entries((field == null ? void 0 : field.metadata) || {}));
|
|
8949
8910
|
metadata.set("componentType", "float16");
|
|
8950
|
-
return new
|
|
8911
|
+
return new arrow4.Field(attributeName, column.type, false, metadata);
|
|
8951
8912
|
}
|
|
8952
8913
|
if (field && field.type.toString() !== column.type.toString()) {
|
|
8953
8914
|
const deserializedField = deserializeArrowField(field);
|
|
8954
|
-
return new
|
|
8915
|
+
return new arrow4.Field(
|
|
8955
8916
|
attributeName,
|
|
8956
8917
|
column.type,
|
|
8957
8918
|
deserializedField.nullable,
|
|
8958
8919
|
deserializedField.metadata
|
|
8959
8920
|
);
|
|
8960
8921
|
}
|
|
8961
|
-
return field ? deserializeArrowField(field) : new
|
|
8922
|
+
return field ? deserializeArrowField(field) : new arrow4.Field(attributeName, column.type, false);
|
|
8962
8923
|
}
|
|
8963
8924
|
function isMeshPositionColumn(column) {
|
|
8964
|
-
return column.type instanceof
|
|
8925
|
+
return column.type instanceof arrow4.FixedSizeList && column.type.listSize === 3 && column.type.children[0].type instanceof arrow4.Float32;
|
|
8965
8926
|
}
|
|
8966
8927
|
function getIndicesVector(indices, vertexCount, type) {
|
|
8967
8928
|
const indicesType = type;
|
|
@@ -8974,25 +8935,25 @@ function getIndicesVector(indices, vertexCount, type) {
|
|
|
8974
8935
|
if (vertexCount > 0) {
|
|
8975
8936
|
nullBitmap[0] = 1;
|
|
8976
8937
|
}
|
|
8977
|
-
const valuesData = new
|
|
8938
|
+
const valuesData = new arrow4.Data(
|
|
8978
8939
|
indicesType.children[0].type,
|
|
8979
8940
|
0,
|
|
8980
8941
|
values.length,
|
|
8981
8942
|
0,
|
|
8982
|
-
{ [
|
|
8943
|
+
{ [arrow4.BufferType.DATA]: values }
|
|
8983
8944
|
);
|
|
8984
|
-
const indicesData = new
|
|
8945
|
+
const indicesData = new arrow4.Data(
|
|
8985
8946
|
indicesType,
|
|
8986
8947
|
0,
|
|
8987
8948
|
vertexCount,
|
|
8988
8949
|
Math.max(0, vertexCount - 1),
|
|
8989
8950
|
{
|
|
8990
|
-
[
|
|
8991
|
-
[
|
|
8951
|
+
[arrow4.BufferType.OFFSET]: valueOffsets,
|
|
8952
|
+
[arrow4.BufferType.VALIDITY]: nullBitmap
|
|
8992
8953
|
},
|
|
8993
8954
|
[valuesData]
|
|
8994
8955
|
);
|
|
8995
|
-
return new
|
|
8956
|
+
return new arrow4.Vector([indicesData]);
|
|
8996
8957
|
}
|
|
8997
8958
|
function getMeshArrowMetadata(options) {
|
|
8998
8959
|
var _a;
|
|
@@ -9008,13 +8969,13 @@ function getMeshArrowMetadata(options) {
|
|
|
9008
8969
|
}
|
|
9009
8970
|
return deserializeArrowMetadata(metadata);
|
|
9010
8971
|
}
|
|
9011
|
-
var
|
|
8972
|
+
var arrow4, MESH_ARROW_ATTRIBUTE_ORDER;
|
|
9012
8973
|
var init_convert_mesh_to_table = __esm({
|
|
9013
8974
|
"../core/src/schema-utils/lib/mesh/convert-mesh-to-table.ts"() {
|
|
9014
8975
|
"use strict";
|
|
9015
8976
|
init_schema();
|
|
9016
8977
|
init_schema();
|
|
9017
|
-
|
|
8978
|
+
arrow4 = __toESM(require("apache-arrow"), 1);
|
|
9018
8979
|
init_arrow_fixed_size_list_utils();
|
|
9019
8980
|
init_convert_arrow_schema();
|
|
9020
8981
|
MESH_ARROW_ATTRIBUTE_ORDER = ["POSITION"];
|
|
@@ -9022,12 +8983,12 @@ var init_convert_mesh_to_table = __esm({
|
|
|
9022
8983
|
});
|
|
9023
8984
|
|
|
9024
8985
|
// ../core/src/schema-utils/lib/mesh/deduce-mesh-schema.ts
|
|
9025
|
-
function deduceMeshField(
|
|
8986
|
+
function deduceMeshField(name22, attribute, optionalMetadata) {
|
|
9026
8987
|
const type = attribute.componentType || getDataTypeFromTypedArray(attribute.value);
|
|
9027
8988
|
const metadata = optionalMetadata ? optionalMetadata : makeMeshAttributeMetadata(attribute);
|
|
9028
8989
|
const dataType = attribute.size === 1 ? type : { type: "fixed-size-list", listSize: attribute.size, children: [{ name: "value", type }] };
|
|
9029
8990
|
return {
|
|
9030
|
-
name:
|
|
8991
|
+
name: name22,
|
|
9031
8992
|
type: dataType,
|
|
9032
8993
|
nullable: false,
|
|
9033
8994
|
metadata
|
|
@@ -9878,7 +9839,7 @@ var DracoLoader;
|
|
|
9878
9839
|
var init_draco_loader_types = __esm({
|
|
9879
9840
|
"../scene/src/draco/draco-loader-types.ts"() {
|
|
9880
9841
|
"use strict";
|
|
9881
|
-
|
|
9842
|
+
init_arrow_worker_transport();
|
|
9882
9843
|
init_version4();
|
|
9883
9844
|
init_draco_format();
|
|
9884
9845
|
init_draco_loader_options();
|
|
@@ -9912,11 +9873,11 @@ var init_draco_loader_types2 = __esm({
|
|
|
9912
9873
|
// ../scene/src/gltf/lib/gltf-utils/gltf-attribute-utils.ts
|
|
9913
9874
|
function getGLTFAccessors(attributes) {
|
|
9914
9875
|
const accessors = {};
|
|
9915
|
-
for (const
|
|
9916
|
-
const attribute = attributes[
|
|
9917
|
-
if (
|
|
9876
|
+
for (const name22 in attributes) {
|
|
9877
|
+
const attribute = attributes[name22];
|
|
9878
|
+
if (name22 !== "indices") {
|
|
9918
9879
|
const glTFAccessor = getGLTFAccessor(attribute);
|
|
9919
|
-
accessors[
|
|
9880
|
+
accessors[name22] = glTFAccessor;
|
|
9920
9881
|
}
|
|
9921
9882
|
}
|
|
9922
9883
|
return accessors;
|
|
@@ -9977,11 +9938,11 @@ var init_gltf_attribute_utils = __esm({
|
|
|
9977
9938
|
// ../scene/src/gltf/lib/extensions/KHR_draco_mesh_compression.ts
|
|
9978
9939
|
var KHR_draco_mesh_compression_exports = {};
|
|
9979
9940
|
__export(KHR_draco_mesh_compression_exports, {
|
|
9980
|
-
decode: () =>
|
|
9981
|
-
name: () =>
|
|
9982
|
-
preprocess: () =>
|
|
9941
|
+
decode: () => decode13,
|
|
9942
|
+
name: () => name17,
|
|
9943
|
+
preprocess: () => preprocess6
|
|
9983
9944
|
});
|
|
9984
|
-
function
|
|
9945
|
+
function preprocess6(gltfData, options, context) {
|
|
9985
9946
|
const iterator = new GLTFIterator(gltfData);
|
|
9986
9947
|
for (const mesh of iterator.meshes) {
|
|
9987
9948
|
for (const primitive of iterator.getReferences(mesh).primitives) {
|
|
@@ -9990,7 +9951,7 @@ function preprocess4(gltfData, options, context) {
|
|
|
9990
9951
|
}
|
|
9991
9952
|
}
|
|
9992
9953
|
}
|
|
9993
|
-
async function
|
|
9954
|
+
async function decode13(gltfData, options, context) {
|
|
9994
9955
|
var _a;
|
|
9995
9956
|
if (!((_a = options == null ? void 0 : options.gltf) == null ? void 0 : _a.decompressMeshes)) {
|
|
9996
9957
|
return;
|
|
@@ -10073,7 +10034,7 @@ function checkPrimitive(primitive) {
|
|
|
10073
10034
|
throw new Error("glTF: Empty primitive detected: Draco decompression failure?");
|
|
10074
10035
|
}
|
|
10075
10036
|
}
|
|
10076
|
-
var KHR_DRACO_MESH_COMPRESSION,
|
|
10037
|
+
var KHR_DRACO_MESH_COMPRESSION, name17;
|
|
10077
10038
|
var init_KHR_draco_mesh_compression = __esm({
|
|
10078
10039
|
"../scene/src/gltf/lib/extensions/KHR_draco_mesh_compression.ts"() {
|
|
10079
10040
|
"use strict";
|
|
@@ -10083,17 +10044,17 @@ var init_KHR_draco_mesh_compression = __esm({
|
|
|
10083
10044
|
init_gltf_attribute_utils();
|
|
10084
10045
|
init_get_typed_array();
|
|
10085
10046
|
KHR_DRACO_MESH_COMPRESSION = "KHR_draco_mesh_compression";
|
|
10086
|
-
|
|
10047
|
+
name17 = KHR_DRACO_MESH_COMPRESSION;
|
|
10087
10048
|
}
|
|
10088
10049
|
});
|
|
10089
10050
|
|
|
10090
10051
|
// ../scene/src/gltf/lib/extensions/KHR_texture_transform.ts
|
|
10091
10052
|
var KHR_texture_transform_exports = {};
|
|
10092
10053
|
__export(KHR_texture_transform_exports, {
|
|
10093
|
-
decode: () =>
|
|
10094
|
-
name: () =>
|
|
10054
|
+
decode: () => decode14,
|
|
10055
|
+
name: () => name18
|
|
10095
10056
|
});
|
|
10096
|
-
async function
|
|
10057
|
+
async function decode14(gltfData, options) {
|
|
10097
10058
|
var _a;
|
|
10098
10059
|
const iterator = new GLTFIterator(gltfData);
|
|
10099
10060
|
const hasExtension = iterator.hasExtension(KHR_TEXTURE_TRANSFORM);
|
|
@@ -10314,7 +10275,7 @@ function makeTransformationMatrix(extensionData) {
|
|
|
10314
10275
|
const scaleMatrix = scratchScaleMatrix.set(scale[0], 0, 0, 0, scale[1], 0, 0, 0, 1);
|
|
10315
10276
|
return translationMatrix.multiplyRight(rotationMatrix).multiplyRight(scaleMatrix);
|
|
10316
10277
|
}
|
|
10317
|
-
var import_core3, KHR_TEXTURE_TRANSFORM,
|
|
10278
|
+
var import_core3, KHR_TEXTURE_TRANSFORM, name18, scratchVector, scratchRotationMatrix, scratchScaleMatrix;
|
|
10318
10279
|
var init_KHR_texture_transform = __esm({
|
|
10319
10280
|
"../scene/src/gltf/lib/extensions/KHR_texture_transform.ts"() {
|
|
10320
10281
|
"use strict";
|
|
@@ -10324,7 +10285,7 @@ var init_KHR_texture_transform = __esm({
|
|
|
10324
10285
|
init_gltf_iterator();
|
|
10325
10286
|
init_loader_utils();
|
|
10326
10287
|
KHR_TEXTURE_TRANSFORM = "KHR_texture_transform";
|
|
10327
|
-
|
|
10288
|
+
name18 = KHR_TEXTURE_TRANSFORM;
|
|
10328
10289
|
scratchVector = new import_core3.Vector3();
|
|
10329
10290
|
scratchRotationMatrix = new import_core3.Matrix3();
|
|
10330
10291
|
scratchScaleMatrix = new import_core3.Matrix3();
|
|
@@ -10334,11 +10295,11 @@ var init_KHR_texture_transform = __esm({
|
|
|
10334
10295
|
// ../scene/src/gltf/lib/extensions/deprecated/KHR_lights_punctual.ts
|
|
10335
10296
|
var KHR_lights_punctual_exports = {};
|
|
10336
10297
|
__export(KHR_lights_punctual_exports, {
|
|
10337
|
-
decode: () =>
|
|
10298
|
+
decode: () => decode15,
|
|
10338
10299
|
encode: () => encode3,
|
|
10339
|
-
name: () =>
|
|
10300
|
+
name: () => name19
|
|
10340
10301
|
});
|
|
10341
|
-
async function
|
|
10302
|
+
async function decode15(gltfData) {
|
|
10342
10303
|
const iterator = new GLTFIterator(gltfData);
|
|
10343
10304
|
const extension = iterator.getExtension(KHR_LIGHTS_PUNCTUAL);
|
|
10344
10305
|
if (extension) {
|
|
@@ -10370,7 +10331,7 @@ async function encode3(gltfData) {
|
|
|
10370
10331
|
delete gltfScenegraph.json.lights;
|
|
10371
10332
|
}
|
|
10372
10333
|
}
|
|
10373
|
-
var KHR_LIGHTS_PUNCTUAL,
|
|
10334
|
+
var KHR_LIGHTS_PUNCTUAL, name19;
|
|
10374
10335
|
var init_KHR_lights_punctual = __esm({
|
|
10375
10336
|
"../scene/src/gltf/lib/extensions/deprecated/KHR_lights_punctual.ts"() {
|
|
10376
10337
|
"use strict";
|
|
@@ -10378,18 +10339,18 @@ var init_KHR_lights_punctual = __esm({
|
|
|
10378
10339
|
init_gltf_iterator();
|
|
10379
10340
|
init_gltf_scenegraph();
|
|
10380
10341
|
KHR_LIGHTS_PUNCTUAL = "KHR_lights_punctual";
|
|
10381
|
-
|
|
10342
|
+
name19 = KHR_LIGHTS_PUNCTUAL;
|
|
10382
10343
|
}
|
|
10383
10344
|
});
|
|
10384
10345
|
|
|
10385
10346
|
// ../scene/src/gltf/lib/extensions/deprecated/KHR_materials_unlit.ts
|
|
10386
10347
|
var KHR_materials_unlit_exports = {};
|
|
10387
10348
|
__export(KHR_materials_unlit_exports, {
|
|
10388
|
-
decode: () =>
|
|
10349
|
+
decode: () => decode16,
|
|
10389
10350
|
encode: () => encode4,
|
|
10390
|
-
name: () =>
|
|
10351
|
+
name: () => name20
|
|
10391
10352
|
});
|
|
10392
|
-
async function
|
|
10353
|
+
async function decode16(gltfData) {
|
|
10393
10354
|
const iterator = new GLTFIterator(gltfData);
|
|
10394
10355
|
for (const material of iterator.materials) {
|
|
10395
10356
|
const extension = iterator.getExtension(material, KHR_MATERIALS_UNLIT);
|
|
@@ -10414,25 +10375,25 @@ function encode4(gltfData) {
|
|
|
10414
10375
|
for (const field of ["extensionsUsed", "extensionsRequired"])
|
|
10415
10376
|
if (((_a = gltfData.json[field]) == null ? void 0 : _a.length) === 0) delete gltfData.json[field];
|
|
10416
10377
|
}
|
|
10417
|
-
var KHR_MATERIALS_UNLIT,
|
|
10378
|
+
var KHR_MATERIALS_UNLIT, name20;
|
|
10418
10379
|
var init_KHR_materials_unlit = __esm({
|
|
10419
10380
|
"../scene/src/gltf/lib/extensions/deprecated/KHR_materials_unlit.ts"() {
|
|
10420
10381
|
"use strict";
|
|
10421
10382
|
init_gltf_iterator();
|
|
10422
10383
|
init_gltf_scenegraph();
|
|
10423
10384
|
KHR_MATERIALS_UNLIT = "KHR_materials_unlit";
|
|
10424
|
-
|
|
10385
|
+
name20 = KHR_MATERIALS_UNLIT;
|
|
10425
10386
|
}
|
|
10426
10387
|
});
|
|
10427
10388
|
|
|
10428
10389
|
// ../scene/src/gltf/lib/extensions/deprecated/KHR_techniques_webgl.ts
|
|
10429
10390
|
var KHR_techniques_webgl_exports = {};
|
|
10430
10391
|
__export(KHR_techniques_webgl_exports, {
|
|
10431
|
-
decode: () =>
|
|
10392
|
+
decode: () => decode17,
|
|
10432
10393
|
encode: () => encode5,
|
|
10433
|
-
name: () =>
|
|
10394
|
+
name: () => name21
|
|
10434
10395
|
});
|
|
10435
|
-
async function
|
|
10396
|
+
async function decode17(gltfData) {
|
|
10436
10397
|
const iterator = new GLTFIterator(gltfData);
|
|
10437
10398
|
const extension = iterator.getExtension(KHR_TECHNIQUES_WEBGL);
|
|
10438
10399
|
if (extension) {
|
|
@@ -10493,14 +10454,14 @@ function resolveValues(technique, iterator) {
|
|
|
10493
10454
|
});
|
|
10494
10455
|
return values;
|
|
10495
10456
|
}
|
|
10496
|
-
var KHR_TECHNIQUES_WEBGL,
|
|
10457
|
+
var KHR_TECHNIQUES_WEBGL, name21;
|
|
10497
10458
|
var init_KHR_techniques_webgl = __esm({
|
|
10498
10459
|
"../scene/src/gltf/lib/extensions/deprecated/KHR_techniques_webgl.ts"() {
|
|
10499
10460
|
"use strict";
|
|
10500
10461
|
init_gltf_iterator();
|
|
10501
10462
|
init_get_typed_array();
|
|
10502
10463
|
KHR_TECHNIQUES_WEBGL = "KHR_techniques_webgl";
|
|
10503
|
-
|
|
10464
|
+
name21 = KHR_TECHNIQUES_WEBGL;
|
|
10504
10465
|
}
|
|
10505
10466
|
});
|
|
10506
10467
|
|
|
@@ -10530,6 +10491,7 @@ var EXTENSIONS;
|
|
|
10530
10491
|
var init_gltf_extensions = __esm({
|
|
10531
10492
|
"../scene/src/gltf/lib/api/gltf-extensions.ts"() {
|
|
10532
10493
|
"use strict";
|
|
10494
|
+
init_KHR_accessor_float64();
|
|
10533
10495
|
init_EXT_mesh_features();
|
|
10534
10496
|
init_EXT_structural_metadata();
|
|
10535
10497
|
init_KHR_gaussian_splatting();
|
|
@@ -10541,6 +10503,7 @@ var init_gltf_extensions = __esm({
|
|
|
10541
10503
|
init_KHR_meshopt_compression();
|
|
10542
10504
|
init_EXT_texture_webp();
|
|
10543
10505
|
init_EXT_texture_avif();
|
|
10506
|
+
init_MSFT_texture_dds();
|
|
10544
10507
|
init_KHR_texture_basisu();
|
|
10545
10508
|
init_KHR_draco_mesh_compression();
|
|
10546
10509
|
init_KHR_texture_transform();
|
|
@@ -10550,6 +10513,7 @@ var init_gltf_extensions = __esm({
|
|
|
10550
10513
|
init_KHR_techniques_webgl();
|
|
10551
10514
|
init_EXT_feature_metadata();
|
|
10552
10515
|
EXTENSIONS = [
|
|
10516
|
+
KHR_accessor_float64_exports,
|
|
10553
10517
|
// 1.0
|
|
10554
10518
|
// KHR_binary_gltf is handled separately - must be processed before other parsing starts
|
|
10555
10519
|
// KHR_binary_gltf,
|
|
@@ -10568,9 +10532,11 @@ var init_gltf_extensions = __esm({
|
|
|
10568
10532
|
EXT_mesh_polygon_exports,
|
|
10569
10533
|
MPEG_audio_spatial_exports,
|
|
10570
10534
|
KHR_audio_emitter_exports,
|
|
10571
|
-
EXT_texture_avif_exports,
|
|
10572
10535
|
EXT_texture_webp_exports,
|
|
10573
|
-
|
|
10536
|
+
EXT_texture_avif_exports,
|
|
10537
|
+
// Compressed textures take precedence over browser image formats when available.
|
|
10538
|
+
MSFT_texture_dds_exports,
|
|
10539
|
+
// BasisU remains preferred when both compressed alternatives are provided.
|
|
10574
10540
|
KHR_texture_basisu_exports,
|
|
10575
10541
|
KHR_lights_punctual_exports,
|
|
10576
10542
|
KHR_materials_unlit_exports,
|
|
@@ -10582,7 +10548,7 @@ var init_gltf_extensions = __esm({
|
|
|
10582
10548
|
});
|
|
10583
10549
|
|
|
10584
10550
|
// ../scene/src/gltf/lib/extensions/KHR_binary_gltf.ts
|
|
10585
|
-
function
|
|
10551
|
+
function preprocess7(gltfData) {
|
|
10586
10552
|
const iterator = new GLTFIterator(gltfData);
|
|
10587
10553
|
for (const image of iterator.images) {
|
|
10588
10554
|
const extension = iterator.getExtension(image, KHR_BINARY_GLTF);
|
|
@@ -10724,7 +10690,7 @@ function convertGLTFV1Skins(json, resolveNodeId, reportUnsupported) {
|
|
|
10724
10690
|
for (let skinIndex = 0; skinIndex < originalSkinCount; skinIndex++) {
|
|
10725
10691
|
const skin = skins[skinIndex];
|
|
10726
10692
|
const jointNames = skin.jointNames;
|
|
10727
|
-
if (!Array.isArray(jointNames) || jointNames.length === 0 || jointNames.some((
|
|
10693
|
+
if (!Array.isArray(jointNames) || jointNames.length === 0 || jointNames.some((name22) => typeof name22 !== "string" || !name22) || new Set(jointNames).size !== jointNames.length) {
|
|
10728
10694
|
reportUnsupported(`skin ${skinIndex} has invalid joint names`);
|
|
10729
10695
|
hasUnconvertedSkin = true;
|
|
10730
10696
|
continue;
|
|
@@ -11308,7 +11274,7 @@ function hasOpaqueGLTFV1Consumers(json) {
|
|
|
11308
11274
|
for (const [field, value] of Object.entries(object)) {
|
|
11309
11275
|
if (field === "extras") continue;
|
|
11310
11276
|
if (field === "extensions" && value && typeof value === "object" && Object.keys(value).some(
|
|
11311
|
-
(
|
|
11277
|
+
(name22) => !["KHR_materials_unlit", "KHR_materials_common"].includes(name22)
|
|
11312
11278
|
))
|
|
11313
11279
|
return true;
|
|
11314
11280
|
pending.push(value);
|
|
@@ -11448,18 +11414,18 @@ function preserveLegacyFields(object, fields) {
|
|
|
11448
11414
|
function isRecord(value) {
|
|
11449
11415
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
11450
11416
|
}
|
|
11451
|
-
function convertGLTFV1AttributeName(
|
|
11452
|
-
const indexed = /^(JOINTS?|WEIGHTS?|TEXCOORD|COLOR)(?:_(\d+))?$/.exec(
|
|
11417
|
+
function convertGLTFV1AttributeName(name22) {
|
|
11418
|
+
const indexed = /^(JOINTS?|WEIGHTS?|TEXCOORD|COLOR)(?:_(\d+))?$/.exec(name22);
|
|
11453
11419
|
if (indexed) {
|
|
11454
11420
|
const semantic = indexed[1].startsWith("JOINT") ? "JOINTS" : indexed[1].startsWith("WEIGHT") ? "WEIGHTS" : indexed[1];
|
|
11455
11421
|
const index = Number(indexed[2] || 0);
|
|
11456
11422
|
if (!Number.isSafeInteger(index) || index > 999999999)
|
|
11457
|
-
throw new Error(`glTF v1: invalid attribute set index ${
|
|
11423
|
+
throw new Error(`glTF v1: invalid attribute set index ${name22}`);
|
|
11458
11424
|
return `${semantic}_${index}`;
|
|
11459
11425
|
}
|
|
11460
|
-
if (["POSITION", "NORMAL", "TANGENT"].includes(
|
|
11461
|
-
return
|
|
11462
|
-
return `_${
|
|
11426
|
+
if (["POSITION", "NORMAL", "TANGENT"].includes(name22) || name22.startsWith("_") || name22.includes(":"))
|
|
11427
|
+
return name22;
|
|
11428
|
+
return `_${name22}`;
|
|
11463
11429
|
}
|
|
11464
11430
|
var init_clean_gltf_v1_fields = __esm({
|
|
11465
11431
|
"../scene/src/gltf/lib/api/clean-gltf-v1-fields.ts"() {
|
|
@@ -11885,8 +11851,8 @@ function validateSkinInfluences(gltf, readAccessor, reportUnsupported) {
|
|
|
11885
11851
|
checkedBindings.add(binding);
|
|
11886
11852
|
for (const [primitiveIndex, primitive] of mesh.primitives.entries()) {
|
|
11887
11853
|
const label = `mesh ${node.mesh} primitive ${primitiveIndex} skin ${node.skin}`;
|
|
11888
|
-
const jointSets = Object.keys(primitive.attributes).filter((
|
|
11889
|
-
const weightSets = Object.keys(primitive.attributes).filter((
|
|
11854
|
+
const jointSets = Object.keys(primitive.attributes).filter((name22) => /^JOINTS_\d+$/.test(name22)).map((name22) => Number(name22.slice(7))).sort((first, second) => first - second);
|
|
11855
|
+
const weightSets = Object.keys(primitive.attributes).filter((name22) => /^WEIGHTS_\d+$/.test(name22)).map((name22) => Number(name22.slice(8))).sort((first, second) => first - second);
|
|
11890
11856
|
if (!jointSets.length && !weightSets.length) {
|
|
11891
11857
|
reportUnsupported(`${label} requires JOINTS_0 and WEIGHTS_0 skin influences`);
|
|
11892
11858
|
continue;
|
|
@@ -12337,7 +12303,7 @@ function collectExtensionNames(value) {
|
|
|
12337
12303
|
if (!object || typeof object !== "object" || visited.has(object)) continue;
|
|
12338
12304
|
visited.add(object);
|
|
12339
12305
|
if (isRecord2(object) && isRecord2(object.extensions))
|
|
12340
|
-
for (const
|
|
12306
|
+
for (const name22 of Object.keys(object.extensions)) names.add(name22);
|
|
12341
12307
|
for (const [field, child] of Object.entries(object))
|
|
12342
12308
|
if (field !== "extras") pending.push(child);
|
|
12343
12309
|
}
|
|
@@ -12495,7 +12461,7 @@ var init_normalize_gltf_v1 = __esm({
|
|
|
12495
12461
|
this._addAsset(json);
|
|
12496
12462
|
this._orderBinaryBufferPayloads(gltf);
|
|
12497
12463
|
this._convertTopLevelObjectsToArrays(json);
|
|
12498
|
-
|
|
12464
|
+
preprocess7(gltf);
|
|
12499
12465
|
this._convertObjectIdsToArrayIndices(json);
|
|
12500
12466
|
this._updateObjects(json);
|
|
12501
12467
|
for (const [bufferIndex, buffer] of (json.buffers || []).entries())
|
|
@@ -13084,6 +13050,7 @@ function getReferencesImageIndices(gltf) {
|
|
|
13084
13050
|
return Array.from(imageIndices).sort();
|
|
13085
13051
|
}
|
|
13086
13052
|
async function loadImage(gltf, image, index, options, context) {
|
|
13053
|
+
var _a, _b, _c;
|
|
13087
13054
|
let arrayBuffer;
|
|
13088
13055
|
if (image.uri && !image.hasOwnProperty("bufferView")) {
|
|
13089
13056
|
const uri = resolveUrl(image.uri, options, context);
|
|
@@ -13100,6 +13067,33 @@ async function loadImage(gltf, image, index, options, context) {
|
|
|
13100
13067
|
}
|
|
13101
13068
|
assert3(arrayBuffer, "glTF image has no data");
|
|
13102
13069
|
const gltfOptions = getGLTFImageOptions(options, image.mimeType);
|
|
13070
|
+
const ddsLoader = getDDSLoader(context);
|
|
13071
|
+
const ddsSelected = Boolean(
|
|
13072
|
+
ddsLoader && !((_b = (_a = options.gltf) == null ? void 0 : _a.excludeExtensions) == null ? void 0 : _b.includes("MSFT_texture_dds")) && ((_c = gltf.json.textures) == null ? void 0 : _c.some(
|
|
13073
|
+
(texture) => {
|
|
13074
|
+
var _a2, _b2;
|
|
13075
|
+
return texture.source === index && ((_b2 = (_a2 = texture.extensions) == null ? void 0 : _a2.MSFT_texture_dds) == null ? void 0 : _b2.source) === index;
|
|
13076
|
+
}
|
|
13077
|
+
))
|
|
13078
|
+
);
|
|
13079
|
+
if (ddsSelected) {
|
|
13080
|
+
const levels = await parseFromContext(
|
|
13081
|
+
arrayBuffer,
|
|
13082
|
+
ddsLoader,
|
|
13083
|
+
options,
|
|
13084
|
+
context
|
|
13085
|
+
);
|
|
13086
|
+
assert3(levels.length > 0, "MSFT_texture_dds parser returned no texture levels");
|
|
13087
|
+
gltf.images = gltf.images || [];
|
|
13088
|
+
gltf.images[index] = {
|
|
13089
|
+
compressed: true,
|
|
13090
|
+
mipmaps: true,
|
|
13091
|
+
width: levels[0].width,
|
|
13092
|
+
height: levels[0].height,
|
|
13093
|
+
data: levels
|
|
13094
|
+
};
|
|
13095
|
+
return;
|
|
13096
|
+
}
|
|
13103
13097
|
let parsedImage = await parseFromContext(
|
|
13104
13098
|
arrayBuffer,
|
|
13105
13099
|
[ImageLoader, BasisLoader],
|
|
@@ -13132,6 +13126,7 @@ var init_parse_gltf = __esm({
|
|
|
13132
13126
|
init_resolve_gltf_file();
|
|
13133
13127
|
init_get_typed_array();
|
|
13134
13128
|
init_gltf_extensions();
|
|
13129
|
+
init_MSFT_texture_dds();
|
|
13135
13130
|
init_normalize_gltf_v1();
|
|
13136
13131
|
PACKAGE_URL_PREFIX = "gltf-package://";
|
|
13137
13132
|
}
|
|
@@ -13749,8 +13744,8 @@ var init_format_spatial_reference = __esm({
|
|
|
13749
13744
|
function getSpatialProjectionEngine() {
|
|
13750
13745
|
return spatialProjectionEngine;
|
|
13751
13746
|
}
|
|
13752
|
-
function getGeoidModel(
|
|
13753
|
-
return geoidModels.get(
|
|
13747
|
+
function getGeoidModel(name22) {
|
|
13748
|
+
return geoidModels.get(name22);
|
|
13754
13749
|
}
|
|
13755
13750
|
var import_earth, import_projection, geoidModels, spatialProjectionEngine;
|
|
13756
13751
|
var init_spatial_resource_registry = __esm({
|
|
@@ -14810,9 +14805,9 @@ var init_tile_3d_batch_table = __esm({
|
|
|
14810
14805
|
this.binary = binary;
|
|
14811
14806
|
this.featureCount = featureCount;
|
|
14812
14807
|
this._extensions = ((_a = this.json) == null ? void 0 : _a.extensions) || {};
|
|
14813
|
-
this._properties =
|
|
14814
|
-
for (const propertyName
|
|
14815
|
-
if (!IGNORED_PROPERTY_FIELDS
|
|
14808
|
+
this._properties = /* @__PURE__ */ Object.create(null);
|
|
14809
|
+
for (const propertyName of Object.keys(this.json)) {
|
|
14810
|
+
if (!Object.hasOwn(IGNORED_PROPERTY_FIELDS, propertyName)) {
|
|
14816
14811
|
this._properties[propertyName] = this.json[propertyName];
|
|
14817
14812
|
}
|
|
14818
14813
|
}
|
|
@@ -14853,10 +14848,10 @@ var init_tile_3d_batch_table = __esm({
|
|
|
14853
14848
|
}
|
|
14854
14849
|
return void 0;
|
|
14855
14850
|
}
|
|
14856
|
-
hasProperty(batchId,
|
|
14851
|
+
hasProperty(batchId, name22) {
|
|
14857
14852
|
this._checkBatchId(batchId);
|
|
14858
|
-
assert(typeof
|
|
14859
|
-
return defined2(this._properties[
|
|
14853
|
+
assert(typeof name22 === "string", name22);
|
|
14854
|
+
return defined2(this._properties[name22]) || this._hasPropertyInHierarchy(batchId, name22);
|
|
14860
14855
|
}
|
|
14861
14856
|
getPropertyNames(batchId, results) {
|
|
14862
14857
|
this._checkBatchId(batchId);
|
|
@@ -14869,47 +14864,47 @@ var init_tile_3d_batch_table = __esm({
|
|
|
14869
14864
|
}
|
|
14870
14865
|
return results;
|
|
14871
14866
|
}
|
|
14872
|
-
getProperty(batchId,
|
|
14867
|
+
getProperty(batchId, name22) {
|
|
14873
14868
|
this._checkBatchId(batchId);
|
|
14874
|
-
assert(typeof
|
|
14869
|
+
assert(typeof name22 === "string", name22);
|
|
14875
14870
|
if (this._binaryProperties) {
|
|
14876
|
-
const binaryProperty = this._binaryProperties[
|
|
14871
|
+
const binaryProperty = this._binaryProperties[name22];
|
|
14877
14872
|
if (defined2(binaryProperty)) {
|
|
14878
14873
|
return this._getBinaryProperty(binaryProperty, batchId);
|
|
14879
14874
|
}
|
|
14880
14875
|
}
|
|
14881
|
-
const propertyValues = this._properties[
|
|
14876
|
+
const propertyValues = this._properties[name22];
|
|
14882
14877
|
if (defined2(propertyValues)) {
|
|
14883
14878
|
return clone(propertyValues[batchId], true);
|
|
14884
14879
|
}
|
|
14885
14880
|
if (this._hierarchy) {
|
|
14886
|
-
const hierarchyProperty = this._getHierarchyProperty(batchId,
|
|
14881
|
+
const hierarchyProperty = this._getHierarchyProperty(batchId, name22);
|
|
14887
14882
|
if (defined2(hierarchyProperty)) {
|
|
14888
14883
|
return hierarchyProperty;
|
|
14889
14884
|
}
|
|
14890
14885
|
}
|
|
14891
14886
|
return void 0;
|
|
14892
14887
|
}
|
|
14893
|
-
setProperty(batchId,
|
|
14888
|
+
setProperty(batchId, name22, value) {
|
|
14894
14889
|
const featureCount = this.featureCount;
|
|
14895
14890
|
this._checkBatchId(batchId);
|
|
14896
|
-
assert(typeof
|
|
14891
|
+
assert(typeof name22 === "string", name22);
|
|
14897
14892
|
if (this._binaryProperties) {
|
|
14898
|
-
const binaryProperty = this._binaryProperties[
|
|
14893
|
+
const binaryProperty = this._binaryProperties[name22];
|
|
14899
14894
|
if (binaryProperty) {
|
|
14900
14895
|
this._setBinaryProperty(binaryProperty, batchId, value);
|
|
14901
14896
|
return;
|
|
14902
14897
|
}
|
|
14903
14898
|
}
|
|
14904
14899
|
if (this._hierarchy) {
|
|
14905
|
-
if (this._setHierarchyProperty(this, batchId,
|
|
14900
|
+
if (this._setHierarchyProperty(this, batchId, name22, value)) {
|
|
14906
14901
|
return;
|
|
14907
14902
|
}
|
|
14908
14903
|
}
|
|
14909
|
-
let propertyValues = this._properties[
|
|
14904
|
+
let propertyValues = this._properties[name22];
|
|
14910
14905
|
if (!defined2(propertyValues)) {
|
|
14911
|
-
this._properties[
|
|
14912
|
-
propertyValues = this._properties[
|
|
14906
|
+
this._properties[name22] = new Array(featureCount);
|
|
14907
|
+
propertyValues = this._properties[name22];
|
|
14913
14908
|
}
|
|
14914
14909
|
propertyValues[batchId] = clone(value, true);
|
|
14915
14910
|
}
|
|
@@ -14928,21 +14923,21 @@ var init_tile_3d_batch_table = __esm({
|
|
|
14928
14923
|
}
|
|
14929
14924
|
_initializeBinaryProperties() {
|
|
14930
14925
|
let binaryProperties = null;
|
|
14931
|
-
for (const
|
|
14932
|
-
const property = this._properties[
|
|
14933
|
-
const binaryProperty = this._initializeBinaryProperty(
|
|
14926
|
+
for (const name22 in this._properties) {
|
|
14927
|
+
const property = this._properties[name22];
|
|
14928
|
+
const binaryProperty = this._initializeBinaryProperty(name22, property);
|
|
14934
14929
|
if (binaryProperty) {
|
|
14935
|
-
binaryProperties
|
|
14936
|
-
binaryProperties[
|
|
14930
|
+
binaryProperties ??= /* @__PURE__ */ Object.create(null);
|
|
14931
|
+
binaryProperties[name22] = binaryProperty;
|
|
14937
14932
|
}
|
|
14938
14933
|
}
|
|
14939
14934
|
return binaryProperties;
|
|
14940
14935
|
}
|
|
14941
|
-
_initializeBinaryProperty(
|
|
14936
|
+
_initializeBinaryProperty(name22, property) {
|
|
14942
14937
|
if ("byteOffset" in property) {
|
|
14943
14938
|
const tile3DAccessor = property;
|
|
14944
|
-
assert(this.binary, `Property ${
|
|
14945
|
-
assert(tile3DAccessor.type, `Property ${
|
|
14939
|
+
assert(this.binary, `Property ${name22} requires a batch table binary.`);
|
|
14940
|
+
assert(tile3DAccessor.type, `Property ${name22} requires a type.`);
|
|
14946
14941
|
const accessor = createTypedArrayFromAccessor(tile3DAccessor, this.binary.buffer, this.binary.byteOffset | 0, this.featureCount);
|
|
14947
14942
|
return {
|
|
14948
14943
|
typedArray: accessor.values,
|
|
@@ -14954,14 +14949,14 @@ var init_tile_3d_batch_table = __esm({
|
|
|
14954
14949
|
return null;
|
|
14955
14950
|
}
|
|
14956
14951
|
// EXTENSION SUPPORT: 3DTILES_batch_table_hierarchy
|
|
14957
|
-
_hasPropertyInHierarchy(batchId,
|
|
14952
|
+
_hasPropertyInHierarchy(batchId, name22) {
|
|
14958
14953
|
if (!this._hierarchy) {
|
|
14959
14954
|
return false;
|
|
14960
14955
|
}
|
|
14961
14956
|
const result = traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
14962
14957
|
const classId = hierarchy.classIds[instanceIndex];
|
|
14963
14958
|
const instances = hierarchy.classes[classId].instances;
|
|
14964
|
-
return defined2(instances[
|
|
14959
|
+
return Object.hasOwn(instances, name22) && defined2(instances[name22]) ? true : void 0;
|
|
14965
14960
|
});
|
|
14966
14961
|
return defined2(result);
|
|
14967
14962
|
}
|
|
@@ -14969,21 +14964,21 @@ var init_tile_3d_batch_table = __esm({
|
|
|
14969
14964
|
traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
14970
14965
|
const classId = hierarchy.classIds[instanceIndex];
|
|
14971
14966
|
const instances = hierarchy.classes[classId].instances;
|
|
14972
|
-
for (const
|
|
14973
|
-
if (
|
|
14974
|
-
if (results.indexOf(
|
|
14975
|
-
results.push(
|
|
14967
|
+
for (const name22 in instances) {
|
|
14968
|
+
if (Object.hasOwn(instances, name22)) {
|
|
14969
|
+
if (results.indexOf(name22) === -1) {
|
|
14970
|
+
results.push(name22);
|
|
14976
14971
|
}
|
|
14977
14972
|
}
|
|
14978
14973
|
}
|
|
14979
14974
|
});
|
|
14980
14975
|
}
|
|
14981
|
-
_getHierarchyProperty(batchId,
|
|
14976
|
+
_getHierarchyProperty(batchId, name22) {
|
|
14982
14977
|
return traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
14983
14978
|
const classId = hierarchy.classIds[instanceIndex];
|
|
14984
14979
|
const instanceClass = hierarchy.classes[classId];
|
|
14985
14980
|
const indexInClass = hierarchy.classIndexes[instanceIndex];
|
|
14986
|
-
const propertyValues = instanceClass.instances[
|
|
14981
|
+
const propertyValues = Object.hasOwn(instanceClass.instances, name22) ? instanceClass.instances[name22] : void 0;
|
|
14987
14982
|
if (defined2(propertyValues)) {
|
|
14988
14983
|
if (defined2(propertyValues.typedArray)) {
|
|
14989
14984
|
return this._getBinaryProperty(propertyValues, indexInClass);
|
|
@@ -14993,14 +14988,14 @@ var init_tile_3d_batch_table = __esm({
|
|
|
14993
14988
|
return void 0;
|
|
14994
14989
|
});
|
|
14995
14990
|
}
|
|
14996
|
-
_setHierarchyProperty(batchTable, batchId,
|
|
14991
|
+
_setHierarchyProperty(batchTable, batchId, name22, value) {
|
|
14997
14992
|
const result = traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
14998
14993
|
const classId = hierarchy.classIds[instanceIndex];
|
|
14999
14994
|
const instanceClass = hierarchy.classes[classId];
|
|
15000
14995
|
const indexInClass = hierarchy.classIndexes[instanceIndex];
|
|
15001
|
-
const propertyValues = instanceClass.instances[
|
|
14996
|
+
const propertyValues = Object.hasOwn(instanceClass.instances, name22) ? instanceClass.instances[name22] : void 0;
|
|
15002
14997
|
if (defined2(propertyValues)) {
|
|
15003
|
-
assert(instanceIndex === batchId, `Inherited property "${
|
|
14998
|
+
assert(instanceIndex === batchId, `Inherited property "${name22}" is read-only.`);
|
|
15004
14999
|
if (defined2(propertyValues.typedArray)) {
|
|
15005
15000
|
this._setBinaryProperty(propertyValues, indexInClass, value);
|
|
15006
15001
|
} else {
|
|
@@ -15626,6 +15621,7 @@ function parseInstancedModel(tile, arrayBuffer, byteOffset, options, context) {
|
|
|
15626
15621
|
function extractInstancedAttributes(tile, featureTable, batchTable, instancesLength) {
|
|
15627
15622
|
const instances = new Array(instancesLength);
|
|
15628
15623
|
const instancePosition = new import_core10.Vector3();
|
|
15624
|
+
const instanceFramePosition = new import_core10.Vector3();
|
|
15629
15625
|
const instanceNormalRight = new import_core10.Vector3();
|
|
15630
15626
|
const instanceNormalUp = new import_core10.Vector3();
|
|
15631
15627
|
const instanceNormalForward = new import_core10.Vector3();
|
|
@@ -15688,7 +15684,10 @@ function extractInstancedAttributes(tile, featureTable, batchTable, instancesLen
|
|
|
15688
15684
|
tile.hasCustomOrientation = true;
|
|
15689
15685
|
hasCustomOrientation = true;
|
|
15690
15686
|
} else if (tile.eastNorthUp) {
|
|
15691
|
-
|
|
15687
|
+
instanceFramePosition.copy(instancePosition);
|
|
15688
|
+
if (tile.rtcCenter)
|
|
15689
|
+
instanceFramePosition.add(tile.rtcCenter);
|
|
15690
|
+
(0, import_geospatial4.eastNorthUpToFixedFrame)(import_geospatial3.Ellipsoid.WGS84, instanceFramePosition, instanceTransform);
|
|
15692
15691
|
instanceTransform.getRotationMatrix3(instanceRotation);
|
|
15693
15692
|
} else {
|
|
15694
15693
|
instanceRotation.identity();
|
|
@@ -16250,7 +16249,7 @@ var VERSION5;
|
|
|
16250
16249
|
var init_version5 = __esm({
|
|
16251
16250
|
"dist/3d-tiles/lib/utils/version.js"() {
|
|
16252
16251
|
"use strict";
|
|
16253
|
-
VERSION5 = true ? "5.0.0-beta.
|
|
16252
|
+
VERSION5 = true ? "5.0.0-beta.5" : "latest";
|
|
16254
16253
|
}
|
|
16255
16254
|
});
|
|
16256
16255
|
|
|
@@ -18171,9 +18170,9 @@ var init_tile_3d_batch_table2 = __esm({
|
|
|
18171
18170
|
this.binary = binary;
|
|
18172
18171
|
this.featureCount = featureCount;
|
|
18173
18172
|
this._extensions = ((_a = this.json) == null ? void 0 : _a.extensions) || {};
|
|
18174
|
-
this._properties =
|
|
18175
|
-
for (const propertyName
|
|
18176
|
-
if (!IGNORED_PROPERTY_FIELDS2
|
|
18173
|
+
this._properties = /* @__PURE__ */ Object.create(null);
|
|
18174
|
+
for (const propertyName of Object.keys(this.json)) {
|
|
18175
|
+
if (!Object.hasOwn(IGNORED_PROPERTY_FIELDS2, propertyName)) {
|
|
18177
18176
|
this._properties[propertyName] = this.json[propertyName];
|
|
18178
18177
|
}
|
|
18179
18178
|
}
|
|
@@ -18214,10 +18213,10 @@ var init_tile_3d_batch_table2 = __esm({
|
|
|
18214
18213
|
}
|
|
18215
18214
|
return void 0;
|
|
18216
18215
|
}
|
|
18217
|
-
hasProperty(batchId,
|
|
18216
|
+
hasProperty(batchId, name22) {
|
|
18218
18217
|
this._checkBatchId(batchId);
|
|
18219
|
-
assert(typeof
|
|
18220
|
-
return defined4(this._properties[
|
|
18218
|
+
assert(typeof name22 === "string", name22);
|
|
18219
|
+
return defined4(this._properties[name22]) || this._hasPropertyInHierarchy(batchId, name22);
|
|
18221
18220
|
}
|
|
18222
18221
|
getPropertyNames(batchId, results) {
|
|
18223
18222
|
this._checkBatchId(batchId);
|
|
@@ -18230,47 +18229,47 @@ var init_tile_3d_batch_table2 = __esm({
|
|
|
18230
18229
|
}
|
|
18231
18230
|
return results;
|
|
18232
18231
|
}
|
|
18233
|
-
getProperty(batchId,
|
|
18232
|
+
getProperty(batchId, name22) {
|
|
18234
18233
|
this._checkBatchId(batchId);
|
|
18235
|
-
assert(typeof
|
|
18234
|
+
assert(typeof name22 === "string", name22);
|
|
18236
18235
|
if (this._binaryProperties) {
|
|
18237
|
-
const binaryProperty = this._binaryProperties[
|
|
18236
|
+
const binaryProperty = this._binaryProperties[name22];
|
|
18238
18237
|
if (defined4(binaryProperty)) {
|
|
18239
18238
|
return this._getBinaryProperty(binaryProperty, batchId);
|
|
18240
18239
|
}
|
|
18241
18240
|
}
|
|
18242
|
-
const propertyValues = this._properties[
|
|
18241
|
+
const propertyValues = this._properties[name22];
|
|
18243
18242
|
if (defined4(propertyValues)) {
|
|
18244
18243
|
return clone2(propertyValues[batchId], true);
|
|
18245
18244
|
}
|
|
18246
18245
|
if (this._hierarchy) {
|
|
18247
|
-
const hierarchyProperty = this._getHierarchyProperty(batchId,
|
|
18246
|
+
const hierarchyProperty = this._getHierarchyProperty(batchId, name22);
|
|
18248
18247
|
if (defined4(hierarchyProperty)) {
|
|
18249
18248
|
return hierarchyProperty;
|
|
18250
18249
|
}
|
|
18251
18250
|
}
|
|
18252
18251
|
return void 0;
|
|
18253
18252
|
}
|
|
18254
|
-
setProperty(batchId,
|
|
18253
|
+
setProperty(batchId, name22, value) {
|
|
18255
18254
|
const featureCount = this.featureCount;
|
|
18256
18255
|
this._checkBatchId(batchId);
|
|
18257
|
-
assert(typeof
|
|
18256
|
+
assert(typeof name22 === "string", name22);
|
|
18258
18257
|
if (this._binaryProperties) {
|
|
18259
|
-
const binaryProperty = this._binaryProperties[
|
|
18258
|
+
const binaryProperty = this._binaryProperties[name22];
|
|
18260
18259
|
if (binaryProperty) {
|
|
18261
18260
|
this._setBinaryProperty(binaryProperty, batchId, value);
|
|
18262
18261
|
return;
|
|
18263
18262
|
}
|
|
18264
18263
|
}
|
|
18265
18264
|
if (this._hierarchy) {
|
|
18266
|
-
if (this._setHierarchyProperty(this, batchId,
|
|
18265
|
+
if (this._setHierarchyProperty(this, batchId, name22, value)) {
|
|
18267
18266
|
return;
|
|
18268
18267
|
}
|
|
18269
18268
|
}
|
|
18270
|
-
let propertyValues = this._properties[
|
|
18269
|
+
let propertyValues = this._properties[name22];
|
|
18271
18270
|
if (!defined4(propertyValues)) {
|
|
18272
|
-
this._properties[
|
|
18273
|
-
propertyValues = this._properties[
|
|
18271
|
+
this._properties[name22] = new Array(featureCount);
|
|
18272
|
+
propertyValues = this._properties[name22];
|
|
18274
18273
|
}
|
|
18275
18274
|
propertyValues[batchId] = clone2(value, true);
|
|
18276
18275
|
}
|
|
@@ -18289,21 +18288,21 @@ var init_tile_3d_batch_table2 = __esm({
|
|
|
18289
18288
|
}
|
|
18290
18289
|
_initializeBinaryProperties() {
|
|
18291
18290
|
let binaryProperties = null;
|
|
18292
|
-
for (const
|
|
18293
|
-
const property = this._properties[
|
|
18294
|
-
const binaryProperty = this._initializeBinaryProperty(
|
|
18291
|
+
for (const name22 in this._properties) {
|
|
18292
|
+
const property = this._properties[name22];
|
|
18293
|
+
const binaryProperty = this._initializeBinaryProperty(name22, property);
|
|
18295
18294
|
if (binaryProperty) {
|
|
18296
|
-
binaryProperties
|
|
18297
|
-
binaryProperties[
|
|
18295
|
+
binaryProperties ??= /* @__PURE__ */ Object.create(null);
|
|
18296
|
+
binaryProperties[name22] = binaryProperty;
|
|
18298
18297
|
}
|
|
18299
18298
|
}
|
|
18300
18299
|
return binaryProperties;
|
|
18301
18300
|
}
|
|
18302
|
-
_initializeBinaryProperty(
|
|
18301
|
+
_initializeBinaryProperty(name22, property) {
|
|
18303
18302
|
if ("byteOffset" in property) {
|
|
18304
18303
|
const tile3DAccessor = property;
|
|
18305
|
-
assert(this.binary, `Property ${
|
|
18306
|
-
assert(tile3DAccessor.type, `Property ${
|
|
18304
|
+
assert(this.binary, `Property ${name22} requires a batch table binary.`);
|
|
18305
|
+
assert(tile3DAccessor.type, `Property ${name22} requires a type.`);
|
|
18307
18306
|
const accessor = createTypedArrayFromAccessor2(
|
|
18308
18307
|
tile3DAccessor,
|
|
18309
18308
|
this.binary.buffer,
|
|
@@ -18320,14 +18319,14 @@ var init_tile_3d_batch_table2 = __esm({
|
|
|
18320
18319
|
return null;
|
|
18321
18320
|
}
|
|
18322
18321
|
// EXTENSION SUPPORT: 3DTILES_batch_table_hierarchy
|
|
18323
|
-
_hasPropertyInHierarchy(batchId,
|
|
18322
|
+
_hasPropertyInHierarchy(batchId, name22) {
|
|
18324
18323
|
if (!this._hierarchy) {
|
|
18325
18324
|
return false;
|
|
18326
18325
|
}
|
|
18327
18326
|
const result = traverseHierarchy2(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
18328
18327
|
const classId = hierarchy.classIds[instanceIndex];
|
|
18329
18328
|
const instances = hierarchy.classes[classId].instances;
|
|
18330
|
-
return defined4(instances[
|
|
18329
|
+
return Object.hasOwn(instances, name22) && defined4(instances[name22]) ? true : void 0;
|
|
18331
18330
|
});
|
|
18332
18331
|
return defined4(result);
|
|
18333
18332
|
}
|
|
@@ -18335,21 +18334,21 @@ var init_tile_3d_batch_table2 = __esm({
|
|
|
18335
18334
|
traverseHierarchy2(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
18336
18335
|
const classId = hierarchy.classIds[instanceIndex];
|
|
18337
18336
|
const instances = hierarchy.classes[classId].instances;
|
|
18338
|
-
for (const
|
|
18339
|
-
if (
|
|
18340
|
-
if (results.indexOf(
|
|
18341
|
-
results.push(
|
|
18337
|
+
for (const name22 in instances) {
|
|
18338
|
+
if (Object.hasOwn(instances, name22)) {
|
|
18339
|
+
if (results.indexOf(name22) === -1) {
|
|
18340
|
+
results.push(name22);
|
|
18342
18341
|
}
|
|
18343
18342
|
}
|
|
18344
18343
|
}
|
|
18345
18344
|
});
|
|
18346
18345
|
}
|
|
18347
|
-
_getHierarchyProperty(batchId,
|
|
18346
|
+
_getHierarchyProperty(batchId, name22) {
|
|
18348
18347
|
return traverseHierarchy2(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
18349
18348
|
const classId = hierarchy.classIds[instanceIndex];
|
|
18350
18349
|
const instanceClass = hierarchy.classes[classId];
|
|
18351
18350
|
const indexInClass = hierarchy.classIndexes[instanceIndex];
|
|
18352
|
-
const propertyValues = instanceClass.instances[
|
|
18351
|
+
const propertyValues = Object.hasOwn(instanceClass.instances, name22) ? instanceClass.instances[name22] : void 0;
|
|
18353
18352
|
if (defined4(propertyValues)) {
|
|
18354
18353
|
if (defined4(propertyValues.typedArray)) {
|
|
18355
18354
|
return this._getBinaryProperty(propertyValues, indexInClass);
|
|
@@ -18359,14 +18358,14 @@ var init_tile_3d_batch_table2 = __esm({
|
|
|
18359
18358
|
return void 0;
|
|
18360
18359
|
});
|
|
18361
18360
|
}
|
|
18362
|
-
_setHierarchyProperty(batchTable, batchId,
|
|
18361
|
+
_setHierarchyProperty(batchTable, batchId, name22, value) {
|
|
18363
18362
|
const result = traverseHierarchy2(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
18364
18363
|
const classId = hierarchy.classIds[instanceIndex];
|
|
18365
18364
|
const instanceClass = hierarchy.classes[classId];
|
|
18366
18365
|
const indexInClass = hierarchy.classIndexes[instanceIndex];
|
|
18367
|
-
const propertyValues = instanceClass.instances[
|
|
18366
|
+
const propertyValues = Object.hasOwn(instanceClass.instances, name22) ? instanceClass.instances[name22] : void 0;
|
|
18368
18367
|
if (defined4(propertyValues)) {
|
|
18369
|
-
assert(instanceIndex === batchId, `Inherited property "${
|
|
18368
|
+
assert(instanceIndex === batchId, `Inherited property "${name22}" is read-only.`);
|
|
18370
18369
|
if (defined4(propertyValues.typedArray)) {
|
|
18371
18370
|
this._setBinaryProperty(propertyValues, indexInClass, value);
|
|
18372
18371
|
} else {
|
|
@@ -19031,6 +19030,7 @@ function parseInstancedModel2(tile, arrayBuffer, byteOffset, options, context) {
|
|
|
19031
19030
|
function extractInstancedAttributes2(tile, featureTable, batchTable, instancesLength) {
|
|
19032
19031
|
const instances = new Array(instancesLength);
|
|
19033
19032
|
const instancePosition = new import_core16.Vector3();
|
|
19033
|
+
const instanceFramePosition = new import_core16.Vector3();
|
|
19034
19034
|
const instanceNormalRight = new import_core16.Vector3();
|
|
19035
19035
|
const instanceNormalUp = new import_core16.Vector3();
|
|
19036
19036
|
const instanceNormalForward = new import_core16.Vector3();
|
|
@@ -19125,7 +19125,9 @@ function extractInstancedAttributes2(tile, featureTable, batchTable, instancesLe
|
|
|
19125
19125
|
tile.hasCustomOrientation = true;
|
|
19126
19126
|
hasCustomOrientation = true;
|
|
19127
19127
|
} else if (tile.eastNorthUp) {
|
|
19128
|
-
|
|
19128
|
+
instanceFramePosition.copy(instancePosition);
|
|
19129
|
+
if (tile.rtcCenter) instanceFramePosition.add(tile.rtcCenter);
|
|
19130
|
+
(0, import_geospatial7.eastNorthUpToFixedFrame)(import_geospatial6.Ellipsoid.WGS84, instanceFramePosition, instanceTransform);
|
|
19129
19131
|
instanceTransform.getRotationMatrix3(instanceRotation);
|
|
19130
19132
|
} else {
|
|
19131
19133
|
instanceRotation.identity();
|