@ifc-lite/renderer 1.41.0 → 1.43.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/camera-fit-policy.d.ts.map +1 -1
- package/dist/camera-fit-policy.js +18 -7
- package/dist/camera-fit-policy.js.map +1 -1
- package/dist/camera.d.ts.map +1 -1
- package/dist/camera.js +77 -7
- package/dist/camera.js.map +1 -1
- package/dist/deviation/deviation-pipeline.d.ts.map +1 -1
- package/dist/deviation/deviation-pipeline.js +21 -4
- package/dist/deviation/deviation-pipeline.js.map +1 -1
- package/dist/index.d.ts +179 -35
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +478 -672
- package/dist/index.js.map +1 -1
- package/dist/math.d.ts +10 -1
- package/dist/math.d.ts.map +1 -1
- package/dist/math.js +107 -12
- package/dist/math.js.map +1 -1
- package/dist/model-bounds-tracker.d.ts +96 -0
- package/dist/model-bounds-tracker.d.ts.map +1 -0
- package/dist/model-bounds-tracker.js +147 -0
- package/dist/model-bounds-tracker.js.map +1 -0
- package/dist/pointcloud/point-cloud-node.d.ts.map +1 -1
- package/dist/pointcloud/point-cloud-node.js +24 -4
- package/dist/pointcloud/point-cloud-node.js.map +1 -1
- package/dist/render-degradation.d.ts +77 -0
- package/dist/render-degradation.d.ts.map +1 -0
- package/dist/render-degradation.js +52 -0
- package/dist/render-degradation.js.map +1 -0
- package/dist/render-section-draw.d.ts +51 -0
- package/dist/render-section-draw.d.ts.map +1 -0
- package/dist/render-section-draw.js +66 -0
- package/dist/render-section-draw.js.map +1 -0
- package/dist/render-section-plane.d.ts +128 -0
- package/dist/render-section-plane.d.ts.map +1 -0
- package/dist/render-section-plane.js +298 -0
- package/dist/render-section-plane.js.map +1 -0
- package/dist/renderer-overlays.d.ts +144 -0
- package/dist/renderer-overlays.d.ts.map +1 -0
- package/dist/renderer-overlays.js +257 -0
- package/dist/renderer-overlays.js.map +1 -0
- package/dist/renderer-symbolic-overlays.d.ts +52 -0
- package/dist/renderer-symbolic-overlays.d.ts.map +1 -0
- package/dist/renderer-symbolic-overlays.js +120 -0
- package/dist/renderer-symbolic-overlays.js.map +1 -0
- package/dist/scene.d.ts +103 -1
- package/dist/scene.d.ts.map +1 -1
- package/dist/scene.js +374 -104
- package/dist/scene.js.map +1 -1
- package/dist/section-2d-overlay.d.ts +17 -0
- package/dist/section-2d-overlay.d.ts.map +1 -1
- package/dist/section-2d-overlay.js +62 -0
- package/dist/section-2d-overlay.js.map +1 -1
- package/dist/visual-enhancement.d.ts +33 -0
- package/dist/visual-enhancement.d.ts.map +1 -0
- package/dist/visual-enhancement.js +46 -0
- package/dist/visual-enhancement.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,298 @@
|
|
|
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
|
+
* The distance range an AABB spans along `normal`: the min and max of
|
|
6
|
+
* `dot(corner, normal)` over the eight corners (issue #2447).
|
|
7
|
+
*
|
|
8
|
+
* This is the quantity a section slider has to travel over, because the plane
|
|
9
|
+
* the shader clips against is `dot(worldPos, normal) = distance`. Reading the
|
|
10
|
+
* range off one axis of the AABB instead is only the same quantity when
|
|
11
|
+
* `normal` IS that unit axis; on a rotated building it is short by up to
|
|
12
|
+
* `(1 - cos45) * extent` at each end, so the slider's 0-100% cannot reach the
|
|
13
|
+
* model's extremes (a 40 x 20 footprint cut on `side` at 45 degrees spans 40
|
|
14
|
+
* units where the true extent along the normal is 42.426).
|
|
15
|
+
*
|
|
16
|
+
* When `normal` IS a unit axis the loop collapses to that axis's extent
|
|
17
|
+
* bit-for-bit (`x * 1 + y * 0 + z * 0 === x` for finite inputs), so unrotated
|
|
18
|
+
* models are unaffected.
|
|
19
|
+
*
|
|
20
|
+
* Exported so the 2D cap upload can share the one formula instead of carrying
|
|
21
|
+
* a second copy — see `RendererOverlays.uploadSection2DOverlay`, which passes
|
|
22
|
+
* the un-rotated axis normal on purpose.
|
|
23
|
+
*/
|
|
24
|
+
export function projectedBoundsRange(boundsMin, boundsMax, normal) {
|
|
25
|
+
let min = Infinity;
|
|
26
|
+
let max = -Infinity;
|
|
27
|
+
for (const x of [boundsMin.x, boundsMax.x]) {
|
|
28
|
+
for (const y of [boundsMin.y, boundsMax.y]) {
|
|
29
|
+
for (const z of [boundsMin.z, boundsMax.z]) {
|
|
30
|
+
const d = x * normal[0] + y * normal[1] + z * normal[2];
|
|
31
|
+
if (d < min)
|
|
32
|
+
min = d;
|
|
33
|
+
if (d > max)
|
|
34
|
+
max = d;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return { min, max };
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Resolve this frame's clip plane and the bounds it is expressed in.
|
|
42
|
+
*
|
|
43
|
+
* Pure apart from the one-shot diagnostic, which is gated by
|
|
44
|
+
* `input.logSectionBounds` and commits its latch through
|
|
45
|
+
* `input.spendLogLatch` before logging.
|
|
46
|
+
*/
|
|
47
|
+
export function resolveSectionPlaneFrame(input) {
|
|
48
|
+
const { options, batchedMeshes, meshes, pointCloudBounds } = input;
|
|
49
|
+
// Calculate section plane parameters and model bounds
|
|
50
|
+
// Always calculate bounds when sectionPlane is provided (for preview and active mode)
|
|
51
|
+
let sectionPlaneData;
|
|
52
|
+
// Terrain clip: when Cesium overlay is active, clip model below terrain.
|
|
53
|
+
// Normal (0,-1,0) + distance (-clipY) clips where worldPos.y < clipY.
|
|
54
|
+
if (options.terrainClipY !== undefined && !options.sectionPlane?.enabled) {
|
|
55
|
+
sectionPlaneData = {
|
|
56
|
+
normal: [0, -1, 0],
|
|
57
|
+
distance: -options.terrainClipY,
|
|
58
|
+
enabled: true,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
if (!options.sectionPlane) {
|
|
62
|
+
return { sectionPlaneData, bounds: null };
|
|
63
|
+
}
|
|
64
|
+
// Get model bounds from batched meshes. We deliberately EXCLUDE
|
|
65
|
+
// individual meshes (`this.scene.getMeshes()`) here: those are
|
|
66
|
+
// created lazily for selection highlighting and can live at
|
|
67
|
+
// unexpected world positions (e.g. legacy transforms, overlay
|
|
68
|
+
// helpers), which would inflate the bounds range and make
|
|
69
|
+
// "1% of the slider" span the entire real model — producing
|
|
70
|
+
// the reported symptom where the model pops from fully visible
|
|
71
|
+
// to fully invisible across a tiny slider range.
|
|
72
|
+
const boundsMin = { x: Infinity, y: Infinity, z: Infinity };
|
|
73
|
+
const boundsMax = { x: -Infinity, y: -Infinity, z: -Infinity };
|
|
74
|
+
for (const batch of batchedMeshes) {
|
|
75
|
+
if (batch.bounds) {
|
|
76
|
+
boundsMin.x = Math.min(boundsMin.x, batch.bounds.min[0]);
|
|
77
|
+
boundsMin.y = Math.min(boundsMin.y, batch.bounds.min[1]);
|
|
78
|
+
boundsMin.z = Math.min(boundsMin.z, batch.bounds.min[2]);
|
|
79
|
+
boundsMax.x = Math.max(boundsMax.x, batch.bounds.max[0]);
|
|
80
|
+
boundsMax.y = Math.max(boundsMax.y, batch.bounds.max[1]);
|
|
81
|
+
boundsMax.z = Math.max(boundsMax.z, batch.bounds.max[2]);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
// Fold in point-cloud bounds too — without this, a
|
|
85
|
+
// pure point-cloud scene falls through to the default
|
|
86
|
+
// [-100,100], and a mixed scene clips against a
|
|
87
|
+
// smaller mesh-only range while the point pipeline
|
|
88
|
+
// (which honours the same sectionPlaneData) keeps
|
|
89
|
+
// drawing points outside the slider's reach.
|
|
90
|
+
if (pointCloudBounds) {
|
|
91
|
+
boundsMin.x = Math.min(boundsMin.x, pointCloudBounds.min[0]);
|
|
92
|
+
boundsMin.y = Math.min(boundsMin.y, pointCloudBounds.min[1]);
|
|
93
|
+
boundsMin.z = Math.min(boundsMin.z, pointCloudBounds.min[2]);
|
|
94
|
+
boundsMax.x = Math.max(boundsMax.x, pointCloudBounds.max[0]);
|
|
95
|
+
boundsMax.y = Math.max(boundsMax.y, pointCloudBounds.max[1]);
|
|
96
|
+
boundsMax.z = Math.max(boundsMax.z, pointCloudBounds.max[2]);
|
|
97
|
+
}
|
|
98
|
+
// If no batched meshes have bounds yet (streaming, degenerate
|
|
99
|
+
// models), fall back to individual meshes so at least the
|
|
100
|
+
// slider has a workable range.
|
|
101
|
+
if (!Number.isFinite(boundsMin.x)) {
|
|
102
|
+
for (const mesh of meshes) {
|
|
103
|
+
if (mesh.bounds) {
|
|
104
|
+
boundsMin.x = Math.min(boundsMin.x, mesh.bounds.min[0]);
|
|
105
|
+
boundsMin.y = Math.min(boundsMin.y, mesh.bounds.min[1]);
|
|
106
|
+
boundsMin.z = Math.min(boundsMin.z, mesh.bounds.min[2]);
|
|
107
|
+
boundsMax.x = Math.max(boundsMax.x, mesh.bounds.max[0]);
|
|
108
|
+
boundsMax.y = Math.max(boundsMax.y, mesh.bounds.max[1]);
|
|
109
|
+
boundsMax.z = Math.max(boundsMax.z, mesh.bounds.max[2]);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
// Fallback if no bounds found
|
|
114
|
+
if (!Number.isFinite(boundsMin.x)) {
|
|
115
|
+
boundsMin.x = boundsMin.y = boundsMin.z = -100;
|
|
116
|
+
boundsMax.x = boundsMax.y = boundsMax.z = 100;
|
|
117
|
+
}
|
|
118
|
+
// Only calculate clipping data if section is enabled
|
|
119
|
+
// Terrain clip: when no section plane is active, use terrainClipY
|
|
120
|
+
// to clip fragments below terrain height. Normal (0,-1,0) with
|
|
121
|
+
// distance = -clipY clips worldPos.y < clipY.
|
|
122
|
+
if (!options.sectionPlane?.enabled && options.terrainClipY !== undefined) {
|
|
123
|
+
sectionPlaneData = {
|
|
124
|
+
normal: [0, -1, 0],
|
|
125
|
+
distance: -options.terrainClipY,
|
|
126
|
+
enabled: true,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
if (options.sectionPlane.enabled) {
|
|
130
|
+
// Explicit normal + distance override (face-pick / arbitrary
|
|
131
|
+
// plane, issue #243). Used verbatim: no axis mapping, no
|
|
132
|
+
// position slider, no building rotation — the caller already
|
|
133
|
+
// has the plane in world space.
|
|
134
|
+
const explicitNormal = options.sectionPlane.normal;
|
|
135
|
+
const explicitDistance = options.sectionPlane.distance;
|
|
136
|
+
// `SectionPlane.normal` / `.distance` are caller-supplied public
|
|
137
|
+
// `RenderOptions` surface (the face-pick / arbitrary-plane path from
|
|
138
|
+
// #243), so every component has to clear finiteness before it can reach
|
|
139
|
+
// the clip uniform and `_activePickSection` (#2442). Only `distance`
|
|
140
|
+
// used to be checked: an `Infinity` component then made `len` infinite,
|
|
141
|
+
// `len > 1e-6` true, and `normal = [NaN, NaN, NaN]` was written straight
|
|
142
|
+
// into both the draw and the GPU pick. A rejected plane degrades to the
|
|
143
|
+
// cardinal-axis preset below, which is always a usable plane.
|
|
144
|
+
const hasExplicitPlane = explicitNormal !== undefined &&
|
|
145
|
+
explicitDistance !== undefined &&
|
|
146
|
+
Number.isFinite(explicitDistance) &&
|
|
147
|
+
Number.isFinite(explicitNormal[0]) &&
|
|
148
|
+
Number.isFinite(explicitNormal[1]) &&
|
|
149
|
+
Number.isFinite(explicitNormal[2]);
|
|
150
|
+
let normal;
|
|
151
|
+
let distance;
|
|
152
|
+
if (hasExplicitPlane) {
|
|
153
|
+
// Defensive renormalisation in case the caller passed a
|
|
154
|
+
// non-unit vector (e.g. mesh face normals quantised by
|
|
155
|
+
// the geometry pipeline).
|
|
156
|
+
const nx = explicitNormal[0];
|
|
157
|
+
const ny = explicitNormal[1];
|
|
158
|
+
const nz = explicitNormal[2];
|
|
159
|
+
const len = Math.sqrt(nx * nx + ny * ny + nz * nz);
|
|
160
|
+
// Finite components are not enough: `1e200` squares to `Infinity`,
|
|
161
|
+
// so `len` can still overflow and `len > 1e-6` is true for it,
|
|
162
|
+
// yielding `normal = [0, 0, 0]` and `distance = 0` (#2442). Both the
|
|
163
|
+
// overflow and the degenerate near-zero vector take the documented
|
|
164
|
+
// [0, 1, 0] fallback.
|
|
165
|
+
if (Number.isFinite(len) && len > 1e-6) {
|
|
166
|
+
normal = [nx / len, ny / len, nz / len];
|
|
167
|
+
distance = explicitDistance / len;
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
normal = [0, 1, 0];
|
|
171
|
+
distance = explicitDistance;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
// Cardinal-axis preset path (unchanged behaviour).
|
|
176
|
+
// down = Y axis (horizontal cut), front = Z axis, side = X axis
|
|
177
|
+
normal = [0, 0, 0];
|
|
178
|
+
if (options.sectionPlane.axis === 'side')
|
|
179
|
+
normal[0] = 1; // X axis
|
|
180
|
+
else if (options.sectionPlane.axis === 'down')
|
|
181
|
+
normal[1] = 1; // Y axis (horizontal)
|
|
182
|
+
else
|
|
183
|
+
normal[2] = 1; // Z axis (front)
|
|
184
|
+
// Apply building rotation if present (rotate normal around Y axis)
|
|
185
|
+
// Building rotation is in X-Y plane (Z is up in IFC, Y is up in WebGL)
|
|
186
|
+
//
|
|
187
|
+
// The angle must also be FINITE (#2442). It is model-derived, not
|
|
188
|
+
// authored by us — `rotation_angle_about_z` on the resolved IfcSite
|
|
189
|
+
// placement — and a malformed placement direction whose components
|
|
190
|
+
// overflow to Infinity (`IFCDIRECTION((0.,0.,1.0E400))`, which the
|
|
191
|
+
// STEP tokenizer parses to `inf`) normalises to a NaN matrix, so
|
|
192
|
+
// the pre-pass emits `atan2(NaN, NaN)` = NaN and nothing on the way
|
|
193
|
+
// to `RenderOptions` filters it. `Math.cos` is NaN for both NaN and
|
|
194
|
+
// Infinity, and the `rlen > 0.0001` guard below is FALSE for NaN,
|
|
195
|
+
// so it would reach `projectedBoundsRange`, `distance` and the clip
|
|
196
|
+
// uniform — the failure #2442 fixed on the explicit-plane sibling.
|
|
197
|
+
// Non-finite degrades to no rotation: the cardinal preset the axis
|
|
198
|
+
// already describes.
|
|
199
|
+
if (options.buildingRotation !== undefined &&
|
|
200
|
+
options.buildingRotation !== 0 &&
|
|
201
|
+
Number.isFinite(options.buildingRotation)) {
|
|
202
|
+
const cosR = Math.cos(options.buildingRotation);
|
|
203
|
+
const sinR = Math.sin(options.buildingRotation);
|
|
204
|
+
// Rotate normal vector around Y axis (vertical)
|
|
205
|
+
// For X-Z plane rotation: x' = x*cos - z*sin, z' = x*sin + z*cos, y' = y
|
|
206
|
+
const x = normal[0];
|
|
207
|
+
const z = normal[2];
|
|
208
|
+
normal[0] = x * cosR - z * sinR;
|
|
209
|
+
normal[2] = x * sinR + z * cosR;
|
|
210
|
+
// Normalize to maintain unit length
|
|
211
|
+
const rlen = Math.sqrt(normal[0] * normal[0] + normal[1] * normal[1] + normal[2] * normal[2]);
|
|
212
|
+
if (rlen > 0.0001) {
|
|
213
|
+
normal[0] /= rlen;
|
|
214
|
+
normal[1] /= rlen;
|
|
215
|
+
normal[2] /= rlen;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
// Get the range the slider travels over. The renderer's own `boundsMin/Max`
|
|
219
|
+
// are computed from the GPU vertex buffers this frame, so
|
|
220
|
+
// they are guaranteed to be in the same Y-up world space as
|
|
221
|
+
// `input.worldPos` in the shader. `options.sectionPlane.min/max`
|
|
222
|
+
// comes from the UI via `coordinateInfo.shiftedBounds` and can
|
|
223
|
+
// be stale during streaming or outright wrong during model
|
|
224
|
+
// load (initialised to {0,0,0} before the first bounds update)
|
|
225
|
+
// — using those directly was the cause of the "slider moves
|
|
226
|
+
// 1% and the whole model disappears" bug.
|
|
227
|
+
//
|
|
228
|
+
// Policy: always use the renderer's own bounds for the Y-up
|
|
229
|
+
// range. Only honour the UI override when it is a valid,
|
|
230
|
+
// non-degenerate range that lies INSIDE the actual mesh
|
|
231
|
+
// bounds (e.g. storey filtering from the level picker).
|
|
232
|
+
//
|
|
233
|
+
// The range must be measured along the normal the plane actually
|
|
234
|
+
// cuts with, not along the cardinal axis it was derived from: the
|
|
235
|
+
// shader clips on `dot(worldPos, normal)`, so on a rotated building
|
|
236
|
+
// an axis-aligned extent leaves an unreachable wedge at each end of
|
|
237
|
+
// the slider (#2447). `projectedBoundsRange` is the axis extent
|
|
238
|
+
// exactly when the normal is still that unit axis.
|
|
239
|
+
const projected = projectedBoundsRange(boundsMin, boundsMax, normal);
|
|
240
|
+
let minVal = projected.min;
|
|
241
|
+
let maxVal = projected.max;
|
|
242
|
+
// The UI override arrives in AXIS-ALIGNED elevation units
|
|
243
|
+
// (`coordinateInfo.shiftedBounds`), while the range above is a plane
|
|
244
|
+
// distance. Those coincide only while the resolved normal is still
|
|
245
|
+
// the positive unit axis the override is expressed along — true for
|
|
246
|
+
// any unrotated model, and true for `axis: 'down'` at every rotation
|
|
247
|
+
// (a Y-axis building rotation leaves [0,1,0] fixed). Outside that,
|
|
248
|
+
// honouring the override would silently compare metres-along-Y
|
|
249
|
+
// against a distance-along-a-tilted-normal, so it is skipped and the
|
|
250
|
+
// full projected range stands (#2447).
|
|
251
|
+
const axisComponent = options.sectionPlane.axis === 'side' ? 0 : options.sectionPlane.axis === 'down' ? 1 : 2;
|
|
252
|
+
const overrideUnitsMatch = Math.abs(normal[axisComponent] - 1) <= 1e-6 &&
|
|
253
|
+
Math.abs(normal[(axisComponent + 1) % 3]) <= 1e-6 &&
|
|
254
|
+
Math.abs(normal[(axisComponent + 2) % 3]) <= 1e-6;
|
|
255
|
+
const uiMin = options.sectionPlane.min;
|
|
256
|
+
const uiMax = options.sectionPlane.max;
|
|
257
|
+
if (overrideUnitsMatch &&
|
|
258
|
+
Number.isFinite(uiMin) &&
|
|
259
|
+
Number.isFinite(uiMax) &&
|
|
260
|
+
uiMax - uiMin > 1e-6 &&
|
|
261
|
+
uiMin >= minVal - 1e-3 &&
|
|
262
|
+
uiMax <= maxVal + 1e-3) {
|
|
263
|
+
minVal = uiMin;
|
|
264
|
+
maxVal = uiMax;
|
|
265
|
+
}
|
|
266
|
+
// Calculate plane distance from position percentage
|
|
267
|
+
const range = maxVal - minVal;
|
|
268
|
+
distance = minVal + (options.sectionPlane.position / 100) * range;
|
|
269
|
+
}
|
|
270
|
+
sectionPlaneData = { normal, distance, enabled: true };
|
|
271
|
+
// One-shot diagnostic: when section first becomes active,
|
|
272
|
+
// log the exact bounds + plane the shader will use. This
|
|
273
|
+
// is the fastest way to confirm "bounds mismatch" / "plane
|
|
274
|
+
// off-screen" bugs without asking the user to run a
|
|
275
|
+
// debugger. The custom-plane branch logs `mode: 'explicit'`
|
|
276
|
+
// so reports against tilted planes are easy to spot.
|
|
277
|
+
if (input.logSectionBounds) {
|
|
278
|
+
input.spendLogLatch();
|
|
279
|
+
console.info('[Section] Y-up bounds used for clip:', {
|
|
280
|
+
mode: hasExplicitPlane ? 'explicit' : 'axis-aligned',
|
|
281
|
+
axis: options.sectionPlane.axis,
|
|
282
|
+
bounds: {
|
|
283
|
+
min: { x: boundsMin.x, y: boundsMin.y, z: boundsMin.z },
|
|
284
|
+
max: { x: boundsMax.x, y: boundsMax.y, z: boundsMax.z },
|
|
285
|
+
},
|
|
286
|
+
normal,
|
|
287
|
+
distance,
|
|
288
|
+
position: options.sectionPlane.position,
|
|
289
|
+
batchedMeshCount: batchedMeshes.length,
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
return {
|
|
294
|
+
sectionPlaneData,
|
|
295
|
+
bounds: { min: boundsMin, max: boundsMax },
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
//# sourceMappingURL=render-section-plane.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-section-plane.js","sourceRoot":"","sources":["../src/render-section-plane.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAyB/D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,oBAAoB,CAChC,SAA8C,EAC9C,SAA8C,EAC9C,MAAyC;IAEzC,IAAI,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C,YAAY,CAAC,QAAQ;gBACvC,gBAAgB,EAAE,aAAa,CAAC,MAAM;aACzC,CAAC,CAAC;QACP,CAAC;IACL,CAAC;IAED,OAAO;QACH,gBAAgB;QAChB,MAAM,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE;KAC7C,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The renderer's overlay layer, lifted verbatim out of `Renderer` (issue
|
|
3
|
+
* #2425): the section-plane gizmo, the 2D section drawing / cut cap, and the
|
|
4
|
+
* standalone 3D line overlays (IfcAnnotation lines, IfcAlignment centrelines,
|
|
5
|
+
* IfcGridAxis, the DXF reference layer, and the focused clash's box / contact
|
|
6
|
+
* lines).
|
|
7
|
+
*
|
|
8
|
+
* These were already one unit in everything but location: created together in
|
|
9
|
+
* `init()`, destroyed together in `destroy()`, drawn one after another at the
|
|
10
|
+
* tail of the render pass, and fed by a facade of upload/clear methods that
|
|
11
|
+
* touches nothing else. Owning them here follows the `PickingManager` /
|
|
12
|
+
* `RaycastEngine` precedent — a cohesive chunk of state plus its behaviour,
|
|
13
|
+
* composed by `Renderer` rather than inlined into it.
|
|
14
|
+
*
|
|
15
|
+
* The boundary is GPU-object ownership, not subject matter. Every 3D line
|
|
16
|
+
* layer above lives on the SAME `Section2DOverlayRenderer` instance as the
|
|
17
|
+
* section cap, so "section rendering" and "standalone line overlays" cannot be
|
|
18
|
+
* separate modules without giving one nullable, init-created / destroy-disposed
|
|
19
|
+
* object two owners in two files. The symbolic fill/text pipelines ARE separate
|
|
20
|
+
* GPU objects, so they live in `renderer-symbolic-overlays.ts` and are composed
|
|
21
|
+
* here — this class keeps only the draw ORDER, which is the one thing the two
|
|
22
|
+
* families share.
|
|
23
|
+
*
|
|
24
|
+
* Behaviour that needs those objects but does not own them can still leave:
|
|
25
|
+
* `render-section-draw.ts` holds the section gizmo + cut-cap draw, receiving
|
|
26
|
+
* both renderers as arguments. Passing a GPU object costs nothing; co-owning
|
|
27
|
+
* one is what the paragraph above rules out.
|
|
28
|
+
*
|
|
29
|
+
* Doc comments for the published methods live on the matching `Renderer`
|
|
30
|
+
* delegates, which are what consumers see in the emitted `.d.ts`; they are not
|
|
31
|
+
* duplicated here.
|
|
32
|
+
*
|
|
33
|
+
* What stayed on `Renderer` is what genuinely couples: model bounds. Several
|
|
34
|
+
* uploads grow the scene AABB so an annotation-only or alignment-only model can
|
|
35
|
+
* still be framed, and those bounds are read by the camera, the section slider
|
|
36
|
+
* and `getDiagnostics()`. Rather than give one AABB two owners, this reaches the
|
|
37
|
+
* renderer's copy through the narrow `OverlayHost` seam below.
|
|
38
|
+
*/
|
|
39
|
+
import type { Camera } from './camera.js';
|
|
40
|
+
import { type CutPolygon2D, type DrawingLine2D } from './section-2d-overlay.js';
|
|
41
|
+
import type { SymbolicFillInput, SymbolicTextInput } from './symbolic-overlay-pipelines.js';
|
|
42
|
+
import { type ModelBounds } from './render-section-draw.js';
|
|
43
|
+
import type { RenderOptions } from './types.js';
|
|
44
|
+
/**
|
|
45
|
+
* The slice of `Renderer` the overlays need. Deliberately four methods wide:
|
|
46
|
+
* the overlays own their GPU objects outright, and borrow only the model-bounds
|
|
47
|
+
* bookkeeping that the rest of the renderer also owns.
|
|
48
|
+
*/
|
|
49
|
+
export interface OverlayHost {
|
|
50
|
+
/** The renderer's cached model AABB, or null before any geometry. */
|
|
51
|
+
getModelBounds(): ModelBounds | null;
|
|
52
|
+
/** Grow (or seed) the model AABB from a flat `[x,y,z,...]` buffer. */
|
|
53
|
+
expandModelBoundsWithFlatVertices(positions: Float32Array, stride: number): void;
|
|
54
|
+
/** Push the current model AABB to the camera's near/far fit. */
|
|
55
|
+
syncCameraSceneBounds(): void;
|
|
56
|
+
/** Mark the viewport dirty for the next animation frame. */
|
|
57
|
+
requestRender(): void;
|
|
58
|
+
}
|
|
59
|
+
/** Everything the overlay draw pass reads from the frame in flight. */
|
|
60
|
+
export interface OverlayDrawContext {
|
|
61
|
+
options: RenderOptions;
|
|
62
|
+
viewProj: Float32Array;
|
|
63
|
+
/** The bounds this frame resolved the section slider against. */
|
|
64
|
+
modelBounds: ModelBounds | null;
|
|
65
|
+
camera: Camera;
|
|
66
|
+
canvasWidth: number;
|
|
67
|
+
canvasHeight: number;
|
|
68
|
+
}
|
|
69
|
+
export declare class RendererOverlays {
|
|
70
|
+
private readonly host;
|
|
71
|
+
private sectionPlaneRenderer;
|
|
72
|
+
private section2DOverlayRenderer;
|
|
73
|
+
private overlayLineColor;
|
|
74
|
+
private readonly symbolic;
|
|
75
|
+
constructor(host: OverlayHost);
|
|
76
|
+
/**
|
|
77
|
+
* Create the overlay GPU objects. Called from `Renderer.init()` once the
|
|
78
|
+
* device and the main pipeline (for its sample count) exist.
|
|
79
|
+
*/
|
|
80
|
+
init(device: GPUDevice, format: GPUTextureFormat, sampleCount: number): void;
|
|
81
|
+
/** Release every overlay GPU resource. Idempotent, like `Renderer.destroy()`. */
|
|
82
|
+
destroy(): void;
|
|
83
|
+
/**
|
|
84
|
+
* Draw every overlay into the frame's render pass, in the documented order.
|
|
85
|
+
* Called from the encode region right before `pass.end()`.
|
|
86
|
+
*/
|
|
87
|
+
draw(pass: GPURenderPassEncoder, ctx: OverlayDrawContext): void;
|
|
88
|
+
/** See `Renderer.uploadSection2DOverlay` for the published contract. */
|
|
89
|
+
uploadSection2DOverlay(polygons: CutPolygon2D[], lines: DrawingLine2D[], axis: 'down' | 'front' | 'side', position: number, // 0-100 percentage
|
|
90
|
+
sectionRange?: {
|
|
91
|
+
min?: number;
|
|
92
|
+
max?: number;
|
|
93
|
+
}, // Same storey-based range as section plane
|
|
94
|
+
flipped?: boolean, customPlane?: {
|
|
95
|
+
origin: [number, number, number];
|
|
96
|
+
tangent: [number, number, number];
|
|
97
|
+
bitangent: [number, number, number];
|
|
98
|
+
}): void;
|
|
99
|
+
/** See `Renderer.clearSection2DOverlay` for the published contract. */
|
|
100
|
+
clearSection2DOverlay(): void;
|
|
101
|
+
/** See `Renderer.setOverlayLineColor` for the published contract. */
|
|
102
|
+
setOverlayLineColor(color: readonly [number, number, number, number]): void;
|
|
103
|
+
/** See `Renderer.uploadAnnotationLines3D` for the published contract. */
|
|
104
|
+
uploadAnnotationLines3D(vertices: Float32Array): void;
|
|
105
|
+
/** See `Renderer.clearAnnotationLines3D` for the published contract. */
|
|
106
|
+
clearAnnotationLines3D(): void;
|
|
107
|
+
/** See `Renderer.uploadAlignmentLines3D` for the published contract. */
|
|
108
|
+
uploadAlignmentLines3D(vertices: Float32Array): void;
|
|
109
|
+
/** See `Renderer.clearAlignmentLines3D` for the published contract. */
|
|
110
|
+
clearAlignmentLines3D(): void;
|
|
111
|
+
/**
|
|
112
|
+
* See `Renderer.uploadGridLines3D` for the published contract. Unlike
|
|
113
|
+
* alignment, grids do NOT expand model bounds: they're behind a visibility
|
|
114
|
+
* toggle, so toggling them on must not reframe the camera.
|
|
115
|
+
*/
|
|
116
|
+
uploadGridLines3D(vertices: Float32Array): void;
|
|
117
|
+
/** See `Renderer.clearGridLines3D` for the published contract. */
|
|
118
|
+
clearGridLines3D(): void;
|
|
119
|
+
/** See `Renderer.uploadDxfLines3D` for the published contract. */
|
|
120
|
+
uploadDxfLines3D(vertices: Float32Array): void;
|
|
121
|
+
/** See `Renderer.clearDxfLines3D` for the published contract. */
|
|
122
|
+
clearDxfLines3D(): void;
|
|
123
|
+
/** See `Renderer.setClashOverlapBox` for the published contract. */
|
|
124
|
+
setClashOverlapBox(box: {
|
|
125
|
+
min: [number, number, number];
|
|
126
|
+
max: [number, number, number];
|
|
127
|
+
color: [number, number, number, number];
|
|
128
|
+
} | null): void;
|
|
129
|
+
/**
|
|
130
|
+
* See `Renderer.setClashContactLines` for the published contract. Shares the
|
|
131
|
+
* clash-box line buffer, so only one of this / setClashOverlapBox shows.
|
|
132
|
+
*/
|
|
133
|
+
setClashContactLines(lines: {
|
|
134
|
+
vertices: Float32Array;
|
|
135
|
+
color: [number, number, number, number];
|
|
136
|
+
} | null): void;
|
|
137
|
+
/** See `Renderer.uploadAnnotationFills3D` for the published contract. */
|
|
138
|
+
uploadAnnotationFills3D(fills: readonly SymbolicFillInput[]): void;
|
|
139
|
+
/** See `Renderer.uploadAnnotationTexts3D` for the published contract. */
|
|
140
|
+
uploadAnnotationTexts3D(texts: readonly SymbolicTextInput[]): void;
|
|
141
|
+
/** See `Renderer.hasSection2DOverlay` for the published contract. */
|
|
142
|
+
hasSection2DOverlay(): boolean;
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=renderer-overlays.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer-overlays.d.ts","sourceRoot":"","sources":["../src/renderer-overlays.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAA4B,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE1G,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAG5F,OAAO,EAAuB,KAAK,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACjF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD;;;;GAIG;AACH,MAAM,WAAW,WAAW;IACxB,qEAAqE;IACrE,cAAc,IAAI,WAAW,GAAG,IAAI,CAAC;IACrC,sEAAsE;IACtE,iCAAiC,CAAC,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACjF,gEAAgE;IAChE,qBAAqB,IAAI,IAAI,CAAC;IAC9B,4DAA4D;IAC5D,aAAa,IAAI,IAAI,CAAC;CACzB;AAED,uEAAuE;AACvE,MAAM,WAAW,kBAAkB;IAC/B,OAAO,EAAE,aAAa,CAAC;IACvB,QAAQ,EAAE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