@pascal-app/core 1.0.0 → 1.0.3

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 (345) hide show
  1. package/dist/capture/index.d.ts +2 -2
  2. package/dist/capture/index.js +2 -2
  3. package/dist/capture/schema.d.ts.map +1 -1
  4. package/dist/capture/schema.js +2 -0
  5. package/dist/capture/source.d.ts +1 -1
  6. package/dist/capture/source.js +1 -1
  7. package/dist/events/bus.d.ts +6 -3
  8. package/dist/events/bus.d.ts.map +1 -1
  9. package/dist/hooks/spatial-grid/floor-placed-elevation.d.ts +4 -4
  10. package/dist/hooks/spatial-grid/floor-placed-elevation.d.ts.map +1 -1
  11. package/dist/hooks/spatial-grid/floor-placed-elevation.js +7 -12
  12. package/dist/hooks/spatial-grid/floor-placed-footprints.d.ts +4 -0
  13. package/dist/hooks/spatial-grid/floor-placed-footprints.d.ts.map +1 -0
  14. package/dist/hooks/spatial-grid/floor-placed-footprints.js +7 -0
  15. package/dist/hooks/spatial-grid/spatial-grid-manager.d.ts +5 -8
  16. package/dist/hooks/spatial-grid/spatial-grid-manager.d.ts.map +1 -1
  17. package/dist/hooks/spatial-grid/spatial-grid-manager.js +23 -106
  18. package/dist/hooks/spatial-grid/spatial-grid-sync.d.ts +263 -84
  19. package/dist/hooks/spatial-grid/spatial-grid-sync.d.ts.map +1 -1
  20. package/dist/hooks/spatial-grid/spatial-grid-sync.js +77 -13
  21. package/dist/hooks/spatial-grid/support-host-patch.d.ts +1 -1
  22. package/dist/hooks/spatial-grid/support-host-patch.js +6 -6
  23. package/dist/hooks/spatial-grid/use-spatial-query.d.ts +1 -1
  24. package/dist/hooks/spatial-grid/use-spatial-query.js +1 -1
  25. package/dist/index.d.ts +77 -72
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +74 -69
  28. package/dist/lib/door-operation.d.ts +1 -1
  29. package/dist/lib/item-polygon-overlap.d.ts +6 -0
  30. package/dist/lib/item-polygon-overlap.d.ts.map +1 -0
  31. package/dist/lib/item-polygon-overlap.js +67 -0
  32. package/dist/lib/level-name.d.ts +1 -1
  33. package/dist/lib/measurement-geometry.d.ts +4 -4
  34. package/dist/lib/node-visibility.d.ts +12 -0
  35. package/dist/lib/node-visibility.d.ts.map +1 -0
  36. package/dist/lib/node-visibility.js +12 -0
  37. package/dist/lib/plan-footprint.d.ts +41 -0
  38. package/dist/lib/plan-footprint.d.ts.map +1 -0
  39. package/dist/lib/plan-footprint.js +58 -0
  40. package/dist/lib/room-topology-index.d.ts +1 -1
  41. package/dist/lib/room-topology-index.js +1 -1
  42. package/dist/lib/selection-proxy.d.ts +1 -1
  43. package/dist/lib/slab-polygon.d.ts +2 -2
  44. package/dist/lib/slab-polygon.js +2 -2
  45. package/dist/lib/space-detection.d.ts +1 -1
  46. package/dist/lib/space-detection.d.ts.map +1 -1
  47. package/dist/lib/space-detection.js +16 -11
  48. package/dist/lib/terrain-brush.d.ts +1 -1
  49. package/dist/lib/terrain-brush.js +1 -1
  50. package/dist/lib/terrain-codec.d.ts +2 -2
  51. package/dist/lib/terrain-codec.js +1 -1
  52. package/dist/lib/terrain-raycast.d.ts +1 -1
  53. package/dist/lib/terrain-raycast.js +1 -1
  54. package/dist/lib/terrain-source.d.ts +3 -3
  55. package/dist/lib/terrain-source.js +3 -3
  56. package/dist/lib/terrain-support.d.ts +1 -1
  57. package/dist/lib/terrain-support.js +3 -3
  58. package/dist/lib/unit-containment.d.ts +19 -0
  59. package/dist/lib/unit-containment.d.ts.map +1 -0
  60. package/dist/lib/unit-containment.js +158 -0
  61. package/dist/lib/unit-report.d.ts +19 -0
  62. package/dist/lib/unit-report.d.ts.map +1 -0
  63. package/dist/lib/unit-report.js +36 -0
  64. package/dist/lib/wall-distance.d.ts +2 -2
  65. package/dist/lib/wall-distance.js +1 -1
  66. package/dist/lib/zone-quantities.d.ts +1 -1
  67. package/dist/lib/zone-quantities.js +7 -7
  68. package/dist/material-library.d.ts +1 -1
  69. package/dist/material-library.js +1 -1
  70. package/dist/procedural-items/fixtures.d.ts +261 -0
  71. package/dist/procedural-items/fixtures.d.ts.map +1 -0
  72. package/dist/procedural-items/fixtures.js +349 -0
  73. package/dist/procedural-items/index.d.ts +10 -0
  74. package/dist/procedural-items/index.d.ts.map +1 -0
  75. package/dist/procedural-items/index.js +9 -0
  76. package/dist/procedural-items/integration.d.ts +92 -0
  77. package/dist/procedural-items/integration.d.ts.map +1 -0
  78. package/dist/procedural-items/integration.js +19 -0
  79. package/dist/procedural-items/library-colors.d.ts +56 -0
  80. package/dist/procedural-items/library-colors.d.ts.map +1 -0
  81. package/dist/procedural-items/library-colors.js +84 -0
  82. package/dist/procedural-items/materials.d.ts +5 -0
  83. package/dist/procedural-items/materials.d.ts.map +1 -0
  84. package/dist/procedural-items/materials.js +47 -0
  85. package/dist/procedural-items/node.d.ts +280 -0
  86. package/dist/procedural-items/node.d.ts.map +1 -0
  87. package/dist/procedural-items/node.js +71 -0
  88. package/dist/procedural-items/placement.d.ts +7 -0
  89. package/dist/procedural-items/placement.d.ts.map +1 -0
  90. package/dist/procedural-items/placement.js +48 -0
  91. package/dist/procedural-items/query.d.ts +51 -0
  92. package/dist/procedural-items/query.d.ts.map +1 -0
  93. package/dist/procedural-items/query.js +342 -0
  94. package/dist/procedural-items/recipe.d.ts +144 -0
  95. package/dist/procedural-items/recipe.d.ts.map +1 -0
  96. package/dist/procedural-items/recipe.js +372 -0
  97. package/dist/procedural-items/spatial.d.ts +19 -0
  98. package/dist/procedural-items/spatial.d.ts.map +1 -0
  99. package/dist/procedural-items/spatial.js +39 -0
  100. package/dist/registry/__bench__/relations-resolver.bench.js +2 -2
  101. package/dist/registry/handles.d.ts +40 -5
  102. package/dist/registry/handles.d.ts.map +1 -1
  103. package/dist/registry/index.d.ts +6 -6
  104. package/dist/registry/index.d.ts.map +1 -1
  105. package/dist/registry/index.js +4 -4
  106. package/dist/registry/registry.d.ts +1 -1
  107. package/dist/registry/relations-resolver.d.ts +2 -2
  108. package/dist/registry/relations-resolver.js +1 -1
  109. package/dist/registry/scene-api.d.ts +2 -2
  110. package/dist/registry/scene-api.js +2 -2
  111. package/dist/registry/subtree.d.ts +1 -1
  112. package/dist/registry/subtree.d.ts.map +1 -1
  113. package/dist/registry/subtree.js +8 -2
  114. package/dist/registry/types.d.ts +32 -10
  115. package/dist/registry/types.d.ts.map +1 -1
  116. package/dist/registry/use-registry-version.js +1 -1
  117. package/dist/registry/validate-relations.d.ts +4 -0
  118. package/dist/registry/validate-relations.d.ts.map +1 -0
  119. package/dist/registry/validate-relations.js +22 -0
  120. package/dist/schema/__bench__/node-parsers.bench.js +3 -3
  121. package/dist/schema/__fixtures__/node-fixtures.d.ts +1 -1
  122. package/dist/schema/__fixtures__/node-fixtures.d.ts.map +1 -1
  123. package/dist/schema/__fixtures__/node-fixtures.js +4 -2
  124. package/dist/schema/base.js +1 -1
  125. package/dist/schema/collections.d.ts +1 -1
  126. package/dist/schema/collections.js +1 -1
  127. package/dist/schema/compiled-node-parsers.d.ts +1 -1
  128. package/dist/schema/compiled-node-parsers.js +1 -1
  129. package/dist/schema/index.d.ts +74 -70
  130. package/dist/schema/index.d.ts.map +1 -1
  131. package/dist/schema/index.js +65 -61
  132. package/dist/schema/material.d.ts +1 -1
  133. package/dist/schema/material.js +1 -1
  134. package/dist/schema/nodes/automatic-downspout.d.ts +4 -4
  135. package/dist/schema/nodes/automatic-downspout.js +5 -5
  136. package/dist/schema/nodes/block.d.ts +3 -3
  137. package/dist/schema/nodes/block.d.ts.map +1 -1
  138. package/dist/schema/nodes/block.js +24 -12
  139. package/dist/schema/nodes/box-vent.js +2 -2
  140. package/dist/schema/nodes/building.d.ts +1 -1
  141. package/dist/schema/nodes/building.d.ts.map +1 -1
  142. package/dist/schema/nodes/building.js +8 -5
  143. package/dist/schema/nodes/cabinet.d.ts +4 -4
  144. package/dist/schema/nodes/cabinet.js +4 -4
  145. package/dist/schema/nodes/ceiling.d.ts +1 -1
  146. package/dist/schema/nodes/ceiling.js +5 -5
  147. package/dist/schema/nodes/chimney.js +2 -2
  148. package/dist/schema/nodes/column.d.ts +1 -0
  149. package/dist/schema/nodes/column.d.ts.map +1 -1
  150. package/dist/schema/nodes/column.js +3 -2
  151. package/dist/schema/nodes/construction-dimension.d.ts +3 -3
  152. package/dist/schema/nodes/construction-dimension.js +2 -2
  153. package/dist/schema/nodes/cupola.d.ts +1 -1
  154. package/dist/schema/nodes/cupola.js +2 -2
  155. package/dist/schema/nodes/curtain-wall.d.ts +129 -0
  156. package/dist/schema/nodes/curtain-wall.d.ts.map +1 -0
  157. package/dist/schema/nodes/curtain-wall.js +49 -0
  158. package/dist/schema/nodes/door.d.ts +2 -2
  159. package/dist/schema/nodes/door.js +2 -2
  160. package/dist/schema/nodes/dormer.d.ts +3 -3
  161. package/dist/schema/nodes/dormer.js +4 -4
  162. package/dist/schema/nodes/downspout.js +2 -2
  163. package/dist/schema/nodes/duct-fitting.js +1 -1
  164. package/dist/schema/nodes/duct-segment.js +2 -2
  165. package/dist/schema/nodes/duct-terminal.js +1 -1
  166. package/dist/schema/nodes/elevator.js +2 -2
  167. package/dist/schema/nodes/eyebrow-vent.js +2 -2
  168. package/dist/schema/nodes/fence.js +2 -2
  169. package/dist/schema/nodes/guide.js +2 -2
  170. package/dist/schema/nodes/gutter.d.ts +1 -1
  171. package/dist/schema/nodes/gutter.js +4 -4
  172. package/dist/schema/nodes/hvac-equipment.js +1 -1
  173. package/dist/schema/nodes/imported-mesh.d.ts +40 -0
  174. package/dist/schema/nodes/imported-mesh.d.ts.map +1 -0
  175. package/dist/schema/nodes/imported-mesh.js +27 -0
  176. package/dist/schema/nodes/item.d.ts +3 -3
  177. package/dist/schema/nodes/item.js +3 -3
  178. package/dist/schema/nodes/lean-to-extension.js +4 -4
  179. package/dist/schema/nodes/level.d.ts +1 -1
  180. package/dist/schema/nodes/level.d.ts.map +1 -1
  181. package/dist/schema/nodes/level.js +1 -1
  182. package/dist/schema/nodes/lineset.js +1 -1
  183. package/dist/schema/nodes/liquid-line.js +1 -1
  184. package/dist/schema/nodes/measurement.js +2 -2
  185. package/dist/schema/nodes/pipe-fitting.d.ts +1 -1
  186. package/dist/schema/nodes/pipe-fitting.js +1 -1
  187. package/dist/schema/nodes/pipe-segment.d.ts +1 -1
  188. package/dist/schema/nodes/pipe-segment.js +2 -2
  189. package/dist/schema/nodes/pipe-trap.d.ts +1 -1
  190. package/dist/schema/nodes/pipe-trap.js +1 -1
  191. package/dist/schema/nodes/ridge-vent.d.ts +1 -1
  192. package/dist/schema/nodes/ridge-vent.js +3 -3
  193. package/dist/schema/nodes/roof-segment-shape.d.ts +1 -1
  194. package/dist/schema/nodes/roof-segment-shape.js +1 -1
  195. package/dist/schema/nodes/roof-segment-walls.d.ts +1 -1
  196. package/dist/schema/nodes/roof-segment-walls.js +1 -1
  197. package/dist/schema/nodes/roof-segment.d.ts +2 -2
  198. package/dist/schema/nodes/roof-segment.js +2 -2
  199. package/dist/schema/nodes/roof.d.ts +1 -1
  200. package/dist/schema/nodes/roof.js +3 -3
  201. package/dist/schema/nodes/scan.js +3 -3
  202. package/dist/schema/nodes/shelf.d.ts +1 -1
  203. package/dist/schema/nodes/shelf.d.ts.map +1 -1
  204. package/dist/schema/nodes/shelf.js +3 -4
  205. package/dist/schema/nodes/site.js +2 -2
  206. package/dist/schema/nodes/skylight.d.ts +4 -4
  207. package/dist/schema/nodes/skylight.js +2 -2
  208. package/dist/schema/nodes/slab.js +3 -3
  209. package/dist/schema/nodes/solar-panel.js +3 -3
  210. package/dist/schema/nodes/spawn.js +1 -1
  211. package/dist/schema/nodes/stair-segment.js +2 -2
  212. package/dist/schema/nodes/stair.d.ts +1 -1
  213. package/dist/schema/nodes/stair.js +3 -3
  214. package/dist/schema/nodes/structural-grid.js +1 -1
  215. package/dist/schema/nodes/turbine-vent.d.ts +1 -1
  216. package/dist/schema/nodes/turbine-vent.js +2 -2
  217. package/dist/schema/nodes/unit.d.ts +33 -0
  218. package/dist/schema/nodes/unit.d.ts.map +1 -0
  219. package/dist/schema/nodes/unit.js +13 -0
  220. package/dist/schema/nodes/wall.d.ts +75 -2
  221. package/dist/schema/nodes/wall.d.ts.map +1 -1
  222. package/dist/schema/nodes/wall.js +10 -6
  223. package/dist/schema/nodes/window.js +2 -2
  224. package/dist/schema/nodes/zone.js +1 -1
  225. package/dist/schema/scene-material.js +2 -2
  226. package/dist/schema/types.d.ts +417 -22
  227. package/dist/schema/types.d.ts.map +1 -1
  228. package/dist/schema/types.js +56 -49
  229. package/dist/services/__fixtures__/hosting.d.ts +3 -0
  230. package/dist/services/__fixtures__/hosting.d.ts.map +1 -0
  231. package/dist/services/__fixtures__/hosting.js +9 -0
  232. package/dist/services/__fixtures__/shelf-surface-rows.d.ts +4 -0
  233. package/dist/services/__fixtures__/shelf-surface-rows.d.ts.map +1 -0
  234. package/dist/services/__fixtures__/shelf-surface-rows.js +18 -0
  235. package/dist/services/alignment-anchors.d.ts +6 -11
  236. package/dist/services/alignment-anchors.d.ts.map +1 -1
  237. package/dist/services/alignment-anchors.js +7 -34
  238. package/dist/services/drag-session.d.ts +4 -4
  239. package/dist/services/drag-session.js +1 -1
  240. package/dist/services/hosting.d.ts +5 -8
  241. package/dist/services/hosting.d.ts.map +1 -1
  242. package/dist/services/hosting.js +25 -18
  243. package/dist/services/index.d.ts +16 -13
  244. package/dist/services/index.d.ts.map +1 -1
  245. package/dist/services/index.js +16 -13
  246. package/dist/services/level-height.d.ts +2 -2
  247. package/dist/services/level-height.js +3 -3
  248. package/dist/services/movement.d.ts +3 -3
  249. package/dist/services/movement.js +2 -2
  250. package/dist/services/port-connectivity.d.ts +1 -1
  251. package/dist/services/port-connectivity.js +1 -1
  252. package/dist/services/riser-diagram.d.ts +1 -1
  253. package/dist/services/shelf-board.d.ts +5 -0
  254. package/dist/services/shelf-board.d.ts.map +1 -0
  255. package/dist/services/shelf-board.js +15 -0
  256. package/dist/services/snap.d.ts +3 -0
  257. package/dist/services/snap.d.ts.map +1 -1
  258. package/dist/services/snap.js +11 -0
  259. package/dist/services/storey.d.ts +2 -2
  260. package/dist/services/storey.js +2 -2
  261. package/dist/services/surface-hosting-procedural-parity.fixtures.d.ts +13 -0
  262. package/dist/services/surface-hosting-procedural-parity.fixtures.d.ts.map +1 -0
  263. package/dist/services/surface-hosting-procedural-parity.fixtures.js +4691 -0
  264. package/dist/services/surface-hosting-shelf-parity.fixtures.d.ts +1060 -0
  265. package/dist/services/surface-hosting-shelf-parity.fixtures.d.ts.map +1 -0
  266. package/dist/services/surface-hosting-shelf-parity.fixtures.js +3127 -0
  267. package/dist/services/surface-hosting.d.ts +92 -0
  268. package/dist/services/surface-hosting.d.ts.map +1 -0
  269. package/dist/services/surface-hosting.js +305 -0
  270. package/dist/services/surface-region.d.ts +8 -0
  271. package/dist/services/surface-region.d.ts.map +1 -0
  272. package/dist/services/surface-region.js +44 -0
  273. package/dist/services/system-graph.d.ts +2 -2
  274. package/dist/services/system-graph.js +2 -2
  275. package/dist/services/validate-dwv.d.ts +1 -1
  276. package/dist/services/validate-dwv.js +1 -1
  277. package/dist/store/actions/node-actions.d.ts +2 -2
  278. package/dist/store/actions/node-actions.d.ts.map +1 -1
  279. package/dist/store/actions/node-actions.js +50 -104
  280. package/dist/store/history-control.d.ts +3 -3
  281. package/dist/store/history-invalidation.d.ts +1 -1
  282. package/dist/store/history-invalidation.js +1 -1
  283. package/dist/store/use-interactive.d.ts +2 -2
  284. package/dist/store/use-live-terrain.d.ts +1 -1
  285. package/dist/store/use-scene.d.ts +4 -4
  286. package/dist/store/use-scene.d.ts.map +1 -1
  287. package/dist/store/use-scene.js +50 -32
  288. package/dist/systems/elevator/elevator-dispatch.d.ts +2 -2
  289. package/dist/systems/elevator/elevator-dispatch.js +1 -1
  290. package/dist/systems/elevator/elevator-geometry.d.ts +1 -1
  291. package/dist/systems/elevator/elevator-opening-sync.d.ts +1 -1
  292. package/dist/systems/elevator/elevator-opening-sync.js +2 -2
  293. package/dist/systems/elevator/elevator-opening-system.js +3 -3
  294. package/dist/systems/elevator/elevator-runtime.d.ts +3 -3
  295. package/dist/systems/elevator/elevator-runtime.js +3 -3
  296. package/dist/systems/elevator/elevator-service.d.ts +1 -1
  297. package/dist/systems/elevator/elevator-service.js +1 -1
  298. package/dist/systems/fence/fence-centerline.d.ts +2 -2
  299. package/dist/systems/fence/fence-centerline.js +2 -2
  300. package/dist/systems/fence/fence-spline.d.ts +2 -2
  301. package/dist/systems/roof/roof-elevation-system.js +3 -3
  302. package/dist/systems/roof/roof-elevation.d.ts +2 -2
  303. package/dist/systems/roof/roof-elevation.js +6 -6
  304. package/dist/systems/roof/roof-footprint.d.ts +1 -1
  305. package/dist/systems/roof/roof-footprint.js +3 -3
  306. package/dist/systems/slab/slab-placement.d.ts +1 -1
  307. package/dist/systems/slab/slab-support.d.ts +1 -1
  308. package/dist/systems/slab/slab-support.js +4 -4
  309. package/dist/systems/stair/stair-flight.d.ts +2 -2
  310. package/dist/systems/stair/stair-flight.js +2 -2
  311. package/dist/systems/stair/stair-footprint.d.ts +1 -1
  312. package/dist/systems/stair/stair-opening-preview.d.ts +248 -87
  313. package/dist/systems/stair/stair-opening-preview.d.ts.map +1 -1
  314. package/dist/systems/stair/stair-opening-preview.js +2 -2
  315. package/dist/systems/stair/stair-opening-sync.d.ts +1 -1
  316. package/dist/systems/stair/stair-opening-sync.js +6 -6
  317. package/dist/systems/stair/stair-opening-system.js +8 -8
  318. package/dist/systems/stair/stair-rise.d.ts +1 -1
  319. package/dist/systems/stair/stair-rise.js +3 -3
  320. package/dist/systems/wall/wall-curve.d.ts +2 -2
  321. package/dist/systems/wall/wall-footprint.d.ts +3 -3
  322. package/dist/systems/wall/wall-footprint.js +3 -3
  323. package/dist/systems/wall/wall-merge.d.ts +38 -0
  324. package/dist/systems/wall/wall-merge.d.ts.map +1 -0
  325. package/dist/systems/wall/wall-merge.js +240 -0
  326. package/dist/systems/wall/wall-mitering.d.ts +1 -1
  327. package/dist/systems/wall/wall-mitering.js +1 -1
  328. package/dist/systems/wall/wall-move.d.ts +1 -1
  329. package/dist/systems/wall/wall-operations.d.ts +28 -0
  330. package/dist/systems/wall/wall-operations.d.ts.map +1 -0
  331. package/dist/systems/wall/wall-operations.js +145 -0
  332. package/dist/systems/wall/wall-top.d.ts +1 -1
  333. package/dist/systems/wall/wall-topology.d.ts +9 -2
  334. package/dist/systems/wall/wall-topology.d.ts.map +1 -1
  335. package/dist/systems/wall/wall-topology.js +57 -9
  336. package/dist/utils/clone-scene-graph.d.ts +3 -3
  337. package/dist/utils/clone-scene-graph.d.ts.map +1 -1
  338. package/dist/utils/clone-scene-graph.js +9 -3
  339. package/dist/utils/scene-migrations.d.ts +3 -3
  340. package/dist/utils/scene-migrations.js +3 -3
  341. package/dist/utils/vertical-scene-migration.js +5 -5
  342. package/dist/validation/validate-build-json.d.ts +5 -2
  343. package/dist/validation/validate-build-json.d.ts.map +1 -1
  344. package/dist/validation/validate-build-json.js +57 -4
  345. package/package.json +15 -4
package/dist/index.js CHANGED
@@ -1,72 +1,77 @@
1
- export { emitter, eventSuffixes } from './events/bus';
2
- export { hiddenWallPointerEventsHeld, holdHiddenWallPointerEvents, } from './events/hidden-wall-pointer-hold';
3
- export { itemClipRegistry } from './hooks/scene-registry/item-clip-registry';
4
- export { sceneRegistry, useRegistry, } from './hooks/scene-registry/scene-registry';
5
- export { GROUND_SUPPORT_ID, getFloorPlacedElevation, getFloorPlacedFootprints, getFloorStackedPosition, } from './hooks/spatial-grid/floor-placed-elevation';
6
- export { getWallBaseElevationForNodes, getWallEffectiveHeightForNodes, pointInPolygon, SUPPORT_ELEVATION_EPSILON, spatialGridManager, } from './hooks/spatial-grid/spatial-grid-manager';
7
- export { findLevelAncestorId, initSpatialGridSync, markSlabChangeDependents, resolveBuildingForLevel, resolveLevelId, } from './hooks/spatial-grid/spatial-grid-sync';
8
- export { resolveFenceConstructionSupport, resolveFenceSupportSlabPatch, resolveFrozenFloorPlacementPatch, resolveMovedWallSupportSlabPatch, resolveSupportSlabPatch, resolveTerrainWallConstructionOptions, resolveWallConstruction, resolveWallSupportSlabPatch, } from './hooks/spatial-grid/support-host-patch';
9
- export { useSpatialQuery } from './hooks/spatial-grid/use-spatial-query';
10
- export { loadAssetUrl, saveAsset } from './lib/asset-storage';
11
- export { clampDoorOperationState, getDoorRenderOpenAmount, getGarageVisibleOpeningRatio, isOperationDoorType, SECTIONAL_GARAGE_RENDER_OPEN_SCALE, } from './lib/door-operation';
12
- export { getDefaultLevelName, getLevelDisplayName } from './lib/level-name';
13
- export { areMeasurementPointsCoplanar, closestMeasurementFeatureBinding, MEASUREMENT_PLANAR_TOLERANCE, measurementAnchorFallback, measurementAnchorReferenceNodeIds, measurementAngle, measurementArea, measurementAreaVector, measurementCentroid, measurementDistance, measurementFeatureLength, measurementNormal, measurementPerimeter, measurementPrismVolume, measurementReferenceNodeIds, remapMeasurementAnchors, remapMeasurementReferences, } from './lib/measurement-geometry';
14
- export { pointInPolygon as pointInPolygon2D, pointOnSegment, polygonContainsPolygon, polygonsIntersect, polygonsOverlap, segmentsIntersect, } from './lib/polygon-relations';
15
- export { subtractPolygonsFromPolygon, unionPolygons, } from './lib/polygon-union';
16
- export { compareRoofOverlapIdentity, getRoofPlanBounds, roofOverlapEntryOwns, roofPlanBoundsOverlap, roofPlanOverlapEntryOwns, } from './lib/roof-overlap';
17
- export { resolveSelectionProxyId, selectionProxyIdFromMetadata } from './lib/selection-proxy';
18
- export { getRenderableSlabPolygon, prepareSlabPolygonContext, scopeSlabPolygonContext, slabPolygonContextChanges, slabPolygonContextForLevel, slabPolygonContextFromGeometry, snapSlabEdgeToWallBand, } from './lib/slab-polygon';
19
- export { deriveSlotId, isSlotMaterialName, SLOT_MATERIAL_PREFIX, slotLabelFromId, } from './lib/slots';
20
- export { detectSpacesForLevel, initSpaceDetectionSync, isSpaceDetectionPaused, pauseSpaceDetection, planAutoCeilingsForLevel, planAutoSlabsForLevel, planAutoZonesForLevel, resolveAutoZonePolygon, resumeSpaceDetection, wallClosesRoom, wallTouchesOthers, } from './lib/space-detection';
21
- export { advanceStroke, beginStroke, brushHeightAt, DEFAULT_BRUSH_SETTINGS, detachStrokeAnchor, highestOver, MIN_BRUSH_RADIUS_IN_SPACINGS, maxCoverage, minBrushRadius, RAISE_METRES_PER_STROKE, sampleTarget, weightAt, } from './lib/terrain-brush';
22
- export { decodeHeightPatch, decodeTerrainField, encodeHeightPatch, encodeTerrainField, isDatumField, } from './lib/terrain-codec';
23
- export { applyHeightPatch, createTerrainField, DEFAULT_TERRAIN_SPACING, DEFAULT_TERRAIN_STEP, diffToPatches, flattenPatch, heightAt, heightAtSample, isFlatOver, normalAt, quantize, sampleRangeOver, slopeAt, surfaceHeightAt, } from './lib/terrain-field';
24
- export { raycastTerrain } from './lib/terrain-raycast';
25
- export { commitTerrainField, persistedTerrainFieldOf, terrainFieldForEdit, terrainFieldOf, } from './lib/terrain-source';
26
- export { isLevelBaseConsumer, isSiteDatum, levelBaseElevationAt, noteLevelBaseConsumer, SITE_DATUM_EPSILON, SITE_DATUM_Y, terrainSupportLift, } from './lib/terrain-support';
27
- export { closestOnSegment, collectLevelWallSegments, nearestWallSegment, WALL_SNAP_DISTANCE_M, } from './lib/wall-distance';
28
- export { deriveZoneQuantityReport, } from './lib/zone-quantities';
29
- export { getCatalogMaterialById, getDynamicLibraryMaterials, getLibraryMaterialIdFromRef, getLibraryMaterialsVersion, getMaterialPresetByRef, getMaterialsForCategory, getSceneMaterialIdFromRef, LIBRARY_MATERIAL_REF_PREFIX, MATERIAL_CATALOG, MATERIAL_CATEGORIES, MATERIAL_SURFACES, parseMaterialRef, registerLibraryMaterials, SCENE_MATERIAL_REF_PREFIX, subscribeLibraryMaterials, toLibraryMaterialRef, toSceneMaterialRef, unregisterLibraryMaterials, } from './material-library';
30
- export * from './registry';
1
+ export { emitter, eventSuffixes } from './events/bus.js';
2
+ export { hiddenWallPointerEventsHeld, holdHiddenWallPointerEvents, } from './events/hidden-wall-pointer-hold.js';
3
+ export { itemClipRegistry } from './hooks/scene-registry/item-clip-registry.js';
4
+ export { sceneRegistry, useRegistry, } from './hooks/scene-registry/scene-registry.js';
5
+ export { GROUND_SUPPORT_ID, getFloorPlacedElevation, getFloorPlacedFootprints, getFloorStackedPosition, } from './hooks/spatial-grid/floor-placed-elevation.js';
6
+ export { getWallBaseElevationForNodes, getWallEffectiveHeightForNodes, pointInPolygon, SUPPORT_ELEVATION_EPSILON, spatialGridManager, } from './hooks/spatial-grid/spatial-grid-manager.js';
7
+ export { findLevelAncestorId, initSpatialGridSync, markSlabChangeDependents, resolveBuildingForLevel, resolveLevelId, } from './hooks/spatial-grid/spatial-grid-sync.js';
8
+ export { resolveFenceConstructionSupport, resolveFenceSupportSlabPatch, resolveFrozenFloorPlacementPatch, resolveMovedWallSupportSlabPatch, resolveSupportSlabPatch, resolveTerrainWallConstructionOptions, resolveWallConstruction, resolveWallSupportSlabPatch, } from './hooks/spatial-grid/support-host-patch.js';
9
+ export { useSpatialQuery } from './hooks/spatial-grid/use-spatial-query.js';
10
+ export { loadAssetUrl, saveAsset } from './lib/asset-storage.js';
11
+ export { clampDoorOperationState, getDoorRenderOpenAmount, getGarageVisibleOpeningRatio, isOperationDoorType, SECTIONAL_GARAGE_RENDER_OPEN_SCALE, } from './lib/door-operation.js';
12
+ export { getDefaultLevelName, getLevelDisplayName } from './lib/level-name.js';
13
+ export { areMeasurementPointsCoplanar, closestMeasurementFeatureBinding, MEASUREMENT_PLANAR_TOLERANCE, measurementAnchorFallback, measurementAnchorReferenceNodeIds, measurementAngle, measurementArea, measurementAreaVector, measurementCentroid, measurementDistance, measurementFeatureLength, measurementNormal, measurementPerimeter, measurementPrismVolume, measurementReferenceNodeIds, remapMeasurementAnchors, remapMeasurementReferences, } from './lib/measurement-geometry.js';
14
+ export { HIDDEN_SITE_NOTE, hidesDescendants } from './lib/node-visibility.js';
15
+ export { pointInPolygon as pointInPolygon2D, pointOnSegment, polygonContainsPolygon, polygonsIntersect, polygonsOverlap, segmentsIntersect, } from './lib/polygon-relations.js';
16
+ export { subtractPolygonsFromPolygon, unionPolygons, } from './lib/polygon-union.js';
17
+ export { compareRoofOverlapIdentity, getRoofPlanBounds, roofOverlapEntryOwns, roofPlanBoundsOverlap, roofPlanOverlapEntryOwns, } from './lib/roof-overlap.js';
18
+ export { resolveSelectionProxyId, selectionProxyIdFromMetadata } from './lib/selection-proxy.js';
19
+ export { getRenderableSlabPolygon, prepareSlabPolygonContext, scopeSlabPolygonContext, slabPolygonContextChanges, slabPolygonContextForLevel, slabPolygonContextFromGeometry, snapSlabEdgeToWallBand, } from './lib/slab-polygon.js';
20
+ export { deriveSlotId, isSlotMaterialName, SLOT_MATERIAL_PREFIX, slotLabelFromId, } from './lib/slots.js';
21
+ export { detectSpacesForLevel, initSpaceDetectionSync, isSpaceDetectionPaused, pauseSpaceDetection, planAutoCeilingsForLevel, planAutoSlabsForLevel, planAutoZonesForLevel, resolveAutoZonePolygon, resumeSpaceDetection, wallClosesRoom, wallTouchesOthers, } from './lib/space-detection.js';
22
+ export { advanceStroke, beginStroke, brushHeightAt, DEFAULT_BRUSH_SETTINGS, detachStrokeAnchor, highestOver, MIN_BRUSH_RADIUS_IN_SPACINGS, maxCoverage, minBrushRadius, RAISE_METRES_PER_STROKE, sampleTarget, weightAt, } from './lib/terrain-brush.js';
23
+ export { decodeHeightPatch, decodeTerrainField, encodeHeightPatch, encodeTerrainField, isDatumField, } from './lib/terrain-codec.js';
24
+ export { applyHeightPatch, createTerrainField, DEFAULT_TERRAIN_SPACING, DEFAULT_TERRAIN_STEP, diffToPatches, flattenPatch, heightAt, heightAtSample, isFlatOver, normalAt, quantize, sampleRangeOver, slopeAt, surfaceHeightAt, } from './lib/terrain-field.js';
25
+ export { raycastTerrain } from './lib/terrain-raycast.js';
26
+ export { commitTerrainField, persistedTerrainFieldOf, terrainFieldForEdit, terrainFieldOf, } from './lib/terrain-source.js';
27
+ export { isLevelBaseConsumer, isSiteDatum, levelBaseElevationAt, noteLevelBaseConsumer, SITE_DATUM_EPSILON, SITE_DATUM_Y, terrainSupportLift, } from './lib/terrain-support.js';
28
+ export { deriveUnit, unassignedZoneIds, unitsForZone, unitWarnings, } from './lib/unit-containment.js';
29
+ export { buildUnitReport } from './lib/unit-report.js';
30
+ export { closestOnSegment, collectLevelWallSegments, nearestWallSegment, WALL_SNAP_DISTANCE_M, } from './lib/wall-distance.js';
31
+ export { deriveZoneQuantityReport, } from './lib/zone-quantities.js';
32
+ export { getCatalogMaterialById, getDynamicLibraryMaterials, getLibraryMaterialIdFromRef, getLibraryMaterialsVersion, getMaterialPresetByRef, getMaterialsForCategory, getSceneMaterialIdFromRef, LIBRARY_MATERIAL_REF_PREFIX, MATERIAL_CATALOG, MATERIAL_CATEGORIES, MATERIAL_SURFACES, parseMaterialRef, registerLibraryMaterials, SCENE_MATERIAL_REF_PREFIX, subscribeLibraryMaterials, toLibraryMaterialRef, toSceneMaterialRef, unregisterLibraryMaterials, } from './material-library.js';
33
+ export * from './registry/index.js';
31
34
  // Exported here rather than from the registry barrel: that barrel is
32
35
  // reachable from server-safe graphs (schema → spatial grid → registry)
33
36
  // and must stay free of React imports.
34
- export { useRegistryVersion } from './registry/use-registry-version';
35
- export * from './schema';
36
- export * from './services';
37
- export { isMovable, movePlanToward, moveToward, resolveMovable } from './services/movement';
38
- export { acquireSceneHistoryPause, activeSceneCommitNodeIds, getSceneHistoryPauseDepth, pauseSceneHistory, resetSceneHistoryPauseDepth, resumeSceneHistory, runAsSingleSceneHistoryStep, subscribeSceneCommits, } from './store/history-control';
39
- export { getHistoryDirtyNodeIds } from './store/history-invalidation';
40
- export { useInteractive, } from './store/use-interactive';
41
- export { default as useLiveNodeOverrides, getEffectiveNode, } from './store/use-live-node-overrides';
42
- export { default as useLiveTerrain, } from './store/use-live-terrain';
43
- export { default as useLiveTransforms } from './store/use-live-transforms';
44
- export { acquireSceneReadOnlyLease, applySceneOperationPatch, applyScenePatch, applySceneSnapshot, clearSceneHistory, default as useScene, } from './store/use-scene';
45
- export { resolveElevatorDispatchTarget } from './systems/elevator/elevator-dispatch';
46
- export { getElevatorCabCenterZ, getElevatorCabDepth, getElevatorCabWidth, getElevatorDoorLeafSides, getElevatorDoorLeafWidth, getElevatorDoorLeafX, getElevatorShaftDepth, getElevatorShaftWallThickness, getElevatorShaftWidth, getResolvedElevatorDoorPanelStyle, getResolvedElevatorDoorStyle, getResolvedElevatorShaftStyle, } from './systems/elevator/elevator-geometry';
47
- export { syncAutoElevatorOpenings } from './systems/elevator/elevator-opening-sync';
48
- export { ElevatorOpeningSystem } from './systems/elevator/elevator-opening-system';
49
- export { createElevatorInteractiveState, openElevatorDoor, openElevatorDoorState, queueElevatorRequest, requestElevatorLevel, stepElevatorRuntimeState, stepElevatorRuntimes, } from './systems/elevator/elevator-runtime';
50
- export { resolveElevatorBuildingLevels, resolveElevatorLevels, resolveElevatorServiceLevelIds, resolveElevatorServiceLevels, } from './systems/elevator/elevator-service';
51
- export { getFenceCenterlineFrameAt, getFenceCenterlineLength, sampleFenceCenterline, } from './systems/fence/fence-centerline';
52
- export { getFenceControlHandle, getFenceSplineFrameAt, getFenceSplineLength, getTwoPointFenceCurveTangents, isSplineFence, sampleFenceSpline, } from './systems/fence/fence-spline';
53
- export { resolveRoofElevation, resolveRoofWallTopElevation } from './systems/roof/roof-elevation';
54
- export { RoofElevationSystem } from './systems/roof/roof-elevation-system';
55
- export { fitRoofFootprint, resolveRoomRoofFootprint, resolveRoomRoofFootprintOnLevel, } from './systems/roof/roof-footprint';
56
- export { resolveSlabPlacementElevation } from './systems/slab/slab-placement';
57
- export { clampSlabElevationForWalls, getSlabElevationUpperBound, } from './systems/slab/slab-support';
58
- export { createDefaultStairSegment, createStairFlightFromStair, } from './systems/stair/stair-flight';
59
- export { stairFootprintAABB } from './systems/stair/stair-footprint';
60
- export { createSurfaceOpeningPreviewController } from './systems/stair/stair-opening-preview';
61
- export { syncAutoStairOpenings } from './systems/stair/stair-opening-sync';
62
- export { StairOpeningSystem } from './systems/stair/stair-opening-system';
63
- export { resolveStairTotalRise, syncStairRises } from './systems/stair/stair-rise';
64
- export { constrainWallCurveOffsetToAvoidIntersections, getClampedWallCurveOffset, getMaxWallCurveOffset, getWallArcData, getWallChordFrame, getWallCurveFrameAt, getWallCurveLength, getWallMidpointHandlePoint, getWallStraightSnapOffset, getWallSurfacePolygon, isCurvedWall, normalizeWallCurveOffset, sampleWallCenterline, } from './systems/wall/wall-curve';
65
- export { DEFAULT_WALL_HEIGHT, DEFAULT_WALL_THICKNESS, getWallPlanFootprint, getWallThickness, } from './systems/wall/wall-footprint';
66
- export { calculateLevelMiters, getAdjacentWallIds, getWallMiterBoundaryPoints, pointToKey, } from './systems/wall/wall-mitering';
67
- export { constrainWallMoveDeltaToAxis, getLinkedWallUpdates, getPerpendicularWallMoveAxis, getPlannedLinkedWallUpdates, planWallMoveJunctions, } from './systems/wall/wall-move';
68
- export { MIN_WALL_HEIGHT, resolveWallEffectiveHeight, resolveWallTop, } from './systems/wall/wall-top';
69
- export { planWallInsertion, planWallSplitAtPoint, } from './systems/wall/wall-topology';
70
- export { cloneLevelSubtree, cloneSceneGraph, forkSceneGraph } from './utils/clone-scene-graph';
71
- export { isObject } from './utils/types';
72
- export { validateBuildJson, } from './validation/validate-build-json';
37
+ export { useRegistryVersion } from './registry/use-registry-version.js';
38
+ export * from './schema/index.js';
39
+ export * from './services/index.js';
40
+ export { isMovable, movePlanToward, moveToward, resolveMovable } from './services/movement.js';
41
+ export { acquireSceneHistoryPause, activeSceneCommitNodeIds, getSceneHistoryPauseDepth, pauseSceneHistory, resetSceneHistoryPauseDepth, resumeSceneHistory, runAsSingleSceneHistoryStep, subscribeSceneCommits, } from './store/history-control.js';
42
+ export { getHistoryDirtyNodeIds } from './store/history-invalidation.js';
43
+ export { useInteractive, } from './store/use-interactive.js';
44
+ export { default as useLiveNodeOverrides, getEffectiveNode, } from './store/use-live-node-overrides.js';
45
+ export { default as useLiveTerrain, } from './store/use-live-terrain.js';
46
+ export { default as useLiveTransforms } from './store/use-live-transforms.js';
47
+ export { acquireSceneReadOnlyLease, applySceneOperationPatch, applyScenePatch, applySceneSnapshot, clearSceneHistory, default as useScene, } from './store/use-scene.js';
48
+ export { resolveElevatorDispatchTarget } from './systems/elevator/elevator-dispatch.js';
49
+ export { getElevatorCabCenterZ, getElevatorCabDepth, getElevatorCabWidth, getElevatorDoorLeafSides, getElevatorDoorLeafWidth, getElevatorDoorLeafX, getElevatorShaftDepth, getElevatorShaftWallThickness, getElevatorShaftWidth, getResolvedElevatorDoorPanelStyle, getResolvedElevatorDoorStyle, getResolvedElevatorShaftStyle, } from './systems/elevator/elevator-geometry.js';
50
+ export { syncAutoElevatorOpenings } from './systems/elevator/elevator-opening-sync.js';
51
+ export { ElevatorOpeningSystem } from './systems/elevator/elevator-opening-system.js';
52
+ export { createElevatorInteractiveState, openElevatorDoor, openElevatorDoorState, queueElevatorRequest, requestElevatorLevel, stepElevatorRuntimeState, stepElevatorRuntimes, } from './systems/elevator/elevator-runtime.js';
53
+ export { resolveElevatorBuildingLevels, resolveElevatorLevels, resolveElevatorServiceLevelIds, resolveElevatorServiceLevels, } from './systems/elevator/elevator-service.js';
54
+ export { getFenceCenterlineFrameAt, getFenceCenterlineLength, sampleFenceCenterline, } from './systems/fence/fence-centerline.js';
55
+ export { getFenceControlHandle, getFenceSplineFrameAt, getFenceSplineLength, getTwoPointFenceCurveTangents, isSplineFence, sampleFenceSpline, } from './systems/fence/fence-spline.js';
56
+ export { resolveRoofElevation, resolveRoofWallTopElevation } from './systems/roof/roof-elevation.js';
57
+ export { RoofElevationSystem } from './systems/roof/roof-elevation-system.js';
58
+ export { fitRoofFootprint, resolveRoomRoofFootprint, resolveRoomRoofFootprintOnLevel, } from './systems/roof/roof-footprint.js';
59
+ export { resolveSlabPlacementElevation } from './systems/slab/slab-placement.js';
60
+ export { clampSlabElevationForWalls, getSlabElevationUpperBound, } from './systems/slab/slab-support.js';
61
+ export { createDefaultStairSegment, createStairFlightFromStair, } from './systems/stair/stair-flight.js';
62
+ export { stairFootprintAABB } from './systems/stair/stair-footprint.js';
63
+ export { createSurfaceOpeningPreviewController } from './systems/stair/stair-opening-preview.js';
64
+ export { syncAutoStairOpenings } from './systems/stair/stair-opening-sync.js';
65
+ export { StairOpeningSystem } from './systems/stair/stair-opening-system.js';
66
+ export { resolveStairTotalRise, syncStairRises } from './systems/stair/stair-rise.js';
67
+ export { constrainWallCurveOffsetToAvoidIntersections, getClampedWallCurveOffset, getMaxWallCurveOffset, getWallArcData, getWallChordFrame, getWallCurveFrameAt, getWallCurveLength, getWallMidpointHandlePoint, getWallStraightSnapOffset, getWallSurfacePolygon, isCurvedWall, normalizeWallCurveOffset, sampleWallCenterline, } from './systems/wall/wall-curve.js';
68
+ export { DEFAULT_WALL_HEIGHT, DEFAULT_WALL_THICKNESS, getWallPlanFootprint, getWallThickness, } from './systems/wall/wall-footprint.js';
69
+ export { planWallMerge } from './systems/wall/wall-merge.js';
70
+ export { calculateLevelMiters, getAdjacentWallIds, getWallMiterBoundaryPoints, pointToKey, } from './systems/wall/wall-mitering.js';
71
+ export { constrainWallMoveDeltaToAxis, getLinkedWallUpdates, getPerpendicularWallMoveAxis, getPlannedLinkedWallUpdates, planWallMoveJunctions, } from './systems/wall/wall-move.js';
72
+ export { planWallDivision, planWallDivisions, planWallRectangle, wallRectangleCorners, } from './systems/wall/wall-operations.js';
73
+ export { MIN_WALL_HEIGHT, resolveWallEffectiveHeight, resolveWallTop, } from './systems/wall/wall-top.js';
74
+ export { planWallInsertion, planWallSplitAtPoint, } from './systems/wall/wall-topology.js';
75
+ export { cloneLevelSubtree, cloneSceneGraph, forkSceneGraph } from './utils/clone-scene-graph.js';
76
+ export { isObject } from './utils/types.js';
77
+ export { validateBuildJson, } from './validation/validate-build-json.js';
@@ -1,4 +1,4 @@
1
- import type { DoorNode, DoorType } from '../schema/nodes/door';
1
+ import type { DoorNode, DoorType } from '../schema/nodes/door.js';
2
2
  export declare const SECTIONAL_GARAGE_RENDER_OPEN_SCALE = 0.88;
3
3
  export declare function clampDoorOperationState(value: number | undefined): number;
4
4
  export declare function isOperationDoorType(doorType: DoorType | DoorNode['doorType'] | string | undefined): doorType is "folding" | "pocket" | "barn" | "sliding" | "garage-sectional" | "garage-rollup" | "garage-tiltup";
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Test if an item's footprint overlaps with a polygon.
3
+ * Checks: any item corner inside polygon, or any polygon vertex inside item AABB, or edges intersect.
4
+ */
5
+ export declare function itemOverlapsPolygon(position: [number, number, number], dimensions: [number, number, number], rotation: [number, number, number], polygon: Array<[number, number]>, inset?: number): boolean;
6
+ //# sourceMappingURL=item-polygon-overlap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"item-polygon-overlap.d.ts","sourceRoot":"","sources":["../../src/lib/item-polygon-overlap.ts"],"names":[],"mappings":"AA0EA;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAClC,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EACpC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAClC,OAAO,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAChC,KAAK,SAAI,GACR,OAAO,CA8BT"}
@@ -0,0 +1,67 @@
1
+ import { pointInPolygon } from '../systems/slab/slab-support.js';
2
+ import { planFootprintCorners } from './plan-footprint.js';
3
+ /**
4
+ * Test if two line segments (a1->a2) and (b1->b2) intersect.
5
+ */
6
+ function segmentsIntersect(ax1, az1, ax2, az2, bx1, bz1, bx2, bz2) {
7
+ const cross = (ox, oz, ax, az, bx, bz) => (ax - ox) * (bz - oz) - (az - oz) * (bx - ox);
8
+ const d1 = cross(bx1, bz1, bx2, bz2, ax1, az1);
9
+ const d2 = cross(bx1, bz1, bx2, bz2, ax2, az2);
10
+ const d3 = cross(ax1, az1, ax2, az2, bx1, bz1);
11
+ const d4 = cross(ax1, az1, ax2, az2, bx2, bz2);
12
+ if (((d1 > 0 && d2 < 0) || (d1 < 0 && d2 > 0)) && ((d3 > 0 && d4 < 0) || (d3 < 0 && d4 > 0))) {
13
+ return true;
14
+ }
15
+ // Collinear touching cases
16
+ const onSeg = (px, pz, qx, qz, rx, rz) => Math.min(px, qx) <= rx &&
17
+ rx <= Math.max(px, qx) &&
18
+ Math.min(pz, qz) <= rz &&
19
+ rz <= Math.max(pz, qz);
20
+ if (d1 === 0 && onSeg(bx1, bz1, bx2, bz2, ax1, az1))
21
+ return true;
22
+ if (d2 === 0 && onSeg(bx1, bz1, bx2, bz2, ax2, az2))
23
+ return true;
24
+ if (d3 === 0 && onSeg(ax1, az1, ax2, az2, bx1, bz1))
25
+ return true;
26
+ if (d4 === 0 && onSeg(ax1, az1, ax2, az2, bx2, bz2))
27
+ return true;
28
+ return false;
29
+ }
30
+ /**
31
+ * Test if a line segment intersects any edge of a polygon.
32
+ */
33
+ function segmentIntersectsPolygon(sx1, sz1, sx2, sz2, polygon) {
34
+ const n = polygon.length;
35
+ for (let i = 0; i < n; i++) {
36
+ const j = (i + 1) % n;
37
+ if (segmentsIntersect(sx1, sz1, sx2, sz2, polygon[i][0], polygon[i][1], polygon[j][0], polygon[j][1])) {
38
+ return true;
39
+ }
40
+ }
41
+ return false;
42
+ }
43
+ /**
44
+ * Test if an item's footprint overlaps with a polygon.
45
+ * Checks: any item corner inside polygon, or any polygon vertex inside item AABB, or edges intersect.
46
+ */
47
+ export function itemOverlapsPolygon(position, dimensions, rotation, polygon, inset = 0) {
48
+ const corners = planFootprintCorners(position, dimensions, rotation[1], inset);
49
+ // Check if any item corner is inside the polygon
50
+ for (const [cx, cz] of corners) {
51
+ if (pointInPolygon(cx, cz, polygon))
52
+ return true;
53
+ }
54
+ // Check if any polygon vertex is inside the item footprint
55
+ // (handles case where slab is fully inside a large item)
56
+ for (const [px, pz] of polygon) {
57
+ if (pointInPolygon(px, pz, corners))
58
+ return true;
59
+ }
60
+ // Check if any item edge intersects any polygon edge
61
+ for (let i = 0; i < 4; i++) {
62
+ const j = (i + 1) % 4;
63
+ if (segmentIntersectsPolygon(corners[i][0], corners[i][1], corners[j][0], corners[j][1], polygon))
64
+ return true;
65
+ }
66
+ return false;
67
+ }
@@ -1,4 +1,4 @@
1
- import type { LevelNode } from '../schema';
1
+ import type { LevelNode } from '../schema/index.js';
2
2
  export declare function getDefaultLevelName(level: number): string;
3
3
  export declare function getLevelDisplayName(level: Pick<LevelNode, 'name' | 'level'>): string;
4
4
  //# sourceMappingURL=level-name.d.ts.map
@@ -1,7 +1,7 @@
1
- import type { MeasurementFeature, MeasurementFeatureBinding } from '../registry/types';
2
- import type { ConstructionDimensionNode } from '../schema/nodes/construction-dimension';
3
- import type { MeasurementAnchor, MeasurementPayload, MeasurementPoint } from '../schema/nodes/measurement';
4
- import type { AnyNodeId } from '../schema/types';
1
+ import type { MeasurementFeature, MeasurementFeatureBinding } from '../registry/types.js';
2
+ import type { ConstructionDimensionNode } from '../schema/nodes/construction-dimension.js';
3
+ import type { MeasurementAnchor, MeasurementPayload, MeasurementPoint } from '../schema/nodes/measurement.js';
4
+ import type { AnyNodeId } from '../schema/types.js';
5
5
  export declare const MEASUREMENT_PLANAR_TOLERANCE = 0.01;
6
6
  export declare function measurementDistance(start: MeasurementPoint, end: MeasurementPoint): number;
7
7
  export declare function measurementAnchorFallback(anchor: MeasurementAnchor): MeasurementPoint;
@@ -0,0 +1,12 @@
1
+ import type { AnyNode } from '../schema/index.js';
2
+ /**
3
+ * Whether a node's `visible: false` also hides the nodes beneath it.
4
+ *
5
+ * A Site is the parcel reference, not a container: hiding it hides its own
6
+ * ground fill and boundary only, and the buildings on it keep their own flag.
7
+ * Every other kind hides its whole subtree. Exports, the 2D plan and the
8
+ * validators all read this one rule so a hidden Site can never empty a scene.
9
+ */
10
+ export declare function hidesDescendants(node: Pick<AnyNode, 'type'>): boolean;
11
+ export declare const HIDDEN_SITE_NOTE = "A hidden Site hides only its own ground fill and boundary; the buildings on it stay visible in the viewport, the 2D plan and every export.";
12
+ //# sourceMappingURL=node-visibility.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-visibility.d.ts","sourceRoot":"","sources":["../../src/lib/node-visibility.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAExC;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,OAAO,CAErE;AAED,eAAO,MAAM,gBAAgB,+IACiH,CAAA"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Whether a node's `visible: false` also hides the nodes beneath it.
3
+ *
4
+ * A Site is the parcel reference, not a container: hiding it hides its own
5
+ * ground fill and boundary only, and the buildings on it keep their own flag.
6
+ * Every other kind hides its whole subtree. Exports, the 2D plan and the
7
+ * validators all read this one rule so a hidden Site can never empty a scene.
8
+ */
9
+ export function hidesDescendants(node) {
10
+ return node.type !== 'site';
11
+ }
12
+ export const HIDDEN_SITE_NOTE = 'A hidden Site hides only its own ground fill and boundary; the buildings on it stay visible in the viewport, the 2D plan and every export.';
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Pure plan (XZ) footprint math — one source for spatial-grid collision and
3
+ * alignment anchors. The `@pascal-app/core/plan-footprint` subpath is the seam
4
+ * for a follow-up that consolidates MCP layout clearance onto these helpers.
5
+ *
6
+ * ## Invariant
7
+ * Callers share `planFootprintCorners` / `planFootprintAABB`. Do not invent a
8
+ * third rotation-aware plan AABB path beside this module.
9
+ *
10
+ * ## Gap call-site meanings (for the follow-up overlap helper)
11
+ * When an expand-then-intersect overlap check lands here, treat `gap` as
12
+ * **minimum free space** (expand each box by `gap`, then intersect):
13
+ * - Packing / furnish: typically `gap ≈ 0.08` for breathing room between items
14
+ * - check / verify collision: use `gap = 0` for true interpenetration only
15
+ * Do not share one default blindly across both questions.
16
+ *
17
+ * ## Scope
18
+ * Foundation only. Does not move door keep-outs, level ancestry, or furnish
19
+ * search into core. Item-scaled / attach-aware wrappers stay with callers
20
+ * until the MCP consolidation follow-up.
21
+ */
22
+ export type PlanAabb = {
23
+ minX: number;
24
+ maxX: number;
25
+ minZ: number;
26
+ maxZ: number;
27
+ };
28
+ export type PlanVec2 = [number, number];
29
+ /**
30
+ * Four XZ corners of a centred footprint at `position`, rotated by Y
31
+ * rotation. Matches spatial-grid `getItemFootprint` convention:
32
+ * local +X maps with (cos, sin), local +Z with (-sin, cos) terms as used
33
+ * in the existing corner formula.
34
+ */
35
+ export declare function planFootprintCorners(position: readonly [number, number, number], dimensions: readonly [number, number, number], rotationY: number, inset?: number): PlanVec2[];
36
+ /**
37
+ * Axis-aligned XZ extent of a footprint. Equivalent to the AABB of
38
+ * `planFootprintCorners` (no inset) and to spatial-grid `footprintBoundsXZ`.
39
+ */
40
+ export declare function planFootprintAABB(position: readonly [number, number, number], dimensions: readonly [number, number, number], rotationY: number): PlanAabb;
41
+ //# sourceMappingURL=plan-footprint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan-footprint.d.ts","sourceRoot":"","sources":["../../src/lib/plan-footprint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAEvC;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAC3C,UAAU,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAC7C,SAAS,EAAE,MAAM,EACjB,KAAK,SAAI,GACR,QAAQ,EAAE,CAcZ;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAC3C,UAAU,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAC7C,SAAS,EAAE,MAAM,GAChB,QAAQ,CAYV"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Pure plan (XZ) footprint math — one source for spatial-grid collision and
3
+ * alignment anchors. The `@pascal-app/core/plan-footprint` subpath is the seam
4
+ * for a follow-up that consolidates MCP layout clearance onto these helpers.
5
+ *
6
+ * ## Invariant
7
+ * Callers share `planFootprintCorners` / `planFootprintAABB`. Do not invent a
8
+ * third rotation-aware plan AABB path beside this module.
9
+ *
10
+ * ## Gap call-site meanings (for the follow-up overlap helper)
11
+ * When an expand-then-intersect overlap check lands here, treat `gap` as
12
+ * **minimum free space** (expand each box by `gap`, then intersect):
13
+ * - Packing / furnish: typically `gap ≈ 0.08` for breathing room between items
14
+ * - check / verify collision: use `gap = 0` for true interpenetration only
15
+ * Do not share one default blindly across both questions.
16
+ *
17
+ * ## Scope
18
+ * Foundation only. Does not move door keep-outs, level ancestry, or furnish
19
+ * search into core. Item-scaled / attach-aware wrappers stay with callers
20
+ * until the MCP consolidation follow-up.
21
+ */
22
+ /**
23
+ * Four XZ corners of a centred footprint at `position`, rotated by Y
24
+ * rotation. Matches spatial-grid `getItemFootprint` convention:
25
+ * local +X maps with (cos, sin), local +Z with (-sin, cos) terms as used
26
+ * in the existing corner formula.
27
+ */
28
+ export function planFootprintCorners(position, dimensions, rotationY, inset = 0) {
29
+ const [x, , z] = position;
30
+ const [w, , d] = dimensions;
31
+ const halfW = Math.max(0, w / 2 - inset);
32
+ const halfD = Math.max(0, d / 2 - inset);
33
+ const cos = Math.cos(rotationY);
34
+ const sin = Math.sin(rotationY);
35
+ return [
36
+ [x + (-halfW * cos + halfD * sin), z + (-halfW * sin - halfD * cos)],
37
+ [x + (halfW * cos + halfD * sin), z + (halfW * sin - halfD * cos)],
38
+ [x + (halfW * cos - halfD * sin), z + (halfW * sin + halfD * cos)],
39
+ [x + (-halfW * cos - halfD * sin), z + (-halfW * sin + halfD * cos)],
40
+ ];
41
+ }
42
+ /**
43
+ * Axis-aligned XZ extent of a footprint. Equivalent to the AABB of
44
+ * `planFootprintCorners` (no inset) and to spatial-grid `footprintBoundsXZ`.
45
+ */
46
+ export function planFootprintAABB(position, dimensions, rotationY) {
47
+ const [width, , depth] = dimensions;
48
+ const cos = Math.abs(Math.cos(rotationY));
49
+ const sin = Math.abs(Math.sin(rotationY));
50
+ const rotatedW = width * cos + depth * sin;
51
+ const rotatedD = width * sin + depth * cos;
52
+ return {
53
+ minX: position[0] - rotatedW / 2,
54
+ maxX: position[0] + rotatedW / 2,
55
+ minZ: position[2] - rotatedD / 2,
56
+ maxZ: position[2] + rotatedD / 2,
57
+ };
58
+ }
@@ -1,4 +1,4 @@
1
- import type { WallNode } from '../schema';
1
+ import type { WallNode } from '../schema/index.js';
2
2
  type SceneNodes = Record<string, any>;
3
3
  type Point = [number, number];
4
4
  type IndexedRoom = {
@@ -1,4 +1,4 @@
1
- import { getClampedWallCurveOffset } from '../systems/wall/wall-curve';
1
+ import { getClampedWallCurveOffset } from '../systems/wall/wall-curve.js';
2
2
  const CELL_SIZE = 2;
3
3
  function bboxOf(points) {
4
4
  let minX = Number.POSITIVE_INFINITY;
@@ -1,4 +1,4 @@
1
- import type { AnyNode, AnyNodeId } from '../schema/types';
1
+ import type { AnyNode, AnyNodeId } from '../schema/types.js';
2
2
  export declare function selectionProxyIdFromMetadata(metadata: unknown): AnyNodeId | null;
3
3
  export declare function resolveSelectionProxyId(node: AnyNode, nodes: Readonly<Record<string, AnyNode | undefined>>): AnyNodeId;
4
4
  //# sourceMappingURL=selection-proxy.d.ts.map
@@ -1,5 +1,5 @@
1
- import type { GeometryContext } from '../registry/types';
2
- import type { AnyNode, AnyNodeId, SlabNode, WallNode } from '../schema';
1
+ import type { GeometryContext } from '../registry/types.js';
2
+ import type { AnyNode, AnyNodeId, SlabNode, WallNode } from '../schema/index.js';
3
3
  export type SlabPolygonContext = {
4
4
  /** Walls on the slab's level. */
5
5
  walls: WallNode[];
@@ -1,5 +1,5 @@
1
- import { isCurvedWall, sampleWallCenterline } from '../systems/wall/wall-curve';
2
- import { getWallThickness } from '../systems/wall/wall-footprint';
1
+ import { isCurvedWall, sampleWallCenterline } from '../systems/wall/wall-curve.js';
2
+ import { getWallThickness } from '../systems/wall/wall-footprint.js';
3
3
  /**
4
4
  * Render-time slab polygon rules.
5
5
  *
@@ -1,4 +1,4 @@
1
- import { type AnyNodeId, type CeilingNode as CeilingNodeType, type SlabNode as SlabNodeType, type WallNode, type ZoneNode as ZoneNodeType } from '../schema';
1
+ import { type AnyNodeId, type CeilingNode as CeilingNodeType, type SlabNode as SlabNodeType, type WallNode, type ZoneNode as ZoneNodeType } from '../schema/index.js';
2
2
  type Point2D = {
3
3
  x: number;
4
4
  y: number;
@@ -1 +1 @@
1
- {"version":3,"file":"space-detection.d.ts","sourceRoot":"","sources":["../../src/lib/space-detection.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,SAAS,EAEd,KAAK,WAAW,IAAI,eAAe,EAGnC,KAAK,QAAQ,IAAI,YAAY,EAC7B,KAAK,QAAQ,EAEb,KAAK,QAAQ,IAAI,YAAY,EAC9B,MAAM,WAAW,CAAA;AAgClB,KAAK,OAAO,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAEvC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAA;IACtB,IAAI,EAAE,OAAO,GAAG,MAAM,CAAA;IACtB,MAAM,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CAChC,CAAA;AAED,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,CAAC,EAAE,EAAE,SAAS,KAAK,OAAO,GAClC,YAAY,CAAC,SAAS,CAAC,CAgBzB;AAED,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,OAAO,EAAE,EAAE,EACzB,aAAa,EAAE,YAAY,EAAE,EAC7B,OAAO,GAAE,uBAA4B,EACrC,WAAW,GAAE,KAAK,CAAC;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAiB,GACpD,gBAAgB,CAiHlB;AA2BD,wBAAgB,wBAAwB,CACtC,YAAY,EAAE,OAAO,EAAE,EAAE,EACzB,gBAAgB,EAAE,eAAe,EAAE,EACnC,OAAO,GAAE,0BAA+B,EACxC,cAAc,GAAE,KAAK,CAAC;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAoB,GAC1D,mBAAmB,CAmKrB;AAkDD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE;;;;;EAEtE;AAoSD,mGAAmG;AACnG,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C;AAED,oFAAoF;AACpF,wBAAgB,oBAAoB,IAAI,IAAI,CAG3C;AAED,2EAA2E;AAC3E,wBAAgB,sBAAsB,IAAI,OAAO,CAEhD;AAED,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,GAAG,EACf,WAAW,EAAE,GAAG,EAChB,OAAO,GAAE,yBAA8B,GACtC,MAAM,IAAI,CAmKZ;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,OAAO,CAiBjF"}
@@ -1,14 +1,14 @@
1
- import { GROUND_SUPPORT_ID } from '../hooks/spatial-grid/support-host-id';
2
- import { CeilingNode, SlabNode, ZoneNode, } from '../schema';
3
- import { DEFAULT_LEVEL_HEIGHT } from '../services/level-height';
4
- import { CEILING_CLAMP_MARGIN, findLevelAboveId, getCeilingClampBound, getLevelBelow, getLevelElevations, getStoredLevelHeight, } from '../services/storey';
5
- import { activeSceneCommitNodeIds, getSceneHistoryPauseDepth, pauseSceneHistory, resumeSceneHistory, subscribeSceneCommits, } from '../store/history-control';
6
- import { computeWallSlabSupport } from '../systems/slab/slab-support';
7
- import { getClampedWallCurveOffset, getWallCurveFrameAt, isCurvedWall, } from '../systems/wall/wall-curve';
8
- import { resolveWallTop } from '../systems/wall/wall-top';
9
- import { simplifyClosedPolygon } from './polygon-geometry';
10
- import { distanceToSegment, RoomTopologyIndex, } from './room-topology-index';
11
- import { levelBaseElevationAt } from './terrain-support';
1
+ import { GROUND_SUPPORT_ID } from '../hooks/spatial-grid/support-host-id.js';
2
+ import { CeilingNode, SlabNode, ZoneNode, } from '../schema/index.js';
3
+ import { DEFAULT_LEVEL_HEIGHT } from '../services/level-height.js';
4
+ import { CEILING_CLAMP_MARGIN, findLevelAboveId, getCeilingClampBound, getLevelBelow, getLevelElevations, getStoredLevelHeight, } from '../services/storey.js';
5
+ import { activeSceneCommitNodeIds, getSceneHistoryPauseDepth, pauseSceneHistory, resumeSceneHistory, subscribeSceneCommits, } from '../store/history-control.js';
6
+ import { computeWallSlabSupport } from '../systems/slab/slab-support.js';
7
+ import { getClampedWallCurveOffset, getWallCurveFrameAt, isCurvedWall, } from '../systems/wall/wall-curve.js';
8
+ import { resolveWallTop } from '../systems/wall/wall-top.js';
9
+ import { simplifyClosedPolygon } from './polygon-geometry.js';
10
+ import { distanceToSegment, RoomTopologyIndex, } from './room-topology-index.js';
11
+ import { levelBaseElevationAt } from './terrain-support.js';
12
12
  const DEFAULT_AUTO_SLAB_ELEVATION = 0.05;
13
13
  const CEILING_HEIGHT_EPSILON = 1e-6;
14
14
  const ROOM_CURVE_TOLERANCE = 0.04;
@@ -1858,6 +1858,11 @@ export function initSpaceDetectionSync(sceneStore, editorStore, options = {}) {
1858
1858
  return;
1859
1859
  adoptSceneBaseline(commit.current.nodes);
1860
1860
  });
1861
+ // Keep reconciliation in this synchronous store subscription. Zundo emits
1862
+ // the originating local SceneCommit only after subscribers return, so the
1863
+ // history-paused derived writes below join that commit's current snapshot
1864
+ // and undo step. Running from subscribeSceneCommits would cross the snapshot
1865
+ // boundary, and the paused writes would emit no replacement commit.
1861
1866
  const unsubscribe = sceneStore.subscribe((state) => {
1862
1867
  if (isProcessing)
1863
1868
  return;
@@ -30,7 +30,7 @@
30
30
  * one in-flight gesture and dies with it, which is cheaper and clearer than
31
31
  * rebuilding a coverage map per pointer-move.
32
32
  */
33
- import { type HeightPatch, type TerrainField } from './terrain-field';
33
+ import { type HeightPatch, type TerrainField } from './terrain-field.js';
34
34
  export type BrushShape = 'round' | 'square';
35
35
  /**
36
36
  * `raise`/`lower` are one verb with an inverted sign at the call site, matching
@@ -30,7 +30,7 @@
30
30
  * one in-flight gesture and dies with it, which is cheaper and clearer than
31
31
  * rebuilding a coverage map per pointer-move.
32
32
  */
33
- import { heightAt, heightAtSample, quantize, } from './terrain-field';
33
+ import { heightAt, heightAtSample, quantize, } from './terrain-field.js';
34
34
  export const DEFAULT_BRUSH_SETTINGS = {
35
35
  radius: 2,
36
36
  strength: 0.6,
@@ -24,8 +24,8 @@
24
24
  * the wire format must not depend on that being true of the machine that saved
25
25
  * the scene.
26
26
  */
27
- import { type TerrainData } from '../schema/terrain';
28
- import type { HeightPatch, TerrainField } from './terrain-field';
27
+ import { type TerrainData } from '../schema/terrain.js';
28
+ import type { HeightPatch, TerrainField } from './terrain-field.js';
29
29
  export type EncodedHeightPatch = Omit<HeightPatch, 'heights'> & {
30
30
  heights: string;
31
31
  };
@@ -24,7 +24,7 @@
24
24
  * the wire format must not depend on that being true of the machine that saved
25
25
  * the scene.
26
26
  */
27
- import { MAX_TERRAIN_SIDE } from '../schema/terrain';
27
+ import { MAX_TERRAIN_SIDE } from '../schema/terrain.js';
28
28
  const BASE64_ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
29
29
  function encodeBase64(bytes) {
30
30
  let out = '';
@@ -20,7 +20,7 @@
20
20
  * ladder, so the returned point is on the same rendered triangle plane
21
21
  * `heightAt` reports.
22
22
  */
23
- import { type TerrainField } from './terrain-field';
23
+ import { type TerrainField } from './terrain-field.js';
24
24
  export type TerrainHit = {
25
25
  /** Distance along the (unnormalized) direction vector. */
26
26
  readonly t: number;
@@ -20,7 +20,7 @@
20
20
  * ladder, so the returned point is on the same rendered triangle plane
21
21
  * `heightAt` reports.
22
22
  */
23
- import { heightAt } from './terrain-field';
23
+ import { heightAt } from './terrain-field.js';
24
24
  /** Bisection depth. 20 halvings of one cell is sub-micrometre at any sane spacing. */
25
25
  const REFINE_ITERATIONS = 20;
26
26
  /**
@@ -17,9 +17,9 @@
17
17
  * the commit, the next read is a cache hit, so a stroke never decodes base64 even
18
18
  * once, let alone per dab.
19
19
  */
20
- import type { SiteNode } from '../schema/nodes/site';
21
- import type { TerrainData } from '../schema/terrain';
22
- import { createTerrainField, type TerrainField } from './terrain-field';
20
+ import type { SiteNode } from '../schema/nodes/site.js';
21
+ import type { TerrainData } from '../schema/terrain.js';
22
+ import { createTerrainField, type TerrainField } from './terrain-field.js';
23
23
  /**
24
24
  * The terrain field for a site, or `null` when the site has no sculpted terrain.
25
25
  *