@ifc-lite/renderer 1.38.1 → 1.40.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.
- package/dist/deviation/deviation-pipeline.d.ts +8 -0
- package/dist/deviation/deviation-pipeline.d.ts.map +1 -1
- package/dist/deviation/deviation-pipeline.js +20 -9
- package/dist/deviation/deviation-pipeline.js.map +1 -1
- package/dist/deviation/deviation-shader.wgsl.d.ts +1 -1
- package/dist/deviation/deviation-shader.wgsl.d.ts.map +1 -1
- package/dist/deviation/deviation-shader.wgsl.js +11 -3
- package/dist/deviation/deviation-shader.wgsl.js.map +1 -1
- package/dist/index.d.ts +45 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +78 -3
- package/dist/index.js.map +1 -1
- package/dist/picker.d.ts +9 -0
- package/dist/picker.d.ts.map +1 -1
- package/dist/picker.js +84 -2
- package/dist/picker.js.map +1 -1
- package/dist/pointcloud/point-cloud-node.d.ts +46 -0
- package/dist/pointcloud/point-cloud-node.d.ts.map +1 -1
- package/dist/pointcloud/point-cloud-node.js +71 -0
- package/dist/pointcloud/point-cloud-node.js.map +1 -1
- package/dist/pointcloud/point-cloud-ray-transform.d.ts +66 -0
- package/dist/pointcloud/point-cloud-ray-transform.d.ts.map +1 -0
- package/dist/pointcloud/point-cloud-ray-transform.js +172 -0
- package/dist/pointcloud/point-cloud-ray-transform.js.map +1 -0
- package/dist/pointcloud/point-cloud-renderer.d.ts +39 -6
- package/dist/pointcloud/point-cloud-renderer.d.ts.map +1 -1
- package/dist/pointcloud/point-cloud-renderer.js +53 -17
- package/dist/pointcloud/point-cloud-renderer.js.map +1 -1
- package/dist/pointcloud/point-cloud-spatial-index.d.ts +188 -0
- package/dist/pointcloud/point-cloud-spatial-index.d.ts.map +1 -0
- package/dist/pointcloud/point-cloud-spatial-index.js +536 -0
- package/dist/pointcloud/point-cloud-spatial-index.js.map +1 -0
- package/dist/pointcloud/point-cloud-uniforms.d.ts +14 -2
- package/dist/pointcloud/point-cloud-uniforms.d.ts.map +1 -1
- package/dist/pointcloud/point-cloud-uniforms.js +49 -8
- package/dist/pointcloud/point-cloud-uniforms.js.map +1 -1
- package/dist/pointcloud/point-pipeline.d.ts +3 -2
- package/dist/pointcloud/point-pipeline.d.ts.map +1 -1
- package/dist/pointcloud/point-pipeline.js +8 -5
- package/dist/pointcloud/point-pipeline.js.map +1 -1
- package/dist/pointcloud/point-shader.wgsl.d.ts +1 -1
- package/dist/pointcloud/point-shader.wgsl.d.ts.map +1 -1
- package/dist/pointcloud/point-shader.wgsl.js +20 -17
- package/dist/pointcloud/point-shader.wgsl.js.map +1 -1
- package/dist/raycast-engine.d.ts +8 -0
- package/dist/raycast-engine.d.ts.map +1 -1
- package/dist/raycast-engine.js +68 -23
- package/dist/raycast-engine.js.map +1 -1
- package/dist/raycast-point-cloud-query.d.ts +122 -0
- package/dist/raycast-point-cloud-query.d.ts.map +1 -0
- package/dist/raycast-point-cloud-query.js +145 -0
- package/dist/raycast-point-cloud-query.js.map +1 -0
- package/dist/scene.d.ts +18 -0
- package/dist/scene.d.ts.map +1 -1
- package/dist/scene.js +166 -63
- package/dist/scene.js.map +1 -1
- package/dist/snap-detector.d.ts +12 -1
- package/dist/snap-detector.d.ts.map +1 -1
- package/dist/snap-detector.js +9 -1
- package/dist/snap-detector.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
/**
|
|
5
|
+
* Ray <-> point-cloud local-frame conversion for snap queries.
|
|
6
|
+
*
|
|
7
|
+
* ## Why this exists
|
|
8
|
+
*
|
|
9
|
+
* Two features landed independently and left a gap between them:
|
|
10
|
+
*
|
|
11
|
+
* - #1804 gives each point-cloud node a per-asset model matrix
|
|
12
|
+
* (`PointCloudNode.model`) applied at RENDER time — the shader places
|
|
13
|
+
* points through it, and `transformAabb` folds it into reported bounds.
|
|
14
|
+
* - #1860 built the snap/measure spatial index, which stores RAW,
|
|
15
|
+
* untransformed chunk positions straight off the decoder.
|
|
16
|
+
*
|
|
17
|
+
* So for a georeferenced (aligned) scan the renderer draws points at
|
|
18
|
+
* aligned positions while the snap query walks an index of pre-alignment
|
|
19
|
+
* positions: a measurement snapped to where the point USED to be, not
|
|
20
|
+
* where the user can see it. Both features are individually correct; the
|
|
21
|
+
* defect only exists in their composition, which is why neither PR's tests
|
|
22
|
+
* caught it.
|
|
23
|
+
*
|
|
24
|
+
* ## Why the ray moves, not the points
|
|
25
|
+
*
|
|
26
|
+
* We inverse-transform the ray into the node's local frame rather than
|
|
27
|
+
* transforming candidate points into world space:
|
|
28
|
+
*
|
|
29
|
+
* - The index's cell keys are packed RELATIVE to the first indexed point
|
|
30
|
+
* and are only meaningful in local space — transforming points would
|
|
31
|
+
* invalidate the whole acceleration structure.
|
|
32
|
+
* - It is O(1) per node instead of O(points-examined).
|
|
33
|
+
*
|
|
34
|
+
* ## Distances stay in world units
|
|
35
|
+
*
|
|
36
|
+
* `queryRay` treats `t` as a distance along a UNIT direction and compares
|
|
37
|
+
* `toleranceAt(t)` as a perpendicular radius, both in the index's own
|
|
38
|
+
* space. Under a matrix with scale `s`, a world distance `d` is a local
|
|
39
|
+
* distance `d / s`. Every distance-valued quantity therefore has to be
|
|
40
|
+
* converted on the way in and back on the way out:
|
|
41
|
+
*
|
|
42
|
+
* maxDistance_local = maxDistance_world / s
|
|
43
|
+
* toleranceAt_local(t_local) = toleranceAt_world(t_local * s) / s
|
|
44
|
+
* distance_world = distance_local * s
|
|
45
|
+
*
|
|
46
|
+
* Get this wrong and the ~8px screen-space snap tolerance silently means
|
|
47
|
+
* something different on any scan whose CRS is not in metres (a foot-based
|
|
48
|
+
* CRS carries s = 0.3048), which would read as "snapping feels wrong on
|
|
49
|
+
* US survey-foot projects" — the sort of bug that is very hard to trace
|
|
50
|
+
* back to a matrix.
|
|
51
|
+
*
|
|
52
|
+
* The alignment matrices this handles are similarity transforms (uniform
|
|
53
|
+
* scale * rotation about Y, zero translation — see `pointCloudAlignment`),
|
|
54
|
+
* so a single scalar `s` is exact. `matrixUniformScale` falls back to the
|
|
55
|
+
* mean column length for anything else, which keeps a non-uniform matrix
|
|
56
|
+
* approximately right rather than wildly wrong.
|
|
57
|
+
*
|
|
58
|
+
* ## Known limit: long-range reach under a sub-unit scale
|
|
59
|
+
*
|
|
60
|
+
* `PointCloudSpatialIndex` caps its per-step dilation at
|
|
61
|
+
* `MAX_DILATION_RADIUS_CELLS * cellSize` = 2 LOCAL units, a deliberate
|
|
62
|
+
* bound on march cost. Because the tolerance is converted into local
|
|
63
|
+
* units, a matrix with `s < 1` tightens that cap in world terms: a
|
|
64
|
+
* foot-based CRS (`s = 0.3048`) caps the effective snap radius at
|
|
65
|
+
* `2 * 0.3048 = 0.61 m` rather than 2 m, so at long range a point inside
|
|
66
|
+
* the nominal ~8px tolerance can sit outside the searched cells and be
|
|
67
|
+
* missed.
|
|
68
|
+
*
|
|
69
|
+
* This is a reach limit, not a wrong answer: whatever the query returns is
|
|
70
|
+
* correctly placed, and near-to-mid range (where measuring actually
|
|
71
|
+
* happens) is unaffected. Restoring the full world-space reach means
|
|
72
|
+
* scaling the cap to `MAX_DILATION_RADIUS_CELLS / s` (~14 cells at
|
|
73
|
+
* s = 0.3048), which re-inflates the per-step probe cost that the
|
|
74
|
+
* leading-slab bound exists to contain — a perf trade that should be made
|
|
75
|
+
* deliberately, with a benchmark, rather than folded into this fix.
|
|
76
|
+
*/
|
|
77
|
+
import { MathUtils } from '../math.js';
|
|
78
|
+
import { isUsableModelMatrix } from './point-cloud-node.js';
|
|
79
|
+
/**
|
|
80
|
+
* Build the snap-query snapshot from live nodes.
|
|
81
|
+
*
|
|
82
|
+
* Pure and node-shaped rather than inlined in `PointCloudRenderer` so it is
|
|
83
|
+
* testable without a `GPUDevice`. That matters here specifically: the
|
|
84
|
+
* renderer-to-query wiring is exactly where the aligned-scan gap lived, and
|
|
85
|
+
* it went unnoticed because nothing could exercise it without a GPU. Empty
|
|
86
|
+
* nodes are skipped, mirroring `getPickNodes`.
|
|
87
|
+
*/
|
|
88
|
+
export function buildRayQuerySources(nodes, classMask) {
|
|
89
|
+
const out = [];
|
|
90
|
+
for (const node of nodes) {
|
|
91
|
+
if (node.spatialIndex.pointCount === 0)
|
|
92
|
+
continue;
|
|
93
|
+
out.push({
|
|
94
|
+
expressId: node.meta.expressId,
|
|
95
|
+
modelIndex: node.meta.modelIndex,
|
|
96
|
+
index: node.spatialIndex,
|
|
97
|
+
// The index stores RAW decoder positions while the shader draws
|
|
98
|
+
// through `model` (#1804) — the query needs the matrix to reconcile
|
|
99
|
+
// the two, or an aligned scan snaps to pre-alignment coordinates.
|
|
100
|
+
model: node.model,
|
|
101
|
+
classMask,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
return out;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Uniform scale factor of a column-major 4x4's linear part.
|
|
108
|
+
*
|
|
109
|
+
* Exact for a similarity transform (every column has the same length);
|
|
110
|
+
* for a non-uniform matrix it returns the mean, which keeps snap
|
|
111
|
+
* tolerances in the right ballpark rather than exact. Returns 1 for a
|
|
112
|
+
* degenerate (~zero) matrix so callers never divide by zero.
|
|
113
|
+
*/
|
|
114
|
+
export function matrixUniformScale(m) {
|
|
115
|
+
const cx = Math.hypot(m[0], m[1], m[2]);
|
|
116
|
+
const cy = Math.hypot(m[4], m[5], m[6]);
|
|
117
|
+
const cz = Math.hypot(m[8], m[9], m[10]);
|
|
118
|
+
const mean = (cx + cy + cz) / 3;
|
|
119
|
+
return mean > 1e-12 ? mean : 1;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* True when `m` is close enough to the identity that transforming through
|
|
123
|
+
* it is pure overhead. The overwhelmingly common case is an unaligned
|
|
124
|
+
* scan, and this keeps that path allocation-free.
|
|
125
|
+
*/
|
|
126
|
+
export function isIdentityMatrix(m) {
|
|
127
|
+
const EPS = 1e-6;
|
|
128
|
+
for (let i = 0; i < 16; i++) {
|
|
129
|
+
const expected = i % 5 === 0 ? 1 : 0;
|
|
130
|
+
if (Math.abs(m[i] - expected) > EPS)
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Rewrite a world-space ray into `model`'s local frame.
|
|
137
|
+
*
|
|
138
|
+
* Returns `null` when no transform is needed (absent, malformed, identity)
|
|
139
|
+
* or when the matrix is singular — callers should then query with the
|
|
140
|
+
* original world ray, which is the correct behaviour for an unaligned
|
|
141
|
+
* cloud and a safe fallback for a degenerate matrix.
|
|
142
|
+
*/
|
|
143
|
+
export function toLocalFrameRay(origin, direction, model) {
|
|
144
|
+
if (!isUsableModelMatrix(model) || isIdentityMatrix(model))
|
|
145
|
+
return null;
|
|
146
|
+
const inv = MathUtils.invert({ m: model });
|
|
147
|
+
if (!inv)
|
|
148
|
+
return null;
|
|
149
|
+
const i = inv.m;
|
|
150
|
+
const ox = i[0] * origin.x + i[4] * origin.y + i[8] * origin.z + i[12];
|
|
151
|
+
const oy = i[1] * origin.x + i[5] * origin.y + i[9] * origin.z + i[13];
|
|
152
|
+
const oz = i[2] * origin.x + i[6] * origin.y + i[10] * origin.z + i[14];
|
|
153
|
+
// Direction is a vector: no translation column.
|
|
154
|
+
const dx = i[0] * direction.x + i[4] * direction.y + i[8] * direction.z;
|
|
155
|
+
const dy = i[1] * direction.x + i[5] * direction.y + i[9] * direction.z;
|
|
156
|
+
const dz = i[2] * direction.x + i[6] * direction.y + i[10] * direction.z;
|
|
157
|
+
const len = Math.hypot(dx, dy, dz);
|
|
158
|
+
if (!(len > 1e-12))
|
|
159
|
+
return null;
|
|
160
|
+
const m = model;
|
|
161
|
+
return {
|
|
162
|
+
origin: { x: ox, y: oy, z: oz },
|
|
163
|
+
direction: { x: dx / len, y: dy / len, z: dz / len },
|
|
164
|
+
distanceScale: matrixUniformScale(m),
|
|
165
|
+
toWorld: (p) => ({
|
|
166
|
+
x: m[0] * p.x + m[4] * p.y + m[8] * p.z + m[12],
|
|
167
|
+
y: m[1] * p.x + m[5] * p.y + m[9] * p.z + m[13],
|
|
168
|
+
z: m[2] * p.x + m[6] * p.y + m[10] * p.z + m[14],
|
|
169
|
+
}),
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
//# sourceMappingURL=point-cloud-ray-transform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"point-cloud-ray-transform.js","sourceRoot":"","sources":["../../src/pointcloud/point-cloud-ray-transform.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAkB5D;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAClC,KAAsB,EACtB,SAAsB;IAEtB,MAAM,GAAG,GAAiC,EAAE,CAAC;IAC7C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,IAAI,CAAC,YAAY,CAAC,UAAU,KAAK,CAAC;YAAE,SAAS;QACjD,GAAG,CAAC,IAAI,CAAC;YACP,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS;YAC9B,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU;YAChC,KAAK,EAAE,IAAI,CAAC,YAAY;YACxB,gEAAgE;YAChE,oEAAoE;YACpE,kEAAkE;YAClE,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,SAAS;SACV,CAAC,CAAC;IACL,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AA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AAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;SACjD,CAAC;KACH,CAAC;AACJ,CAAC"}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import type { PointCloudAsset } from '@ifc-lite/geometry';
|
|
14
14
|
import { type PointCloudChunkInput, type PointCloudNode, type PointCloudNodeMeta } from './point-cloud-node.js';
|
|
15
|
+
import type { PointCloudSpatialIndex } from './point-cloud-spatial-index.js';
|
|
15
16
|
import { type PointColorMode, type PointSizeMode } from './point-cloud-uniforms.js';
|
|
16
17
|
export interface ResolvedSectionPlane {
|
|
17
18
|
normal: [number, number, number];
|
|
@@ -57,12 +58,14 @@ export interface PointCloudRenderOptions {
|
|
|
57
58
|
/** Render splats as discs instead of squares. Defaults to true. */
|
|
58
59
|
roundShape?: boolean;
|
|
59
60
|
/**
|
|
60
|
-
* Per-
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
61
|
+
* Per-LAS-class visibility bitmask covering the full 0..255 code
|
|
62
|
+
* range (#1783). Bit `i % 32` of word `i / 32` set → class `i` is
|
|
63
|
+
* visible. Pass up to 8 u32 words LSB-first (missing words default
|
|
64
|
+
* to all-visible), or a plain `number` for the legacy 32-bit form
|
|
65
|
+
* (classes 32..255 stay visible). Defaults to everything visible.
|
|
66
|
+
* Only affects points carrying classifications; meshes ignore it.
|
|
64
67
|
*/
|
|
65
|
-
classMask?: number
|
|
68
|
+
classMask?: number | ArrayLike<number>;
|
|
66
69
|
/**
|
|
67
70
|
* Stride-cull factor for the splat shader: 1 = render every point,
|
|
68
71
|
* 2 = every other, 4 = every fourth, etc. Used by the section-plane
|
|
@@ -86,6 +89,13 @@ export interface PointCloudRenderOptions {
|
|
|
86
89
|
export interface PointCloudAssetHandle {
|
|
87
90
|
readonly id: number;
|
|
88
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* `PointCloudRenderOptions` with every field present and `classMask`
|
|
94
|
+
* normalized to the 8-word uniform layout.
|
|
95
|
+
*/
|
|
96
|
+
export type ResolvedPointCloudRenderOptions = Omit<Required<PointCloudRenderOptions>, 'classMask'> & {
|
|
97
|
+
classMask: Uint32Array;
|
|
98
|
+
};
|
|
89
99
|
export declare class PointCloudRenderer {
|
|
90
100
|
private device;
|
|
91
101
|
private pipeline;
|
|
@@ -97,7 +107,7 @@ export declare class PointCloudRenderer {
|
|
|
97
107
|
private options;
|
|
98
108
|
constructor(device: GPUDevice, colorFormat: GPUTextureFormat, depthFormat: GPUTextureFormat, sampleCount: number);
|
|
99
109
|
setOptions(opts: PointCloudRenderOptions): void;
|
|
100
|
-
getOptions(): Readonly<
|
|
110
|
+
getOptions(): Readonly<ResolvedPointCloudRenderOptions>;
|
|
101
111
|
/**
|
|
102
112
|
* Replace every IFCx-owned asset with `assets`. Streamed assets are
|
|
103
113
|
* untouched. Use this from the viewer's IFCx sync hook.
|
|
@@ -119,6 +129,14 @@ export declare class PointCloudRenderer {
|
|
|
119
129
|
* touching the per-vertex attributes.
|
|
120
130
|
*/
|
|
121
131
|
relabelAsset(handle: PointCloudAssetHandle, newExpressId: number): void;
|
|
132
|
+
/**
|
|
133
|
+
* Set (or clear) a streamed asset's per-vertex GPU model matrix
|
|
134
|
+
* (issue #1804: point-cloud ↔ `IfcMapConversion` alignment). Pass
|
|
135
|
+
* `null` to reset to identity. Takes effect on the next frame's
|
|
136
|
+
* uniform write — no GPU buffer rewrite needed, so toggling alignment
|
|
137
|
+
* on/off is cheap.
|
|
138
|
+
*/
|
|
139
|
+
setAssetTransform(handle: PointCloudAssetHandle, matrix: Float32Array | null): void;
|
|
122
140
|
clear(): void;
|
|
123
141
|
private clearOwner;
|
|
124
142
|
hasAssets(): boolean;
|
|
@@ -162,5 +180,20 @@ export declare class PointCloudRenderer {
|
|
|
162
180
|
pointCount: number;
|
|
163
181
|
}>;
|
|
164
182
|
}>;
|
|
183
|
+
/**
|
|
184
|
+
* Snapshot of every node's CPU spatial index (issue #1860), for the
|
|
185
|
+
* measure tool's ray-based point snapping (`RaycastEngine`). Skips
|
|
186
|
+
* empty nodes, mirroring `getPickNodes`. Each source carries the
|
|
187
|
+
* CURRENT class visibility bitmask so the query skips points the
|
|
188
|
+
* splat shader is hiding (#1783) — snapping to invisible scan data
|
|
189
|
+
* would otherwise silently corrupt measurements.
|
|
190
|
+
*/
|
|
191
|
+
getRayQuerySources(): Array<{
|
|
192
|
+
expressId: number;
|
|
193
|
+
modelIndex?: number;
|
|
194
|
+
index: PointCloudSpatialIndex;
|
|
195
|
+
classMask: Uint32Array;
|
|
196
|
+
model?: Float32Array;
|
|
197
|
+
}>;
|
|
165
198
|
}
|
|
166
199
|
//# sourceMappingURL=point-cloud-renderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"point-cloud-renderer.d.ts","sourceRoot":"","sources":["../../src/pointcloud/point-cloud-renderer.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,
|
|
1
|
+
{"version":3,"file":"point-cloud-renderer.d.ts","sourceRoot":"","sources":["../../src/pointcloud/point-cloud-renderer.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,EAML,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAE7E,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,2BAA2B,CAAC;AAEnC,MAAM,WAAW,oBAAoB;IACnC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IAQb,OAAO,CAAC,UAAU;IAUlB,SAAS,IAAI,OAAO;IAIpB,YAAY,IAAI,MAAM;IAItB;;;;OAIG;IACH,gBAAgB,IAAI,QAAQ,CAAC,cAAc,CAAC;IAI5C,mEAAmE;IACnE,aAAa,IAAI,MAAM;IAQvB,SAAS,IAAI;QAAE,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,GAAG,IAAI;IAyBpF;;;OAGG;IACH,IAAI,CAAC,IAAI,EAAE,oBAAoB,EAAE,KAAK,EAAE,mBAAmB,GAAG,IAAI;IAuElE;;;OAGG;IACH,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG;QAAE,MAAM,EAAE,qBAAqB,CAAC;QAAC,IAAI,EAAE,kBAAkB,CAAA;KAAE,GAAG,IAAI;IASlG;;;;;OAKG;IACH,YAAY,IAAI,KAAK,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,KAAK,CAAC;YAAE,YAAY,EAAE,SAAS,CAAC;YAAC,UAAU,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KAChE,CAAC;IAaF;;;;;;;OAOG;IACH,kBAAkB,IAAI,KAAK,CAAC;QAC1B,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,KAAK,EAAE,sBAAsB,CAAC;QAC9B,SAAS,EAAE,WAAW,CAAC;QACvB,KAAK,CAAC,EAAE,YAAY,CAAC;KACtB,CAAC;CAKH"}
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
3
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
4
|
import { PointRenderPipeline, POINT_QUAD_VERTS, POINT_UNIFORM_SIZE } from './point-pipeline.js';
|
|
5
|
-
import { appendChunkToNode, createNode, destroyNode, uploadAssetToGpu, } from './point-cloud-node.js';
|
|
6
|
-
import {
|
|
5
|
+
import { appendChunkToNode, createNode, destroyNode, transformAabb, uploadAssetToGpu, } from './point-cloud-node.js';
|
|
6
|
+
import { buildRayQuerySources } from './point-cloud-ray-transform.js';
|
|
7
|
+
import { normalizeClassMask, writePointCloudUniforms, } from './point-cloud-uniforms.js';
|
|
7
8
|
export class PointCloudRenderer {
|
|
8
9
|
device;
|
|
9
10
|
pipeline;
|
|
@@ -19,7 +20,7 @@ export class PointCloudRenderer {
|
|
|
19
20
|
sizeMode: 'attenuated',
|
|
20
21
|
worldRadius: 0.02,
|
|
21
22
|
roundShape: true,
|
|
22
|
-
classMask:
|
|
23
|
+
classMask: normalizeClassMask(undefined),
|
|
23
24
|
previewStride: 1,
|
|
24
25
|
deviationRange: { centerOffset: 0, halfRange: 0.05 },
|
|
25
26
|
};
|
|
@@ -41,7 +42,7 @@ export class PointCloudRenderer {
|
|
|
41
42
|
if (opts.roundShape !== undefined)
|
|
42
43
|
this.options.roundShape = opts.roundShape;
|
|
43
44
|
if (opts.classMask !== undefined)
|
|
44
|
-
this.options.classMask = opts.classMask
|
|
45
|
+
this.options.classMask = normalizeClassMask(opts.classMask);
|
|
45
46
|
if (opts.previewStride !== undefined) {
|
|
46
47
|
// Clamp to a sane positive integer — stride 0 would divide by
|
|
47
48
|
// zero in the shader's modulo. >256 is silly but harmless.
|
|
@@ -60,7 +61,10 @@ export class PointCloudRenderer {
|
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
63
|
getOptions() {
|
|
63
|
-
|
|
64
|
+
// Snapshot the mask — handing out the live Uint32Array would let
|
|
65
|
+
// callers mutate renderer visibility without going through
|
|
66
|
+
// setOptions.
|
|
67
|
+
return { ...this.options, classMask: this.options.classMask.slice() };
|
|
64
68
|
}
|
|
65
69
|
// ─── one-shot API (IFCx) ──────────────────────────────────────────────────
|
|
66
70
|
/**
|
|
@@ -123,6 +127,19 @@ export class PointCloudRenderer {
|
|
|
123
127
|
return;
|
|
124
128
|
node.meta.expressId = newExpressId >>> 0;
|
|
125
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
* Set (or clear) a streamed asset's per-vertex GPU model matrix
|
|
132
|
+
* (issue #1804: point-cloud ↔ `IfcMapConversion` alignment). Pass
|
|
133
|
+
* `null` to reset to identity. Takes effect on the next frame's
|
|
134
|
+
* uniform write — no GPU buffer rewrite needed, so toggling alignment
|
|
135
|
+
* on/off is cheap.
|
|
136
|
+
*/
|
|
137
|
+
setAssetTransform(handle, matrix) {
|
|
138
|
+
const node = this.nodes.get(handle.id);
|
|
139
|
+
if (!node)
|
|
140
|
+
return;
|
|
141
|
+
node.model = matrix ?? undefined;
|
|
142
|
+
}
|
|
126
143
|
// ─── lifecycle / queries ─────────────────────────────────────────────────
|
|
127
144
|
clear() {
|
|
128
145
|
for (const node of this.nodes.values()) {
|
|
@@ -174,18 +191,24 @@ export class PointCloudRenderer {
|
|
|
174
191
|
if (!Number.isFinite(node.bounds.min[0]))
|
|
175
192
|
continue;
|
|
176
193
|
any = true;
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
if (
|
|
184
|
-
|
|
185
|
-
if (
|
|
186
|
-
|
|
187
|
-
if (
|
|
188
|
-
|
|
194
|
+
// Report WORLD-space extents: fold the per-asset model matrix
|
|
195
|
+
// (issue #1804 IfcMapConversion alignment) into the chunk-space
|
|
196
|
+
// bounds, so the height-ramp min/max and the viewer's scene
|
|
197
|
+
// bounds/framing agree with where the vertex shader actually
|
|
198
|
+
// places the points. Identity/no-matrix nodes pass through as-is.
|
|
199
|
+
const b = transformAabb(node.bounds, node.model);
|
|
200
|
+
if (b.min[0] < minX)
|
|
201
|
+
minX = b.min[0];
|
|
202
|
+
if (b.min[1] < minY)
|
|
203
|
+
minY = b.min[1];
|
|
204
|
+
if (b.min[2] < minZ)
|
|
205
|
+
minZ = b.min[2];
|
|
206
|
+
if (b.max[0] > maxX)
|
|
207
|
+
maxX = b.max[0];
|
|
208
|
+
if (b.max[1] > maxY)
|
|
209
|
+
maxY = b.max[1];
|
|
210
|
+
if (b.max[2] > maxZ)
|
|
211
|
+
maxZ = b.max[2];
|
|
189
212
|
}
|
|
190
213
|
if (!any)
|
|
191
214
|
return null;
|
|
@@ -289,5 +312,18 @@ export class PointCloudRenderer {
|
|
|
289
312
|
}
|
|
290
313
|
return out;
|
|
291
314
|
}
|
|
315
|
+
/**
|
|
316
|
+
* Snapshot of every node's CPU spatial index (issue #1860), for the
|
|
317
|
+
* measure tool's ray-based point snapping (`RaycastEngine`). Skips
|
|
318
|
+
* empty nodes, mirroring `getPickNodes`. Each source carries the
|
|
319
|
+
* CURRENT class visibility bitmask so the query skips points the
|
|
320
|
+
* splat shader is hiding (#1783) — snapping to invisible scan data
|
|
321
|
+
* would otherwise silently corrupt measurements.
|
|
322
|
+
*/
|
|
323
|
+
getRayQuerySources() {
|
|
324
|
+
// `classMask` is a live reference — read synchronously within one
|
|
325
|
+
// query, and `setOptions` replaces (never mutates in place) the array.
|
|
326
|
+
return buildRayQuerySources(this.nodes.values(), this.options.classMask);
|
|
327
|
+
}
|
|
292
328
|
}
|
|
293
329
|
//# sourceMappingURL=point-cloud-renderer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"point-cloud-renderer.js","sourceRoot":"","sources":["../../src/pointcloud/point-cloud-renderer.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAgB/D,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAChG,OAAO,EACL,iBAAiB,EACjB,UAAU,EACV,WAAW,EACX,gBAAgB,GAIjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,uBAAuB,GAGxB,MAAM,2BAA2B,CAAC;AAsFnC,MAAM,OAAO,kBAAkB;IACrB,MAA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CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;IAED;;;;;;;OAOG;IACH,kBAAkB;QAOhB,kEAAkE;QAClE,uEAAuE;QACvE,OAAO,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC3E,CAAC;CACF"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CPU spatial index over one point-cloud asset's positions (issue #1860).
|
|
3
|
+
*
|
|
4
|
+
* The measure tool picks by CPU ray-casting triangle meshes
|
|
5
|
+
* (`scene-raycaster.ts` / `raycast-engine.ts`); point clouds never
|
|
6
|
+
* participate because their positions are packed straight into a GPU
|
|
7
|
+
* vertex buffer and discarded (`point-cloud-node.ts` `appendChunkToNode`
|
|
8
|
+
* never retains the source `Float32Array`). This index is built
|
|
9
|
+
* incrementally as chunks stream in (or on the one-shot IFCx upload
|
|
10
|
+
* path) and keeps just enough CPU-side state to answer "which real scan
|
|
11
|
+
* point is closest to this ray, within a screen-space tolerance".
|
|
12
|
+
*
|
|
13
|
+
* Storage: a coarse uniform voxel grid. Points bucket into
|
|
14
|
+
* `floor(coord / cellSize)` cells, keyed by a single packed integer
|
|
15
|
+
* (`packKey`) so the grid is a plain `Map<number, number[]>` — no
|
|
16
|
+
* string hashing, and no need to know the cloud's final extent up
|
|
17
|
+
* front. Keys are packed relative to the FIRST indexed point's cell so
|
|
18
|
+
* they stay exact f64 integers even for un-rebased georeferenced clouds
|
|
19
|
+
* (LV95 / UTM eastings in the millions of metres); see `CELL_KEY_BIAS`.
|
|
20
|
+
*
|
|
21
|
+
* Memory: each inserted chunk's `Float32Array` is kept BY REFERENCE
|
|
22
|
+
* (never copied) — it would otherwise be garbage immediately after
|
|
23
|
+
* `appendChunkToNode` finishes packing it into the GPU buffer, so
|
|
24
|
+
* retaining it here is the only reason it survives. That is an
|
|
25
|
+
* unavoidable 12 bytes/point (three f32) if snapping is to hit real
|
|
26
|
+
* points rather than an approximation. The grid itself adds roughly
|
|
27
|
+
* 8 bytes/point (one array slot per point, across however many cells)
|
|
28
|
+
* plus a small constant per occupied cell — a few MB per million
|
|
29
|
+
* points at typical scan density. See `DEFAULT_MAX_INDEXED_POINTS` for
|
|
30
|
+
* the safety valve on extreme (tens-of-millions-of-points) clouds.
|
|
31
|
+
*
|
|
32
|
+
* Query: `queryRay` walks cells in ray-marching (Amanatides & Woo DDA)
|
|
33
|
+
* order, so cost is O(cells touched along the ray), not O(points) —
|
|
34
|
+
* a query over a 50M-point cloud still only tests a handful of cells.
|
|
35
|
+
*/
|
|
36
|
+
import type { Vec3 } from '../raycaster.js';
|
|
37
|
+
/**
|
|
38
|
+
* Default cell edge, metres. Coarse relative to typical scan spacing
|
|
39
|
+
* (millimetres to a few centimetres) so a query rarely visits more than
|
|
40
|
+
* a handful of cells, while small enough that a query near building
|
|
41
|
+
* scale doesn't degenerate into "search almost everything".
|
|
42
|
+
*/
|
|
43
|
+
export declare const DEFAULT_POINTCLOUD_INDEX_CELL_SIZE = 0.5;
|
|
44
|
+
/**
|
|
45
|
+
* Hard cap on how many points a single index will hold. Beyond this,
|
|
46
|
+
* further inserted points still upload to the GPU normally (rendering
|
|
47
|
+
* is unaffected) but are simply not indexed, so the measure tool can't
|
|
48
|
+
* snap to them. This is the "last resort" from the design brief: full,
|
|
49
|
+
* uncapped indexing is strongly preferred (snapping wants real points),
|
|
50
|
+
* so this only bites on genuinely extreme clouds — at ~20 bytes/point
|
|
51
|
+
* of CPU overhead (12 bytes retained positions + ~8 bytes grid), 30M
|
|
52
|
+
* points is already ~600 MB of additional retained memory.
|
|
53
|
+
*/
|
|
54
|
+
export declare const DEFAULT_MAX_INDEXED_POINTS = 30000000;
|
|
55
|
+
/**
|
|
56
|
+
* Cap on the per-visited-cell neighborhood dilation radius, in cells
|
|
57
|
+
* (issue #1860 review finding 1). `toleranceAt(t)` GROWS with depth
|
|
58
|
+
* (it's a screen-space pixel tolerance projected to world units), so a
|
|
59
|
+
* fixed +-1 cell dilation (~0.5 * cellSize of perpendicular coverage)
|
|
60
|
+
* silently stops covering the true tolerance once
|
|
61
|
+
* `toleranceAt(t) > cellSize` — which for the measure tool's ~8px
|
|
62
|
+
* tolerance happens around t = 60-130 m depending on canvas/fov, i.e.
|
|
63
|
+
* exactly the zoomed-out site-scale scans where this matters most.
|
|
64
|
+
* `queryRay` instead computes `r = clamp(ceil(toleranceAt(t)/cellSize),
|
|
65
|
+
* 1, MAX_DILATION_RADIUS_CELLS)` at every visited cell and dilates by
|
|
66
|
+
* that many cells. Capped so a single visited cell never tests more
|
|
67
|
+
* than `(2*4+1)^3 = 729` cells worst case; beyond the cap the
|
|
68
|
+
* *effective* snap radius clamps at `MAX_DILATION_RADIUS_CELLS *
|
|
69
|
+
* cellSize` (2 m at the default 0.5 m cell size) instead of growing
|
|
70
|
+
* unbounded with depth.
|
|
71
|
+
*/
|
|
72
|
+
export declare const MAX_DILATION_RADIUS_CELLS = 4;
|
|
73
|
+
export interface PointCloudRayHit {
|
|
74
|
+
/** World-space position of the snapped point. */
|
|
75
|
+
position: Vec3;
|
|
76
|
+
/** True distance along the ray (world units) to the snapped point. */
|
|
77
|
+
distance: number;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* CPU spatial index for one point-cloud asset. Insert incrementally via
|
|
81
|
+
* `insertRange` as chunks stream in; query via `queryRay`. Not thread
|
|
82
|
+
* safe (single-threaded main-thread structure, matching the renderer).
|
|
83
|
+
*/
|
|
84
|
+
export declare class PointCloudSpatialIndex {
|
|
85
|
+
private readonly cellSize;
|
|
86
|
+
private readonly maxIndexedPoints;
|
|
87
|
+
private readonly cells;
|
|
88
|
+
private chunks;
|
|
89
|
+
private total;
|
|
90
|
+
private minX;
|
|
91
|
+
private minY;
|
|
92
|
+
private minZ;
|
|
93
|
+
private maxX;
|
|
94
|
+
private maxY;
|
|
95
|
+
private maxZ;
|
|
96
|
+
/**
|
|
97
|
+
* Cell coordinates of the first indexed point — the origin every packed
|
|
98
|
+
* cell key is relative to (see `CELL_KEY_BIAS`). Rebasing per index keeps
|
|
99
|
+
* keys f64-exact even for un-rebased georeferenced clouds (e.g. Swiss
|
|
100
|
+
* LV95 eastings ~2.6e6 m → absolute cell ~5.2e6, far outside any
|
|
101
|
+
* absolute packing window, but within ±2^16 cells of the cloud's own
|
|
102
|
+
* first point).
|
|
103
|
+
*/
|
|
104
|
+
private cellOriginX;
|
|
105
|
+
private cellOriginY;
|
|
106
|
+
private cellOriginZ;
|
|
107
|
+
private hasCellOrigin;
|
|
108
|
+
/** Pack ABSOLUTE cell coordinates into one exact-integer key. */
|
|
109
|
+
private packKey;
|
|
110
|
+
constructor(cellSize?: number, maxIndexedPoints?: number);
|
|
111
|
+
/** Total number of points currently indexed (may be less than the
|
|
112
|
+
* asset's true point count once `maxIndexedPoints` is hit). */
|
|
113
|
+
get pointCount(): number;
|
|
114
|
+
/** True once further inserts are silently dropped (memory safety valve). */
|
|
115
|
+
get isCapped(): boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Insert the first `count` xyz triples of `positions` (renderer/world
|
|
118
|
+
* space — the same frame `queryRay` expects). Keeps `positions` (and
|
|
119
|
+
* `classifications`, when given) BY REFERENCE; the caller must not
|
|
120
|
+
* mutate them afterwards. A no-op past `maxIndexedPoints` (see class
|
|
121
|
+
* docs) — points beyond the cap render normally but are not indexed
|
|
122
|
+
* for picking. When a chunk CROSSES the cap, only the accepted prefix
|
|
123
|
+
* is retained (copied) so the cap genuinely bounds retained memory —
|
|
124
|
+
* keeping the whole source array by reference would retain e.g. a
|
|
125
|
+
* 100M-point one-shot chunk's full 1.2 GB for a 30M-point cap.
|
|
126
|
+
*/
|
|
127
|
+
insertRange(positions: Float32Array, count: number, classifications?: Uint8Array | null): void;
|
|
128
|
+
/** World-space bounds of every indexed point, or null when empty. */
|
|
129
|
+
getBounds(): {
|
|
130
|
+
min: Vec3;
|
|
131
|
+
max: Vec3;
|
|
132
|
+
} | null;
|
|
133
|
+
/** Resolve a global point id to its owning chunk, or null. */
|
|
134
|
+
private chunkFor;
|
|
135
|
+
private testPoint;
|
|
136
|
+
/**
|
|
137
|
+
* Test points in the dilated cell block around (cx,cy,cz), skipping
|
|
138
|
+
* cells already visited by an earlier step of the same query.
|
|
139
|
+
* `radiusCells` must cover `toleranceAt(t)` at the depth this cell is
|
|
140
|
+
* visited at — see `queryRay`'s per-step radius computation (#1860
|
|
141
|
+
* review finding 1: a fixed +-1 dilation under-covers tolerance at
|
|
142
|
+
* long range).
|
|
143
|
+
*
|
|
144
|
+
* When `slabAxis` is 0/1/2 the scan is restricted to the LEADING SLAB
|
|
145
|
+
* of the block along that axis (offset `slabDir * radiusCells`, the
|
|
146
|
+
* `(2r+1)^2` cells newly uncovered by a one-cell DDA advance) instead
|
|
147
|
+
* of the full `(2r+1)^3` block (hosted CodeRabbit review, PR #1875):
|
|
148
|
+
* consecutive DDA steps overlap ~90% of their blocks, and while the
|
|
149
|
+
* `visited` set kept the overlap from re-scanning buckets, every probe
|
|
150
|
+
* still paid `packKey` + `Set.has` — ~6M map operations for a capped
|
|
151
|
+
* worst-case march at radius 4. Since the DDA advances exactly one
|
|
152
|
+
* axis by exactly one cell per step, `block(new) \ block(old)` IS that
|
|
153
|
+
* leading slab whenever the radius is unchanged; `queryRay` passes
|
|
154
|
+
* `slabAxis: -1` (full block) for the first cell and whenever the
|
|
155
|
+
* radius changed between steps.
|
|
156
|
+
*/
|
|
157
|
+
private testCellNeighborhood;
|
|
158
|
+
/**
|
|
159
|
+
* Nearest indexed point to `ray` (origin + unit `dir`) within
|
|
160
|
+
* `toleranceAt(t)` world units of the ray axis at depth `t`,
|
|
161
|
+
* restricted to `[0, maxDistance]`. Returns the candidate with the
|
|
162
|
+
* SMALLEST `t` (nearest along the ray) among everything within
|
|
163
|
+
* tolerance — not necessarily the one closest to the ray's infinite
|
|
164
|
+
* line — matching how a real surface point would occlude anything
|
|
165
|
+
* behind it.
|
|
166
|
+
*
|
|
167
|
+
* O(cells touched) via an Amanatides & Woo DDA march from the ray's
|
|
168
|
+
* entry into the index's bounding box. `toleranceAt(t)` grows with
|
|
169
|
+
* depth, so each visited cell's neighborhood dilation radius is
|
|
170
|
+
* recomputed from `toleranceAt` at that cell's ray parameter —
|
|
171
|
+
* `clamp(ceil(toleranceAt(t)/cellSize), 1, MAX_DILATION_RADIUS_CELLS)`
|
|
172
|
+
* — instead of a fixed +-1 cell, so a point within the true
|
|
173
|
+
* screen-space tolerance is never missed just because it's more than
|
|
174
|
+
* half a cell off the ray's exact cell path at long range (#1860
|
|
175
|
+
* review finding 1). Marching stops one cell past the first
|
|
176
|
+
* tolerance hit (using the largest radius seen so far, conservative),
|
|
177
|
+
* since DDA visits cells in non-decreasing ray-parameter order.
|
|
178
|
+
*/
|
|
179
|
+
queryRay(origin: Vec3, dir: Vec3, maxDistance: number, toleranceAt: (t: number) => number,
|
|
180
|
+
/** Normalized 8-word LAS class visibility bitmask (#1783); points of
|
|
181
|
+
* hidden classes are skipped. Omit/null for "everything visible". */
|
|
182
|
+
classMask?: Uint32Array | null): PointCloudRayHit | null;
|
|
183
|
+
/** Drop every retained position array and grid bucket. Call when the
|
|
184
|
+
* owning PointCloudNode is destroyed so nothing outlives its GPU
|
|
185
|
+
* resources (see `destroyNode` in point-cloud-node.ts). */
|
|
186
|
+
dispose(): void;
|
|
187
|
+
}
|
|
188
|
+
//# sourceMappingURL=point-cloud-spatial-index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"point-cloud-spatial-index.d.ts","sourceRoot":"","sources":["../../src/pointcloud/point-cloud-spatial-index.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE5C;;;;;GAKG;AACH,eAAO,MAAM,kCAAkC,MAAM,CAAC;AAEtD;;;;;;;;;GASG;AACH,eA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