@ifc-lite/renderer 6.4.0 → 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 +18 -5
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +68 -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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"section-cap-geometry.js","sourceRoot":"","sources":["../src/section-cap-geometry.ts"],"names":[],"mappings":"AAAA;;+DAE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AS,aAAa,CAAC,CAAsB,EAAE,CAAsB;IACnE,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC1C,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI;QAAE,OAAO,KAAK,CAAC;IAChD,KAAK,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5B,MAAM,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACxB,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC;YAAE,OAAO,KAAK,CAAC;IAC/H,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,60 @@
1
+ import type { ExtraClipPlane } from './clip-types.js';
2
+ import { type CapHighlight, type CutPolygon2D, type DrawingLine2D, type SectionAxis, type SectionCustomPlane } from './section-2d-lift.js';
3
+ import type { Section2DOverlayOptions } from './section-2d-types.js';
4
+ /** What a cap draw borrows from `Section2DOverlayRenderer` for the duration of one frame. */
5
+ export interface CapDrawResources {
6
+ device: GPUDevice;
7
+ fillPipeline: GPURenderPipeline;
8
+ fillDepthPipeline: GPURenderPipeline;
9
+ /** The outline pipeline that clips like the fill (not the shared world-line pipeline). */
10
+ outlinePipeline: GPURenderPipeline;
11
+ bindGroup: GPUBindGroup;
12
+ uniformBuffer: GPUBuffer;
13
+ uniformStride: number;
14
+ /** Group 1: one extra-clip block per cap, addressed by dynamic offset. */
15
+ clipBindGroup: GPUBindGroup;
16
+ clipBuffer: GPUBuffer;
17
+ clipStride: number;
18
+ lineColor: readonly [number, number, number, number];
19
+ }
20
+ /** One extra plane's cap to draw: its key and the planes that clip it. */
21
+ export interface ExtraCapDraw {
22
+ key: string;
23
+ /** Every OTHER cutting plane (the primary one included), resolved in world space. */
24
+ clippedBy: readonly ExtraClipPlane[];
25
+ }
26
+ export declare class SectionCapSet {
27
+ private readonly primary;
28
+ private readonly extras;
29
+ private readonly uniforms;
30
+ private readonly clipScratch;
31
+ /** The elements whose cap is painted in a highlight colour; carried over every re-upload. */
32
+ private highlight;
33
+ /** Paint these elements' cap polygons in their colour on every cap; `null` clears. */
34
+ setHighlight(device: GPUDevice, highlight: CapHighlight | null): void;
35
+ /** Whether the primary cap has cached source, including geometry currently excluded. */
36
+ has(): boolean;
37
+ /** Whether an extra cap has cached source, including geometry currently excluded. */
38
+ hasExtras(): boolean;
39
+ /** The keys of the extra caps currently held. */
40
+ extraKeys(): string[];
41
+ upload(device: GPUDevice, key: string | null, ...args: [
42
+ CutPolygon2D[],
43
+ DrawingLine2D[],
44
+ SectionAxis,
45
+ number,
46
+ boolean,
47
+ SectionCustomPlane | undefined
48
+ ]): void;
49
+ /** Release the primary cap (`key` null) or one extra cap. */
50
+ clear(key: string | null): void;
51
+ /** Release every extra cap whose key is not in `keep`. */
52
+ clearExtrasExcept(keep: ReadonlySet<string>): void;
53
+ dispose(): void;
54
+ /** Draw the primary plane's cap, clipped by `clippedBy` (every extra cutting plane). */
55
+ draw(pass: GPURenderPassEncoder, res: CapDrawResources, options: Section2DOverlayOptions, clippedBy: readonly ExtraClipPlane[]): void;
56
+ /** Draw each listed extra plane's cap in its own uniform slot, with the cap style of the primary. */
57
+ drawExtras(pass: GPURenderPassEncoder, res: CapDrawResources, options: Section2DOverlayOptions, caps: readonly ExtraCapDraw[]): void;
58
+ private drawOne;
59
+ }
60
+ //# sourceMappingURL=section-cap-set.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"section-cap-set.d.ts","sourceRoot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AG,IAAI;IAMrE,wFAAwF;IACxF,GAAG,IAAI,OAAO;IAEd,qFAAqF;IACrF,SAAS,IAAI,OAAO;IAKpB,iDAAiD;IACjD,SAAS,IAAI,MAAM,EAAE;IAErB,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,IAAI,EAAE;QACrD,YAAY,EAAE;QAAE,aAAa,EAAE;QAAE,WAAW;QAAE,MAAM;QAAE,OAAO;QAAE,kBAAkB,GAAG,SAAS;KAC9F,GAAG,IAAI;IAYR,6DAA6D;IAC7D,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAM/B,0DAA0D;IAC1D,iBAAiB,CAAC,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,IAAI;IAIlD,OAAO,IAAI,IAAI;IAMf,wFAAwF;IACxF,IAAI,CACF,IAAI,EAAE,oBAAoB,EAC1B,GAAG,EAAE,gBAAgB,EACrB,OAAO,EAAE,uBAAuB,EAChC,SAAS,EAAE,SAAS,cAAc,EAAE,GACnC,IAAI;IAIP,qGAAqG;IACrG,UAAU,CACR,IAAI,EAAE,oBAAoB,EAC1B,GAAG,EAAE,gBAAgB,EACrB,OAAO,EAAE,uBAAuB,EAChC,IAAI,EAAE,SAAS,YAAY,EAAE,GAC5B,IAAI;IAUP,OAAO,CAAC,OAAO;CA4HhB"}
@@ -0,0 +1,212 @@
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 section cut caps (#7545): one per cutting plane.
6
+ *
7
+ * `Section2DOverlayRenderer` used to hold exactly one cap's vertex and index
8
+ * buffers and draw it; with several cutting planes there is one cap per plane,
9
+ * each lying on its own plane and each removed where ANOTHER plane cuts it away.
10
+ * This holds the cap geometry and the draw, and borrows every shared GPU
11
+ * resource (pipelines, the uniform buffer, the bind groups) per draw, exactly as
12
+ * `WorldLineBuffer` does, so `Section2DOverlayRenderer` stays the single owner
13
+ * of what it creates in `init()` and destroys in `dispose()` (issue #2456).
14
+ *
15
+ * The primary plane's cap keeps the section-cut uniform slot it always had; each
16
+ * extra plane's cap has a slot of its own (`SECTION_2D_UNIFORM_SLOT_INDEX.extraCap`
17
+ * and up). Alongside each cap's uniform goes the block of planes that clip it
18
+ * (`extra-clip-planes.ts`): every other cutting plane, never its own.
19
+ */
20
+ import { CapGeometry } from './section-cap-geometry.js';
21
+ import { packExtraClip, EXTRA_CLIP_FLOATS } from './extra-clip-planes.js';
22
+ import { tryPackRteDrawableDelta } from './relative-to-eye.js';
23
+ import { SECTION_2D_MAX_EXTRA_CAPS, SECTION_2D_UNIFORM_FLOATS, SECTION_2D_UNIFORM_SLOTS, SECTION_2D_UNIFORM_SLOT_INDEX, } from './shaders/section-2d-overlay.wgsl.js';
24
+ export class SectionCapSet {
25
+ primary = new CapGeometry();
26
+ extras = new Map();
27
+ uniforms = new Float32Array(SECTION_2D_UNIFORM_FLOATS);
28
+ clipScratch = new Float32Array(EXTRA_CLIP_FLOATS);
29
+ /** The elements whose cap is painted in a highlight colour; carried over every re-upload. */
30
+ highlight = null;
31
+ /** Paint these elements' cap polygons in their colour on every cap; `null` clears. */
32
+ setHighlight(device, highlight) {
33
+ this.highlight = highlight && highlight.size > 0 ? highlight : null;
34
+ this.primary.setHighlight(device, this.highlight);
35
+ for (const geometry of this.extras.values())
36
+ geometry.setHighlight(device, this.highlight);
37
+ }
38
+ /** Whether the primary cap has cached source, including geometry currently excluded. */
39
+ has() { return this.primary.has(); }
40
+ /** Whether an extra cap has cached source, including geometry currently excluded. */
41
+ hasExtras() {
42
+ for (const geometry of this.extras.values())
43
+ if (geometry.has())
44
+ return true;
45
+ return false;
46
+ }
47
+ /** The keys of the extra caps currently held. */
48
+ extraKeys() { return [...this.extras.keys()]; }
49
+ upload(device, key, ...args) {
50
+ if (key === null) {
51
+ this.primary.upload(device, this.highlight, ...args);
52
+ return;
53
+ }
54
+ // A plane past the capacity has no uniform slot to draw with.
55
+ if (!this.extras.has(key) && this.extras.size >= SECTION_2D_MAX_EXTRA_CAPS)
56
+ return;
57
+ let geometry = this.extras.get(key);
58
+ if (!geometry) {
59
+ geometry = new CapGeometry();
60
+ this.extras.set(key, geometry);
61
+ }
62
+ geometry.upload(device, this.highlight, ...args);
63
+ }
64
+ /** Release the primary cap (`key` null) or one extra cap. */
65
+ clear(key) {
66
+ if (key === null) {
67
+ this.primary.clear();
68
+ return;
69
+ }
70
+ this.extras.get(key)?.clear();
71
+ this.extras.delete(key);
72
+ }
73
+ /** Release every extra cap whose key is not in `keep`. */
74
+ clearExtrasExcept(keep) {
75
+ for (const key of [...this.extras.keys()])
76
+ if (!keep.has(key))
77
+ this.clear(key);
78
+ }
79
+ dispose() {
80
+ this.primary.clear();
81
+ for (const geometry of this.extras.values())
82
+ geometry.clear();
83
+ this.extras.clear();
84
+ }
85
+ /** Draw the primary plane's cap, clipped by `clippedBy` (every extra cutting plane). */
86
+ draw(pass, res, options, clippedBy) {
87
+ this.drawOne(pass, res, options, this.primary, SECTION_2D_UNIFORM_SLOT_INDEX.sectionCut, 0, clippedBy);
88
+ }
89
+ /** Draw each listed extra plane's cap in its own uniform slot, with the cap style of the primary. */
90
+ drawExtras(pass, res, options, caps) {
91
+ const keys = this.extraKeys();
92
+ for (const cap of caps) {
93
+ const geometry = this.extras.get(cap.key);
94
+ if (!geometry?.has())
95
+ continue;
96
+ const index = keys.indexOf(cap.key);
97
+ this.drawOne(pass, res, options, geometry, SECTION_2D_UNIFORM_SLOT_INDEX.extraCap + index, 1 + index, cap.clippedBy);
98
+ }
99
+ }
100
+ drawOne(pass, res, options, geometry, uniformSlot, clipSlot, clippedBy) {
101
+ geometry.setExclusions(res.device, this.highlight, options.sectionExcludedIds);
102
+ if (!geometry.hasDrawable())
103
+ return;
104
+ const { viewProj } = options;
105
+ // No offset — cap renders exactly on the section plane. The previous
106
+ // 0.3m bias was there to keep the outline lines clear of below-plane
107
+ // geometry, but it made the cap visually drift off the slider plane
108
+ // (users could see a 0.3m gap between the plane preview and the cap).
109
+ // The fill pipeline uses depthCompare 'greater-equal' (reverse-Z) so the
110
+ // cap ties cleanly with coincident below-plane top faces and is occluded
111
+ // by nearer model geometry — see the depthStencil comment in
112
+ // `section-cap-pipelines.ts`. There is no stencil test; the fill is restricted
113
+ // to the actual cap polygons by the triangle-plane intersection geometry
114
+ // `SectionCutter` produces, not by a stencil gate.
115
+ // Cap vertices are stored relative to the anchor so that the RTE path can
116
+ // retain their small in-plane residuals. The legacy view-projection path
117
+ // still transforms world coordinates, however, so it must add that anchor
118
+ // back through planeOffset. Leaving it zero placed every rebased legacy
119
+ // cap around the world origin. Do not combine the two: RTE adds this same
120
+ // anchor as an f64 split drawable delta below.
121
+ const anchor = geometry.anchor;
122
+ const rteViewProj = options.rteViewProj;
123
+ const rteCamera = options.rteCamera;
124
+ const rte = anchor !== null && rteViewProj !== undefined && rteCamera !== undefined;
125
+ const offset = anchor === null || rte ? [0, 0, 0] : anchor;
126
+ // Field offsets come from SECTION_2D_UNIFORM_SLOTS, which sits next to the
127
+ // WGSL struct it describes.
128
+ const S = SECTION_2D_UNIFORM_SLOTS;
129
+ const uniforms = this.uniforms;
130
+ uniforms.fill(0);
131
+ uniforms.set(viewProj, S.viewProj);
132
+ if (rte) {
133
+ uniforms.set(rteViewProj, S.rteViewProj);
134
+ // Outside this camera's RTE envelope: the cap and its outline, the only
135
+ // draws below, are not rasterisable this frame (#6128).
136
+ if (!tryPackRteDrawableDelta(anchor, rteCamera, uniforms, S.originDeltaHigh))
137
+ return;
138
+ uniforms[S.originDeltaHigh + 3] = 1;
139
+ }
140
+ uniforms.set(res.lineColor, S.lineColor); // section-cut outline colour
141
+ uniforms[S.planeOffset + 0] = offset[0];
142
+ uniforms[S.planeOffset + 1] = offset[1];
143
+ uniforms[S.planeOffset + 2] = offset[2];
144
+ const cs = options.capStyle;
145
+ if (cs) {
146
+ uniforms.set(cs.fillColor, S.capFillColor);
147
+ uniforms.set(cs.strokeColor, S.capStrokeColor);
148
+ uniforms[S.params + 0] = cs.patternId;
149
+ uniforms[S.params + 1] = cs.spacingPx;
150
+ uniforms[S.params + 2] = cs.angleRad;
151
+ uniforms[S.params + 3] = cs.widthPx;
152
+ uniforms[S.params2 + 0] = cs.secondaryAngleRad;
153
+ }
154
+ else {
155
+ // Sensible defaults when caller omits style (e.g. legacy lines-only
156
+ // use): solid fill using a warm-paper colour, no hatch.
157
+ uniforms.set([0.92, 0.88, 0.78, 1], S.capFillColor);
158
+ uniforms.set([0.10, 0.10, 0.10, 1], S.capStrokeColor);
159
+ uniforms[S.params + 0] = 0; // solid pattern
160
+ uniforms[S.params + 1] = 8;
161
+ uniforms[S.params + 2] = Math.PI / 4;
162
+ uniforms[S.params + 3] = 1;
163
+ uniforms[S.params2 + 0] = -Math.PI / 4;
164
+ }
165
+ // Each cap owns its slot. Both draws below read it, which is correct: the
166
+ // fill and the outline are one drawing with one plane offset and one style.
167
+ // What they must NOT share is the record the world-space line families
168
+ // write, whose zeroed cap-style tail would otherwise arrive here.
169
+ // The planes that remove this cap's fragments, in the frame the shader works in
170
+ // (eye-relative on the RTE path, world otherwise). Written first: the cap's own
171
+ // uniform record stays the last write of the draw.
172
+ packExtraClip(clippedBy, rte ? rteCamera : null, this.clipScratch, 0);
173
+ const clipOffset = clipSlot * res.clipStride;
174
+ res.device.queue.writeBuffer(res.clipBuffer, clipOffset, this.clipScratch);
175
+ const uniformOffset = uniformSlot * res.uniformStride;
176
+ res.device.queue.writeBuffer(res.uniformBuffer, uniformOffset, uniforms);
177
+ // Filled polygons = the 3D section cap. Render them ONLY when the
178
+ // caller opts in (`showFills: true` + a capStyle). This replaces the
179
+ // old stencil-parity cap, which leaked hatch into empty sky on non-
180
+ // manifold IFC geometry. The polygons here come from exact triangle-
181
+ // plane intersection in `SectionCutter`, so the silhouette is
182
+ // mathematically correct.
183
+ if (options.showFills === true &&
184
+ options.capStyle &&
185
+ geometry.fillVertexBuffer &&
186
+ geometry.fillIndexBuffer &&
187
+ geometry.fillIndexCount > 0) {
188
+ pass.setPipeline(res.fillPipeline);
189
+ pass.setBindGroup(0, res.bindGroup, [uniformOffset]);
190
+ pass.setBindGroup(1, res.clipBindGroup, [clipOffset]);
191
+ pass.setVertexBuffer(0, geometry.fillVertexBuffer);
192
+ pass.setIndexBuffer(geometry.fillIndexBuffer, 'uint32');
193
+ pass.drawIndexed(geometry.fillIndexCount);
194
+ // Then its depth, colour-masked, for the post passes (section-cap-pipelines.ts).
195
+ pass.setPipeline(res.fillDepthPipeline);
196
+ pass.drawIndexed(geometry.fillIndexCount);
197
+ }
198
+ // Outline lines on top of the fill. Gated by `showOutlines` so the
199
+ // user can toggle surfaces and outlines independently from the UI.
200
+ // Defaults to true when the caller omits the flag.
201
+ if (options.showOutlines !== false &&
202
+ geometry.lineVertexBuffer &&
203
+ geometry.lineVertexCount > 0) {
204
+ pass.setPipeline(res.outlinePipeline);
205
+ pass.setBindGroup(0, res.bindGroup, [uniformOffset]);
206
+ pass.setBindGroup(1, res.clipBindGroup, [clipOffset]);
207
+ pass.setVertexBuffer(0, geometry.lineVertexBuffer);
208
+ pass.draw(geometry.lineVertexCount);
209
+ }
210
+ }
211
+ }
212
+ //# sourceMappingURL=section-cap-set.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"section-cap-set.js","sourceRoot":"","sources":["../src/section-cap-set.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE1E,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,wBAAwB,EACxB,6BAA6B,GAC9B,MAAM,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C,CAAC,CAAC;YACtD,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE,QAAQ,CAAC,gBAAgB,CAAC,CAAC;YACnD,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;CACF"}
@@ -25,6 +25,9 @@ export declare const HATCH_PATTERN_IDS: {
25
25
  };
26
26
  export type HatchPatternId = keyof typeof HATCH_PATTERN_IDS;
27
27
  export interface SectionCapStyle {
28
+ /** Cap fill source preference, persisted with the style. The renderer does not read it: the app's cap conversion (`capOverlayInput`)
29
+ * uses it to give each polygon its element colour (`'element'`) or leave it to the uniform fill (`'uniform'`, default). */
30
+ fillMode?: 'uniform' | 'element';
28
31
  fillColor: [number, number, number, number];
29
32
  strokeColor: [number, number, number, number];
30
33
  pattern: HatchPatternId;
@@ -1 +1 @@
1
- {"version":3,"file":"section-cap-style.d.ts","sourceRoot":"","sources":["../src/section-cap-style.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;CASpB,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,iBAAiB,CAAC;AAE5D,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACpD,WAAW,EAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACpD,OAAO,EAAY,cAAc,CAAC;IAClC,SAAS,EAAU,MAAM,CAAC;IAC1B,QAAQ,EAAW,MAAM,CAAC;IAC1B,OAAO,EAAY,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,iBAAiB,EAAE,eAQ/B,CAAC"}
1
+ {"version":3,"file":"section-cap-style.d.ts","sourceRoot":"","sources":["../src/section-cap-style.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;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I,CAAC,EAAE,GAAG,CAAC,EAAe,MAAM;IACnD,OAAO,EAAY,GAAG;IACtB,iBAAiB,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC;CAChC,CAAC"}
1
+ {"version":3,"file":"section-cap-style.js","sourceRoot":"","sources":["../src/section-cap-style.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;GAcG;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,KAAK,EAAQ,CAAC;IACd,QAAQ,EAAK,CAAC;IACd,UAAU,EAAG,CAAC;IACd,UAAU,EAAG,CAAC;IACd,QAAQ,EAAK,CAAC;IACd,QAAQ,EAAK,CAAC;IACd,KAAK,EAAQ,CAAC;IACd,UAAU,EAAG,CAAC;CACN,CAAC;AAiBX,MAAM,CAAC,MAAM,iBAAiB,GAAoB;IAChD,SAAS,EAAU,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,EAAG,aAAa;IAC1D,WAAW,EAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,EAAG,MAAM;IACnD,OAAO,EAAY,UAAU;IAC7B,SAAS,EAAU,CAAC;IACpB,QAAQ,EAAW,IAAI,CAAC,EAAE,GAAG,CAAC,EAAe,MAAM;IACnD,OAAO,EAAY,GAAG;IACtB,iBAAiB,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC;CAChC,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { Section2DOverlayRenderer, CutPolygon2D, DrawingLine2D } from './section-2d-overlay.js';
2
+ import type { ModelBounds } from './render-section-draw.js';
3
+ type CustomPlane = {
4
+ origin: [number, number, number];
5
+ tangent: [number, number, number];
6
+ bitangent: [number, number, number];
7
+ };
8
+ /** True when overlay geometry changed (the caller then asks for a frame); false for the early returns that leave it untouched. */
9
+ export declare function uploadSectionCap(overlay: Section2DOverlayRenderer, modelBounds: ModelBounds | null, planeId: string | undefined, polygons: CutPolygon2D[], lines: DrawingLine2D[], axis: 'down' | 'front' | 'side', position: number, // 0-100 percentage
10
+ sectionRange: {
11
+ min?: number;
12
+ max?: number;
13
+ } | undefined, // Same storey-based range as section plane
14
+ flipped: boolean, customPlane?: CustomPlane): boolean;
15
+ export {};
16
+ //# sourceMappingURL=section-cap-upload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"section-cap-upload.d.ts","sourceRoot":"","sources":["../src/section-cap-upload.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,wBAAwB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACrG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D,KAAK,WAAW,GAAG;IAAE,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,CAAC;AAEhI,kIAAkI;AAClI,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,wBAAwB,EACjC,WAAW,EAAE,WAAW,GAAG,IAAI,EAC/B,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,QAAQ,EAAE,YAAY,EAAE,EACxB,KAAK,EAAE,aAAa,EAAE,EACtB,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,EAC/B,QAAQ,EAAE,MAAM,EAAE,mBAAmB;AACrC,YAAY,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,EAAE,2CAA2C;AACrG,OAAO,EAAE,OAAO,EAChB,WAAW,CAAC,EAAE,WAAW,GACxB,OAAO,CAuCT"}
@@ -0,0 +1,52 @@
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
+ * Where a section cap's 2D drawing lands in 3D (`Renderer.uploadSection2DOverlay`),
6
+ * lifted out of `RendererOverlays`: the cardinal drawing is lifted onto an
7
+ * axis-aligned plane at a world coordinate derived from the slider percentage and
8
+ * the SAME range formula the clip plane uses, and a face-picked plane carries its
9
+ * own basis. `planeId` keys the cap of a cutting plane beyond the first (#7545);
10
+ * without it the primary plane's cap is replaced, as it always was.
11
+ */
12
+ import { projectedBoundsRange } from './section-plane-resolve.js';
13
+ /** True when overlay geometry changed (the caller then asks for a frame); false for the early returns that leave it untouched. */
14
+ export function uploadSectionCap(overlay, modelBounds, planeId, polygons, lines, axis, position, // 0-100 percentage
15
+ sectionRange, // Same storey-based range as section plane
16
+ flipped, customPlane) {
17
+ const upload = (planePosition, custom) => (planeId === undefined
18
+ ? overlay.uploadDrawing(polygons, lines, axis, planePosition, flipped, custom)
19
+ : overlay.uploadExtraDrawing(planeId, polygons, lines, axis, planePosition, flipped, custom));
20
+ if (customPlane) {
21
+ // Custom-plane path: planePosition / axis are unused — the
22
+ // basis the cap shader needs travels in `customPlane`. We pass
23
+ // 0 for `planePosition` and the existing `axis` so the cardinal
24
+ // shader code path that callers depend on (e.g. legacy SVG
25
+ // export) keeps working when customPlane is omitted.
26
+ upload(0, customPlane);
27
+ return true;
28
+ }
29
+ // Same range formula as the clip plane (`resolveSectionPlaneFrame`),
30
+ // shared rather than copied — but deliberately evaluated against the
31
+ // UN-ROTATED axis normal, which is what makes the two agree instead of
32
+ // merely look alike (#2447).
33
+ //
34
+ // `planePosition` is not a plane distance here: `transform2Dto3D` lifts
35
+ // the cardinal drawing onto an AXIS-ALIGNED plane at that world
36
+ // coordinate (`side` -> `[planePosition, y, x]`), and the polygons it
37
+ // lifts were cut on that same axis-aligned plane upstream. Feeding it
38
+ // the rotated plane's distance would move the cap off the geometry it
39
+ // was cut from. A rotated or face-picked plane reaches the cap through
40
+ // `customPlane` above, which carries its own basis.
41
+ const axisNormal = axis === 'side' ? [1, 0, 0] : axis === 'down' ? [0, 1, 0] : [0, 0, 1];
42
+ // Allow upload if either sectionRange has both values, or modelBounds exists as fallback
43
+ const hasFullRange = sectionRange?.min !== undefined && sectionRange?.max !== undefined;
44
+ if (!hasFullRange && !modelBounds)
45
+ return false;
46
+ const axisRange = modelBounds ? projectedBoundsRange(modelBounds.min, modelBounds.max, axisNormal) : null;
47
+ const minVal = sectionRange?.min ?? axisRange.min;
48
+ const maxVal = sectionRange?.max ?? axisRange.max;
49
+ upload(minVal + (position / 100) * (maxVal - minVal));
50
+ return true;
51
+ }
52
+ //# sourceMappingURL=section-cap-upload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"section-cap-upload.js","sourceRoot":"","sources":["../src/section-cap-upload.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;GAOG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAMlE,kIAAkI;AAClI,MAAM,UAAU,gBAAgB,CAC9B,OAAiC,EACjC,WAA+B,EAC/B,OAA2B,EAC3B,QAAwB,EACxB,KAAsB,EACtB,IAA+B,EAC/B,QAAgB,EAAE,mBAAmB;AACrC,YAAwD,EAAE,2CAA2C;AACrG,OAAgB,EAChB,WAAyB;IAEzB,MAAM,MAAM,GAAG,CAAC,aAAqB,EAAE,MAAoB,EAAQ,EAAE,CAAC,CAAC,OAAO,KAAK,SAAS;QAC1F,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,CAAC;QAC9E,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;IAEhG,IAAI,WAAW,EAAE,CAAC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@@
1
+ import type { PickClipState } from './pick-types.js';
2
+ /** All section planes are exempted together; the crop box remains independent (#8015). */
3
+ export declare function entityClip(clip: PickClipState | null | undefined, id: number): PickClipState | null | undefined;
4
+ /** Sorted full scene ids: count followed by keys. No 24-bit aliasing across models. */
5
+ export declare function sectionExclusionImage(ids?: ReadonlySet<number> | null): Uint32Array;
6
+ export declare function sectionExclusions(device: GPUDevice): SectionExclusions;
7
+ export declare function withSectionExclusions(device: GPUDevice, layouts: GPUBindGroupLayout[]): GPUBindGroupLayout[];
8
+ declare class SectionExclusions {
9
+ private device;
10
+ readonly layout: GPUBindGroupLayout;
11
+ buffer: GPUBuffer;
12
+ bindGroup: GPUBindGroup;
13
+ private snapshot;
14
+ private owners;
15
+ private bytes;
16
+ constructor(device: GPUDevice);
17
+ retain(): void;
18
+ release(): void;
19
+ private allocate;
20
+ private bind;
21
+ update(ids?: ReadonlySet<number> | null): void;
22
+ }
23
+ /** Binary search is bounded by log2(count); the empty default reads just the count. */
24
+ export declare const sectionExclusionsWgsl = "\n@group(3) @binding(0) var<storage, read> sectionExcludedIds: array<u32>;\n// Scene colour buckets are partitioned by 2^24 ID page. Reject an invalid anchor.\nfn sectionEntityFromLane(anchor: u32, lane: u32) -> u32 {\n return select(anchor + ((lane - anchor) & 0x00FFFFFFu), 0xFFFFFFFFu, anchor == 0xFFFFFFFFu);\n}\nfn sectionExcluded(id: u32) -> bool {\n var lo = 0u;\n var hi = sectionExcludedIds[0];\n while (lo < hi) {\n let mid = lo + (hi - lo) / 2u;\n let key = sectionExcludedIds[mid + 1u];\n if (key == id) { return true; }\n if (key < id) { lo = mid + 1u; } else { hi = mid; }\n }\n return false;\n}\n";
25
+ export {};
26
+ //# sourceMappingURL=section-exclusions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"section-exclusions.d.ts","sourceRoot":"","sources":["../src/section-exclusions.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,0FAA0F;AAC1F,wBAAgB,UAAU,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI,GAAG,SAAS,EAAE,EAAE,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,GAAG,SAAS,CAE/G;AAED,uFAAuF;AACvF,wBAAgB,qBAAqB,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,IAAI,GAAG,WAAW,CAKnF;AAKD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,GAAG,iBAAiB,CAItE;AACD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,kBAAkB,EAAE,GAAG,kBAAkB,EAAE,CAG5G;AACD,cAAM,iBAAiB;IAOT,OAAO,CAAC,MAAM;IAN1B,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;IACpC,MAAM,EAAE,SAAS,CAAC;IAClB,SAAS,EAAE,YAAY,CAAC;IACxB,OAAO,CAAC,QAAQ,CAAqB;IACrC,OAAO,CAAC,MAAM,CAAK;IACnB,OAAO,CAAC,KAAK,CAAK;gBACE,MAAM,EAAE,SAAS;IAKrC,MAAM,IAAI,IAAI;IACd,OAAO,IAAI,IAAI;IAGf,OAAO,CAAC,QAAQ;IAGhB,OAAO,CAAC,IAAI;IAGZ,MAAM,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,IAAI,GAAG,IAAI;CAY/C;AAED,uFAAuF;AACvF,eAAO,MAAM,qBAAqB,0nBAiBjC,CAAC"}
@@ -0,0 +1,95 @@
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
+ /** All section planes are exempted together; the crop box remains independent (#8015). */
5
+ export function entityClip(clip, id) {
6
+ return clip?.sectionExcludedIds?.has(id) ? { clipBox: clip.clipBox } : clip;
7
+ }
8
+ /** Sorted full scene ids: count followed by keys. No 24-bit aliasing across models. */
9
+ export function sectionExclusionImage(ids) {
10
+ const keys = [...(ids ?? [])].filter(id => Number.isInteger(id) && id >= 0 && id < 0xFFFFFFFF).sort((a, b) => a - b);
11
+ const image = new Uint32Array(keys.length + 1);
12
+ image[0] = keys.length;
13
+ image.set(keys, 1);
14
+ return image;
15
+ }
16
+ // One table per device submission, shared by colour, masks, shadow and picking.
17
+ // Owners retain/release it; mask passes borrow it while the renderer is alive.
18
+ const tables = new WeakMap();
19
+ export function sectionExclusions(device) {
20
+ let table = tables.get(device);
21
+ if (!table) {
22
+ table = new SectionExclusions(device);
23
+ tables.set(device, table);
24
+ }
25
+ return table;
26
+ }
27
+ export function withSectionExclusions(device, layouts) {
28
+ while (layouts.length < 3)
29
+ layouts.push(device.createBindGroupLayout({ entries: [] }));
30
+ return [...layouts, sectionExclusions(device).layout];
31
+ }
32
+ class SectionExclusions {
33
+ device;
34
+ layout;
35
+ buffer;
36
+ bindGroup;
37
+ snapshot = new Set();
38
+ owners = 0;
39
+ bytes = 4;
40
+ constructor(device) {
41
+ this.device = device;
42
+ this.layout = device.createBindGroupLayout({ entries: [{ binding: 0, visibility: GPUShaderStage.FRAGMENT, buffer: { type: 'read-only-storage' } }] });
43
+ this.buffer = this.allocate(4);
44
+ this.bindGroup = this.bind();
45
+ }
46
+ retain() { this.owners++; }
47
+ release() {
48
+ if (--this.owners === 0) {
49
+ this.buffer.destroy();
50
+ tables.delete(this.device);
51
+ }
52
+ }
53
+ allocate(size) {
54
+ return this.device.createBuffer({ label: 'section-excluded-ids', size, usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST });
55
+ }
56
+ bind() {
57
+ return this.device.createBindGroup({ layout: this.layout, entries: [{ binding: 0, resource: { buffer: this.buffer } }] });
58
+ }
59
+ update(ids) {
60
+ if (this.snapshot.size === (ids?.size ?? 0) && [...this.snapshot].every(id => ids?.has(id)))
61
+ return;
62
+ const image = sectionExclusionImage(ids);
63
+ const limit = Math.min(this.device.limits.maxStorageBufferBindingSize ?? 134217728, this.device.limits.maxBufferSize ?? 268435456);
64
+ if (image.byteLength > limit)
65
+ throw new RangeError('Section exclusions exceed the GPU storage buffer limit');
66
+ if (image.byteLength > this.bytes) {
67
+ this.buffer.destroy();
68
+ this.bytes = image.byteLength;
69
+ this.buffer = this.allocate(this.bytes);
70
+ this.bindGroup = this.bind();
71
+ }
72
+ this.device.queue.writeBuffer(this.buffer, 0, image);
73
+ this.snapshot = new Set(ids);
74
+ }
75
+ }
76
+ /** Binary search is bounded by log2(count); the empty default reads just the count. */
77
+ export const sectionExclusionsWgsl = `
78
+ @group(3) @binding(0) var<storage, read> sectionExcludedIds: array<u32>;
79
+ // Scene colour buckets are partitioned by 2^24 ID page. Reject an invalid anchor.
80
+ fn sectionEntityFromLane(anchor: u32, lane: u32) -> u32 {
81
+ return select(anchor + ((lane - anchor) & 0x00FFFFFFu), 0xFFFFFFFFu, anchor == 0xFFFFFFFFu);
82
+ }
83
+ fn sectionExcluded(id: u32) -> bool {
84
+ var lo = 0u;
85
+ var hi = sectionExcludedIds[0];
86
+ while (lo < hi) {
87
+ let mid = lo + (hi - lo) / 2u;
88
+ let key = sectionExcludedIds[mid + 1u];
89
+ if (key == id) { return true; }
90
+ if (key < id) { lo = mid + 1u; } else { hi = mid; }
91
+ }
92
+ return false;
93
+ }
94
+ `;
95
+ //# sourceMappingURL=section-exclusions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"section-exclusions.js","sourceRoot":"","sources":["../src/section-exclusions.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAI/D,0FAA0F;AAC1F,MAAM,UAAU,UAAU,CAAC,IAAsC,EAAE,EAAU;IAC3E,OAAO,IAAI,EAAE,kBAAkB,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAC9E,CAAC;AAED,uFAAuF;AACv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AAM,CAAC,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;CAiBpC,CAAC"}
@@ -0,0 +1,48 @@
1
+ import type { SectionPlane } from './types.js';
2
+ type Xyz = {
3
+ x: number;
4
+ y: number;
5
+ z: number;
6
+ };
7
+ /** One section plane in world space. */
8
+ export interface SectionPlaneFrame {
9
+ /** The plane's `id`, when it has one (the primary plane's too). */
10
+ id: string | null;
11
+ /** True for `RenderOptions.sectionPlane`; false for an entry of `extraSectionPlanes`. */
12
+ primary: boolean;
13
+ enabled: boolean;
14
+ flipped: boolean;
15
+ /** Unit normal, and `dot(p, normal) = distance` on the plane. */
16
+ normal: [number, number, number];
17
+ distance: number;
18
+ /** The model's centre projected onto the plane: where a handle sits. */
19
+ anchor: [number, number, number];
20
+ /**
21
+ * A square on the plane the clip uses (centred on `anchor`, sized from the model bounds), in winding
22
+ * order. It lies in the clipping plane exactly; the drawn preview quad of a rotated cardinal plane
23
+ * is axis-aligned instead, so place marks from `anchor` and the plane, not by matching that quad.
24
+ */
25
+ corners: [[number, number, number], [number, number, number], [number, number, number], [number, number, number]];
26
+ }
27
+ /** The inputs a frame was resolved from, kept by the renderer for the next query. */
28
+ export interface SectionFrameInput {
29
+ primary: SectionPlane | null;
30
+ extras: readonly SectionPlane[];
31
+ bounds: {
32
+ min: Xyz;
33
+ max: Xyz;
34
+ };
35
+ buildingRotation: number | undefined;
36
+ }
37
+ /** The anchor and quad of `dot(p, normal) = distance` across `bounds`, matching the preview quad's size. */
38
+ export declare function planeFrameGeometry(normal: readonly [number, number, number], distance: number, bounds: {
39
+ min: Xyz;
40
+ max: Xyz;
41
+ }): {
42
+ anchor: [number, number, number];
43
+ corners: SectionPlaneFrame['corners'];
44
+ };
45
+ /** Every plane of `input`, enabled or not, primary first. Seven extras at most, as the renderer clips. */
46
+ export declare function resolveSectionPlaneFrames(input: SectionFrameInput): SectionPlaneFrame[];
47
+ export {};
48
+ //# sourceMappingURL=section-plane-frames.d.ts.map
@@ -0,0 +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