@ifc-lite/renderer 1.30.1 → 1.33.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/aabb-edges.d.ts +6 -0
- package/dist/aabb-edges.d.ts.map +1 -0
- package/dist/aabb-edges.js +34 -0
- package/dist/aabb-edges.js.map +1 -0
- package/dist/camera-controls.d.ts +20 -0
- package/dist/camera-controls.d.ts.map +1 -1
- package/dist/camera-controls.js.map +1 -1
- package/dist/camera.d.ts +35 -0
- package/dist/camera.d.ts.map +1 -1
- package/dist/camera.js +22 -0
- package/dist/camera.js.map +1 -1
- package/dist/deviation/deviation-pipeline.d.ts +15 -1
- package/dist/deviation/deviation-pipeline.d.ts.map +1 -1
- package/dist/deviation/deviation-pipeline.js +33 -16
- 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 -2
- package/dist/deviation/deviation-shader.wgsl.js.map +1 -1
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +68 -1
- package/dist/index.js.map +1 -1
- package/dist/picking-manager.d.ts.map +1 -1
- package/dist/picking-manager.js +9 -7
- package/dist/picking-manager.js.map +1 -1
- package/dist/pointcloud/point-cloud-node.d.ts +13 -2
- package/dist/pointcloud/point-cloud-node.d.ts.map +1 -1
- package/dist/pointcloud/point-cloud-node.js +50 -20
- package/dist/pointcloud/point-cloud-node.js.map +1 -1
- package/dist/scene.d.ts.map +1 -1
- package/dist/scene.js +7 -1
- package/dist/scene.js.map +1 -1
- package/dist/section-2d-overlay.d.ts +23 -0
- package/dist/section-2d-overlay.d.ts.map +1 -1
- package/dist/section-2d-overlay.js +97 -9
- package/dist/section-2d-overlay.js.map +1 -1
- package/dist/shaders/main.wgsl.d.ts +1 -1
- package/dist/shaders/main.wgsl.d.ts.map +1 -1
- package/dist/shaders/main.wgsl.js +14 -1
- package/dist/shaders/main.wgsl.js.map +1 -1
- package/dist/snap-detector.d.ts.map +1 -1
- package/dist/snap-detector.js +20 -4
- package/dist/snap-detector.js.map +1 -1
- package/dist/types.d.ts +6 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -61,6 +61,7 @@ export declare class Renderer {
|
|
|
61
61
|
private canvas;
|
|
62
62
|
private sectionPlaneRenderer;
|
|
63
63
|
private section2DOverlayRenderer;
|
|
64
|
+
private overlayLineColor;
|
|
64
65
|
private symbolicFillPipeline;
|
|
65
66
|
private symbolicTextPipeline;
|
|
66
67
|
private postProcessor;
|
|
@@ -69,6 +70,9 @@ export declare class Renderer {
|
|
|
69
70
|
private skyPass;
|
|
70
71
|
private edlOptions;
|
|
71
72
|
private pointCloudRenderer;
|
|
73
|
+
/** Set true at the end of `init()`; gates `whenReady()`. */
|
|
74
|
+
private ready;
|
|
75
|
+
private readyWaiters;
|
|
72
76
|
private deviationPipeline;
|
|
73
77
|
/**
|
|
74
78
|
* Cache of which mesh-set the BVH was built from. We rebuild on
|
|
@@ -99,6 +103,16 @@ export declare class Renderer {
|
|
|
99
103
|
* Initialize renderer
|
|
100
104
|
*/
|
|
101
105
|
init(): Promise<void>;
|
|
106
|
+
/**
|
|
107
|
+
* Resolves once `init()` has finished and the GPU device + point-cloud
|
|
108
|
+
* renderer are usable. Callers that may run before init completes — e.g.
|
|
109
|
+
* dropping a point cloud immediately after the viewport mounts, before
|
|
110
|
+
* the async WebGPU init resolves — should `await renderer.whenReady()`
|
|
111
|
+
* before `beginPointCloudStream`, which otherwise throws
|
|
112
|
+
* "Renderer not initialized".
|
|
113
|
+
*/
|
|
114
|
+
whenReady(): Promise<void>;
|
|
115
|
+
private markReady;
|
|
102
116
|
/**
|
|
103
117
|
* Replace all loaded point clouds with `assets`.
|
|
104
118
|
*
|
|
@@ -406,6 +420,13 @@ export declare class Renderer {
|
|
|
406
420
|
* Clear the 2D section overlay
|
|
407
421
|
*/
|
|
408
422
|
clearSection2DOverlay(): void;
|
|
423
|
+
/**
|
|
424
|
+
* Set the colour of the overlay lines (annotation / alignment / grid) and the
|
|
425
|
+
* section-cut outline (RGBA, 0..1). Defaults to opaque black; theme it to keep
|
|
426
|
+
* lines legible on a dark canvas. The matching label colour is per-text via
|
|
427
|
+
* `SymbolicTextInput.color` on `uploadAnnotationTexts3D`.
|
|
428
|
+
*/
|
|
429
|
+
setOverlayLineColor(color: readonly [number, number, number, number]): void;
|
|
409
430
|
/**
|
|
410
431
|
* Upload pre-lifted 3D line-list vertices for the standalone annotation
|
|
411
432
|
* overlay. Each segment is `[x1, y1, z1, x2, y2, z2]` in world space.
|
|
@@ -448,6 +469,17 @@ export declare class Renderer {
|
|
|
448
469
|
uploadGridLines3D(vertices: Float32Array): void;
|
|
449
470
|
/** Clear the structural-grid overlay. */
|
|
450
471
|
clearGridLines3D(): void;
|
|
472
|
+
/**
|
|
473
|
+
* Show (or clear) the clash-overlap box: the wireframe AABB of a focused
|
|
474
|
+
* clash, drawn in `color` so the overlap region reads as a distinct third
|
|
475
|
+
* colour next to the two glowing clash elements (#1277). Pass `null` to
|
|
476
|
+
* clear. `min`/`max` are world-space corners (clash works in world frame).
|
|
477
|
+
*/
|
|
478
|
+
setClashOverlapBox(box: {
|
|
479
|
+
min: [number, number, number];
|
|
480
|
+
max: [number, number, number];
|
|
481
|
+
color: [number, number, number, number];
|
|
482
|
+
} | null): void;
|
|
451
483
|
/**
|
|
452
484
|
* Upload filled IfcAnnotation regions for the symbolic overlay
|
|
453
485
|
* (issue #653). Pass an empty array to clear.
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,cAAc,EA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/C,yCAAyC;IACzC,gBAAgB,IAAI,IAAI;IAOxB;;;;;OAKG;IACH,kBAAkB,CACd,GAAG,EAAE;QAAE,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,GAAG,IAAI,GACtH,IAAI;IAYP;;;OAGG;IACH,uBAAuB,CAAC,KAAK,EAAE,SAAS,iBAAiB,EAAE,GAAG,IAAI;IAqBlE;;;OAGG;IACH,uBAAuB,CAAC,KAAK,EAAE,SAAS,iBAAiB,EAAE,GAAG,IAAI;IAmBlE;;OAEG;IACH,mBAAmB,IAAI,OAAO;IAI9B;;OAEG;IACH,WAAW,IAAI,cAAc,GAAG,IAAI;IAIpC;;OAEG;IACH,OAAO,IAAI,OAAO;IAIlB;;OAEG;IACH,YAAY,IAAI,SAAS,GAAG,IAAI;IAOhC;;;;OAIG;IACG,iBAAiB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAqBjD;;;;;;;OAOG;IACH,OAAO,IAAI,IAAI;IAmDf;;OAEG;IACH,SAAS,IAAI,iBAAiB;CAGjC"}
|
package/dist/index.js
CHANGED
|
@@ -13,6 +13,7 @@ export { Picker } from './picker.js';
|
|
|
13
13
|
export { MathUtils } from './math.js';
|
|
14
14
|
export { SectionPlaneRenderer } from './section-plane.js';
|
|
15
15
|
export { Section2DOverlayRenderer } from './section-2d-overlay.js';
|
|
16
|
+
import { aabbEdgeLineList } from './aabb-edges.js';
|
|
16
17
|
// IfcAnnotation overlay pipelines (3D world-space). Self-contained — caller
|
|
17
18
|
// passes a GPUDevice + presentation format and invokes `.render(pass, viewProj)`
|
|
18
19
|
// from inside an RGBA-blended pass. See packages/renderer/src/symbolic-overlay-pipelines.ts.
|
|
@@ -94,6 +95,9 @@ export class Renderer {
|
|
|
94
95
|
canvas;
|
|
95
96
|
sectionPlaneRenderer = null;
|
|
96
97
|
section2DOverlayRenderer = null;
|
|
98
|
+
// Overlay/section-cut line colour, kept on the Renderer so it survives a
|
|
99
|
+
// pre-init call and a section2DOverlayRenderer re-creation (re-applied below).
|
|
100
|
+
overlayLineColor = [0, 0, 0, 1];
|
|
97
101
|
// IfcAnnotation overlay pipelines (issue #653). Created on `init()` once
|
|
98
102
|
// the device exists; nulled until then.
|
|
99
103
|
symbolicFillPipeline = null;
|
|
@@ -111,6 +115,9 @@ export class Renderer {
|
|
|
111
115
|
highQuality: true,
|
|
112
116
|
};
|
|
113
117
|
pointCloudRenderer = null;
|
|
118
|
+
/** Set true at the end of `init()`; gates `whenReady()`. */
|
|
119
|
+
ready = false;
|
|
120
|
+
readyWaiters = [];
|
|
114
121
|
deviationPipeline = null;
|
|
115
122
|
/**
|
|
116
123
|
* Cache of which mesh-set the BVH was built from. We rebuild on
|
|
@@ -187,6 +194,8 @@ export class Renderer {
|
|
|
187
194
|
this.picker = new Picker(this.device, width, height);
|
|
188
195
|
this.sectionPlaneRenderer = new SectionPlaneRenderer(this.device.getDevice(), this.device.getFormat(), this.pipeline.getSampleCount());
|
|
189
196
|
this.section2DOverlayRenderer = new Section2DOverlayRenderer(this.device.getDevice(), this.device.getFormat(), this.pipeline.getSampleCount());
|
|
197
|
+
// Re-apply any colour set before this (re)creation so it isn't lost.
|
|
198
|
+
this.section2DOverlayRenderer.setOverlayLineColor(this.overlayLineColor);
|
|
190
199
|
// IfcAnnotation overlay pipelines (issue #653). Share the device +
|
|
191
200
|
// presentation format AND the MSAA sample count + objectId attachment
|
|
192
201
|
// shape with the rest of the renderer so they composite into the same
|
|
@@ -234,6 +243,27 @@ export class Renderer {
|
|
|
234
243
|
},
|
|
235
244
|
};
|
|
236
245
|
});
|
|
246
|
+
this.markReady();
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Resolves once `init()` has finished and the GPU device + point-cloud
|
|
250
|
+
* renderer are usable. Callers that may run before init completes — e.g.
|
|
251
|
+
* dropping a point cloud immediately after the viewport mounts, before
|
|
252
|
+
* the async WebGPU init resolves — should `await renderer.whenReady()`
|
|
253
|
+
* before `beginPointCloudStream`, which otherwise throws
|
|
254
|
+
* "Renderer not initialized".
|
|
255
|
+
*/
|
|
256
|
+
whenReady() {
|
|
257
|
+
if (this.ready)
|
|
258
|
+
return Promise.resolve();
|
|
259
|
+
return new Promise((resolve) => { this.readyWaiters.push(resolve); });
|
|
260
|
+
}
|
|
261
|
+
markReady() {
|
|
262
|
+
this.ready = true;
|
|
263
|
+
const waiters = this.readyWaiters;
|
|
264
|
+
this.readyWaiters = [];
|
|
265
|
+
for (const w of waiters)
|
|
266
|
+
w();
|
|
237
267
|
}
|
|
238
268
|
/**
|
|
239
269
|
* Replace all loaded point clouds with `assets`.
|
|
@@ -447,6 +477,8 @@ export class Renderer {
|
|
|
447
477
|
// Otherwise the caller's "compute done" callback fires before
|
|
448
478
|
// the deviation buffers are actually populated.
|
|
449
479
|
await this.device.getDevice().queue.onSubmittedWorkDone();
|
|
480
|
+
// The GPU is done reading each chunk's params uniform — free them.
|
|
481
|
+
this.deviationPipeline.releaseTransientParams();
|
|
450
482
|
this.requestRender();
|
|
451
483
|
// Suggest a default half-range = max(0.01m, max-extent / 1000).
|
|
452
484
|
// Tighter than the maxRange clip; gives the user a reasonable
|
|
@@ -1759,7 +1791,8 @@ export class Renderer {
|
|
|
1759
1791
|
const overrideBatches = this.scene.getOverrideBatches();
|
|
1760
1792
|
if (overrideBatches.length > 0) {
|
|
1761
1793
|
pass.setPipeline(this.pipeline.getOverlayPipeline());
|
|
1762
|
-
|
|
1794
|
+
// bit 1 = overlay; bit 5 (32) = emphasize (pop) — see shader.
|
|
1795
|
+
tplFlags[0] = options.emphasizeOverrides ? (2 | 32) : 2;
|
|
1763
1796
|
for (const batch of overrideBatches) {
|
|
1764
1797
|
renderBatch(batch);
|
|
1765
1798
|
}
|
|
@@ -2074,6 +2107,9 @@ export class Renderer {
|
|
|
2074
2107
|
if (this.section2DOverlayRenderer?.hasGridLines3D()) {
|
|
2075
2108
|
this.section2DOverlayRenderer.drawGridLines3D(pass, viewProj);
|
|
2076
2109
|
}
|
|
2110
|
+
if (this.section2DOverlayRenderer?.hasClashBoxLines3D()) {
|
|
2111
|
+
this.section2DOverlayRenderer.drawClashBoxLines3D(pass, viewProj);
|
|
2112
|
+
}
|
|
2077
2113
|
if (this.symbolicTextPipeline?.hasGeometry()) {
|
|
2078
2114
|
// Pass viewport pixel dimensions so the shader can scale glyphs
|
|
2079
2115
|
// to a constant on-screen size (BIMvision-style annotations)
|
|
@@ -2356,6 +2392,19 @@ export class Renderer {
|
|
|
2356
2392
|
this.section2DOverlayRenderer.clearGeometry();
|
|
2357
2393
|
}
|
|
2358
2394
|
}
|
|
2395
|
+
/**
|
|
2396
|
+
* Set the colour of the overlay lines (annotation / alignment / grid) and the
|
|
2397
|
+
* section-cut outline (RGBA, 0..1). Defaults to opaque black; theme it to keep
|
|
2398
|
+
* lines legible on a dark canvas. The matching label colour is per-text via
|
|
2399
|
+
* `SymbolicTextInput.color` on `uploadAnnotationTexts3D`.
|
|
2400
|
+
*/
|
|
2401
|
+
setOverlayLineColor(color) {
|
|
2402
|
+
// Persist on the Renderer so a pre-init call (and any later overlay
|
|
2403
|
+
// re-creation) keeps the colour — init() re-applies this.overlayLineColor.
|
|
2404
|
+
this.overlayLineColor = color;
|
|
2405
|
+
this.section2DOverlayRenderer?.setOverlayLineColor(color);
|
|
2406
|
+
this.requestRender();
|
|
2407
|
+
}
|
|
2359
2408
|
/**
|
|
2360
2409
|
* Upload pre-lifted 3D line-list vertices for the standalone annotation
|
|
2361
2410
|
* overlay. Each segment is `[x1, y1, z1, x2, y2, z2]` in world space.
|
|
@@ -2487,6 +2536,24 @@ export class Renderer {
|
|
|
2487
2536
|
this.requestRender();
|
|
2488
2537
|
}
|
|
2489
2538
|
}
|
|
2539
|
+
/**
|
|
2540
|
+
* Show (or clear) the clash-overlap box: the wireframe AABB of a focused
|
|
2541
|
+
* clash, drawn in `color` so the overlap region reads as a distinct third
|
|
2542
|
+
* colour next to the two glowing clash elements (#1277). Pass `null` to
|
|
2543
|
+
* clear. `min`/`max` are world-space corners (clash works in world frame).
|
|
2544
|
+
*/
|
|
2545
|
+
setClashOverlapBox(box) {
|
|
2546
|
+
if (!this.section2DOverlayRenderer)
|
|
2547
|
+
return;
|
|
2548
|
+
if (!box) {
|
|
2549
|
+
this.section2DOverlayRenderer.clearClashBoxLines3D();
|
|
2550
|
+
this.requestRender();
|
|
2551
|
+
return;
|
|
2552
|
+
}
|
|
2553
|
+
this.section2DOverlayRenderer.setClashBoxLineColor(box.color);
|
|
2554
|
+
this.section2DOverlayRenderer.uploadClashBoxLines3D(aabbEdgeLineList(box.min, box.max));
|
|
2555
|
+
this.requestRender();
|
|
2556
|
+
}
|
|
2490
2557
|
/**
|
|
2491
2558
|
* Upload filled IfcAnnotation regions for the symbolic overlay
|
|
2492
2559
|
* (issue #653). Pass an empty array to clear.
|