@pascal-app/core 0.9.2 → 1.0.0-beta.2

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 (339) hide show
  1. package/README.md +17 -10
  2. package/dist/events/bus.d.ts +21 -2
  3. package/dist/events/bus.d.ts.map +1 -1
  4. package/dist/hooks/spatial-grid/floor-placed-elevation.d.ts +17 -1
  5. package/dist/hooks/spatial-grid/floor-placed-elevation.d.ts.map +1 -1
  6. package/dist/hooks/spatial-grid/floor-placed-elevation.js +61 -8
  7. package/dist/hooks/spatial-grid/spatial-grid-manager.d.ts +116 -66
  8. package/dist/hooks/spatial-grid/spatial-grid-manager.d.ts.map +1 -1
  9. package/dist/hooks/spatial-grid/spatial-grid-manager.js +319 -441
  10. package/dist/hooks/spatial-grid/spatial-grid-sync.d.ts +46 -1
  11. package/dist/hooks/spatial-grid/spatial-grid-sync.d.ts.map +1 -1
  12. package/dist/hooks/spatial-grid/spatial-grid-sync.js +204 -12
  13. package/dist/hooks/spatial-grid/support-host-id.d.ts +3 -0
  14. package/dist/hooks/spatial-grid/support-host-id.d.ts.map +1 -0
  15. package/dist/hooks/spatial-grid/support-host-id.js +2 -0
  16. package/dist/hooks/spatial-grid/support-host-patch.d.ts +51 -0
  17. package/dist/hooks/spatial-grid/support-host-patch.d.ts.map +1 -0
  18. package/dist/hooks/spatial-grid/support-host-patch.js +164 -0
  19. package/dist/index.d.ts +23 -11
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +22 -10
  22. package/dist/lib/measurement-geometry.d.ts +4 -0
  23. package/dist/lib/measurement-geometry.d.ts.map +1 -1
  24. package/dist/lib/measurement-geometry.js +27 -10
  25. package/dist/lib/slab-polygon.d.ts.map +1 -1
  26. package/dist/lib/slab-polygon.js +33 -1
  27. package/dist/lib/space-detection.d.ts +15 -4
  28. package/dist/lib/space-detection.d.ts.map +1 -1
  29. package/dist/lib/space-detection.js +232 -91
  30. package/dist/lib/terrain-brush.d.ts +163 -0
  31. package/dist/lib/terrain-brush.d.ts.map +1 -0
  32. package/dist/lib/terrain-brush.js +359 -0
  33. package/dist/lib/terrain-codec.d.ts +51 -0
  34. package/dist/lib/terrain-codec.d.ts.map +1 -0
  35. package/dist/lib/terrain-codec.js +167 -0
  36. package/dist/lib/terrain-field.d.ts +150 -0
  37. package/dist/lib/terrain-field.d.ts.map +1 -0
  38. package/dist/lib/terrain-field.js +248 -0
  39. package/dist/lib/terrain-raycast.d.ts +44 -0
  40. package/dist/lib/terrain-raycast.d.ts.map +1 -0
  41. package/dist/lib/terrain-raycast.js +188 -0
  42. package/dist/lib/terrain-source.d.ts +60 -0
  43. package/dist/lib/terrain-source.d.ts.map +1 -0
  44. package/dist/lib/terrain-source.js +90 -0
  45. package/dist/lib/terrain-support.d.ts +85 -0
  46. package/dist/lib/terrain-support.d.ts.map +1 -0
  47. package/dist/lib/terrain-support.js +218 -0
  48. package/dist/lib/zone-quantities.d.ts +1 -1
  49. package/dist/lib/zone-quantities.d.ts.map +1 -1
  50. package/dist/lib/zone-quantities.js +311 -66
  51. package/dist/material-library.d.ts +9 -1
  52. package/dist/material-library.d.ts.map +1 -1
  53. package/dist/material-library.js +56 -4
  54. package/dist/registry/handles.d.ts +16 -1
  55. package/dist/registry/handles.d.ts.map +1 -1
  56. package/dist/registry/index.d.ts +1 -1
  57. package/dist/registry/index.d.ts.map +1 -1
  58. package/dist/registry/subtree.d.ts.map +1 -1
  59. package/dist/registry/subtree.js +5 -2
  60. package/dist/registry/types.d.ts +83 -1
  61. package/dist/registry/types.d.ts.map +1 -1
  62. package/dist/schema/index.d.ts +6 -3
  63. package/dist/schema/index.d.ts.map +1 -1
  64. package/dist/schema/index.js +6 -3
  65. package/dist/schema/nodes/cabinet.d.ts +2 -0
  66. package/dist/schema/nodes/cabinet.d.ts.map +1 -1
  67. package/dist/schema/nodes/cabinet.js +4 -2
  68. package/dist/schema/nodes/ceiling.d.ts +1 -1
  69. package/dist/schema/nodes/ceiling.d.ts.map +1 -1
  70. package/dist/schema/nodes/ceiling.js +7 -1
  71. package/dist/schema/nodes/column.d.ts +1 -0
  72. package/dist/schema/nodes/column.d.ts.map +1 -1
  73. package/dist/schema/nodes/column.js +2 -0
  74. package/dist/schema/nodes/construction-dimension.d.ts +195 -0
  75. package/dist/schema/nodes/construction-dimension.d.ts.map +1 -0
  76. package/dist/schema/nodes/construction-dimension.js +151 -0
  77. package/dist/schema/nodes/door.d.ts +29 -0
  78. package/dist/schema/nodes/door.d.ts.map +1 -1
  79. package/dist/schema/nodes/door.js +20 -0
  80. package/dist/schema/nodes/duct-terminal.d.ts +1 -0
  81. package/dist/schema/nodes/duct-terminal.d.ts.map +1 -1
  82. package/dist/schema/nodes/duct-terminal.js +2 -0
  83. package/dist/schema/nodes/fence.d.ts +2 -0
  84. package/dist/schema/nodes/fence.d.ts.map +1 -1
  85. package/dist/schema/nodes/fence.js +8 -0
  86. package/dist/schema/nodes/hvac-equipment.d.ts +1 -0
  87. package/dist/schema/nodes/hvac-equipment.d.ts.map +1 -1
  88. package/dist/schema/nodes/hvac-equipment.js +2 -0
  89. package/dist/schema/nodes/item.d.ts +1 -0
  90. package/dist/schema/nodes/item.d.ts.map +1 -1
  91. package/dist/schema/nodes/item.js +13 -0
  92. package/dist/schema/nodes/level.d.ts +2 -1
  93. package/dist/schema/nodes/level.d.ts.map +1 -1
  94. package/dist/schema/nodes/level.js +12 -33
  95. package/dist/schema/nodes/shelf.d.ts +1 -0
  96. package/dist/schema/nodes/shelf.d.ts.map +1 -1
  97. package/dist/schema/nodes/shelf.js +2 -0
  98. package/dist/schema/nodes/site.d.ts +9 -0
  99. package/dist/schema/nodes/site.d.ts.map +1 -1
  100. package/dist/schema/nodes/site.js +8 -6
  101. package/dist/schema/nodes/slab.d.ts +5 -0
  102. package/dist/schema/nodes/slab.d.ts.map +1 -1
  103. package/dist/schema/nodes/slab.js +14 -2
  104. package/dist/schema/nodes/spawn.d.ts +1 -0
  105. package/dist/schema/nodes/spawn.d.ts.map +1 -1
  106. package/dist/schema/nodes/spawn.js +2 -0
  107. package/dist/schema/nodes/stair.d.ts +3 -1
  108. package/dist/schema/nodes/stair.d.ts.map +1 -1
  109. package/dist/schema/nodes/stair.js +8 -1
  110. package/dist/schema/nodes/structural-grid.d.ts +27 -0
  111. package/dist/schema/nodes/structural-grid.d.ts.map +1 -0
  112. package/dist/schema/nodes/structural-grid.js +17 -0
  113. package/dist/schema/nodes/wall.d.ts +5 -2
  114. package/dist/schema/nodes/wall.d.ts.map +1 -1
  115. package/dist/schema/nodes/wall.js +13 -4
  116. package/dist/schema/nodes/window.d.ts +29 -0
  117. package/dist/schema/nodes/window.d.ts.map +1 -1
  118. package/dist/schema/nodes/window.js +18 -0
  119. package/dist/schema/nodes/zone.d.ts +20 -0
  120. package/dist/schema/nodes/zone.d.ts.map +1 -1
  121. package/dist/schema/nodes/zone.js +15 -0
  122. package/dist/schema/terrain.d.ts +28 -0
  123. package/dist/schema/terrain.d.ts.map +1 -0
  124. package/dist/schema/terrain.js +30 -0
  125. package/dist/schema/types.d.ts +211 -3
  126. package/dist/schema/types.d.ts.map +1 -1
  127. package/dist/schema/types.js +4 -0
  128. package/dist/services/__fixtures__/wall-plane-top-boundary-repro.d.ts +80 -0
  129. package/dist/services/__fixtures__/wall-plane-top-boundary-repro.d.ts.map +1 -0
  130. package/dist/services/__fixtures__/wall-plane-top-boundary-repro.js +89 -0
  131. package/dist/services/index.d.ts +2 -1
  132. package/dist/services/index.d.ts.map +1 -1
  133. package/dist/services/index.js +2 -1
  134. package/dist/services/level-height.d.ts +8 -9
  135. package/dist/services/level-height.d.ts.map +1 -1
  136. package/dist/services/level-height.js +48 -16
  137. package/dist/services/storey.d.ts +103 -0
  138. package/dist/services/storey.d.ts.map +1 -0
  139. package/dist/services/storey.js +296 -0
  140. package/dist/store/actions/node-actions.d.ts.map +1 -1
  141. package/dist/store/actions/node-actions.js +47 -3
  142. package/dist/store/history-control.d.ts +20 -0
  143. package/dist/store/history-control.d.ts.map +1 -1
  144. package/dist/store/history-control.js +110 -13
  145. package/dist/store/use-live-terrain.d.ts +65 -0
  146. package/dist/store/use-live-terrain.d.ts.map +1 -0
  147. package/dist/store/use-live-terrain.js +31 -0
  148. package/dist/store/use-live-transforms.d.ts +8 -0
  149. package/dist/store/use-live-transforms.d.ts.map +1 -1
  150. package/dist/store/use-scene.d.ts +31 -2
  151. package/dist/store/use-scene.d.ts.map +1 -1
  152. package/dist/store/use-scene.js +638 -8
  153. package/dist/systems/elevator/elevator-opening-system.d.ts +1 -0
  154. package/dist/systems/elevator/elevator-opening-system.d.ts.map +1 -1
  155. package/dist/systems/elevator/elevator-opening-system.js +27 -21
  156. package/dist/systems/elevator/elevator-service.d.ts +0 -2
  157. package/dist/systems/elevator/elevator-service.d.ts.map +1 -1
  158. package/dist/systems/elevator/elevator-service.js +2 -24
  159. package/dist/systems/slab/slab-placement.d.ts +11 -0
  160. package/dist/systems/slab/slab-placement.d.ts.map +1 -0
  161. package/dist/systems/slab/slab-placement.js +14 -0
  162. package/dist/systems/slab/slab-support.d.ts +150 -0
  163. package/dist/systems/slab/slab-support.d.ts.map +1 -0
  164. package/dist/systems/slab/slab-support.js +575 -0
  165. package/dist/systems/stair/stair-opening-preview.d.ts +1060 -935
  166. package/dist/systems/stair/stair-opening-preview.d.ts.map +1 -1
  167. package/dist/systems/stair/stair-opening-sync.d.ts.map +1 -1
  168. package/dist/systems/stair/stair-opening-sync.js +18 -15
  169. package/dist/systems/stair/stair-opening-system.d.ts.map +1 -1
  170. package/dist/systems/stair/stair-opening-system.js +32 -4
  171. package/dist/systems/stair/stair-rise.d.ts +22 -0
  172. package/dist/systems/stair/stair-rise.d.ts.map +1 -0
  173. package/dist/systems/stair/stair-rise.js +79 -0
  174. package/dist/systems/wall/wall-curve.d.ts +10 -0
  175. package/dist/systems/wall/wall-curve.d.ts.map +1 -1
  176. package/dist/systems/wall/wall-curve.js +1 -1
  177. package/dist/systems/wall/wall-mitering.js +6 -6
  178. package/dist/systems/wall/wall-top.d.ts +40 -0
  179. package/dist/systems/wall/wall-top.d.ts.map +1 -0
  180. package/dist/systems/wall/wall-top.js +46 -0
  181. package/dist/utils/clone-scene-graph.d.ts.map +1 -1
  182. package/dist/utils/clone-scene-graph.js +34 -3
  183. package/dist/utils/heal-scene-graph.d.ts +1 -1
  184. package/dist/utils/heal-scene-graph.d.ts.map +1 -1
  185. package/dist/utils/heal-scene-graph.js +25 -9
  186. package/dist/validation/validate-build-json.d.ts +2 -0
  187. package/dist/validation/validate-build-json.d.ts.map +1 -1
  188. package/dist/validation/validate-build-json.js +59 -3
  189. package/package.json +2 -2
  190. package/dist/hooks/scene-registry/scene-registry.test.d.ts +0 -2
  191. package/dist/hooks/scene-registry/scene-registry.test.d.ts.map +0 -1
  192. package/dist/hooks/scene-registry/scene-registry.test.js +0 -26
  193. package/dist/hooks/spatial-grid/floor-placed-elevation.test.d.ts +0 -2
  194. package/dist/hooks/spatial-grid/floor-placed-elevation.test.d.ts.map +0 -1
  195. package/dist/hooks/spatial-grid/floor-placed-elevation.test.js +0 -366
  196. package/dist/hooks/spatial-grid/wall-slab-overlap.test.d.ts +0 -2
  197. package/dist/hooks/spatial-grid/wall-slab-overlap.test.d.ts.map +0 -1
  198. package/dist/hooks/spatial-grid/wall-slab-overlap.test.js +0 -363
  199. package/dist/lib/measurement-geometry.test.d.ts +0 -2
  200. package/dist/lib/measurement-geometry.test.d.ts.map +0 -1
  201. package/dist/lib/measurement-geometry.test.js +0 -102
  202. package/dist/lib/slab-polygon.test.d.ts +0 -2
  203. package/dist/lib/slab-polygon.test.d.ts.map +0 -1
  204. package/dist/lib/slab-polygon.test.js +0 -635
  205. package/dist/lib/space-detection-pause.test.d.ts +0 -2
  206. package/dist/lib/space-detection-pause.test.d.ts.map +0 -1
  207. package/dist/lib/space-detection-pause.test.js +0 -42
  208. package/dist/lib/space-detection.test.d.ts +0 -2
  209. package/dist/lib/space-detection.test.d.ts.map +0 -1
  210. package/dist/lib/space-detection.test.js +0 -376
  211. package/dist/lib/zone-quantities.test.d.ts +0 -2
  212. package/dist/lib/zone-quantities.test.d.ts.map +0 -1
  213. package/dist/lib/zone-quantities.test.js +0 -82
  214. package/dist/registry/registry.test.d.ts +0 -2
  215. package/dist/registry/registry.test.d.ts.map +0 -1
  216. package/dist/registry/registry.test.js +0 -196
  217. package/dist/registry/relations-resolver.test.d.ts +0 -2
  218. package/dist/registry/relations-resolver.test.d.ts.map +0 -1
  219. package/dist/registry/relations-resolver.test.js +0 -183
  220. package/dist/registry/scene-api.test.d.ts +0 -2
  221. package/dist/registry/scene-api.test.d.ts.map +0 -1
  222. package/dist/registry/scene-api.test.js +0 -183
  223. package/dist/registry/subtree.test.d.ts +0 -2
  224. package/dist/registry/subtree.test.d.ts.map +0 -1
  225. package/dist/registry/subtree.test.js +0 -163
  226. package/dist/schema/asset-url.test.d.ts +0 -2
  227. package/dist/schema/asset-url.test.d.ts.map +0 -1
  228. package/dist/schema/asset-url.test.js +0 -134
  229. package/dist/schema/material.test.d.ts +0 -2
  230. package/dist/schema/material.test.d.ts.map +0 -1
  231. package/dist/schema/material.test.js +0 -43
  232. package/dist/schema/nodes/measurement.test.d.ts +0 -2
  233. package/dist/schema/nodes/measurement.test.d.ts.map +0 -1
  234. package/dist/schema/nodes/measurement.test.js +0 -139
  235. package/dist/schema/nodes/ridge-vent-defaults.test.d.ts +0 -2
  236. package/dist/schema/nodes/ridge-vent-defaults.test.d.ts.map +0 -1
  237. package/dist/schema/nodes/ridge-vent-defaults.test.js +0 -205
  238. package/dist/schema/nodes/roof-segment-shape.test.d.ts +0 -2
  239. package/dist/schema/nodes/roof-segment-shape.test.d.ts.map +0 -1
  240. package/dist/schema/nodes/roof-segment-shape.test.js +0 -175
  241. package/dist/schema/nodes/roof-segment-surface.test.d.ts +0 -2
  242. package/dist/schema/nodes/roof-segment-surface.test.d.ts.map +0 -1
  243. package/dist/schema/nodes/roof-segment-surface.test.js +0 -48
  244. package/dist/schema/nodes/roof-segment-trim.test.d.ts +0 -2
  245. package/dist/schema/nodes/roof-segment-trim.test.d.ts.map +0 -1
  246. package/dist/schema/nodes/roof-segment-trim.test.js +0 -107
  247. package/dist/schema/nodes/roof-segment-walls.test.d.ts +0 -2
  248. package/dist/schema/nodes/roof-segment-walls.test.d.ts.map +0 -1
  249. package/dist/schema/nodes/roof-segment-walls.test.js +0 -92
  250. package/dist/schema/nodes/wall.test.d.ts +0 -2
  251. package/dist/schema/nodes/wall.test.d.ts.map +0 -1
  252. package/dist/schema/nodes/wall.test.js +0 -208
  253. package/dist/services/alignment-anchors.test.d.ts +0 -2
  254. package/dist/services/alignment-anchors.test.d.ts.map +0 -1
  255. package/dist/services/alignment-anchors.test.js +0 -383
  256. package/dist/services/alignment.test.d.ts +0 -2
  257. package/dist/services/alignment.test.d.ts.map +0 -1
  258. package/dist/services/alignment.test.js +0 -92
  259. package/dist/services/drag-session.test.d.ts +0 -2
  260. package/dist/services/drag-session.test.d.ts.map +0 -1
  261. package/dist/services/drag-session.test.js +0 -219
  262. package/dist/services/hosting.test.d.ts +0 -2
  263. package/dist/services/hosting.test.d.ts.map +0 -1
  264. package/dist/services/hosting.test.js +0 -230
  265. package/dist/services/movement.test.d.ts +0 -2
  266. package/dist/services/movement.test.d.ts.map +0 -1
  267. package/dist/services/movement.test.js +0 -133
  268. package/dist/services/opening-guides.test.d.ts +0 -2
  269. package/dist/services/opening-guides.test.d.ts.map +0 -1
  270. package/dist/services/opening-guides.test.js +0 -208
  271. package/dist/services/port-connectivity.test.d.ts +0 -2
  272. package/dist/services/port-connectivity.test.d.ts.map +0 -1
  273. package/dist/services/port-connectivity.test.js +0 -297
  274. package/dist/services/riser-diagram.test.d.ts +0 -2
  275. package/dist/services/riser-diagram.test.d.ts.map +0 -1
  276. package/dist/services/riser-diagram.test.js +0 -66
  277. package/dist/services/single-undo-dance.test.d.ts +0 -2
  278. package/dist/services/single-undo-dance.test.d.ts.map +0 -1
  279. package/dist/services/single-undo-dance.test.js +0 -210
  280. package/dist/services/snap.test.d.ts +0 -2
  281. package/dist/services/snap.test.d.ts.map +0 -1
  282. package/dist/services/snap.test.js +0 -137
  283. package/dist/services/system-graph.test.d.ts +0 -2
  284. package/dist/services/system-graph.test.d.ts.map +0 -1
  285. package/dist/services/system-graph.test.js +0 -138
  286. package/dist/services/validate-dwv.test.d.ts +0 -2
  287. package/dist/services/validate-dwv.test.d.ts.map +0 -1
  288. package/dist/services/validate-dwv.test.js +0 -109
  289. package/dist/store/actions/node-mutation-sanitize.test.d.ts +0 -2
  290. package/dist/store/actions/node-mutation-sanitize.test.d.ts.map +0 -1
  291. package/dist/store/actions/node-mutation-sanitize.test.js +0 -147
  292. package/dist/store/actions/reparent.test.d.ts +0 -2
  293. package/dist/store/actions/reparent.test.d.ts.map +0 -1
  294. package/dist/store/actions/reparent.test.js +0 -212
  295. package/dist/store/actions/ridge-vent-update.test.d.ts +0 -2
  296. package/dist/store/actions/ridge-vent-update.test.d.ts.map +0 -1
  297. package/dist/store/actions/ridge-vent-update.test.js +0 -264
  298. package/dist/store/use-scene-dirty-tracking.test.d.ts +0 -2
  299. package/dist/store/use-scene-dirty-tracking.test.d.ts.map +0 -1
  300. package/dist/store/use-scene-dirty-tracking.test.js +0 -68
  301. package/dist/store/use-scene-elevator-migration.test.d.ts +0 -2
  302. package/dist/store/use-scene-elevator-migration.test.d.ts.map +0 -1
  303. package/dist/store/use-scene-elevator-migration.test.js +0 -109
  304. package/dist/store/use-scene-measurement-roundtrip.test.d.ts +0 -2
  305. package/dist/store/use-scene-measurement-roundtrip.test.d.ts.map +0 -1
  306. package/dist/store/use-scene-measurement-roundtrip.test.js +0 -97
  307. package/dist/store/use-scene-plugins.test.d.ts +0 -2
  308. package/dist/store/use-scene-plugins.test.d.ts.map +0 -1
  309. package/dist/store/use-scene-plugins.test.js +0 -51
  310. package/dist/store/use-scene-wall-slot-migration.test.d.ts +0 -2
  311. package/dist/store/use-scene-wall-slot-migration.test.d.ts.map +0 -1
  312. package/dist/store/use-scene-wall-slot-migration.test.js +0 -210
  313. package/dist/store/use-scene-window-migration.test.d.ts +0 -2
  314. package/dist/store/use-scene-window-migration.test.d.ts.map +0 -1
  315. package/dist/store/use-scene-window-migration.test.js +0 -85
  316. package/dist/systems/elevator/elevator-opening-sync.test.d.ts +0 -2
  317. package/dist/systems/elevator/elevator-opening-sync.test.d.ts.map +0 -1
  318. package/dist/systems/elevator/elevator-opening-sync.test.js +0 -146
  319. package/dist/systems/elevator/elevator-runtime.test.d.ts +0 -2
  320. package/dist/systems/elevator/elevator-runtime.test.d.ts.map +0 -1
  321. package/dist/systems/elevator/elevator-runtime.test.js +0 -64
  322. package/dist/systems/fence/fence-spline.test.d.ts +0 -2
  323. package/dist/systems/fence/fence-spline.test.d.ts.map +0 -1
  324. package/dist/systems/fence/fence-spline.test.js +0 -136
  325. package/dist/systems/stair/stair-opening-preview.test.d.ts +0 -2
  326. package/dist/systems/stair/stair-opening-preview.test.d.ts.map +0 -1
  327. package/dist/systems/stair/stair-opening-preview.test.js +0 -80
  328. package/dist/systems/stair/stair-opening-sync.test.d.ts +0 -2
  329. package/dist/systems/stair/stair-opening-sync.test.d.ts.map +0 -1
  330. package/dist/systems/stair/stair-opening-sync.test.js +0 -485
  331. package/dist/systems/wall/wall-mitering.test.d.ts +0 -2
  332. package/dist/systems/wall/wall-mitering.test.d.ts.map +0 -1
  333. package/dist/systems/wall/wall-mitering.test.js +0 -63
  334. package/dist/utils/clone-scene-graph.test.d.ts +0 -2
  335. package/dist/utils/clone-scene-graph.test.d.ts.map +0 -1
  336. package/dist/utils/clone-scene-graph.test.js +0 -62
  337. package/dist/utils/heal-scene-graph.test.d.ts +0 -2
  338. package/dist/utils/heal-scene-graph.test.d.ts.map +0 -1
  339. package/dist/utils/heal-scene-graph.test.js +0 -88
@@ -1,485 +0,0 @@
1
- import { describe, expect, test } from 'bun:test';
2
- import { BuildingNode, CeilingNode, LevelNode, SlabNode, StairNode, StairSegmentNode, } from '../../schema';
3
- import { syncAutoStairOpenings } from './stair-opening-sync';
4
- describe('syncAutoStairOpenings', () => {
5
- test('only applies stair holes to destination slabs that overlap the opening', () => {
6
- const building = BuildingNode.parse({ name: 'Building' });
7
- const ground = LevelNode.parse({ name: 'Ground', level: 0, parentId: building.id });
8
- const upper = LevelNode.parse({ name: 'Upper', level: 1, parentId: building.id });
9
- const landingSlab = SlabNode.parse({
10
- name: 'Landing Slab',
11
- parentId: upper.id,
12
- polygon: [
13
- [0, 0],
14
- [4, 0],
15
- [4, 3],
16
- [0, 3],
17
- ],
18
- });
19
- const bedroomSlab = SlabNode.parse({
20
- name: 'Bedroom Slab',
21
- parentId: upper.id,
22
- polygon: [
23
- [4, 0],
24
- [8, 0],
25
- [8, 3],
26
- [4, 3],
27
- ],
28
- });
29
- const segment = StairSegmentNode.parse({
30
- parentId: 'stair_main',
31
- width: 1,
32
- length: 2.6,
33
- height: 2.5,
34
- stepCount: 12,
35
- });
36
- const stair = StairNode.parse({
37
- id: 'stair_main',
38
- name: 'Main Stair',
39
- parentId: ground.id,
40
- position: [2, 0, 0.2],
41
- stairType: 'straight',
42
- fromLevelId: ground.id,
43
- toLevelId: upper.id,
44
- slabOpeningMode: 'destination',
45
- children: [segment.id],
46
- });
47
- const nodes = Object.fromEntries([
48
- building,
49
- ground,
50
- upper,
51
- landingSlab,
52
- bedroomSlab,
53
- stair,
54
- { ...segment, parentId: stair.id },
55
- ].map((node) => [node.id, node]));
56
- const updates = syncAutoStairOpenings(nodes);
57
- const landingUpdate = updates.find((update) => update.id === landingSlab.id);
58
- const bedroomUpdate = updates.find((update) => update.id === bedroomSlab.id);
59
- expect(landingUpdate?.data.holes).toHaveLength(1);
60
- expect(landingUpdate?.data.holeMetadata).toEqual([{ source: 'stair', stairId: stair.id }]);
61
- expect(bedroomUpdate).toBeUndefined();
62
- });
63
- test('applies stair holes to a later destination slab when the configured offset overhangs the slab edge', () => {
64
- const building = BuildingNode.parse({ name: 'Building' });
65
- const ground = LevelNode.parse({ name: 'Ground', level: 0, parentId: building.id });
66
- const upper = LevelNode.parse({ name: 'Upper', level: 1, parentId: building.id });
67
- const landingSlab = SlabNode.parse({
68
- name: 'Landing Slab',
69
- parentId: upper.id,
70
- polygon: [
71
- [0, 0],
72
- [4, 0],
73
- [4, 3],
74
- [0, 3],
75
- ],
76
- });
77
- const segment = StairSegmentNode.parse({
78
- parentId: 'stair_edge',
79
- width: 1,
80
- length: 2.6,
81
- height: 2.5,
82
- stepCount: 12,
83
- });
84
- const stair = StairNode.parse({
85
- id: 'stair_edge',
86
- name: 'Edge Stair',
87
- parentId: ground.id,
88
- position: [2, 0, 0],
89
- stairType: 'straight',
90
- fromLevelId: ground.id,
91
- toLevelId: upper.id,
92
- slabOpeningMode: 'destination',
93
- openingOffset: 0.08,
94
- children: [segment.id],
95
- });
96
- const nodes = Object.fromEntries([building, ground, upper, landingSlab, stair, { ...segment, parentId: stair.id }].map((node) => [node.id, node]));
97
- const updates = syncAutoStairOpenings(nodes);
98
- const landingUpdate = updates.find((update) => update.id === landingSlab.id);
99
- const hole = landingUpdate?.data.holes?.[0];
100
- expect(hole).toBeDefined();
101
- expect(Math.min(...hole.map(([, z]) => z))).toBeCloseTo(-0.08);
102
- expect(landingUpdate?.data.holeMetadata).toEqual([{ source: 'stair', stairId: stair.id }]);
103
- });
104
- test('does not apply stair holes to slabs on another building with a matching level number', () => {
105
- const buildingA = BuildingNode.parse({ name: 'Building A' });
106
- const groundA = LevelNode.parse({ name: 'Ground A', level: 0, parentId: buildingA.id });
107
- const upperA = LevelNode.parse({ name: 'Upper A', level: 1, parentId: buildingA.id });
108
- const buildingB = BuildingNode.parse({ name: 'Building B' });
109
- const upperB = LevelNode.parse({ name: 'Upper B', level: 1, parentId: buildingB.id });
110
- const slabA = SlabNode.parse({
111
- name: 'Upper A Slab',
112
- parentId: upperA.id,
113
- polygon: [
114
- [0, 0],
115
- [4, 0],
116
- [4, 3],
117
- [0, 3],
118
- ],
119
- });
120
- const slabB = SlabNode.parse({
121
- name: 'Upper B Slab',
122
- parentId: upperB.id,
123
- polygon: [
124
- [0, 0],
125
- [4, 0],
126
- [4, 3],
127
- [0, 3],
128
- ],
129
- });
130
- const segment = StairSegmentNode.parse({
131
- parentId: 'stair_scoped',
132
- width: 1,
133
- length: 2.6,
134
- height: 2.5,
135
- stepCount: 12,
136
- });
137
- const stair = StairNode.parse({
138
- id: 'stair_scoped',
139
- name: 'Scoped Stair',
140
- parentId: groundA.id,
141
- position: [2, 0, 0.2],
142
- stairType: 'straight',
143
- fromLevelId: groundA.id,
144
- toLevelId: upperA.id,
145
- slabOpeningMode: 'destination',
146
- children: [segment.id],
147
- });
148
- const nodes = Object.fromEntries([
149
- buildingA,
150
- groundA,
151
- upperA,
152
- buildingB,
153
- upperB,
154
- slabA,
155
- slabB,
156
- stair,
157
- { ...segment, parentId: stair.id },
158
- ].map((node) => [node.id, node]));
159
- const updates = syncAutoStairOpenings(nodes);
160
- expect(updates.find((update) => update.id === slabA.id)?.data.holes).toHaveLength(1);
161
- expect(updates.find((update) => update.id === slabB.id)).toBeUndefined();
162
- });
163
- test('uses the parent level when a stair has stale from-level data', () => {
164
- const building = BuildingNode.parse({ name: 'Building' });
165
- const ground = LevelNode.parse({ name: 'Ground', level: 0, parentId: building.id });
166
- const upper = LevelNode.parse({ name: 'Upper', level: 1, parentId: building.id });
167
- const landingSlab = SlabNode.parse({
168
- name: 'Landing Slab',
169
- parentId: upper.id,
170
- polygon: [
171
- [0, 0],
172
- [4, 0],
173
- [4, 8],
174
- [0, 8],
175
- ],
176
- });
177
- const segment = StairSegmentNode.parse({
178
- parentId: 'stair_stale_from',
179
- width: 1,
180
- length: 6,
181
- height: 2.5,
182
- stepCount: 12,
183
- });
184
- const stair = StairNode.parse({
185
- id: 'stair_stale_from',
186
- name: 'Stale From Stair',
187
- parentId: ground.id,
188
- position: [2, 0, 0.2],
189
- stairType: 'straight',
190
- fromLevelId: 'default',
191
- toLevelId: upper.id,
192
- slabOpeningMode: 'destination',
193
- children: [segment.id],
194
- });
195
- const nodes = Object.fromEntries([building, ground, upper, landingSlab, stair, { ...segment, parentId: stair.id }].map((node) => [node.id, node]));
196
- const updates = syncAutoStairOpenings(nodes);
197
- const landingUpdate = updates.find((update) => update.id === landingSlab.id);
198
- const hole = landingUpdate?.data.holes?.[0];
199
- expect(hole).toBeDefined();
200
- expect(Math.min(...hole.map(([, z]) => z))).toBeGreaterThan(0.9);
201
- expect(landingUpdate?.data.holeMetadata).toEqual([{ source: 'stair', stairId: stair.id }]);
202
- });
203
- test('infers the destination level when a destination stair has blank level fields', () => {
204
- const building = BuildingNode.parse({ name: 'Building' });
205
- const ground = LevelNode.parse({ name: 'Ground', level: 0, parentId: building.id });
206
- const upper = LevelNode.parse({ name: 'Upper', level: 1, parentId: building.id });
207
- const landingSlab = SlabNode.parse({
208
- name: 'Landing Slab',
209
- parentId: upper.id,
210
- polygon: [
211
- [0, 0],
212
- [4, 0],
213
- [4, 8],
214
- [0, 8],
215
- ],
216
- });
217
- const segment = StairSegmentNode.parse({
218
- parentId: 'stair_blank_levels',
219
- width: 1,
220
- length: 6,
221
- height: 2.5,
222
- stepCount: 12,
223
- });
224
- const stair = StairNode.parse({
225
- id: 'stair_blank_levels',
226
- name: 'Blank Level Stair',
227
- parentId: ground.id,
228
- position: [2, 0, 0.2],
229
- stairType: 'straight',
230
- fromLevelId: '',
231
- toLevelId: '',
232
- slabOpeningMode: 'destination',
233
- children: [segment.id],
234
- });
235
- const nodes = Object.fromEntries([building, ground, upper, landingSlab, stair, { ...segment, parentId: stair.id }].map((node) => [node.id, node]));
236
- const updates = syncAutoStairOpenings(nodes);
237
- const landingUpdate = updates.find((update) => update.id === landingSlab.id);
238
- expect(landingUpdate?.data.holes).toHaveLength(1);
239
- expect(landingUpdate?.data.holeMetadata).toEqual([{ source: 'stair', stairId: stair.id }]);
240
- });
241
- test('infers the destination level when a destination stair targets its source level', () => {
242
- const building = BuildingNode.parse({ name: 'Building' });
243
- const ground = LevelNode.parse({ name: 'Ground', level: 0, parentId: building.id });
244
- const upper = LevelNode.parse({ name: 'Upper', level: 1, parentId: building.id });
245
- const landingSlab = SlabNode.parse({
246
- name: 'Landing Slab',
247
- parentId: upper.id,
248
- polygon: [
249
- [0, 0],
250
- [4, 0],
251
- [4, 8],
252
- [0, 8],
253
- ],
254
- });
255
- const segment = StairSegmentNode.parse({
256
- parentId: 'stair_self_target',
257
- width: 1,
258
- length: 6,
259
- height: 2.5,
260
- stepCount: 12,
261
- });
262
- const stair = StairNode.parse({
263
- id: 'stair_self_target',
264
- name: 'Self Target Stair',
265
- parentId: ground.id,
266
- position: [2, 0, 0.2],
267
- stairType: 'straight',
268
- fromLevelId: ground.id,
269
- toLevelId: ground.id,
270
- slabOpeningMode: 'destination',
271
- children: [segment.id],
272
- });
273
- const nodes = Object.fromEntries([building, ground, upper, landingSlab, stair, { ...segment, parentId: stair.id }].map((node) => [node.id, node]));
274
- const updates = syncAutoStairOpenings(nodes);
275
- const landingUpdate = updates.find((update) => update.id === landingSlab.id);
276
- expect(landingUpdate?.data.holes).toHaveLength(1);
277
- expect(landingUpdate?.data.holeMetadata).toEqual([{ source: 'stair', stairId: stair.id }]);
278
- });
279
- test('does not add stair holes when a manual surface hole already covers them', () => {
280
- const building = BuildingNode.parse({ name: 'Building' });
281
- const ground = LevelNode.parse({ name: 'Ground', level: 0, parentId: building.id });
282
- const upper = LevelNode.parse({ name: 'Upper', level: 1, parentId: building.id });
283
- const manualOpening = [
284
- [1.0, 0.0],
285
- [3.0, 0.0],
286
- [3.0, 3.0],
287
- [1.0, 3.0],
288
- ];
289
- const sourceCeiling = CeilingNode.parse({
290
- name: 'Source Ceiling',
291
- parentId: ground.id,
292
- polygon: [
293
- [0, 0],
294
- [4, 0],
295
- [4, 3],
296
- [0, 3],
297
- ],
298
- holes: [manualOpening],
299
- holeMetadata: [{ source: 'manual' }],
300
- });
301
- const landingSlab = SlabNode.parse({
302
- name: 'Landing Slab',
303
- parentId: upper.id,
304
- polygon: [
305
- [0, 0],
306
- [4, 0],
307
- [4, 3],
308
- [0, 3],
309
- ],
310
- holes: [manualOpening],
311
- holeMetadata: [{ source: 'manual' }],
312
- });
313
- const segment = StairSegmentNode.parse({
314
- parentId: 'stair_main',
315
- width: 1,
316
- length: 2.6,
317
- height: 2.5,
318
- stepCount: 12,
319
- });
320
- const stair = StairNode.parse({
321
- id: 'stair_main',
322
- name: 'Main Stair',
323
- parentId: ground.id,
324
- position: [2, 0, 0.2],
325
- stairType: 'straight',
326
- fromLevelId: ground.id,
327
- toLevelId: upper.id,
328
- slabOpeningMode: 'destination',
329
- children: [segment.id],
330
- });
331
- const nodes = Object.fromEntries([
332
- building,
333
- ground,
334
- upper,
335
- sourceCeiling,
336
- landingSlab,
337
- stair,
338
- { ...segment, parentId: stair.id },
339
- ].map((node) => [node.id, node]));
340
- const updates = syncAutoStairOpenings(nodes);
341
- expect(updates.find((update) => update.id === landingSlab.id)).toBeUndefined();
342
- expect(updates.find((update) => update.id === sourceCeiling.id)).toBeUndefined();
343
- });
344
- test('adds stair holes when an existing manual hole is too small', () => {
345
- const building = BuildingNode.parse({ name: 'Building' });
346
- const ground = LevelNode.parse({ name: 'Ground', level: 0, parentId: building.id });
347
- const upper = LevelNode.parse({ name: 'Upper', level: 1, parentId: building.id });
348
- const smallManualOpening = [
349
- [1.8, 1.6],
350
- [2.2, 1.6],
351
- [2.2, 2.1],
352
- [1.8, 2.1],
353
- ];
354
- const landingSlab = SlabNode.parse({
355
- name: 'Landing Slab',
356
- parentId: upper.id,
357
- polygon: [
358
- [0, 0],
359
- [4, 0],
360
- [4, 3],
361
- [0, 3],
362
- ],
363
- holes: [smallManualOpening],
364
- holeMetadata: [{ source: 'manual' }],
365
- });
366
- const segment = StairSegmentNode.parse({
367
- parentId: 'stair_main',
368
- width: 1,
369
- length: 2.6,
370
- height: 2.5,
371
- stepCount: 12,
372
- });
373
- const stair = StairNode.parse({
374
- id: 'stair_main',
375
- name: 'Main Stair',
376
- parentId: ground.id,
377
- position: [2, 0, 0.2],
378
- stairType: 'straight',
379
- fromLevelId: ground.id,
380
- toLevelId: upper.id,
381
- slabOpeningMode: 'destination',
382
- children: [segment.id],
383
- });
384
- const nodes = Object.fromEntries([building, ground, upper, landingSlab, stair, { ...segment, parentId: stair.id }].map((node) => [node.id, node]));
385
- const updates = syncAutoStairOpenings(nodes);
386
- const landingUpdate = updates.find((update) => update.id === landingSlab.id);
387
- expect(landingUpdate?.data.holes).toHaveLength(2);
388
- expect(landingUpdate?.data.holes?.[0]).toEqual(smallManualOpening);
389
- expect(landingUpdate?.data.holeMetadata).toEqual([
390
- { source: 'manual' },
391
- { source: 'stair', stairId: stair.id },
392
- ]);
393
- });
394
- test('removes stale auto stair holes when a manual hole overlaps the stair opening', () => {
395
- const building = BuildingNode.parse({ name: 'Building' });
396
- const ground = LevelNode.parse({ name: 'Ground', level: 0, parentId: building.id });
397
- const upper = LevelNode.parse({ name: 'Upper', level: 1, parentId: building.id });
398
- const manualOpening = [
399
- [1.0, 0.0],
400
- [3.0, 0.0],
401
- [3.0, 3.0],
402
- [1.0, 3.0],
403
- ];
404
- const staleAutoOpening = [
405
- [1.5, 1],
406
- [2.5, 1],
407
- [2.5, 2.8],
408
- [1.5, 2.8],
409
- ];
410
- const landingSlab = SlabNode.parse({
411
- name: 'Landing Slab',
412
- parentId: upper.id,
413
- polygon: [
414
- [0, 0],
415
- [4, 0],
416
- [4, 3],
417
- [0, 3],
418
- ],
419
- holes: [manualOpening, staleAutoOpening],
420
- holeMetadata: [{ source: 'manual' }, { source: 'stair', stairId: 'stair_main' }],
421
- });
422
- const segment = StairSegmentNode.parse({
423
- parentId: 'stair_main',
424
- width: 1,
425
- length: 2.6,
426
- height: 2.5,
427
- stepCount: 12,
428
- });
429
- const stair = StairNode.parse({
430
- id: 'stair_main',
431
- name: 'Main Stair',
432
- parentId: ground.id,
433
- position: [2, 0, 0.2],
434
- stairType: 'straight',
435
- fromLevelId: ground.id,
436
- toLevelId: upper.id,
437
- slabOpeningMode: 'destination',
438
- children: [segment.id],
439
- });
440
- const nodes = Object.fromEntries([building, ground, upper, landingSlab, stair, { ...segment, parentId: stair.id }].map((node) => [node.id, node]));
441
- const updates = syncAutoStairOpenings(nodes);
442
- const landingUpdate = updates.find((update) => update.id === landingSlab.id);
443
- expect(landingUpdate?.data.holes).toEqual([manualOpening]);
444
- expect(landingUpdate?.data.holeMetadata).toEqual([{ source: 'manual' }]);
445
- });
446
- test('does not add a separate rectangular hole for an integrated spiral top landing', () => {
447
- const building = BuildingNode.parse({ name: 'Building' });
448
- const ground = LevelNode.parse({ name: 'Ground', level: 0, parentId: building.id });
449
- const upper = LevelNode.parse({ name: 'Upper', level: 1, parentId: building.id });
450
- const landingSlab = SlabNode.parse({
451
- name: 'Landing Slab',
452
- parentId: upper.id,
453
- polygon: [
454
- [-4, -4],
455
- [4, -4],
456
- [4, 4],
457
- [-4, 4],
458
- ],
459
- });
460
- const stair = StairNode.parse({
461
- id: 'stair_spiral_landing',
462
- name: 'Spiral Landing Stair',
463
- parentId: ground.id,
464
- position: [0, 0, 0],
465
- rotation: Math.PI / 2,
466
- stairType: 'spiral',
467
- fromLevelId: ground.id,
468
- toLevelId: upper.id,
469
- slabOpeningMode: 'destination',
470
- innerRadius: 0.35,
471
- width: 1.2,
472
- sweepAngle: Math.PI * 1.6,
473
- topLandingMode: 'integrated',
474
- topLandingDepth: 1.1,
475
- });
476
- const nodes = Object.fromEntries([building, ground, upper, landingSlab, stair].map((node) => [node.id, node]));
477
- const updates = syncAutoStairOpenings(nodes);
478
- const landingUpdate = updates.find((update) => update.id === landingSlab.id);
479
- const holes = landingUpdate?.data.holes ?? [];
480
- const rectangularHoles = holes.filter((hole) => hole.length === 4);
481
- expect(holes).toHaveLength(1);
482
- expect(rectangularHoles).toHaveLength(0);
483
- expect(landingUpdate?.data.holeMetadata).toEqual([{ source: 'stair', stairId: stair.id }]);
484
- });
485
- });
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=wall-mitering.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wall-mitering.test.d.ts","sourceRoot":"","sources":["../../../src/systems/wall/wall-mitering.test.ts"],"names":[],"mappings":""}
@@ -1,63 +0,0 @@
1
- import { describe, expect, test } from 'bun:test';
2
- import { calculateLevelMiters, getWallMiterBoundaryPoints } from './wall-mitering';
3
- function wall(id, start, end) {
4
- return {
5
- id,
6
- type: 'wall',
7
- object: 'node',
8
- visible: true,
9
- parentId: 'level_test',
10
- children: [],
11
- start,
12
- end,
13
- thickness: 0.1,
14
- height: 2.5,
15
- frontSide: 'interior',
16
- backSide: 'exterior',
17
- metadata: {},
18
- };
19
- }
20
- function maxBoundaryCoord(walls) {
21
- const miter = calculateLevelMiters(walls);
22
- let max = 0;
23
- for (const w of walls) {
24
- const bp = getWallMiterBoundaryPoints(w, miter);
25
- expect(bp).not.toBeNull();
26
- if (!bp)
27
- continue;
28
- for (const p of [bp.startLeft, bp.startRight, bp.endLeft, bp.endRight]) {
29
- expect(Number.isFinite(p.x)).toBe(true);
30
- expect(Number.isFinite(p.y)).toBe(true);
31
- max = Math.max(max, Math.abs(p.x), Math.abs(p.y));
32
- }
33
- }
34
- return max;
35
- }
36
- describe('wall mitering miter limit', () => {
37
- // Two 3 m walls sharing the origin, meeting at decreasing angles. Without a
38
- // miter limit the joint point runs to infinity as the angle → 0 (∝ 1/sin θ),
39
- // which is the "infinite wall" seen when a room-preset preview lands on top of
40
- // an existing wall. The boundary must stay bounded near the wall length.
41
- test.each([90, 30, 10, 5, 1, 0.1, 0.01])('stays bounded at a %s° junction', (deg) => {
42
- const rad = (deg * Math.PI) / 180;
43
- const walls = [
44
- wall('A', [0, 0], [3, 0]),
45
- wall('B', [0, 0], [3 * Math.cos(rad), 3 * Math.sin(rad)]),
46
- ];
47
- // 3 m walls + a few cm of joint: anything past ~4 m is a runaway spike.
48
- expect(maxBoundaryCoord(walls)).toBeLessThan(4);
49
- });
50
- test('still miters a normal 90° corner', () => {
51
- const walls = [wall('A', [0, 0], [3, 0]), wall('B', [0, 0], [0, 3])];
52
- const miter = calculateLevelMiters(walls);
53
- const bpA = getWallMiterBoundaryPoints(walls[0], miter);
54
- expect(bpA).not.toBeNull();
55
- if (!bpA)
56
- throw new Error('expected miter boundary points');
57
- // The shared corner is pulled to the mitred intersection, offset from the
58
- // raw butt position (halfThickness 0.05) by the diagonal of the joint.
59
- const startSideX = Math.min(bpA.startLeft.x, bpA.startRight.x);
60
- expect(startSideX).toBeLessThan(-0.001);
61
- expect(startSideX).toBeGreaterThan(-0.5);
62
- });
63
- });
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=clone-scene-graph.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"clone-scene-graph.test.d.ts","sourceRoot":"","sources":["../../src/utils/clone-scene-graph.test.ts"],"names":[],"mappings":""}
@@ -1,62 +0,0 @@
1
- import { describe, expect, test } from 'bun:test';
2
- import { forkSceneGraph } from './clone-scene-graph';
3
- function makeNode(id, type, extra = {}) {
4
- return {
5
- object: 'node',
6
- id,
7
- type,
8
- parentId: null,
9
- visible: true,
10
- metadata: {},
11
- ...extra,
12
- };
13
- }
14
- function makeSceneGraph() {
15
- const site = makeNode('site_1', 'site', { children: ['level_1'] });
16
- const level = makeNode('level_1', 'level', {
17
- parentId: 'site_1',
18
- children: ['wall_1', 'scan_1', 'guide_1'],
19
- });
20
- const wall = makeNode('wall_1', 'wall', { parentId: 'level_1' });
21
- const scan = makeNode('scan_1', 'scan', { parentId: 'level_1', url: 'scan.glb' });
22
- const guide = makeNode('guide_1', 'guide', { parentId: 'level_1', url: 'guide.png' });
23
- return {
24
- nodes: {
25
- ['site_1']: site,
26
- ['level_1']: level,
27
- ['wall_1']: wall,
28
- ['scan_1']: scan,
29
- ['guide_1']: guide,
30
- },
31
- rootNodeIds: ['site_1'],
32
- collections: {
33
- ['collection_1']: {
34
- id: 'collection_1',
35
- name: 'References',
36
- nodeIds: ['scan_1', 'guide_1'],
37
- },
38
- },
39
- installedPlugins: ['pascal:trees'],
40
- };
41
- }
42
- describe('forkSceneGraph', () => {
43
- test('strips scan and guide nodes by default', () => {
44
- const forked = forkSceneGraph(makeSceneGraph());
45
- const nodes = Object.values(forked.nodes);
46
- expect(nodes.some((node) => node.type === 'scan')).toBe(false);
47
- expect(nodes.some((node) => node.type === 'guide')).toBe(false);
48
- expect(nodes.some((node) => node.type === 'wall')).toBe(true);
49
- expect(forked.collections).toEqual({});
50
- expect(forked.installedPlugins).toEqual(['pascal:trees']);
51
- });
52
- test('preserves scan and guide nodes when requested', () => {
53
- const forked = forkSceneGraph(makeSceneGraph(), { preserveScans: true });
54
- const nodes = Object.values(forked.nodes);
55
- expect(nodes.some((node) => node.type === 'scan')).toBe(true);
56
- expect(nodes.some((node) => node.type === 'guide')).toBe(true);
57
- expect(nodes.map((node) => node.id)).not.toContain('scan_1');
58
- expect(nodes.map((node) => node.id)).not.toContain('guide_1');
59
- expect(Object.values(forked.collections ?? {}).flatMap((collection) => collection.nodeIds)).toHaveLength(2);
60
- expect(forked.installedPlugins).toEqual(['pascal:trees']);
61
- });
62
- });
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=heal-scene-graph.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"heal-scene-graph.test.d.ts","sourceRoot":"","sources":["../../src/utils/heal-scene-graph.test.ts"],"names":[],"mappings":""}