@crystaldesign/real-time-viewer-next 26.14.0-beta.26 → 26.14.0-beta.28

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 (188) hide show
  1. package/build/esm/{DeckCutoutSubsystem-036a108a.js → DeckCutoutSubsystem-f730e3dd.js} +235 -97
  2. package/build/esm/{GpuPassTiming-2f4ce2ca.js → GpuPassTiming-9962c76e.js} +4 -3
  3. package/build/esm/{RoomShell-dd0b4568.js → RoomShell-0b090b63.js} +4 -3
  4. package/build/esm/{SunLensflare-fd8e41df.js → SunLensflare-4c164431.js} +8 -5
  5. package/build/esm/{WaterSurface-1b33fc73.js → WaterSurface-212b9520.js} +71 -26
  6. package/build/esm/{chipPlacement-6b82d471.js → chipPlacement-8ad0b83c.js} +1 -1
  7. package/build/esm/{coachChunk-6b35e349.js → coachChunk-79a6336b.js} +4 -3
  8. package/build/esm/{doorSwapChunk-9ee4befc.js → doorSwapChunk-2f659712.js} +5 -4
  9. package/build/esm/{index-a70c59aa.js → index-10214cbb.js} +15117 -10853
  10. package/build/esm/index.js +4 -3
  11. package/build/types/real-time-viewer-next/src/RealTimeRendererNext.d.ts +6 -0
  12. package/build/types/real-time-viewer-next/src/RealTimeRendererNext.d.ts.map +1 -1
  13. package/build/types/real-time-viewer-next/src/config/environment.config.d.ts +61 -1
  14. package/build/types/real-time-viewer-next/src/config/environment.config.d.ts.map +1 -1
  15. package/build/types/real-time-viewer-next/src/core/SceneRenderer.d.ts.map +1 -1
  16. package/build/types/real-time-viewer-next/src/core/camera/CameraController.d.ts.map +1 -1
  17. package/build/types/real-time-viewer-next/src/core/camera/cameraIntents.d.ts +27 -7
  18. package/build/types/real-time-viewer-next/src/core/camera/cameraIntents.d.ts.map +1 -1
  19. package/build/types/real-time-viewer-next/src/core/camera/cameraIntents.options.test.d.ts +2 -0
  20. package/build/types/real-time-viewer-next/src/core/camera/cameraIntents.options.test.d.ts.map +1 -0
  21. package/build/types/real-time-viewer-next/src/core/camera/partFocus.d.ts +82 -0
  22. package/build/types/real-time-viewer-next/src/core/camera/partFocus.d.ts.map +1 -0
  23. package/build/types/real-time-viewer-next/src/core/camera/partFocus.test.d.ts +2 -0
  24. package/build/types/real-time-viewer-next/src/core/camera/partFocus.test.d.ts.map +1 -0
  25. package/build/types/real-time-viewer-next/src/core/camera/poolBasin.d.ts +24 -0
  26. package/build/types/real-time-viewer-next/src/core/camera/poolBasin.d.ts.map +1 -0
  27. package/build/types/real-time-viewer-next/src/core/camera/poolBasin.test.d.ts +2 -0
  28. package/build/types/real-time-viewer-next/src/core/camera/poolBasin.test.d.ts.map +1 -0
  29. package/build/types/real-time-viewer-next/src/core/camera/stepTableInput.d.ts.map +1 -1
  30. package/build/types/real-time-viewer-next/src/core/camera/useCameraActions.d.ts.map +1 -1
  31. package/build/types/real-time-viewer-next/src/core/camera/useCameraConstraints.d.ts +5 -0
  32. package/build/types/real-time-viewer-next/src/core/camera/useCameraConstraints.d.ts.map +1 -1
  33. package/build/types/real-time-viewer-next/src/core/camera/usePartZoomFocus.d.ts +18 -0
  34. package/build/types/real-time-viewer-next/src/core/camera/usePartZoomFocus.d.ts.map +1 -0
  35. package/build/types/real-time-viewer-next/src/core/camera/useStepPartFollow.d.ts +6 -0
  36. package/build/types/real-time-viewer-next/src/core/camera/useStepPartFollow.d.ts.map +1 -0
  37. package/build/types/real-time-viewer-next/src/core/camera/useStepPartFollow.test.d.ts +2 -0
  38. package/build/types/real-time-viewer-next/src/core/camera/useStepPartFollow.test.d.ts.map +1 -0
  39. package/build/types/real-time-viewer-next/src/core/camera/zoomGlide.d.ts +34 -0
  40. package/build/types/real-time-viewer-next/src/core/camera/zoomGlide.d.ts.map +1 -0
  41. package/build/types/real-time-viewer-next/src/core/camera/zoomGlide.test.d.ts +2 -0
  42. package/build/types/real-time-viewer-next/src/core/camera/zoomGlide.test.d.ts.map +1 -0
  43. package/build/types/real-time-viewer-next/src/core/dimension-lines/DimensionLines3D.d.ts.map +1 -1
  44. package/build/types/real-time-viewer-next/src/core/dimension-lines/dimensionLineBuilders3D.d.ts +7 -5
  45. package/build/types/real-time-viewer-next/src/core/dimension-lines/dimensionLineBuilders3D.d.ts.map +1 -1
  46. package/build/types/real-time-viewer-next/src/core/dimension-lines/dimensionLines.config.d.ts +7 -0
  47. package/build/types/real-time-viewer-next/src/core/dimension-lines/dimensionLines.config.d.ts.map +1 -1
  48. package/build/types/real-time-viewer-next/src/core/elementParts/geometryPartPick.d.ts +11 -0
  49. package/build/types/real-time-viewer-next/src/core/elementParts/geometryPartPick.d.ts.map +1 -0
  50. package/build/types/real-time-viewer-next/src/core/elementParts/geometryPartPick.test.d.ts +2 -0
  51. package/build/types/real-time-viewer-next/src/core/elementParts/geometryPartPick.test.d.ts.map +1 -0
  52. package/build/types/real-time-viewer-next/src/core/elementParts/partNodes.d.ts +32 -0
  53. package/build/types/real-time-viewer-next/src/core/elementParts/partNodes.d.ts.map +1 -0
  54. package/build/types/real-time-viewer-next/src/core/elementParts/partNodes.test.d.ts +2 -0
  55. package/build/types/real-time-viewer-next/src/core/elementParts/partNodes.test.d.ts.map +1 -0
  56. package/build/types/real-time-viewer-next/src/core/environment/EnvironmentSceneLoader.d.ts +2 -2
  57. package/build/types/real-time-viewer-next/src/core/environment/EnvironmentSceneLoader.d.ts.map +1 -1
  58. package/build/types/real-time-viewer-next/src/core/environment/EnvironmentSunLensflare.d.ts.map +1 -1
  59. package/build/types/real-time-viewer-next/src/core/environment/SkydomeBackground.d.ts.map +1 -1
  60. package/build/types/real-time-viewer-next/src/core/environment/SkydomeBackground.test.d.ts.map +1 -1
  61. package/build/types/real-time-viewer-next/src/core/environment/SunLensflare.d.ts +3 -1
  62. package/build/types/real-time-viewer-next/src/core/environment/SunLensflare.d.ts.map +1 -1
  63. package/build/types/real-time-viewer-next/src/core/environment/deckCutout/articleFootprint.d.ts +7 -0
  64. package/build/types/real-time-viewer-next/src/core/environment/deckCutout/articleFootprint.d.ts.map +1 -1
  65. package/build/types/real-time-viewer-next/src/core/environment/deckCutout/collectDeckTriangles.d.ts.map +1 -1
  66. package/build/types/real-time-viewer-next/src/core/environment/dome.config.d.ts +22 -4
  67. package/build/types/real-time-viewer-next/src/core/environment/dome.config.d.ts.map +1 -1
  68. package/build/types/real-time-viewer-next/src/core/environment/lighting.config.d.ts +45 -0
  69. package/build/types/real-time-viewer-next/src/core/environment/lighting.config.d.ts.map +1 -1
  70. package/build/types/real-time-viewer-next/src/core/environment/scene.config.d.ts +74 -0
  71. package/build/types/real-time-viewer-next/src/core/environment/scene.config.d.ts.map +1 -1
  72. package/build/types/real-time-viewer-next/src/core/environment/undoAcesCurve.d.ts +9 -0
  73. package/build/types/real-time-viewer-next/src/core/environment/undoAcesCurve.d.ts.map +1 -0
  74. package/build/types/real-time-viewer-next/src/core/frameOrder.d.ts +7 -0
  75. package/build/types/real-time-viewer-next/src/core/frameOrder.d.ts.map +1 -1
  76. package/build/types/real-time-viewer-next/src/core/garden/EnvironmentMeadow.d.ts +10 -0
  77. package/build/types/real-time-viewer-next/src/core/garden/EnvironmentMeadow.d.ts.map +1 -0
  78. package/build/types/real-time-viewer-next/src/core/garden/EnvironmentTrees.d.ts +4 -0
  79. package/build/types/real-time-viewer-next/src/core/garden/EnvironmentTrees.d.ts.map +1 -0
  80. package/build/types/real-time-viewer-next/src/core/garden/billboardTrees.d.ts +12 -0
  81. package/build/types/real-time-viewer-next/src/core/garden/billboardTrees.d.ts.map +1 -0
  82. package/build/types/real-time-viewer-next/src/core/garden/forestLayout.d.ts +24 -0
  83. package/build/types/real-time-viewer-next/src/core/garden/forestLayout.d.ts.map +1 -0
  84. package/build/types/real-time-viewer-next/src/core/garden/forestLayout.test.d.ts +2 -0
  85. package/build/types/real-time-viewer-next/src/core/garden/forestLayout.test.d.ts.map +1 -0
  86. package/build/types/real-time-viewer-next/src/core/grass/EnvironmentGrass.d.ts +18 -0
  87. package/build/types/real-time-viewer-next/src/core/grass/EnvironmentGrass.d.ts.map +1 -0
  88. package/build/types/real-time-viewer-next/src/core/grass/grassNoise.d.ts +5 -0
  89. package/build/types/real-time-viewer-next/src/core/grass/grassNoise.d.ts.map +1 -0
  90. package/build/types/real-time-viewer-next/src/core/grass/lawnGrass.d.ts +68 -0
  91. package/build/types/real-time-viewer-next/src/core/grass/lawnGrass.d.ts.map +1 -0
  92. package/build/types/real-time-viewer-next/src/core/grass/lawnGrassReach.d.ts +30 -0
  93. package/build/types/real-time-viewer-next/src/core/grass/lawnGrassReach.d.ts.map +1 -0
  94. package/build/types/real-time-viewer-next/src/core/interaction/useElementInteraction.d.ts +1 -0
  95. package/build/types/real-time-viewer-next/src/core/interaction/useElementInteraction.d.ts.map +1 -1
  96. package/build/types/real-time-viewer-next/src/core/materials/textureCache.d.ts +16 -4
  97. package/build/types/real-time-viewer-next/src/core/materials/textureCache.d.ts.map +1 -1
  98. package/build/types/real-time-viewer-next/src/core/postprocessing/OpaqueOutput.d.ts +4 -0
  99. package/build/types/real-time-viewer-next/src/core/postprocessing/OpaqueOutput.d.ts.map +1 -0
  100. package/build/types/real-time-viewer-next/src/core/postprocessing/PostProcessingDynamicEffects.d.ts.map +1 -1
  101. package/build/types/real-time-viewer-next/src/core/postprocessing/PostProcessingStack.d.ts.map +1 -1
  102. package/build/types/real-time-viewer-next/src/core/postprocessing/outlineMaskTuning.d.ts +22 -0
  103. package/build/types/real-time-viewer-next/src/core/postprocessing/outlineMaskTuning.d.ts.map +1 -0
  104. package/build/types/real-time-viewer-next/src/core/postprocessing/outlineMaskTuning.test.d.ts +2 -0
  105. package/build/types/real-time-viewer-next/src/core/postprocessing/outlineMaskTuning.test.d.ts.map +1 -0
  106. package/build/types/real-time-viewer-next/src/core/postprocessing/postProcessing.config.d.ts +32 -0
  107. package/build/types/real-time-viewer-next/src/core/postprocessing/postProcessing.config.d.ts.map +1 -1
  108. package/build/types/real-time-viewer-next/src/core/reflection/EnvironmentMirrors.d.ts +15 -0
  109. package/build/types/real-time-viewer-next/src/core/reflection/EnvironmentMirrors.d.ts.map +1 -0
  110. package/build/types/real-time-viewer-next/src/core/reflection/glassPlanes.d.ts +10 -0
  111. package/build/types/real-time-viewer-next/src/core/reflection/glassPlanes.d.ts.map +1 -0
  112. package/build/types/real-time-viewer-next/src/core/reflection/glassPlanes.test.d.ts +2 -0
  113. package/build/types/real-time-viewer-next/src/core/reflection/glassPlanes.test.d.ts.map +1 -0
  114. package/build/types/real-time-viewer-next/src/core/reflection/mirrorCrop.d.ts +36 -0
  115. package/build/types/real-time-viewer-next/src/core/reflection/mirrorCrop.d.ts.map +1 -0
  116. package/build/types/real-time-viewer-next/src/core/reflection/mirrorCrop.test.d.ts +2 -0
  117. package/build/types/real-time-viewer-next/src/core/reflection/mirrorCrop.test.d.ts.map +1 -0
  118. package/build/types/real-time-viewer-next/src/core/reflection/mirrorSurfaces.d.ts +30 -0
  119. package/build/types/real-time-viewer-next/src/core/reflection/mirrorSurfaces.d.ts.map +1 -1
  120. package/build/types/real-time-viewer-next/src/core/reflection/mirrorSurfaces.test.d.ts.map +1 -1
  121. package/build/types/real-time-viewer-next/src/core/reflection/reflectionRegistry.d.ts +15 -0
  122. package/build/types/real-time-viewer-next/src/core/reflection/reflectionRegistry.d.ts.map +1 -1
  123. package/build/types/real-time-viewer-next/src/core/reflection/softReflection.d.ts +5 -0
  124. package/build/types/real-time-viewer-next/src/core/reflection/softReflection.d.ts.map +1 -0
  125. package/build/types/real-time-viewer-next/src/core/renderer.config.d.ts +21 -0
  126. package/build/types/real-time-viewer-next/src/core/renderer.config.d.ts.map +1 -1
  127. package/build/types/real-time-viewer-next/src/core/water/RefractionCapture.d.ts.map +1 -1
  128. package/build/types/real-time-viewer-next/src/core/water/SceneCapture.d.ts.map +1 -1
  129. package/build/types/real-time-viewer-next/src/core/water/WaterSurface.d.ts.map +1 -1
  130. package/build/types/real-time-viewer-next/src/core/water/WaterSurfaceRenderer.d.ts +3 -1
  131. package/build/types/real-time-viewer-next/src/core/water/WaterSurfaceRenderer.d.ts.map +1 -1
  132. package/build/types/real-time-viewer-next/src/core/water/water.config.d.ts +15 -0
  133. package/build/types/real-time-viewer-next/src/core/water/water.config.d.ts.map +1 -1
  134. package/build/types/real-time-viewer-next/src/core/water/waterShaders.d.ts.map +1 -1
  135. package/build/types/real-time-viewer-next/src/core/water/waterSurfaceMaterial.d.ts +1 -0
  136. package/build/types/real-time-viewer-next/src/core/water/waterSurfaceMaterial.d.ts.map +1 -1
  137. package/build/types/real-time-viewer-next/src/hooks/useHostPropsSync.d.ts.map +1 -1
  138. package/build/types/real-time-viewer-next/src/internals.d.ts +4 -0
  139. package/build/types/real-time-viewer-next/src/internals.d.ts.map +1 -1
  140. package/build/types/real-time-viewer-next/src/presets/pool-garden.d.ts +4 -0
  141. package/build/types/real-time-viewer-next/src/presets/pool-garden.d.ts.map +1 -0
  142. package/build/types/real-time-viewer-next/src/publicApi.d.ts +3 -0
  143. package/build/types/real-time-viewer-next/src/publicApi.d.ts.map +1 -1
  144. package/build/types/real-time-viewer-next/src/store/index.d.ts.map +1 -1
  145. package/build/types/real-time-viewer-next/src/store/shared.d.ts +6 -0
  146. package/build/types/real-time-viewer-next/src/store/shared.d.ts.map +1 -1
  147. package/build/types/real-time-viewer-next/src/store/slices/camera.d.ts +16 -1
  148. package/build/types/real-time-viewer-next/src/store/slices/camera.d.ts.map +1 -1
  149. package/build/types/real-time-viewer-next/src/store/slices/config.d.ts.map +1 -1
  150. package/build/types/real-time-viewer-next/src/store/slices/elementParts.d.ts +63 -0
  151. package/build/types/real-time-viewer-next/src/store/slices/elementParts.d.ts.map +1 -0
  152. package/build/types/real-time-viewer-next/src/store/slices/elementPartsPick.test.d.ts +5 -0
  153. package/build/types/real-time-viewer-next/src/store/slices/elementPartsPick.test.d.ts.map +1 -0
  154. package/build/types/real-time-viewer-next/src/store/slices/environment.d.ts +21 -2
  155. package/build/types/real-time-viewer-next/src/store/slices/environment.d.ts.map +1 -1
  156. package/build/types/real-time-viewer-next/src/store/slices/focusPartGeo.test.d.ts +5 -0
  157. package/build/types/real-time-viewer-next/src/store/slices/focusPartGeo.test.d.ts.map +1 -0
  158. package/build/types/real-time-viewer-next/src/store/slices/scene.d.ts +3 -0
  159. package/build/types/real-time-viewer-next/src/store/slices/scene.d.ts.map +1 -1
  160. package/build/types/real-time-viewer-next/src/store/slices/selection.d.ts.map +1 -1
  161. package/build/types/real-time-viewer-next/src/store/types.d.ts +7 -1
  162. package/build/types/real-time-viewer-next/src/store/types.d.ts.map +1 -1
  163. package/build/types/real-time-viewer-next/src/types/camera.d.ts +17 -0
  164. package/build/types/real-time-viewer-next/src/types/camera.d.ts.map +1 -1
  165. package/build/types/real-time-viewer-next/src/types/elementParts.d.ts +77 -0
  166. package/build/types/real-time-viewer-next/src/types/elementParts.d.ts.map +1 -0
  167. package/build/types/real-time-viewer-next/src/utils/cameraFraming.d.ts +3 -2
  168. package/build/types/real-time-viewer-next/src/utils/cameraFraming.d.ts.map +1 -1
  169. package/build/types/real-time-viewer-next/src/utils/footprintTrace.d.ts +24 -0
  170. package/build/types/real-time-viewer-next/src/utils/footprintTrace.d.ts.map +1 -1
  171. package/build/types/real-time-viewer-next/src/utils/geoTargets.d.ts +6 -1
  172. package/build/types/real-time-viewer-next/src/utils/geoTargets.d.ts.map +1 -1
  173. package/build/types/real-time-viewer-next/src/utils/gpuMemoryAudit.d.ts +17 -2
  174. package/build/types/real-time-viewer-next/src/utils/gpuMemoryAudit.d.ts.map +1 -1
  175. package/build/types/real-time-viewer-next/src/utils/gpuMemoryAudit.test.d.ts +2 -0
  176. package/build/types/real-time-viewer-next/src/utils/gpuMemoryAudit.test.d.ts.map +1 -0
  177. package/build/types/real-time-viewer-next/src/utils/textureSourceRelease.d.ts +7 -0
  178. package/build/types/real-time-viewer-next/src/utils/textureSourceRelease.d.ts.map +1 -1
  179. package/build/umd/114.real-time-viewer-next.umd.min.js +1 -1
  180. package/build/umd/177.real-time-viewer-next.umd.min.js +1 -1
  181. package/build/umd/187.real-time-viewer-next.umd.min.js +1 -1
  182. package/build/umd/207.real-time-viewer-next.umd.min.js +1 -1
  183. package/build/umd/391.real-time-viewer-next.umd.min.js +1 -1
  184. package/build/umd/422.real-time-viewer-next.umd.min.js +1 -1
  185. package/build/umd/498.real-time-viewer-next.umd.min.js +1 -1
  186. package/build/umd/real-time-viewer-next.umd.min.js +1 -1
  187. package/build/umd/report.html +1 -1
  188. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- import { ai as parseQualifiedElementKey, aj as resolveGeoNodes, ak as polygonSignedArea, al as simplifyClosedPolygon, am as ensureSimplePolygon, b as parseElementKey, an as useStableEnvSlice, u as useRTVStore, ao as bootPhase, ap as adoptPristineFadeState, aq as DECK_COLLAR_LOAD_ID } from './index-a70c59aa.js';
1
+ import { ai as parseQualifiedElementKey, aj as resolveGeoNodes, ak as polygonSignedArea, al as simplifyClosedPolygon, am as ensureSimplePolygon, b as parseElementKey, an as useStableEnvSlice, u as useRTVStore, ao as bootPhase, ap as adoptPristineFadeState, aq as DECK_COLLAR_LOAD_ID } from './index-10214cbb.js';
2
2
  import { useRef, useEffect, useMemo, useState, useCallback } from 'react';
3
3
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
4
4
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
@@ -20,6 +20,8 @@ import '@babel/runtime/helpers/possibleConstructorReturn';
20
20
  import '@babel/runtime/helpers/getPrototypeOf';
21
21
  import '@babel/runtime/helpers/inherits';
22
22
  import 'detect-gpu';
23
+ import '@babel/runtime/helpers/toArray';
24
+ import '@babel/runtime/helpers/construct';
23
25
  import 'three/examples/jsm/loaders/DRACOLoader.js';
24
26
  import 'three/examples/jsm/loaders/GLTFLoader.js';
25
27
  import '@react-three/drei';
@@ -30,15 +32,14 @@ import 'troika-three-text';
30
32
  import 'three/examples/jsm/lines/LineSegments2.js';
31
33
  import 'three/examples/jsm/lines/LineSegmentsGeometry.js';
32
34
  import 'three/examples/jsm/lines/LineMaterial.js';
33
- import '@babel/runtime/helpers/toArray';
34
- import '@babel/runtime/helpers/construct';
35
35
  import 'three/examples/jsm/environments/RoomEnvironment.js';
36
36
  import 'three/examples/jsm/loaders/RGBELoader.js';
37
37
  import 'three/examples/jsm/loaders/EXRLoader.js';
38
+ import 'three/examples/jsm/objects/GroundedSkybox.js';
38
39
  import '@react-three/postprocessing';
39
40
 
40
- function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
41
- function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
41
+ function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
42
+ function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
42
43
  function _createForOfIteratorHelper$7(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$7(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
43
44
  function _unsupportedIterableToArray$7(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$7(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$7(r, a) : void 0; } }
44
45
  function _arrayLikeToArray$7(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
@@ -210,13 +211,13 @@ function restrictToGeos(measurement, geoPrefix, geoAssets) {
210
211
  _iterator2.f();
211
212
  }
212
213
  if (_unionBox.isEmpty()) {
213
- return _objectSpread$1(_objectSpread$1({}, measurement), {}, {
214
+ return _objectSpread$2(_objectSpread$2({}, measurement), {}, {
214
215
  geoScope: "geos ".concat(geoPrefix, ": NONE matched \u2014 ").concat(describeArticleGeos(measurement, prefixes, geoAssets), " \u2014 measured the whole article")
215
216
  });
216
217
  }
217
218
  var worldBottomY = _unionBox.min.y;
218
219
  _unionBox.applyMatrix4(measurement.floorLocal);
219
- return _objectSpread$1(_objectSpread$1({}, measurement), {}, {
220
+ return _objectSpread$2(_objectSpread$2({}, measurement), {}, {
220
221
  rect: {
221
222
  minX: _unionBox.min.x,
222
223
  maxX: _unionBox.max.x,
@@ -528,6 +529,60 @@ var TARGET_MASK_CELLS = 4000000;
528
529
 
529
530
  /** What a trace did internally — see {@link TraceFootprintOptions.diagnostics}. */
530
531
 
532
+ /**
533
+ * Joins the water opening, grown by its clearance, to `mask` (the offset silhouette): the rim's top surface is rasterized on
534
+ * the same grid, its ring sealed like the silhouette, and what the ring encloses but does not cover is the opening. Returns
535
+ * the cells it added.
536
+ */
537
+ function keepOpeningClear(mask, nx, nz, closeRadius, opening, cell, fill) {
538
+ var ring = new Uint8Array(nx * nz);
539
+ fill(ring, opening.triangleXZ);
540
+ closeMask(ring, nx, nz, closeRadius);
541
+ var inside = ring.slice();
542
+ fillEnclosed(inside, nx, nz);
543
+ var found = false;
544
+ for (var i = 0; i < inside.length; i++) {
545
+ inside[i] = inside[i] && !ring[i] ? 1 : 0;
546
+ found || (found = inside[i] === 1);
547
+ }
548
+ var clearanceRadius = Math.round(opening.clearance / cell);
549
+ if (clearanceRadius >= 1) offsetMask(inside, nx, nz, clearanceRadius, true);
550
+ var added = 0;
551
+ for (var _i = 0; _i < mask.length; _i++) {
552
+ if (!inside[_i] || mask[_i]) continue;
553
+ mask[_i] = 1;
554
+ added += 1;
555
+ }
556
+ return {
557
+ added: added,
558
+ found: found
559
+ };
560
+ }
561
+
562
+ /** Where the contour of `mask`'s set cells would lie (marching squares runs along the cells' borders); undefined when empty. */
563
+ function maskBounds(mask, nx, nz, originX, originZ, cell) {
564
+ var minCol = nx;
565
+ var maxCol = -1;
566
+ var minRow = nz;
567
+ var maxRow = -1;
568
+ for (var iz = 0; iz < nz; iz++) {
569
+ for (var ix = 0; ix < nx; ix++) {
570
+ if (!mask[iz * nx + ix]) continue;
571
+ if (ix < minCol) minCol = ix;
572
+ if (ix > maxCol) maxCol = ix;
573
+ if (iz < minRow) minRow = iz;
574
+ if (iz > maxRow) maxRow = iz;
575
+ }
576
+ }
577
+ if (maxCol < 0) return undefined;
578
+ return {
579
+ minX: originX + minCol * cell,
580
+ maxX: originX + (maxCol + 1) * cell,
581
+ minZ: originZ + minRow * cell,
582
+ maxZ: originZ + (maxRow + 1) * cell
583
+ };
584
+ }
585
+
531
586
  /**
532
587
  * Trace the outer silhouette of a triangle soup already projected onto the
533
588
  * plane: `triangleXZ` holds 6 numbers per triangle (x0 z0 x1 z1 x2 z2). The
@@ -581,73 +636,77 @@ function traceFootprintFromTriangles(triangleXZ) {
581
636
  var cellOf = function cellOf(v, origin, n) {
582
637
  return Math.min(n - border - 1, Math.max(border, Math.floor((v - origin) / cell)));
583
638
  };
584
- var mark = function mark(x, z) {
585
- mask[cellOf(z, originZ, nz) * nx + cellOf(x, originX, nx)] = 1;
639
+ var mark = function mark(target, x, z) {
640
+ target[cellOf(z, originZ, nz) * nx + cellOf(x, originX, nx)] = 1;
586
641
  };
587
- for (var t = 0; t < triCount; t++) {
588
- var o = t * 6;
589
- var x0 = triangleXZ[o];
590
- var z0 = triangleXZ[o + 1];
591
- var x1 = triangleXZ[o + 2];
592
- var z1 = triangleXZ[o + 3];
593
- var x2 = triangleXZ[o + 4];
594
- var z2 = triangleXZ[o + 5];
595
- mark(x0, z0);
596
- mark(x1, z1);
597
- mark(x2, z2);
598
-
599
- // Edge sampling is only needed for SLIVERS — a triangle thinner than a
600
- // raster row can fall between row centers and be missed by the scanline
601
- // fill below. Fat triangles (the vast majority in a real mesh) are fully
602
- // covered by the fill, and skipping their edges is the difference between
603
- // a fine raster being affordable and not.
604
- var twiceArea = Math.abs((x1 - x0) * (z2 - z0) - (x2 - x0) * (z1 - z0));
605
- var longestEdge = Math.max(Math.hypot(x1 - x0, z1 - z0), Math.hypot(x2 - x1, z2 - z1), Math.hypot(x0 - x2, z0 - z2));
606
- var thickness = longestEdge > EPS$1 ? twiceArea / longestEdge : 0;
607
- if (thickness < cell * 1.5) {
608
- var edges = [[x0, z0, x1, z1], [x1, z1, x2, z2], [x2, z2, x0, z0]];
609
- for (var _i = 0, _edges = edges; _i < _edges.length; _i++) {
610
- var _edges$_i = _slicedToArray(_edges[_i], 4),
611
- ax = _edges$_i[0],
612
- az = _edges$_i[1],
613
- bx = _edges$_i[2],
614
- bz = _edges$_i[3];
615
- var steps = Math.ceil(Math.hypot(bx - ax, bz - az) / (cell * 0.7));
616
- for (var st = 1; st < steps; st++) {
617
- var f = st / steps;
618
- mark(ax + (bx - ax) * f, az + (bz - az) * f);
642
+ var fill = function fill(target, triangles) {
643
+ var count = Math.floor(triangles.length / 6);
644
+ for (var t = 0; t < count; t++) {
645
+ var o = t * 6;
646
+ var x0 = triangles[o];
647
+ var z0 = triangles[o + 1];
648
+ var x1 = triangles[o + 2];
649
+ var z1 = triangles[o + 3];
650
+ var x2 = triangles[o + 4];
651
+ var z2 = triangles[o + 5];
652
+ mark(target, x0, z0);
653
+ mark(target, x1, z1);
654
+ mark(target, x2, z2);
655
+
656
+ // Edge sampling is only needed for SLIVERS — a triangle thinner than a
657
+ // raster row can fall between row centers and be missed by the scanline
658
+ // fill below. Fat triangles (the vast majority in a real mesh) are fully
659
+ // covered by the fill, and skipping their edges is the difference between
660
+ // a fine raster being affordable and not.
661
+ var twiceArea = Math.abs((x1 - x0) * (z2 - z0) - (x2 - x0) * (z1 - z0));
662
+ var longestEdge = Math.max(Math.hypot(x1 - x0, z1 - z0), Math.hypot(x2 - x1, z2 - z1), Math.hypot(x0 - x2, z0 - z2));
663
+ var thickness = longestEdge > EPS$1 ? twiceArea / longestEdge : 0;
664
+ if (thickness < cell * 1.5) {
665
+ var edges = [[x0, z0, x1, z1], [x1, z1, x2, z2], [x2, z2, x0, z0]];
666
+ for (var _i2 = 0, _edges = edges; _i2 < _edges.length; _i2++) {
667
+ var _edges$_i = _slicedToArray(_edges[_i2], 4),
668
+ ax = _edges$_i[0],
669
+ az = _edges$_i[1],
670
+ bx = _edges$_i[2],
671
+ bz = _edges$_i[3];
672
+ var steps = Math.ceil(Math.hypot(bx - ax, bz - az) / (cell * 0.7));
673
+ for (var st = 1; st < steps; st++) {
674
+ var f = st / steps;
675
+ mark(target, ax + (bx - ax) * f, az + (bz - az) * f);
676
+ }
619
677
  }
620
678
  }
621
- }
622
- // Interior: scanline spans. Each raster row crosses a triangle in exactly
623
- // one x interval, so the row is filled with a single `fill()` — no
624
- // per-cell inside test, which is what makes a fine raster affordable.
625
- var cz0 = cellOf(Math.min(z0, z1, z2), originZ, nz);
626
- var cz1 = cellOf(Math.max(z0, z1, z2), originZ, nz);
627
- for (var iz = cz0; iz <= cz1; iz++) {
628
- var pz = originZ + (iz + 0.5) * cell;
629
- var xa = Infinity;
630
- var xb = -Infinity;
631
- // Half-open [lo, hi) span test per edge ⇒ exactly two crossings, no
632
- // double-count at shared vertices. Horizontal edges never cross.
633
- for (var e = 0; e < 3; e++) {
634
- var _ax = e === 0 ? x0 : e === 1 ? x1 : x2;
635
- var _az = e === 0 ? z0 : e === 1 ? z1 : z2;
636
- var _bx = e === 0 ? x1 : e === 1 ? x2 : x0;
637
- var _bz = e === 0 ? z1 : e === 1 ? z2 : z0;
638
- if (_az === _bz) continue;
639
- if (pz < Math.min(_az, _bz) || pz >= Math.max(_az, _bz)) continue;
640
- var _x = _ax + (pz - _az) / (_bz - _az) * (_bx - _ax);
641
- if (_x < xa) xa = _x;
642
- if (_x > xb) xb = _x;
679
+ // Interior: scanline spans. Each raster row crosses a triangle in exactly
680
+ // one x interval, so the row is filled with a single `fill()` — no
681
+ // per-cell inside test, which is what makes a fine raster affordable.
682
+ var cz0 = cellOf(Math.min(z0, z1, z2), originZ, nz);
683
+ var cz1 = cellOf(Math.max(z0, z1, z2), originZ, nz);
684
+ for (var iz = cz0; iz <= cz1; iz++) {
685
+ var pz = originZ + (iz + 0.5) * cell;
686
+ var xa = Infinity;
687
+ var xb = -Infinity;
688
+ // Half-open [lo, hi) span test per edge ⇒ exactly two crossings, no
689
+ // double-count at shared vertices. Horizontal edges never cross.
690
+ for (var e = 0; e < 3; e++) {
691
+ var _ax = e === 0 ? x0 : e === 1 ? x1 : x2;
692
+ var _az = e === 0 ? z0 : e === 1 ? z1 : z2;
693
+ var _bx = e === 0 ? x1 : e === 1 ? x2 : x0;
694
+ var _bz = e === 0 ? z1 : e === 1 ? z2 : z0;
695
+ if (_az === _bz) continue;
696
+ if (pz < Math.min(_az, _bz) || pz >= Math.max(_az, _bz)) continue;
697
+ var _x = _ax + (pz - _az) / (_bz - _az) * (_bx - _ax);
698
+ if (_x < xa) xa = _x;
699
+ if (_x > xb) xb = _x;
700
+ }
701
+ if (xa > xb) continue;
702
+ // Fill the cells whose CENTER lies inside the span.
703
+ var from = Math.max(border, Math.ceil((xa - originX) / cell - 0.5));
704
+ var to = Math.min(nx - border - 1, Math.floor((xb - originX) / cell - 0.5));
705
+ if (from <= to) target.fill(1, iz * nx + from, iz * nx + to + 1);
643
706
  }
644
- if (xa > xb) continue;
645
- // Fill the cells whose CENTER lies inside the span.
646
- var from = Math.max(border, Math.ceil((xa - originX) / cell - 0.5));
647
- var to = Math.min(nx - border - 1, Math.floor((xb - originX) / cell - 0.5));
648
- if (from <= to) mask.fill(1, iz * nx + from, iz * nx + to + 1);
649
707
  }
650
- }
708
+ };
709
+ fill(mask, triangleXZ);
651
710
  closeMask(mask, nx, nz, closeRadius);
652
711
  // Offset AFTER the closing: seams have to be sealed before the boundary is
653
712
  // moved, or the erosion widens them instead. An erosion strong enough to
@@ -662,10 +721,16 @@ function traceFootprintFromTriangles(triangleXZ) {
662
721
  var enclosedFilled = fillEnclosed(mask, nx, nz);
663
722
  if (offsetRadius >= 1) offsetMask(mask, nx, nz, offsetRadius, grow);
664
723
  var diag = options.diagnostics;
724
+ if (diag && options.opening) diag.offsetBounds = maskBounds(mask, nx, nz, originX, originZ, cell);
725
+ var opening = options.opening ? keepOpeningClear(mask, nx, nz, closeRadius, options.opening, cell, fill) : null;
726
+ if (diag && opening) {
727
+ diag.openingCells = opening.added;
728
+ diag.openingFound = opening.found;
729
+ }
665
730
  if (diag) {
666
731
  diag.enclosedFilled = enclosedFilled;
667
732
  var filled = 0;
668
- for (var _i2 = 0; _i2 < mask.length; _i2++) filled += mask[_i2];
733
+ for (var _i3 = 0; _i3 < mask.length; _i3++) filled += mask[_i3];
669
734
  diag.filledCells = filled;
670
735
  }
671
736
  var loops = marchingSquaresLoops(mask, nx, nz, originX, originZ, cell);
@@ -674,12 +739,12 @@ function traceFootprintFromTriangles(triangleXZ) {
674
739
  var best = loops[0];
675
740
  var bestArea = Math.abs(polygonSignedArea(best));
676
741
  var totalArea = bestArea;
677
- for (var _i3 = 1; _i3 < loops.length; _i3++) {
678
- var a = Math.abs(polygonSignedArea(loops[_i3]));
742
+ for (var _i4 = 1; _i4 < loops.length; _i4++) {
743
+ var a = Math.abs(polygonSignedArea(loops[_i4]));
679
744
  totalArea += a;
680
745
  if (a > bestArea) {
681
746
  bestArea = a;
682
- best = loops[_i3];
747
+ best = loops[_i4];
683
748
  }
684
749
  }
685
750
  var simplified = simplifyClosedPolygon(best, tolerance);
@@ -729,6 +794,8 @@ function matchArticleRule(rules, articleCodex) {
729
794
  return null;
730
795
  }
731
796
 
797
+ function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
798
+ function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
732
799
  function _createForOfIteratorHelper$4(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$4(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
733
800
  function _unsupportedIterableToArray$4(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$4(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$4(r, a) : void 0; } }
734
801
  function _arrayLikeToArray$4(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
@@ -739,6 +806,8 @@ function _arrayLikeToArray$4(r, a) { (null == a || a > r.length) && (a = r.lengt
739
806
  * so the finer grid costs a one-off, not per-frame work.
740
807
  */
741
808
  var GEOMETRY_FOOTPRINT_CELL = 0.005;
809
+ /** Metres below the article's top that still count as its rim's top surface: a rim sloping outward stays one ring. */
810
+ var RIM_TOP_BAND = 0.04;
742
811
 
743
812
  /**
744
813
  * Minimum share of the measured article extent a traced outline has to cover on
@@ -821,7 +890,8 @@ function pickArticleRule(rules, codexesByArea) {
821
890
  * meshes change; anchor moves are pure translations and reuse the cache.
822
891
  * Returns the outline in CURRENT floor-local coordinates.
823
892
  */
824
- function traceArticleFootprint(elements, floorLocal, rect, minLocalY, offset, diagnostics, cache, pendingLiftY) {
893
+ function traceArticleFootprint(elements, floorLocal, rect, minLocalY, offset, /** The rule's `openingClearance`: how far the cut stays onto the rim from the water opening. */
894
+ clearance, diagnostics, cache, pendingLiftY) {
825
895
  var meshes = [];
826
896
  var sigParts = [];
827
897
  var _iterator2 = _createForOfIteratorHelper$4(elements),
@@ -851,15 +921,15 @@ function traceArticleFootprint(elements, floorLocal, rect, minLocalY, offset, di
851
921
  // Vertical position decides which triangles clear the fixed slice plane, so the top belongs in
852
922
  // the signature. Signed with the POST-lift top: the pre-lift measure then produces the same
853
923
  // signature as the post-lift one and the second measure hits the cache instead of re-tracing.
854
- var signature = "".concat(minLocalY.toFixed(3), "|").concat((rect.maxY + pendingLiftY).toFixed(3), "|").concat(offset.toFixed(3), "|").concat(sizeX.toFixed(3), "x").concat(sizeY.toFixed(3), "x").concat(sizeZ.toFixed(3), "|").concat(sigParts.join(','));
924
+ var signature = "".concat(minLocalY.toFixed(3), "|").concat((rect.maxY + pendingLiftY).toFixed(3), "|").concat(offset.toFixed(3), "|").concat(clearance.toFixed(3), "|").concat(sizeX.toFixed(3), "x").concat(sizeY.toFixed(3), "x").concat(sizeZ.toFixed(3), "|").concat(sigParts.join(','));
855
925
  if (!cache.current || cache.current.signature !== signature) {
856
926
  var started = performance.now();
857
- var _vertexCount = 0;
927
+ var vertexCount = 0;
858
928
  // Transform every vertex once per mesh; triangles then index into the flat array. Kept per
859
929
  // mesh so the count pass below can re-scan triangles without re-transforming.
860
930
  var locals = meshes.map(function (mesh) {
861
931
  var pos = mesh.geometry.getAttribute('position');
862
- _vertexCount += pos.count;
932
+ vertexCount += pos.count;
863
933
  _meshToFloor.multiplyMatrices(floorLocal, mesh.matrixWorld);
864
934
  var local = new Float32Array(pos.count * 3);
865
935
  for (var i = 0; i < pos.count; i++) {
@@ -893,8 +963,8 @@ function traceArticleFootprint(elements, floorLocal, rect, minLocalY, offset, di
893
963
  }
894
964
  return count;
895
965
  };
896
- var _triCount = forEachSliceTriangle(null);
897
- var xz = new Float32Array(_triCount * 6);
966
+ var triCount = forEachSliceTriangle(null);
967
+ var xz = new Float32Array(triCount * 6);
898
968
  var write = 0;
899
969
  forEachSliceTriangle(function (ax, az, bx, bz, cx, cz) {
900
970
  xz[write] = ax;
@@ -905,11 +975,49 @@ function traceArticleFootprint(elements, floorLocal, rect, minLocalY, offset, di
905
975
  xz[write + 5] = cz;
906
976
  write += 6;
907
977
  });
978
+ // The rim's top surface: triangles all of whose corners lie near the top. Its ring's inside is the water opening.
979
+ var topY = -Infinity;
980
+ for (var i = 0; i < locals.length; i++) for (var v = 1; v < locals[i].length; v += 3) topY = Math.max(topY, locals[i][v]);
981
+ // Like the slice: count, then fill one exactly-sized array.
982
+ var forEachRimTopTriangle = function forEachRimTopTriangle(emit) {
983
+ var count = 0;
984
+ var floor = topY - RIM_TOP_BAND;
985
+ for (var m = 0; m < meshes.length; m++) {
986
+ var geometry = meshes[m].geometry;
987
+ var local = locals[m];
988
+ var index = geometry.index;
989
+ var triTotal = index ? Math.floor(index.count / 3) : Math.floor(geometry.getAttribute('position').count / 3);
990
+ for (var t = 0; t < triTotal; t++) {
991
+ var a = index ? index.getX(t * 3) : t * 3;
992
+ var b = index ? index.getX(t * 3 + 1) : t * 3 + 1;
993
+ var c = index ? index.getX(t * 3 + 2) : t * 3 + 2;
994
+ if (local[a * 3 + 1] < floor || local[b * 3 + 1] < floor || local[c * 3 + 1] < floor) continue;
995
+ count += 1;
996
+ if (emit) emit(local[a * 3], local[a * 3 + 2], local[b * 3], local[b * 3 + 2], local[c * 3], local[c * 3 + 2]);
997
+ }
998
+ }
999
+ return count;
1000
+ };
1001
+ var rimTopCount = clearance > 0 ? forEachRimTopTriangle(null) : 0;
1002
+ var rimTop = new Float32Array(rimTopCount * 6);
1003
+ var rimWrite = 0;
1004
+ if (rimTopCount > 0) {
1005
+ forEachRimTopTriangle(function (ax, az, bx, bz, cx, cz) {
1006
+ rimTop.set([ax, az, bx, bz, cx, cz], rimWrite);
1007
+ rimWrite += 6;
1008
+ });
1009
+ }
1010
+ var opening = rimTopCount > 0 ? {
1011
+ triangleXZ: rimTop,
1012
+ clearance: clearance
1013
+ } : undefined;
908
1014
  var traced = traceFootprintFromTriangles(xz, {
909
1015
  cellSize: GEOMETRY_FOOTPRINT_CELL,
910
1016
  offset: offset,
1017
+ opening: opening,
911
1018
  diagnostics: diagnostics
912
1019
  });
1020
+ var offsetBounds = opening && diagnostics.openingCells ? diagnostics.offsetBounds : undefined;
913
1021
  cache.current = {
914
1022
  signature: signature,
915
1023
  relPoints: traced.map(function (_ref) {
@@ -918,21 +1026,33 @@ function traceArticleFootprint(elements, floorLocal, rect, minLocalY, offset, di
918
1026
  z = _ref2[1];
919
1027
  return [x - rect.minX, z - rect.minZ];
920
1028
  }),
921
- triCount: _triCount,
922
- vertexCount: _vertexCount
1029
+ relOffsetBounds: offsetBounds ? {
1030
+ minX: offsetBounds.minX - rect.minX,
1031
+ maxX: offsetBounds.maxX - rect.minX,
1032
+ minZ: offsetBounds.minZ - rect.minZ,
1033
+ maxZ: offsetBounds.maxZ - rect.minZ
1034
+ } : null,
1035
+ openingMissed: clearance > 0 && diagnostics.openingFound !== true,
1036
+ triCount: triCount,
1037
+ vertexCount: vertexCount
923
1038
  };
924
- return {
925
- points: traced,
926
- triCount: _triCount,
927
- vertexCount: _vertexCount,
1039
+ return _objectSpread$1(_objectSpread$1({}, fromCache(cache.current, rect)), {}, {
928
1040
  retraced: true,
929
1041
  traceMs: performance.now() - started
930
- };
1042
+ });
931
1043
  }
932
- var _cache$current = cache.current,
933
- relPoints = _cache$current.relPoints,
934
- triCount = _cache$current.triCount,
935
- vertexCount = _cache$current.vertexCount;
1044
+ return _objectSpread$1(_objectSpread$1({}, fromCache(cache.current, rect)), {}, {
1045
+ retraced: false,
1046
+ traceMs: 0
1047
+ });
1048
+ }
1049
+ /** The cached trace placed at the article's current corner. */
1050
+ function fromCache(cached, rect) {
1051
+ var relPoints = cached.relPoints,
1052
+ b = cached.relOffsetBounds,
1053
+ openingMissed = cached.openingMissed,
1054
+ triCount = cached.triCount,
1055
+ vertexCount = cached.vertexCount;
936
1056
  return {
937
1057
  points: relPoints.map(function (_ref3) {
938
1058
  var _ref4 = _slicedToArray(_ref3, 2),
@@ -940,10 +1060,15 @@ function traceArticleFootprint(elements, floorLocal, rect, minLocalY, offset, di
940
1060
  z = _ref4[1];
941
1061
  return [x + rect.minX, z + rect.minZ];
942
1062
  }),
1063
+ offsetBounds: b ? {
1064
+ minX: b.minX + rect.minX,
1065
+ maxX: b.maxX + rect.minX,
1066
+ minZ: b.minZ + rect.minZ,
1067
+ maxZ: b.maxZ + rect.minZ
1068
+ } : null,
1069
+ openingMissed: openingMissed,
943
1070
  triCount: triCount,
944
- vertexCount: vertexCount,
945
- retraced: false,
946
- traceMs: 0
1071
+ vertexCount: vertexCount
947
1072
  };
948
1073
  }
949
1074
 
@@ -972,7 +1097,7 @@ function deriveArticleFootprint(measurement, rule, margin, cache) {
972
1097
  elementObjects = measurement.elementObjects;
973
1098
  var rawSizeX = rect.maxX - rect.minX;
974
1099
  var rawSizeZ = rect.maxZ - rect.minZ;
975
- var traced = traceArticleFootprint((_measurement$shapeNod = measurement.shapeNodes) !== null && _measurement$shapeNod !== void 0 ? _measurement$shapeNod : topLevelElements(elementObjects), floorLocal, rect, floorTopY - rule.footprintSliceDepth, margin, result.trace, cache, pendingLiftY);
1100
+ var traced = traceArticleFootprint((_measurement$shapeNod = measurement.shapeNodes) !== null && _measurement$shapeNod !== void 0 ? _measurement$shapeNod : topLevelElements(elementObjects), floorLocal, rect, floorTopY - rule.footprintSliceDepth, margin, rule.openingClearance, result.trace, cache, pendingLiftY);
976
1101
  var minX = Infinity;
977
1102
  var maxX = -Infinity;
978
1103
  var minZ = Infinity;
@@ -990,14 +1115,22 @@ function deriveArticleFootprint(measurement, rule, margin, cache) {
990
1115
  if (z < minZ) minZ = z;
991
1116
  if (z > maxZ) maxZ = z;
992
1117
  }
993
- // The contour comes back with `margin` already applied, so undo it here:
994
- // what the steps below need is the article's RIM extent (it sizes the
995
- // water volume), not the collar's inner boundary.
1118
+ // A cut the water opening held back reaches further than the margin: the silhouette's own extent tells the rim's.
996
1119
  } catch (err) {
997
1120
  _iterator3.e(err);
998
1121
  } finally {
999
1122
  _iterator3.f();
1000
1123
  }
1124
+ if (traced.offsetBounds) {
1125
+ var _traced$offsetBounds = traced.offsetBounds;
1126
+ minX = _traced$offsetBounds.minX;
1127
+ maxX = _traced$offsetBounds.maxX;
1128
+ minZ = _traced$offsetBounds.minZ;
1129
+ maxZ = _traced$offsetBounds.maxZ;
1130
+ }
1131
+ // The contour comes back with `margin` already applied, so undo it here:
1132
+ // what the steps below need is the article's RIM extent (it sizes the
1133
+ // water volume and places the article), not the collar's inner boundary.
1001
1134
  minX += margin;
1002
1135
  maxX -= margin;
1003
1136
  minZ += margin;
@@ -1024,6 +1157,7 @@ function deriveArticleFootprint(measurement, rule, margin, cache) {
1024
1157
  var guarded = ensureSimplePolygon(traced.points);
1025
1158
  if (guarded !== null && guarded !== void 0 && guarded.repaired) result.repairNote = ' | HULL-REPAIRED, traced outline self-intersects (concavities lost)';
1026
1159
  if (guarded === null) result.repairNote = ' | outline UNUSABLE even as a hull';
1160
+ if (traced.openingMissed) result.repairNote += ' | NO WATER OPENING in the rim top: the margin alone cut it, a narrow rim may show its wall';
1027
1161
  result.points = (_guarded$points = guarded === null || guarded === void 0 ? void 0 : guarded.points) !== null && _guarded$points !== void 0 ? _guarded$points : null;
1028
1162
  result.sampledCount = traced.points.length;
1029
1163
  result.source = traced.retraced ? "geometry traced in ".concat(traced.traceMs.toFixed(1), " ms (").concat(traced.vertexCount, " verts, ").concat(traced.triCount, " tris in slice)") : "geometry cached (".concat(traced.triCount, " tris in slice)");
@@ -1965,6 +2099,10 @@ function cloneDeckMaterial(source) {
1965
2099
  clone.aoMap = null;
1966
2100
  clone.lightMap = null;
1967
2101
  }
2102
+ // It overlaps the deck it continues, in the same plane: it wins, or the deck's edge shows as a line of its own.
2103
+ clone.polygonOffset = true;
2104
+ clone.polygonOffsetFactor = -1;
2105
+ clone.polygonOffsetUnits = -2;
1968
2106
  clone.needsUpdate = true;
1969
2107
  return clone;
1970
2108
  }
@@ -3,7 +3,7 @@ import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
3
3
  import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
4
4
  import _createClass from '@babel/runtime/helpers/createClass';
5
5
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
6
- import { I as FRAME_ORDER, u as useRTVStore, ax as outlineSubPasses, ay as isOutlineDrawSkipped, az as gpuTimingTargets, aA as effectsOf } from './index-a70c59aa.js';
6
+ import { I as FRAME_ORDER, u as useRTVStore, aA as outlineSubPasses, aB as isOutlineDrawSkipped, aC as gpuTimingTargets, aD as effectsOf } from './index-10214cbb.js';
7
7
  import { useRef, useEffect } from 'react';
8
8
  import { useThree, useFrame } from '@react-three/fiber';
9
9
  import { RenderPass, EffectPass, Effect } from 'postprocessing';
@@ -20,6 +20,8 @@ import '@babel/runtime/helpers/getPrototypeOf';
20
20
  import '@babel/runtime/helpers/inherits';
21
21
  import 'react/jsx-runtime';
22
22
  import 'detect-gpu';
23
+ import '@babel/runtime/helpers/toArray';
24
+ import '@babel/runtime/helpers/construct';
23
25
  import 'three/examples/jsm/loaders/DRACOLoader.js';
24
26
  import 'three/examples/jsm/loaders/GLTFLoader.js';
25
27
  import '@react-three/drei';
@@ -30,11 +32,10 @@ import 'troika-three-text';
30
32
  import 'three/examples/jsm/lines/LineSegments2.js';
31
33
  import 'three/examples/jsm/lines/LineSegmentsGeometry.js';
32
34
  import 'three/examples/jsm/lines/LineMaterial.js';
33
- import '@babel/runtime/helpers/toArray';
34
- import '@babel/runtime/helpers/construct';
35
35
  import 'three/examples/jsm/environments/RoomEnvironment.js';
36
36
  import 'three/examples/jsm/loaders/RGBELoader.js';
37
37
  import 'three/examples/jsm/loaders/EXRLoader.js';
38
+ import 'three/examples/jsm/objects/GroundedSkybox.js';
38
39
  import '@react-three/postprocessing';
39
40
 
40
41
  function _createForOfIteratorHelper$1(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$1(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }