@loaders.gl/tile-converter 5.0.0-alpha.1 → 5.0.0-alpha.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/LICENSE +14 -3
- package/README.md +497 -0
- package/dist/converter.min.cjs +210 -282
- package/dist/i3s-server/bin/i3s-server.min.cjs +106 -341
- package/dist/index.cjs +38586 -0
- package/dist/index.js +38557 -0
- package/dist/v5/adapters.cjs +3548 -0
- package/dist/v5/adapters.d.ts +33 -0
- package/dist/v5/adapters.js +3537 -0
- package/dist/v5/browser-sink.d.ts +37 -0
- package/dist/v5/browser-source.d.ts +38 -0
- package/dist/v5/browser-tileset-source.d.ts +70 -0
- package/dist/v5/browser.cjs +76 -0
- package/dist/v5/browser.d.ts +44 -0
- package/dist/v5/browser.js +75 -0
- package/dist/v5/conversion-api.d.ts +122 -0
- package/dist/v5/conversion-archive.d.ts +32 -0
- package/dist/v5/core.cjs +917 -0
- package/dist/v5/core.d.ts +16 -0
- package/dist/v5/core.js +899 -0
- package/dist/v5/feature-arrow.d.ts +36 -0
- package/dist/v5/i3s-mesh-conversion.d.ts +32 -0
- package/dist/v5/i3s-mesh-sink.d.ts +25 -0
- package/dist/v5/i3s-mesh-source-features.d.ts +13 -0
- package/dist/v5/i3s-mesh-source-material.d.ts +5 -0
- package/dist/v5/i3s-mesh-source.d.ts +30 -0
- package/dist/v5/index.cjs +73 -0
- package/dist/v5/index.d.ts +40 -0
- package/dist/v5/index.js +75 -0
- package/dist/v5/mesh-conversion.d.ts +71 -0
- package/dist/v5/mesh-draco.d.ts +8 -0
- package/dist/v5/mesh-features.d.ts +9 -0
- package/dist/v5/mesh-source-features.d.ts +21 -0
- package/dist/v5/mesh-source-texture.d.ts +6 -0
- package/dist/v5/mesh-source.d.ts +41 -0
- package/dist/v5/mesh-tileset-archive.d.ts +18 -0
- package/dist/v5/mesh-tileset-sink.d.ts +51 -0
- package/dist/v5/mesh.d.ts +86 -0
- package/dist/v5/point-cloud-conversion.d.ts +31 -0
- package/dist/v5/point-cloud-source-encoder.d.ts +46 -0
- package/dist/v5/point-cloud-source.d.ts +25 -0
- package/dist/v5/point-cloud-spatial.d.ts +22 -0
- package/dist/v5/point-cloud-tileset-sink.d.ts +28 -0
- package/dist/v5/point-cloud.d.ts +49 -0
- package/dist/v5/resource-fetcher.d.ts +18 -0
- package/dist/v5/resource-manifest.d.ts +58 -0
- package/dist/v5/spatial-conversion.d.ts +61 -0
- package/dist/v5/tileset-source.d.ts +21 -0
- package/package.json +52 -26
- package/src/common/README.md +5 -0
- package/src/index.ts +1 -2
- package/src/{3d-tiles-converter → v4/3d-tiles-converter}/3d-tiles-converter.ts +13 -2
- package/src/v4/3d-tiles-converter/helpers/validate-i3s-spatial-reference.ts +124 -0
- package/src/{deps-installer → v4/deps-installer}/deps-installer.ts +10 -7
- package/src/{i3s-converter → v4/i3s-converter}/helpers/batch-ids-extensions.ts +1 -1
- package/src/v4/i3s-converter/helpers/encode-string-attribute.ts +23 -0
- package/src/{i3s-converter → v4/i3s-converter}/helpers/geometry-converter.ts +30 -55
- package/src/{i3s-converter → v4/i3s-converter}/helpers/gltf-attributes.ts +5 -4
- package/src/{i3s-converter → v4/i3s-converter}/helpers/load-3d-tiles.ts +5 -9
- package/src/{i3s-converter → v4/i3s-converter}/i3s-converter.ts +6 -7
- package/src/{i3s-server → v4/i3s-server}/README.md +2 -2
- package/src/{i3s-server → v4/i3s-server}/routes/slpk-router.ts +1 -0
- package/src/v4/index.ts +2 -0
- package/src/{lib → v4/lib}/utils/compress-util.ts +8 -7
- package/src/v5/adapters.ts +75 -0
- package/src/v5/browser-sink.ts +130 -0
- package/src/v5/browser-source.ts +155 -0
- package/src/v5/browser-tileset-source.ts +328 -0
- package/src/v5/browser.ts +139 -0
- package/src/v5/conversion-api.ts +287 -0
- package/src/v5/conversion-archive.ts +85 -0
- package/src/v5/core.ts +61 -0
- package/src/v5/feature-arrow.ts +429 -0
- package/src/v5/i3s-mesh-conversion.ts +192 -0
- package/src/v5/i3s-mesh-sink.ts +351 -0
- package/src/v5/i3s-mesh-source-features.ts +279 -0
- package/src/v5/i3s-mesh-source-material.ts +157 -0
- package/src/v5/i3s-mesh-source.ts +227 -0
- package/src/v5/index.ts +131 -0
- package/src/v5/mesh-conversion.ts +230 -0
- package/src/v5/mesh-draco.ts +182 -0
- package/src/v5/mesh-features.ts +319 -0
- package/src/v5/mesh-source-features.ts +263 -0
- package/src/v5/mesh-source-texture.ts +169 -0
- package/src/v5/mesh-source.ts +422 -0
- package/src/v5/mesh-tileset-archive.ts +50 -0
- package/src/v5/mesh-tileset-sink.ts +324 -0
- package/src/v5/mesh.ts +526 -0
- package/src/v5/point-cloud-conversion.ts +88 -0
- package/src/v5/point-cloud-source-encoder.ts +116 -0
- package/src/v5/point-cloud-source.ts +84 -0
- package/src/v5/point-cloud-spatial.ts +280 -0
- package/src/v5/point-cloud-tileset-sink.ts +234 -0
- package/src/v5/point-cloud.ts +398 -0
- package/src/v5/resource-fetcher.ts +110 -0
- package/src/v5/resource-manifest.ts +213 -0
- package/src/v5/spatial-conversion.ts +389 -0
- package/src/v5/tileset-source.ts +54 -0
- /package/src/{3d-tiles-converter → v4/3d-tiles-converter}/helpers/3d-tiles-content-converter.ts +0 -0
- /package/src/{3d-tiles-converter → v4/3d-tiles-converter}/helpers/i3s-obb-to-3d-tiles-obb.ts +0 -0
- /package/src/{3d-tiles-converter → v4/3d-tiles-converter}/helpers/load-i3s.ts +0 -0
- /package/src/{3d-tiles-converter → v4/3d-tiles-converter}/helpers/texture-atlas.ts +0 -0
- /package/src/{3d-tiles-converter → v4/3d-tiles-converter}/json-templates/tileset.ts +0 -0
- /package/src/{constants.ts → v4/constants.ts} +0 -0
- /package/src/{converter-cli.ts → v4/converter-cli.ts} +0 -0
- /package/src/{i3s-converter → v4/i3s-converter}/helpers/attribute-metadata-info.ts +0 -0
- /package/src/{i3s-converter → v4/i3s-converter}/helpers/coordinate-converter.ts +0 -0
- /package/src/{i3s-converter → v4/i3s-converter}/helpers/create-scene-server-path.ts +0 -0
- /package/src/{i3s-converter → v4/i3s-converter}/helpers/feature-attributes.ts +0 -0
- /package/src/{i3s-converter → v4/i3s-converter}/helpers/geometry-attributes.ts +0 -0
- /package/src/{i3s-converter → v4/i3s-converter}/helpers/node-debug.ts +0 -0
- /package/src/{i3s-converter → v4/i3s-converter}/helpers/node-index-document.ts +0 -0
- /package/src/{i3s-converter → v4/i3s-converter}/helpers/node-pages.ts +0 -0
- /package/src/{i3s-converter → v4/i3s-converter}/helpers/preprocess-3d-tiles.ts +0 -0
- /package/src/{i3s-converter → v4/i3s-converter}/helpers/progress.ts +0 -0
- /package/src/{i3s-converter → v4/i3s-converter}/helpers/tileset-traversal.ts +0 -0
- /package/src/{i3s-converter → v4/i3s-converter}/json-templates/geometry-definitions.ts +0 -0
- /package/src/{i3s-converter → v4/i3s-converter}/json-templates/layers.ts +0 -0
- /package/src/{i3s-converter → v4/i3s-converter}/json-templates/metadata.ts +0 -0
- /package/src/{i3s-converter → v4/i3s-converter}/json-templates/node.ts +0 -0
- /package/src/{i3s-converter → v4/i3s-converter}/json-templates/scene-server.ts +0 -0
- /package/src/{i3s-converter → v4/i3s-converter}/json-templates/shared-resources.ts +0 -0
- /package/src/{i3s-converter → v4/i3s-converter}/json-templates/store.ts +0 -0
- /package/src/{i3s-converter → v4/i3s-converter}/types.ts +0 -0
- /package/src/{i3s-server → v4/i3s-server}/app.ts +0 -0
- /package/src/{i3s-server → v4/i3s-server}/bin/www.ts +0 -0
- /package/src/{i3s-server → v4/i3s-server}/certs/cert.pem +0 -0
- /package/src/{i3s-server → v4/i3s-server}/certs/key.pem +0 -0
- /package/src/{i3s-server → v4/i3s-server}/controllers/slpk-controller.ts +0 -0
- /package/src/{i3s-server → v4/i3s-server}/utils/create-scene-server.ts +0 -0
- /package/src/{i3s-server → v4/i3s-server}/utils/server-utils.ts +0 -0
- /package/src/{lib → v4/lib}/json-schemas/conversion-dump-json-schema.ts +0 -0
- /package/src/{lib → v4/lib}/utils/cli-utils.ts +0 -0
- /package/src/{lib → v4/lib}/utils/conversion-dump.ts +0 -0
- /package/src/{lib → v4/lib}/utils/file-utils.ts +0 -0
- /package/src/{lib → v4/lib}/utils/geometry-utils.ts +0 -0
- /package/src/{lib → v4/lib}/utils/lod-conversion-utils.ts +0 -0
- /package/src/{lib → v4/lib}/utils/queue.ts +0 -0
- /package/src/{lib → v4/lib}/utils/statistic-utils.ts +0 -0
- /package/src/{lib → v4/lib}/utils/write-queue.ts +0 -0
- /package/src/{pgm-loader.ts → v4/pgm-loader.ts} +0 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ArrowTableBatch, Schema } from '@loaders.gl/schema';
|
|
2
|
+
/** Feature attributes and source identifier ready for Arrow normalization. */
|
|
3
|
+
export interface TileFeatureAttributes {
|
|
4
|
+
/** Stable feature identifier decoded from the source's feature-ID descriptor. */
|
|
5
|
+
readonly featureId: string | number | bigint;
|
|
6
|
+
/** Property values interpreted from the source metadata class. */
|
|
7
|
+
readonly properties: Readonly<Record<string, unknown>>;
|
|
8
|
+
/** Original class or property-table name, kept distinct between output batches. */
|
|
9
|
+
readonly metadataClass: string;
|
|
10
|
+
/** Optional original encoded metadata bytes, preserved without interpretation. */
|
|
11
|
+
readonly rawMetadata?: Uint8Array;
|
|
12
|
+
}
|
|
13
|
+
/** Explicit Arrow mapping and bounded output size for feature attribute batches. */
|
|
14
|
+
export interface FeatureArrowBatchOptions {
|
|
15
|
+
/** Declared output columns and types, including the feature-ID column. */
|
|
16
|
+
readonly schema: Schema;
|
|
17
|
+
/** Schema field receiving stable feature identifiers. Defaults to `feature_id`. */
|
|
18
|
+
readonly featureIdField?: string;
|
|
19
|
+
/** Optional binary field receiving source metadata bytes. */
|
|
20
|
+
readonly rawMetadataField?: string;
|
|
21
|
+
/** Maximum number of features in one emitted Arrow record batch. Defaults to 65,536. */
|
|
22
|
+
readonly batchSize?: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Converts decoded feature attributes to bounded Arrow batches using a caller-declared schema.
|
|
26
|
+
*
|
|
27
|
+
* Values retain their source primitive types; nested lists, structs, dictionary enums, and 64-bit
|
|
28
|
+
* identifiers use the corresponding schema field type. Missing schema fields and incompatible
|
|
29
|
+
* identifiers fail explicitly. Unknown properties are rejected so a class mapping cannot silently
|
|
30
|
+
* discard data. Separate metadata classes should be passed separately with their own schema.
|
|
31
|
+
*
|
|
32
|
+
* @param features - Features decoded from one source metadata class.
|
|
33
|
+
* @param options - Explicit Arrow schema and batch configuration.
|
|
34
|
+
* @returns Arrow table batches whose schema metadata records the source metadata class.
|
|
35
|
+
*/
|
|
36
|
+
export declare function convertFeatureAttributesToArrowBatches(features: readonly TileFeatureAttributes[], options: FeatureArrowBatchOptions): ArrowTableBatch[];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { EncodedI3SMeshLayer, I3SMeshWriterOptions, I3SDracoLibraryOptions } from '@loaders.gl/i3s';
|
|
2
|
+
import type { TileConversionCodec, TileConversionSink } from '@loaders.gl/tile-converter/v5/core';
|
|
3
|
+
import type { Tiles3DConversionSpatialContext, I3SConversionSpatialContext } from '@loaders.gl/tile-converter/v5/core';
|
|
4
|
+
import type { MeshSourceResource } from './mesh-source.js';
|
|
5
|
+
import type { BrowserTileConversionFile } from '@loaders.gl/tile-converter/v5/core';
|
|
6
|
+
/** One authored mesh layer, ready for the single-layer sink. */
|
|
7
|
+
export interface I3SMeshConversionResource extends EncodedI3SMeshLayer {
|
|
8
|
+
/** Source placement identifier used for diagnostics. */
|
|
9
|
+
readonly id: string;
|
|
10
|
+
}
|
|
11
|
+
/** Spatial preparation and required authoring limits for the I3S codec. */
|
|
12
|
+
export interface I3SMeshConversionCodecOptions extends Pick<I3SMeshWriterOptions, 'name' | 'maxPositionError' | 'maxResourceBytes'> {
|
|
13
|
+
/** Shared source-to-ECEF context, applied exactly once before I3S geographic encoding. */
|
|
14
|
+
readonly spatialContext: Tiles3DConversionSpatialContext | I3SConversionSpatialContext;
|
|
15
|
+
/** I3S vector frame when using an I3S context; defaults to earth-centered. */
|
|
16
|
+
readonly normalReferenceFrame?: 'earth-centered' | 'vertex-reference-frame';
|
|
17
|
+
/** Lossless Edge Breaker geometry by default; false retains raw I3S geometry. */
|
|
18
|
+
readonly draco?: boolean;
|
|
19
|
+
/** Full Draco encoder/decoder runtime URLs or injected modules. */
|
|
20
|
+
readonly dracoLibraryOptions?: I3SDracoLibraryOptions;
|
|
21
|
+
}
|
|
22
|
+
/** Creates a portable source-mesh to I3S layer codec with explicit precision and feature diagnostics. */
|
|
23
|
+
export declare function createI3SMeshConversionCodec<TInspection = unknown>(options: I3SMeshConversionCodecOptions): TileConversionCodec<TInspection, MeshSourceResource, I3SMeshConversionResource>;
|
|
24
|
+
/** Atomic bounded output for one authored I3S layer. */
|
|
25
|
+
export interface SingleMeshI3SSink extends TileConversionSink<I3SMeshConversionResource> {
|
|
26
|
+
/** Archive-relative geometry, metadata and images visible only after successful finalization. */
|
|
27
|
+
getFiles(): readonly BrowserTileConversionFile[];
|
|
28
|
+
}
|
|
29
|
+
/** Creates an atomic bounded single-mesh I3S sink; pass finalized files to createTileConversionArchive. */
|
|
30
|
+
export declare function createSingleMeshI3SSink(options: {
|
|
31
|
+
/** Maximum retained compressed resource bytes; not peak conversion memory. */ readonly maxTotalBytes: number;
|
|
32
|
+
}): SingleMeshI3SSink;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { BrowserTileConversionFile, TileConversionSink } from '@loaders.gl/tile-converter/v5/core';
|
|
2
|
+
import type { I3SMeshConversionResource } from './i3s-mesh-conversion.js';
|
|
3
|
+
/** Bounded flat collection of mesh nodes sharing one I3S feature/geometry schema. */
|
|
4
|
+
export interface I3SMeshSinkOptions {
|
|
5
|
+
/** Maximum compressed bytes retained, including final layer/index metadata. */
|
|
6
|
+
readonly maxTotalBytes: number;
|
|
7
|
+
/** Maximum primitive placements, from one through 64. */
|
|
8
|
+
readonly maxMeshes: number;
|
|
9
|
+
/** Maximum decompressed or generated metadata/attribute resource bytes. */
|
|
10
|
+
readonly maxResourceBytes: number;
|
|
11
|
+
}
|
|
12
|
+
/** Atomic multi-mesh I3S output, ready for portable SLPK packaging. */
|
|
13
|
+
export interface I3SMeshSink extends TileConversionSink<I3SMeshConversionResource> {
|
|
14
|
+
/** Finalized files only; failed or unfinished conversion exposes no output. */
|
|
15
|
+
getFiles(): readonly BrowserTileConversionFile[];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Combines independently authored mesh resources into one flat I3S layer.
|
|
19
|
+
* Leaves retain geographic placements, compressed geometry and attributes. A shared schema is
|
|
20
|
+
* required; generated object IDs must be disjoint (the conversion codec allocates them).
|
|
21
|
+
* Finalization rebuilds legacy indices, paged indices and enclosing ECEF bounds, including a
|
|
22
|
+
* second page for the 64th leaf. No source LOD hierarchy is implied. Byte gates bound retained
|
|
23
|
+
* resources and metadata, not peak decoder/compressor memory.
|
|
24
|
+
*/
|
|
25
|
+
export declare function createI3SMeshSink(options: I3SMeshSinkOptions): I3SMeshSink;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { I3STileContent, I3SMeshFeatures } from '@loaders.gl/i3s';
|
|
2
|
+
import type { TilesetContentTraversalItem, TilesetSourceMetadata } from '@loaders.gl/tiles';
|
|
3
|
+
import type { MeshSourceFeatureOptions } from './mesh-source-features.js';
|
|
4
|
+
import type { MeshTilesetSourceOptions } from './mesh-source.js';
|
|
5
|
+
/** Explicit mapping of scalar I3S attribute resources and their geometry identifiers. */
|
|
6
|
+
export interface I3SMeshSourceFeatureOptions extends MeshSourceFeatureOptions {
|
|
7
|
+
/** Attribute column whose exact integer values identify the decoded geometry. */
|
|
8
|
+
readonly objectIdProperty: string;
|
|
9
|
+
/** Aggregate encoded attribute byte limit for each node, checked before parsing. */
|
|
10
|
+
readonly maxAttributeBytes: number;
|
|
11
|
+
}
|
|
12
|
+
/** Reads exact scalar/string columns and constructs complete triangle-to-Arrow-row ownership. */
|
|
13
|
+
export declare function extractI3SMeshFeatures(content: I3STileContent, item: TilesetContentTraversalItem, metadata: TilesetSourceMetadata, options: I3SMeshSourceFeatureOptions, readExternalResource: MeshTilesetSourceOptions['readExternalResource'], contentUri: string | undefined, signal?: AbortSignal): Promise<I3SMeshFeatures>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { I3STileContent, I3STileHeader } from '@loaders.gl/i3s';
|
|
2
|
+
import type { MeshTilesetSourceOptions } from './mesh-source.js';
|
|
3
|
+
import type { MeshTileMaterial } from './mesh.js';
|
|
4
|
+
/** Maps normalized I3S factors and one encoded base-color PNG/JPEG with explicit wrapping. */
|
|
5
|
+
export declare function mapI3SMeshSourceMaterial(content: I3STileContent, header: Partial<I3STileHeader>, readExternalResource: MeshTilesetSourceOptions['readExternalResource'], contentUri: string | undefined, signal?: AbortSignal): Promise<MeshTileMaterial | undefined>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { I3STileContent, I3SMeshFeatures } from '@loaders.gl/i3s';
|
|
2
|
+
import type { Tileset3D, TilesetSourceMetadata, TilesetContentTraversalItem } from '@loaders.gl/tiles';
|
|
3
|
+
import type { TileConversionSource, TilesetConversionSourceOptions } from '@loaders.gl/tile-converter/v5/core';
|
|
4
|
+
import type { MeshSourceResource } from './mesh-source.js';
|
|
5
|
+
import type { MeshTilesetSourceOptions } from './mesh-source.js';
|
|
6
|
+
import type { I3SMeshSourceFeatureOptions } from './i3s-mesh-source-features.js';
|
|
7
|
+
export type { I3SMeshSourceFeatureOptions } from './i3s-mesh-source-features.js';
|
|
8
|
+
/** Selected I3S triangle, encoded base-color appearance and explicit-schema feature profile. */
|
|
9
|
+
export interface I3SMeshTilesetSourceOptions extends TilesetConversionSourceOptions {
|
|
10
|
+
/** Read scalar/string attribute resources with an explicit schema and geometry OID mapping. */
|
|
11
|
+
readonly features?: I3SMeshSourceFeatureOptions;
|
|
12
|
+
/** Application-owned bounded reader, including archive resolution, authentication and decompression. */
|
|
13
|
+
readonly readExternalResource?: MeshTilesetSourceOptions['readExternalResource'];
|
|
14
|
+
/** Custom alternative to features, for source semantics outside the scalar resource profile. */
|
|
15
|
+
readonly getFeatures?: (content: I3STileContent, item: TilesetContentTraversalItem, metadata: TilesetSourceMetadata, signal?: AbortSignal) => I3SMeshFeatures | Promise<I3SMeshFeatures>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Reads original absolute I3S positions through camera-independent traversal.
|
|
19
|
+
* Use a dedicated runtime with i3s.geometryMode='source'. The shared I3S spatial codec owns
|
|
20
|
+
* units, elevation and reprojection; this source never consumes renderer placement matrices.
|
|
21
|
+
* Pair the GLB codec with autoOrigin=true, or select an explicit target origin on the resources.
|
|
22
|
+
* Positions/normals/TEXCOORD_0, basic PBR factors and one encoded PNG/JPEG base-color texture
|
|
23
|
+
* are supported. Vertex colors, UV regions, additional attributes and segmentation fail explicitly.
|
|
24
|
+
* Features require an explicit schema/resource reader or a custom Arrow mapper.
|
|
25
|
+
* Unsafe decoded numeric geometry identifiers are rejected; exact property IDs use bigint.
|
|
26
|
+
* @param tileset - Dedicated I3S runtime using source-coordinate content decoding.
|
|
27
|
+
* @param options - Feature mapping and lifetime policy for content loaded during traversal.
|
|
28
|
+
* @returns A portable source of one absolute mesh per I3S node content.
|
|
29
|
+
*/
|
|
30
|
+
export declare function createI3SMeshTilesetConversionSource(tileset: Tileset3D, options?: I3SMeshTilesetSourceOptions): TileConversionSource<TilesetSourceMetadata, MeshSourceResource>;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/v5/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
TileConversionError: () => import_core.TileConversionError,
|
|
24
|
+
convertFeatureAttributesToArrowBatches: () => import_adapters.convertFeatureAttributesToArrowBatches,
|
|
25
|
+
convertPointCloudSource: () => import_adapters4.convertPointCloudSource,
|
|
26
|
+
convertTileset: () => import_core.convertTileset,
|
|
27
|
+
createI3SConversionSpatialContext: () => import_core3.createI3SConversionSpatialContext,
|
|
28
|
+
createI3SMeshConversionCodec: () => import_adapters11.createI3SMeshConversionCodec,
|
|
29
|
+
createI3SMeshSink: () => import_adapters12.createI3SMeshSink,
|
|
30
|
+
createI3SMeshTilesetConversionSource: () => import_adapters15.createI3SMeshTilesetConversionSource,
|
|
31
|
+
createManifestBackedTileConversionSink: () => import_core5.createManifestBackedTileConversionSink,
|
|
32
|
+
createMeshConversionCodec: () => import_adapters6.createMeshConversionCodec,
|
|
33
|
+
createMeshTilesetConversionSource: () => import_adapters10.createMeshTilesetConversionSource,
|
|
34
|
+
createPointCloudTilesetSink: () => import_adapters13.createPointCloudTilesetSink,
|
|
35
|
+
createSingleMeshI3SSink: () => import_adapters11.createSingleMeshI3SSink,
|
|
36
|
+
createSingleMeshTilesetArchive: () => import_adapters9.createSingleMeshTilesetArchive,
|
|
37
|
+
createSingleMeshTilesetSink: () => import_adapters7.createSingleMeshTilesetSink,
|
|
38
|
+
createTileConversionArchive: () => import_adapters8.createTileConversionArchive,
|
|
39
|
+
createTileConversionResourceFetcher: () => import_adapters12.createTileConversionResourceFetcher,
|
|
40
|
+
createTiles3DConversionSpatialContext: () => import_core3.createTiles3DConversionSpatialContext,
|
|
41
|
+
createTilesetConversionSource: () => import_core2.createTilesetConversionSource,
|
|
42
|
+
encodeMeshTile: () => import_adapters5.encodeMeshTile,
|
|
43
|
+
encodePointCloudSource: () => import_adapters3.encodePointCloudSource,
|
|
44
|
+
encodePointCloudSourceTile: () => import_adapters3.encodePointCloudSourceTile,
|
|
45
|
+
encodePointCloudTile: () => import_adapters2.encodePointCloudTile,
|
|
46
|
+
encodePointCloudTileWithMetadata: () => import_adapters2.encodePointCloudTileWithMetadata,
|
|
47
|
+
encodeTileConversionArchiveInBatches: () => import_adapters8.encodeTileConversionArchiveInBatches,
|
|
48
|
+
inspectTileset: () => import_core.inspectTileset,
|
|
49
|
+
transformPointCloudSourceTile: () => import_adapters14.transformPointCloudSourceTile,
|
|
50
|
+
traversePointCloudSource: () => import_core4.traversePointCloudSource,
|
|
51
|
+
validateTileset: () => import_core.validateTileset
|
|
52
|
+
});
|
|
53
|
+
module.exports = __toCommonJS(index_exports);
|
|
54
|
+
var import_core = require("@loaders.gl/tile-converter/v5/core");
|
|
55
|
+
var import_core2 = require("@loaders.gl/tile-converter/v5/core");
|
|
56
|
+
var import_core3 = require("@loaders.gl/tile-converter/v5/core");
|
|
57
|
+
var import_adapters = require("@loaders.gl/tile-converter/v5/adapters");
|
|
58
|
+
var import_adapters2 = require("@loaders.gl/tile-converter/v5/adapters");
|
|
59
|
+
var import_core4 = require("@loaders.gl/tile-converter/v5/core");
|
|
60
|
+
var import_adapters3 = require("@loaders.gl/tile-converter/v5/adapters");
|
|
61
|
+
var import_adapters4 = require("@loaders.gl/tile-converter/v5/adapters");
|
|
62
|
+
var import_core5 = require("@loaders.gl/tile-converter/v5/core");
|
|
63
|
+
var import_adapters5 = require("@loaders.gl/tile-converter/v5/adapters");
|
|
64
|
+
var import_adapters6 = require("@loaders.gl/tile-converter/v5/adapters");
|
|
65
|
+
var import_adapters7 = require("@loaders.gl/tile-converter/v5/adapters");
|
|
66
|
+
var import_adapters8 = require("@loaders.gl/tile-converter/v5/adapters");
|
|
67
|
+
var import_adapters9 = require("@loaders.gl/tile-converter/v5/adapters");
|
|
68
|
+
var import_adapters10 = require("@loaders.gl/tile-converter/v5/adapters");
|
|
69
|
+
var import_adapters11 = require("@loaders.gl/tile-converter/v5/adapters");
|
|
70
|
+
var import_adapters12 = require("@loaders.gl/tile-converter/v5/adapters");
|
|
71
|
+
var import_adapters13 = require("@loaders.gl/tile-converter/v5/adapters");
|
|
72
|
+
var import_adapters14 = require("@loaders.gl/tile-converter/v5/adapters");
|
|
73
|
+
var import_adapters15 = require("@loaders.gl/tile-converter/v5/adapters");
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export { convertTileset, inspectTileset, TileConversionError, validateTileset } from '@loaders.gl/tile-converter/v5/core';
|
|
2
|
+
export type { ConvertTilesetOptions, TileConversionCodec, TileConversionDiagnostic, TileConversionProgress, TileConversionReport, TileConversionSink, TileConversionSource, TileValidationReport, ValidateTilesetOptions } from '@loaders.gl/tile-converter/v5/core';
|
|
3
|
+
export { createTilesetConversionSource } from '@loaders.gl/tile-converter/v5/core';
|
|
4
|
+
export type { TilesetConversionSourceOptions } from '@loaders.gl/tile-converter/v5/core';
|
|
5
|
+
export { createI3SConversionSpatialContext, createTiles3DConversionSpatialContext } from '@loaders.gl/tile-converter/v5/core';
|
|
6
|
+
export type { I3SConversionSpatialContext, Tiles3DConversionSpatialContext } from '@loaders.gl/tile-converter/v5/core';
|
|
7
|
+
export { convertFeatureAttributesToArrowBatches } from '@loaders.gl/tile-converter/v5/adapters';
|
|
8
|
+
export type { FeatureArrowBatchOptions, TileFeatureAttributes } from '@loaders.gl/tile-converter/v5/adapters';
|
|
9
|
+
export { encodePointCloudTile, encodePointCloudTileWithMetadata } from '@loaders.gl/tile-converter/v5/adapters';
|
|
10
|
+
export type { EncodePointCloudTileOptions, EncodedPointCloudTile } from '@loaders.gl/tile-converter/v5/adapters';
|
|
11
|
+
export { traversePointCloudSource } from '@loaders.gl/tile-converter/v5/core';
|
|
12
|
+
export type { PointCloudSourceTile, TraversePointCloudSourceOptions } from '@loaders.gl/tile-converter/v5/core';
|
|
13
|
+
export { encodePointCloudSource, encodePointCloudSourceTile } from '@loaders.gl/tile-converter/v5/adapters';
|
|
14
|
+
export type { EncodedPointCloudSourceTile, EncodePointCloudSourceOptions } from '@loaders.gl/tile-converter/v5/adapters';
|
|
15
|
+
export { convertPointCloudSource } from '@loaders.gl/tile-converter/v5/adapters';
|
|
16
|
+
export type { ConvertPointCloudSourceOptions } from '@loaders.gl/tile-converter/v5/adapters';
|
|
17
|
+
export { createManifestBackedTileConversionSink } from '@loaders.gl/tile-converter/v5/core';
|
|
18
|
+
export type { ManifestBackedTileConversionSinkOptions, TileResourceManifest, TileResourceManifestEntry, TileResourceManifestStore } from '@loaders.gl/tile-converter/v5/core';
|
|
19
|
+
export { encodeMeshTile } from '@loaders.gl/tile-converter/v5/adapters';
|
|
20
|
+
export type { MeshTileMaterial, MeshTileOptions, MeshTileTexture, MeshTileSampler, MeshTileTextureTransform } from '@loaders.gl/tile-converter/v5/adapters';
|
|
21
|
+
export { createMeshConversionCodec } from '@loaders.gl/tile-converter/v5/adapters';
|
|
22
|
+
export type { MeshConversionInput, EncodedMeshConversionResource, MeshConversionCodecOptions } from '@loaders.gl/tile-converter/v5/adapters';
|
|
23
|
+
export { createSingleMeshTilesetSink } from '@loaders.gl/tile-converter/v5/adapters';
|
|
24
|
+
export type { SingleMeshTilesetSink, SingleMeshTilesetSinkOptions } from '@loaders.gl/tile-converter/v5/adapters';
|
|
25
|
+
export { createTileConversionArchive, encodeTileConversionArchiveInBatches } from '@loaders.gl/tile-converter/v5/adapters';
|
|
26
|
+
export type { TileConversionArchiveOptions } from '@loaders.gl/tile-converter/v5/adapters';
|
|
27
|
+
export { createSingleMeshTilesetArchive } from '@loaders.gl/tile-converter/v5/adapters';
|
|
28
|
+
export type { SingleMeshTilesetArchiveOptions } from '@loaders.gl/tile-converter/v5/adapters';
|
|
29
|
+
export { createMeshTilesetConversionSource } from '@loaders.gl/tile-converter/v5/adapters';
|
|
30
|
+
export type { MeshSourceResource, MeshTilesetSourceOptions, MeshSourceFeatureOptions } from '@loaders.gl/tile-converter/v5/adapters';
|
|
31
|
+
export { createI3SMeshConversionCodec, createSingleMeshI3SSink } from '@loaders.gl/tile-converter/v5/adapters';
|
|
32
|
+
export type { I3SMeshConversionResource, I3SMeshConversionCodecOptions, SingleMeshI3SSink } from '@loaders.gl/tile-converter/v5/adapters';
|
|
33
|
+
export { createI3SMeshSink, createTileConversionResourceFetcher } from '@loaders.gl/tile-converter/v5/adapters';
|
|
34
|
+
export type { I3SMeshSink, I3SMeshSinkOptions, TileConversionResourceFetcherOptions, MeshTileFeatures } from '@loaders.gl/tile-converter/v5/adapters';
|
|
35
|
+
export { createPointCloudTilesetSink } from '@loaders.gl/tile-converter/v5/adapters';
|
|
36
|
+
export type { PointCloudTilesetSink, PointCloudTilesetSinkOptions } from '@loaders.gl/tile-converter/v5/adapters';
|
|
37
|
+
export { transformPointCloudSourceTile } from '@loaders.gl/tile-converter/v5/adapters';
|
|
38
|
+
export type { PointCloudSpatialOptions } from '@loaders.gl/tile-converter/v5/adapters';
|
|
39
|
+
export { createI3SMeshTilesetConversionSource } from '@loaders.gl/tile-converter/v5/adapters';
|
|
40
|
+
export type { I3SMeshTilesetSourceOptions, I3SMeshSourceFeatureOptions } from '@loaders.gl/tile-converter/v5/adapters';
|
package/dist/v5/index.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// src/v5/index.ts
|
|
2
|
+
import {
|
|
3
|
+
convertTileset,
|
|
4
|
+
inspectTileset,
|
|
5
|
+
TileConversionError,
|
|
6
|
+
validateTileset
|
|
7
|
+
} from "@loaders.gl/tile-converter/v5/core";
|
|
8
|
+
import { createTilesetConversionSource } from "@loaders.gl/tile-converter/v5/core";
|
|
9
|
+
import {
|
|
10
|
+
createI3SConversionSpatialContext,
|
|
11
|
+
createTiles3DConversionSpatialContext
|
|
12
|
+
} from "@loaders.gl/tile-converter/v5/core";
|
|
13
|
+
import { convertFeatureAttributesToArrowBatches } from "@loaders.gl/tile-converter/v5/adapters";
|
|
14
|
+
import {
|
|
15
|
+
encodePointCloudTile,
|
|
16
|
+
encodePointCloudTileWithMetadata
|
|
17
|
+
} from "@loaders.gl/tile-converter/v5/adapters";
|
|
18
|
+
import { traversePointCloudSource } from "@loaders.gl/tile-converter/v5/core";
|
|
19
|
+
import {
|
|
20
|
+
encodePointCloudSource,
|
|
21
|
+
encodePointCloudSourceTile
|
|
22
|
+
} from "@loaders.gl/tile-converter/v5/adapters";
|
|
23
|
+
import { convertPointCloudSource } from "@loaders.gl/tile-converter/v5/adapters";
|
|
24
|
+
import { createManifestBackedTileConversionSink } from "@loaders.gl/tile-converter/v5/core";
|
|
25
|
+
import { encodeMeshTile } from "@loaders.gl/tile-converter/v5/adapters";
|
|
26
|
+
import { createMeshConversionCodec } from "@loaders.gl/tile-converter/v5/adapters";
|
|
27
|
+
import { createSingleMeshTilesetSink } from "@loaders.gl/tile-converter/v5/adapters";
|
|
28
|
+
import {
|
|
29
|
+
createTileConversionArchive,
|
|
30
|
+
encodeTileConversionArchiveInBatches
|
|
31
|
+
} from "@loaders.gl/tile-converter/v5/adapters";
|
|
32
|
+
import { createSingleMeshTilesetArchive } from "@loaders.gl/tile-converter/v5/adapters";
|
|
33
|
+
import { createMeshTilesetConversionSource } from "@loaders.gl/tile-converter/v5/adapters";
|
|
34
|
+
import {
|
|
35
|
+
createI3SMeshConversionCodec,
|
|
36
|
+
createSingleMeshI3SSink
|
|
37
|
+
} from "@loaders.gl/tile-converter/v5/adapters";
|
|
38
|
+
import {
|
|
39
|
+
createI3SMeshSink,
|
|
40
|
+
createTileConversionResourceFetcher
|
|
41
|
+
} from "@loaders.gl/tile-converter/v5/adapters";
|
|
42
|
+
import { createPointCloudTilesetSink } from "@loaders.gl/tile-converter/v5/adapters";
|
|
43
|
+
import { transformPointCloudSourceTile } from "@loaders.gl/tile-converter/v5/adapters";
|
|
44
|
+
import { createI3SMeshTilesetConversionSource } from "@loaders.gl/tile-converter/v5/adapters";
|
|
45
|
+
export {
|
|
46
|
+
TileConversionError,
|
|
47
|
+
convertFeatureAttributesToArrowBatches,
|
|
48
|
+
convertPointCloudSource,
|
|
49
|
+
convertTileset,
|
|
50
|
+
createI3SConversionSpatialContext,
|
|
51
|
+
createI3SMeshConversionCodec,
|
|
52
|
+
createI3SMeshSink,
|
|
53
|
+
createI3SMeshTilesetConversionSource,
|
|
54
|
+
createManifestBackedTileConversionSink,
|
|
55
|
+
createMeshConversionCodec,
|
|
56
|
+
createMeshTilesetConversionSource,
|
|
57
|
+
createPointCloudTilesetSink,
|
|
58
|
+
createSingleMeshI3SSink,
|
|
59
|
+
createSingleMeshTilesetArchive,
|
|
60
|
+
createSingleMeshTilesetSink,
|
|
61
|
+
createTileConversionArchive,
|
|
62
|
+
createTileConversionResourceFetcher,
|
|
63
|
+
createTiles3DConversionSpatialContext,
|
|
64
|
+
createTilesetConversionSource,
|
|
65
|
+
encodeMeshTile,
|
|
66
|
+
encodePointCloudSource,
|
|
67
|
+
encodePointCloudSourceTile,
|
|
68
|
+
encodePointCloudTile,
|
|
69
|
+
encodePointCloudTileWithMetadata,
|
|
70
|
+
encodeTileConversionArchiveInBatches,
|
|
71
|
+
inspectTileset,
|
|
72
|
+
transformPointCloudSourceTile,
|
|
73
|
+
traversePointCloudSource,
|
|
74
|
+
validateTileset
|
|
75
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { TilesetSpatialReference } from '@loaders.gl/tiles';
|
|
2
|
+
import type { MeshGeometry } from '@loaders.gl/schema';
|
|
3
|
+
import type { LoadLibraryOptions } from '@loaders.gl/worker-utils';
|
|
4
|
+
import type { TileConversionCodec } from '@loaders.gl/tile-converter/v5/core';
|
|
5
|
+
import type { Tiles3DConversionSpatialContext, I3SConversionSpatialContext } from '@loaders.gl/tile-converter/v5/core';
|
|
6
|
+
import type { MeshTileFeatures } from './mesh-features.js';
|
|
7
|
+
import type { MeshTileMaterial } from './mesh.js';
|
|
8
|
+
/** Explicitly selected geometry, with positions already in the spatial context's source frame. */
|
|
9
|
+
export interface MeshConversionInput {
|
|
10
|
+
/** Caller-owned resource identifier, forwarded to the output sink. */
|
|
11
|
+
readonly id: string;
|
|
12
|
+
/** Triangle geometry with absolute packed Float32 or Float64 source positions. */
|
|
13
|
+
readonly mesh: MeshGeometry;
|
|
14
|
+
/** Original I3S vector basis; overrides the codec default when supplied by a source. */
|
|
15
|
+
readonly normalReferenceFrame?: 'earth-centered' | 'vertex-reference-frame';
|
|
16
|
+
/** Optional single material with an embedded base-color image, mapped explicitly by the source adapter. */
|
|
17
|
+
readonly material?: MeshTileMaterial;
|
|
18
|
+
/** Explicit feature table and triangle associations, written as structural metadata. */
|
|
19
|
+
readonly features?: MeshTileFeatures;
|
|
20
|
+
/** Finite xyz origin in the target frame, subtracted before float32 encoding. */
|
|
21
|
+
readonly origin: readonly [number, number, number];
|
|
22
|
+
}
|
|
23
|
+
/** A completed GLB resource and the metadata needed to place its local geometry. */
|
|
24
|
+
export interface EncodedMeshConversionResource {
|
|
25
|
+
/** Caller-owned resource identifier. */
|
|
26
|
+
readonly id: string;
|
|
27
|
+
/** Self-contained GLB with local positions and transformed normals. */
|
|
28
|
+
readonly glb: ArrayBuffer;
|
|
29
|
+
/** Target-frame translation to add to the encoded positions. */
|
|
30
|
+
readonly origin: readonly [number, number, number];
|
|
31
|
+
/** Target-frame bounds of the reconstructed encoded vertices, including float32 rounding. */
|
|
32
|
+
readonly boundingBox: readonly [readonly number[], readonly number[]];
|
|
33
|
+
/** Bounds of encoded local vertices before adding the origin, without absolute-coordinate cancellation. */
|
|
34
|
+
readonly localBoundingBox: readonly [readonly number[], readonly number[]];
|
|
35
|
+
/** Metadata describing the output coordinate operation and height reference. */
|
|
36
|
+
readonly spatialReference: TilesetSpatialReference;
|
|
37
|
+
/** Largest measured Euclidean reconstruction error in target coordinate units. */
|
|
38
|
+
readonly maximumPositionError: number;
|
|
39
|
+
}
|
|
40
|
+
/** Spatial policy used by the concrete mesh conversion codec. */
|
|
41
|
+
export interface MeshConversionCodecOptions {
|
|
42
|
+
/** Shared context that accepts absolute source positions and returns absolute target positions. */
|
|
43
|
+
readonly spatialContext: Tiles3DConversionSpatialContext | I3SConversionSpatialContext;
|
|
44
|
+
/** I3S vector frame when using an I3S context; defaults to earth-centered. */
|
|
45
|
+
readonly normalReferenceFrame?: 'earth-centered' | 'vertex-reference-frame';
|
|
46
|
+
/** Rebase around the transformed bounds center instead of the resource's explicit origin. */
|
|
47
|
+
readonly autoOrigin?: boolean;
|
|
48
|
+
/** Maximum Euclidean reconstruction error per vertex, in target coordinate units. */
|
|
49
|
+
readonly maxPositionError: number;
|
|
50
|
+
/** Lossless Draco Edge Breaker is enabled by default; false emits uncompressed GLB geometry. */
|
|
51
|
+
readonly draco?: boolean;
|
|
52
|
+
/** Optional local/CDN library locations or injected Draco runtimes for compression and verification. */
|
|
53
|
+
readonly dracoLibraryOptions?: LoadLibraryOptions;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Creates a concrete mesh codec for `convertTileset`.
|
|
57
|
+
*
|
|
58
|
+
* Source adapters must select geometry and apply source placement before supplying absolute
|
|
59
|
+
* positions and matching normals. This codec applies the supplied spatial context once, rebases
|
|
60
|
+
* around each input's target origin, and rejects rounding above the explicit error budget.
|
|
61
|
+
* Lossless Draco Edge Breaker is enabled by default; decoded positions determine output bounds.
|
|
62
|
+
* Set draco to false for uncompressed geometry. Quantization is not enabled by this profile.
|
|
63
|
+
* Geographic and unknown output frames are rejected. The returned origin/bounds/reference are
|
|
64
|
+
* external placement metadata; applications own axis conventions, hierarchy, and packaging.
|
|
65
|
+
* Input arrays are not mutated. Core input/output byte gates, cancellation, awaited writes, and
|
|
66
|
+
* destination finalize/abort handling apply when used through `convertTileset`.
|
|
67
|
+
*
|
|
68
|
+
* @param options - Resolved spatial context and finite nonnegative target-unit precision budget.
|
|
69
|
+
* @returns One GLB and matching metadata per input geometry.
|
|
70
|
+
*/
|
|
71
|
+
export declare function createMeshConversionCodec<TInspection = unknown>(options: MeshConversionCodecOptions): TileConversionCodec<TInspection, MeshConversionInput, EncodedMeshConversionResource>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MeshGeometry } from '@loaders.gl/schema';
|
|
2
|
+
import type { LoadLibraryOptions } from '@loaders.gl/worker-utils';
|
|
3
|
+
import { type MeshTileOptions } from './mesh.js';
|
|
4
|
+
/** Encodes the validated single-mesh profile with lossless Edge Breaker and no raw fallback. */
|
|
5
|
+
export declare function encodeDracoMeshTile(geometry: MeshGeometry, options: MeshTileOptions, libraryOptions?: LoadLibraryOptions): Promise<{
|
|
6
|
+
glb: ArrayBuffer;
|
|
7
|
+
positions: Float32Array;
|
|
8
|
+
}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { MeshGeometry } from '@loaders.gl/schema';
|
|
2
|
+
import type { GLTFScenegraph } from '@loaders.gl/gltf';
|
|
3
|
+
import type { I3SMeshFeatures } from '@loaders.gl/i3s';
|
|
4
|
+
/** Explicit-schema Arrow features; stable identifiers are distinct from geometry row indices. */
|
|
5
|
+
export type MeshTileFeatures = Pick<I3SMeshFeatures, 'batches' | 'triangleFeatureIndices' | 'featureIdField'>;
|
|
6
|
+
/** Expands shared vertices so each complete triangle retains its own feature row through Draco. */
|
|
7
|
+
export declare function prepareMeshFeatureGeometry(mesh: MeshGeometry, features?: MeshTileFeatures): MeshGeometry;
|
|
8
|
+
/** Writes one inline structural metadata table without number coercion or nullable sentinel collisions. */
|
|
9
|
+
export declare function encodeMeshFeatures(scenegraph: GLTFScenegraph, meshIndex: number, features?: MeshTileFeatures): void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { MeshGeometry } from '@loaders.gl/schema';
|
|
2
|
+
import type { GLTFPostprocessed, GLTFMeshPrimitivePostprocessed } from '@loaders.gl/gltf';
|
|
3
|
+
import type { I3SMeshFeatures } from '@loaders.gl/i3s';
|
|
4
|
+
import type { FeatureArrowBatchOptions } from './feature-arrow.js';
|
|
5
|
+
/** Explicit source feature mapping; target type changes must be authorized separately. */
|
|
6
|
+
export interface MeshSourceFeatureOptions extends FeatureArrowBatchOptions {
|
|
7
|
+
/** Batch-table class label, or the exact structural-metadata class to select. */
|
|
8
|
+
readonly metadataClass: string;
|
|
9
|
+
/** Optional source property providing stable identifiers; otherwise row indices are stable within the content. */
|
|
10
|
+
readonly sourceFeatureIdProperty?: string;
|
|
11
|
+
/** Explicit I3S representation for 64-bit integers; omission rejects those target fields. */
|
|
12
|
+
readonly integer64Encoding?: 'decimal-string';
|
|
13
|
+
}
|
|
14
|
+
/** Extracts legacy batch tables or one decoded modern property table and validates geometry ownership. */
|
|
15
|
+
export declare function extractMeshFeatures(gltf: GLTFPostprocessed, primitive: GLTFMeshPrimitivePostprocessed, payload: {
|
|
16
|
+
batchTableJson?: Record<string, unknown>;
|
|
17
|
+
header?: {
|
|
18
|
+
batchLength?: number;
|
|
19
|
+
};
|
|
20
|
+
featureTableJson?: Record<string, unknown>;
|
|
21
|
+
}, mesh: MeshGeometry, options?: MeshSourceFeatureOptions): I3SMeshFeatures | undefined;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { GLTFMaterialPostprocessed } from '@loaders.gl/gltf';
|
|
2
|
+
import type { MeshTileTexture } from './mesh.js';
|
|
3
|
+
/** Maps a buffer-view or base64 PNG/JPEG image, sampling and UV transform without decoding pixels. */
|
|
4
|
+
export declare function mapMeshSourceTexture(textureInfo: NonNullable<GLTFMaterialPostprocessed['pbrMetallicRoughness']>['baseColorTexture']): MeshTileTexture;
|
|
5
|
+
/** Resolves one external encoded image through an explicitly supplied application reader. */
|
|
6
|
+
export declare function resolveMeshSourceTexture(textureInfo: NonNullable<GLTFMaterialPostprocessed['pbrMetallicRoughness']>['baseColorTexture'], readExternalResource: ((uri: string, contentUri: string | undefined, signal?: AbortSignal) => Promise<Uint8Array>) | undefined, contentUri: string | undefined, signal?: AbortSignal): Promise<MeshTileTexture>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { GLTFMaterialPostprocessed } from '@loaders.gl/gltf';
|
|
2
|
+
import type { Tileset3D, TilesetSourceMetadata } from '@loaders.gl/tiles';
|
|
3
|
+
import type { TileConversionSource } from '@loaders.gl/tile-converter/v5/core';
|
|
4
|
+
import type { TilesetConversionSourceOptions } from '@loaders.gl/tile-converter/v5/core';
|
|
5
|
+
import type { MeshConversionInput } from './mesh-conversion.js';
|
|
6
|
+
import type { MeshTileMaterial } from './mesh.js';
|
|
7
|
+
import type { MeshSourceFeatureOptions } from './mesh-source-features.js';
|
|
8
|
+
import type { I3SMeshFeatures } from '@loaders.gl/i3s';
|
|
9
|
+
export type { MeshSourceFeatureOptions } from './mesh-source-features.js';
|
|
10
|
+
/** Source mesh with optional explicit-schema feature data and triangle association. */
|
|
11
|
+
export interface MeshSourceResource extends MeshConversionInput {
|
|
12
|
+
/** Arrow features associated with the selected primitive; IDs are distinct from table row indices. */
|
|
13
|
+
readonly features?: I3SMeshFeatures;
|
|
14
|
+
}
|
|
15
|
+
/** Narrow source profile and content lifetime controls. */
|
|
16
|
+
export interface MeshTilesetSourceOptions extends TilesetConversionSourceOptions {
|
|
17
|
+
/** Required when the source has batch/structural metadata; no schema is inferred. */
|
|
18
|
+
readonly features?: MeshSourceFeatureOptions;
|
|
19
|
+
/** Explicit bounded reader for external encoded images, relative to the content URI. */
|
|
20
|
+
readonly readExternalResource?: (uri: string, contentUri: string | undefined, signal?: AbortSignal) => Promise<Uint8Array>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Extracts static GLB/B3DM primitives from a native ECEF 3D Tiles runtime, including
|
|
24
|
+
* optional buffer-view or base64 data-URI PNG/JPEG images, TEXCOORD_0, glTF sampling and
|
|
25
|
+
* KHR_texture_transform controls on TEXCOORD_0. Decode content with
|
|
26
|
+
* `gltf.excludeExtensions: {KHR_texture_transform: false}` to retain authored UVs/transforms.
|
|
27
|
+
* Triangle strips are expanded with alternating winding; the glTF loader already expands fans.
|
|
28
|
+
* Shared traversal retains placement identity and unloads content according to the supplied policy.
|
|
29
|
+
* The adapter applies node transforms, glTF up-axis correction, RTC translation, and tile placement
|
|
30
|
+
* once, retaining Float64 absolute positions and inverse-transpose unit normals. Animation, skins,
|
|
31
|
+
* morphs, instancing, broader texture semantics, unknown extensions, non-affine/mirrored
|
|
32
|
+
* placements, and
|
|
33
|
+
* metadata outside the declared feature profile fail explicitly. Multiple resources can be read;
|
|
34
|
+
* collection sinks accept bounded multiple placements; the compatibility single-mesh sink rejects a second resource.
|
|
35
|
+
* @param tileset - Dedicated native EPSG:4978 runtime with decoded glTF content enabled.
|
|
36
|
+
* @param options - Explicit feature schema/mapping and optional decoded-content cleanup.
|
|
37
|
+
* @returns Portable conversion source; COLOR_0 is preserved for GLB, while I3S rejects vertex colors.
|
|
38
|
+
*/
|
|
39
|
+
export declare function createMeshTilesetConversionSource(tileset: Tileset3D, options?: MeshTilesetSourceOptions): TileConversionSource<TilesetSourceMetadata, MeshSourceResource>;
|
|
40
|
+
/** Maps supported PBR controls and an embedded base-color image, rejecting unmapped semantics. */
|
|
41
|
+
export declare function mapMeshSourceMaterial(material: GLTFMaterialPostprocessed | undefined, readExternalResource: MeshTilesetSourceOptions['readExternalResource'], contentUri: string | undefined, signal?: AbortSignal): Promise<MeshTileMaterial | undefined>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { BrowserTileConversionFile } from '@loaders.gl/tile-converter/v5/core';
|
|
2
|
+
/** Output-size budget for a single-mesh 3TZ archive. */
|
|
3
|
+
export interface SingleMeshTilesetArchiveOptions {
|
|
4
|
+
/** Maximum final archive bytes, including ZIP headers and index; not peak serialization memory. */
|
|
5
|
+
readonly maxArchiveBytes: number;
|
|
6
|
+
/** Cooperative packaging cancellation; active Blob reads and entry encodes finish first. */
|
|
7
|
+
readonly signal?: AbortSignal;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Packages the two unmodified files from a finalized single-mesh sink as a downloadable 3TZ Blob.
|
|
11
|
+
* The writer checks the complete archive budget before reading either Blob. Applications own
|
|
12
|
+
* object-URL creation/revocation and download UI. Retained input Blobs and transient ZIP buffers
|
|
13
|
+
* are additional memory. SLPK requires separately authored I3S scene-layer resources.
|
|
14
|
+
* @param files - Files returned by a successfully finalized createSingleMeshTilesetSink.
|
|
15
|
+
* @param options - Required final archive-size budget.
|
|
16
|
+
* @returns An indexed 3TZ Blob; save with the .3tz extension.
|
|
17
|
+
*/
|
|
18
|
+
export declare function createSingleMeshTilesetArchive(files: readonly BrowserTileConversionFile[], options: SingleMeshTilesetArchiveOptions): Promise<Blob>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { TileConversionSink } from '@loaders.gl/tile-converter/v5/core';
|
|
2
|
+
import type { BrowserTileConversionFile } from '@loaders.gl/tile-converter/v5/core';
|
|
3
|
+
import type { EncodedMeshConversionResource } from './mesh-conversion.js';
|
|
4
|
+
/** Limits and fidelity policy for one ECEF mesh tileset. */
|
|
5
|
+
export interface SingleMeshTilesetSinkOptions {
|
|
6
|
+
/** Maximum combined UTF-8 tileset JSON and GLB Blob bytes retained by the sink. */
|
|
7
|
+
readonly maxTotalBytes: number;
|
|
8
|
+
/** Explicit geometric error in meters, including source error and position rounding. */
|
|
9
|
+
readonly geometricError: number;
|
|
10
|
+
}
|
|
11
|
+
/** A single-tile output package retained as two named browser-native Blobs. */
|
|
12
|
+
export interface SingleMeshTilesetSink extends TileConversionSink<EncodedMeshConversionResource> {
|
|
13
|
+
/** Returns mesh.glb and tileset.json only after successful finalization; empty after abort. */
|
|
14
|
+
getFiles(): readonly BrowserTileConversionFile[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Packages exactly one `createMeshConversionCodec` output as a 3D Tiles 1.1 tileset.
|
|
18
|
+
*
|
|
19
|
+
* Requires resolved EPSG:4978 output identified by the compact string, with ellipsoidal heights.
|
|
20
|
+
* The tile transform cancels the standard glTF y-up to z-up rotation and adds the ECEF origin.
|
|
21
|
+
* Bounds come from encoded local vertices, avoiding subtraction of large absolute coordinates.
|
|
22
|
+
* Fixed relative names keep the package deterministic. Save both files together or pass them to
|
|
23
|
+
* createSingleMeshTilesetArchive for 3TZ packaging. Applications own downloads, workers, and
|
|
24
|
+
* source-scene extraction.
|
|
25
|
+
* The byte limit bounds retained Blobs, not peak conversion/serialization memory. Input GLB and
|
|
26
|
+
* local bounds must be unmodified codec outputs; this sink does not independently validate GLB.
|
|
27
|
+
*
|
|
28
|
+
* @param options - Required retained-output budget and geometric error in meters.
|
|
29
|
+
* @returns A bounded sink that exposes files on finalization and clears them on abort.
|
|
30
|
+
*/
|
|
31
|
+
export declare function createSingleMeshTilesetSink(options: SingleMeshTilesetSinkOptions): SingleMeshTilesetSink;
|
|
32
|
+
/** Limits for an explicit collection of independent ECEF mesh leaves. */
|
|
33
|
+
export interface MeshTilesetSinkOptions extends SingleMeshTilesetSinkOptions {
|
|
34
|
+
/** Maximum mesh placements, including repeated content at distinct source placements. */
|
|
35
|
+
readonly maxMeshes: number;
|
|
36
|
+
}
|
|
37
|
+
/** Atomic mesh package with a contentless root and independently placed GLB leaves. */
|
|
38
|
+
export interface MeshTilesetSink extends TileConversionSink<EncodedMeshConversionResource> {
|
|
39
|
+
/** Returns deterministically named GLBs and tileset JSON only after finalization. */
|
|
40
|
+
getFiles(): readonly BrowserTileConversionFile[];
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Packages independent codec outputs as a bounded 3D Tiles 1.1 leaf collection.
|
|
44
|
+
* Each leaf retains its ECEF placement and encoded bounds; the contentless ADD root encloses
|
|
45
|
+
* all leaves. Its geometric error covers the enclosing diagonal; each leaf retains the
|
|
46
|
+
* supplied error. This authors a flat partial dataset, not the source LOD hierarchy. Callers must
|
|
47
|
+
* exclude overlapping parent/descendant LOD representations and provide a conservative error.
|
|
48
|
+
* Resource IDs identify placements, never output paths. Retained bytes include final JSON;
|
|
49
|
+
* maxMeshes bounds hierarchy metadata, while neither limit bounds peak conversion memory.
|
|
50
|
+
*/
|
|
51
|
+
export declare function createMeshTilesetSink(options: MeshTilesetSinkOptions): MeshTilesetSink;
|