@loaders.gl/draco 4.0.0-alpha.4 → 4.0.0-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,107 @@
1
+ import type { Draco3D, Encoder, Mesh, MeshBuilder, PointCloud, Metadata, MetadataBuilder, draco_GeometryAttribute_Type } from '../draco3d/draco3d-types';
2
+ import type { TypedArray } from '@loaders.gl/schema';
3
+ import type { DracoMesh } from './draco-types';
4
+ export declare type DracoBuildOptions = {
5
+ pointcloud?: boolean;
6
+ metadata?: {
7
+ [key: string]: string;
8
+ };
9
+ attributesMetadata?: {};
10
+ log?: any;
11
+ speed?: [number, number];
12
+ method?: string;
13
+ quantization?: {
14
+ [attributeName: string]: number;
15
+ };
16
+ };
17
+ export default class DracoBuilder {
18
+ draco: Draco3D;
19
+ dracoEncoder: Encoder;
20
+ dracoMeshBuilder: MeshBuilder;
21
+ dracoMetadataBuilder: MetadataBuilder;
22
+ log: any;
23
+ constructor(draco: Draco3D);
24
+ destroy(): void;
25
+ destroyEncodedObject(object: any): void;
26
+ /**
27
+ * Encode mesh or point cloud
28
+ * @param mesh =({})
29
+ * @param options
30
+ */
31
+ encodeSync(mesh: DracoMesh, options?: DracoBuildOptions): ArrayBuffer;
32
+ _getAttributesFromMesh(mesh: DracoMesh): {
33
+ attributes: {
34
+ [attributeName: string]: import("@loaders.gl/schema").MeshAttribute;
35
+ };
36
+ indices?: import("@loaders.gl/schema").MeshAttribute | undefined;
37
+ topology: "triangle-list" | "triangle-strip" | "point-list";
38
+ mode: number;
39
+ loader: "draco";
40
+ loaderData: {
41
+ [key: string]: any;
42
+ } & import("./draco-types").DracoLoaderData;
43
+ header?: {
44
+ vertexCount: number;
45
+ boundingBox?: [number[], number[]] | undefined;
46
+ } | undefined;
47
+ schema: import("@loaders.gl/schema").Schema;
48
+ };
49
+ _encodePointCloud(pointcloud: DracoMesh, options: DracoBuildOptions): ArrayBuffer;
50
+ _encodeMesh(mesh: DracoMesh, options: DracoBuildOptions): ArrayBuffer;
51
+ /**
52
+ * Set encoding options.
53
+ * @param {{speed?: any; method?: any; quantization?: any;}} options
54
+ */
55
+ _setOptions(options: DracoBuildOptions): void;
56
+ /**
57
+ * @param {Mesh} dracoMesh
58
+ * @param {object} attributes
59
+ * @returns {Mesh}
60
+ */
61
+ _createDracoMesh(dracoMesh: Mesh, attributes: any, options: DracoBuildOptions): Mesh;
62
+ /**
63
+ * @param {} dracoPointCloud
64
+ * @param {object} attributes
65
+ */
66
+ _createDracoPointCloud(dracoPointCloud: PointCloud, attributes: object, options: DracoBuildOptions): PointCloud;
67
+ /**
68
+ * @param mesh
69
+ * @param attributeName
70
+ * @param attribute
71
+ * @param vertexCount
72
+ */
73
+ _addAttributeToMesh(mesh: PointCloud, attributeName: string, attribute: TypedArray, vertexCount: number): any;
74
+ /**
75
+ * DRACO can compress attributes of know type better
76
+ * TODO - expose an attribute type map?
77
+ * @param attributeName
78
+ */
79
+ _getDracoAttributeType(attributeName: string): draco_GeometryAttribute_Type | 'indices';
80
+ _getPositionAttribute(attributes: any): any;
81
+ /**
82
+ * Add metadata for the geometry.
83
+ * @param dracoGeometry - WASM Draco Object
84
+ * @param metadata
85
+ */
86
+ _addGeometryMetadata(dracoGeometry: PointCloud, metadata: {
87
+ [key: string]: string;
88
+ }): void;
89
+ /**
90
+ * Add metadata for an attribute to geometry.
91
+ * @param dracoGeometry - WASM Draco Object
92
+ * @param uniqueAttributeId
93
+ * @param metadata
94
+ */
95
+ _addAttributeMetadata(dracoGeometry: PointCloud, uniqueAttributeId: number, metadata: Map<string, string> | {
96
+ [key: string]: string;
97
+ }): void;
98
+ /**
99
+ * Add contents of object or map to a WASM Draco Metadata Object
100
+ * @param dracoMetadata - WASM Draco Object
101
+ * @param metadata
102
+ */
103
+ _populateDracoMetadata(dracoMetadata: Metadata, metadata: Map<string, string> | {
104
+ [key: string]: string;
105
+ }): void;
106
+ }
107
+ //# sourceMappingURL=draco-builder.d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;
2
+ export declare function loadDracoEncoderModule(options: any): Promise<any>;
3
+ //# sourceMappingURL=draco-module-loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draco-module-loader.d.ts","sourceRoot":"","sources":["../../src/lib/draco-module-loader.ts"],"names":[],"mappings":"AAgBA,wBAAsB,sBAAsB,CAAC,OAAO,KAAA,gBAenD;AAED,wBAAsB,sBAAsB,CAAC,OAAO,KAAA,gBAenD"}
@@ -0,0 +1,137 @@
1
+ import type { TypedArray, MeshAttribute, MeshGeometry } from '@loaders.gl/schema';
2
+ import type { Draco3D, Decoder, Mesh, PointCloud, PointAttribute, Metadata, MetadataQuerier } from '../draco3d/draco3d-types';
3
+ import type { DracoMesh, DracoLoaderData, DracoAttribute, DracoMetadataEntry, DracoQuantizationTransform, DracoOctahedronTransform } from './draco-types';
4
+ /**
5
+ * @param topology - How triangle indices should be generated (mesh only)
6
+ * @param attributeNameEntry
7
+ * @param extraAttributes
8
+ * @param quantizedAttributes
9
+ * @param octahedronAttributes
10
+ */
11
+ export declare type DracoParseOptions = {
12
+ topology?: 'triangle-list' | 'triangle-strip';
13
+ attributeNameEntry?: string;
14
+ extraAttributes?: {
15
+ [uniqueId: string]: number;
16
+ };
17
+ quantizedAttributes?: ('POSITION' | 'NORMAL' | 'COLOR' | 'TEX_COORD' | 'GENERIC')[];
18
+ octahedronAttributes?: ('POSITION' | 'NORMAL' | 'COLOR' | 'TEX_COORD' | 'GENERIC')[];
19
+ };
20
+ export default class DracoParser {
21
+ draco: Draco3D;
22
+ decoder: Decoder;
23
+ metadataQuerier: MetadataQuerier;
24
+ constructor(draco: Draco3D);
25
+ /**
26
+ * Destroy draco resources
27
+ */
28
+ destroy(): void;
29
+ /**
30
+ * NOTE: caller must call `destroyGeometry` on the return value after using it
31
+ * @param arrayBuffer
32
+ * @param options
33
+ */
34
+ parseSync(arrayBuffer: ArrayBuffer, options?: DracoParseOptions): DracoMesh;
35
+ /**
36
+ * Extract
37
+ * @param dracoGeometry
38
+ * @param geometry_type
39
+ * @param options
40
+ * @returns
41
+ */
42
+ _getDracoLoaderData(dracoGeometry: Mesh | PointCloud, geometry_type: any, options: DracoParseOptions): DracoLoaderData;
43
+ /**
44
+ * Extract all draco provided information and metadata for each attribute
45
+ * @param dracoGeometry
46
+ * @param options
47
+ * @returns
48
+ */
49
+ _getDracoAttributes(dracoGeometry: Mesh | PointCloud, options: DracoParseOptions): {
50
+ [unique_id: number]: DracoAttribute;
51
+ };
52
+ /**
53
+ * Get standard loaders.gl mesh category data
54
+ * Extracts the geometry from draco
55
+ * @param dracoGeometry
56
+ * @param options
57
+ */
58
+ _getMeshData(dracoGeometry: Mesh | PointCloud, loaderData: DracoLoaderData, options: DracoParseOptions): MeshGeometry;
59
+ _getMeshAttributes(loaderData: DracoLoaderData, dracoGeometry: Mesh | PointCloud, options: DracoParseOptions): {
60
+ [attributeName: string]: MeshAttribute;
61
+ };
62
+ /**
63
+ * For meshes, we need indices to define the faces.
64
+ * @param dracoGeometry
65
+ */
66
+ _getTriangleListIndices(dracoGeometry: Mesh): Uint32Array;
67
+ /**
68
+ * For meshes, we need indices to define the faces.
69
+ * @param dracoGeometry
70
+ */
71
+ _getTriangleStripIndices(dracoGeometry: Mesh): Int32Array;
72
+ /**
73
+ *
74
+ * @param dracoGeometry
75
+ * @param dracoAttribute
76
+ * @param attributeName
77
+ */
78
+ _getAttributeValues(dracoGeometry: Mesh | PointCloud, attribute: DracoAttribute): {
79
+ value: TypedArray;
80
+ size: number;
81
+ };
82
+ /**
83
+ * DRACO does not store attribute names - We need to deduce an attribute name
84
+ * for each attribute
85
+ _getAttributeNames(
86
+ dracoGeometry: Mesh | PointCloud,
87
+ options: DracoParseOptions
88
+ ): {[unique_id: number]: string} {
89
+ const attributeNames: {[unique_id: number]: string} = {};
90
+ for (let attributeId = 0; attributeId < dracoGeometry.num_attributes(); attributeId++) {
91
+ const dracoAttribute = this.decoder.GetAttribute(dracoGeometry, attributeId);
92
+ const attributeName = this._deduceAttributeName(dracoAttribute, options);
93
+ attributeNames[attributeName] = attributeName;
94
+ }
95
+ return attributeNames;
96
+ }
97
+ */
98
+ /**
99
+ * Deduce an attribute name.
100
+ * @note DRACO does not save attribute names, just general type (POSITION, COLOR)
101
+ * to help optimize compression. We generate GLTF compatible names for the Draco-recognized
102
+ * types
103
+ * @param attributeData
104
+ */
105
+ _deduceAttributeName(attribute: DracoAttribute, options: DracoParseOptions): string;
106
+ /** Get top level metadata */
107
+ _getTopLevelMetadata(dracoGeometry: Mesh | PointCloud): {
108
+ [entry: string]: DracoMetadataEntry;
109
+ };
110
+ /** Get per attribute metadata */
111
+ _getAttributeMetadata(dracoGeometry: Mesh | PointCloud, attributeId: number): {
112
+ [entry: string]: DracoMetadataEntry;
113
+ };
114
+ /**
115
+ * Extract metadata field values
116
+ * @param dracoMetadata
117
+ * @returns
118
+ */
119
+ _getDracoMetadata(dracoMetadata: Metadata): {
120
+ [entry: string]: DracoMetadataEntry;
121
+ };
122
+ /**
123
+ * Extracts possible values for one metadata entry by name
124
+ * @param dracoMetadata
125
+ * @param entryName
126
+ */
127
+ _getDracoMetadataField(dracoMetadata: Metadata, entryName: string): DracoMetadataEntry;
128
+ /** Skip transforms for specific attribute types */
129
+ _disableAttributeTransforms(options: DracoParseOptions): void;
130
+ /**
131
+ * Extract (and apply?) Position Transform
132
+ * @todo not used
133
+ */
134
+ _getQuantizationTransform(dracoAttribute: PointAttribute, options: DracoParseOptions): DracoQuantizationTransform | null;
135
+ _getOctahedronTransform(dracoAttribute: PointAttribute, options: DracoParseOptions): DracoOctahedronTransform | null;
136
+ }
137
+ //# sourceMappingURL=draco-parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draco-parser.d.ts","sourceRoot":"","sources":["../../src/lib/draco-parser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,UAAU,EAAE,aAAa,EAAE,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAGhF,OAAO,KAAK,EACV,OAAO,EAC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B,CACrB,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,iBAAiB,GACzB,wBAAwB,GAAG,IAAI;CAsBnC"}
@@ -0,0 +1,59 @@
1
+ import { Mesh } from '@loaders.gl/schema';
2
+ export declare type DracoMetadataEntry = {
3
+ int: number;
4
+ string: string;
5
+ double: number;
6
+ intArray: Int32Array;
7
+ };
8
+ /** For attributes that have not been fully decompressed */
9
+ export declare type DracoQuantizationTransform = {
10
+ quantization_bits?: number;
11
+ range?: number;
12
+ min_values?: Float32Array;
13
+ };
14
+ /** For attributes that have not been fully decompressed */
15
+ export declare type DracoOctahedronTransform = {
16
+ quantization_bits?: number;
17
+ };
18
+ /** Draco attribute fields */
19
+ export declare type DracoAttribute = {
20
+ unique_id: number;
21
+ num_components: number;
22
+ attribute_type: number;
23
+ data_type: number;
24
+ byte_offset: number;
25
+ byte_stride: number;
26
+ normalized: boolean;
27
+ name?: string;
28
+ quantization_transform?: DracoQuantizationTransform;
29
+ octahedron_transform?: DracoOctahedronTransform;
30
+ metadata: {
31
+ [key: string]: DracoMetadataEntry;
32
+ };
33
+ attribute_index: number;
34
+ };
35
+ /**
36
+ * Draco format specific data
37
+ * The `data.loaderData` field will have this layout when `data.loader === 'draco'`.
38
+ * @todo Metadata should also be available in normalized form in a standard `Schema`.
39
+ */
40
+ export declare type DracoLoaderData = {
41
+ geometry_type: number;
42
+ num_attributes: number;
43
+ num_points: number;
44
+ num_faces: number;
45
+ metadata: {
46
+ [entry: string]: DracoMetadataEntry;
47
+ };
48
+ attributes: {
49
+ [unique_id: number]: DracoAttribute;
50
+ };
51
+ };
52
+ /**
53
+ * loaders.gl Mesh with Draco specific data
54
+ */
55
+ export declare type DracoMesh = Mesh & {
56
+ loader: 'draco';
57
+ loaderData: DracoLoaderData;
58
+ };
59
+ //# sourceMappingURL=draco-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draco-types.d.ts","sourceRoot":"","sources":["../../src/lib/draco-types.ts"],"names":[],"mappings":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;QAAC,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc,CAAA;KAAC,CAAC;CAGnD,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS,GAAG,IAAI,GAAG;IAC7B,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,eAAe,CAAC;CAC7B,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { MeshAttribute } from '@loaders.gl/schema';
2
+ import { Schema } from '@loaders.gl/schema';
3
+ import type { DracoLoaderData } from '../draco-types';
4
+ /** Extract an arrow-like schema from a Draco mesh */
5
+ export declare function getDracoSchema(attributes: {
6
+ [attributeName: string]: MeshAttribute;
7
+ }, loaderData: DracoLoaderData, indices?: MeshAttribute): Schema;
8
+ //# sourceMappingURL=get-draco-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-draco-schema.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/get-draco-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,aAAa,EAAC,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAC,MAAM,EAAQ,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAiB,eAAe,EAAqB,MAAM,gBAAgB,CAAC;AAExF,qDAAqD;AACrD,wBAAgB,cAAc,CAC5B,UAAU,EAAE;IAAC,CAAC,aAAa,EAAE,MAAM,GAAG,aAAa,CAAA;CAAC,EACpD,UAAU,EAAE,eAAe,EAC3B,OAAO,CAAC,EAAE,aAAa,GACtB,MAAM,CAkBR"}
@@ -0,0 +1,2 @@
1
+ export declare const VERSION: any;
2
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/version.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,KAA8D,CAAC"}
@@ -1,2 +1,2 @@
1
- export const VERSION = typeof "4.0.0-alpha.4" !== 'undefined' ? "4.0.0-alpha.4" : 'latest';
1
+ export const VERSION = typeof "4.0.0-alpha.5" !== 'undefined' ? "4.0.0-alpha.5" : 'latest';
2
2
  //# sourceMappingURL=version.js.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=draco-worker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draco-worker.d.ts","sourceRoot":"","sources":["../../src/workers/draco-worker.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/draco",
3
- "version": "4.0.0-alpha.4",
3
+ "version": "4.0.0-alpha.5",
4
4
  "description": "Framework-independent loader and writer for Draco compressed meshes and point clouds",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -19,7 +19,7 @@
19
19
  "draco3d",
20
20
  "draco"
21
21
  ],
22
- "types": "src/index.ts",
22
+ "types": "dist/index.d.ts",
23
23
  "main": "dist/index.js",
24
24
  "module": "dist/index.js",
25
25
  "sideEffects": false,
@@ -33,15 +33,15 @@
33
33
  ],
34
34
  "scripts": {
35
35
  "pre-build": "npm run build-bundle && npm run build-worker",
36
- "build-bundle": "esbuild src/bundle.ts --bundle --outfile=dist/bundle.js",
37
- "build-worker": "esbuild src/workers/draco-worker.ts --bundle --outfile=dist/draco-worker.js"
36
+ "build-bundle": "esbuild src/bundle.ts --outfile=dist/dist.min.js --bundle --minify --sourcemap",
37
+ "build-worker": "esbuild src/workers/draco-worker.ts --outfile=dist/draco-worker.js --bundle --minify --sourcemap --define:__VERSION__=\\\"$npm_package_version\\\""
38
38
  },
39
39
  "dependencies": {
40
40
  "@babel/runtime": "^7.3.1",
41
- "@loaders.gl/loader-utils": "4.0.0-alpha.4",
42
- "@loaders.gl/schema": "4.0.0-alpha.4",
43
- "@loaders.gl/worker-utils": "4.0.0-alpha.4",
41
+ "@loaders.gl/loader-utils": "4.0.0-alpha.5",
42
+ "@loaders.gl/schema": "4.0.0-alpha.5",
43
+ "@loaders.gl/worker-utils": "4.0.0-alpha.5",
44
44
  "draco3d": "1.4.1"
45
45
  },
46
- "gitHead": "53026061b3c8871f7e96d3a5826125cc6613bddc"
46
+ "gitHead": "7a71a54bdf1ddf985cc3af3db90b82e7fa97d025"
47
47
  }