@pascal-app/nodes 1.0.1 → 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 (319) hide show
  1. package/dist/block/definition.d.ts.map +1 -1
  2. package/dist/block/definition.js +4 -1
  3. package/dist/block/face-host.d.ts.map +1 -1
  4. package/dist/block/face-host.js +19 -2
  5. package/dist/block/hosted-edit.d.ts +13 -0
  6. package/dist/block/hosted-edit.d.ts.map +1 -0
  7. package/dist/block/hosted-edit.js +205 -0
  8. package/dist/block/last-operation.d.ts +1 -1
  9. package/dist/block/last-operation.d.ts.map +1 -1
  10. package/dist/block/last-operation.js +6 -4
  11. package/dist/block/modal-session.d.ts +2 -1
  12. package/dist/block/modal-session.d.ts.map +1 -1
  13. package/dist/block/modal-session.js +2 -2
  14. package/dist/block/selection.d.ts.map +1 -1
  15. package/dist/block/selection.js +82 -24
  16. package/dist/block/surface.d.ts +4 -0
  17. package/dist/block/surface.d.ts.map +1 -0
  18. package/dist/block/surface.js +54 -0
  19. package/dist/block/use-block-face-operation.d.ts +2 -2
  20. package/dist/block/use-block-face-operation.d.ts.map +1 -1
  21. package/dist/block/use-block-face-operation.js +25 -11
  22. package/dist/box-vent/definition.d.ts.map +1 -1
  23. package/dist/box-vent/definition.js +1 -0
  24. package/dist/building/renderer.d.ts.map +1 -1
  25. package/dist/building/renderer.js +1 -1
  26. package/dist/cabinet/definition.d.ts.map +1 -1
  27. package/dist/cabinet/definition.js +3 -1
  28. package/dist/cabinet/hosted-resize.d.ts +3 -6
  29. package/dist/cabinet/hosted-resize.d.ts.map +1 -1
  30. package/dist/cabinet/hosted-resize.js +9 -153
  31. package/dist/cabinet/placement-snap.d.ts.map +1 -1
  32. package/dist/cabinet/placement-snap.js +4 -2
  33. package/dist/cabinet/surfaces.d.ts +1 -0
  34. package/dist/cabinet/surfaces.d.ts.map +1 -1
  35. package/dist/cabinet/surfaces.js +13 -1
  36. package/dist/cabinet/tool.d.ts.map +1 -1
  37. package/dist/cabinet/tool.js +8 -4
  38. package/dist/ceiling/definition.d.ts.map +1 -1
  39. package/dist/ceiling/definition.js +5 -0
  40. package/dist/ceiling/renderer.d.ts.map +1 -1
  41. package/dist/ceiling/renderer.js +3 -2
  42. package/dist/chimney/definition.d.ts.map +1 -1
  43. package/dist/chimney/definition.js +1 -0
  44. package/dist/column/definition.d.ts.map +1 -1
  45. package/dist/column/definition.js +10 -3
  46. package/dist/column/floorplan-affordances.d.ts.map +1 -1
  47. package/dist/column/floorplan-affordances.js +6 -1
  48. package/dist/column/floorplan.d.ts.map +1 -1
  49. package/dist/column/floorplan.js +23 -11
  50. package/dist/column/hosted-resize.d.ts +116 -0
  51. package/dist/column/hosted-resize.d.ts.map +1 -0
  52. package/dist/column/hosted-resize.js +9 -0
  53. package/dist/column/panel.d.ts.map +1 -1
  54. package/dist/column/panel.js +6 -3
  55. package/dist/column/renderer.d.ts.map +1 -1
  56. package/dist/column/renderer.js +25 -103
  57. package/dist/column/shape.d.ts +22 -0
  58. package/dist/column/shape.d.ts.map +1 -0
  59. package/dist/column/shape.js +120 -0
  60. package/dist/column/surface.d.ts +4 -0
  61. package/dist/column/surface.d.ts.map +1 -0
  62. package/dist/column/surface.js +66 -0
  63. package/dist/cupola/definition.d.ts.map +1 -1
  64. package/dist/cupola/definition.js +1 -0
  65. package/dist/door/definition.d.ts.map +1 -1
  66. package/dist/door/definition.js +40 -1
  67. package/dist/door/door-math.d.ts +1 -1
  68. package/dist/door/door-math.d.ts.map +1 -1
  69. package/dist/door/door-math.js +7 -10
  70. package/dist/door/floorplan-affordances.d.ts.map +1 -1
  71. package/dist/door/floorplan-affordances.js +8 -12
  72. package/dist/door/move-tool.d.ts.map +1 -1
  73. package/dist/door/move-tool.js +3 -4
  74. package/dist/door/panel.d.ts.map +1 -1
  75. package/dist/door/panel.js +23 -52
  76. package/dist/door/tool.d.ts.map +1 -1
  77. package/dist/door/tool.js +20 -2
  78. package/dist/dormer/definition.d.ts.map +1 -1
  79. package/dist/dormer/definition.js +1 -0
  80. package/dist/downspout/definition.d.ts.map +1 -1
  81. package/dist/downspout/definition.js +1 -0
  82. package/dist/duct-segment/tool.d.ts.map +1 -1
  83. package/dist/duct-segment/tool.js +11 -0
  84. package/dist/duct-terminal/tool.d.ts.map +1 -1
  85. package/dist/duct-terminal/tool.js +77 -8
  86. package/dist/elevator/definition.d.ts.map +1 -1
  87. package/dist/elevator/definition.js +2 -0
  88. package/dist/elevator/parametrics.d.ts.map +1 -1
  89. package/dist/elevator/parametrics.js +98 -1
  90. package/dist/eyebrow-vent/definition.d.ts.map +1 -1
  91. package/dist/eyebrow-vent/definition.js +1 -0
  92. package/dist/fence/definition.d.ts.map +1 -1
  93. package/dist/fence/definition.js +1 -0
  94. package/dist/fence/tool.js +2 -2
  95. package/dist/guide/definition.d.ts.map +1 -1
  96. package/dist/guide/definition.js +1 -0
  97. package/dist/gutter/definition.d.ts.map +1 -1
  98. package/dist/gutter/definition.js +1 -0
  99. package/dist/hvac-equipment/tool.d.ts.map +1 -1
  100. package/dist/hvac-equipment/tool.js +8 -2
  101. package/dist/item/__fixtures__/main-floorplan.d.ts +26 -0
  102. package/dist/item/__fixtures__/main-floorplan.d.ts.map +1 -0
  103. package/dist/item/__fixtures__/main-floorplan.js +297 -0
  104. package/dist/item/definition.d.ts.map +1 -1
  105. package/dist/item/definition.js +3 -1
  106. package/dist/item/floorplan-move.d.ts.map +1 -1
  107. package/dist/item/floorplan-move.js +209 -130
  108. package/dist/item/floorplan.d.ts +22 -0
  109. package/dist/item/floorplan.d.ts.map +1 -1
  110. package/dist/item/floorplan.js +61 -2
  111. package/dist/item/move-tool.d.ts +1 -1
  112. package/dist/item/move-tool.d.ts.map +1 -1
  113. package/dist/item/move-tool.js +15 -7
  114. package/dist/item/renderer.d.ts.map +1 -1
  115. package/dist/item/renderer.js +8 -2
  116. package/dist/level/renderer.js +1 -1
  117. package/dist/lineset/tool.d.ts.map +1 -1
  118. package/dist/lineset/tool.js +1 -0
  119. package/dist/liquid-line/tool.d.ts.map +1 -1
  120. package/dist/liquid-line/tool.js +5 -1
  121. package/dist/measurement/definition.d.ts.map +1 -1
  122. package/dist/measurement/definition.js +1 -0
  123. package/dist/pipe-segment/tool.d.ts.map +1 -1
  124. package/dist/pipe-segment/tool.js +14 -3
  125. package/dist/pipe-trap/tool.d.ts.map +1 -1
  126. package/dist/pipe-trap/tool.js +7 -8
  127. package/dist/procedural-item/definition.d.ts.map +1 -1
  128. package/dist/procedural-item/definition.js +4 -1
  129. package/dist/ridge-vent/definition.d.ts.map +1 -1
  130. package/dist/ridge-vent/definition.js +1 -0
  131. package/dist/roof/definition.d.ts.map +1 -1
  132. package/dist/roof/definition.js +4 -1
  133. package/dist/roof/panel-model.d.ts +4 -0
  134. package/dist/roof/panel-model.d.ts.map +1 -0
  135. package/dist/roof/panel-model.js +151 -0
  136. package/dist/roof/panel.d.ts.map +1 -1
  137. package/dist/roof/panel.js +3 -4
  138. package/dist/roof/parametrics.d.ts.map +1 -1
  139. package/dist/roof/parametrics.js +16 -1
  140. package/dist/roof-segment/definition.d.ts.map +1 -1
  141. package/dist/roof-segment/definition.js +1 -0
  142. package/dist/roof-segment/parametrics.d.ts.map +1 -1
  143. package/dist/roof-segment/parametrics.js +176 -1
  144. package/dist/scan/definition.d.ts.map +1 -1
  145. package/dist/scan/definition.js +1 -0
  146. package/dist/shared/commit-opening-move.d.ts +4 -0
  147. package/dist/shared/commit-opening-move.d.ts.map +1 -0
  148. package/dist/shared/commit-opening-move.js +9 -0
  149. package/dist/shared/curtain-opening-limits.d.ts +14 -0
  150. package/dist/shared/curtain-opening-limits.d.ts.map +1 -0
  151. package/dist/shared/curtain-opening-limits.js +53 -0
  152. package/dist/shared/draft-axis-guides.d.ts +0 -6
  153. package/dist/shared/draft-axis-guides.d.ts.map +1 -1
  154. package/dist/shared/draft-axis-guides.js +1 -8
  155. package/dist/shared/hosted-resize.d.ts +12 -0
  156. package/dist/shared/hosted-resize.d.ts.map +1 -0
  157. package/dist/shared/hosted-resize.js +166 -0
  158. package/dist/shared/opening-grid-follow.d.ts +8 -0
  159. package/dist/shared/opening-grid-follow.d.ts.map +1 -0
  160. package/dist/shared/opening-grid-follow.js +12 -0
  161. package/dist/shared/opening-property-preview-host.d.ts +3 -0
  162. package/dist/shared/opening-property-preview-host.d.ts.map +1 -0
  163. package/dist/shared/opening-property-preview-host.js +21 -0
  164. package/dist/shared/opening-property-preview.d.ts +19 -0
  165. package/dist/shared/opening-property-preview.d.ts.map +1 -0
  166. package/dist/shared/opening-property-preview.js +99 -0
  167. package/dist/shared/resting-surface-plan.d.ts +2 -1
  168. package/dist/shared/resting-surface-plan.d.ts.map +1 -1
  169. package/dist/shared/resting-surface-plan.js +29 -4
  170. package/dist/shared/surface-counterparts.d.ts +12 -0
  171. package/dist/shared/surface-counterparts.d.ts.map +1 -0
  172. package/dist/shared/surface-counterparts.js +27 -0
  173. package/dist/shared/wall-attach-target.d.ts +1 -0
  174. package/dist/shared/wall-attach-target.d.ts.map +1 -1
  175. package/dist/shared/wall-attach-target.js +4 -1
  176. package/dist/shared/wall-event-from-grid.d.ts +5 -0
  177. package/dist/shared/wall-event-from-grid.d.ts.map +1 -0
  178. package/dist/shared/wall-event-from-grid.js +36 -0
  179. package/dist/shelf/definition.d.ts.map +1 -1
  180. package/dist/shelf/definition.js +3 -1
  181. package/dist/shelf/floorplan.d.ts.map +1 -1
  182. package/dist/shelf/floorplan.js +9 -2
  183. package/dist/site/renderer.d.ts.map +1 -1
  184. package/dist/site/renderer.js +9 -2
  185. package/dist/skylight/definition.d.ts.map +1 -1
  186. package/dist/skylight/definition.js +1 -0
  187. package/dist/slab/definition.d.ts.map +1 -1
  188. package/dist/slab/definition.js +4 -0
  189. package/dist/solar-panel/definition.d.ts.map +1 -1
  190. package/dist/solar-panel/definition.js +1 -0
  191. package/dist/spawn/definition.d.ts.map +1 -1
  192. package/dist/spawn/definition.js +1 -0
  193. package/dist/stair/definition.d.ts.map +1 -1
  194. package/dist/stair/definition.js +2 -0
  195. package/dist/stair/parametrics.d.ts.map +1 -1
  196. package/dist/stair/parametrics.js +164 -1
  197. package/dist/stair-segment/definition.d.ts.map +1 -1
  198. package/dist/stair-segment/definition.js +1 -0
  199. package/dist/stair-segment/parametrics.d.ts.map +1 -1
  200. package/dist/stair-segment/parametrics.js +81 -1
  201. package/dist/turbine-vent/definition.d.ts.map +1 -1
  202. package/dist/turbine-vent/definition.js +1 -0
  203. package/dist/wall/actions.d.ts +3 -0
  204. package/dist/wall/actions.d.ts.map +1 -0
  205. package/dist/wall/actions.js +56 -0
  206. package/dist/wall/curtain-opening-frame.d.ts +14 -0
  207. package/dist/wall/curtain-opening-frame.d.ts.map +1 -0
  208. package/dist/wall/curtain-opening-frame.js +111 -0
  209. package/dist/wall/curtain-panel-highlight.d.ts +3 -0
  210. package/dist/wall/curtain-panel-highlight.d.ts.map +1 -0
  211. package/dist/wall/curtain-panel-highlight.js +113 -0
  212. package/dist/wall/curtain-wall-adapter.d.ts +3 -0
  213. package/dist/wall/curtain-wall-adapter.d.ts.map +1 -0
  214. package/dist/wall/curtain-wall-adapter.js +55 -0
  215. package/dist/wall/curtain-wall-floorplan.d.ts +3 -0
  216. package/dist/wall/curtain-wall-floorplan.d.ts.map +1 -0
  217. package/dist/wall/curtain-wall-floorplan.js +91 -0
  218. package/dist/wall/curtain-wall-geometry.d.ts +4 -0
  219. package/dist/wall/curtain-wall-geometry.d.ts.map +1 -0
  220. package/dist/wall/curtain-wall-geometry.js +226 -0
  221. package/dist/wall/curtain-wall-layout.d.ts +16 -0
  222. package/dist/wall/curtain-wall-layout.d.ts.map +1 -0
  223. package/dist/wall/curtain-wall-layout.js +176 -0
  224. package/dist/wall/curtain-wall-materials.d.ts +5 -0
  225. package/dist/wall/curtain-wall-materials.d.ts.map +1 -0
  226. package/dist/wall/curtain-wall-materials.js +55 -0
  227. package/dist/wall/curtain-wall-panel.d.ts +14 -0
  228. package/dist/wall/curtain-wall-panel.d.ts.map +1 -0
  229. package/dist/wall/curtain-wall-panel.js +167 -0
  230. package/dist/wall/curtain-wall-piece-geometry.d.ts +5 -0
  231. package/dist/wall/curtain-wall-piece-geometry.d.ts.map +1 -0
  232. package/dist/wall/curtain-wall-piece-geometry.js +220 -0
  233. package/dist/wall/curtain-wall-shadow.d.ts +4 -0
  234. package/dist/wall/curtain-wall-shadow.d.ts.map +1 -0
  235. package/dist/wall/curtain-wall-shadow.js +15 -0
  236. package/dist/wall/definition.d.ts +0 -15
  237. package/dist/wall/definition.d.ts.map +1 -1
  238. package/dist/wall/definition.js +65 -4
  239. package/dist/wall/drawing-mode.d.ts +12 -0
  240. package/dist/wall/drawing-mode.d.ts.map +1 -0
  241. package/dist/wall/drawing-mode.js +38 -0
  242. package/dist/wall/floorplan-tool.d.ts +4 -0
  243. package/dist/wall/floorplan-tool.d.ts.map +1 -0
  244. package/dist/wall/floorplan-tool.js +107 -0
  245. package/dist/wall/floorplan.d.ts.map +1 -1
  246. package/dist/wall/floorplan.js +6 -2
  247. package/dist/wall/length-patch.d.ts +3 -0
  248. package/dist/wall/length-patch.d.ts.map +1 -0
  249. package/dist/wall/length-patch.js +14 -0
  250. package/dist/wall/move-tool.d.ts.map +1 -1
  251. package/dist/wall/move-tool.js +23 -1
  252. package/dist/wall/paint.d.ts.map +1 -1
  253. package/dist/wall/paint.js +39 -4
  254. package/dist/wall/panel-model.d.ts +4 -0
  255. package/dist/wall/panel-model.d.ts.map +1 -0
  256. package/dist/wall/panel-model.js +117 -0
  257. package/dist/wall/panel.d.ts.map +1 -1
  258. package/dist/wall/panel.js +20 -24
  259. package/dist/wall/property-preview.d.ts +7 -0
  260. package/dist/wall/property-preview.d.ts.map +1 -0
  261. package/dist/wall/property-preview.js +31 -0
  262. package/dist/wall/rectangle-command.d.ts +149 -0
  263. package/dist/wall/rectangle-command.d.ts.map +1 -0
  264. package/dist/wall/rectangle-command.js +22 -0
  265. package/dist/wall/rectangle-tool.d.ts +2 -0
  266. package/dist/wall/rectangle-tool.d.ts.map +1 -0
  267. package/dist/wall/rectangle-tool.js +147 -0
  268. package/dist/wall/renderer.d.ts.map +1 -1
  269. package/dist/wall/renderer.js +7 -4
  270. package/dist/wall/slots.d.ts +2 -2
  271. package/dist/wall/slots.d.ts.map +1 -1
  272. package/dist/wall/slots.js +10 -2
  273. package/dist/wall/split-floorplan-layer.d.ts +4 -0
  274. package/dist/wall/split-floorplan-layer.d.ts.map +1 -0
  275. package/dist/wall/split-floorplan-layer.js +71 -0
  276. package/dist/wall/split-pointer.d.ts +3 -0
  277. package/dist/wall/split-pointer.d.ts.map +1 -0
  278. package/dist/wall/split-pointer.js +95 -0
  279. package/dist/wall/split-preview.d.ts +55 -0
  280. package/dist/wall/split-preview.d.ts.map +1 -0
  281. package/dist/wall/split-preview.js +106 -0
  282. package/dist/wall/split-session.d.ts +16 -0
  283. package/dist/wall/split-session.d.ts.map +1 -0
  284. package/dist/wall/split-session.js +138 -0
  285. package/dist/wall/split-store.d.ts +16 -0
  286. package/dist/wall/split-store.d.ts.map +1 -0
  287. package/dist/wall/split-store.js +6 -0
  288. package/dist/wall/split-tool.d.ts +10 -0
  289. package/dist/wall/split-tool.d.ts.map +1 -0
  290. package/dist/wall/split-tool.js +95 -0
  291. package/dist/wall/system.d.ts.map +1 -1
  292. package/dist/wall/system.js +3 -1
  293. package/dist/wall/tool.d.ts.map +1 -1
  294. package/dist/wall/tool.js +14 -6
  295. package/dist/wall/wall-batch-system.d.ts.map +1 -1
  296. package/dist/wall/wall-batch-system.js +3 -0
  297. package/dist/window/definition.d.ts.map +1 -1
  298. package/dist/window/definition.js +48 -1
  299. package/dist/window/floorplan-affordances.d.ts.map +1 -1
  300. package/dist/window/floorplan-affordances.js +8 -10
  301. package/dist/window/move-tool.d.ts.map +1 -1
  302. package/dist/window/move-tool.js +4 -6
  303. package/dist/window/panel.d.ts.map +1 -1
  304. package/dist/window/panel.js +21 -59
  305. package/dist/window/tool.d.ts.map +1 -1
  306. package/dist/window/tool.js +34 -2
  307. package/dist/window/window-math.d.ts +1 -1
  308. package/dist/window/window-math.d.ts.map +1 -1
  309. package/dist/window/window-math.js +8 -11
  310. package/dist/zone/definition.d.ts.map +1 -1
  311. package/dist/zone/definition.js +1 -0
  312. package/dist/zone/quantities-panel.d.ts.map +1 -1
  313. package/dist/zone/quantities-panel.js +3 -19
  314. package/dist/zone/renderer.d.ts.map +1 -1
  315. package/dist/zone/renderer.js +1 -1
  316. package/package.json +8 -8
  317. package/dist/shared/opening-documentation-fields.d.ts +0 -16
  318. package/dist/shared/opening-documentation-fields.d.ts.map +0 -1
  319. package/dist/shared/opening-documentation-fields.js +0 -54
@@ -0,0 +1,176 @@
1
+ export function curtainGridPositions(length, grid) {
2
+ if (!Number.isFinite(length) || length <= 0)
3
+ return [0];
4
+ const count = grid.layout === 'count' ? grid.count : Math.ceil(length / grid.spacing);
5
+ const bounded = Math.max(1, Math.min(32, count));
6
+ if (grid.layout !== 'fixed-spacing' || count > 32) {
7
+ return Array.from({ length: bounded + 1 }, (_, index) => (length * index) / bounded);
8
+ }
9
+ const whole = Math.floor(length / grid.spacing);
10
+ const remainder = length - whole * grid.spacing;
11
+ const offset = grid.alignment === 'start' ? 0 : grid.alignment === 'end' ? remainder : remainder / 2;
12
+ const positions = [0];
13
+ for (let index = 0; index <= whole; index++) {
14
+ const value = offset + index * grid.spacing;
15
+ if (value > 1e-6 && value < length - 1e-6)
16
+ positions.push(value);
17
+ }
18
+ positions.push(length);
19
+ // A centered remainder can introduce two edge cells.
20
+ return positions.length <= 33
21
+ ? positions
22
+ : Array.from({ length: 33 }, (_, i) => (length * i) / 32);
23
+ }
24
+ export function curtainPanelType(config, column, row, rowCount) {
25
+ const override = config.panels.find((panel) => panel.column === column && panel.row === row);
26
+ if (override)
27
+ return override.type;
28
+ if ((config.spandrel === 'bottom' && row === 0) ||
29
+ (config.spandrel === 'top' && row === rowCount - 1))
30
+ return 'solid';
31
+ return config.panelType;
32
+ }
33
+ export function buildCurtainWallLayout(length, height, depth, config, openings = [], baseElevation = 0) {
34
+ if (length <= 1e-6 || height <= 1e-6 || depth <= 0)
35
+ return [];
36
+ const xs = curtainGridPositions(length, config.columns);
37
+ const ys = curtainGridPositions(height, config.rows);
38
+ const pieces = [];
39
+ const panelDepth = Math.min(config.glassThickness, depth * 0.45);
40
+ const panelFront = depth / 2 - Math.min(0.005, depth * 0.05);
41
+ const panelBack = panelFront - panelDepth;
42
+ const add = (left, right, bottom, top, front, role, back = -depth / 2) => {
43
+ if (right - left > 1e-6 && top - bottom > 1e-6 && front - back > 1e-6)
44
+ pieces.push({ left, right, bottom, top, front, back, role });
45
+ };
46
+ const verticalCap = config.framing === 'capped' || config.framing === 'vertical-caps';
47
+ const horizontalCap = config.framing === 'capped' || config.framing === 'horizontal-caps';
48
+ if (config.construction === 'stick') {
49
+ const verticalBounds = xs.map((x, index) => {
50
+ if (index === 0)
51
+ return [0, Math.min(config.perimeterWidth, (xs[1] - x) * 0.4)];
52
+ if (index === xs.length - 1)
53
+ return [length - Math.min(config.perimeterWidth, (x - xs[index - 1]) * 0.4), length];
54
+ return [
55
+ x - Math.min(config.mullionWidth / 2, (x - xs[index - 1]) * 0.4),
56
+ x + Math.min(config.mullionWidth / 2, (xs[index + 1] - x) * 0.4),
57
+ ];
58
+ });
59
+ const horizontalBounds = ys.map((y, index) => {
60
+ if (index === 0)
61
+ return [0, Math.min(config.perimeterWidth, (ys[1] - y) * 0.4)];
62
+ if (index === ys.length - 1)
63
+ return [height - Math.min(config.perimeterWidth, (y - ys[index - 1]) * 0.4), height];
64
+ return [
65
+ y - Math.min(config.transomWidth / 2, (y - ys[index - 1]) * 0.4),
66
+ y + Math.min(config.transomWidth / 2, (ys[index + 1] - y) * 0.4),
67
+ ];
68
+ });
69
+ for (const [left, right] of verticalBounds)
70
+ add(left, right, 0, height, verticalCap ? depth / 2 : panelBack, 'frame');
71
+ for (const [bottom, top] of horizontalBounds) {
72
+ for (let column = 0; column < xs.length - 1; column++) {
73
+ add(verticalBounds[column][1], verticalBounds[column + 1][0], bottom, top, horizontalCap ? depth / 2 : panelBack, 'frame');
74
+ }
75
+ }
76
+ for (let column = 0; column < xs.length - 1; column++) {
77
+ for (let row = 0; row < ys.length - 1; row++) {
78
+ const type = curtainPanelType(config, column, row, ys.length - 1);
79
+ if (type === 'empty')
80
+ continue;
81
+ add(verticalBounds[column][1], verticalBounds[column + 1][0], horizontalBounds[row][1], horizontalBounds[row + 1][0], panelFront, type, panelBack);
82
+ }
83
+ }
84
+ }
85
+ else {
86
+ for (let column = 0; column < xs.length - 1; column++) {
87
+ for (let row = 0; row < ys.length - 1; row++) {
88
+ const x0 = xs[column], x1 = xs[column + 1], y0 = ys[row], y1 = ys[row + 1];
89
+ const gap = config.construction === 'unitized'
90
+ ? Math.min(config.jointWidth / 2, (x1 - x0) / 10, (y1 - y0) / 10)
91
+ : 0;
92
+ const left = x0 + (column === 0 ? 0 : gap), right = x1 - (column === xs.length - 2 ? 0 : gap);
93
+ const bottom = y0 + (row === 0 ? 0 : gap), top = y1 - (row === ys.length - 2 ? 0 : gap);
94
+ const lw = Math.min(column === 0 ? config.perimeterWidth : config.mullionWidth / 2, (right - left) * 0.4);
95
+ const rw = Math.min(column === xs.length - 2 ? config.perimeterWidth : config.mullionWidth / 2, (right - left) * 0.4);
96
+ const bw = Math.min(row === 0 ? config.perimeterWidth : config.transomWidth / 2, (top - bottom) * 0.4);
97
+ const tw = Math.min(row === ys.length - 2 ? config.perimeterWidth : config.transomWidth / 2, (top - bottom) * 0.4);
98
+ add(left, left + lw, bottom, top, verticalCap ? depth / 2 : panelBack, 'frame');
99
+ add(right - rw, right, bottom, top, verticalCap ? depth / 2 : panelBack, 'frame');
100
+ add(left + lw, right - rw, bottom, bottom + bw, horizontalCap ? depth / 2 : panelBack, 'frame');
101
+ add(left + lw, right - rw, top - tw, top, horizontalCap ? depth / 2 : panelBack, 'frame');
102
+ const type = curtainPanelType(config, column, row, ys.length - 1);
103
+ if (type === 'empty')
104
+ continue;
105
+ const joint = Math.min(config.jointWidth / 2, (right - left) * 0.1, (top - bottom) * 0.1);
106
+ add(left + (verticalCap ? lw : joint), right - (verticalCap ? rw : joint), bottom + (horizontalCap ? bw : joint), top - (horizontalCap ? tw : joint), panelFront, type, panelBack);
107
+ }
108
+ }
109
+ }
110
+ let fitted = pieces;
111
+ for (const opening of openings) {
112
+ if (opening.openingShape !== 'rectangle')
113
+ continue;
114
+ const left = opening.position[0] - opening.width / 2;
115
+ const right = opening.position[0] + opening.width / 2;
116
+ const bottom = opening.position[1] - opening.height / 2 - baseElevation;
117
+ const top = bottom + opening.height;
118
+ if (right <= 0 || left >= length || top <= 0 || bottom >= height)
119
+ continue;
120
+ const outerLeft = Math.max(0, left - config.perimeterWidth);
121
+ const outerRight = Math.min(length, right + config.perimeterWidth);
122
+ const outerBottom = Math.max(0, bottom - (opening.type === 'window' ? config.perimeterWidth : 0));
123
+ const outerTop = Math.min(height, top + config.perimeterWidth);
124
+ // Replace intersecting infill and grid members with a continuous entrance subframe.
125
+ fitted = fitted.flatMap((piece) => {
126
+ const x0 = Math.max(piece.left, outerLeft);
127
+ const x1 = Math.min(piece.right, outerRight);
128
+ const y0 = Math.max(piece.bottom, outerBottom);
129
+ const y1 = Math.min(piece.top, outerTop);
130
+ if (x1 <= x0 || y1 <= y0)
131
+ return [piece];
132
+ return [
133
+ { ...piece, right: x0 },
134
+ { ...piece, left: x1 },
135
+ { ...piece, left: x0, right: x1, top: y0 },
136
+ { ...piece, left: x0, right: x1, bottom: y1 },
137
+ ].filter((part) => part.right - part.left > 1e-6 && part.top - part.bottom > 1e-6);
138
+ });
139
+ const frame = { front: depth / 2, back: -depth / 2, role: 'frame' };
140
+ fitted.push(...[
141
+ ...(opening.type === 'window'
142
+ ? [
143
+ {
144
+ ...frame,
145
+ left: Math.max(0, left),
146
+ right: Math.min(length, right),
147
+ bottom: outerBottom,
148
+ top: Math.min(height, bottom),
149
+ },
150
+ ]
151
+ : []),
152
+ {
153
+ ...frame,
154
+ left: outerLeft,
155
+ right: Math.min(length, left),
156
+ bottom: outerBottom,
157
+ top: outerTop,
158
+ },
159
+ {
160
+ ...frame,
161
+ left: Math.max(0, right),
162
+ right: outerRight,
163
+ bottom: outerBottom,
164
+ top: outerTop,
165
+ },
166
+ {
167
+ ...frame,
168
+ left: Math.max(0, left),
169
+ right: Math.min(length, right),
170
+ bottom: Math.max(0, top),
171
+ top: outerTop,
172
+ },
173
+ ].filter((part) => part.right - part.left > 1e-6 && part.top - part.bottom > 1e-6));
174
+ }
175
+ return fitted;
176
+ }
@@ -0,0 +1,5 @@
1
+ import { type SceneMaterial, type SceneMaterialId, type WallNode } from '@pascal-app/core';
2
+ import { getMaterialsForWall, type RenderShading, type WallMaterialOverride, type WallMaterials } from '@pascal-app/viewer';
3
+ export declare function createCurtainWallMaterials(wall: WallNode, shading: RenderShading, materials?: Record<SceneMaterialId, SceneMaterial>): WallMaterialOverride;
4
+ export declare function getCurtainAwareWallMaterials(wall: WallNode, shading?: RenderShading, textures?: boolean, colorPreset?: Parameters<typeof getMaterialsForWall>[3], sceneTheme?: string, materials?: Record<SceneMaterialId, SceneMaterial>): WallMaterials;
5
+ //# sourceMappingURL=curtain-wall-materials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"curtain-wall-materials.d.ts","sourceRoot":"","sources":["../../src/wall/curtain-wall-materials.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,QAAQ,EACd,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,mBAAmB,EACnB,KAAK,aAAa,EAElB,KAAK,oBAAoB,EACzB,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAA;AAI3B,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,QAAQ,EACd,OAAO,EAAE,aAAa,EACtB,SAAS,CAAC,EAAE,MAAM,CAAC,eAAe,EAAE,aAAa,CAAC,GACjD,oBAAoB,CA6CtB;AAED,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,QAAQ,EACd,OAAO,GAAE,aAA0B,EACnC,QAAQ,UAAO,EACf,WAAW,GAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAAC,CAAU,EAC/D,UAAU,CAAC,EAAE,MAAM,EACnB,SAAS,CAAC,EAAE,MAAM,CAAC,eAAe,EAAE,aAAa,CAAC,GACjD,aAAa,CAMf"}
@@ -0,0 +1,55 @@
1
+ import { getCurtainWallConfig, } from '@pascal-app/core';
2
+ import { getMaterialsForWall, resolveMaterialRef, } from '@pascal-app/viewer';
3
+ import { MeshLambertNodeMaterial, MeshStandardNodeMaterial } from 'three/webgpu';
4
+ export function createCurtainWallMaterials(wall, shading, materials) {
5
+ const config = getCurtainWallConfig(wall);
6
+ return {
7
+ hash: JSON.stringify({
8
+ config,
9
+ slots: ['curtain-frame', 'curtain-glass', 'curtain-solid'].map((slot) => {
10
+ const ref = wall.slots?.[slot];
11
+ return [
12
+ ref,
13
+ ref?.startsWith('scene:') ? materials?.[ref.slice(6)] : null,
14
+ ];
15
+ }),
16
+ }),
17
+ create: () => {
18
+ const owned = [];
19
+ const visible = ['frame', 'glass', 'solid'].map((role) => {
20
+ const ref = wall.slots?.[`curtain-${role}`];
21
+ const override = ref ? resolveMaterialRef(ref, materials, shading) : undefined;
22
+ if (override)
23
+ return override;
24
+ const glass = role === 'glass';
25
+ const color = glass
26
+ ? config.glassColor
27
+ : role === 'frame'
28
+ ? config.frameColor
29
+ : config.solidColor;
30
+ const properties = {
31
+ color,
32
+ transparent: glass,
33
+ opacity: glass ? config.glassOpacity : 1,
34
+ depthWrite: !glass,
35
+ };
36
+ const material = shading === 'solid'
37
+ ? new MeshLambertNodeMaterial(properties)
38
+ : new MeshStandardNodeMaterial({
39
+ ...properties,
40
+ metalness: role === 'frame' ? 0.65 : 0,
41
+ roughness: glass ? config.glassRoughness : 0.4,
42
+ });
43
+ owned.push(material);
44
+ return material;
45
+ });
46
+ return { visible, owned };
47
+ },
48
+ };
49
+ }
50
+ export function getCurtainAwareWallMaterials(wall, shading = 'rendered', textures = true, colorPreset = 'clay', sceneTheme, materials) {
51
+ const override = textures && wall.wallType === 'curtain'
52
+ ? createCurtainWallMaterials(wall, shading, materials)
53
+ : undefined;
54
+ return getMaterialsForWall(wall, shading, textures, colorPreset, sceneTheme, materials, override);
55
+ }
@@ -0,0 +1,14 @@
1
+ import { type CurtainWallConfig, type WallNode } from '@pascal-app/core';
2
+ type Props = {
3
+ node: WallNode;
4
+ height: number;
5
+ unit: 'metric' | 'imperial';
6
+ onUpdate: (patch: Partial<WallNode>) => void;
7
+ onPreview: (patch: Partial<WallNode>) => void;
8
+ onCommit: () => void;
9
+ onCancel: () => void;
10
+ };
11
+ export declare function getCurtainWallUpdate(node: WallNode, patch: Partial<CurtainWallConfig>): Pick<WallNode, 'curtainWall'>;
12
+ export declare function CurtainWallPanel({ node, height, unit, onUpdate, onPreview, onCommit, onCancel, }: Props): import("react").JSX.Element;
13
+ export {};
14
+ //# sourceMappingURL=curtain-wall-panel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"curtain-wall-panel.d.ts","sourceRoot":"","sources":["../../src/wall/curtain-wall-panel.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,iBAAiB,EAKtB,KAAK,QAAQ,EACd,MAAM,kBAAkB,CAAA;AAczB,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,QAAQ,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,QAAQ,GAAG,UAAU,CAAA;IAC3B,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAA;IAC5C,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAA;IAC7C,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,QAAQ,EAAE,MAAM,IAAI,CAAA;CACrB,CAAA;AA6KD,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAChC,IAAI,CAAC,QAAQ,EAAE,aAAa,CAAC,CAI/B;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,QAAQ,GACT,EAAE,KAAK,+BAscP"}
@@ -0,0 +1,167 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { getCurtainWallConfig, getEffectiveNode, getWallCurveLength, getWallThickness, } from '@pascal-app/core';
4
+ import { getLinearUnitLabel, linearControlValueToMeters, metersToLinearUnit, PanelSection, SegmentedControl, SliderControl, ToggleControl, } from '@pascal-app/editor';
5
+ import { useState } from 'react';
6
+ import { useCurtainPanelHighlight } from './curtain-panel-highlight';
7
+ import { curtainGridPositions, curtainPanelType } from './curtain-wall-layout';
8
+ function Choice({ label, value, options, onChange, }) {
9
+ return (_jsxs("label", { className: "flex items-center justify-between gap-2 text-xs text-muted-foreground", children: [label, _jsx("select", { "aria-label": label, className: "max-w-[160px] rounded-md border border-border bg-background px-2 py-1.5 text-foreground", onChange: (event) => {
10
+ const option = options.find((entry) => entry.value === event.target.value);
11
+ if (option)
12
+ onChange(option.value);
13
+ }, value: value, children: options.map((option) => (_jsx("option", { value: option.value, children: option.label }, option.value))) })] }));
14
+ }
15
+ function LengthControl({ label, value, min, max, unit, onChange, onCommit, onCancel, profile = false, }) {
16
+ const millimeters = profile && unit === 'metric';
17
+ const display = (meters) => millimeters ? meters * 1000 : metersToLinearUnit(meters, unit);
18
+ return (_jsx(SliderControl, { onCommit: onCommit, onCancel: onCancel, restoreOnCommit: false, previewWhileTyping: true, label: label, max: display(max), min: display(min), onChange: (next) => onChange(millimeters
19
+ ? Math.max(min, Math.min(max, next / 1000))
20
+ : linearControlValueToMeters(next, unit, { minMeters: min, maxMeters: max })), precision: millimeters ? 1 : 3, step: millimeters ? 1 : 0.005, unit: millimeters ? 'mm' : getLinearUnitLabel(unit), value: display(value) }));
21
+ }
22
+ function GridSection({ length, vertical = false, onPreview, title, value, unit, onChange, onCommit, onCancel, }) {
23
+ return (_jsxs(PanelSection, { title: title, children: [_jsx(Choice, { label: "Layout", onChange: (layout) => onChange({ ...value, layout }), options: [
24
+ { label: 'Panel count', value: 'count' },
25
+ { label: 'Maximum spacing', value: 'maximum-spacing' },
26
+ { label: 'Fixed spacing', value: 'fixed-spacing' },
27
+ ], value: value.layout }), value.layout === 'count' ? (_jsx(SliderControl, { onCommit: onCommit, onCancel: onCancel, restoreOnCommit: false, previewWhileTyping: true, label: "Panels", max: 32, min: 1, onChange: (count) => onPreview({ ...value, count: Math.round(count) }), precision: 0, step: 1, value: value.count })) : (_jsx(LengthControl, { onCommit: onCommit, onCancel: onCancel, label: "Spacing", max: 100, min: 0.2, onChange: (spacing) => onPreview({ ...value, spacing }), unit: unit, value: value.spacing })), value.layout === 'fixed-spacing' && (_jsx(SegmentedControl, { onChange: (alignment) => onChange({ ...value, alignment }), options: [
28
+ { label: vertical ? 'Bottom' : 'Start', value: 'start' },
29
+ { label: 'Center', value: 'center' },
30
+ { label: vertical ? 'Top' : 'End', value: 'end' },
31
+ ], value: value.alignment })), _jsx("p", { className: "text-[11px] text-muted-foreground", children: (() => {
32
+ const positions = curtainGridPositions(length, value);
33
+ const spans = positions.slice(1).map((position, i) => position - positions[i]);
34
+ if (!spans.length)
35
+ return 'No panels';
36
+ const min = metersToLinearUnit(Math.min(...spans), unit);
37
+ const max = metersToLinearUnit(Math.max(...spans), unit);
38
+ return `${spans.length} ${vertical ? 'rows' : 'columns'} · ${min.toFixed(2)}${max - min > 0.005 ? `–${max.toFixed(2)}` : ''} ${getLinearUnitLabel(unit)} grid spacing`;
39
+ })() })] }));
40
+ }
41
+ const PANEL_OPTIONS = [
42
+ { label: 'Glass', value: 'glass' },
43
+ { label: 'Solid', value: 'solid' },
44
+ { label: 'Empty', value: 'empty' },
45
+ ];
46
+ export function getCurtainWallUpdate(node, patch) {
47
+ return {
48
+ curtainWall: { ...getCurtainWallConfig(getEffectiveNode(node)), ...patch },
49
+ };
50
+ }
51
+ export function CurtainWallPanel({ node, height, unit, onUpdate, onPreview, onCommit, onCancel, }) {
52
+ const config = getCurtainWallConfig(node);
53
+ const update = (patch, preview = false) => {
54
+ ;
55
+ (preview ? onPreview : onUpdate)(getCurtainWallUpdate(node, patch));
56
+ };
57
+ const [tintEditing, setTintEditing] = useState(false);
58
+ const [panelEditing, setPanelEditing] = useState(false);
59
+ const [selectedColumn, setColumn] = useState(0);
60
+ const [selectedRow, setRow] = useState(0);
61
+ const columnCount = curtainGridPositions(getWallCurveLength(node), config.columns).length - 1;
62
+ const rowCount = curtainGridPositions(height, config.rows).length - 1;
63
+ const column = Math.max(0, Math.min(selectedColumn, columnCount - 1));
64
+ const row = Math.max(0, Math.min(selectedRow, rowCount - 1));
65
+ const selectedType = curtainPanelType(config, column, row, rowCount);
66
+ const changePanel = (type) => update({
67
+ panels: [
68
+ ...config.panels.filter((panel) => panel.column !== column || panel.row !== row),
69
+ ...(type ? [{ column, row, type }] : []),
70
+ ],
71
+ });
72
+ const hiddenOverrides = config.panels.filter((panel) => panel.column >= columnCount || panel.row >= rowCount);
73
+ const diagramWidth = Math.max(240, columnCount * 32);
74
+ const diagramHeight = Math.max(150, rowCount * 32);
75
+ const overridden = config.panels.some((panel) => panel.column === column && panel.row === row);
76
+ const xs = curtainGridPositions(getWallCurveLength(node), config.columns);
77
+ const ys = curtainGridPositions(height, config.rows);
78
+ useCurtainPanelHighlight(node, xs[column] ?? 0, xs[column + 1] ?? 0, ys[row] ?? 0, ys[row + 1] ?? 0, panelEditing);
79
+ const hasGlass = xs
80
+ .slice(1)
81
+ .some((_, c) => ys.slice(1).some((_, r) => curtainPanelType(config, c, r, rowCount) === 'glass'));
82
+ const paintedGlass = Boolean(node.slots?.['curtain-glass']);
83
+ const effectiveThickness = Math.min(config.glassThickness, getWallThickness(node) * 0.45);
84
+ return (_jsxs(_Fragment, { children: [_jsxs(PanelSection, { title: "Wall system", children: [_jsx(Choice, { label: "Construction", onChange: (construction) => update({ construction }), options: [
85
+ { label: 'Stick-built', value: 'stick' },
86
+ { label: 'Unitized', value: 'unitized' },
87
+ ], value: config.construction }), _jsx(Choice, { label: "Framing", onChange: (framing) => update({ framing }), options: [
88
+ { label: 'Fully capped', value: 'capped' },
89
+ { label: 'Vertical caps', value: 'vertical-caps' },
90
+ { label: 'Horizontal caps', value: 'horizontal-caps' },
91
+ { label: 'Structural glazing', value: 'structural-glazing' },
92
+ ], value: config.framing }), _jsx("p", { className: "text-[11px] text-muted-foreground", children: config.construction === 'unitized'
93
+ ? 'Separate framed modules with joints between units.'
94
+ : 'Continuous mullions and transoms assembled along the wall.' }), config.framing !== 'capped' && (_jsx("p", { className: "text-[11px] text-muted-foreground", children: "Uncapped members sit behind the glazing." }))] }), _jsx(GridSection, { onChange: (columns) => update({ columns }), onPreview: (columns) => update({ columns }, true), onCommit: onCommit, onCancel: onCancel, title: "Column layout", length: getWallCurveLength(node), unit: unit, value: config.columns }), _jsx(GridSection, { onChange: (rows) => update({ rows }), onPreview: (rows) => update({ rows }, true), onCommit: onCommit, onCancel: onCancel, title: "Row layout", length: height, vertical: true, unit: unit, value: config.rows }), ((getWallCurveLength(node) / config.columns.spacing > 32 &&
95
+ config.columns.layout !== 'count') ||
96
+ (height / config.rows.spacing > 32 && config.rows.layout !== 'count')) && (_jsx("p", { className: "px-3 text-[11px] text-muted-foreground", children: "Grid limited to 32 panels per axis. Spacing expands to fit this wall." })), _jsxs(PanelSection, { title: "Frame dimensions", children: [_jsx(LengthControl, { profile: true, onCommit: onCommit, onCancel: onCancel, label: "Vertical frame width", max: 0.3, min: 0.01, onChange: (mullionWidth) => update({ mullionWidth }, true), unit: unit, value: config.mullionWidth }), _jsx(LengthControl, { profile: true, onCommit: onCommit, onCancel: onCancel, label: "Horizontal frame width", max: 0.3, min: 0.01, onChange: (transomWidth) => update({ transomWidth }, true), unit: unit, value: config.transomWidth }), _jsx(LengthControl, { profile: true, onCommit: onCommit, onCancel: onCancel, label: "Border / opening frame", max: 0.3, min: 0.01, onChange: (perimeterWidth) => update({ perimeterWidth }, true), unit: unit, value: config.perimeterWidth }), (config.construction === 'unitized' || config.framing !== 'capped') && (_jsx(LengthControl, { profile: true, onCommit: onCommit, onCancel: onCancel, label: config.construction === 'unitized' ? 'Module joint width' : 'Glazing gap', max: 0.05, min: 0.002, onChange: (jointWidth) => update({ jointWidth }, true), unit: unit, value: config.jointWidth }))] }), _jsxs(PanelSection, { title: "Panel infill", children: [_jsx(Choice, { label: "Default panel", onChange: (panelType) => update({ panelType }), options: PANEL_OPTIONS, value: config.panelType }), _jsx(Choice, { label: "Opaque band", onChange: (spandrel) => update({ spandrel }), options: [
97
+ { label: 'None', value: 'none' },
98
+ { label: 'Bottom row', value: 'bottom' },
99
+ { label: 'Top row', value: 'top' },
100
+ ], value: config.spandrel }), _jsx("p", { className: "text-[11px] text-muted-foreground", children: "Opaque bands replace a full row with solid panels. Apply their finish with the paint tool." }), _jsx(LengthControl, { profile: true, onCommit: onCommit, onCancel: onCancel, label: "Panel thickness", max: 0.08, min: 0.004, onChange: (glassThickness) => update({ glassThickness }, true), unit: unit, value: config.glassThickness }), effectiveThickness < config.glassThickness - 1e-6 && (_jsxs("p", { className: "text-[11px] text-muted-foreground", children: ["Effective thickness:", ' ', unit === 'metric'
101
+ ? `${(effectiveThickness * 1000).toFixed(1)} mm`
102
+ : `${metersToLinearUnit(effectiveThickness, unit).toFixed(3)} ${getLinearUnitLabel(unit)}`, ", limited by frame depth."] }))] }), _jsxs(PanelSection, { title: "Edit individual panels", children: [_jsx(ToggleControl, { checked: panelEditing, label: "Enable panel editing", onChange: setPanelEditing }), panelEditing && (_jsxs(_Fragment, { children: [_jsx("p", { className: "text-[11px] text-muted-foreground", children: "Choose a cell or enter its column and row. Use arrow keys to move between cells. Columns run from the wall start; rows count upward." }), _jsx("div", { className: "max-h-64 overflow-auto rounded border border-border", children: _jsx("svg", { viewBox: `0 0 ${diagramWidth} ${diagramHeight}`, style: { width: diagramWidth, height: diagramHeight }, className: "block", role: "group", "aria-label": "Curtain wall panel selection", children: xs.slice(1).flatMap((_, c) => ys.slice(1).map((_, r) => {
103
+ const type = curtainPanelType(config, c, r, rowCount);
104
+ const selected = c === column && r === row;
105
+ return (_jsx("rect", { role: "button", tabIndex: selected ? 0 : -1, "aria-label": `Column ${c + 1}, row ${r + 1}: ${type}`, "aria-pressed": selected, "data-cell": `${c}-${r}`, x: (c / columnCount) * diagramWidth, y: diagramHeight - ((r + 1) / rowCount) * diagramHeight, width: diagramWidth / columnCount, height: diagramHeight / rowCount, fill: type === 'glass'
106
+ ? '#53788a'
107
+ : type === 'solid'
108
+ ? '#64748b'
109
+ : 'transparent', stroke: selected ? '#fb923c' : '#94a3b8', strokeWidth: selected ? 3 : 1, className: "cursor-pointer focus:stroke-orange-400 focus:stroke-[3]", onClick: () => {
110
+ setColumn(c);
111
+ setRow(r);
112
+ }, onKeyDown: (event) => {
113
+ const arrows = {
114
+ ArrowLeft: [-1, 0],
115
+ ArrowRight: [1, 0],
116
+ ArrowUp: [0, 1],
117
+ ArrowDown: [0, -1],
118
+ };
119
+ const delta = arrows[event.key];
120
+ if (delta) {
121
+ event.preventDefault();
122
+ const nextColumn = Math.max(0, Math.min(columnCount - 1, c + delta[0]));
123
+ const nextRow = Math.max(0, Math.min(rowCount - 1, r + delta[1]));
124
+ setColumn(nextColumn);
125
+ setRow(nextRow);
126
+ const target = event.currentTarget.parentElement?.querySelector(`[data-cell="${nextColumn}-${nextRow}"]`);
127
+ target?.focus();
128
+ target?.scrollIntoView({ block: 'nearest', inline: 'nearest' });
129
+ }
130
+ if (event.key === 'Enter' || event.key === ' ') {
131
+ event.preventDefault();
132
+ setColumn(c);
133
+ setRow(r);
134
+ }
135
+ } }, `${c}-${r}`));
136
+ })) }) }), hiddenOverrides.length > 0 && (_jsxs("div", { className: "space-y-2 text-[11px] text-muted-foreground", children: [_jsxs("p", { children: [hiddenOverrides.length, " custom panels are outside this grid. They return if the grid expands."] }), _jsx("button", { type: "button", className: "rounded border border-border px-2 py-1 text-xs", onClick: () => update({
137
+ panels: config.panels.filter((panel) => panel.column < columnCount && panel.row < rowCount),
138
+ }), children: "Clear hidden overrides" })] })), _jsxs("p", { className: "text-[11px] text-muted-foreground", children: ["Column ", column + 1, ", row ", row + 1, " \u00B7", ' ', overridden ? 'Custom infill' : 'Following wall defaults'] }), _jsx(SliderControl, { label: "Column", max: Math.max(1, columnCount), min: 1, onChange: (value) => setColumn(Math.round(value) - 1), precision: 0, step: 1, value: column + 1 }), _jsx(SliderControl, { label: "Row", max: Math.max(1, rowCount), min: 1, onChange: (value) => setRow(Math.round(value) - 1), precision: 0, step: 1, value: row + 1 }), _jsx(Choice, { label: "Panel infill", onChange: changePanel, options: PANEL_OPTIONS, value: selectedType }), _jsx("button", { className: "rounded border border-border px-2 py-1 text-xs disabled:cursor-default disabled:opacity-40", disabled: !overridden, onClick: () => changePanel(), type: "button", children: "Reset this panel" }), _jsx("p", { className: "text-[11px] text-muted-foreground", children: "Use the Door or Window tool to add an opening through the wall." })] }))] }), hasGlass && (_jsxs(PanelSection, { title: "Glass appearance", children: [paintedGlass && (_jsxs("div", { className: "space-y-2 text-xs text-muted-foreground", children: [_jsx("p", { children: "Glass appearance is controlled by the paint tool." }), _jsx("button", { type: "button", className: "rounded border border-border px-2 py-1", onClick: () => {
139
+ onCommit();
140
+ const slots = { ...node.slots };
141
+ delete slots['curtain-glass'];
142
+ onUpdate({ slots });
143
+ }, children: "Use glass settings instead" })] })), !paintedGlass && (_jsxs("div", { className: "space-y-2", children: [_jsx(SliderControl, { onCommit: onCommit, onCancel: onCancel, restoreOnCommit: false, previewWhileTyping: true, label: "Opacity", max: 100, min: 5, onChange: (value) => update({ glassOpacity: value / 100 }, true), precision: 0, step: 5, unit: "%", value: Math.round(config.glassOpacity * 100) }), _jsx(SliderControl, { onCommit: onCommit, onCancel: onCancel, restoreOnCommit: false, previewWhileTyping: true, label: "Surface roughness", max: 1, min: 0, onChange: (glassRoughness) => update({ glassRoughness }, true), precision: 2, step: 0.05, value: config.glassRoughness }), _jsxs("label", { className: "flex items-center justify-between text-xs text-muted-foreground", children: ["Glass tint", _jsx("input", { "aria-label": "Glass tint", className: "h-7 w-10 cursor-pointer rounded border border-border bg-transparent", onKeyDown: (event) => {
144
+ if (event.key === 'Escape') {
145
+ event.preventDefault();
146
+ onCancel();
147
+ setTintEditing(false);
148
+ }
149
+ }, onChange: (event) => {
150
+ setTintEditing(true);
151
+ update({ glassColor: event.target.value }, true);
152
+ }, onBlur: () => {
153
+ if (!tintEditing)
154
+ return;
155
+ onCommit();
156
+ setTintEditing(false);
157
+ }, onInput: (event) => {
158
+ setTintEditing(true);
159
+ update({ glassColor: event.currentTarget.value }, true);
160
+ }, type: "color", value: config.glassColor })] }), tintEditing && (_jsxs("div", { className: "flex gap-2", children: [_jsx("button", { type: "button", className: "rounded border border-border px-2 py-1 text-xs", onClick: () => {
161
+ onCommit();
162
+ setTintEditing(false);
163
+ }, children: "Apply tint" }), _jsx("button", { type: "button", className: "rounded border border-border px-2 py-1 text-xs", onClick: () => {
164
+ onCancel();
165
+ setTintEditing(false);
166
+ }, children: "Cancel tint" })] })), _jsx("p", { className: "text-[11px] text-muted-foreground", children: "Low roughness is smooth; high roughness gives a matte surface in rendered shading." })] }))] }))] }));
167
+ }
@@ -0,0 +1,5 @@
1
+ import { BufferGeometry, Vector2 } from 'three';
2
+ import type { CurtainWallPiece } from './curtain-wall-layout';
3
+ export declare function buildStraightCurtainPiecesWithCutouts(pieces: readonly CurtainWallPiece[], base: number, cutouts: readonly (readonly Vector2[])[]): BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>;
4
+ export declare function buildStraightCurtainPieces(pieces: readonly CurtainWallPiece[], base: number, cullSharedFaces?: boolean): BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>;
5
+ //# sourceMappingURL=curtain-wall-piece-geometry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"curtain-wall-piece-geometry.d.ts","sourceRoot":"","sources":["../../src/wall/curtain-wall-piece-geometry.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAsC,OAAO,EAAE,MAAM,OAAO,CAAA;AACnF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAI7D,wBAAgB,qCAAqC,CACnD,MAAM,EAAE,SAAS,gBAAgB,EAAE,EACnC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,SAAS,CAAC,SAAS,OAAO,EAAE,CAAC,EAAE,kGA+GzC;AAGD,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,SAAS,gBAAgB,EAAE,EACnC,IAAI,EAAE,MAAM,EACZ,eAAe,UAAO,kGA0HvB"}