@margoengine/points 0.0.0-stage → 0.1.0

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.
Files changed (52) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +4 -0
  3. package/README.md +794 -3
  4. package/dist/attributes-DNc-1pdr.js +256 -0
  5. package/dist/attributes.d.ts +48 -0
  6. package/dist/clip.d.ts +55 -0
  7. package/dist/clip.js +122 -0
  8. package/dist/cloud-B4O_G-Df.js +545 -0
  9. package/dist/cloud.d.ts +155 -0
  10. package/dist/color.d.ts +1 -0
  11. package/dist/copc.d.ts +55 -0
  12. package/dist/copc.js +130 -0
  13. package/dist/depth-video.d.ts +98 -0
  14. package/dist/depth-video.js +164 -0
  15. package/dist/e57.d.ts +163 -0
  16. package/dist/e57.js +624 -0
  17. package/dist/frame.d.ts +9 -0
  18. package/dist/index.d.ts +16 -0
  19. package/dist/index.js +1246 -0
  20. package/dist/las.d.ts +213 -0
  21. package/dist/las.js +500 -0
  22. package/dist/laz.d.ts +50 -0
  23. package/dist/laz.js +1025 -0
  24. package/dist/material.d.ts +167 -0
  25. package/dist/math.d.ts +103 -0
  26. package/dist/octree.d.ts +182 -0
  27. package/dist/octree.js +360 -0
  28. package/dist/pick.d.ts +76 -0
  29. package/dist/pick.js +192 -0
  30. package/dist/plugin.d.ts +235 -0
  31. package/dist/potree.d.ts +70 -0
  32. package/dist/potree.js +451 -0
  33. package/dist/range-BQuJAjUM.js +23 -0
  34. package/dist/range.d.ts +4 -0
  35. package/dist/screen-door-CALlYs39.js +7 -0
  36. package/dist/shaders-Deu8H36P.js +278 -0
  37. package/dist/shaders.d.ts +52 -0
  38. package/dist/shared/fog.d.ts +33 -0
  39. package/dist/shared/pass.d.ts +53 -0
  40. package/dist/shared/selection-mask.d.ts +52 -0
  41. package/dist/shared/style-expression.d.ts +18 -0
  42. package/dist/sprites.d.ts +78 -0
  43. package/dist/storage-limit.d.ts +6 -0
  44. package/dist/style.d.ts +124 -0
  45. package/dist/style.js +708 -0
  46. package/dist/surfels.d.ts +95 -0
  47. package/dist/surfels.js +538 -0
  48. package/dist/survey-DToZwkJv.js +46 -0
  49. package/dist/survey.d.ts +10 -0
  50. package/dist/tier-BcFbLPVT.js +91 -0
  51. package/dist/tier.d.ts +6 -0
  52. package/package.json +96 -6
package/dist/e57.d.ts ADDED
@@ -0,0 +1,163 @@
1
+ /** CRC-32C of bytes. */
2
+ export declare function crc32c(bytes: Uint8Array): number;
3
+ /** A parsed XML element (the subset E57 uses: elements, attributes, text). */
4
+ export interface E57Element {
5
+ readonly name: string;
6
+ readonly attributes: Readonly<Record<string, string>>;
7
+ readonly children: readonly E57Element[];
8
+ readonly text: string;
9
+ }
10
+ /** Parses XML into elements (no DTDs, no processing beyond the declaration); throws TypeError on malformed input. */
11
+ export declare function parseXML(source: string): E57Element;
12
+ /** The file header. */
13
+ export interface E57Header {
14
+ readonly versionMajor: number;
15
+ readonly versionMinor: number;
16
+ readonly physicalLength: number;
17
+ readonly xmlOffset: number;
18
+ readonly xmlLength: number;
19
+ readonly pageSize: number;
20
+ }
21
+ /** One field of a points prototype. */
22
+ export interface E57Field {
23
+ readonly name: string;
24
+ readonly type: 'Float' | 'ScaledInteger' | 'Integer';
25
+ /** Float precision in bits (32 or 64), or the packed width of integers. */
26
+ readonly bits: number;
27
+ readonly minimum: number;
28
+ readonly maximum: number;
29
+ readonly scale: number;
30
+ readonly offset: number;
31
+ }
32
+ /** One scan (a data3D child): its points in world coordinates (pose applied) relative to the file's origin. */
33
+ export interface E57Scan {
34
+ readonly name: string;
35
+ readonly guid: string;
36
+ /** Rotation quaternion [w, x, y, z] and translation of the scan's pose. */
37
+ readonly pose: {
38
+ readonly rotation: readonly [number, number, number, number];
39
+ readonly translation: readonly [number, number, number];
40
+ };
41
+ readonly fields: readonly E57Field[];
42
+ /** Records stored (including invalid ones). */
43
+ readonly recordCount: number;
44
+ /** Valid points kept. */
45
+ readonly count: number;
46
+ /** xyz per point relative to `origin`, float32. */
47
+ readonly positions: Float32Array;
48
+ /** Intensity normalised to 0..1 by `intensityLimits`, when the scan has it. */
49
+ readonly intensity?: Float32Array;
50
+ /** RGBA 0..255, normalised by `colorLimits`, when the scan has colour. */
51
+ readonly colors?: Uint8Array;
52
+ /** Any other numeric field (returnIndex, timeStamp, rowIndex, ...), by name, raw values. */
53
+ readonly attributes: Readonly<Record<string, Float64Array>>;
54
+ }
55
+ /** How an E57 2D image maps pixels to rays. */
56
+ export type E57ImageProjection = 'pinhole' | 'spherical' | 'cylindrical' | 'visualReference';
57
+ /** One images2D entry: the encoded picture bytes with the camera pose and projection parameters. */
58
+ export interface E57Image {
59
+ readonly name: string;
60
+ readonly guid: string;
61
+ /** guid of the scan (data3D child) this picture was taken with, when stated. */
62
+ readonly associatedScanGuid?: string;
63
+ readonly description?: string;
64
+ readonly projection: E57ImageProjection;
65
+ readonly width: number;
66
+ readonly height: number;
67
+ /** Encoding of `data`. */
68
+ readonly format: 'jpeg' | 'png';
69
+ readonly mime: 'image/jpeg' | 'image/png';
70
+ /** The encoded picture, ready for `new Blob([data], { type: mime })` or `createImageBitmap`. */
71
+ readonly data: Uint8Array<ArrayBuffer>;
72
+ /** Optional PNG mask (non-zero pixels are valid). */
73
+ readonly mask?: Uint8Array<ArrayBuffer>;
74
+ /** Camera pose in the file's world frame (not recentred on `origin`): rotation [w, x, y, z] and translation. */
75
+ readonly pose: {
76
+ readonly rotation: readonly [number, number, number, number];
77
+ readonly translation: readonly [number, number, number];
78
+ };
79
+ /** Projection parameters by name: pinhole focalLength, pixelWidth, pixelHeight, principalPointX/Y; spherical
80
+ * pixelWidth, pixelHeight; cylindrical radius, principalPointY, pixelWidth, pixelHeight. Lengths in metres. */
81
+ readonly parameters: Readonly<Record<string, number>>;
82
+ }
83
+ /** A parsed E57 file. */
84
+ export interface E57File {
85
+ readonly header: E57Header;
86
+ readonly xml: E57Element;
87
+ /** World position of local [0, 0, 0]: the centre of every scan's posed bounds unless `origin` was given. */
88
+ readonly origin: readonly [number, number, number];
89
+ readonly scans: readonly E57Scan[];
90
+ /** The images2D pictures with their poses (empty when the file has none or `images: false`). */
91
+ readonly images: readonly E57Image[];
92
+ /** Coordinate metadata text of the root, when present. */
93
+ readonly coordinateMetadata?: string;
94
+ }
95
+ /** Options of `parseE57`. */
96
+ export interface E57Options {
97
+ /** World position to store positions relative to. Default: the centre of all posed points. */
98
+ origin?: readonly [number, number, number];
99
+ /** Verify every page's CRC-32C. Default true. */
100
+ verifyChecksums?: boolean;
101
+ /** Keep points flagged invalid (cartesianInvalidState 2, sphericalInvalidState 2). Default false. */
102
+ keepInvalid?: boolean;
103
+ /** Read the images2D pictures. Default true. */
104
+ images?: boolean;
105
+ signal?: AbortSignal;
106
+ }
107
+ /** Reads the 48-byte header. */
108
+ export declare function readE57Header(bytes: Uint8Array): E57Header;
109
+ /** Parses an E57 file: every scan's points posed into one world frame. */
110
+ export declare function parseE57(input: ArrayBuffer | Uint8Array, options?: E57Options): E57File;
111
+ /** Fetches and parses an E57 file. Aborts with `options.signal`. */
112
+ export declare function loadE57(url: string | URL, options?: E57Options & {
113
+ fetch?: typeof fetch;
114
+ }): Promise<E57File>;
115
+ /** A scan for `writeE57`. */
116
+ export interface E57WriteScan {
117
+ name?: string;
118
+ /** xyz per point (scan-local unless a pose is given). Or give `spherical` instead. */
119
+ positions?: ArrayLike<number>;
120
+ /** range, azimuth, elevation per point (radians). */
121
+ spherical?: ArrayLike<number>;
122
+ /** Store coordinates as ScaledInteger with this resolution instead of double floats. */
123
+ resolution?: number;
124
+ /** Intensity 0..1 (stored as a 16-bit Integer). */
125
+ intensity?: ArrayLike<number>;
126
+ /** RGB 0..255 per point (8-bit Integers). */
127
+ rgb?: ArrayLike<number>;
128
+ /** cartesianInvalidState (or spherical) per point: 0 valid, 1 direction only, 2 invalid. */
129
+ invalid?: ArrayLike<number>;
130
+ pose?: {
131
+ rotation?: readonly [number, number, number, number];
132
+ translation?: readonly [number, number, number];
133
+ };
134
+ }
135
+ /** A picture for `writeE57`. */
136
+ export interface E57WriteImage {
137
+ name?: string;
138
+ /** Encoded JPEG or PNG bytes. */
139
+ data: Uint8Array;
140
+ format: 'jpeg' | 'png';
141
+ projection: 'pinhole' | 'spherical' | 'cylindrical';
142
+ width: number;
143
+ height: number;
144
+ /** PNG mask bytes. */
145
+ mask?: Uint8Array;
146
+ /** Index of the scan written with it that this picture belongs to. */
147
+ scan?: number;
148
+ pose?: {
149
+ rotation?: readonly [number, number, number, number];
150
+ translation?: readonly [number, number, number];
151
+ };
152
+ /** Projection parameters (focalLength, pixelWidth, pixelHeight, principalPointX, principalPointY, radius). */
153
+ parameters?: Readonly<Record<string, number>>;
154
+ }
155
+ /** Writes an E57 file (bitPack codec, one data packet stream per scan). Meant for tools and round-trip tests. */
156
+ export declare function writeE57(scans: readonly E57WriteScan[], options?: {
157
+ packetBytes?: number;
158
+ }): Uint8Array;
159
+ /** `writeE57` with pictures: the same scans plus `images` written as images2D with their poses and projections. */
160
+ export declare function writeE57Document(scans: readonly E57WriteScan[], options?: {
161
+ packetBytes?: number;
162
+ images?: readonly E57WriteImage[];
163
+ }): Uint8Array;