@loaders.gl/3d-tiles 4.0.0-alpha.7 → 4.0.0-alpha.9
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/dist.min.js +317 -146
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/lib/parsers/helpers/normalize-3d-tile-colors.js +4 -3
- package/dist/es5/lib/parsers/helpers/normalize-3d-tile-colors.js.map +1 -1
- package/dist/es5/lib/parsers/helpers/normalize-3d-tile-normals.js +2 -2
- package/dist/es5/lib/parsers/helpers/normalize-3d-tile-normals.js.map +1 -1
- package/dist/es5/lib/parsers/helpers/parse-3d-implicit-tiles.js.map +1 -1
- package/dist/es5/lib/parsers/helpers/parse-3d-tile-gltf-view.js +30 -18
- package/dist/es5/lib/parsers/helpers/parse-3d-tile-gltf-view.js.map +1 -1
- package/dist/es5/lib/parsers/helpers/parse-3d-tile-header.js.map +1 -1
- package/dist/es5/lib/parsers/helpers/parse-3d-tile-tables.js +12 -12
- package/dist/es5/lib/parsers/helpers/parse-3d-tile-tables.js.map +1 -1
- package/dist/es5/lib/parsers/parse-3d-tile-batched-model.js.map +1 -1
- package/dist/es5/lib/parsers/parse-3d-tile-composite.js +1 -1
- package/dist/es5/lib/parsers/parse-3d-tile-composite.js.map +1 -1
- package/dist/es5/lib/parsers/parse-3d-tile-gltf.js +19 -4
- package/dist/es5/lib/parsers/parse-3d-tile-gltf.js.map +1 -1
- package/dist/es5/lib/parsers/parse-3d-tile-header.js +98 -80
- package/dist/es5/lib/parsers/parse-3d-tile-header.js.map +1 -1
- package/dist/es5/lib/parsers/parse-3d-tile-instanced-model.js +12 -21
- package/dist/es5/lib/parsers/parse-3d-tile-instanced-model.js.map +1 -1
- package/dist/es5/lib/parsers/parse-3d-tile-point-cloud.js +29 -5
- package/dist/es5/lib/parsers/parse-3d-tile-point-cloud.js.map +1 -1
- package/dist/es5/lib/parsers/parse-3d-tile.js.map +1 -1
- package/dist/es5/lib/utils/version.js +1 -1
- package/dist/es5/tiles-3d-loader.js +26 -31
- package/dist/es5/tiles-3d-loader.js.map +1 -1
- package/dist/es5/types.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/parsers/helpers/normalize-3d-tile-colors.js +3 -3
- package/dist/esm/lib/parsers/helpers/normalize-3d-tile-colors.js.map +1 -1
- package/dist/esm/lib/parsers/helpers/normalize-3d-tile-normals.js +2 -2
- package/dist/esm/lib/parsers/helpers/normalize-3d-tile-normals.js.map +1 -1
- package/dist/esm/lib/parsers/helpers/parse-3d-implicit-tiles.js.map +1 -1
- package/dist/esm/lib/parsers/helpers/parse-3d-tile-gltf-view.js +15 -9
- package/dist/esm/lib/parsers/helpers/parse-3d-tile-gltf-view.js.map +1 -1
- package/dist/esm/lib/parsers/helpers/parse-3d-tile-header.js.map +1 -1
- package/dist/esm/lib/parsers/helpers/parse-3d-tile-tables.js +7 -7
- package/dist/esm/lib/parsers/helpers/parse-3d-tile-tables.js.map +1 -1
- package/dist/esm/lib/parsers/parse-3d-tile-batched-model.js.map +1 -1
- package/dist/esm/lib/parsers/parse-3d-tile-composite.js +1 -1
- package/dist/esm/lib/parsers/parse-3d-tile-composite.js.map +1 -1
- package/dist/esm/lib/parsers/parse-3d-tile-gltf.js +15 -7
- package/dist/esm/lib/parsers/parse-3d-tile-gltf.js.map +1 -1
- package/dist/esm/lib/parsers/parse-3d-tile-header.js +62 -45
- package/dist/esm/lib/parsers/parse-3d-tile-header.js.map +1 -1
- package/dist/esm/lib/parsers/parse-3d-tile-instanced-model.js +12 -21
- package/dist/esm/lib/parsers/parse-3d-tile-instanced-model.js.map +1 -1
- package/dist/esm/lib/parsers/parse-3d-tile-point-cloud.js +23 -2
- package/dist/esm/lib/parsers/parse-3d-tile-point-cloud.js.map +1 -1
- package/dist/esm/lib/parsers/parse-3d-tile.js.map +1 -1
- package/dist/esm/lib/utils/version.js +1 -1
- package/dist/esm/tiles-3d-loader.js +18 -12
- package/dist/esm/tiles-3d-loader.js.map +1 -1
- package/dist/esm/types.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/lib/parsers/helpers/normalize-3d-tile-colors.d.ts +4 -2
- package/dist/lib/parsers/helpers/normalize-3d-tile-colors.d.ts.map +1 -1
- package/dist/lib/parsers/helpers/normalize-3d-tile-colors.js +3 -3
- package/dist/lib/parsers/helpers/normalize-3d-tile-normals.d.ts +3 -2
- package/dist/lib/parsers/helpers/normalize-3d-tile-normals.d.ts.map +1 -1
- package/dist/lib/parsers/helpers/normalize-3d-tile-normals.js +2 -2
- package/dist/lib/parsers/helpers/parse-3d-implicit-tiles.d.ts.map +1 -1
- package/dist/lib/parsers/helpers/parse-3d-tile-gltf-view.d.ts +5 -2
- package/dist/lib/parsers/helpers/parse-3d-tile-gltf-view.d.ts.map +1 -1
- package/dist/lib/parsers/helpers/parse-3d-tile-gltf-view.js +15 -9
- package/dist/lib/parsers/helpers/parse-3d-tile-header.d.ts +2 -1
- package/dist/lib/parsers/helpers/parse-3d-tile-header.d.ts.map +1 -1
- package/dist/lib/parsers/helpers/parse-3d-tile-tables.d.ts +4 -2
- package/dist/lib/parsers/helpers/parse-3d-tile-tables.d.ts.map +1 -1
- package/dist/lib/parsers/helpers/parse-3d-tile-tables.js +7 -7
- package/dist/lib/parsers/parse-3d-tile-batched-model.d.ts +4 -1
- package/dist/lib/parsers/parse-3d-tile-batched-model.d.ts.map +1 -1
- package/dist/lib/parsers/parse-3d-tile-batched-model.js +1 -1
- package/dist/lib/parsers/parse-3d-tile-composite.d.ts +3 -2
- package/dist/lib/parsers/parse-3d-tile-composite.d.ts.map +1 -1
- package/dist/lib/parsers/parse-3d-tile-composite.js +1 -1
- package/dist/lib/parsers/parse-3d-tile-gltf.d.ts +2 -1
- package/dist/lib/parsers/parse-3d-tile-gltf.d.ts.map +1 -1
- package/dist/lib/parsers/parse-3d-tile-gltf.js +13 -5
- package/dist/lib/parsers/parse-3d-tile-header.d.ts +5 -6
- package/dist/lib/parsers/parse-3d-tile-header.d.ts.map +1 -1
- package/dist/lib/parsers/parse-3d-tile-header.js +57 -42
- package/dist/lib/parsers/parse-3d-tile-instanced-model.d.ts +2 -1
- package/dist/lib/parsers/parse-3d-tile-instanced-model.d.ts.map +1 -1
- package/dist/lib/parsers/parse-3d-tile-instanced-model.js +11 -25
- package/dist/lib/parsers/parse-3d-tile-point-cloud.d.ts +3 -2
- package/dist/lib/parsers/parse-3d-tile-point-cloud.d.ts.map +1 -1
- package/dist/lib/parsers/parse-3d-tile-point-cloud.js +23 -2
- package/dist/lib/parsers/parse-3d-tile.d.ts +4 -1
- package/dist/lib/parsers/parse-3d-tile.d.ts.map +1 -1
- package/dist/lib/parsers/parse-3d-tile.js +0 -4
- package/dist/tiles-3d-loader.d.ts.map +1 -1
- package/dist/tiles-3d-loader.js +18 -17
- package/dist/types.d.ts +257 -15
- package/dist/types.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/index.ts +12 -1
- package/src/lib/parsers/helpers/normalize-3d-tile-colors.ts +10 -4
- package/src/lib/parsers/helpers/normalize-3d-tile-normals.ts +7 -3
- package/src/lib/parsers/helpers/parse-3d-implicit-tiles.ts +4 -4
- package/src/lib/parsers/helpers/parse-3d-tile-gltf-view.ts +35 -13
- package/src/lib/parsers/helpers/parse-3d-tile-header.ts +7 -1
- package/src/lib/parsers/helpers/parse-3d-tile-tables.ts +32 -11
- package/src/lib/parsers/parse-3d-tile-batched-model.ts +18 -3
- package/src/lib/parsers/parse-3d-tile-composite.ts +7 -6
- package/src/lib/parsers/parse-3d-tile-gltf.ts +16 -8
- package/src/lib/parsers/parse-3d-tile-header.ts +84 -52
- package/src/lib/parsers/parse-3d-tile-instanced-model.ts +24 -33
- package/src/lib/parsers/parse-3d-tile-point-cloud.ts +51 -19
- package/src/lib/parsers/parse-3d-tile.ts +10 -5
- package/src/tiles-3d-loader.ts +21 -23
- package/src/types.ts +269 -15
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { GLTFPostprocessed } from '@loaders.gl/gltf';
|
|
2
|
+
import { LoaderWithParser } from '@loaders.gl/loader-utils';
|
|
2
3
|
import { Matrix4, Vector3 } from '@math.gl/core';
|
|
4
|
+
import { TILESET_TYPE, LOD_METRIC_TYPE, TILE_TYPE, TILE_REFINEMENT } from '@loaders.gl/tiles';
|
|
3
5
|
export type FeatureTableJson = {
|
|
4
6
|
[key: string]: any[];
|
|
5
7
|
};
|
|
@@ -31,19 +33,247 @@ export type GLTFHeader = {
|
|
|
31
33
|
featureTableBinaryByteLength: number;
|
|
32
34
|
featureTableJsonByteLength: number;
|
|
33
35
|
};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
/**
|
|
37
|
+
* A 3D Tiles tileset JSON
|
|
38
|
+
* https://github.com/CesiumGS/3d-tiles/tree/main/specification#property-reference
|
|
39
|
+
*/
|
|
40
|
+
export type Tiles3DTilesetJSON = {
|
|
41
|
+
/** Metadata about the entire tileset.
|
|
42
|
+
* https://github.com/CesiumGS/3d-tiles/tree/main/specification#asset
|
|
43
|
+
*/
|
|
44
|
+
asset: {
|
|
45
|
+
/** The 3D Tiles version. The version defines the JSON schema for the tileset JSON and the base set of tile formats. */
|
|
46
|
+
version: string;
|
|
47
|
+
/** Application-specific version of this tileset, e.g., for when an existing tileset is updated. */
|
|
48
|
+
tilesetVersion?: string;
|
|
49
|
+
/** Dictionary object with extension-specific objects. */
|
|
50
|
+
extensions?: object;
|
|
51
|
+
/** Application-specific data. */
|
|
52
|
+
extras?: any;
|
|
53
|
+
/** Not mentioned in 1.0 spec but some tilesets contain this option */
|
|
54
|
+
gltfUpAxis?: string;
|
|
41
55
|
};
|
|
56
|
+
/** A dictionary object of metadata about per-feature properties. */
|
|
57
|
+
properties?: Record<string, TilesetProperty>;
|
|
58
|
+
/** The error, in meters, introduced if this tileset is not rendered. At runtime, the geometric error is used to compute screen space error (SSE), i.e., the error measured in pixels. */
|
|
59
|
+
geometricError: number;
|
|
60
|
+
/** A tile in a 3D Tiles tileset. */
|
|
61
|
+
root: Tiles3DTileJSON;
|
|
62
|
+
/** Names of 3D Tiles extensions used somewhere in this tileset. */
|
|
63
|
+
extensionsUsed?: string[];
|
|
64
|
+
/** Names of 3D Tiles extensions required to properly load this tileset. */
|
|
65
|
+
extensionsRequired?: string[];
|
|
66
|
+
/** Dictionary object with extension-specific objects. */
|
|
67
|
+
extensions?: object;
|
|
68
|
+
/** Application-specific data. */
|
|
69
|
+
extras?: any;
|
|
70
|
+
};
|
|
71
|
+
/** TilesetJSON postprocessed by Tiles3DLoader */
|
|
72
|
+
export type Tiles3DTilesetJSONPostprocessed = Omit<Tiles3DTilesetJSON, 'root'> & {
|
|
73
|
+
/**
|
|
74
|
+
* Loader used
|
|
75
|
+
* @deprecated
|
|
76
|
+
*/
|
|
77
|
+
loader: LoaderWithParser;
|
|
78
|
+
/** URL used to load a tileset resource */
|
|
79
|
+
url: string;
|
|
80
|
+
/** HTTP request query string */
|
|
81
|
+
queryString: string;
|
|
82
|
+
/** base path that non-absolute paths in tileset are relative to. */
|
|
83
|
+
basePath: string;
|
|
84
|
+
/** tileset type */
|
|
85
|
+
type: TILESET_TYPE.TILES3D;
|
|
86
|
+
/** LOD metric type */
|
|
87
|
+
lodMetricType: LOD_METRIC_TYPE.GEOMETRIC_ERROR;
|
|
88
|
+
/** LOD metric value */
|
|
89
|
+
lodMetricValue: number;
|
|
90
|
+
/** Postprocessed root */
|
|
91
|
+
root: Tiles3DTileJSONPostprocessed;
|
|
42
92
|
};
|
|
43
|
-
|
|
93
|
+
/**
|
|
94
|
+
* A tile in a 3D Tiles tileset.
|
|
95
|
+
* https://github.com/CesiumGS/3d-tiles/tree/main/specification#tile
|
|
96
|
+
*/
|
|
97
|
+
export type Tiles3DTileJSON = {
|
|
98
|
+
/** A bounding volume that encloses a tile or its content. */
|
|
99
|
+
boundingVolume: Tile3DBoundingVolume;
|
|
100
|
+
/** A bounding volume that encloses a tile or its content. */
|
|
101
|
+
viewerRequestVolume?: object;
|
|
102
|
+
/** The error, in meters, introduced if this tile is rendered and its children are not. At runtime, the geometric error is used to compute screen space error (SSE), i.e., the error measured in pixels. */
|
|
103
|
+
geometricError: number;
|
|
104
|
+
/**
|
|
105
|
+
* Specifies if additive or replacement refinement is used when traversing the tileset for rendering. This property is required for the root tile of a tileset; it is optional for all other tiles.
|
|
106
|
+
* The default is to inherit from the parent tile.
|
|
107
|
+
*/
|
|
108
|
+
refine?: string;
|
|
109
|
+
/** A floating-point 4x4 affine transformation matrix, stored in column-major order, that transforms the tile's content */
|
|
110
|
+
transform?: number[];
|
|
111
|
+
/** Metadata about the tile's content and a link to the content. */
|
|
112
|
+
content?: Tiles3DTileContentJSON;
|
|
113
|
+
/** An array of objects that define child tiles. */
|
|
114
|
+
children: Tiles3DTileJSON[];
|
|
115
|
+
/** Dictionary object with extension-specific objects. */
|
|
116
|
+
extensions?: object;
|
|
117
|
+
/** Application-specific data. */
|
|
118
|
+
extras?: any;
|
|
119
|
+
/** 3DTiles v1.1 properties
|
|
120
|
+
* https://github.com/CesiumGS/3d-tiles/blob/draft-1.1/specification/schema/tile.schema.json
|
|
121
|
+
*/
|
|
122
|
+
/** This object allows a tile to be implicitly subdivided. Tile and content availability and metadata is stored in subtrees which are referenced externally. */
|
|
123
|
+
implicitTiling?: ImplicitTilingData;
|
|
124
|
+
};
|
|
125
|
+
export type Tiles3DTileJSONPostprocessed = Omit<Tiles3DTileJSON, 'refine' | 'children'> & {
|
|
126
|
+
/** Unique ID */
|
|
127
|
+
id?: string;
|
|
128
|
+
/** Content full URL */
|
|
129
|
+
contentUrl?: string;
|
|
130
|
+
/** LOD metric type */
|
|
131
|
+
lodMetricType?: LOD_METRIC_TYPE.GEOMETRIC_ERROR;
|
|
132
|
+
/** LOD metric value */
|
|
133
|
+
lodMetricValue?: number;
|
|
134
|
+
/** Duplicate of transform */
|
|
135
|
+
transformMatrix?: number[];
|
|
136
|
+
/** Type of tile */
|
|
137
|
+
type?: TILE_TYPE | string;
|
|
138
|
+
/**
|
|
139
|
+
* Specifies if additive or replacement refinement is used when traversing the tileset for rendering. This property is required for the root tile of a tileset; it is optional for all other tiles.
|
|
140
|
+
* The default is to inherit from the parent tile.
|
|
141
|
+
*/
|
|
142
|
+
refine?: TILE_REFINEMENT | string;
|
|
143
|
+
/** An array of objects that define child tiles. */
|
|
144
|
+
children: Tiles3DTileJSONPostprocessed[];
|
|
145
|
+
};
|
|
146
|
+
/** Metadata about the tile's content and a link to the content. */
|
|
147
|
+
export type Tiles3DTileContentJSON = {
|
|
148
|
+
/** A uri that points to the tile's content. When the uri is relative, it is relative to the referring tileset JSON file. */
|
|
149
|
+
uri: string;
|
|
150
|
+
/** url doesn't allign the spec but we support it same way as uri */
|
|
151
|
+
url?: string;
|
|
152
|
+
/** A bounding volume that encloses a tile or its content. At least one bounding volume property is required. Bounding volumes include box, region, or sphere. */
|
|
153
|
+
boundingVolume?: Tile3DBoundingVolume;
|
|
154
|
+
/** Dictionary object with extension-specific objects. */
|
|
155
|
+
extensions?: object;
|
|
156
|
+
/** Application-specific data. */
|
|
157
|
+
extras?: any;
|
|
158
|
+
};
|
|
159
|
+
/** A bounding volume that encloses a tile or its content.
|
|
160
|
+
* https://github.com/CesiumGS/3d-tiles/tree/main/specification#bounding-volume
|
|
161
|
+
*/
|
|
162
|
+
export type Tile3DBoundingVolume = {
|
|
163
|
+
/** An array of 12 numbers that define an oriented bounding box. The first three elements define the x, y, and z values for the center of the box.
|
|
164
|
+
* The next three elements (with indices 3, 4, and 5) define the x axis direction and half-length. The next three elements (indices 6, 7, and 8) define
|
|
165
|
+
* the y axis direction and half-length. The last three elements (indices 9, 10, and 11) define the z axis direction and half-length. */
|
|
44
166
|
box?: number[];
|
|
167
|
+
/** An array of four numbers that define a bounding sphere. The first three elements define the x, y, and z values for the center of the sphere.
|
|
168
|
+
* The last element (with index 3) defines the radius in meters. */
|
|
45
169
|
sphere?: number[];
|
|
170
|
+
/** An array of six numbers that define a bounding geographic region in EPSG:4979 coordinates with the order [west, south, east, north, minimum height, maximum height].
|
|
171
|
+
* Longitudes and latitudes are in radians, and heights are in meters above (or below) the WGS84 ellipsoid. */
|
|
46
172
|
region?: number[];
|
|
173
|
+
/** Dictionary object with extension-specific objects. */
|
|
174
|
+
extensions?: object;
|
|
175
|
+
/** Application-specific data. */
|
|
176
|
+
extras?: any;
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* A dictionary object of metadata about per-feature properties.
|
|
180
|
+
* https://github.com/CesiumGS/3d-tiles/tree/main/specification#properties
|
|
181
|
+
*/
|
|
182
|
+
export type TilesetProperty = {
|
|
183
|
+
/** The maximum value of this property of all the features in the tileset. */
|
|
184
|
+
maximum: number;
|
|
185
|
+
/** The minimum value of this property of all the features in the tileset. */
|
|
186
|
+
minimum: number;
|
|
187
|
+
/** Dictionary object with extension-specific objects. */
|
|
188
|
+
extensions?: object;
|
|
189
|
+
/** Application-specific data. */
|
|
190
|
+
extras?: any;
|
|
191
|
+
};
|
|
192
|
+
export type Tiles3DTileContent = {
|
|
193
|
+
/** Common properties */
|
|
194
|
+
byteOffset?: number;
|
|
195
|
+
type?: string;
|
|
196
|
+
featureIds?: null;
|
|
197
|
+
/** 3DTile header */
|
|
198
|
+
magic?: number;
|
|
199
|
+
version?: number;
|
|
200
|
+
byteLength?: number;
|
|
201
|
+
/** 3DTile tables header */
|
|
202
|
+
header?: {
|
|
203
|
+
featureTableJsonByteLength?: number;
|
|
204
|
+
featureTableBinaryByteLength?: number;
|
|
205
|
+
batchTableJsonByteLength?: number;
|
|
206
|
+
batchTableBinaryByteLength?: number;
|
|
207
|
+
batchLength?: number;
|
|
208
|
+
};
|
|
209
|
+
/** 3DTile tables */
|
|
210
|
+
featureTableJson?: {
|
|
211
|
+
BATCH_LENGTH?: number;
|
|
212
|
+
} | Record<string, any>;
|
|
213
|
+
featureTableBinary?: Uint8Array;
|
|
214
|
+
batchTableJson?: Record<string, (string | number)[]>;
|
|
215
|
+
batchTableBinary?: Uint8Array;
|
|
216
|
+
rtcCenter?: number[];
|
|
217
|
+
/** 3DTile glTF */
|
|
218
|
+
gltfArrayBuffer?: ArrayBuffer;
|
|
219
|
+
gltfByteOffset?: number;
|
|
220
|
+
gltfByteLength?: number;
|
|
221
|
+
rotateYtoZ?: boolean;
|
|
222
|
+
gltfUpAxis?: 'x' | 'X' | 'y' | 'Y' | 'z' | 'Z';
|
|
223
|
+
gltfUrl?: string;
|
|
224
|
+
gpuMemoryUsageInBytes?: number;
|
|
225
|
+
gltf?: GLTFPostprocessed;
|
|
226
|
+
/** For Composite tiles */
|
|
227
|
+
tilesLength?: number;
|
|
228
|
+
tiles?: Tiles3DTileContent[];
|
|
229
|
+
/** For Instances model and Pointcloud tiles */
|
|
230
|
+
featuresLength?: number;
|
|
231
|
+
/** For Instanced model tiles */
|
|
232
|
+
gltfFormat?: number;
|
|
233
|
+
eastNorthUp?: boolean;
|
|
234
|
+
normalUp?: number[];
|
|
235
|
+
normalRight?: number[];
|
|
236
|
+
hasCustomOrientation?: boolean;
|
|
237
|
+
octNormalUp?: number[];
|
|
238
|
+
octNormalRight?: number[];
|
|
239
|
+
instances?: {
|
|
240
|
+
modelMatrix: Matrix4;
|
|
241
|
+
batchId: number;
|
|
242
|
+
}[];
|
|
243
|
+
/** For Pointcloud tiles */
|
|
244
|
+
attributes?: {
|
|
245
|
+
positions: null | number[];
|
|
246
|
+
colors: null | number[] | {
|
|
247
|
+
type: number;
|
|
248
|
+
value: Uint8ClampedArray;
|
|
249
|
+
size: number;
|
|
250
|
+
normalized: boolean;
|
|
251
|
+
};
|
|
252
|
+
normals: null | number[] | {
|
|
253
|
+
type: number;
|
|
254
|
+
size: number;
|
|
255
|
+
value: Float32Array;
|
|
256
|
+
};
|
|
257
|
+
batchIds: null | number[];
|
|
258
|
+
};
|
|
259
|
+
constantRGBA?: number[];
|
|
260
|
+
isQuantized?: boolean;
|
|
261
|
+
isTranslucent?: boolean;
|
|
262
|
+
isRGB565?: boolean;
|
|
263
|
+
isOctEncoded16P?: boolean;
|
|
264
|
+
pointsLength?: number;
|
|
265
|
+
pointCount?: number;
|
|
266
|
+
batchIds?: number[];
|
|
267
|
+
hasPositions?: boolean;
|
|
268
|
+
hasColors?: boolean;
|
|
269
|
+
hasNormals?: boolean;
|
|
270
|
+
hasBatchIds?: boolean;
|
|
271
|
+
quantizedVolumeScale?: Vector3;
|
|
272
|
+
quantizedVolumeOffset?: Vector3;
|
|
273
|
+
quantizedRange?: number;
|
|
274
|
+
isQuantizedDraco?: boolean;
|
|
275
|
+
octEncodedRange?: number;
|
|
276
|
+
isOctEncodedDraco?: boolean;
|
|
47
277
|
};
|
|
48
278
|
/**
|
|
49
279
|
* 3DTILES_implicit_tiling types
|
|
@@ -79,15 +309,27 @@ type BufferView = {
|
|
|
79
309
|
/**
|
|
80
310
|
* Spec - https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_implicit_tiling
|
|
81
311
|
*/
|
|
82
|
-
export type
|
|
83
|
-
subdivisionScheme: 'QUADTREE' | 'OCTREE';
|
|
312
|
+
export type ImplicitTilingExensionData = ImplicitTilingData & {
|
|
84
313
|
maximumLevel?: number;
|
|
85
|
-
availableLevels: number;
|
|
86
|
-
subtreeLevels: number;
|
|
87
|
-
subtrees: SubtreeUri;
|
|
88
314
|
};
|
|
89
|
-
|
|
90
|
-
|
|
315
|
+
/** 3DTiles v1.1 types */
|
|
316
|
+
/**
|
|
317
|
+
* This object allows a tile to be implicitly subdivided. Tile and content availability and metadata is stored in subtrees which are referenced externally.
|
|
318
|
+
* https://github.com/CesiumGS/3d-tiles/blob/draft-1.1/specification/schema/tile.implicitTiling.schema.json
|
|
319
|
+
* */
|
|
320
|
+
type ImplicitTilingData = {
|
|
321
|
+
/** A string describing the subdivision scheme used within the tileset. */
|
|
322
|
+
subdivisionScheme: 'QUADTREE' | 'OCTREE' | string;
|
|
323
|
+
/** The number of distinct levels in each subtree. For example, a quadtree with `subtreeLevels = 2` will have subtrees with 5 nodes (one root and 4 children). */
|
|
324
|
+
subtreeLevels: number;
|
|
325
|
+
/** The numbers of the levels in the tree with available tiles. */
|
|
326
|
+
availableLevels: number;
|
|
327
|
+
/** An object describing the location of subtree files. */
|
|
328
|
+
subtrees: {
|
|
329
|
+
/** A template URI pointing to subtree files. A subtree is a fixed-depth (defined by `subtreeLevels`) portion of the tree to keep memory use bounded.
|
|
330
|
+
* The URI of each file is substituted with the subtree root's global level, x, and y. For subdivision scheme `OCTREE`, z shall also be given. Relative paths are relative to the tileset JSON. */
|
|
331
|
+
uri: string;
|
|
332
|
+
};
|
|
91
333
|
};
|
|
92
334
|
export {};
|
|
93
335
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAC,OAAO,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAC,gBAAgB,EAAC,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAC,OAAO,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAC,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAE5F,MAAM,MAAM,gBAAgB,GAAG;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,cAAc,CAAC,EAAE,gBAAgB,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EAAE,MAAM,CAAC;IAEpB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC;AAE3C;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEtD,KAAK,MAAM,GAAG;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,KAAK,UAAU,GAAG;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAAG,kBAAkB,GAAG;IAC5D,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,yBAAyB;AAEzB;;;KAGK;AACL,KAAK,kBAAkB,GAAG;IACxB,0EAA0E;IAC1E,iBAAiB,EAAE,UAAU,GAAG,QAAQ,GAAG,MAAM,CAAC;IAClD,iKAAiK;IACjK,aAAa,EAAE,MAAM,CAAC;IACtB,kEAAkE;IAClE,eAAe,EAAE,MAAM,CAAC;IACxB,0DAA0D;IAC1D,QAAQ,EAAE;QACR;0MACkM;QAClM,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/3d-tiles",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.9",
|
|
4
4
|
"description": "3D Tiles, an open standard for streaming massive heterogeneous 3D geospatial datasets.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -34,17 +34,17 @@
|
|
|
34
34
|
"build-bundle": "esbuild src/bundle.ts --bundle --outfile=dist/dist.min.js"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@loaders.gl/draco": "4.0.0-alpha.
|
|
38
|
-
"@loaders.gl/gltf": "4.0.0-alpha.
|
|
39
|
-
"@loaders.gl/loader-utils": "4.0.0-alpha.
|
|
40
|
-
"@loaders.gl/math": "4.0.0-alpha.
|
|
41
|
-
"@loaders.gl/tiles": "4.0.0-alpha.
|
|
37
|
+
"@loaders.gl/draco": "4.0.0-alpha.9",
|
|
38
|
+
"@loaders.gl/gltf": "4.0.0-alpha.9",
|
|
39
|
+
"@loaders.gl/loader-utils": "4.0.0-alpha.9",
|
|
40
|
+
"@loaders.gl/math": "4.0.0-alpha.9",
|
|
41
|
+
"@loaders.gl/tiles": "4.0.0-alpha.9",
|
|
42
42
|
"@math.gl/core": "^3.5.1",
|
|
43
43
|
"@math.gl/geospatial": "^3.5.1",
|
|
44
44
|
"long": "^5.2.1"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@loaders.gl/core": "4.0.0-alpha.
|
|
47
|
+
"@loaders.gl/core": "^4.0.0-alpha.8"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "03ff81ab468f20f3bddeec787aa88d477a7e1c72"
|
|
50
50
|
}
|
package/src/index.ts
CHANGED
|
@@ -13,4 +13,15 @@ export {default as Tile3DBatchTable} from './lib/classes/tile-3d-batch-table';
|
|
|
13
13
|
// EXPERIMENTAL
|
|
14
14
|
export {TILE3D_TYPE} from './lib/constants';
|
|
15
15
|
export {getIonTilesetMetadata as _getIonTilesetMetadata} from './lib/ion/ion';
|
|
16
|
-
export type {
|
|
16
|
+
export type {
|
|
17
|
+
FeatureTableJson,
|
|
18
|
+
B3DMContent,
|
|
19
|
+
Tile3DBoundingVolume,
|
|
20
|
+
Tiles3DTileJSON,
|
|
21
|
+
Tiles3DTileJSONPostprocessed,
|
|
22
|
+
Tiles3DTilesetJSON,
|
|
23
|
+
Tiles3DTilesetJSONPostprocessed,
|
|
24
|
+
Tiles3DTileContent,
|
|
25
|
+
ImplicitTilingExensionData
|
|
26
|
+
} from './types';
|
|
27
|
+
export type {Tiles3DLoaderOptions} from './tiles-3d-loader';
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
+
import {Tile3DBatchTable} from '@loaders.gl/3d-tiles';
|
|
1
2
|
import {decodeRGB565, GL} from '@loaders.gl/math';
|
|
3
|
+
import {Tiles3DTileContent} from '../../../types';
|
|
2
4
|
|
|
3
5
|
/* eslint-disable complexity*/
|
|
4
|
-
export function normalize3DTileColorAttribute(
|
|
6
|
+
export function normalize3DTileColorAttribute(
|
|
7
|
+
tile: Tiles3DTileContent,
|
|
8
|
+
colors: Uint8ClampedArray | null,
|
|
9
|
+
batchTable?: Tile3DBatchTable
|
|
10
|
+
): {type: number; value: Uint8ClampedArray; size: number; normalized: boolean} | null {
|
|
5
11
|
// no colors defined
|
|
6
12
|
if (!colors && (!tile || !tile.batchIds || !batchTable)) {
|
|
7
13
|
return null;
|
|
8
14
|
}
|
|
9
15
|
|
|
10
|
-
const {batchIds, isRGB565, pointCount} = tile;
|
|
16
|
+
const {batchIds, isRGB565, pointCount = 0} = tile;
|
|
11
17
|
// Batch table, look up colors in table
|
|
12
18
|
if (batchIds && batchTable) {
|
|
13
19
|
const colorArray = new Uint8ClampedArray(pointCount * 3);
|
|
@@ -29,7 +35,7 @@ export function normalize3DTileColorAttribute(tile, colors, batchTable?) {
|
|
|
29
35
|
}
|
|
30
36
|
|
|
31
37
|
// RGB565 case, convert to RGB
|
|
32
|
-
if (isRGB565) {
|
|
38
|
+
if (colors && isRGB565) {
|
|
33
39
|
const colorArray = new Uint8ClampedArray(pointCount * 3);
|
|
34
40
|
for (let i = 0; i < pointCount; i++) {
|
|
35
41
|
const color = decodeRGB565(colors[i]);
|
|
@@ -58,7 +64,7 @@ export function normalize3DTileColorAttribute(tile, colors, batchTable?) {
|
|
|
58
64
|
// DEFAULT: RGBA case
|
|
59
65
|
return {
|
|
60
66
|
type: GL.UNSIGNED_BYTE,
|
|
61
|
-
value: colors,
|
|
67
|
+
value: colors || new Uint8ClampedArray(),
|
|
62
68
|
size: 4,
|
|
63
69
|
normalized: true
|
|
64
70
|
};
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import {Vector3} from '@math.gl/core';
|
|
2
2
|
import {GL, octDecode} from '@loaders.gl/math';
|
|
3
|
+
import {Tiles3DTileContent} from '../../../types';
|
|
3
4
|
|
|
4
5
|
const scratchNormal = new Vector3();
|
|
5
6
|
|
|
6
|
-
export function normalize3DTileNormalAttribute(
|
|
7
|
+
export function normalize3DTileNormalAttribute(
|
|
8
|
+
tile: Tiles3DTileContent,
|
|
9
|
+
normals: Float32Array | null
|
|
10
|
+
): {type: number; size: number; value: Float32Array} | null {
|
|
7
11
|
if (!normals) {
|
|
8
12
|
return null;
|
|
9
13
|
}
|
|
10
14
|
|
|
11
15
|
if (tile.isOctEncoded16P) {
|
|
12
|
-
const decodedArray = new Float32Array(tile.pointsLength * 3);
|
|
13
|
-
for (let i = 0; i < tile.pointsLength; i++) {
|
|
16
|
+
const decodedArray = new Float32Array((tile.pointsLength || 0) * 3);
|
|
17
|
+
for (let i = 0; i < (tile.pointsLength || 0); i++) {
|
|
14
18
|
octDecode(normals[i * 2], normals[i * 2 + 1], scratchNormal);
|
|
15
19
|
// @ts-ignore
|
|
16
20
|
scratchNormal.toArray(decodedArray, i * 3);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {Availability,
|
|
1
|
+
import type {Availability, Tile3DBoundingVolume, Subtree} from '../../../types';
|
|
2
2
|
import {Tile3DSubtreeLoader} from '../../../tile-3d-subtree-loader';
|
|
3
3
|
import {load} from '@loaders.gl/core';
|
|
4
4
|
|
|
@@ -263,7 +263,7 @@ function formatTileData(
|
|
|
263
263
|
const uri = tile.contentUrl && tile.contentUrl.replace(`${basePath}/`, '');
|
|
264
264
|
const lodMetricValue = rootLodMetricValue / 2 ** level;
|
|
265
265
|
|
|
266
|
-
const boundingVolume:
|
|
266
|
+
const boundingVolume: Tile3DBoundingVolume = s2VolumeBox?.box
|
|
267
267
|
? {box: s2VolumeBox.box}
|
|
268
268
|
: rootBoundingVolume;
|
|
269
269
|
|
|
@@ -297,9 +297,9 @@ function formatTileData(
|
|
|
297
297
|
*/
|
|
298
298
|
function calculateBoundingVolumeForChildTile(
|
|
299
299
|
level: number,
|
|
300
|
-
rootBoundingVolume:
|
|
300
|
+
rootBoundingVolume: Tile3DBoundingVolume,
|
|
301
301
|
childCoordinates: {childTileX: number; childTileY: number; childTileZ: number}
|
|
302
|
-
):
|
|
302
|
+
): Tile3DBoundingVolume {
|
|
303
303
|
if (rootBoundingVolume.region) {
|
|
304
304
|
const {childTileX, childTileY, childTileZ} = childCoordinates;
|
|
305
305
|
const [west, south, east, north, minimumHeight, maximumHeight] = rootBoundingVolume.region;
|
|
@@ -8,28 +8,35 @@
|
|
|
8
8
|
// - Also, should we have hard dependency on gltf module or use injection or auto-discovery for gltf parser?
|
|
9
9
|
|
|
10
10
|
import {GLTFLoader, postProcessGLTF, _getMemoryUsageGLTF} from '@loaders.gl/gltf';
|
|
11
|
-
import {sliceArrayBuffer} from '@loaders.gl/loader-utils';
|
|
11
|
+
import {LoaderContext, sliceArrayBuffer} from '@loaders.gl/loader-utils';
|
|
12
|
+
import {Tiles3DTileContent} from '../../../types';
|
|
13
|
+
import {Tiles3DLoaderOptions} from '../../../tiles-3d-loader';
|
|
12
14
|
|
|
13
15
|
export const GLTF_FORMAT = {
|
|
14
16
|
URI: 0,
|
|
15
17
|
EMBEDDED: 1
|
|
16
18
|
};
|
|
17
19
|
|
|
18
|
-
export function parse3DTileGLTFViewSync(
|
|
20
|
+
export function parse3DTileGLTFViewSync(
|
|
21
|
+
tile: Tiles3DTileContent,
|
|
22
|
+
arrayBuffer: ArrayBuffer,
|
|
23
|
+
byteOffset: number,
|
|
24
|
+
options: Tiles3DLoaderOptions | undefined
|
|
25
|
+
) {
|
|
19
26
|
// Set flags
|
|
20
27
|
// glTF models need to be rotated from Y to Z up
|
|
21
28
|
// https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification#y-up-to-z-up
|
|
22
29
|
tile.rotateYtoZ = true;
|
|
23
30
|
|
|
24
31
|
// Assume glTF consumes rest of tile
|
|
25
|
-
const gltfByteLength = tile.byteOffset + tile.byteLength - byteOffset;
|
|
32
|
+
const gltfByteLength = (tile.byteOffset || 0) + (tile.byteLength || 0) - byteOffset;
|
|
26
33
|
if (gltfByteLength === 0) {
|
|
27
34
|
throw new Error('glTF byte length must be greater than 0.');
|
|
28
35
|
}
|
|
29
36
|
|
|
30
37
|
// Save gltf up axis
|
|
31
38
|
tile.gltfUpAxis =
|
|
32
|
-
options['3d-tiles'] && options['3d-tiles'].assetGltfUpAxis
|
|
39
|
+
options?.['3d-tiles'] && options['3d-tiles'].assetGltfUpAxis
|
|
33
40
|
? options['3d-tiles'].assetGltfUpAxis
|
|
34
41
|
: 'Y';
|
|
35
42
|
|
|
@@ -50,18 +57,27 @@ export function parse3DTileGLTFViewSync(tile, arrayBuffer, byteOffset, options)
|
|
|
50
57
|
}
|
|
51
58
|
|
|
52
59
|
// Entire tile is consumed
|
|
53
|
-
return tile.byteOffset + tile.byteLength;
|
|
60
|
+
return (tile.byteOffset || 0) + (tile.byteLength || 0);
|
|
54
61
|
}
|
|
55
62
|
|
|
56
|
-
export async function extractGLTF(
|
|
57
|
-
|
|
63
|
+
export async function extractGLTF(
|
|
64
|
+
tile: Tiles3DTileContent,
|
|
65
|
+
gltfFormat: number,
|
|
66
|
+
options?: Tiles3DLoaderOptions,
|
|
67
|
+
context?: LoaderContext
|
|
68
|
+
): Promise<void> {
|
|
69
|
+
const tile3DOptions = options?.['3d-tiles'] || {};
|
|
58
70
|
|
|
59
71
|
extractGLTFBufferOrURL(tile, gltfFormat, options);
|
|
60
72
|
|
|
61
73
|
if (tile3DOptions.loadGLTF) {
|
|
74
|
+
if (!context) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
62
77
|
const {parse, fetch} = context;
|
|
63
78
|
if (tile.gltfUrl) {
|
|
64
|
-
|
|
79
|
+
const response = await fetch(tile.gltfUrl, options);
|
|
80
|
+
tile.gltfArrayBuffer = await response.arrayBuffer();
|
|
65
81
|
tile.gltfByteOffset = 0;
|
|
66
82
|
}
|
|
67
83
|
if (tile.gltfArrayBuffer) {
|
|
@@ -76,15 +92,21 @@ export async function extractGLTF(tile, gltfFormat, options, context) {
|
|
|
76
92
|
}
|
|
77
93
|
}
|
|
78
94
|
|
|
79
|
-
function extractGLTFBufferOrURL(
|
|
95
|
+
function extractGLTFBufferOrURL(
|
|
96
|
+
tile: Tiles3DTileContent,
|
|
97
|
+
gltfFormat: number,
|
|
98
|
+
options: Tiles3DLoaderOptions | undefined
|
|
99
|
+
) {
|
|
80
100
|
switch (gltfFormat) {
|
|
81
101
|
case GLTF_FORMAT.URI:
|
|
82
102
|
// We need to remove padding from the end of the model URL in case this tile was part of a composite tile.
|
|
83
103
|
// This removes all white space and null characters from the end of the string.
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
104
|
+
if (tile.gltfArrayBuffer) {
|
|
105
|
+
const gltfUrlBytes = new Uint8Array(tile.gltfArrayBuffer, tile.gltfByteOffset);
|
|
106
|
+
const textDecoder = new TextDecoder();
|
|
107
|
+
const gltfUrl = textDecoder.decode(gltfUrlBytes);
|
|
108
|
+
tile.gltfUrl = gltfUrl.replace(/[\s\0]+$/, '');
|
|
109
|
+
}
|
|
88
110
|
delete tile.gltfArrayBuffer;
|
|
89
111
|
delete tile.gltfByteOffset;
|
|
90
112
|
delete tile.gltfByteLength;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// This file is derived from the Cesium code base under Apache 2 license
|
|
2
2
|
// See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
|
|
3
3
|
|
|
4
|
+
import {Tiles3DTileContent} from '../../../types';
|
|
5
|
+
|
|
4
6
|
const SIZEOF_UINT32 = 4;
|
|
5
7
|
|
|
6
8
|
/* PARSE FIXED HEADER:
|
|
@@ -10,7 +12,11 @@ Populates
|
|
|
10
12
|
version,
|
|
11
13
|
byteLength
|
|
12
14
|
*/
|
|
13
|
-
export function parse3DTileHeaderSync(
|
|
15
|
+
export function parse3DTileHeaderSync(
|
|
16
|
+
tile: Tiles3DTileContent,
|
|
17
|
+
arrayBuffer: ArrayBuffer,
|
|
18
|
+
byteOffset: number = 0
|
|
19
|
+
) {
|
|
14
20
|
const view = new DataView(arrayBuffer);
|
|
15
21
|
|
|
16
22
|
tile.magic = view.getUint32(byteOffset, true);
|