@ifc-lite/renderer 1.39.0 → 1.41.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 (60) hide show
  1. package/dist/deviation/deviation-pipeline.d.ts +8 -0
  2. package/dist/deviation/deviation-pipeline.d.ts.map +1 -1
  3. package/dist/deviation/deviation-pipeline.js +20 -9
  4. package/dist/deviation/deviation-pipeline.js.map +1 -1
  5. package/dist/deviation/deviation-shader.wgsl.d.ts +1 -1
  6. package/dist/deviation/deviation-shader.wgsl.d.ts.map +1 -1
  7. package/dist/deviation/deviation-shader.wgsl.js +11 -3
  8. package/dist/deviation/deviation-shader.wgsl.js.map +1 -1
  9. package/dist/index.d.ts +45 -1
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +78 -3
  12. package/dist/index.js.map +1 -1
  13. package/dist/picker.d.ts +9 -0
  14. package/dist/picker.d.ts.map +1 -1
  15. package/dist/picker.js +84 -2
  16. package/dist/picker.js.map +1 -1
  17. package/dist/picking-manager.d.ts +33 -5
  18. package/dist/picking-manager.d.ts.map +1 -1
  19. package/dist/picking-manager.js +162 -101
  20. package/dist/picking-manager.js.map +1 -1
  21. package/dist/pointcloud/point-cloud-node.d.ts +46 -0
  22. package/dist/pointcloud/point-cloud-node.d.ts.map +1 -1
  23. package/dist/pointcloud/point-cloud-node.js +71 -0
  24. package/dist/pointcloud/point-cloud-node.js.map +1 -1
  25. package/dist/pointcloud/point-cloud-ray-transform.d.ts +66 -0
  26. package/dist/pointcloud/point-cloud-ray-transform.d.ts.map +1 -0
  27. package/dist/pointcloud/point-cloud-ray-transform.js +172 -0
  28. package/dist/pointcloud/point-cloud-ray-transform.js.map +1 -0
  29. package/dist/pointcloud/point-cloud-renderer.d.ts +24 -0
  30. package/dist/pointcloud/point-cloud-renderer.d.ts.map +1 -1
  31. package/dist/pointcloud/point-cloud-renderer.js +46 -13
  32. package/dist/pointcloud/point-cloud-renderer.js.map +1 -1
  33. package/dist/pointcloud/point-cloud-spatial-index.d.ts +188 -0
  34. package/dist/pointcloud/point-cloud-spatial-index.d.ts.map +1 -0
  35. package/dist/pointcloud/point-cloud-spatial-index.js +536 -0
  36. package/dist/pointcloud/point-cloud-spatial-index.js.map +1 -0
  37. package/dist/pointcloud/point-cloud-uniforms.d.ts.map +1 -1
  38. package/dist/pointcloud/point-cloud-uniforms.js +14 -6
  39. package/dist/pointcloud/point-cloud-uniforms.js.map +1 -1
  40. package/dist/raycast-engine.d.ts +8 -0
  41. package/dist/raycast-engine.d.ts.map +1 -1
  42. package/dist/raycast-engine.js +68 -23
  43. package/dist/raycast-engine.js.map +1 -1
  44. package/dist/raycast-point-cloud-query.d.ts +122 -0
  45. package/dist/raycast-point-cloud-query.d.ts.map +1 -0
  46. package/dist/raycast-point-cloud-query.js +145 -0
  47. package/dist/raycast-point-cloud-query.js.map +1 -0
  48. package/dist/scene-rect-select.d.ts +51 -0
  49. package/dist/scene-rect-select.d.ts.map +1 -0
  50. package/dist/scene-rect-select.js +207 -0
  51. package/dist/scene-rect-select.js.map +1 -0
  52. package/dist/scene.d.ts +15 -0
  53. package/dist/scene.d.ts.map +1 -1
  54. package/dist/scene.js +115 -46
  55. package/dist/scene.js.map +1 -1
  56. package/dist/snap-detector.d.ts +12 -1
  57. package/dist/snap-detector.d.ts.map +1 -1
  58. package/dist/snap-detector.js +9 -1
  59. package/dist/snap-detector.js.map +1 -1
  60. package/package.json +2 -2
@@ -7,6 +7,8 @@ import { Scene } from './scene.js';
7
7
  import { Raycaster, type Intersection } from './raycaster.js';
8
8
  import { SnapDetector, type SnapTarget, type SnapOptions, type EdgeLockInput, type MagneticSnapResult } from './snap-detector.js';
9
9
  import type { PickOptions } from './types.js';
10
+ import { type PointCloudRayProvider } from './raycast-point-cloud-query.js';
11
+ export type { PointCloudRaySource, PointCloudRayProvider } from './raycast-point-cloud-query.js';
10
12
  export declare class RaycastEngine {
11
13
  private camera;
12
14
  private scene;
@@ -14,6 +16,7 @@ export declare class RaycastEngine {
14
16
  private raycaster;
15
17
  private snapDetector;
16
18
  private bvh;
19
+ private pointCloudProvider;
17
20
  private bvhCache;
18
21
  private readonly BVH_THRESHOLD;
19
22
  constructor(camera: Camera, scene: Scene, canvas: HTMLCanvasElement);
@@ -71,6 +74,11 @@ export declare class RaycastEngine {
71
74
  * Get the snap detector instance (for advanced usage)
72
75
  */
73
76
  getSnapDetector(): SnapDetector;
77
+ /**
78
+ * Renderer wires this once point clouds are initialised so the
79
+ * measure tool can snap to scan points (#1860). Pass null to disable.
80
+ */
81
+ setPointCloudProvider(provider: PointCloudRayProvider | null): void;
74
82
  /**
75
83
  * Clear all caches (call when geometry changes)
76
84
  */
@@ -1 +1 @@
1
- {"version":3,"file":"raycast-engine.d.ts","sourceRoot":"","sources":["../src/raycast-engine.ts"],"names":[],"mappings":"AAIA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,KAAK,YAAY,EAAY,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,KAAK,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAGlI,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAkB9C,qBAAa,aAAa;IACtB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,MAAM,CAAoB;IAClC,OAAO,CAAC,SAAS,CAAY;IAC7B,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,GAAG,CAAM;IAGjB,OAAO,CAAC,QAAQ,CASA;IAGhB,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAO;gBAEzB,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,iBA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G;QAAE,YAAY,EAAE,YAAY,GAAG,IAAI,CAAA;KAAE;IAwH7D;;OAEG;IACH,kBAAkB,IAAI,IAAI;IAI1B;;OAEG;IACH,YAAY,IAAI,SAAS;IAIzB;;OAEG;IACH,eAAe,IAAI,YAAY;IAI/B;;;OAGG;IACH,qBAAqB,CAAC,QAAQ,EAAE,qBAAqB,GAAG,IAAI,GAAG,IAAI;IAInE;;OAEG;IACH,WAAW,IAAI,IAAI;CAItB"}
@@ -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 { Raycaster } from './raycaster.js';
5
- import { SnapDetector } from './snap-detector.js';
5
+ import { SnapDetector, SnapType } from './snap-detector.js';
6
6
  import { BVH } from './bvh.js';
7
+ import { queryPointClouds, releasedEdgeLock, pointCloudSnapEnabled, pointCloudWinsOverMeshSnap, } from './raycast-point-cloud-query.js';
7
8
  /**
8
9
  * Cheap order-sensitive 32-bit signature of a mesh set, used to detect when the
9
10
  * raycast BVH must rebuild because the SET changed (not just its size). Mixes
@@ -26,6 +27,7 @@ export class RaycastEngine {
26
27
  raycaster;
27
28
  snapDetector;
28
29
  bvh;
30
+ pointCloudProvider = null;
29
31
  // BVH cache
30
32
  bvhCache = null;
31
33
  // Performance constants
@@ -279,31 +281,67 @@ export class RaycastEngine {
279
281
  }
280
282
  // Create ray from screen coordinates
281
283
  const ray = this.camera.unprojectToRay(scaled.scaledX, scaled.scaledY, this.canvas.width, this.canvas.height);
282
- // Get all mesh data from scene
284
+ // Get all mesh data from scene. Unlike before #1860, an empty
285
+ // scene no longer short-circuits here — a point-cloud-only
286
+ // model (no IFC mesh loaded at all) must still fall through
287
+ // to the point-cloud query below instead of returning a hard
288
+ // miss.
283
289
  const allMeshData = this.collectVisibleMeshData(options, ray);
284
- if (allMeshData.length === 0) {
285
- return {
286
- intersection: null,
287
- snapTarget: null,
288
- edgeLock: {
289
- edge: null,
290
- meshExpressId: null,
291
- edgeT: 0,
292
- shouldLock: false,
293
- shouldRelease: true,
294
- isCorner: false,
295
- cornerValence: 0,
296
- },
297
- };
298
- }
299
- // Use BVH for performance if we have many meshes
300
- const meshesToTest = this.filterWithBVH(allMeshData, ray);
301
- // Perform raycasting
302
- const intersection = this.raycaster.raycast(ray, meshesToTest);
303
- // Use magnetic snap detection
304
290
  const cameraPos = this.camera.getPosition();
305
291
  const cameraFov = this.camera.getFOV();
306
- const magneticResult = this.snapDetector.detectMagneticSnap(ray, meshesToTest, intersection, { position: cameraPos, fov: cameraFov }, this.canvas.height, currentEdgeLock, options?.snapOptions || {});
292
+ let intersection = null;
293
+ let magneticResult = { snapTarget: null, edgeLock: releasedEdgeLock() };
294
+ if (allMeshData.length > 0) {
295
+ // Use BVH for performance if we have many meshes
296
+ const meshesToTest = this.filterWithBVH(allMeshData, ray);
297
+ // Perform raycasting
298
+ intersection = this.raycaster.raycast(ray, meshesToTest);
299
+ // Use magnetic snap detection
300
+ magneticResult = this.snapDetector.detectMagneticSnap(ray, meshesToTest, intersection, { position: cameraPos, fov: cameraFov }, this.canvas.height, currentEdgeLock, options?.snapOptions || {});
301
+ }
302
+ // Point-cloud snapping (#1860): search up to whatever the mesh
303
+ // path already found (or the whole scene, if there was no mesh
304
+ // hit at all) — a real mesh surface in front of a scan point
305
+ // should still win the pick. Gated on the caller's snap config
306
+ // so the measure tool's snap toggle disables scan-point
307
+ // magnetism exactly like mesh vertex/edge magnetism.
308
+ const snapCamera = {
309
+ fov: cameraFov,
310
+ canvasHeightPx: this.canvas.height,
311
+ orthoHalfHeight: this.camera.getProjectionMode() === 'orthographic' ? this.camera.getOrthoSize() : null,
312
+ };
313
+ const maxPointDistance = intersection ? intersection.distance : Infinity;
314
+ const pointHit = pointCloudSnapEnabled(options?.snapOptions)
315
+ ? queryPointClouds(this.pointCloudProvider, ray, snapCamera, maxPointDistance, options)
316
+ : null;
317
+ if (pointHit) {
318
+ // A point-cloud hit only OVERRIDES an existing mesh snap
319
+ // target (vertex/edge/face/...) when it's meaningfully in
320
+ // front of the mesh surface, not just scan noise a few mm
321
+ // nearer along the ray — otherwise a scan overlapping its
322
+ // as-designed model would non-deterministically steal
323
+ // intended vertex/corner snaps on most measurements over
324
+ // scanned-over geometry (#1860 review finding 2). When the
325
+ // mesh path found no snap target at all (bare face hit, or
326
+ // no mesh hit), the point snap wins as before.
327
+ const wins = pointCloudWinsOverMeshSnap({
328
+ pointHit,
329
+ meshSnapTarget: magneticResult.snapTarget,
330
+ meshIntersectionDistance: intersection ? intersection.distance : null,
331
+ camera: snapCamera,
332
+ });
333
+ if (wins) {
334
+ magneticResult = {
335
+ snapTarget: {
336
+ type: SnapType.POINT_CLOUD,
337
+ position: pointHit.position,
338
+ expressId: pointHit.expressId,
339
+ confidence: 1,
340
+ },
341
+ edgeLock: releasedEdgeLock(),
342
+ };
343
+ }
344
+ }
307
345
  return {
308
346
  intersection,
309
347
  ...magneticResult,
@@ -344,6 +382,13 @@ export class RaycastEngine {
344
382
  getSnapDetector() {
345
383
  return this.snapDetector;
346
384
  }
385
+ /**
386
+ * Renderer wires this once point clouds are initialised so the
387
+ * measure tool can snap to scan points (#1860). Pass null to disable.
388
+ */
389
+ setPointCloudProvider(provider) {
390
+ this.pointCloudProvider = provider;
391
+ }
347
392
  /**
348
393
  * Clear all caches (call when geometry changes)
349
394
  */
@@ -1 +1 @@
1
- {"version":3,"file":"raycast-engine.js","sourceRoot":"","sources":["../src/raycast-engine.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAS/D,OAAO,EAAE,SAAS,EAA+B,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAE,YAAY,EAAkF,MAAM,oBAAoB,CAAC;AAClI,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAI/B;;;;;GAKG;AACH,SAAS,uBAAuB,CAAC,QAA6B;IAC1D,IAAI,GAAG,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;IAC9B,KAAK,IA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AE,CAAC;yBAChB;wBACD,QAAQ,EAAE,gBAAgB,EAAE;qBAC/B,CAAC;gBACN,CAAC;YACL,CAAC;YAED,OAAO;gBACH,YAAY;gBACZ,GAAG,cAAc;aACpB,CAAC;QACN,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;YAChD,OAAO;gBACH,YAAY,EAAE,IAAI;gBAClB,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE;oBACN,IAAI,EAAE,IAAI;oBACV,aAAa,EAAE,IAAI;oBACnB,KAAK,EAAE,CAAC;oBACR,UAAU,EAAE,KAAK;oBACjB,aAAa,EAAE,IAAI;oBACnB,QAAQ,EAAE,KAAK;oBACf,aAAa,EAAE,CAAC;iBACnB;aACJ,CAAC;QACN,CAAC;IACL,CAAC;IAED;;OAEG;IACH,kBAAkB;QACd,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,YAAY;QACR,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,eAAe;QACX,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IAED;;;OAGG;IACH,qBAAqB,CAAC,QAAsC;QACxD,IAAI,CAAC,kBAAkB,GAAG,QAAQ,CAAC;IACvC,CAAC;IAED;;OAEG;IACH,WAAW;QACP,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC1B,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,CAAC;IACnC,CAAC;CACJ"}
@@ -0,0 +1,122 @@
1
+ /**
2
+ * Point-cloud ray query glue for `RaycastEngine` (issue #1860). Extracted
3
+ * out of `raycast-engine.ts` to keep that file under this repo's
4
+ * ~400-line module-split guideline — this is pure composition logic
5
+ * with no BVH/mesh-raycast state of its own.
6
+ */
7
+ import type { Ray, Vec3 } from './raycaster.js';
8
+ import type { MagneticSnapResult, SnapOptions, SnapTarget } from './snap-detector.js';
9
+ import type { PickOptions } from './types.js';
10
+ import type { PointCloudSpatialIndex } from './pointcloud/point-cloud-spatial-index.js';
11
+ /** Source the RaycastEngine queries for point-cloud ray snapping (#1860). */
12
+ export interface PointCloudRaySource {
13
+ expressId: number;
14
+ modelIndex?: number;
15
+ index: PointCloudSpatialIndex;
16
+ /** Current LAS class visibility bitmask (#1783); hidden-class points
17
+ * are not snappable. Omit for "everything visible". */
18
+ classMask?: Uint32Array | null;
19
+ /**
20
+ * The node's per-asset render transform (#1804), or undefined when the
21
+ * asset is unaligned. The index holds RAW decoder positions, so without
22
+ * this the query would snap to where a georeferenced point sat BEFORE
23
+ * alignment while the shader draws it somewhere else — see
24
+ * `point-cloud-ray-transform.ts`.
25
+ */
26
+ model?: Float32Array;
27
+ }
28
+ /** Supplied by the renderer once point clouds are loaded; empty/null disables point snapping. */
29
+ export type PointCloudRayProvider = () => ReadonlyArray<PointCloudRaySource>;
30
+ export interface PointCloudRayResult {
31
+ position: Vec3;
32
+ expressId: number;
33
+ modelIndex?: number;
34
+ distance: number;
35
+ }
36
+ /**
37
+ * The camera facts the point-cloud snap tolerance depends on. In
38
+ * perspective mode the world size of a screen pixel grows linearly with
39
+ * ray depth `t`; in orthographic mode it is CONSTANT
40
+ * (`2 * orthoHalfHeight / canvasHeightPx` per pixel, independent of
41
+ * depth), so `orthoHalfHeight` must be supplied when the camera is
42
+ * orthographic or far points get an inflated snap radius and near
43
+ * points an unusably tight one. (The mesh snap path predates this and
44
+ * still applies the perspective formula in ortho — a pre-existing
45
+ * divergence, not one this module introduces.)
46
+ */
47
+ export interface PointCloudSnapCamera {
48
+ /** Vertical field of view in RADIANS (`Camera.getFOV()`), perspective only. */
49
+ fov: number;
50
+ canvasHeightPx: number;
51
+ /** `Camera.getOrthoSize()` when the projection is orthographic, else null. */
52
+ orthoHalfHeight?: number | null;
53
+ }
54
+ /**
55
+ * World-space point-cloud snap tolerance at ray depth `t` — the same
56
+ * conversion `queryPointClouds` uses internally, exposed so
57
+ * `pointCloudWinsOverMeshSnap` can apply the identical margin when
58
+ * deciding whether a point-cloud hit is meaningfully in FRONT of an
59
+ * existing mesh snap, not just a few mm of scan noise nearer (#1860
60
+ * review finding 2).
61
+ */
62
+ export declare function pointCloudSnapToleranceAt(t: number, camera: PointCloudSnapCamera): number;
63
+ /**
64
+ * Whether the caller's snap configuration allows point-cloud snapping at
65
+ * all. Mirrors `SnapDetector`'s defaulting (absent fields mean ON): with
66
+ * no `snapOptions` every snap kind is enabled; with one, an explicit
67
+ * `snapToPointClouds` wins, otherwise point snapping follows "is any
68
+ * mesh snap kind enabled" — so the viewer's snap toggle (which flips
69
+ * vertices/edges/faces all off) disables scan-point snapping too instead
70
+ * of the measure tool still magnetically grabbing scan points with
71
+ * snapping visibly OFF.
72
+ */
73
+ export declare function pointCloudSnapEnabled(snapOptions?: Partial<SnapOptions>): boolean;
74
+ /**
75
+ * Nearest point, across every loaded point-cloud asset, to `ray` within a
76
+ * small screen-space tolerance of depth `t`, bounded to `[0, maxDistance]`.
77
+ * Returns null when no point cloud is loaded, no point falls within
78
+ * tolerance, or every candidate is filtered out by
79
+ * `hiddenIds`/`isolatedIds` (checked per whole asset — point clouds have
80
+ * no finer-grained visibility, matching the existing GPU pick path in
81
+ * `picking-manager.ts`).
82
+ */
83
+ export declare function queryPointClouds(provider: PointCloudRayProvider | null, ray: Ray, camera: PointCloudSnapCamera, maxDistance: number, options?: PickOptions): PointCloudRayResult | null;
84
+ /** Inputs to the mesh-vs-point-cloud snap override decision. */
85
+ export interface PointCloudOverrideDecision {
86
+ /** The point-cloud hit under consideration. */
87
+ pointHit: PointCloudRayResult;
88
+ /** The mesh path's existing snap target (vertex/edge/face/...), or null
89
+ * when the mesh path produced no snap (bare face hit / snapping off). */
90
+ meshSnapTarget: SnapTarget | null;
91
+ /** The raw mesh raycast distance, or null when there was no mesh hit
92
+ * at all (point-cloud-only scene). */
93
+ meshIntersectionDistance: number | null;
94
+ camera: PointCloudSnapCamera;
95
+ }
96
+ /**
97
+ * Should a point-cloud hit override the mesh path's result? (#1860 review
98
+ * finding 2.)
99
+ *
100
+ * When the mesh path found NO snap target (a bare face hit, snapping
101
+ * disabled, or no mesh hit at all), a point-cloud hit always wins — this
102
+ * matches the pre-existing "point wins when present" behavior, since
103
+ * there's nothing more specific to preserve.
104
+ *
105
+ * When the mesh path DID find a snap target (vertex/edge/face/face
106
+ * center), a point-cloud hit only wins when it is MEANINGFULLY in front
107
+ * of the mesh surface — `pointHit.distance < meshIntersectionDistance -
108
+ * toleranceAt(pointHit.distance)` — not just a few millimetres nearer.
109
+ * Scan points sit ON scanned surfaces plus/minus centimetres of capture
110
+ * noise, so wherever a scan overlaps its as-designed model (the common
111
+ * case), a coincidence-only "nearer wins" rule would non-deterministically
112
+ * steal an intended vertex/corner snap on essentially every measurement
113
+ * over scanned geometry. Requiring the point to clear the surface by more
114
+ * than its own screen-space tolerance means it must be a real occluder
115
+ * (something genuinely in front, e.g. scanned furniture in front of a
116
+ * modeled wall), not scan noise on the same surface.
117
+ */
118
+ export declare function pointCloudWinsOverMeshSnap(decision: PointCloudOverrideDecision): boolean;
119
+ /** A released (non-locked) edge-lock result, used whenever a point-cloud
120
+ * snap wins — point snapping has no edge-lock concept of its own. */
121
+ export declare function releasedEdgeLock(): MagneticSnapResult['edgeLock'];
122
+ //# sourceMappingURL=raycast-point-cloud-query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"raycast-point-cloud-query.d.ts","sourceRoot":"","sources":["../src/raycast-point-cloud-query.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEtF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,sBAAsB,EA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Q,EAAE,mBAAmB,CAAC;IAC9B;8EAC0E;IAC1E,cAAc,EAAE,UAAU,GAAG,IAAI,CAAC;IAClC;2CACuC;IACvC,wBAAwB,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,MAAM,EAAE,oBAAoB,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,0BAA0B,GAAG,OAAO,CAKxF;AAED;sEACsE;AACtE,wBAAgB,gBAAgB,IAAI,kBAAkB,CAAC,UAAU,CAAC,CAUjE"}
@@ -0,0 +1,145 @@
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
+ import { screenToWorldRadius } from './snap-geometry-utils.js';
5
+ import { toLocalFrameRay } from './pointcloud/point-cloud-ray-transform.js';
6
+ /** Screen-space snap tolerance for point-cloud picking (~8 CSS-equivalent
7
+ * px at the canvas' device-pixel scale, per the #1860 design brief) —
8
+ * tighter than the 40-60px mesh vertex/edge snap radii since a scan
9
+ * point has no larger "target zone" the way an edge or corner does. */
10
+ const POINT_CLOUD_SNAP_TOLERANCE_PX = 8;
11
+ /**
12
+ * World-space point-cloud snap tolerance at ray depth `t` — the same
13
+ * conversion `queryPointClouds` uses internally, exposed so
14
+ * `pointCloudWinsOverMeshSnap` can apply the identical margin when
15
+ * deciding whether a point-cloud hit is meaningfully in FRONT of an
16
+ * existing mesh snap, not just a few mm of scan noise nearer (#1860
17
+ * review finding 2).
18
+ */
19
+ export function pointCloudSnapToleranceAt(t, camera) {
20
+ if (camera.orthoHalfHeight !== undefined && camera.orthoHalfHeight !== null) {
21
+ // Orthographic: a pixel spans the same world distance at every depth.
22
+ return (POINT_CLOUD_SNAP_TOLERANCE_PX / camera.canvasHeightPx) * (2 * camera.orthoHalfHeight);
23
+ }
24
+ return screenToWorldRadius(POINT_CLOUD_SNAP_TOLERANCE_PX, t, camera.fov, camera.canvasHeightPx);
25
+ }
26
+ /**
27
+ * Whether the caller's snap configuration allows point-cloud snapping at
28
+ * all. Mirrors `SnapDetector`'s defaulting (absent fields mean ON): with
29
+ * no `snapOptions` every snap kind is enabled; with one, an explicit
30
+ * `snapToPointClouds` wins, otherwise point snapping follows "is any
31
+ * mesh snap kind enabled" — so the viewer's snap toggle (which flips
32
+ * vertices/edges/faces all off) disables scan-point snapping too instead
33
+ * of the measure tool still magnetically grabbing scan points with
34
+ * snapping visibly OFF.
35
+ */
36
+ export function pointCloudSnapEnabled(snapOptions) {
37
+ if (!snapOptions)
38
+ return true;
39
+ if (snapOptions.snapToPointClouds !== undefined)
40
+ return snapOptions.snapToPointClouds;
41
+ return (snapOptions.snapToVertices ?? true)
42
+ || (snapOptions.snapToEdges ?? true)
43
+ || (snapOptions.snapToFaces ?? true);
44
+ }
45
+ /**
46
+ * Nearest point, across every loaded point-cloud asset, to `ray` within a
47
+ * small screen-space tolerance of depth `t`, bounded to `[0, maxDistance]`.
48
+ * Returns null when no point cloud is loaded, no point falls within
49
+ * tolerance, or every candidate is filtered out by
50
+ * `hiddenIds`/`isolatedIds` (checked per whole asset — point clouds have
51
+ * no finer-grained visibility, matching the existing GPU pick path in
52
+ * `picking-manager.ts`).
53
+ */
54
+ export function queryPointClouds(provider, ray, camera, maxDistance, options) {
55
+ if (!provider || maxDistance <= 0)
56
+ return null;
57
+ const sources = provider();
58
+ if (sources.length === 0)
59
+ return null;
60
+ const toleranceAt = (t) => pointCloudSnapToleranceAt(t, camera);
61
+ let best = null;
62
+ for (const src of sources) {
63
+ if (options?.hiddenIds?.has(src.expressId))
64
+ continue;
65
+ if (options?.isolatedIds !== null &&
66
+ options?.isolatedIds !== undefined &&
67
+ !options.isolatedIds.has(src.expressId)) {
68
+ continue;
69
+ }
70
+ // Never search past the current best (or the caller's bound) — keeps
71
+ // the "nearest across assets" search itself O(assets).
72
+ const bound = best ? Math.min(maxDistance, best.distance) : maxDistance;
73
+ // An aligned asset (#1804) renders through `model` while its index
74
+ // holds raw decoder positions, so the ray has to be rewritten into the
75
+ // node's local frame — and every distance-valued quantity converted
76
+ // with it, or the screen-space tolerance quietly changes meaning under
77
+ // a non-metre CRS. `null` means "no transform needed", which is both
78
+ // the unaligned fast path and the safe fallback for a singular matrix.
79
+ const local = toLocalFrameRay(ray.origin, ray.direction, src.model);
80
+ if (!local) {
81
+ const hit = src.index.queryRay(ray.origin, ray.direction, bound, toleranceAt, src.classMask);
82
+ if (hit && (!best || hit.distance < best.distance)) {
83
+ best = { position: hit.position, expressId: src.expressId, modelIndex: src.modelIndex, distance: hit.distance };
84
+ }
85
+ continue;
86
+ }
87
+ const s = local.distanceScale;
88
+ const hit = src.index.queryRay(local.origin, local.direction, bound / s, (tLocal) => toleranceAt(tLocal * s) / s, src.classMask);
89
+ if (hit) {
90
+ const worldDistance = hit.distance * s;
91
+ if (!best || worldDistance < best.distance) {
92
+ best = {
93
+ position: local.toWorld(hit.position),
94
+ expressId: src.expressId,
95
+ modelIndex: src.modelIndex,
96
+ distance: worldDistance,
97
+ };
98
+ }
99
+ }
100
+ }
101
+ return best;
102
+ }
103
+ /**
104
+ * Should a point-cloud hit override the mesh path's result? (#1860 review
105
+ * finding 2.)
106
+ *
107
+ * When the mesh path found NO snap target (a bare face hit, snapping
108
+ * disabled, or no mesh hit at all), a point-cloud hit always wins — this
109
+ * matches the pre-existing "point wins when present" behavior, since
110
+ * there's nothing more specific to preserve.
111
+ *
112
+ * When the mesh path DID find a snap target (vertex/edge/face/face
113
+ * center), a point-cloud hit only wins when it is MEANINGFULLY in front
114
+ * of the mesh surface — `pointHit.distance < meshIntersectionDistance -
115
+ * toleranceAt(pointHit.distance)` — not just a few millimetres nearer.
116
+ * Scan points sit ON scanned surfaces plus/minus centimetres of capture
117
+ * noise, so wherever a scan overlaps its as-designed model (the common
118
+ * case), a coincidence-only "nearer wins" rule would non-deterministically
119
+ * steal an intended vertex/corner snap on essentially every measurement
120
+ * over scanned geometry. Requiring the point to clear the surface by more
121
+ * than its own screen-space tolerance means it must be a real occluder
122
+ * (something genuinely in front, e.g. scanned furniture in front of a
123
+ * modeled wall), not scan noise on the same surface.
124
+ */
125
+ export function pointCloudWinsOverMeshSnap(decision) {
126
+ const { pointHit, meshSnapTarget, meshIntersectionDistance, camera } = decision;
127
+ if (!meshSnapTarget || meshIntersectionDistance === null)
128
+ return true;
129
+ const occlusionMargin = pointCloudSnapToleranceAt(pointHit.distance, camera);
130
+ return pointHit.distance < meshIntersectionDistance - occlusionMargin;
131
+ }
132
+ /** A released (non-locked) edge-lock result, used whenever a point-cloud
133
+ * snap wins — point snapping has no edge-lock concept of its own. */
134
+ export function releasedEdgeLock() {
135
+ return {
136
+ edge: null,
137
+ meshExpressId: null,
138
+ edgeT: 0,
139
+ shouldLock: false,
140
+ shouldRelease: true,
141
+ isCorner: false,
142
+ cornerValence: 0,
143
+ };
144
+ }
145
+ //# sourceMappingURL=raycast-point-cloud-query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"raycast-point-cloud-query.js","sourceRoot":"","sources":["../src/raycast-point-cloud-query.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAW/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAG/D,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAuB5E;;;wEAGwE;AACxE,MAAM,6BAA6B,GAAG,CAAC,CAAC;AA4BxC;;;;;;;GAOG;AACH,MAAM,UAAU,yBAAyB,CAAC,CAAS,EAAE,MAA4B;IAC/E,IAAI,MAAM,CAAC,eAAe,KAAK,SAAS,IAAI,MAAM,CAAC,eAAe,KAAK,IAAI,EAAE,CAAC;QAC5E,sEAAsE;QACtE,OAAO,CAAC,6BAA6B,GAAG,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;IAChG,CAAC;IACD,OAAO,mBAAmB,CAAC,6BAA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,CAAC,CAAC;YACvC,IAAI,CAAC,IAAI,IAAI,aAAa,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAC3C,IAAI,GAAG;oBACL,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;oBACrC,SAAS,EAAE,GAAG,CAAC,SAAS;oBACxB,UAAU,EAAE,GAAG,CAAC,UAAU;oBAC1B,QAAQ,EAAE,aAAa;iBACxB,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAeD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,0BAA0B,CAAC,QAAoC;IAC7E,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,wBAAwB,EAAE,MAAM,EAAE,GAAG,QAAQ,CAAC;IAChF,IAAI,CAAC,cAAc,IAAI,wBAAwB,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACtE,MAAM,eAAe,GAAG,yBAAyB,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC7E,OAAO,QAAQ,CAAC,QAAQ,GAAG,wBAAwB,GAAG,eAAe,CAAC;AACxE,CAAC;AAED;sEACsE;AACtE,MAAM,UAAU,gBAAgB;IAC9B,OAAO;QACL,IAAI,EAAE,IAAI;QACV,aAAa,EAAE,IAAI;QACnB,KAAK,EAAE,CAAC;QACR,UAAU,EAAE,KAAK;QACjB,aAAa,EAAE,IAAI;QACnB,QAAQ,EAAE,KAAK;QACf,aAAa,EAAE,CAAC;KACjB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * CPU rectangle selection against bounding-box data.
3
+ *
4
+ * The rect analogue of `raycastBoundingBoxes` in `scene-raycaster.ts`, and it
5
+ * exists for the same reason: on a batched model the GPU pick pass only sees
6
+ * individually hydrated meshes, and hydrating every visible piece is too
7
+ * expensive past a few hundred entities. `pick()` has always had a CPU escape
8
+ * hatch for that case; rectangle select had none, which is why it returned an
9
+ * empty set on batched models (#1904).
10
+ *
11
+ * Granularity: bounding box, not triangle. A box whose screen-space AABB
12
+ * overlaps the rect counts as selected, so this over-selects relative to the
13
+ * pixel-exact GPU path — an entity can be picked when the rect covers only
14
+ * empty space inside its bounds. That granularity is the same one the
15
+ * released-geometry raycast path already has (`raycastBoundingBoxes` also tests
16
+ * boxes, not triangles), and over-selection is recoverable by the user in a way
17
+ * that selecting nothing is not.
18
+ *
19
+ * Two further gaps are NOT shared with that path, and both over-select. There is
20
+ * no depth test at all here, so an entity fully occluded by another is still
21
+ * selected, whereas the raycast keeps only the nearest box (`tNear <
22
+ * closestDistance`). And section-plane / crop-box filtering is whole-box: the
23
+ * `boxFullyClipped` call below skips an entity only when nothing of its box
24
+ * could be visible, so a rect over the sectioned-away half of a box still
25
+ * selects it — the raycast measures entry into the *visible* part of the box
26
+ * (`clippedBoxEntryDistance`), and the pick shader discards per fragment.
27
+ */
28
+ import { type BoundingBox } from './scene-raycaster.js';
29
+ import type { PickClipState } from './types.js';
30
+ /** Selection rectangle in canvas (device) pixels. Corners may be in any order. */
31
+ export interface ScreenRect {
32
+ x0: number;
33
+ y0: number;
34
+ x1: number;
35
+ y1: number;
36
+ }
37
+ /**
38
+ * Every entity whose bounding box projects onto the given screen rect.
39
+ *
40
+ * @param boundingBoxes World-space AABB per expressId
41
+ * @param viewProj Camera view-projection, column-major (see below)
42
+ * @param rect Selection rect in canvas pixels
43
+ * @param viewportWidth Canvas width in pixels
44
+ * @param viewportHeight Canvas height in pixels
45
+ * @param hiddenIds Skipped entirely
46
+ * @param isolatedIds When non-null, only these ids are considered
47
+ * @param clip Active section plane / crop box, so selection matches
48
+ * what is visible (same contract as the raycast paths)
49
+ */
50
+ export declare function selectBoundingBoxesInRect(boundingBoxes: Map<number, BoundingBox>, viewProj: Float32Array, rect: ScreenRect, viewportWidth: number, viewportHeight: number, hiddenIds?: Set<number>, isolatedIds?: Set<number> | null, clip?: PickClipState | null): Set<number>;
51
+ //# sourceMappingURL=scene-rect-select.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scene-rect-select.d.ts","sourceRoot":"","sources":["../src/scene-rect-select.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAiC,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACvF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAiBhD,kFAAkF;AAClF,MAAM,WAAW,UAAU;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,yBAAyB,CACrC,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,EACvC,QAAQ,EAAE,YAAY,EACtB,IAAI,EAAE,UAAU,EAChB,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,MAAM,EACtB,SAAS,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,EACvB,WAAW,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,EAChC,IAAI,CAAC,EAAE,aAAa,GAAG,IAAI,GAC5B,GAAG,CAAC,MAAM,CAAC,CAyIb"}