@loaders.gl/tiles-3d 5.0.0-beta.10 → 5.0.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/3d-tiles/3d-tiles-archive-loader.js +1 -1
- package/dist/3d-tiles/dist.dev.js +169 -581
- package/dist/3d-tiles/dist.min.js +16 -16
- package/dist/3d-tiles/index.cjs +115 -390
- package/dist/3d-tiles/index.cjs.map +3 -3
- package/dist/3d-tiles/lib/classes/helpers/tile-3d-accessor-utils.d.ts +1 -2
- package/dist/3d-tiles/lib/classes/helpers/tile-3d-accessor-utils.d.ts.map +1 -1
- package/dist/3d-tiles/lib/classes/helpers/tile-3d-accessor-utils.js +3 -4
- package/dist/3d-tiles/lib/classes/helpers/tile-3d-accessor-utils.js.map +1 -1
- package/dist/3d-tiles/lib/classes/helpers/tile-component-types.d.ts +4 -0
- package/dist/3d-tiles/lib/classes/helpers/tile-component-types.d.ts.map +1 -0
- package/dist/3d-tiles/lib/classes/helpers/tile-component-types.js +36 -0
- package/dist/3d-tiles/lib/classes/helpers/tile-component-types.js.map +1 -0
- package/dist/3d-tiles/lib/classes/tile-3d-batch-table-hierarchy.d.ts.map +1 -1
- package/dist/3d-tiles/lib/classes/tile-3d-batch-table-hierarchy.js +3 -4
- package/dist/3d-tiles/lib/classes/tile-3d-batch-table-hierarchy.js.map +1 -1
- package/dist/3d-tiles/lib/classes/tile-3d-batch-table.d.ts +1 -1
- package/dist/3d-tiles/lib/classes/tile-3d-feature-table.d.ts +9 -5
- package/dist/3d-tiles/lib/classes/tile-3d-feature-table.d.ts.map +1 -1
- package/dist/3d-tiles/lib/classes/tile-3d-feature-table.js +15 -12
- package/dist/3d-tiles/lib/classes/tile-3d-feature-table.js.map +1 -1
- package/dist/3d-tiles/lib/parsers/helpers/normalize-3d-tile-colors.d.ts +0 -1
- package/dist/3d-tiles/lib/parsers/helpers/normalize-3d-tile-colors.d.ts.map +1 -1
- package/dist/3d-tiles/lib/parsers/helpers/normalize-3d-tile-colors.js +2 -4
- package/dist/3d-tiles/lib/parsers/helpers/normalize-3d-tile-colors.js.map +1 -1
- package/dist/3d-tiles/lib/parsers/helpers/normalize-3d-tile-normals.d.ts +1 -2
- package/dist/3d-tiles/lib/parsers/helpers/normalize-3d-tile-normals.d.ts.map +1 -1
- package/dist/3d-tiles/lib/parsers/helpers/normalize-3d-tile-normals.js +7 -7
- package/dist/3d-tiles/lib/parsers/helpers/normalize-3d-tile-normals.js.map +1 -1
- package/dist/3d-tiles/lib/parsers/helpers/normalize-3d-tile-positions.d.ts.map +1 -1
- package/dist/3d-tiles/lib/parsers/helpers/normalize-3d-tile-positions.js +0 -2
- package/dist/3d-tiles/lib/parsers/helpers/normalize-3d-tile-positions.js.map +1 -1
- package/dist/3d-tiles/lib/parsers/parse-3d-tile-batched-model.d.ts.map +1 -1
- package/dist/3d-tiles/lib/parsers/parse-3d-tile-batched-model.js +1 -2
- package/dist/3d-tiles/lib/parsers/parse-3d-tile-batched-model.js.map +1 -1
- package/dist/3d-tiles/lib/parsers/parse-3d-tile-instanced-model.js +13 -13
- package/dist/3d-tiles/lib/parsers/parse-3d-tile-instanced-model.js.map +1 -1
- package/dist/3d-tiles/lib/parsers/parse-3d-tile-point-cloud.d.ts.map +1 -1
- package/dist/3d-tiles/lib/parsers/parse-3d-tile-point-cloud.js +22 -23
- package/dist/3d-tiles/lib/parsers/parse-3d-tile-point-cloud.js.map +1 -1
- package/dist/3d-tiles/lib/utils/version.js +1 -1
- package/dist/3d-tiles/types.d.ts +7 -3
- package/dist/3d-tiles/types.d.ts.map +1 -1
- package/dist/3d-tiles-archive-writer.cjs +1 -1
- package/dist/copc/copc-loader.d.ts.map +1 -1
- package/dist/copc/copc-loader.js +10 -7
- package/dist/copc/copc-loader.js.map +1 -1
- package/dist/copc/copc-writer.d.ts +5 -4
- package/dist/copc/copc-writer.d.ts.map +1 -1
- package/dist/copc/copc-writer.js +1 -1
- package/dist/copc/copc-writer.js.map +1 -1
- package/dist/copc/index.cjs +809 -124
- package/dist/copc/index.cjs.map +3 -3
- package/dist/dist.dev.js +45 -77
- package/dist/dist.min.js +10 -10
- package/dist/i3s/arcgis-webscene-loader.js +1 -1
- package/dist/i3s/dist.dev.js +11915 -12119
- package/dist/i3s/dist.min.js +25 -25
- 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-mesh-attributes.d.ts +2 -2
- package/dist/i3s/i3s-mesh-attributes.d.ts.map +1 -1
- package/dist/i3s/i3s-mesh-attributes.js +6 -11
- package/dist/i3s/i3s-mesh-attributes.js.map +1 -1
- package/dist/i3s/i3s-mesh-writer.js +2 -3
- package/dist/i3s/i3s-mesh-writer.js.map +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 +314 -442
- package/dist/i3s/index.cjs.map +3 -3
- package/dist/i3s/lib/parsers/constants.d.ts +0 -3
- package/dist/i3s/lib/parsers/constants.d.ts.map +1 -1
- package/dist/i3s/lib/parsers/constants.js +0 -8
- package/dist/i3s/lib/parsers/constants.js.map +1 -1
- package/dist/i3s/lib/parsers/parse-i3s-tile-content.d.ts.map +1 -1
- package/dist/i3s/lib/parsers/parse-i3s-tile-content.js +1 -2
- package/dist/i3s/lib/parsers/parse-i3s-tile-content.js.map +1 -1
- package/dist/i3s/types.d.ts +0 -1
- package/dist/i3s/types.d.ts.map +1 -1
- 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 +485 -879
- package/dist/i3s-lepcc-worker-node.js +2 -2
- package/dist/i3s-lepcc-worker.js +2 -2
- package/dist/i3s-mesh-writer.cjs +87 -206
- package/dist/i3s-mesh-writer.cjs.map +3 -3
- package/dist/i3s-slpk-writer.cjs +1 -1
- package/dist/index.cjs +44 -41
- package/dist/index.cjs.map +1 -1
- package/dist/point-cloud-tile-loader-types.js +1 -1
- package/dist/point-cloud-tile-loader.cjs +17 -28
- package/dist/point-cloud-tile-loader.cjs.map +1 -1
- package/dist/point-cloud-tile-source.cjs +16 -27
- package/dist/point-cloud-tile-source.cjs.map +1 -1
- package/dist/point-cloud-tile-source.js +2 -2
- package/dist/point-cloud-tile-source.js.map +1 -1
- package/dist/potree/dist.dev.js +985 -139
- package/dist/potree/dist.min.js +28 -28
- package/dist/potree/index.cjs +813 -140
- package/dist/potree/index.cjs.map +3 -3
- package/dist/potree/lib/potree-node-source.d.ts.map +1 -1
- package/dist/potree/lib/potree-node-source.js +2 -14
- package/dist/potree/lib/potree-node-source.js.map +1 -1
- package/dist/potree/parsers/parse-potree-bin.js +3 -3
- package/dist/potree/parsers/parse-potree-bin.js.map +1 -1
- 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-writer.d.ts +3 -3
- package/dist/potree/potree-writer.d.ts.map +1 -1
- package/dist/potree/potree-writer.js +2 -2
- package/dist/potree/potree-writer.js.map +1 -1
- package/dist/potree/potree2-source.d.ts +1 -1
- package/dist/potree/potree2-source.d.ts.map +1 -1
- package/dist/potree/potree2-source.js +6 -3
- package/dist/potree/potree2-source.js.map +1 -1
- package/dist/potree-loader.cjs +817 -153
- package/dist/potree-loader.cjs.map +3 -3
- package/dist/tileset-3d/helpers/frame-state.d.ts +2 -1
- package/dist/tileset-3d/helpers/frame-state.d.ts.map +1 -1
- package/dist/tileset-3d/helpers/frame-state.js +41 -15
- package/dist/tileset-3d/helpers/frame-state.js.map +1 -1
- package/dist/types.d.ts +15 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +13 -13
- package/src/3d-tiles/lib/classes/helpers/tile-3d-accessor-utils.ts +3 -4
- package/src/3d-tiles/lib/classes/helpers/tile-component-types.ts +39 -0
- package/src/3d-tiles/lib/classes/tile-3d-batch-table-hierarchy.ts +3 -4
- package/src/3d-tiles/lib/classes/tile-3d-feature-table.ts +38 -14
- package/src/3d-tiles/lib/parsers/helpers/normalize-3d-tile-colors.ts +2 -5
- package/src/3d-tiles/lib/parsers/helpers/normalize-3d-tile-normals.ts +10 -10
- package/src/3d-tiles/lib/parsers/helpers/normalize-3d-tile-positions.ts +0 -2
- package/src/3d-tiles/lib/parsers/parse-3d-tile-batched-model.ts +1 -2
- package/src/3d-tiles/lib/parsers/parse-3d-tile-instanced-model.ts +19 -19
- package/src/3d-tiles/lib/parsers/parse-3d-tile-point-cloud.ts +22 -23
- package/src/3d-tiles/types.ts +4 -3
- package/src/copc/copc-loader.ts +8 -8
- package/src/copc/copc-writer.ts +6 -5
- package/src/i3s/i3s-mesh-attributes.ts +9 -17
- package/src/i3s/i3s-mesh-writer.ts +4 -3
- package/src/i3s/lib/parsers/constants.ts +0 -9
- package/src/i3s/lib/parsers/parse-i3s-tile-content.ts +1 -2
- package/src/i3s/types.ts +0 -1
- package/src/point-cloud-tile-source.ts +2 -2
- package/src/potree/lib/potree-node-source.ts +2 -15
- package/src/potree/parsers/parse-potree-bin.ts +3 -3
- package/src/potree/potree-writer.ts +6 -11
- package/src/potree/potree2-source.ts +6 -3
- package/src/tileset-3d/helpers/frame-state.ts +43 -15
- package/src/types.ts +15 -0
package/dist/i3s-slpk-writer.cjs
CHANGED
|
@@ -1337,7 +1337,7 @@ var ArcGISWebSceneFormat = json("ArcGIS Web Scene", "arcgis-web-scene", "arcgis-
|
|
|
1337
1337
|
var I3SBuildingSceneLayerFormat = json("I3S Building Scene Layer", "i3s-building-scene-layer", "i3s-building-scene-layer");
|
|
1338
1338
|
|
|
1339
1339
|
// dist/i3s/i3s-slpk-writer.js
|
|
1340
|
-
var VERSION2 = true ? "5.0.0-beta.
|
|
1340
|
+
var VERSION2 = true ? "5.0.0-beta.11" : "latest";
|
|
1341
1341
|
var MAX_ARCHIVE_BYTES = 2147483647;
|
|
1342
1342
|
var SLPKWriter = {
|
|
1343
1343
|
...SLPKFormat,
|
package/dist/index.cjs
CHANGED
|
@@ -2908,7 +2908,7 @@ var init_convert_arrow_schema = __esm({
|
|
|
2908
2908
|
});
|
|
2909
2909
|
|
|
2910
2910
|
// ../core/src/lib/loader-utils/native-arrow.ts
|
|
2911
|
-
function
|
|
2911
|
+
function isArrowTable(value) {
|
|
2912
2912
|
return Boolean(
|
|
2913
2913
|
value && typeof value === "object" && "schema" in value && "batches" in value && Array.isArray(value.batches) && "numRows" in value && typeof value.numRows === "number" && "getChildAt" in value && typeof value.getChildAt === "function"
|
|
2914
2914
|
);
|
|
@@ -3114,7 +3114,7 @@ var init_arrow_fixed_size_list_utils = __esm({
|
|
|
3114
3114
|
});
|
|
3115
3115
|
|
|
3116
3116
|
// ../core/src/schema-utils/lib/mesh/convert-mesh-to-table.ts
|
|
3117
|
-
function
|
|
3117
|
+
function convertMeshToArrowTable(mesh) {
|
|
3118
3118
|
var _a;
|
|
3119
3119
|
return makeMeshArrowTable(mesh.attributes, {
|
|
3120
3120
|
schema: mesh.schema,
|
|
@@ -3137,22 +3137,14 @@ function makeMeshArrowTable(attributes, options = {}) {
|
|
|
3137
3137
|
fields.push(
|
|
3138
3138
|
getAttributeArrowField(options.schema, attributeName, column, attribute.componentType)
|
|
3139
3139
|
);
|
|
3140
|
-
if (attributeName ===
|
|
3140
|
+
if (attributeName === attributeNames[0] && ((_b = (_a = options.indices) == null ? void 0 : _a.value) == null ? void 0 : _b.length)) {
|
|
3141
3141
|
const indicesField = indexedMeshArrowSchema.fields.find((field) => field.name === "indices");
|
|
3142
3142
|
columns.indices = getIndicesVector(options.indices.value, column.length, indicesField.type);
|
|
3143
3143
|
fields.push(indicesField);
|
|
3144
3144
|
}
|
|
3145
3145
|
}
|
|
3146
3146
|
const arrowSchema = new arrow4.Schema(fields, getMeshArrowMetadata(options));
|
|
3147
|
-
|
|
3148
|
-
const schema = serializeArrowSchema(table.schema);
|
|
3149
|
-
return {
|
|
3150
|
-
shape: "arrow-table",
|
|
3151
|
-
schema,
|
|
3152
|
-
data: table,
|
|
3153
|
-
topology: options.topology || "point-list",
|
|
3154
|
-
indices: options.indices
|
|
3155
|
-
};
|
|
3147
|
+
return ((_c = columns[attributeNames[0]]) == null ? void 0 : _c.length) === 0 ? new arrow4.Table(arrowSchema) : new arrow4.Table(arrowSchema, columns);
|
|
3156
3148
|
}
|
|
3157
3149
|
function getAttributeArrowVector(value, size, componentType) {
|
|
3158
3150
|
if (componentType === "float16") {
|
|
@@ -3279,19 +3271,11 @@ var init_convert_mesh_to_table = __esm({
|
|
|
3279
3271
|
|
|
3280
3272
|
// ../core/src/schema-utils/lib/mesh/convert-table-to-mesh.ts
|
|
3281
3273
|
function convertTableToMesh(table) {
|
|
3282
|
-
if (
|
|
3283
|
-
|
|
3284
|
-
// case 'columnar-table':
|
|
3285
|
-
// return convertColumnarTableToMesh(table);
|
|
3286
|
-
case "arrow-table":
|
|
3287
|
-
return convertArrowTableToMesh(table);
|
|
3288
|
-
default:
|
|
3289
|
-
throw new Error(table.shape);
|
|
3290
|
-
}
|
|
3274
|
+
if (isArrowTable(table)) return convertArrowTableToMesh(table);
|
|
3275
|
+
throw new Error(table.shape);
|
|
3291
3276
|
}
|
|
3292
|
-
function convertArrowTableToMesh(
|
|
3277
|
+
function convertArrowTableToMesh(arrowTable) {
|
|
3293
3278
|
var _a, _b;
|
|
3294
|
-
const arrowTable = isNativeArrowTable(table) ? table : table.data;
|
|
3295
3279
|
const schema = serializeArrowSchema(arrowTable.schema);
|
|
3296
3280
|
const localBounds = arrowTable.batches.length === 1 ? arrowTable.batches[0].metadata.get("boundingBox") : void 0;
|
|
3297
3281
|
if (localBounds) schema.metadata = { ...schema.metadata, boundingBox: localBounds };
|
|
@@ -3396,13 +3380,18 @@ function getAttributeTypedArray(attributeData, size) {
|
|
|
3396
3380
|
if (!(attributeData.type instanceof arrow5.FixedSizeList)) {
|
|
3397
3381
|
return attributeData.toArray();
|
|
3398
3382
|
}
|
|
3399
|
-
|
|
3383
|
+
if (attributeData.length === 0) {
|
|
3384
|
+
const EmptyStorage = attributeData.type.valueType.ArrayType;
|
|
3385
|
+
return new EmptyStorage(0);
|
|
3386
|
+
}
|
|
3387
|
+
const values = attributeData.data.find((chunk) => chunk.length > 0).children[0].values;
|
|
3400
3388
|
const TypedArrayConstructor = values.constructor;
|
|
3401
3389
|
const typedArray = new TypedArrayConstructor(attributeData.length * size);
|
|
3402
3390
|
let targetOffset = 0;
|
|
3403
3391
|
for (const data of attributeData.data) {
|
|
3404
|
-
const child = data.children[0];
|
|
3405
3392
|
const sourceLength = data.length * size;
|
|
3393
|
+
if (sourceLength === 0) continue;
|
|
3394
|
+
const child = data.children[0];
|
|
3406
3395
|
const sourceOffset = child.offset || data.offset * size;
|
|
3407
3396
|
const sourceStart = sourceOffset + sourceLength <= child.values.length ? sourceOffset : 0;
|
|
3408
3397
|
const source = child.values.subarray(sourceStart, sourceStart + sourceLength);
|
|
@@ -3641,7 +3630,7 @@ var init_point_cloud_tiler = __esm({
|
|
|
3641
3630
|
var _a, _b;
|
|
3642
3631
|
this.signal.throwIfAborted();
|
|
3643
3632
|
if (!("attributes" in input)) {
|
|
3644
|
-
const table =
|
|
3633
|
+
const table = input;
|
|
3645
3634
|
const buffers2 = /* @__PURE__ */ new Set();
|
|
3646
3635
|
let arrowBytes = 0;
|
|
3647
3636
|
const checkData = (data) => {
|
|
@@ -3885,7 +3874,7 @@ var init_point_cloud_tile_source = __esm({
|
|
|
3885
3874
|
const mesh = await this.tiler.getTileMesh(tile.id);
|
|
3886
3875
|
if (!mesh.header.vertexCount) return null;
|
|
3887
3876
|
return {
|
|
3888
|
-
data:
|
|
3877
|
+
data: convertMeshToArrowTable(mesh),
|
|
3889
3878
|
pointCount: mesh.header.vertexCount,
|
|
3890
3879
|
cartographicOrigin: [0, 0, 0],
|
|
3891
3880
|
coordinateSystem: "cartesian",
|
|
@@ -4301,18 +4290,7 @@ function getFrameState(viewport, frameNumber, options = {}) {
|
|
|
4301
4290
|
enuToFixedTransform.transformAsVector(new import_core2.Vector3(cameraUp).scale(metersPerUnit))
|
|
4302
4291
|
).normalize();
|
|
4303
4292
|
commonSpacePlanesToWGS84(viewport);
|
|
4304
|
-
const
|
|
4305
|
-
const { longitude, latitude, width, bearing, zoom, position } = viewport;
|
|
4306
|
-
const topDownViewport = new ViewportClass({
|
|
4307
|
-
longitude,
|
|
4308
|
-
latitude,
|
|
4309
|
-
height,
|
|
4310
|
-
width,
|
|
4311
|
-
bearing,
|
|
4312
|
-
zoom,
|
|
4313
|
-
position,
|
|
4314
|
-
pitch: 0
|
|
4315
|
-
});
|
|
4293
|
+
const topDownViewport = getTopDownViewport(viewport);
|
|
4316
4294
|
const verticalFieldOfView = Number.isFinite(viewport.fovy) && Number(viewport.fovy) > 0 && Number(viewport.fovy) < 180 ? Number(viewport.fovy) * Math.PI / 180 : Math.PI / 3;
|
|
4317
4295
|
return {
|
|
4318
4296
|
camera: {
|
|
@@ -4355,7 +4333,7 @@ function limitSelectedTiles(tiles, frameState, maximumTilesSelected) {
|
|
|
4355
4333
|
return [tiles, []];
|
|
4356
4334
|
}
|
|
4357
4335
|
const tuples = [];
|
|
4358
|
-
const
|
|
4336
|
+
const [viewportLongitude, viewportLatitude] = getViewportLongitudeLatitude(frameState.viewport);
|
|
4359
4337
|
for (const [index, tile] of tiles.entries()) {
|
|
4360
4338
|
const [longitude, latitude] = tile.header.mbs;
|
|
4361
4339
|
const deltaLon = Math.abs(viewportLongitude - longitude);
|
|
@@ -4374,6 +4352,31 @@ function limitSelectedTiles(tiles, frameState, maximumTilesSelected) {
|
|
|
4374
4352
|
}
|
|
4375
4353
|
return [selectedTiles, unselectedTiles];
|
|
4376
4354
|
}
|
|
4355
|
+
function getTopDownViewport(viewport) {
|
|
4356
|
+
if (viewport.getTopDownViewport) {
|
|
4357
|
+
return viewport.getTopDownViewport();
|
|
4358
|
+
}
|
|
4359
|
+
const ViewportClass = viewport.constructor;
|
|
4360
|
+
const { longitude, latitude, height, width, bearing, zoom, position } = viewport;
|
|
4361
|
+
return new ViewportClass({
|
|
4362
|
+
longitude,
|
|
4363
|
+
latitude,
|
|
4364
|
+
height,
|
|
4365
|
+
width,
|
|
4366
|
+
bearing,
|
|
4367
|
+
zoom,
|
|
4368
|
+
position,
|
|
4369
|
+
pitch: 0
|
|
4370
|
+
});
|
|
4371
|
+
}
|
|
4372
|
+
function getViewportLongitudeLatitude(viewport) {
|
|
4373
|
+
const { longitude, latitude } = viewport;
|
|
4374
|
+
if (Number.isFinite(longitude) && Number.isFinite(latitude)) {
|
|
4375
|
+
return [longitude, latitude];
|
|
4376
|
+
}
|
|
4377
|
+
const [centerLongitude, centerLatitude] = viewport.unprojectPosition(viewport.center);
|
|
4378
|
+
return [centerLongitude, centerLatitude];
|
|
4379
|
+
}
|
|
4377
4380
|
function commonSpacePlanesToWGS84(viewport) {
|
|
4378
4381
|
const frustumPlanes = viewport.getFrustumPlanes();
|
|
4379
4382
|
const nearCenterCommon = closestPointOnPlane(frustumPlanes.near, viewport.cameraPosition);
|
|
@@ -11723,7 +11726,7 @@ var PointCloudTileset = class {
|
|
|
11723
11726
|
};
|
|
11724
11727
|
|
|
11725
11728
|
// dist/point-cloud-tile-loader-types.js
|
|
11726
|
-
var VERSION3 = true ? "5.0.0-beta.
|
|
11729
|
+
var VERSION3 = true ? "5.0.0-beta.11" : "latest";
|
|
11727
11730
|
async function preloadPointCloudTileSource2() {
|
|
11728
11731
|
const { PointCloudTileLoaderWithParser: PointCloudTileLoaderWithParser2 } = await Promise.resolve().then(() => (init_point_cloud_tile_loader(), point_cloud_tile_loader_exports));
|
|
11729
11732
|
return PointCloudTileLoaderWithParser2;
|