@ifc-lite/renderer 1.21.0 → 1.22.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/device.d.ts +6 -0
- package/dist/device.d.ts.map +1 -1
- package/dist/device.js +8 -0
- package/dist/device.js.map +1 -1
- package/dist/index.d.ts +37 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +231 -6
- package/dist/index.js.map +1 -1
- package/dist/pipeline.d.ts.map +1 -1
- package/dist/pipeline.js +10 -0
- package/dist/pipeline.js.map +1 -1
- package/dist/section-2d-overlay.d.ts +21 -0
- package/dist/section-2d-overlay.d.ts.map +1 -1
- package/dist/section-2d-overlay.js +67 -0
- package/dist/section-2d-overlay.js.map +1 -1
- package/dist/shaders/symbolic-overlay.wgsl.d.ts +10 -0
- package/dist/shaders/symbolic-overlay.wgsl.d.ts.map +1 -0
- package/dist/shaders/symbolic-overlay.wgsl.js +192 -0
- package/dist/shaders/symbolic-overlay.wgsl.js.map +1 -0
- package/dist/symbolic-overlay-pipelines.d.ts +110 -0
- package/dist/symbolic-overlay-pipelines.d.ts.map +1 -0
- package/dist/symbolic-overlay-pipelines.js +783 -0
- package/dist/symbolic-overlay-pipelines.js.map +1 -0
- package/dist/symbolic-text-atlas.d.ts +68 -0
- package/dist/symbolic-text-atlas.d.ts.map +1 -0
- package/dist/symbolic-text-atlas.js +144 -0
- package/dist/symbolic-text-atlas.js.map +1 -0
- package/package.json +3 -3
package/dist/device.d.ts
CHANGED
|
@@ -42,6 +42,12 @@ export declare class WebGPUDevice {
|
|
|
42
42
|
*/
|
|
43
43
|
getCurrentTexture(): GPUTexture | null;
|
|
44
44
|
getDevice(): GPUDevice;
|
|
45
|
+
/**
|
|
46
|
+
* Max 2D texture dimension reported by the GPU adapter. WebGPU's spec floor is 8192;
|
|
47
|
+
* iGPUs and most desktop GPUs report 8192 or 16384. Render targets / depth textures
|
|
48
|
+
* must not exceed this in either axis or the device fails validation.
|
|
49
|
+
*/
|
|
50
|
+
getMaxTextureDimension(): number;
|
|
45
51
|
getContext(): GPUCanvasContext;
|
|
46
52
|
getFormat(): GPUTextureFormat;
|
|
47
53
|
isInitialized(): boolean;
|
package/dist/device.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../src/device.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,qBAAa,YAAY;IACvB,OAAO,CAAC,OAAO,CAA2B;IAC1C,OAAO,CAAC,MAAM,CAA0B;IACxC,OAAO,CAAC,OAAO,CAAiC;IAChD,OAAO,CAAC,MAAM,CAAkC;IAChD,OAAO,CAAC,MAAM,CAAkC;IAChD,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,iBAAiB,CAAkB;IAC3C,OAAO,CAAC,UAAU,CAAa;IAC/B,4DAA4D;IAC5D,qBAAqB,EAAE,MAAM,CAAK;IAClC,oBAAoB,EAAE,MAAM,CAAM;IAElC;;OAEG;IACG,IAAI,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAwCpD;;;OAGG;IACH,gBAAgB,IAAI,IAAI;IAoBxB;;OAEG;IACH,gBAAgB,IAAI,OAAO;IAM3B;;OAEG;IACH,iBAAiB,IAAI,IAAI;IAIzB;;;OAGG;IACH,aAAa,IAAI,OAAO;IAWxB;;;OAGG;IACH,iBAAiB,IAAI,UAAU,GAAG,IAAI;IAgBtC,SAAS,IAAI,SAAS;IAOtB,UAAU,IAAI,gBAAgB;IAO9B,SAAS,IAAI,gBAAgB;IAI7B,aAAa,IAAI,OAAO;CAGzB"}
|
|
1
|
+
{"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../src/device.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,qBAAa,YAAY;IACvB,OAAO,CAAC,OAAO,CAA2B;IAC1C,OAAO,CAAC,MAAM,CAA0B;IACxC,OAAO,CAAC,OAAO,CAAiC;IAChD,OAAO,CAAC,MAAM,CAAkC;IAChD,OAAO,CAAC,MAAM,CAAkC;IAChD,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,iBAAiB,CAAkB;IAC3C,OAAO,CAAC,UAAU,CAAa;IAC/B,4DAA4D;IAC5D,qBAAqB,EAAE,MAAM,CAAK;IAClC,oBAAoB,EAAE,MAAM,CAAM;IAElC;;OAEG;IACG,IAAI,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAwCpD;;;OAGG;IACH,gBAAgB,IAAI,IAAI;IAoBxB;;OAEG;IACH,gBAAgB,IAAI,OAAO;IAM3B;;OAEG;IACH,iBAAiB,IAAI,IAAI;IAIzB;;;OAGG;IACH,aAAa,IAAI,OAAO;IAWxB;;;OAGG;IACH,iBAAiB,IAAI,UAAU,GAAG,IAAI;IAgBtC,SAAS,IAAI,SAAS;IAOtB;;;;OAIG;IACH,sBAAsB,IAAI,MAAM;IAIhC,UAAU,IAAI,gBAAgB;IAO9B,SAAS,IAAI,gBAAgB;IAI7B,aAAa,IAAI,OAAO;CAGzB"}
|
package/dist/device.js
CHANGED
|
@@ -130,6 +130,14 @@ export class WebGPUDevice {
|
|
|
130
130
|
}
|
|
131
131
|
return this.device;
|
|
132
132
|
}
|
|
133
|
+
/**
|
|
134
|
+
* Max 2D texture dimension reported by the GPU adapter. WebGPU's spec floor is 8192;
|
|
135
|
+
* iGPUs and most desktop GPUs report 8192 or 16384. Render targets / depth textures
|
|
136
|
+
* must not exceed this in either axis or the device fails validation.
|
|
137
|
+
*/
|
|
138
|
+
getMaxTextureDimension() {
|
|
139
|
+
return this.device?.limits?.maxTextureDimension2D ?? 8192;
|
|
140
|
+
}
|
|
133
141
|
getContext() {
|
|
134
142
|
if (!this.context) {
|
|
135
143
|
throw new Error('Context not initialized');
|
package/dist/device.js.map
CHANGED
|
@@ -1 +1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AO,KAAK,IAAI,CAAC;IACvD,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ export { Picker } from './picker.js';
|
|
|
10
10
|
export { MathUtils } from './math.js';
|
|
11
11
|
export { SectionPlaneRenderer } from './section-plane.js';
|
|
12
12
|
export { Section2DOverlayRenderer } from './section-2d-overlay.js';
|
|
13
|
+
export { SymbolicFillPipeline, SymbolicTextPipeline, type SymbolicFillInput, type SymbolicTextInput, } from './symbolic-overlay-pipelines.js';
|
|
14
|
+
export { SymbolicTextAtlas } from './symbolic-text-atlas.js';
|
|
13
15
|
export { DEFAULT_CAP_STYLE, HATCH_PATTERN_IDS } from './section-cap-style.js';
|
|
14
16
|
export type { SectionCapStyle, HatchPatternId } from './section-cap-style.js';
|
|
15
17
|
export { planeBasis, nearestCardinalAxis } from './section-plane-basis.js';
|
|
@@ -40,6 +42,7 @@ import { Scene } from './scene.js';
|
|
|
40
42
|
import type { MeshData } from '@ifc-lite/geometry';
|
|
41
43
|
import type { RenderOptions, PickOptions, PickResult, Mesh } from './types.js';
|
|
42
44
|
import { type CutPolygon2D, type DrawingLine2D } from './section-2d-overlay.js';
|
|
45
|
+
import { type SymbolicFillInput, type SymbolicTextInput } from './symbolic-overlay-pipelines.js';
|
|
43
46
|
import type { InstancedGeometry } from '@ifc-lite/wasm';
|
|
44
47
|
import { Raycaster, type Intersection } from './raycaster.js';
|
|
45
48
|
import { SnapDetector, type SnapTarget, type SnapOptions, type EdgeLockInput, type MagneticSnapResult } from './snap-detector.js';
|
|
@@ -57,6 +60,8 @@ export declare class Renderer {
|
|
|
57
60
|
private canvas;
|
|
58
61
|
private sectionPlaneRenderer;
|
|
59
62
|
private section2DOverlayRenderer;
|
|
63
|
+
private symbolicFillPipeline;
|
|
64
|
+
private symbolicTextPipeline;
|
|
60
65
|
private postProcessor;
|
|
61
66
|
private edlPass;
|
|
62
67
|
private edlOptions;
|
|
@@ -402,6 +407,38 @@ export declare class Renderer {
|
|
|
402
407
|
* Clear the 2D section overlay
|
|
403
408
|
*/
|
|
404
409
|
clearSection2DOverlay(): void;
|
|
410
|
+
/**
|
|
411
|
+
* Upload pre-lifted 3D line-list vertices for the standalone annotation
|
|
412
|
+
* overlay. Each segment is `[x1, y1, z1, x2, y2, z2]` in world space.
|
|
413
|
+
* The overlay is drawn regardless of whether a section plane is active.
|
|
414
|
+
* Pass an empty Float32Array to clear.
|
|
415
|
+
*/
|
|
416
|
+
uploadAnnotationLines3D(vertices: Float32Array): void;
|
|
417
|
+
/** Walks a flat `[x,y,z,x,y,z,...]` vertex buffer and either initialises
|
|
418
|
+
* or expands the cached `modelBounds` AABB. Used by the annotation
|
|
419
|
+
* overlay upload paths so symbolic-only models can still be framed.
|
|
420
|
+
*
|
|
421
|
+
* The geometry pipeline pre-seeds a placeholder `[-100, 100]` cube on
|
|
422
|
+
* every render when there are 0 meshes (so the section-plane slider
|
|
423
|
+
* always has a workable range). For an annotation-only model that
|
|
424
|
+
* fallback drowns out the much-smaller annotation cluster and a plain
|
|
425
|
+
* "expand" would no-op. We detect the placeholder by its exact symmetric
|
|
426
|
+
* signature and replace it with the actual annotation AABB instead. */
|
|
427
|
+
private expandModelBoundsWithFlatVertices;
|
|
428
|
+
/**
|
|
429
|
+
* Clear the standalone annotation line overlay.
|
|
430
|
+
*/
|
|
431
|
+
clearAnnotationLines3D(): void;
|
|
432
|
+
/**
|
|
433
|
+
* Upload filled IfcAnnotation regions for the symbolic overlay
|
|
434
|
+
* (issue #653). Pass an empty array to clear.
|
|
435
|
+
*/
|
|
436
|
+
uploadAnnotationFills3D(fills: readonly SymbolicFillInput[]): void;
|
|
437
|
+
/**
|
|
438
|
+
* Upload IfcAnnotation text labels for the symbolic overlay
|
|
439
|
+
* (issue #653). Pass an empty array to clear.
|
|
440
|
+
*/
|
|
441
|
+
uploadAnnotationTexts3D(texts: readonly SymbolicTextInput[]): void;
|
|
405
442
|
/**
|
|
406
443
|
* Check if 2D section overlay has geometry to render
|
|
407
444
|
*/
|
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,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;
|
|
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,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAKnE,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,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,IAAI,iBAAiB;CAGjC"}
|
package/dist/index.js
CHANGED
|
@@ -12,6 +12,11 @@ export { Picker } from './picker.js';
|
|
|
12
12
|
export { MathUtils } from './math.js';
|
|
13
13
|
export { SectionPlaneRenderer } from './section-plane.js';
|
|
14
14
|
export { Section2DOverlayRenderer } from './section-2d-overlay.js';
|
|
15
|
+
// IfcAnnotation overlay pipelines (3D world-space). Self-contained — caller
|
|
16
|
+
// passes a GPUDevice + presentation format and invokes `.render(pass, viewProj)`
|
|
17
|
+
// from inside an RGBA-blended pass. See packages/renderer/src/symbolic-overlay-pipelines.ts.
|
|
18
|
+
export { SymbolicFillPipeline, SymbolicTextPipeline, } from './symbolic-overlay-pipelines.js';
|
|
19
|
+
export { SymbolicTextAtlas } from './symbolic-text-atlas.js';
|
|
15
20
|
// Section cap styling (hatch pattern ids + default colours). The cap itself
|
|
16
21
|
// is now rendered by Section2DOverlayRenderer's fill pass; this module just
|
|
17
22
|
// holds the styling primitives shared with the store and UI.
|
|
@@ -41,6 +46,7 @@ import { FrustumUtils } from '@ifc-lite/spatial';
|
|
|
41
46
|
import { deduplicateMeshes } from '@ifc-lite/geometry';
|
|
42
47
|
import { SectionPlaneRenderer } from './section-plane.js';
|
|
43
48
|
import { Section2DOverlayRenderer } from './section-2d-overlay.js';
|
|
49
|
+
import { SymbolicFillPipeline, SymbolicTextPipeline, } from './symbolic-overlay-pipelines.js';
|
|
44
50
|
import { DEFAULT_CAP_STYLE, HATCH_PATTERN_IDS } from './section-cap-style.js';
|
|
45
51
|
import { PickingManager } from './picking-manager.js';
|
|
46
52
|
import { RaycastEngine } from './raycast-engine.js';
|
|
@@ -84,6 +90,10 @@ export class Renderer {
|
|
|
84
90
|
canvas;
|
|
85
91
|
sectionPlaneRenderer = null;
|
|
86
92
|
section2DOverlayRenderer = null;
|
|
93
|
+
// IfcAnnotation overlay pipelines (issue #653). Created on `init()` once
|
|
94
|
+
// the device exists; nulled until then.
|
|
95
|
+
symbolicFillPipeline = null;
|
|
96
|
+
symbolicTextPipeline = null;
|
|
87
97
|
postProcessor = null;
|
|
88
98
|
edlPass = null;
|
|
89
99
|
edlOptions = {
|
|
@@ -146,11 +156,16 @@ export class Renderer {
|
|
|
146
156
|
async init() {
|
|
147
157
|
await this.device.init(this.canvas);
|
|
148
158
|
// Get canvas dimensions (use pixel dimensions if set, otherwise use CSS dimensions)
|
|
159
|
+
// and clamp to the GPU's max 2D texture dimension so the initial pipeline allocations
|
|
160
|
+
// can't overflow on tall/wide layouts (see render() for the per-frame clamp).
|
|
149
161
|
const rect = this.canvas.getBoundingClientRect();
|
|
150
|
-
const
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
|
|
162
|
+
const maxDim = this.device.getMaxTextureDimension();
|
|
163
|
+
const rawWidth = this.canvas.width || Math.max(1, Math.floor(rect.width));
|
|
164
|
+
const rawHeight = this.canvas.height || Math.max(1, Math.floor(rect.height));
|
|
165
|
+
const width = Math.min(rawWidth, maxDim);
|
|
166
|
+
const height = Math.min(rawHeight, maxDim);
|
|
167
|
+
// Set pixel dimensions if not already set, or if we clamped them down
|
|
168
|
+
if (!this.canvas.width || !this.canvas.height || this.canvas.width !== width || this.canvas.height !== height) {
|
|
154
169
|
this.canvas.width = width;
|
|
155
170
|
this.canvas.height = height;
|
|
156
171
|
}
|
|
@@ -159,6 +174,12 @@ export class Renderer {
|
|
|
159
174
|
this.picker = new Picker(this.device, width, height);
|
|
160
175
|
this.sectionPlaneRenderer = new SectionPlaneRenderer(this.device.getDevice(), this.device.getFormat(), this.pipeline.getSampleCount());
|
|
161
176
|
this.section2DOverlayRenderer = new Section2DOverlayRenderer(this.device.getDevice(), this.device.getFormat(), this.pipeline.getSampleCount());
|
|
177
|
+
// IfcAnnotation overlay pipelines (issue #653). Share the device +
|
|
178
|
+
// presentation format AND the MSAA sample count + objectId attachment
|
|
179
|
+
// shape with the rest of the renderer so they composite into the same
|
|
180
|
+
// RGBA pass without WebGPU pass-compatibility validation errors.
|
|
181
|
+
this.symbolicFillPipeline = new SymbolicFillPipeline(this.device.getDevice(), this.device.getFormat(), this.pipeline.getSampleCount());
|
|
182
|
+
this.symbolicTextPipeline = new SymbolicTextPipeline(this.device.getDevice(), this.device.getFormat(), this.pipeline.getSampleCount());
|
|
162
183
|
// PostProcessor is optional — if it fails (e.g. mobile GPU lacking
|
|
163
184
|
// depth TEXTURE_BINDING), rendering still works without post-processing.
|
|
164
185
|
try {
|
|
@@ -900,10 +921,16 @@ export class Renderer {
|
|
|
900
921
|
}
|
|
901
922
|
// Validate canvas dimensions
|
|
902
923
|
// Align width to 64 pixels for WebGPU texture row alignment (256 bytes / 4 bytes per pixel)
|
|
924
|
+
// and clamp both axes to the GPU's max 2D texture dimension. Some hosts (e.g. tall iframes
|
|
925
|
+
// on high-DPR displays) can produce canvas dimensions that exceed 8192 and would otherwise
|
|
926
|
+
// make every depth/colour texture allocation a validation error.
|
|
903
927
|
const rect = this.canvas.getBoundingClientRect();
|
|
928
|
+
const maxDim = this.device.getMaxTextureDimension();
|
|
904
929
|
const rawWidth = Math.max(1, Math.floor(rect.width));
|
|
905
|
-
const
|
|
906
|
-
const
|
|
930
|
+
const widthAligned = Math.max(64, Math.floor(rawWidth / 64) * 64);
|
|
931
|
+
const width = Math.min(widthAligned, Math.floor(maxDim / 64) * 64);
|
|
932
|
+
const rawHeight = Math.max(1, Math.floor(rect.height));
|
|
933
|
+
const height = Math.min(rawHeight, maxDim);
|
|
907
934
|
// Skip rendering if canvas is too small
|
|
908
935
|
if (width < 64 || height < 10) {
|
|
909
936
|
this._renderSkipCount++;
|
|
@@ -1913,6 +1940,60 @@ export class Renderer {
|
|
|
1913
1940
|
});
|
|
1914
1941
|
}
|
|
1915
1942
|
}
|
|
1943
|
+
// Standalone IFC annotation overlay (issue #653). The line
|
|
1944
|
+
// vertices were pre-lifted to world space at upload time, so
|
|
1945
|
+
// this draw happens regardless of whether a section plane is
|
|
1946
|
+
// active — annotations are a free-floating "drawing layer"
|
|
1947
|
+
// that sits at each annotation's storey elevation.
|
|
1948
|
+
//
|
|
1949
|
+
// This block was previously nested inside the `if (options.sectionPlane && ...)`
|
|
1950
|
+
// guard above, contradicting its own comment. Loading an
|
|
1951
|
+
// annotation-only model with no section plane meant the entire
|
|
1952
|
+
// overlay was skipped at draw time even though 9000+ vertices
|
|
1953
|
+
// had been uploaded successfully. Pulled out to its own block.
|
|
1954
|
+
//
|
|
1955
|
+
// Order: fills (background) → lines (outlines on top) →
|
|
1956
|
+
// texts (labels above everything).
|
|
1957
|
+
if (this.symbolicFillPipeline?.hasGeometry()) {
|
|
1958
|
+
this.symbolicFillPipeline.render(pass, viewProj);
|
|
1959
|
+
}
|
|
1960
|
+
if (this.section2DOverlayRenderer?.hasAnnotationLines3D()) {
|
|
1961
|
+
this.section2DOverlayRenderer.drawAnnotationLines3D(pass, viewProj);
|
|
1962
|
+
}
|
|
1963
|
+
if (this.symbolicTextPipeline?.hasGeometry()) {
|
|
1964
|
+
// Pass viewport pixel dimensions so the shader can scale glyphs
|
|
1965
|
+
// to a constant on-screen size (BIMvision-style annotations)
|
|
1966
|
+
// regardless of camera distance or authored text height.
|
|
1967
|
+
//
|
|
1968
|
+
// Also pass the screen-aligned camera basis (right, up) so
|
|
1969
|
+
// billboarded glyphs (grid bubble tags) can face the camera
|
|
1970
|
+
// in any orientation — top-down, eye-level, oblique alike.
|
|
1971
|
+
const camPos = this.camera.getPosition();
|
|
1972
|
+
const camTgt = this.camera.getTarget();
|
|
1973
|
+
const camUpVec = this.camera.getUp();
|
|
1974
|
+
// Forward = normalize(target - position).
|
|
1975
|
+
let fx = camTgt.x - camPos.x;
|
|
1976
|
+
let fy = camTgt.y - camPos.y;
|
|
1977
|
+
let fz = camTgt.z - camPos.z;
|
|
1978
|
+
let flen = Math.hypot(fx, fy, fz) || 1;
|
|
1979
|
+
fx /= flen;
|
|
1980
|
+
fy /= flen;
|
|
1981
|
+
fz /= flen;
|
|
1982
|
+
// Right = normalize(cross(forward, world-up)).
|
|
1983
|
+
let rx = fy * camUpVec.z - fz * camUpVec.y;
|
|
1984
|
+
let ry = fz * camUpVec.x - fx * camUpVec.z;
|
|
1985
|
+
let rz = fx * camUpVec.y - fy * camUpVec.x;
|
|
1986
|
+
let rlen = Math.hypot(rx, ry, rz) || 1;
|
|
1987
|
+
rx /= rlen;
|
|
1988
|
+
ry /= rlen;
|
|
1989
|
+
rz /= rlen;
|
|
1990
|
+
// True up = normalize(cross(right, forward)) — guaranteed
|
|
1991
|
+
// perpendicular to both, defines screen-space vertical.
|
|
1992
|
+
const ux = ry * fz - rz * fy;
|
|
1993
|
+
const uy = rz * fx - rx * fz;
|
|
1994
|
+
const uz = rx * fy - ry * fx;
|
|
1995
|
+
this.symbolicTextPipeline.render(pass, viewProj, this.canvas.width, this.canvas.height, [rx, ry, rz], [ux, uy, uz]);
|
|
1996
|
+
}
|
|
1916
1997
|
pass.end();
|
|
1917
1998
|
const canRunPostPass = (contactEnabled || separationEnabled)
|
|
1918
1999
|
&& this.postProcessor !== null;
|
|
@@ -2142,6 +2223,143 @@ export class Renderer {
|
|
|
2142
2223
|
this.section2DOverlayRenderer.clearGeometry();
|
|
2143
2224
|
}
|
|
2144
2225
|
}
|
|
2226
|
+
/**
|
|
2227
|
+
* Upload pre-lifted 3D line-list vertices for the standalone annotation
|
|
2228
|
+
* overlay. Each segment is `[x1, y1, z1, x2, y2, z2]` in world space.
|
|
2229
|
+
* The overlay is drawn regardless of whether a section plane is active.
|
|
2230
|
+
* Pass an empty Float32Array to clear.
|
|
2231
|
+
*/
|
|
2232
|
+
uploadAnnotationLines3D(vertices) {
|
|
2233
|
+
if (!this.section2DOverlayRenderer)
|
|
2234
|
+
return;
|
|
2235
|
+
this.section2DOverlayRenderer.uploadAnnotationLines3D(vertices);
|
|
2236
|
+
// Contribute annotation extents to modelBounds + camera sceneBounds
|
|
2237
|
+
// so an annotation-only model (no IfcProduct meshes — common for
|
|
2238
|
+
// separate "annotation sheets") gets framed by Home / fit-to-view
|
|
2239
|
+
// AND has correct near/far clipping. Without sceneBounds the camera
|
|
2240
|
+
// frustum doesn't include the annotation cluster and they're clipped
|
|
2241
|
+
// away even when the camera is pointed at them. Mirror the
|
|
2242
|
+
// point-cloud upload path (`addPointClouds`, `setPointClouds`) which
|
|
2243
|
+
// does the same thing.
|
|
2244
|
+
this.expandModelBoundsWithFlatVertices(vertices, 3);
|
|
2245
|
+
if (this.modelBounds)
|
|
2246
|
+
this.camera.setSceneBounds(this.modelBounds);
|
|
2247
|
+
this.requestRender();
|
|
2248
|
+
}
|
|
2249
|
+
/** Walks a flat `[x,y,z,x,y,z,...]` vertex buffer and either initialises
|
|
2250
|
+
* or expands the cached `modelBounds` AABB. Used by the annotation
|
|
2251
|
+
* overlay upload paths so symbolic-only models can still be framed.
|
|
2252
|
+
*
|
|
2253
|
+
* The geometry pipeline pre-seeds a placeholder `[-100, 100]` cube on
|
|
2254
|
+
* every render when there are 0 meshes (so the section-plane slider
|
|
2255
|
+
* always has a workable range). For an annotation-only model that
|
|
2256
|
+
* fallback drowns out the much-smaller annotation cluster and a plain
|
|
2257
|
+
* "expand" would no-op. We detect the placeholder by its exact symmetric
|
|
2258
|
+
* signature and replace it with the actual annotation AABB instead. */
|
|
2259
|
+
expandModelBoundsWithFlatVertices(positions, stride) {
|
|
2260
|
+
if (positions.length === 0)
|
|
2261
|
+
return;
|
|
2262
|
+
const isPlaceholderCube = (b) => b.min.x === -100 && b.min.y === -100 && b.min.z === -100
|
|
2263
|
+
&& b.max.x === 100 && b.max.y === 100 && b.max.z === 100;
|
|
2264
|
+
if (!this.modelBounds || isPlaceholderCube(this.modelBounds)) {
|
|
2265
|
+
this.modelBounds = {
|
|
2266
|
+
min: { x: Infinity, y: Infinity, z: Infinity },
|
|
2267
|
+
max: { x: -Infinity, y: -Infinity, z: -Infinity },
|
|
2268
|
+
};
|
|
2269
|
+
}
|
|
2270
|
+
let expanded = false;
|
|
2271
|
+
for (let i = 0; i + 2 < positions.length; i += stride) {
|
|
2272
|
+
const x = positions[i];
|
|
2273
|
+
const y = positions[i + 1];
|
|
2274
|
+
const z = positions[i + 2];
|
|
2275
|
+
if (!Number.isFinite(x) || !Number.isFinite(y) || !Number.isFinite(z))
|
|
2276
|
+
continue;
|
|
2277
|
+
if (x < this.modelBounds.min.x)
|
|
2278
|
+
this.modelBounds.min.x = x;
|
|
2279
|
+
if (y < this.modelBounds.min.y)
|
|
2280
|
+
this.modelBounds.min.y = y;
|
|
2281
|
+
if (z < this.modelBounds.min.z)
|
|
2282
|
+
this.modelBounds.min.z = z;
|
|
2283
|
+
if (x > this.modelBounds.max.x)
|
|
2284
|
+
this.modelBounds.max.x = x;
|
|
2285
|
+
if (y > this.modelBounds.max.y)
|
|
2286
|
+
this.modelBounds.max.y = y;
|
|
2287
|
+
if (z > this.modelBounds.max.z)
|
|
2288
|
+
this.modelBounds.max.z = z;
|
|
2289
|
+
expanded = true;
|
|
2290
|
+
}
|
|
2291
|
+
if (!expanded)
|
|
2292
|
+
return;
|
|
2293
|
+
// Guarantee non-degenerate extent on every axis so camera frustums
|
|
2294
|
+
// don't collapse. 0.5 m margin matches what the section-plane fallback
|
|
2295
|
+
// uses elsewhere in this file.
|
|
2296
|
+
for (const axis of ['x', 'y', 'z']) {
|
|
2297
|
+
if (this.modelBounds.max[axis] - this.modelBounds.min[axis] < 1e-3) {
|
|
2298
|
+
this.modelBounds.max[axis] += 0.5;
|
|
2299
|
+
this.modelBounds.min[axis] -= 0.5;
|
|
2300
|
+
}
|
|
2301
|
+
}
|
|
2302
|
+
}
|
|
2303
|
+
/**
|
|
2304
|
+
* Clear the standalone annotation line overlay.
|
|
2305
|
+
*/
|
|
2306
|
+
clearAnnotationLines3D() {
|
|
2307
|
+
if (this.section2DOverlayRenderer) {
|
|
2308
|
+
this.section2DOverlayRenderer.clearAnnotationLines3D();
|
|
2309
|
+
this.requestRender();
|
|
2310
|
+
}
|
|
2311
|
+
}
|
|
2312
|
+
/**
|
|
2313
|
+
* Upload filled IfcAnnotation regions for the symbolic overlay
|
|
2314
|
+
* (issue #653). Pass an empty array to clear.
|
|
2315
|
+
*/
|
|
2316
|
+
uploadAnnotationFills3D(fills) {
|
|
2317
|
+
if (!this.symbolicFillPipeline)
|
|
2318
|
+
return;
|
|
2319
|
+
this.symbolicFillPipeline.upload(fills);
|
|
2320
|
+
// Contribute fill extents to modelBounds — see uploadAnnotationLines3D.
|
|
2321
|
+
for (const fill of fills) {
|
|
2322
|
+
const pts = fill.points;
|
|
2323
|
+
if (pts.length === 0)
|
|
2324
|
+
continue;
|
|
2325
|
+
// points are flat [x,z,x,z,...]; lift to (x, fill.worldY, z) per
|
|
2326
|
+
// vertex so we expand bounds in the same world space the renderer draws in.
|
|
2327
|
+
const lifted = new Float32Array((pts.length / 2) * 3);
|
|
2328
|
+
for (let i = 0, j = 0; i < pts.length; i += 2, j += 3) {
|
|
2329
|
+
lifted[j] = pts[i];
|
|
2330
|
+
lifted[j + 1] = fill.worldY;
|
|
2331
|
+
lifted[j + 2] = pts[i + 1];
|
|
2332
|
+
}
|
|
2333
|
+
this.expandModelBoundsWithFlatVertices(lifted, 3);
|
|
2334
|
+
}
|
|
2335
|
+
if (this.modelBounds)
|
|
2336
|
+
this.camera.setSceneBounds(this.modelBounds);
|
|
2337
|
+
this.requestRender();
|
|
2338
|
+
}
|
|
2339
|
+
/**
|
|
2340
|
+
* Upload IfcAnnotation text labels for the symbolic overlay
|
|
2341
|
+
* (issue #653). Pass an empty array to clear.
|
|
2342
|
+
*/
|
|
2343
|
+
uploadAnnotationTexts3D(texts) {
|
|
2344
|
+
if (!this.symbolicTextPipeline)
|
|
2345
|
+
return;
|
|
2346
|
+
this.symbolicTextPipeline.upload(texts);
|
|
2347
|
+
// Text origins are single points; pack them into a flat buffer and
|
|
2348
|
+
// expand bounds. Glyph extents are small enough that origin-only
|
|
2349
|
+
// suffices for framing.
|
|
2350
|
+
if (texts.length > 0) {
|
|
2351
|
+
const buf = new Float32Array(texts.length * 3);
|
|
2352
|
+
for (let i = 0; i < texts.length; i++) {
|
|
2353
|
+
buf[i * 3 + 0] = texts[i].worldPos[0];
|
|
2354
|
+
buf[i * 3 + 1] = texts[i].worldPos[1];
|
|
2355
|
+
buf[i * 3 + 2] = texts[i].worldPos[2];
|
|
2356
|
+
}
|
|
2357
|
+
this.expandModelBoundsWithFlatVertices(buf, 3);
|
|
2358
|
+
if (this.modelBounds)
|
|
2359
|
+
this.camera.setSceneBounds(this.modelBounds);
|
|
2360
|
+
}
|
|
2361
|
+
this.requestRender();
|
|
2362
|
+
}
|
|
2145
2363
|
/**
|
|
2146
2364
|
* Check if 2D section overlay has geometry to render
|
|
2147
2365
|
*/
|
|
@@ -2224,6 +2442,13 @@ export class Renderer {
|
|
|
2224
2442
|
this.sectionPlaneRenderer = null;
|
|
2225
2443
|
this.section2DOverlayRenderer?.dispose();
|
|
2226
2444
|
this.section2DOverlayRenderer = null;
|
|
2445
|
+
// Symbolic annotation overlay pipelines own their own GPU buffers,
|
|
2446
|
+
// sampler, and atlas texture — recreating the viewer without
|
|
2447
|
+
// releasing them leaks resources on every reload.
|
|
2448
|
+
this.symbolicFillPipeline?.destroy();
|
|
2449
|
+
this.symbolicFillPipeline = null;
|
|
2450
|
+
this.symbolicTextPipeline?.destroy();
|
|
2451
|
+
this.symbolicTextPipeline = null;
|
|
2227
2452
|
// Point cloud GPU resources
|
|
2228
2453
|
this.pointCloudRenderer?.clear();
|
|
2229
2454
|
this.pointCloudRenderer = null;
|