@ifc-lite/renderer 6.3.3 → 6.5.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 (223) hide show
  1. package/dist/camera-animation.d.ts +7 -1
  2. package/dist/camera-animation.d.ts.map +1 -1
  3. package/dist/camera-animation.js +19 -3
  4. package/dist/camera-animation.js.map +1 -1
  5. package/dist/camera-fit-geometry.d.ts +47 -0
  6. package/dist/camera-fit-geometry.d.ts.map +1 -0
  7. package/dist/camera-fit-geometry.js +44 -0
  8. package/dist/camera-fit-geometry.js.map +1 -0
  9. package/dist/camera-framing.d.ts +27 -21
  10. package/dist/camera-framing.d.ts.map +1 -1
  11. package/dist/camera-framing.js +47 -44
  12. package/dist/camera-framing.js.map +1 -1
  13. package/dist/camera-preset-view.d.ts +18 -0
  14. package/dist/camera-preset-view.d.ts.map +1 -1
  15. package/dist/camera-preset-view.js +42 -0
  16. package/dist/camera-preset-view.js.map +1 -1
  17. package/dist/camera.d.ts +14 -1
  18. package/dist/camera.d.ts.map +1 -1
  19. package/dist/camera.js +14 -2
  20. package/dist/camera.js.map +1 -1
  21. package/dist/clip-types.d.ts +35 -0
  22. package/dist/clip-types.d.ts.map +1 -0
  23. package/dist/clip-types.js +5 -0
  24. package/dist/clip-types.js.map +1 -0
  25. package/dist/device-recovery.js +11 -1
  26. package/dist/device-recovery.js.map +1 -1
  27. package/dist/device.d.ts +4 -4
  28. package/dist/device.js +9 -9
  29. package/dist/device.js.map +1 -1
  30. package/dist/extra-clip-planes.d.ts +57 -0
  31. package/dist/extra-clip-planes.d.ts.map +1 -0
  32. package/dist/extra-clip-planes.js +161 -0
  33. package/dist/extra-clip-planes.js.map +1 -0
  34. package/dist/gpu-counters.d.ts +4 -2
  35. package/dist/gpu-counters.d.ts.map +1 -1
  36. package/dist/gpu-counters.js +9 -6
  37. package/dist/gpu-counters.js.map +1 -1
  38. package/dist/index.d.ts +19 -5
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +69 -90
  41. package/dist/index.js.map +1 -1
  42. package/dist/mesh-rte-uniforms.d.ts +7 -3
  43. package/dist/mesh-rte-uniforms.d.ts.map +1 -1
  44. package/dist/mesh-rte-uniforms.js +16 -2
  45. package/dist/mesh-rte-uniforms.js.map +1 -1
  46. package/dist/opaque-visibility-commands.d.ts +3 -0
  47. package/dist/opaque-visibility-commands.d.ts.map +1 -0
  48. package/dist/opaque-visibility-commands.js +11 -0
  49. package/dist/opaque-visibility-commands.js.map +1 -0
  50. package/dist/opaque-visibility-pass.d.ts +37 -0
  51. package/dist/opaque-visibility-pass.d.ts.map +1 -0
  52. package/dist/opaque-visibility-pass.js +230 -0
  53. package/dist/opaque-visibility-pass.js.map +1 -0
  54. package/dist/pick-types.d.ts +5 -1
  55. package/dist/pick-types.d.ts.map +1 -1
  56. package/dist/picker-rte-uniforms.d.ts +1 -1
  57. package/dist/picker-rte-uniforms.d.ts.map +1 -1
  58. package/dist/picker-rte-uniforms.js +4 -2
  59. package/dist/picker-rte-uniforms.js.map +1 -1
  60. package/dist/picker-shaders.d.ts +5 -0
  61. package/dist/picker-shaders.d.ts.map +1 -0
  62. package/dist/picker-shaders.js +157 -0
  63. package/dist/picker-shaders.js.map +1 -0
  64. package/dist/picker.d.ts +3 -0
  65. package/dist/picker.d.ts.map +1 -1
  66. package/dist/picker.js +43 -133
  67. package/dist/picker.js.map +1 -1
  68. package/dist/pipeline.d.ts +5 -9
  69. package/dist/pipeline.d.ts.map +1 -1
  70. package/dist/pipeline.js +34 -29
  71. package/dist/pipeline.js.map +1 -1
  72. package/dist/point-picker.d.ts +2 -1
  73. package/dist/point-picker.d.ts.map +1 -1
  74. package/dist/point-picker.js +12 -4
  75. package/dist/point-picker.js.map +1 -1
  76. package/dist/pointcloud/point-cloud-renderer.d.ts +4 -4
  77. package/dist/pointcloud/point-cloud-renderer.d.ts.map +1 -1
  78. package/dist/pointcloud/point-cloud-renderer.js +1 -1
  79. package/dist/pointcloud/point-cloud-renderer.js.map +1 -1
  80. package/dist/pointcloud/point-cloud-uniforms.d.ts +3 -1
  81. package/dist/pointcloud/point-cloud-uniforms.d.ts.map +1 -1
  82. package/dist/pointcloud/point-cloud-uniforms.js +3 -1
  83. package/dist/pointcloud/point-cloud-uniforms.js.map +1 -1
  84. package/dist/pointcloud/point-pipeline.d.ts +3 -1
  85. package/dist/pointcloud/point-pipeline.d.ts.map +1 -1
  86. package/dist/pointcloud/point-pipeline.js +4 -1
  87. package/dist/pointcloud/point-pipeline.js.map +1 -1
  88. package/dist/pointcloud/point-shader.wgsl.d.ts +1 -1
  89. package/dist/pointcloud/point-shader.wgsl.d.ts.map +1 -1
  90. package/dist/pointcloud/point-shader.wgsl.js +8 -0
  91. package/dist/pointcloud/point-shader.wgsl.js.map +1 -1
  92. package/dist/post-pass-chain.d.ts +1 -0
  93. package/dist/post-pass-chain.d.ts.map +1 -1
  94. package/dist/post-pass-chain.js +1 -0
  95. package/dist/post-pass-chain.js.map +1 -1
  96. package/dist/quantized-lifecycle.d.ts +6 -0
  97. package/dist/quantized-lifecycle.d.ts.map +1 -0
  98. package/dist/quantized-lifecycle.js +19 -0
  99. package/dist/quantized-lifecycle.js.map +1 -0
  100. package/dist/raycast-engine.d.ts.map +1 -1
  101. package/dist/raycast-engine.js +3 -2
  102. package/dist/raycast-engine.js.map +1 -1
  103. package/dist/render-section-draw.d.ts +5 -0
  104. package/dist/render-section-draw.d.ts.map +1 -1
  105. package/dist/render-section-draw.js +59 -25
  106. package/dist/render-section-draw.js.map +1 -1
  107. package/dist/render-section-plane.d.ts +5 -33
  108. package/dist/render-section-plane.d.ts.map +1 -1
  109. package/dist/render-section-plane.js +8 -175
  110. package/dist/render-section-plane.js.map +1 -1
  111. package/dist/renderer-frame-timing.d.ts +1 -0
  112. package/dist/renderer-frame-timing.d.ts.map +1 -1
  113. package/dist/renderer-frame-timing.js +8 -1
  114. package/dist/renderer-frame-timing.js.map +1 -1
  115. package/dist/renderer-overlays.d.ts +8 -2
  116. package/dist/renderer-overlays.d.ts.map +1 -1
  117. package/dist/renderer-overlays.js +22 -45
  118. package/dist/renderer-overlays.js.map +1 -1
  119. package/dist/scene-raycaster.d.ts +1 -1
  120. package/dist/scene-raycaster.d.ts.map +1 -1
  121. package/dist/scene-raycaster.js +18 -44
  122. package/dist/scene-raycaster.js.map +1 -1
  123. package/dist/scene-rect-select.d.ts.map +1 -1
  124. package/dist/scene-rect-select.js +2 -1
  125. package/dist/scene-rect-select.js.map +1 -1
  126. package/dist/section-2d-lift.d.ts +25 -0
  127. package/dist/section-2d-lift.d.ts.map +1 -1
  128. package/dist/section-2d-lift.js +35 -0
  129. package/dist/section-2d-lift.js.map +1 -1
  130. package/dist/section-2d-overlay.d.ts +41 -12
  131. package/dist/section-2d-overlay.d.ts.map +1 -1
  132. package/dist/section-2d-overlay.js +121 -179
  133. package/dist/section-2d-overlay.js.map +1 -1
  134. package/dist/section-2d-types.d.ts +2 -0
  135. package/dist/section-2d-types.d.ts.map +1 -1
  136. package/dist/section-cap-geometry.d.ts +33 -0
  137. package/dist/section-cap-geometry.d.ts.map +1 -0
  138. package/dist/section-cap-geometry.js +137 -0
  139. package/dist/section-cap-geometry.js.map +1 -0
  140. package/dist/section-cap-set.d.ts +60 -0
  141. package/dist/section-cap-set.d.ts.map +1 -0
  142. package/dist/section-cap-set.js +212 -0
  143. package/dist/section-cap-set.js.map +1 -0
  144. package/dist/section-cap-style.d.ts +3 -0
  145. package/dist/section-cap-style.d.ts.map +1 -1
  146. package/dist/section-cap-style.js.map +1 -1
  147. package/dist/section-cap-upload.d.ts +16 -0
  148. package/dist/section-cap-upload.d.ts.map +1 -0
  149. package/dist/section-cap-upload.js +52 -0
  150. package/dist/section-cap-upload.js.map +1 -0
  151. package/dist/section-exclusions.d.ts +26 -0
  152. package/dist/section-exclusions.d.ts.map +1 -0
  153. package/dist/section-exclusions.js +95 -0
  154. package/dist/section-exclusions.js.map +1 -0
  155. package/dist/section-plane-frames.d.ts +48 -0
  156. package/dist/section-plane-frames.d.ts.map +1 -0
  157. package/dist/section-plane-frames.js +49 -0
  158. package/dist/section-plane-frames.js.map +1 -0
  159. package/dist/section-plane-resolve.d.ts +63 -0
  160. package/dist/section-plane-resolve.d.ts.map +1 -0
  161. package/dist/section-plane-resolve.js +200 -0
  162. package/dist/section-plane-resolve.js.map +1 -0
  163. package/dist/selection-mask-pass.d.ts +2 -0
  164. package/dist/selection-mask-pass.d.ts.map +1 -1
  165. package/dist/selection-mask-pass.js +16 -4
  166. package/dist/selection-mask-pass.js.map +1 -1
  167. package/dist/selection-mask-pipelines.d.ts +5 -1
  168. package/dist/selection-mask-pipelines.d.ts.map +1 -1
  169. package/dist/selection-mask-pipelines.js +27 -3
  170. package/dist/selection-mask-pipelines.js.map +1 -1
  171. package/dist/selection-outline-frame.d.ts +3 -1
  172. package/dist/selection-outline-frame.d.ts.map +1 -1
  173. package/dist/selection-outline-frame.js +2 -1
  174. package/dist/selection-outline-frame.js.map +1 -1
  175. package/dist/shaders/depth-nudge.wgsl.d.ts +2 -2
  176. package/dist/shaders/depth-nudge.wgsl.d.ts.map +1 -1
  177. package/dist/shaders/depth-nudge.wgsl.js +1 -18
  178. package/dist/shaders/depth-nudge.wgsl.js.map +1 -1
  179. package/dist/shaders/main.wgsl.d.ts +1 -1
  180. package/dist/shaders/main.wgsl.d.ts.map +1 -1
  181. package/dist/shaders/main.wgsl.js +9 -1
  182. package/dist/shaders/main.wgsl.js.map +1 -1
  183. package/dist/shaders/mesh-uniforms.wgsl.d.ts +1 -1
  184. package/dist/shaders/mesh-uniforms.wgsl.d.ts.map +1 -1
  185. package/dist/shaders/mesh-uniforms.wgsl.js +11 -3
  186. package/dist/shaders/mesh-uniforms.wgsl.js.map +1 -1
  187. package/dist/shaders/opaque-visibility.wgsl.d.ts +11 -0
  188. package/dist/shaders/opaque-visibility.wgsl.d.ts.map +1 -0
  189. package/dist/shaders/opaque-visibility.wgsl.js +55 -0
  190. package/dist/shaders/opaque-visibility.wgsl.js.map +1 -0
  191. package/dist/shaders/section-2d-overlay.wgsl.d.ts +11 -5
  192. package/dist/shaders/section-2d-overlay.wgsl.d.ts.map +1 -1
  193. package/dist/shaders/section-2d-overlay.wgsl.js +31 -5
  194. package/dist/shaders/section-2d-overlay.wgsl.js.map +1 -1
  195. package/dist/shaders/selection-mask.wgsl.d.ts +1 -1
  196. package/dist/shaders/selection-mask.wgsl.d.ts.map +1 -1
  197. package/dist/shaders/selection-mask.wgsl.js +10 -4
  198. package/dist/shaders/selection-mask.wgsl.js.map +1 -1
  199. package/dist/shaders/shadow.wgsl.d.ts +1 -1
  200. package/dist/shaders/shadow.wgsl.d.ts.map +1 -1
  201. package/dist/shaders/shadow.wgsl.js +22 -7
  202. package/dist/shaders/shadow.wgsl.js.map +1 -1
  203. package/dist/shaders/symbolic-overlay.wgsl.d.ts +1 -1
  204. package/dist/shaders/symbolic-overlay.wgsl.d.ts.map +1 -1
  205. package/dist/shadow-occluders.d.ts.map +1 -1
  206. package/dist/shadow-occluders.js +4 -0
  207. package/dist/shadow-occluders.js.map +1 -1
  208. package/dist/shadow-pass.d.ts +2 -5
  209. package/dist/shadow-pass.d.ts.map +1 -1
  210. package/dist/shadow-pass.js +17 -17
  211. package/dist/shadow-pass.js.map +1 -1
  212. package/dist/shadow-types.d.ts +7 -0
  213. package/dist/shadow-types.d.ts.map +1 -1
  214. package/dist/shadow-types.js.map +1 -1
  215. package/dist/source-curve-clipping.d.ts.map +1 -1
  216. package/dist/source-curve-clipping.js +7 -1
  217. package/dist/source-curve-clipping.js.map +1 -1
  218. package/dist/source-curve-snap.d.ts.map +1 -1
  219. package/dist/source-curve-snap.js +2 -1
  220. package/dist/source-curve-snap.js.map +1 -1
  221. package/dist/types.d.ts +12 -16
  222. package/dist/types.d.ts.map +1 -1
  223. package/package.json +3 -3
@@ -23,11 +23,12 @@
23
23
  */
24
24
  import { PIPELINE_CONSTANTS } from './constants.js';
25
25
  import { createSectionCapPipelines } from './section-cap-pipelines.js';
26
- import { tryPackRteDrawableDelta } from './relative-to-eye.js';
27
- import { SECTION_2D_CAP_FILL_WGSL, SECTION_2D_OVERLAY_LINE_WGSL, SECTION_2D_UNIFORM_BYTES, SECTION_2D_UNIFORM_FLOATS, SECTION_2D_UNIFORM_SLOTS, SECTION_2D_UNIFORM_SLOT_COUNT, SECTION_2D_UNIFORM_SLOT_INDEX, sectionUniformSlotStride, } from './shaders/section-2d-overlay.wgsl.js';
28
- import { buildCapFillGeometry, buildDrawingOutlineVertices, createSectionLift, } from './section-2d-lift.js';
26
+ import { SectionCapSet } from './section-cap-set.js';
27
+ import { EXTRA_CLIP_BYTES } from './extra-clip-planes.js';
28
+ import { SECTION_2D_CAP_FILL_WGSL, SECTION_2D_CAP_LINE_WGSL, SECTION_2D_MAX_EXTRA_CAPS, SECTION_2D_OVERLAY_LINE_WGSL, SECTION_2D_UNIFORM_BYTES, SECTION_2D_UNIFORM_SLOT_COUNT, SECTION_2D_UNIFORM_SLOT_INDEX, sectionUniformSlotStride, } from './shaders/section-2d-overlay.wgsl.js';
29
29
  import { WorldLineBuffer, } from './section-2d-line-buffer.js';
30
30
  import { LINE_OVERLAY_CHANNELS, } from './section-2d-types.js';
31
+ export { capHighlightKey } from './section-2d-lift.js';
31
32
  export { LINE_OVERLAY_CHANNELS } from './section-2d-types.js';
32
33
  export class Section2DOverlayRenderer {
33
34
  device;
@@ -39,6 +40,12 @@ export class Section2DOverlayRenderer {
39
40
  bindGroupLayout = null;
40
41
  uniformBuffer = null;
41
42
  bindGroup = null;
43
+ /** The cap's outline pipeline: the line pipeline plus the clip against the other cutting planes (#7545). */
44
+ capLinePipeline = null;
45
+ /** Group 1 of the cap pipelines: the planes that clip each cap, one block per cap. */
46
+ clipBindGroup = null;
47
+ clipBuffer = null;
48
+ clipStride = 0;
42
49
  /** Byte stride between the uniform slots in {@link uniformBuffer}. Set by `init()`. */
43
50
  uniformStride = 0;
44
51
  format;
@@ -49,16 +56,10 @@ export class Section2DOverlayRenderer {
49
56
  // opaque black for backwards compatibility; a consumer can theme it (e.g. light
50
57
  // lines on a dark canvas) via setOverlayLineColor().
51
58
  overlayLineColor = [0, 0, 0, 1];
52
- // Cached section-cut geometry buffers. Unlike the world-space overlays below
53
- // these ride the section plane and the fill half is indexed, so they are not
54
- // WorldLineBuffers.
55
- fillVertexBuffer = null;
56
- fillIndexBuffer = null;
57
- fillIndexCount = 0;
58
- lineVertexBuffer = null;
59
- lineVertexCount = 0;
60
- /** f64 cap anchor retained separately from the local cap vertices. */
61
- capAnchor = null;
59
+ // The section-cut cap geometry, one per cutting plane (#7545). Unlike the
60
+ // world-space overlays below these ride their plane and the fill half is
61
+ // indexed, so they are not WorldLineBuffers.
62
+ caps = new SectionCapSet();
62
63
  /**
63
64
  * One world-space vertex buffer per {@link LineOverlayChannel}, each on its
64
65
  * own uniform slot.
@@ -113,10 +114,22 @@ export class Section2DOverlayRenderer {
113
114
  const pipelineLayout = this.device.createPipelineLayout({
114
115
  bindGroupLayouts: [this.bindGroupLayout],
115
116
  });
117
+ // The cap pipelines add group 1: the planes that clip this cap, one block per cap
118
+ // addressed by a dynamic offset (the primary cap and up to seven more, #7545).
119
+ const clipLayout = this.device.createBindGroupLayout({
120
+ entries: [{
121
+ binding: 0,
122
+ visibility: GPUShaderStage.FRAGMENT,
123
+ buffer: { type: 'uniform', hasDynamicOffset: true, minBindingSize: EXTRA_CLIP_BYTES },
124
+ }],
125
+ });
126
+ const capPipelineLayout = this.device.createPipelineLayout({
127
+ bindGroupLayouts: [this.bindGroupLayout, clipLayout],
128
+ });
116
129
  const fillShader = this.device.createShaderModule({ code: SECTION_2D_CAP_FILL_WGSL });
117
130
  const lineShader = this.device.createShaderModule({ code: SECTION_2D_OVERLAY_LINE_WGSL });
118
131
  // Pipelines for filled polygons: the cap colour, and its depth (#5384).
119
- const cap = createSectionCapPipelines(this.device, pipelineLayout, fillShader, this.format, this.sampleCount);
132
+ const cap = createSectionCapPipelines(this.device, capPipelineLayout, fillShader, this.format, this.sampleCount);
120
133
  this.fillPipeline = cap.fill;
121
134
  this.fillDepthPipeline = cap.depth;
122
135
  // The descriptor is retained so the selected-centreline depth variant can
@@ -159,6 +172,13 @@ export class Section2DOverlayRenderer {
159
172
  },
160
173
  };
161
174
  this.linePipeline = this.device.createRenderPipeline(this.linePipelineDescriptor);
175
+ const capLineShader = this.device.createShaderModule({ code: SECTION_2D_CAP_LINE_WGSL });
176
+ this.capLinePipeline = this.device.createRenderPipeline({
177
+ ...this.linePipelineDescriptor,
178
+ layout: capPipelineLayout,
179
+ vertex: { ...this.linePipelineDescriptor.vertex, module: capLineShader },
180
+ fragment: { ...this.linePipelineDescriptor.fragment, module: capLineShader },
181
+ });
162
182
  // One 160-byte uniform buffer shared by BOTH pipelines: the fill fragment
163
183
  // shader reads up to params2 (144 B), the line shader reads
164
184
  // viewProj/planeOffset plus the appended lineColor at byte offset 144, so
@@ -184,8 +204,39 @@ export class Section2DOverlayRenderer {
184
204
  },
185
205
  ],
186
206
  });
207
+ // One clip block per cap: the primary plane's and each extra plane's.
208
+ const align = this.device.limits?.minUniformBufferOffsetAlignment ?? 256;
209
+ this.clipStride = Math.ceil(EXTRA_CLIP_BYTES / (Number.isFinite(align) && align > 0 ? align : 256))
210
+ * (Number.isFinite(align) && align > 0 ? align : 256);
211
+ this.clipBuffer = this.device.createBuffer({
212
+ size: this.clipStride * (1 + SECTION_2D_MAX_EXTRA_CAPS),
213
+ usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,
214
+ });
215
+ this.clipBindGroup = this.device.createBindGroup({
216
+ layout: clipLayout,
217
+ entries: [{ binding: 0, resource: { buffer: this.clipBuffer, offset: 0, size: EXTRA_CLIP_BYTES } }],
218
+ });
187
219
  this.initialized = true;
188
220
  }
221
+ /** Everything a cap draw borrows, or null before `init()` produced it (or after `dispose()`). */
222
+ capResources() {
223
+ if (!this.fillPipeline || !this.fillDepthPipeline || !this.capLinePipeline || !this.uniformBuffer
224
+ || !this.bindGroup || !this.clipBindGroup || !this.clipBuffer)
225
+ return null;
226
+ return {
227
+ device: this.device,
228
+ fillPipeline: this.fillPipeline,
229
+ fillDepthPipeline: this.fillDepthPipeline,
230
+ outlinePipeline: this.capLinePipeline,
231
+ bindGroup: this.bindGroup,
232
+ uniformBuffer: this.uniformBuffer,
233
+ uniformStride: this.uniformStride,
234
+ clipBindGroup: this.clipBindGroup,
235
+ clipBuffer: this.clipBuffer,
236
+ clipStride: this.clipStride,
237
+ lineColor: this.overlayLineColor,
238
+ };
239
+ }
189
240
  /**
190
241
  * The shared line-pipeline resources a WorldLineBuffer borrows for a draw.
191
242
  * Returns null before `init()` has produced them (or after `dispose()`), so
@@ -217,68 +268,30 @@ export class Section2DOverlayRenderer {
217
268
  */
218
269
  uploadDrawing(polygons, lines, axis, planePosition, flipped = false, customPlane) {
219
270
  this.init();
220
- this.clearGeometry();
221
- const lift = createSectionLift(axis, planePosition, flipped, customPlane);
222
- const planeAnchor = customPlane
223
- ? [...customPlane.origin]
224
- : axis === 'side' ? [planePosition, 0, 0]
225
- : axis === 'down' ? [0, planePosition, 0] : [0, 0, planePosition];
226
- // The plane-coordinate anchor was enough when every model was near the
227
- // origin. At a survey offset it leaves both in-plane coordinates absolute
228
- // in the f32 vertex buffer, collapsing centimetre cap edges. Anchor at an
229
- // actual lifted point instead, while retaining the old plane point for an
230
- // empty upload that produces no vertex buffer to draw.
231
- const firstPoint = polygons.find((polygon) => polygon.polygon.outer.length > 0)?.polygon.outer[0]
232
- ?? lines[0]?.line.start;
233
- const anchor = firstPoint ? lift(firstPoint.x, firstPoint.y) : planeAnchor;
234
- // Lift/subtract while the coordinates are JS f64. Building a world-space
235
- // Float32Array first then subtracting the cap anchor loses centimetre
236
- // detail in both the plane normal and its in-plane axes at national-grid
237
- // offsets.
238
- const fill = buildCapFillGeometry(polygons, lift, anchor);
239
- if (fill) {
240
- this.fillVertexBuffer = this.device.createBuffer({
241
- size: fill.vertices.byteLength,
242
- usage: GPUBufferUsage.VERTEX | GPUBufferUsage.COPY_DST,
243
- });
244
- this.device.queue.writeBuffer(this.fillVertexBuffer, 0, fill.vertices);
245
- this.fillIndexBuffer = this.device.createBuffer({
246
- size: fill.indices.byteLength,
247
- usage: GPUBufferUsage.INDEX | GPUBufferUsage.COPY_DST,
248
- });
249
- this.device.queue.writeBuffer(this.fillIndexBuffer, 0, fill.indices);
250
- this.fillIndexCount = fill.indices.length;
251
- }
252
- const outline = buildDrawingOutlineVertices(polygons, lines, lift, anchor);
253
- if (outline) {
254
- this.lineVertexBuffer = this.device.createBuffer({
255
- size: outline.byteLength,
256
- usage: GPUBufferUsage.VERTEX | GPUBufferUsage.COPY_DST,
257
- });
258
- this.device.queue.writeBuffer(this.lineVertexBuffer, 0, outline);
259
- this.lineVertexCount = outline.length / 3; // Each vertex is 3 floats
260
- }
261
- this.capAnchor = anchor;
271
+ this.caps.upload(this.device, null, polygons, lines, axis, planePosition, flipped, customPlane);
272
+ }
273
+ /**
274
+ * Upload the cap of a cutting plane beyond the first (#7545), under `key` (the
275
+ * plane's id). Same arguments as {@link uploadDrawing}; each key holds its own
276
+ * cap, so planes never overwrite one another.
277
+ */
278
+ uploadExtraDrawing(key, polygons, lines, axis, planePosition, flipped = false, customPlane) {
279
+ this.init();
280
+ this.caps.upload(this.device, key, polygons, lines, axis, planePosition, flipped, customPlane);
281
+ }
282
+ /** Release the caps of every extra plane not in `keep` (a plane removed or turned off). */
283
+ clearExtraGeometry(keep = new Set()) {
284
+ this.caps.clearExtrasExcept(keep);
285
+ }
286
+ /** The keys of the extra caps held now. */
287
+ extraGeometryKeys() {
288
+ return this.caps.extraKeys();
262
289
  }
263
290
  /**
264
291
  * Clear uploaded geometry
265
292
  */
266
293
  clearGeometry() {
267
- if (this.fillVertexBuffer) {
268
- this.fillVertexBuffer.destroy();
269
- this.fillVertexBuffer = null;
270
- }
271
- if (this.fillIndexBuffer) {
272
- this.fillIndexBuffer.destroy();
273
- this.fillIndexBuffer = null;
274
- }
275
- if (this.lineVertexBuffer) {
276
- this.lineVertexBuffer.destroy();
277
- this.lineVertexBuffer = null;
278
- }
279
- this.fillIndexCount = 0;
280
- this.lineVertexCount = 0;
281
- this.capAnchor = null;
294
+ this.caps.clear(null);
282
295
  }
283
296
  /**
284
297
  * Set the colour of the overlay lines (annotation / alignment / grid) and the
@@ -364,121 +377,44 @@ export class Section2DOverlayRenderer {
364
377
  this.clashBoxLines.draw(pass, resources, viewProj, this.clashBoxLineColor, rteViewProj, camera);
365
378
  }
366
379
  /**
367
- * Check if there is geometry to draw
380
+ * Whether primary cap source is cached, even when exclusions currently hide it.
381
+ * Keep scheduling draws so a change to the exclusions can restore the cap.
368
382
  */
369
383
  hasGeometry() {
370
- return this.fillIndexCount > 0 || this.lineVertexCount > 0;
384
+ return this.caps.has();
385
+ }
386
+ /**
387
+ * Paint the given elements' cap polygons in their colour on every cutting
388
+ * plane's cap (the selection / hover highlight); `null` restores the caps. A
389
+ * no-op when it matches what is already drawn, so the render loop can call it
390
+ * every frame.
391
+ */
392
+ setCapHighlight(highlight) {
393
+ this.caps.setHighlight(this.device, highlight);
394
+ }
395
+ /** Whether an extra plane has cached cap source, including currently excluded caps (#7545). */
396
+ hasExtraGeometry() {
397
+ return this.caps.hasExtras();
371
398
  }
372
399
  /**
373
- * Draw the 2D overlay on the section plane
400
+ * Draw the primary plane's cap and outline on the section plane.
401
+ * `clippedBy` is every OTHER cutting plane (#7545): the cap's fragments those
402
+ * planes remove are discarded, so a cap never draws where its model is cut away.
374
403
  */
375
- draw(pass, options) {
404
+ draw(pass, options, clippedBy = []) {
376
405
  this.init();
377
- if (!this.fillPipeline || !this.fillDepthPipeline || !this.linePipeline || !this.uniformBuffer || !this.bindGroup) {
406
+ const resources = this.capResources();
407
+ if (!resources || !this.caps.has())
378
408
  return;
379
- }
380
- if (!this.hasGeometry()) {
409
+ this.caps.draw(pass, resources, options, clippedBy);
410
+ }
411
+ /** Draw the caps of the cutting planes beyond the first, each clipped by its own `clippedBy`. */
412
+ drawExtras(pass, options, caps) {
413
+ this.init();
414
+ const resources = this.capResources();
415
+ if (!resources || !this.caps.hasExtras())
381
416
  return;
382
- }
383
- const { viewProj } = options;
384
- // No offset — cap renders exactly on the section plane. The previous
385
- // 0.3m bias was there to keep the outline lines clear of below-plane
386
- // geometry, but it made the cap visually drift off the slider plane
387
- // (users could see a 0.3m gap between the plane preview and the cap).
388
- // The fill pipeline uses depthCompare 'greater-equal' (reverse-Z) so the
389
- // cap ties cleanly with coincident below-plane top faces and is occluded
390
- // by nearer model geometry — see the depthStencil comment in
391
- // `section-cap-pipelines.ts`. There is no stencil test; the fill is restricted
392
- // to the actual cap polygons by the triangle-plane intersection geometry
393
- // `SectionCutter` produces, not by a stencil gate.
394
- // Cap vertices are stored relative to capAnchor so that the RTE path can
395
- // retain their small in-plane residuals. The legacy view-projection path
396
- // still transforms world coordinates, however, so it must add that anchor
397
- // back through planeOffset. Leaving it zero placed every rebased legacy
398
- // cap around the world origin. Do not combine the two: RTE adds this same
399
- // anchor as an f64 split drawable delta below.
400
- const capAnchor = this.capAnchor;
401
- const rteViewProj = options.rteViewProj;
402
- const rteCamera = options.rteCamera;
403
- const offset = capAnchor === null || (rteViewProj !== undefined && rteCamera !== undefined)
404
- ? [0, 0, 0]
405
- : capAnchor;
406
- // Update uniforms. Field offsets come from SECTION_2D_UNIFORM_SLOTS, which
407
- // sits next to the WGSL struct it describes.
408
- const S = SECTION_2D_UNIFORM_SLOTS;
409
- const uniforms = new Float32Array(SECTION_2D_UNIFORM_FLOATS);
410
- uniforms.set(viewProj, S.viewProj);
411
- if (capAnchor !== null && rteViewProj !== undefined && rteCamera !== undefined) {
412
- uniforms.set(rteViewProj, S.rteViewProj);
413
- // Outside this camera's RTE envelope: the cap and its outline, the only
414
- // draws below, are not rasterisable this frame (#6128).
415
- if (!tryPackRteDrawableDelta(capAnchor, rteCamera, uniforms, S.originDeltaHigh))
416
- return;
417
- uniforms[S.originDeltaHigh + 3] = 1;
418
- }
419
- uniforms.set(this.overlayLineColor, S.lineColor); // section-cut outline colour
420
- uniforms[S.planeOffset + 0] = offset[0];
421
- uniforms[S.planeOffset + 1] = offset[1];
422
- uniforms[S.planeOffset + 2] = offset[2];
423
- uniforms[S.planeOffset + 3] = 0;
424
- const cs = options.capStyle;
425
- if (cs) {
426
- uniforms.set(cs.fillColor, S.capFillColor);
427
- uniforms.set(cs.strokeColor, S.capStrokeColor);
428
- uniforms[S.params + 0] = cs.patternId;
429
- uniforms[S.params + 1] = cs.spacingPx;
430
- uniforms[S.params + 2] = cs.angleRad;
431
- uniforms[S.params + 3] = cs.widthPx;
432
- uniforms[S.params2 + 0] = cs.secondaryAngleRad;
433
- }
434
- else {
435
- // Sensible defaults when caller omits style (e.g. legacy lines-only
436
- // use): solid fill using a warm-paper colour, no hatch.
437
- uniforms.set([0.92, 0.88, 0.78, 1], S.capFillColor);
438
- uniforms.set([0.10, 0.10, 0.10, 1], S.capStrokeColor);
439
- uniforms[S.params + 0] = 0; // solid pattern
440
- uniforms[S.params + 1] = 8;
441
- uniforms[S.params + 2] = Math.PI / 4;
442
- uniforms[S.params + 3] = 1;
443
- uniforms[S.params2 + 0] = -Math.PI / 4;
444
- }
445
- // The section cut owns slot 0. Both draws below read it, which is correct:
446
- // the fill and the outline are one drawing with one plane offset and one
447
- // style. What they must NOT share is the record the world-space line
448
- // families write, whose zeroed cap-style tail would otherwise arrive here.
449
- const capOffset = SECTION_2D_UNIFORM_SLOT_INDEX.sectionCut * this.uniformStride;
450
- this.device.queue.writeBuffer(this.uniformBuffer, capOffset, uniforms);
451
- // Filled polygons = the 3D section cap. Render them ONLY when the
452
- // caller opts in (`showFills: true` + a capStyle). This replaces the
453
- // old stencil-parity cap, which leaked hatch into empty sky on non-
454
- // manifold IFC geometry. The polygons here come from exact triangle-
455
- // plane intersection in `SectionCutter`, so the silhouette is
456
- // mathematically correct.
457
- if (options.showFills === true &&
458
- options.capStyle &&
459
- this.fillVertexBuffer &&
460
- this.fillIndexBuffer &&
461
- this.fillIndexCount > 0) {
462
- pass.setPipeline(this.fillPipeline);
463
- pass.setBindGroup(0, this.bindGroup, [capOffset]);
464
- pass.setVertexBuffer(0, this.fillVertexBuffer);
465
- pass.setIndexBuffer(this.fillIndexBuffer, 'uint32');
466
- pass.drawIndexed(this.fillIndexCount);
467
- // Then its depth, colour-masked, for the post passes (section-cap-pipelines.ts).
468
- pass.setPipeline(this.fillDepthPipeline);
469
- pass.drawIndexed(this.fillIndexCount);
470
- }
471
- // Outline lines on top of the fill. Gated by `showOutlines` so the
472
- // user can toggle surfaces and outlines independently from the UI.
473
- // Defaults to true when the caller omits the flag.
474
- if (options.showOutlines !== false &&
475
- this.lineVertexBuffer &&
476
- this.lineVertexCount > 0) {
477
- pass.setPipeline(this.linePipeline);
478
- pass.setBindGroup(0, this.bindGroup, [capOffset]);
479
- pass.setVertexBuffer(0, this.lineVertexBuffer);
480
- pass.draw(this.lineVertexCount);
481
- }
417
+ this.caps.drawExtras(pass, resources, options, caps);
482
418
  }
483
419
  /**
484
420
  * Dispose of GPU resources.
@@ -492,7 +428,7 @@ export class Section2DOverlayRenderer {
492
428
  * is named separately because it is not a channel.
493
429
  */
494
430
  dispose() {
495
- this.clearGeometry();
431
+ this.caps.dispose();
496
432
  for (const channel of LINE_OVERLAY_CHANNELS)
497
433
  this.lineOverlays[channel].clear();
498
434
  this.clearClashBoxLines3D();
@@ -502,6 +438,12 @@ export class Section2DOverlayRenderer {
502
438
  }
503
439
  // Pipeline and bind-group objects belong to this initialization epoch.
504
440
  // A later upload on the same instance must rebuild all of them together.
441
+ if (this.clipBuffer) {
442
+ this.clipBuffer.destroy();
443
+ this.clipBuffer = null;
444
+ }
445
+ this.clipBindGroup = null;
446
+ this.capLinePipeline = null;
505
447
  this.fillPipeline = null;
506
448
  this.fillDepthPipeline = null;
507
449
  this.linePipeline = null;
@@ -1 +1 @@
1
- {"version":3,"file":"section-2d-overlay.js","sourceRoot":"","sources":["../src/section-2d-overlay.ts"],"names":[],"mappings":"AAAA;;+D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1B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACzB,CAAC;QACD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;QAC5B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;QAC9B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;QAC/B,IAAI,CAAC,sBAAsB,GAAG,IAAI,CAAC;QACnC,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;QAC5B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC;QACvB,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;IAC3B,CAAC;CACF"}
@@ -11,6 +11,8 @@ export interface Section2DOverlayCapStyle {
11
11
  secondaryAngleRad: number;
12
12
  }
13
13
  export interface Section2DOverlayOptions {
14
+ /** Scene ids whose pre-uploaded cut polygons and owned outlines must not draw. */
15
+ sectionExcludedIds?: ReadonlySet<number>;
14
16
  axis: 'down' | 'front' | 'side';
15
17
  position: number;
16
18
  bounds: {
@@ -1 +1 @@
1
- {"version":3,"file":"section-2d-types.d.ts","sourceRoot":"","sources":["../src/section-2d-types.ts"],"names":[],"mappings":"AAIA,6EAA6E;AAE7E,eAAO,MAAM,qBAAqB,8EAA+E,CAAC;AAClH,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAExE,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,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E,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,uBAAuB;IACtC,kFAAkF;IAClF,kBAAkB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACzC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE;QAAE,GAAG,EAAE;YAAE,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;QAAC,GAAG,EAAE;YAAE,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;IAC/F,QAAQ,EAAE,YAAY,CAAC;IACvB,WAAW,CAAC,EAAE,YAAY,CAAC;IAC3B,SAAS,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,wBAAwB,CAAC;IACpC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB"}
@@ -0,0 +1,33 @@
1
+ import { type CapHighlight, type CutPolygon2D, type DrawingLine2D, type SectionAxis, type SectionCustomPlane } from './section-2d-lift.js';
2
+ /** One cap's GPU geometry: the filled polygons and their outline. */
3
+ export declare class CapGeometry {
4
+ private source;
5
+ private sourceHasGeometry;
6
+ private excluded;
7
+ fillVertexBuffer: GPUBuffer | null;
8
+ fillIndexBuffer: GPUBuffer | null;
9
+ fillIndexCount: number;
10
+ lineVertexBuffer: GPUBuffer | null;
11
+ lineVertexCount: number;
12
+ /** f64 cap anchor retained separately from the local cap vertices. */
13
+ anchor: [number, number, number] | null;
14
+ /** The fill vertices as built (before any highlight) and each polygon's slice of them. */
15
+ private fillSource;
16
+ private fillRanges;
17
+ /** The highlight last written to {@link fillVertexBuffer}; compared by content. */
18
+ private appliedHighlight;
19
+ setExclusions(device: GPUDevice, highlight: CapHighlight | null, ids?: ReadonlySet<number>): void;
20
+ /** Cached source can be redrawn when exclusions change, even if currently fully excluded. */
21
+ has(): boolean;
22
+ /** Whether the current filtered buffers contain a fill or outline to submit. */
23
+ hasDrawable(): boolean;
24
+ clear(): void;
25
+ /**
26
+ * Paint the highlighted elements' polygons in their colour (`null` restores the
27
+ * cap as built). Rewrites the vertex buffer only when the highlight actually
28
+ * differs from what is already there.
29
+ */
30
+ setHighlight(device: GPUDevice, highlight: CapHighlight | null): void;
31
+ upload(device: GPUDevice, highlight: CapHighlight | null, polygons: CutPolygon2D[], lines: DrawingLine2D[], axis: SectionAxis, planePosition: number, flipped: boolean, customPlane?: SectionCustomPlane): void;
32
+ }
33
+ //# sourceMappingURL=section-cap-geometry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"section-cap-geometry.d.ts","sourceRoot":"","sources":["../src/section-cap-geometry.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,YAAY,EAAwB,KAAK,YAAY,EAAE,KAAK,aAAa,EAC9E,KAAK,WAAW,EAAE,KAAK,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1E,qEAAqE;AACrE,qBAAa,WAAW;IACtB,OAAO,CAAC,MAAM,CAA0B;IACxC,OAAO,CAAC,iBAAiB,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAqB;IACrC,gBAAgB,EAAE,SAAS,GAAG,IAAI,CAAQ;IAC1C,eAAe,EAAE,SAAS,GAAG,IAAI,CAAQ;IACzC,cAAc,SAAK;IACnB,gBAAgB,EAAE,SAAS,GAAG,IAAI,CAAQ;IAC1C,eAAe,SAAK;IACpB,sEAAsE;IACtE,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAQ;IAC/C,0FAA0F;IAC1F,OAAO,CAAC,UAAU,CAA6B;IAC/C,OAAO,CAAC,UAAU,CAAyB;IAC3C,mFAAmF;IACnF,OAAO,CAAC,gBAAgB,CAA6B;IAErD,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,GAAG,IAAI,EAAE,GAAG,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,IAAI;IAYjG,6FAA6F;IAC7F,GAAG,IAAI,OAAO;IAId,gFAAgF;IAChF,WAAW,IAAI,OAAO;IAItB,KAAK,IAAI,IAAI;IAkBb;;;;OAIG;IACH,YAAY,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,GAAG,IAAI,GAAG,IAAI;IASrE,MAAM,CACJ,MAAM,EAAE,SAAS,EACjB,SAAS,EAAE,YAAY,GAAG,IAAI,EAC9B,QAAQ,EAAE,YAAY,EAAE,EACxB,KAAK,EAAE,aAAa,EAAE,EACtB,IAAI,EAAE,WAAW,EACjB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,OAAO,EAChB,WAAW,CAAC,EAAE,kBAAkB,GAC/B,IAAI;CAsDR"}
@@ -0,0 +1,137 @@
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 { buildCapFillGeometry, buildDrawingOutlineVertices, createSectionLift, recolorCapVertices } from './section-2d-lift.js';
5
+ /** One cap's GPU geometry: the filled polygons and their outline. */
6
+ export class CapGeometry {
7
+ source = null;
8
+ sourceHasGeometry = false;
9
+ excluded = new Set();
10
+ fillVertexBuffer = null;
11
+ fillIndexBuffer = null;
12
+ fillIndexCount = 0;
13
+ lineVertexBuffer = null;
14
+ lineVertexCount = 0;
15
+ /** f64 cap anchor retained separately from the local cap vertices. */
16
+ anchor = null;
17
+ /** The fill vertices as built (before any highlight) and each polygon's slice of them. */
18
+ fillSource = null;
19
+ fillRanges = [];
20
+ /** The highlight last written to {@link fillVertexBuffer}; compared by content. */
21
+ appliedHighlight = null;
22
+ setExclusions(device, highlight, ids) {
23
+ if (!this.source || (this.excluded.size === (ids?.size ?? 0) && [...this.excluded].every(id => ids?.has(id))))
24
+ return;
25
+ const source = this.source;
26
+ const sourceHasGeometry = this.sourceHasGeometry;
27
+ const [polygons, lines, ...plane] = source;
28
+ this.upload(device, highlight, polygons.filter(p => !ids?.has(p.expressId)), lines.filter(l => l.ownerId === undefined || !ids?.has(l.ownerId)), ...plane);
29
+ this.source = source;
30
+ this.sourceHasGeometry = sourceHasGeometry;
31
+ this.excluded = new Set(ids);
32
+ }
33
+ /** Cached source can be redrawn when exclusions change, even if currently fully excluded. */
34
+ has() {
35
+ return this.sourceHasGeometry;
36
+ }
37
+ /** Whether the current filtered buffers contain a fill or outline to submit. */
38
+ hasDrawable() {
39
+ return this.fillIndexCount > 0 || this.lineVertexCount > 0;
40
+ }
41
+ clear() {
42
+ this.source = null;
43
+ this.sourceHasGeometry = false;
44
+ this.excluded.clear();
45
+ this.fillVertexBuffer?.destroy();
46
+ this.fillIndexBuffer?.destroy();
47
+ this.lineVertexBuffer?.destroy();
48
+ this.fillVertexBuffer = null;
49
+ this.fillIndexBuffer = null;
50
+ this.lineVertexBuffer = null;
51
+ this.fillIndexCount = 0;
52
+ this.lineVertexCount = 0;
53
+ this.anchor = null;
54
+ this.fillSource = null;
55
+ this.fillRanges = [];
56
+ this.appliedHighlight = null;
57
+ }
58
+ /**
59
+ * Paint the highlighted elements' polygons in their colour (`null` restores the
60
+ * cap as built). Rewrites the vertex buffer only when the highlight actually
61
+ * differs from what is already there.
62
+ */
63
+ setHighlight(device, highlight) {
64
+ if (!this.fillVertexBuffer || !this.fillSource)
65
+ return;
66
+ const next = highlight && highlight.size > 0 ? highlight : null;
67
+ if (sameHighlight(this.appliedHighlight, next))
68
+ return;
69
+ // A copy: the caller may mutate and re-pass the same Map, which must still read as a change.
70
+ this.appliedHighlight = next && new Map(next);
71
+ device.queue.writeBuffer(this.fillVertexBuffer, 0, recolorCapVertices(this.fillSource, this.fillRanges, next) ?? this.fillSource);
72
+ }
73
+ upload(device, highlight, polygons, lines, axis, planePosition, flipped, customPlane) {
74
+ this.clear();
75
+ this.source = [polygons, lines, axis, planePosition, flipped, customPlane];
76
+ const lift = createSectionLift(axis, planePosition, flipped, customPlane);
77
+ const planeAnchor = customPlane
78
+ ? [...customPlane.origin]
79
+ : axis === 'side' ? [planePosition, 0, 0]
80
+ : axis === 'down' ? [0, planePosition, 0] : [0, 0, planePosition];
81
+ // The plane-coordinate anchor was enough when every model was near the
82
+ // origin. At a survey offset it leaves both in-plane coordinates absolute
83
+ // in the f32 vertex buffer, collapsing centimetre cap edges. Anchor at an
84
+ // actual lifted point instead, while retaining the old plane point for an
85
+ // empty upload that produces no vertex buffer to draw.
86
+ const firstPoint = polygons.find((polygon) => polygon.polygon.outer.length > 0)?.polygon.outer[0]
87
+ ?? lines[0]?.line.start;
88
+ const anchor = firstPoint ? lift(firstPoint.x, firstPoint.y) : planeAnchor;
89
+ // Lift/subtract while the coordinates are JS f64. Building a world-space
90
+ // Float32Array first then subtracting the cap anchor loses centimetre
91
+ // detail in both the plane normal and its in-plane axes at national-grid
92
+ // offsets.
93
+ const fill = buildCapFillGeometry(polygons, lift, anchor);
94
+ if (fill) {
95
+ this.fillVertexBuffer = device.createBuffer({
96
+ size: fill.vertices.byteLength,
97
+ usage: GPUBufferUsage.VERTEX | GPUBufferUsage.COPY_DST,
98
+ });
99
+ this.fillSource = fill.vertices;
100
+ this.fillRanges = fill.ranges;
101
+ const painted = recolorCapVertices(fill.vertices, fill.ranges, highlight);
102
+ // Cached even when nothing here matched, so the next frame's identical highlight is a no-op.
103
+ this.appliedHighlight = highlight && highlight.size > 0 ? new Map(highlight) : null;
104
+ device.queue.writeBuffer(this.fillVertexBuffer, 0, painted ?? fill.vertices);
105
+ this.fillIndexBuffer = device.createBuffer({
106
+ size: fill.indices.byteLength,
107
+ usage: GPUBufferUsage.INDEX | GPUBufferUsage.COPY_DST,
108
+ });
109
+ device.queue.writeBuffer(this.fillIndexBuffer, 0, fill.indices);
110
+ this.fillIndexCount = fill.indices.length;
111
+ }
112
+ const outline = buildDrawingOutlineVertices(polygons, lines, lift, anchor);
113
+ if (outline) {
114
+ this.lineVertexBuffer = device.createBuffer({
115
+ size: outline.byteLength,
116
+ usage: GPUBufferUsage.VERTEX | GPUBufferUsage.COPY_DST,
117
+ });
118
+ device.queue.writeBuffer(this.lineVertexBuffer, 0, outline);
119
+ this.lineVertexCount = outline.length / 3; // Each vertex is 3 floats
120
+ }
121
+ this.anchor = anchor;
122
+ this.sourceHasGeometry = this.hasDrawable();
123
+ }
124
+ }
125
+ function sameHighlight(a, b) {
126
+ if (a === null && b === null)
127
+ return true;
128
+ if (!a || !b || a.size !== b.size)
129
+ return false;
130
+ for (const [id, color] of a) {
131
+ const other = b.get(id);
132
+ if (!other || other[0] !== color[0] || other[1] !== color[1] || other[2] !== color[2] || other[3] !== color[3])
133
+ return false;
134
+ }
135
+ return true;
136
+ }
137
+ //# sourceMappingURL=section-cap-geometry.js.map