@kruschdev/pascal-plugin-mit-assets 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/ASSETS.md +298 -0
  2. package/LICENSE +21 -0
  3. package/README.md +71 -2
  4. package/dist/agent-operations.d.ts +8 -0
  5. package/dist/agent-operations.js +305 -0
  6. package/dist/agent-tools.d.ts +7 -0
  7. package/dist/agent-tools.js +128 -0
  8. package/dist/audit.d.ts +78 -0
  9. package/dist/bin/pascal-mit-assets.js +5238 -0
  10. package/dist/bom.d.ts +123 -0
  11. package/dist/cad/appliance-mep-builders.d.ts +7 -0
  12. package/dist/cad/furniture-builders.d.ts +9 -0
  13. package/dist/cad/index.d.ts +48 -0
  14. package/dist/cad/index.js +23 -0
  15. package/dist/cad/kitchen-bath-builders.d.ts +9 -0
  16. package/dist/cad/outdoor-fenestration-builders.d.ts +8 -0
  17. package/dist/cad/primitives.d.ts +56 -0
  18. package/dist/cad/props-vehicles-builders.d.ts +8 -0
  19. package/dist/chunk-2qgndrap.js +5200 -0
  20. package/dist/chunk-6hzyh6qv.js +346 -0
  21. package/dist/chunk-f72r2bmp.js +84 -0
  22. package/dist/chunk-hqgm57dv.js +310 -0
  23. package/dist/chunk-kgwk6kan.js +150 -0
  24. package/dist/chunk-raafkn3w.js +286 -0
  25. package/dist/chunk-vzmjt9dz.js +4380 -0
  26. package/dist/chunk-xhkwv6t4.js +5080 -0
  27. package/dist/hdri/index.d.ts +1 -0
  28. package/dist/hdri/index.js +322 -0
  29. package/dist/hdri/sky.d.ts +26 -0
  30. package/dist/index.d.ts +30 -0
  31. package/dist/index.js +198 -0
  32. package/dist/manifest.d.ts +46 -0
  33. package/dist/materials/index.d.ts +10 -0
  34. package/dist/materials/index.js +1464 -0
  35. package/dist/materials/ktx2.d.ts +10 -0
  36. package/dist/materials/noise.d.ts +89 -0
  37. package/dist/materials/patterns.d.ts +15 -0
  38. package/dist/nodes/mit-item.d.ts +76 -0
  39. package/dist/render.d.ts +10 -0
  40. package/dist/render.js +24 -0
  41. package/dist/scripts/build-assets.js +17129 -0
  42. package/dist/sfx/index.d.ts +1 -0
  43. package/dist/sfx/index.js +1223 -0
  44. package/dist/sfx/synth.d.ts +25 -0
  45. package/dist/sku-crosswalk.d.ts +46 -0
  46. package/dist/ui/chat-card.d.ts +7 -0
  47. package/dist/ui/host-panel.d.ts +1 -0
  48. package/dist/ui/inspector-card.d.ts +4 -0
  49. package/dist/ui/schedule-view.d.ts +1 -0
  50. package/package.json +135 -4
  51. package/src/agent-operations.ts +373 -0
  52. package/src/agent-tools.ts +136 -0
  53. package/src/audit.ts +356 -0
  54. package/src/bom.ts +512 -0
  55. package/src/cad/appliance-mep-builders.ts +1336 -0
  56. package/src/cad/furniture-builders.ts +1622 -0
  57. package/src/cad/index.ts +993 -0
  58. package/src/cad/kitchen-bath-builders.ts +1189 -0
  59. package/src/cad/outdoor-fenestration-builders.ts +1499 -0
  60. package/src/cad/primitives.ts +286 -0
  61. package/src/cad/props-vehicles-builders.ts +1065 -0
  62. package/src/hdri/index.ts +5 -0
  63. package/src/hdri/sky.ts +481 -0
  64. package/src/index.ts +127 -0
  65. package/src/manifest.ts +5296 -0
  66. package/src/materials/index.ts +56 -0
  67. package/src/materials/ktx2.ts +138 -0
  68. package/src/materials/noise.ts +417 -0
  69. package/src/materials/patterns.ts +1507 -0
  70. package/src/nodes/mit-item.ts +163 -0
  71. package/src/render.ts +25 -0
  72. package/src/sfx/index.ts +6 -0
  73. package/src/sfx/synth.ts +1495 -0
  74. package/src/sku-crosswalk.ts +3868 -0
  75. package/src/ui/chat-card.tsx +93 -0
  76. package/src/ui/host-panel.tsx +330 -0
  77. package/src/ui/inspector-card.tsx +213 -0
  78. package/src/ui/schedule-view.tsx +188 -0
@@ -0,0 +1,1622 @@
1
+ /**
2
+ * Clean-room MIT parametric 3D CAD builders for Furniture, Seating, Beds, Tables,
3
+ * Desks, Storage, Soft Goods, Mirrors, Art, Fireplaces, Interior Lighting & Laundry.
4
+ *
5
+ * Strictly React-free, editor-free, and node:*-free.
6
+ * Every builder uses only materials from the per-call MaterialPalette `p`.
7
+ */
8
+
9
+ import * as THREE from 'three'
10
+ import {
11
+ addBox,
12
+ addCyl,
13
+ addFourLegs,
14
+ addRoundedRectExtrude,
15
+ addSphere,
16
+ addTorus,
17
+ type MaterialPalette,
18
+ type SlugBuilderFn,
19
+ } from './primitives'
20
+
21
+ // ---------------------------------------------------------------------------
22
+ // Internal geometry helpers (pure Three.js, zero global cached materials)
23
+ // ---------------------------------------------------------------------------
24
+
25
+ function addSplayedFourLegs(
26
+ g: THREE.Group,
27
+ w: number,
28
+ d: number,
29
+ legH: number,
30
+ rTop: number,
31
+ rBot: number,
32
+ insetX: number,
33
+ insetZ: number,
34
+ mat: THREE.Material,
35
+ splay = 0.08,
36
+ ): void {
37
+ const sx = Math.max(0.02, w / 2 - insetX)
38
+ const sz = Math.max(0.02, d / 2 - insetZ)
39
+ const corners: [number, number][] = [
40
+ [-1, -1],
41
+ [1, -1],
42
+ [-1, 1],
43
+ [1, 1],
44
+ ]
45
+ for (const [cx, cz] of corners) {
46
+ addCyl(
47
+ g,
48
+ rTop,
49
+ rBot,
50
+ legH,
51
+ cx * sx,
52
+ legH / 2,
53
+ cz * sz,
54
+ mat,
55
+ 10,
56
+ [cz * splay, 0, -cx * splay],
57
+ )
58
+ }
59
+ }
60
+
61
+ function addThrowPillow(
62
+ g: THREE.Group,
63
+ x: number,
64
+ y: number,
65
+ z: number,
66
+ pw: number,
67
+ ph: number,
68
+ pd: number,
69
+ rotY: number,
70
+ mat: THREE.Material,
71
+ ): void {
72
+ const pillow = addSphere(g, 0.5, x, y, z, mat, [pw, ph, pd], 12)
73
+ pillow.rotation.set(-0.18, rotY, 0.06)
74
+ }
75
+
76
+ function buildSofaFamily(
77
+ w: number,
78
+ h: number,
79
+ d: number,
80
+ p: MaterialPalette,
81
+ opts: {
82
+ seats: number
83
+ upholstery: THREE.Material
84
+ pillowMat: THREE.Material
85
+ legMat: THREE.Material
86
+ armW: number
87
+ lowModern?: boolean
88
+ tufted?: boolean
89
+ },
90
+ ): THREE.Group {
91
+ const g = new THREE.Group()
92
+ const legH = h * (opts.lowModern ? 0.16 : 0.18)
93
+ const baseH = h * 0.15
94
+ const seatH = h * 0.18
95
+ const seatY = legH + baseH + seatH / 2
96
+ const armW = Math.min(opts.armW, w * 0.16)
97
+ const armH = h * (opts.lowModern ? 0.54 : 0.58)
98
+ const backT = d * 0.2
99
+ const innerW = Math.max(0.2, w - armW * 2)
100
+
101
+ // Tapered legs
102
+ addSplayedFourLegs(g, w, d, legH, 0.026, 0.017, armW * 0.55, d * 0.14, opts.legMat, 0.07)
103
+
104
+ // Under-frame wood/metal plinth rail
105
+ addRoundedRectExtrude(g, w * 0.96, d * 0.92, baseH, 0.03, 0, legH + baseH / 2, 0, opts.upholstery)
106
+ addBox(g, w * 0.92, baseH * 0.26, d * 0.86, 0, legH + baseH * 0.12, 0, opts.legMat)
107
+
108
+ // Armrests (left & right) with padded top rail
109
+ for (const side of [-1, 1]) {
110
+ const ax = side * (w / 2 - armW / 2)
111
+ addRoundedRectExtrude(g, armW, d * 0.94, armH, 0.04, ax, legH + armH / 2, 0, opts.upholstery)
112
+ addCyl(
113
+ g,
114
+ armW * 0.44,
115
+ armW * 0.44,
116
+ d * 0.9,
117
+ ax,
118
+ legH + armH,
119
+ 0,
120
+ opts.upholstery,
121
+ 12,
122
+ [Math.PI / 2, 0, 0],
123
+ )
124
+ }
125
+
126
+ // Structural back frame
127
+ const backFrameH = h - legH
128
+ addRoundedRectExtrude(
129
+ g,
130
+ w * 0.98,
131
+ backT,
132
+ backFrameH * 0.84,
133
+ 0.04,
134
+ 0,
135
+ legH + backFrameH * 0.42,
136
+ -d / 2 + backT / 2,
137
+ opts.upholstery,
138
+ )
139
+
140
+ // Seat cushions & back cushions
141
+ const gap = 0.016
142
+ const cushionW = (innerW - gap * (opts.seats + 1)) / opts.seats
143
+ const seatD = d - backT * 0.95
144
+ const backCushionH = h - (legH + baseH + seatH * 0.7)
145
+ const backCushionD = d * 0.19
146
+
147
+ for (let i = 0; i < opts.seats; i++) {
148
+ const cx = -innerW / 2 + gap + cushionW / 2 + i * (cushionW + gap)
149
+ addRoundedRectExtrude(
150
+ g,
151
+ cushionW,
152
+ seatD,
153
+ seatH,
154
+ 0.045,
155
+ cx,
156
+ seatY,
157
+ backT * 0.42,
158
+ opts.upholstery,
159
+ )
160
+ // Back cushion slightly reclined
161
+ const bc = addRoundedRectExtrude(
162
+ g,
163
+ cushionW * 0.96,
164
+ backCushionD,
165
+ backCushionH * 0.92,
166
+ 0.05,
167
+ cx,
168
+ legH + baseH + seatH * 0.68 + backCushionH * 0.44,
169
+ -d / 2 + backT + backCushionD * 0.42,
170
+ opts.upholstery,
171
+ )
172
+ bc.rotation.x = -0.14
173
+
174
+ if (opts.tufted) {
175
+ // Subtle leather button tufts on backrest
176
+ for (const bx of [-cushionW * 0.22, cushionW * 0.22]) {
177
+ addSphere(
178
+ g,
179
+ 0.015,
180
+ cx + bx,
181
+ legH + baseH + seatH + backCushionH * 0.42,
182
+ -d / 2 + backT + backCushionD * 0.88,
183
+ p.metalDark,
184
+ [1, 1, 0.5],
185
+ 8,
186
+ )
187
+ }
188
+ }
189
+ }
190
+
191
+ // Accent throw pillows resting cleanly in front of the reclined backrest cushions (zero clipping)
192
+ const pillowY = seatY + seatH * 0.55 + h * 0.12
193
+ const pillowZ = -d / 2 + backT + backCushionD + 0.085
194
+ addThrowPillow(g, -innerW / 2 + 0.17, pillowY, pillowZ, 0.25, 0.25, 0.095, 0.32, opts.pillowMat)
195
+ if (opts.seats >= 2) {
196
+ addThrowPillow(g, innerW / 2 - 0.17, pillowY, pillowZ, 0.25, 0.25, 0.095, -0.32, opts.pillowMat)
197
+ }
198
+
199
+ return g
200
+ }
201
+
202
+ function buildFiveStarCasterBase(
203
+ g: THREE.Group,
204
+ radius: number,
205
+ hubY: number,
206
+ mat: THREE.Material,
207
+ wheelMat: THREE.Material,
208
+ ): void {
209
+ addCyl(g, 0.036, 0.042, 0.055, 0, hubY, 0, mat, 14)
210
+ for (let i = 0; i < 5; i++) {
211
+ const angle = (i * Math.PI * 2) / 5
212
+ const armLen = radius - 0.03
213
+ const mx = Math.sin(angle) * (armLen / 2)
214
+ const mz = Math.cos(angle) * (armLen / 2)
215
+ const arm = addBox(g, 0.032, 0.024, armLen, mx, hubY - 0.015, mz, mat)
216
+ arm.rotation.set(0.08, angle, 0)
217
+ const wx = Math.sin(angle) * (radius - 0.02)
218
+ const wz = Math.cos(angle) * (radius - 0.02)
219
+ addCyl(g, 0.012, 0.012, 0.028, wx, 0.044, wz, mat, 8)
220
+ addCyl(g, 0.026, 0.026, 0.032, wx, 0.026, wz, wheelMat, 12, [0, angle, Math.PI / 2])
221
+ }
222
+ }
223
+
224
+ function buildBed(
225
+ w: number,
226
+ h: number,
227
+ d: number,
228
+ p: MaterialPalette,
229
+ isDouble: boolean,
230
+ ): THREE.Group {
231
+ const g = new THREE.Group()
232
+ const legH = h * 0.18
233
+ const railH = h * 0.2
234
+ const railT = 0.045
235
+ const hbT = 0.07
236
+ const mattressH = h * 0.28
237
+ const mattressY = legH + railH * 0.6 + mattressH / 2
238
+
239
+ // Corner legs
240
+ addFourLegs(g, w * 0.94, d * 0.96, legH, 0.034, 0.06, p.woodDark, 0.78)
241
+
242
+ // Perimeter bed frame rails
243
+ addBox(g, w, railH, railT, 0, legH + railH / 2, d / 2 - railT / 2, p.woodWarm)
244
+ addBox(g, railT, railH, d - hbT, -w / 2 + railT / 2, legH + railH / 2, hbT / 2, p.woodWarm)
245
+ addBox(g, railT, railH, d - hbT, w / 2 - railT / 2, legH + railH / 2, hbT / 2, p.woodWarm)
246
+ addBox(g, w - railT * 2, 0.03, d - hbT - railT, 0, legH + railH * 0.35, hbT / 2, p.woodLight)
247
+
248
+ // Slatted / framed headboard at -Z
249
+ const hbY = legH + (h - legH) / 2
250
+ const hbH = h - legH
251
+ addBox(g, 0.06, hbH, hbT, -w / 2 + 0.03, hbY, -d / 2 + hbT / 2, p.woodDark)
252
+ addBox(g, 0.06, hbH, hbT, w / 2 - 0.03, hbY, -d / 2 + hbT / 2, p.woodDark)
253
+ addBox(g, w, 0.055, hbT * 1.08, 0, h - 0.028, -d / 2 + hbT / 2, p.woodDark)
254
+ addBox(g, w - 0.12, hbH * 0.34, hbT * 0.72, 0, legH + hbH * 0.17, -d / 2 + hbT / 2, p.woodWarm)
255
+ const slatCount = isDouble ? 9 : 6
256
+ const innerSpan = w - 0.16
257
+ for (let i = 0; i < slatCount; i++) {
258
+ const sx = -innerSpan / 2 + (innerSpan / (slatCount - 1)) * i
259
+ addBox(g, 0.045, hbH * 0.62, hbT * 0.55, sx, legH + hbH * 0.66, -d / 2 + hbT / 2, p.woodWarm)
260
+ }
261
+
262
+ // Thick rounded mattress
263
+ const matW = w - railT * 2.1
264
+ const matD = d - hbT - railT * 1.6
265
+ const matZ = hbT * 0.45
266
+ addRoundedRectExtrude(g, matW, matD, mattressH, 0.07, 0, mattressY, matZ, p.ceramicWhite)
267
+
268
+ // Folded duvet / comforter cleanly raised proud of mattress top (zero coplanar Z-fighting)
269
+ const duvetD = matD * 0.66
270
+ const duvetH = mattressH * 0.36
271
+ const duvetZ = matZ + (matD - duvetD) / 2 + 0.014
272
+ const duvetY = mattressY + mattressH * 0.5 + duvetH * 0.42
273
+ addRoundedRectExtrude(g, matW + 0.05, duvetD, duvetH, 0.06, 0, duvetY, duvetZ, p.fabricAccent)
274
+ // Folded cuff collar proudly layered above duvet
275
+ const cuffH = mattressH * 0.24
276
+ addRoundedRectExtrude(
277
+ g,
278
+ matW + 0.058,
279
+ duvetD * 0.18,
280
+ cuffH,
281
+ 0.05,
282
+ 0,
283
+ duvetY + duvetH * 0.5 + cuffH * 0.36,
284
+ duvetZ - duvetD * 0.4,
285
+ p.fabricNeutral,
286
+ )
287
+
288
+ // Pillows at head end
289
+ const pillowY = mattressY + mattressH * 0.62
290
+ const pillowZ = -d / 2 + hbT + 0.26
291
+ if (isDouble) {
292
+ for (const side of [-1, 1]) {
293
+ addSphere(g, 0.5, side * (matW * 0.24), pillowY, pillowZ, p.ceramicWhite, [matW * 0.42, 0.12, 0.34], 14)
294
+ addSphere(
295
+ g,
296
+ 0.5,
297
+ side * (matW * 0.22),
298
+ pillowY + 0.03,
299
+ pillowZ + 0.16,
300
+ p.fabricNeutral,
301
+ [matW * 0.32, 0.11, 0.18],
302
+ 12,
303
+ )
304
+ }
305
+ } else {
306
+ addSphere(g, 0.5, 0, pillowY, pillowZ, p.ceramicWhite, [matW * 0.68, 0.12, 0.34], 14)
307
+ addCyl(
308
+ g,
309
+ 0.065,
310
+ 0.065,
311
+ matW * 0.58,
312
+ 0,
313
+ pillowY + 0.02,
314
+ pillowZ + 0.19,
315
+ p.fabricNeutral,
316
+ 12,
317
+ [0, 0, Math.PI / 2],
318
+ )
319
+ }
320
+
321
+ return g
322
+ }
323
+
324
+ // ---------------------------------------------------------------------------
325
+ // 49 Furniture, Seating, Beds, Tables, Storage, Soft Goods, Lighting & Home Builders
326
+ // ---------------------------------------------------------------------------
327
+
328
+ export const FURNITURE_BUILDERS: Record<string, SlugBuilderFn> = {
329
+ // ========================= SEATING (11) =========================
330
+ sofa: (w, h, d, p) =>
331
+ buildSofaFamily(w, h, d, p, {
332
+ seats: 3,
333
+ upholstery: p.fabricNeutral,
334
+ pillowMat: p.fabricAccent,
335
+ legMat: p.woodDark,
336
+ armW: Math.max(0.14, w * 0.095),
337
+ }),
338
+
339
+ 'couch-medium': (w, h, d, p) =>
340
+ buildSofaFamily(w, h, d, p, {
341
+ seats: 2,
342
+ upholstery: p.fabricAccent,
343
+ pillowMat: p.fabricNeutral,
344
+ legMat: p.woodWarm,
345
+ armW: Math.max(0.13, w * 0.105),
346
+ }),
347
+
348
+ 'couch-small': (w, h, d, p) =>
349
+ buildSofaFamily(w, h, d, p, {
350
+ seats: 2,
351
+ upholstery: p.fabricNeutral,
352
+ pillowMat: p.terracotta,
353
+ legMat: p.woodWarm,
354
+ armW: Math.max(0.11, w * 0.11),
355
+ }),
356
+
357
+ 'my-leather-couch-modp80ha': (w, h, d, p) =>
358
+ buildSofaFamily(w, h, d, p, {
359
+ seats: 3,
360
+ upholstery: p.leatherDark,
361
+ pillowMat: p.custom(0x7c4a2d, 0.45, 0.04),
362
+ legMat: p.metalDark,
363
+ armW: Math.max(0.12, w * 0.09),
364
+ lowModern: true,
365
+ tufted: true,
366
+ }),
367
+
368
+ 'livingroom-chair': (w, h, d, p) =>
369
+ buildSofaFamily(w, h, d, p, {
370
+ seats: 1,
371
+ upholstery: p.fabricAccent,
372
+ pillowMat: p.fabricNeutral,
373
+ legMat: p.woodDark,
374
+ armW: Math.max(0.12, w * 0.14),
375
+ }),
376
+
377
+ 'lounge-chair': (w, h, d, p) => {
378
+ const g = new THREE.Group()
379
+ // Eames-inspired bentwood lounge chair + matching angled ottoman (fits 0.68 x 1.03 x 1.26)
380
+ const chairZ = -d * 0.17
381
+ const ottomanZ = d * 0.34
382
+ const baseR = Math.min(w * 0.42, 0.3)
383
+
384
+ // 5-star chrome swivel base for chair
385
+ const chairHub = new THREE.Group()
386
+ chairHub.position.set(0, 0, chairZ)
387
+ buildFiveStarCasterBase(chairHub, baseR, 0.12, p.metalChrome, p.rubberBlack)
388
+ addCyl(chairHub, 0.026, 0.032, 0.24, 0, 0.24, 0, p.metalDark, 12)
389
+ g.add(chairHub)
390
+
391
+ // Reclined plywood lower seat shell + leather cushion
392
+ const seatShell = addRoundedRectExtrude(g, w * 0.92, d * 0.44, 0.045, 0.08, 0, h * 0.34, chairZ + 0.02, p.woodWarm)
393
+ seatShell.rotation.x = -0.18
394
+ const seatCush = addRoundedRectExtrude(g, w * 0.84, d * 0.4, 0.1, 0.07, 0, h * 0.41, chairZ + 0.03, p.leatherDark)
395
+ seatCush.rotation.x = -0.18
396
+
397
+ // Reclined lower & upper backrest shells + leather pads
398
+ const midBack = addRoundedRectExtrude(g, w * 0.88, 0.045, h * 0.34, 0.06, 0, h * 0.58, chairZ - d * 0.2, p.woodWarm)
399
+ midBack.rotation.x = -0.34
400
+ const midPad = addRoundedRectExtrude(g, w * 0.8, 0.09, h * 0.3, 0.05, 0, h * 0.59, chairZ - d * 0.16, p.leatherDark)
401
+ midPad.rotation.x = -0.34
402
+
403
+ const headShell = addRoundedRectExtrude(g, w * 0.78, 0.045, h * 0.26, 0.06, 0, h * 0.86, chairZ - d * 0.28, p.woodWarm)
404
+ headShell.rotation.x = -0.26
405
+ const headPad = addRoundedRectExtrude(g, w * 0.72, 0.09, h * 0.23, 0.05, 0, h * 0.87, chairZ - d * 0.24, p.leatherDark)
406
+ headPad.rotation.x = -0.26
407
+
408
+ // Curved leather armrests + metal spine connectors
409
+ for (const side of [-1, 1]) {
410
+ const arm = addRoundedRectExtrude(g, 0.095, d * 0.34, 0.07, 0.04, side * (w * 0.44), h * 0.52, chairZ - 0.02, p.leatherDark)
411
+ arm.rotation.x = -0.15
412
+ addBox(g, 0.024, h * 0.32, 0.024, side * (w * 0.24), h * 0.72, chairZ - d * 0.27, p.metalDark, [-0.3, 0, 0])
413
+ }
414
+
415
+ // Matching ottoman footstool at +Z
416
+ const ottR = Math.min(w * 0.32, 0.23)
417
+ for (let i = 0; i < 4; i++) {
418
+ const a = (i * Math.PI) / 2 + Math.PI / 4
419
+ addBox(
420
+ g,
421
+ 0.024,
422
+ 0.02,
423
+ ottR * 1.6,
424
+ Math.sin(a) * ottR * 0.45,
425
+ 0.05,
426
+ ottomanZ + Math.cos(a) * ottR * 0.45,
427
+ p.metalChrome,
428
+ [0, a, 0],
429
+ )
430
+ }
431
+ addCyl(g, 0.022, 0.028, 0.22, 0, 0.16, ottomanZ, p.metalDark, 12)
432
+ addRoundedRectExtrude(g, w * 0.72, d * 0.32, 0.04, 0.06, 0, 0.29, ottomanZ, p.woodWarm)
433
+ addRoundedRectExtrude(g, w * 0.68, d * 0.3, 0.1, 0.06, 0, 0.36, ottomanZ, p.leatherDark)
434
+ return g
435
+ },
436
+
437
+ 'bean-bag': (w, h, d, p) => {
438
+ const g = new THREE.Group()
439
+ // Soft slumped matte-fabric lounge bean-bag pouf (no metal ring, no onion point, ultra-matte upholstery)
440
+ const matteFabric = p.custom(0x526b82, 0.95, 0.0)
441
+ const rx = w * 0.49
442
+ const rz = d * 0.49
443
+ const geo = new THREE.SphereGeometry(1, 32, 24)
444
+ const pos = geo.attributes.position!
445
+ for (let i = 0; i < pos.count; i++) {
446
+ const vx = pos.getX(i)
447
+ const vy = pos.getY(i)
448
+ const vz = pos.getZ(i)
449
+ const t = (vy + 1) * 0.5
450
+ // Wide slumped cushion base tapering gently to a broad soft rounded backrest crown (not pointy!)
451
+ const radialScale = t < 0.25 ? 0.84 + (t / 0.25) * 0.18 : 1.02 - Math.pow((t - 0.25) / 0.75, 1.8) * 0.38
452
+ // Cozy reclined seat scoop indentation on front-upper (+Z) slope
453
+ const seatDip = vz > 0.05 && t > 0.2 && t < 0.88 ? Math.sin(((t - 0.2) / 0.68) * Math.PI) * Math.pow(vz, 0.85) * 0.34 : 0
454
+ // Gentle rear backrest lean (-Z)
455
+ const backLeanZ = -Math.pow(t, 1.4) * 0.22
456
+ const yOut = Math.pow(t, 1.08) * h * 0.96 - seatDip * h * 0.42
457
+ pos.setXYZ(i, vx * rx * radialScale, Math.max(0.002, yOut), (vz * radialScale + backLeanZ) * rz)
458
+ }
459
+ geo.computeVertexNormals()
460
+ const nrm = geo.attributes.normal!
461
+ for (let i = 0; i < nrm.count; i++) {
462
+ const nx = nrm.getX(i)
463
+ const ny = nrm.getY(i)
464
+ const nz = nrm.getZ(i)
465
+ const len = Math.hypot(nx, ny, nz)
466
+ if (!Number.isFinite(len) || len < 1e-6) {
467
+ nrm.setXYZ(i, 0, -1, 0)
468
+ } else if (Math.abs(len - 1) > 1e-4) {
469
+ nrm.setXYZ(i, nx / len, ny / len, nz / len)
470
+ }
471
+ }
472
+ g.add(new THREE.Mesh(geo, matteFabric))
473
+ // Subtle soft fabric seat bolster cushion, stitched fabric label tab & top cloth grab loop
474
+ addSphere(g, 1, 0, h * 0.24, d * 0.18, matteFabric, [rx * 0.76, h * 0.22, rz * 0.56], 18)
475
+ addTorus(g, 0.032, 0.009, 0, h * 0.94, -d * 0.16, p.fabricNeutral, [0.3, Math.PI / 2, 0])
476
+ addBox(g, 0.04, 0.015, 0.02, rx * 0.82, h * 0.22, d * 0.15, p.fabricNeutral)
477
+ return g
478
+ },
479
+
480
+ 'dining-chair': (w, h, d, p) => {
481
+ const g = new THREE.Group()
482
+ const seatY = h * 0.51
483
+ const legR = 0.02
484
+ const insetX = w * 0.14
485
+ const insetZ = d * 0.14
486
+
487
+ // Front tapered legs
488
+ for (const side of [-1, 1]) {
489
+ addCyl(g, legR, legR * 0.72, seatY, side * (w / 2 - insetX), seatY / 2, d / 2 - insetZ, p.woodWarm, 10, [0.06, 0, -side * 0.05])
490
+ // Rear continuous stiles extending up into backrest
491
+ addCyl(g, legR, legR * 0.75, seatY, side * (w / 2 - insetX), seatY / 2, -d / 2 + insetZ, p.woodWarm, 10, [-0.07, 0, -side * 0.04])
492
+ addCyl(
493
+ g,
494
+ legR * 0.85,
495
+ legR,
496
+ h - seatY,
497
+ side * (w / 2 - insetX),
498
+ seatY + (h - seatY) / 2,
499
+ -d / 2 + insetZ - 0.03,
500
+ p.woodWarm,
501
+ 10,
502
+ [-0.12, 0, 0],
503
+ )
504
+ // Side stretchers
505
+ addCyl(g, 0.011, 0.011, d - insetZ * 2, side * (w / 2 - insetX), seatY * 0.36, 0, p.woodWarm, 8, [Math.PI / 2, 0, 0])
506
+ }
507
+ // Cross H-stretcher
508
+ addCyl(g, 0.011, 0.011, w - insetX * 2, 0, seatY * 0.36, 0, p.woodWarm, 8, [0, 0, Math.PI / 2])
509
+
510
+ // Wood apron & upholstered seat cushion
511
+ addRoundedRectExtrude(g, w * 0.94, d * 0.88, 0.036, 0.04, 0, seatY, 0.02, p.woodWarm)
512
+ addRoundedRectExtrude(g, w * 0.88, d * 0.82, 0.042, 0.05, 0, seatY + 0.036, 0.02, p.fabricNeutral)
513
+
514
+ // Backrest crest rail + mid rail + vertical spindles
515
+ addRoundedRectExtrude(g, w * 0.92, 0.036, h * 0.12, 0.02, 0, h - h * 0.06, -d / 2 + insetZ - 0.05, p.woodWarm)
516
+ addBox(g, w - insetX * 2, 0.032, 0.026, 0, seatY + (h - seatY) * 0.42, -d / 2 + insetZ - 0.02, p.woodWarm)
517
+ for (let i = -1; i <= 1; i++) {
518
+ addCyl(
519
+ g,
520
+ 0.009,
521
+ 0.009,
522
+ (h - seatY) * 0.78,
523
+ i * (w * 0.19),
524
+ seatY + (h - seatY) * 0.46,
525
+ -d / 2 + insetZ - 0.03,
526
+ p.woodWarm,
527
+ 8,
528
+ [-0.12, 0, 0],
529
+ )
530
+ }
531
+ return g
532
+ },
533
+
534
+ 'office-chair': (w, h, d, p) => {
535
+ const g = new THREE.Group()
536
+ const baseR = Math.min(w, d) * 0.47
537
+ const seatY = h * 0.42
538
+
539
+ // 5-star caster base + pneumatic lift
540
+ buildFiveStarCasterBase(g, baseR, 0.11, p.metalDark, p.rubberBlack)
541
+ addCyl(g, 0.026, 0.034, seatY - 0.12, 0, 0.11 + (seatY - 0.12) / 2, 0, p.metalChrome, 14)
542
+ // Under-seat tilt control box + adjustment lever
543
+ addBox(g, 0.18, 0.055, 0.2, 0, seatY - 0.04, 0, p.plasticDark)
544
+ addCyl(g, 0.008, 0.008, 0.14, 0.14, seatY - 0.045, 0.02, p.metalChrome, 8, [0, 0, Math.PI / 2])
545
+
546
+ // Cushioned contoured seat pan
547
+ addRoundedRectExtrude(g, w * 0.78, d * 0.72, 0.032, 0.06, 0, seatY, 0.02, p.plasticDark)
548
+ addRoundedRectExtrude(g, w * 0.76, d * 0.7, 0.072, 0.06, 0, seatY + 0.045, 0.02, p.leatherDark)
549
+
550
+ // Spine bracket & high ergonomic backrest + headrest
551
+ addBox(g, 0.08, 0.036, d * 0.36, 0, seatY - 0.02, -d * 0.18, p.metalDark)
552
+ addBox(g, 0.075, h * 0.38, 0.035, 0, seatY + h * 0.18, -d * 0.34, p.metalDark, [-0.1, 0, 0])
553
+ const back = addRoundedRectExtrude(g, w * 0.72, 0.075, h * 0.42, 0.06, 0, seatY + h * 0.29, -d * 0.28, p.leatherDark)
554
+ back.rotation.x = -0.1
555
+ // Lumbar pad
556
+ addRoundedRectExtrude(g, w * 0.56, 0.045, 0.12, 0.04, 0, seatY + h * 0.16, -d * 0.24, p.fabricAccent)
557
+ // Headrest
558
+ const head = addRoundedRectExtrude(g, w * 0.42, 0.065, h * 0.12, 0.04, 0, h - h * 0.07, -d * 0.29, p.leatherDark)
559
+ head.rotation.x = 0.08
560
+
561
+ // T-shaped adjustable armrests
562
+ for (const side of [-1, 1]) {
563
+ const ax = side * (w * 0.43)
564
+ addBox(g, 0.032, h * 0.18, 0.036, ax, seatY + h * 0.08, 0.02, p.metalDark)
565
+ addBox(g, 0.08, 0.026, 0.032, side * (w * 0.38), seatY - 0.01, 0.02, p.metalDark)
566
+ addRoundedRectExtrude(g, 0.075, d * 0.38, 0.028, 0.02, ax, seatY + h * 0.17, 0.04, p.rubberBlack)
567
+ }
568
+ return g
569
+ },
570
+
571
+ 'herman-miller-aeron-mo8x36k9': (w, h, d, p) => {
572
+ const g = new THREE.Group()
573
+ const baseR = Math.min(w, d) * 0.47
574
+ const seatY = h * 0.44
575
+ const meshMat = p.custom(0x30343a, 0.72, 0.12)
576
+
577
+ // Polished graphite/aluminum 5-star base & pneumatic cylinder
578
+ buildFiveStarCasterBase(g, baseR, 0.11, p.metalBrushed, p.rubberBlack)
579
+ addCyl(g, 0.024, 0.032, seatY - 0.14, 0, 0.11 + (seatY - 0.14) / 2, 0, p.metalDark, 14)
580
+ // Iconic rounded Aeron tilt housing under seat
581
+ addRoundedRectExtrude(g, 0.2, 0.24, 0.07, 0.04, 0, seatY - 0.045, -0.02, p.plasticDark)
582
+
583
+ // Sculpted Pellicle outer seat frame + recessed taut mesh center
584
+ addRoundedRectExtrude(g, w * 0.76, d * 0.72, 0.052, 0.09, 0, seatY, 0.03, p.metalDark)
585
+ addRoundedRectExtrude(g, w * 0.64, d * 0.6, 0.056, 0.07, 0, seatY + 0.004, 0.03, meshMat)
586
+
587
+ // Signature curved wishbone spine + PostureFit SL Y-lumbar support
588
+ addBox(g, 0.06, 0.045, d * 0.34, 0, seatY - 0.03, -d * 0.18, p.metalBrushed)
589
+ addCyl(g, 0.026, 0.032, h * 0.34, 0, seatY + h * 0.14, -d * 0.32, p.metalBrushed, 10, [-0.16, 0, 0])
590
+ for (const side of [-1, 1]) {
591
+ addBox(g, 0.035, 0.14, 0.024, side * 0.08, seatY + h * 0.2, -d * 0.31, p.plasticDark, [-0.14, 0, side * 0.28])
592
+ }
593
+
594
+ // Iconic wide arched outer backrest rim + translucent-look dark mesh membrane + horizontal ribs
595
+ const backY = seatY + h * 0.3
596
+ const backZ = -d * 0.27
597
+ const backH = h * 0.52
598
+ const backW = w * 0.74
599
+ // Left, right, top & bottom arched frame rails
600
+ addBox(g, 0.04, backH, 0.036, -backW / 2 + 0.02, backY, backZ, p.metalDark, [-0.12, 0, 0.05])
601
+ addBox(g, 0.04, backH, 0.036, backW / 2 - 0.02, backY, backZ, p.metalDark, [-0.12, 0, -0.05])
602
+ addRoundedRectExtrude(g, backW * 0.92, 0.036, 0.048, 0.02, 0, backY + backH * 0.48, backZ - 0.03, p.metalDark)
603
+ addRoundedRectExtrude(g, backW * 0.84, 0.036, 0.045, 0.02, 0, backY - backH * 0.44, backZ + 0.03, p.metalDark)
604
+ // Inner Pellicle mesh membrane
605
+ const meshBack = addRoundedRectExtrude(g, backW * 0.84, 0.018, backH * 0.88, 0.06, 0, backY, backZ, meshMat)
606
+ meshBack.rotation.x = -0.12
607
+
608
+ // Adjustable Aeron armrests with wide soft vinyl pads
609
+ for (const side of [-1, 1]) {
610
+ const ax = side * (w * 0.43)
611
+ addBox(g, 0.034, h * 0.17, 0.04, ax, seatY + h * 0.08, -0.03, p.metalBrushed)
612
+ addBox(g, 0.09, 0.03, 0.034, side * (w * 0.38), seatY, -0.03, p.metalBrushed)
613
+ addRoundedRectExtrude(g, 0.085, d * 0.38, 0.032, 0.03, ax, seatY + h * 0.17, 0.02, p.rubberBlack)
614
+ }
615
+ return g
616
+ },
617
+
618
+ stool: (w, h, d, p) => {
619
+ const g = new THREE.Group()
620
+ // Tall counter/bar stool with backrest (0.52 x 1.16 x 0.55)
621
+ const seatY = h * 0.65
622
+ const insetX = w * 0.15
623
+ const insetZ = d * 0.15
624
+
625
+ // 4 tall splayed tapered legs
626
+ addSplayedFourLegs(g, w, d, seatY, 0.02, 0.015, insetX, insetZ, p.woodDark, 0.06)
627
+
628
+ // 4-sided chrome footrest rail at ~24% height
629
+ const footY = h * 0.24
630
+ const fw = w - insetX * 1.9
631
+ const fd = d - insetZ * 1.9
632
+ addCyl(g, 0.01, 0.01, fw, 0, footY, fd / 2, p.metalChrome, 8, [0, 0, Math.PI / 2])
633
+ addCyl(g, 0.01, 0.01, fw, 0, footY, -fd / 2, p.metalChrome, 8, [0, 0, Math.PI / 2])
634
+ addCyl(g, 0.01, 0.01, fd, -fw / 2, footY, 0, p.metalChrome, 8, [Math.PI / 2, 0, 0])
635
+ addCyl(g, 0.01, 0.01, fd, fw / 2, footY, 0, p.metalChrome, 8, [Math.PI / 2, 0, 0])
636
+
637
+ // Molded seat base + upholstered cushion
638
+ addRoundedRectExtrude(g, w * 0.88, d * 0.84, 0.038, 0.06, 0, seatY, 0.01, p.woodWarm)
639
+ addRoundedRectExtrude(g, w * 0.84, d * 0.78, 0.062, 0.06, 0, seatY + 0.044, 0.01, p.leatherDark)
640
+
641
+ // Backrest uprights & curved padded backrest
642
+ const backH = h - seatY
643
+ for (const side of [-1, 1]) {
644
+ addCyl(g, 0.016, 0.018, backH * 0.9, side * (w * 0.32), seatY + backH * 0.45, -d * 0.36, p.woodDark, 10, [-0.1, 0, 0])
645
+ }
646
+ const backPad = addRoundedRectExtrude(
647
+ g,
648
+ w * 0.84,
649
+ 0.055,
650
+ backH * 0.48,
651
+ 0.05,
652
+ 0,
653
+ h - backH * 0.28,
654
+ -d * 0.38,
655
+ p.leatherDark,
656
+ )
657
+ backPad.rotation.x = -0.1
658
+ return g
659
+ },
660
+
661
+ // ========================= BEDS (3) =========================
662
+ 'double-bed': (w, h, d, p) => buildBed(w, h, d, p, true),
663
+
664
+ 'single-bed': (w, h, d, p) => buildBed(w, h, d, p, false),
665
+
666
+ bunkbed: (w, h, d, p) => {
667
+ const g = new THREE.Group()
668
+ // Length along X (w=1.65), depth along Z (d=0.99), height h=1.55
669
+ const post = 0.065
670
+ const lowerY = h * 0.22
671
+ const upperY = h * 0.7
672
+ const matH = h * 0.11
673
+
674
+ // 4 full-height corner posts
675
+ for (const sx of [-1, 1]) {
676
+ for (const sz of [-1, 1]) {
677
+ addBox(g, post, h, post, sx * (w / 2 - post / 2), h / 2, sz * (d / 2 - post / 2), p.woodWarm)
678
+ addBox(g, post * 1.18, 0.03, post * 1.18, sx * (w / 2 - post / 2), h - 0.015, sz * (d / 2 - post / 2), p.woodDark)
679
+ }
680
+ // End head/foot rail slats for both bunks
681
+ for (const railY of [lowerY + 0.16, upperY + 0.18, upperY + 0.3]) {
682
+ addBox(g, 0.032, 0.06, d - post * 2, sx * (w / 2 - post / 2), railY, 0, p.woodWarm)
683
+ }
684
+ }
685
+
686
+ // Lower & Upper bed decks + mattresses + blankets + pillows
687
+ for (const [idx, bunkY] of [lowerY, upperY].entries()) {
688
+ addBox(g, w - post * 1.2, 0.08, 0.032, 0, bunkY, d / 2 - post / 2, p.woodWarm)
689
+ addBox(g, w - post * 1.2, 0.08, 0.032, 0, bunkY, -d / 2 + post / 2, p.woodWarm)
690
+ addBox(g, w - post * 2, 0.028, d - post * 2, 0, bunkY - 0.01, 0, p.woodLight)
691
+ // Mattress
692
+ addRoundedRectExtrude(g, w - post * 2.2, d - post * 2.2, matH, 0.05, 0, bunkY + matH / 2 + 0.01, 0, p.ceramicWhite)
693
+ // Duvet over right 65% (cleanly raised proud above mattress top, zero Z-fighting)
694
+ const duvetH = matH * 0.36
695
+ addRoundedRectExtrude(
696
+ g,
697
+ (w - post * 2.2) * 0.65,
698
+ d - post * 2.02,
699
+ duvetH,
700
+ 0.04,
701
+ w * 0.14,
702
+ bunkY + matH + duvetH * 0.45 + 0.014,
703
+ 0,
704
+ idx === 0 ? p.fabricAccent : p.paintBlue,
705
+ )
706
+ // Pillow at -X end
707
+ addSphere(
708
+ g,
709
+ 0.5,
710
+ -w / 2 + post + 0.22,
711
+ bunkY + matH + 0.04,
712
+ 0,
713
+ p.fabricNeutral,
714
+ [0.3, 0.1, d * 0.56],
715
+ 12,
716
+ )
717
+ }
718
+
719
+ // Upper safety guardrails (full back rail + partial front rail leaving ladder gap)
720
+ addBox(g, w - post * 2, 0.055, 0.028, 0, upperY + 0.28, -d / 2 + post / 2, p.woodDark)
721
+ addBox(g, w - post * 2, 0.045, 0.028, 0, upperY + 0.16, -d / 2 + post / 2, p.woodWarm)
722
+ addBox(g, w * 0.62, 0.055, 0.028, -w * 0.13, upperY + 0.28, d / 2 - post / 2, p.woodDark)
723
+ addBox(g, w * 0.62, 0.045, 0.028, -w * 0.13, upperY + 0.16, d / 2 - post / 2, p.woodWarm)
724
+
725
+ // Front climbing ladder on right (+X, +Z face)
726
+ const ladX = w * 0.32
727
+ const ladW = 0.36
728
+ const ladZ = d / 2 - 0.01
729
+ for (const side of [-1, 1]) {
730
+ addBox(g, 0.035, h * 0.88, 0.045, ladX + side * (ladW / 2), h * 0.44, ladZ, p.woodDark)
731
+ }
732
+ for (let r = 0; r < 5; r++) {
733
+ const ry = h * 0.15 + r * (h * 0.165)
734
+ addBox(g, ladW, 0.028, 0.04, ladX, ry, ladZ, p.woodWarm)
735
+ }
736
+ return g
737
+ },
738
+
739
+ // ========================= TABLES & DESKS (9) =========================
740
+ 'dining-table': (w, h, d, p) => {
741
+ const g = new THREE.Group()
742
+ const topH = 0.048
743
+ const apronH = 0.068
744
+ const legH = h - topH
745
+
746
+ addRoundedRectExtrude(g, w, d, topH, 0.045, 0, h - topH / 2, 0, p.woodWarm)
747
+ // Recessed perimeter apron frame
748
+ addBox(g, w * 0.84, apronH, 0.028, 0, h - topH - apronH / 2, d * 0.38, p.woodDark)
749
+ addBox(g, w * 0.84, apronH, 0.028, 0, h - topH - apronH / 2, -d * 0.38, p.woodDark)
750
+ addBox(g, 0.028, apronH, d * 0.76, -w * 0.42, h - topH - apronH / 2, 0, p.woodDark)
751
+ addBox(g, 0.028, apronH, d * 0.76, w * 0.42, h - topH - apronH / 2, 0, p.woodDark)
752
+ addSplayedFourLegs(g, w, d, legH, 0.036, 0.024, w * 0.09, d * 0.12, p.woodWarm, 0.06)
753
+ return g
754
+ },
755
+
756
+ 'dining-table-mo9ms5yh': (w, h, d, p) => {
757
+ const g = new THREE.Group()
758
+ // Architectural trestle / steel A-frame dining table
759
+ const topH = 0.056
760
+ const legH = h - topH
761
+
762
+ addRoundedRectExtrude(g, w, d, topH, 0.03, 0, h - topH / 2, 0, p.woodDark)
763
+ // Twin dark-steel architectural A-frame trestle bases
764
+ for (const side of [-1, 1]) {
765
+ const tx = side * (w * 0.34)
766
+ addBox(g, 0.055, 0.04, d * 0.8, tx, 0.02, 0, p.metalDark)
767
+ addBox(g, 0.055, 0.04, d * 0.72, tx, legH - 0.02, 0, p.metalDark)
768
+ for (const sz of [-1, 1]) {
769
+ addBox(g, 0.05, legH * 1.02, 0.05, tx, legH / 2, sz * (d * 0.28), p.metalDark, [sz * 0.16, 0, 0])
770
+ }
771
+ }
772
+ // Central structural steel stretcher beam
773
+ addBox(g, w * 0.7, 0.045, 0.05, 0, legH * 0.28, 0, p.metalDark)
774
+ return g
775
+ },
776
+
777
+ table: (w, h, d, p) => {
778
+ const g = new THREE.Group()
779
+ const topH = 0.042
780
+ const apronH = 0.062
781
+ const legH = h - topH
782
+
783
+ addRoundedRectExtrude(g, w, d, topH, 0.03, 0, h - topH / 2, 0, p.woodLight)
784
+ addBox(g, w * 0.86, apronH, d * 0.82, 0, h - topH - apronH / 2, 0, p.woodWarm)
785
+ const inset = Math.min(w, d) * 0.1
786
+ for (const sx of [-1, 1]) {
787
+ for (const sz of [-1, 1]) {
788
+ const lx = sx * (w / 2 - inset)
789
+ const lz = sz * (d / 2 - inset)
790
+ addBox(g, 0.05, legH, 0.05, lx, legH / 2, lz, p.woodWarm)
791
+ addBox(g, 0.054, 0.045, 0.054, lx, 0.022, lz, p.metalDark)
792
+ }
793
+ }
794
+ return g
795
+ },
796
+
797
+ 'coffee-table': (w, h, d, p) => {
798
+ const g = new THREE.Group()
799
+ const topH = Math.max(0.03, h * 0.14)
800
+ const shelfY = h * 0.36
801
+ const legH = h - topH
802
+
803
+ addRoundedRectExtrude(g, w, d, topH, 0.08, 0, h - topH / 2, 0, p.woodWarm)
804
+ // Recessed lower display shelf
805
+ addRoundedRectExtrude(g, w * 0.82, d * 0.74, topH * 0.7, 0.05, 0, shelfY, 0, p.woodDark)
806
+ addSplayedFourLegs(g, w, d, legH, 0.028, 0.018, w * 0.1, d * 0.14, p.woodDark, 0.12)
807
+ return g
808
+ },
809
+
810
+ 'bedside-table': (w, h, d, p) => {
811
+ const g = new THREE.Group()
812
+ const legH = h * 0.24
813
+ const bodyH = h - legH - 0.026
814
+ const bodyY = legH + bodyH / 2
815
+
816
+ addSplayedFourLegs(g, w, d, legH, 0.02, 0.013, 0.05, 0.05, p.woodDark, 0.08)
817
+ // Carcase & beveled top
818
+ addBox(g, w * 0.96, bodyH, d * 0.94, 0, bodyY, -0.006, p.woodWarm)
819
+ addRoundedRectExtrude(g, w, d, 0.026, 0.02, 0, h - 0.013, 0, p.woodWarm)
820
+
821
+ // 2 stacked drawers with metal bar pulls
822
+ const drawerH = (bodyH - 0.042) / 2
823
+ for (let i = 0; i < 2; i++) {
824
+ const dy = legH + 0.014 + drawerH / 2 + i * (drawerH + 0.014)
825
+ addBox(g, w * 0.88, drawerH, 0.022, 0, dy, d * 0.46, p.woodLight)
826
+ addBox(g, w * 0.28, 0.014, 0.024, 0, dy, d * 0.485, p.metalBrushed)
827
+ }
828
+ return g
829
+ },
830
+
831
+ desk: (w, h, d, p) => {
832
+ const g = new THREE.Group()
833
+ const topH = 0.038
834
+ const legH = h - topH
835
+ const pedW = w * 0.27
836
+
837
+ // Desktop + cable grommet
838
+ addRoundedRectExtrude(g, w, d, topH, 0.025, 0, h - topH / 2, 0, p.woodWarm)
839
+ addCyl(g, 0.028, 0.028, 0.008, -w * 0.22, h + 0.002, -d * 0.34, p.plasticDark, 12)
840
+
841
+ // Left open metal frame legs + modesty cross-panel
842
+ const lx = -w / 2 + 0.06
843
+ addBox(g, 0.04, legH, 0.04, lx, legH / 2, d / 2 - 0.06, p.metalDark)
844
+ addBox(g, 0.04, legH, 0.04, lx, legH / 2, -d / 2 + 0.06, p.metalDark)
845
+ addBox(g, 0.035, 0.035, d - 0.12, lx, 0.08, 0, p.metalDark)
846
+ addBox(g, w - pedW - 0.08, legH * 0.32, 0.022, -pedW / 2, legH * 0.78, -d / 2 + 0.08, p.woodDark)
847
+
848
+ // Right-side 2-drawer storage pedestal
849
+ const px = w / 2 - pedW / 2 - 0.03
850
+ const pedH = legH - 0.08
851
+ addBox(g, pedW, pedH, d * 0.88, px, 0.08 + pedH / 2, -0.01, p.woodDark)
852
+ // Pedestal feet under right-side drawer unit
853
+ for (const fx of [-pedW * 0.36, pedW * 0.36]) {
854
+ for (const fz of [-d * 0.34, d * 0.34]) {
855
+ addCyl(g, 0.016, 0.014, 0.08, px + fx, 0.04, fz, p.metalDark, 8)
856
+ }
857
+ }
858
+ const dh = (pedH - 0.045) / 2
859
+ for (let i = 0; i < 2; i++) {
860
+ const dy = 0.095 + dh / 2 + i * (dh + 0.015)
861
+ addBox(g, pedW * 0.88, dh, 0.022, px, dy, d * 0.44, p.woodWarm)
862
+ addBox(g, pedW * 0.36, 0.014, 0.024, px, dy, d * 0.465, p.metalBrushed)
863
+ }
864
+ return g
865
+ },
866
+
867
+ 'office-table': (w, h, d, p) => {
868
+ const g = new THREE.Group()
869
+ const topH = 0.034
870
+ const legH = h - topH
871
+
872
+ // Clean modern workstation top + rear cable tray
873
+ addRoundedRectExtrude(g, w, d, topH, 0.02, 0, h - topH / 2, 0, p.woodLight)
874
+ addBox(g, w * 0.65, 0.06, 0.09, 0, h - topH - 0.06, -d * 0.32, p.metalDark)
875
+ addBox(g, w * 0.86, 0.04, 0.04, 0, h - topH - 0.025, 0, p.metalDark)
876
+
877
+ // Twin steel sled/loop legs
878
+ for (const side of [-1, 1]) {
879
+ const lx = side * (w / 2 - 0.07)
880
+ addBox(g, 0.042, 0.032, d * 0.88, lx, 0.016, 0, p.metalDark)
881
+ addBox(g, 0.042, 0.032, d * 0.88, lx, legH - 0.016, 0, p.metalDark)
882
+ addBox(g, 0.042, legH, 0.042, lx, legH / 2, -d * 0.42, p.metalDark)
883
+ addBox(g, 0.042, legH, 0.042, lx, legH / 2, d * 0.42, p.metalDark)
884
+ }
885
+ return g
886
+ },
887
+
888
+ 'standing-desk-mo8wgz95': (w, h, d, p) => {
889
+ const g = new THREE.Group()
890
+ const topH = 0.034
891
+ const legH = h - topH
892
+
893
+ // Wide beveled wooden sit-stand desktop
894
+ addRoundedRectExtrude(g, w, d, topH, 0.028, 0, h - topH / 2, 0, p.woodWarm)
895
+ // Under-desk motorized steel crossbar frame
896
+ addBox(g, w * 0.82, 0.048, 0.07, 0, h - topH - 0.024, 0, p.metalDark)
897
+
898
+ // Dual-stage telescoping T-columns + heavy T-feet with leveling glides
899
+ for (const side of [-1, 1]) {
900
+ const lx = side * (w * 0.37)
901
+ // Wide T-foot bar
902
+ addRoundedRectExtrude(g, 0.085, d * 0.88, 0.026, 0.02, lx, 0.022, 0, p.metalDark)
903
+ for (const fz of [-d * 0.38, d * 0.38]) {
904
+ addCyl(g, 0.024, 0.026, 0.012, lx, 0.006, fz, p.rubberBlack, 10)
905
+ }
906
+ // Upper thick outer column + lower inner telescoping column
907
+ addBox(g, 0.072, legH * 0.56, 0.085, lx, legH * 0.72, 0, p.metalDark)
908
+ addBox(g, 0.056, legH * 0.52, 0.068, lx, legH * 0.28, 0, p.metalBrushed)
909
+ // Top mounting wing bracket
910
+ addBox(g, 0.06, 0.024, d * 0.72, lx, legH - 0.012, 0, p.metalDark)
911
+ }
912
+
913
+ // Front-right digital height keypad controller
914
+ addBox(g, 0.12, 0.026, 0.065, w * 0.34, h - topH - 0.014, d / 2 - 0.02, p.plasticDark)
915
+ addBox(g, 0.048, 0.014, 0.008, w * 0.32, h - topH - 0.014, d / 2 + 0.014, p.emissiveGreen)
916
+ return g
917
+ },
918
+
919
+ 'tv-stand': (w, h, d, p) => {
920
+ const g = new THREE.Group()
921
+ const legH = h * 0.26
922
+ const bodyH = h - legH
923
+ const bodyY = legH + bodyH / 2
924
+ const bayW = w * 0.3
925
+
926
+ // 4 short mid-century splayed legs + center support foot
927
+ addSplayedFourLegs(g, w, d, legH, 0.018, 0.012, 0.08, 0.05, p.woodDark, 0.1)
928
+ addCyl(g, 0.014, 0.012, legH, 0, legH / 2, 0, p.metalDark, 8)
929
+
930
+ // Outer top, bottom, back, side carcase boards
931
+ addRoundedRectExtrude(g, w, d, 0.026, 0.015, 0, h - 0.013, 0, p.woodWarm)
932
+ addBox(g, w * 0.98, 0.024, d * 0.96, 0, legH + 0.012, 0, p.woodWarm)
933
+ addBox(g, w * 0.96, bodyH - 0.04, 0.016, 0, bodyY, -d / 2 + 0.012, p.woodDark)
934
+ for (const side of [-1, 1]) {
935
+ addBox(g, 0.024, bodyH - 0.02, d * 0.96, side * (w / 2 - 0.012), bodyY, 0, p.woodWarm)
936
+ // Inner bay dividers
937
+ addBox(g, 0.022, bodyH - 0.04, d * 0.92, side * (w / 2 - bayW), bodyY, 0, p.woodWarm)
938
+ // Left & right closed cabinet doors with pulls
939
+ const doorX = side * (w / 2 - bayW / 2)
940
+ addBox(g, bayW - 0.032, bodyH - 0.044, 0.02, doorX, bodyY, d / 2 - 0.012, p.woodDark)
941
+ addBox(g, 0.07, 0.014, 0.022, doorX - side * (bayW * 0.28), bodyY + bodyH * 0.15, d / 2 + 0.008, p.metalCopper)
942
+ }
943
+
944
+ // Center open media bay shelf (glass)
945
+ addBox(g, w - bayW * 2 - 0.02, 0.014, d * 0.84, 0, bodyY, 0, p.glass)
946
+ return g
947
+ },
948
+
949
+ // ========================= STORAGE & SHELVING (7) =========================
950
+ bookshelf: (w, h, d, p) => {
951
+ const g = new THREE.Group()
952
+ const sideT = 0.032
953
+ const shelfT = 0.028
954
+ const levels = 6
955
+
956
+ // Tall vertical side panels + back panel + plinth
957
+ addBox(g, sideT, h, d, -w / 2 + sideT / 2, h / 2, 0, p.woodWarm)
958
+ addBox(g, sideT, h, d, w / 2 - sideT / 2, h / 2, 0, p.woodWarm)
959
+ addBox(g, w - sideT, h - 0.06, 0.014, 0, h / 2 + 0.02, -d / 2 + 0.008, p.woodDark)
960
+ addBox(g, w - sideT * 2, 0.075, d * 0.88, 0, 0.0375, -0.01, p.woodDark)
961
+
962
+ // 6 horizontal shelves including top crown
963
+ const shelfW = w - sideT * 2
964
+ for (let i = 0; i < levels; i++) {
965
+ const sy = 0.08 + ((h - 0.094) / (levels - 1)) * i
966
+ addBox(g, shelfW, shelfT, d * 0.96, 0, sy, 0.004, p.woodWarm)
967
+ }
968
+
969
+ // Architectural book clusters on shelves 2 & 3 so silhouette reads as bookcase
970
+ const bookColors = [p.paintRed, p.paintBlue, p.fabricAccent, p.terracotta, p.paintYellow, p.woodDark]
971
+ const bayH = (h - 0.094) / (levels - 1)
972
+ for (const shelfIdx of [2, 3]) {
973
+ const baseY = 0.08 + bayH * shelfIdx + shelfT / 2
974
+ const startX = shelfIdx === 2 ? -shelfW * 0.42 : -shelfW * 0.1
975
+ for (let b = 0; b < 5; b++) {
976
+ const bh = bayH * (0.62 + ((b * 7 + shelfIdx) % 3) * 0.08)
977
+ const mat = bookColors[(b + shelfIdx * 2) % bookColors.length] ?? p.paintBlue
978
+ addBox(g, 0.038, bh, d * 0.66, startX + b * 0.044, baseY + bh / 2, 0.02, mat)
979
+ }
980
+ }
981
+ return g
982
+ },
983
+
984
+ 'ikea-kallax-1x4-moa2y49n': (w, h, d, p) => {
985
+ const g = new THREE.Group()
986
+ // Iconic thick-outer-wall Kallax 1x4 vertical shelving unit (1.09 x 2.06 x 0.55)
987
+ const outerT = 0.055
988
+ const innerT = 0.024
989
+ const innerW = w - outerT * 2
990
+ const innerH = h - outerT * 2
991
+ const cubbyH = (innerH - innerT * 3) / 4
992
+
993
+ // Chunky outer perimeter box (matte white)
994
+ addBox(g, w, outerT, d, 0, outerT / 2, 0, p.paintWhite)
995
+ addBox(g, w, outerT, d, 0, h - outerT / 2, 0, p.paintWhite)
996
+ addBox(g, outerT, innerH, d, -w / 2 + outerT / 2, h / 2, 0, p.paintWhite)
997
+ addBox(g, outerT, innerH, d, w / 2 - outerT / 2, h / 2, 0, p.paintWhite)
998
+
999
+ // 3 internal horizontal dividers creating 4 large open cubbies
1000
+ for (let i = 1; i <= 3; i++) {
1001
+ const sy = outerT + cubbyH * i + innerT * (i - 0.5)
1002
+ addBox(g, innerW, innerT, d * 0.98, 0, sy, 0, p.paintWhite)
1003
+ }
1004
+
1005
+ // Bottom 2 cubbies outfitted with flat DRÖNA fabric storage boxes (bottom drawer slid cleanly forward)
1006
+ for (let i = 0; i < 2; i++) {
1007
+ const cy = outerT + cubbyH / 2 + i * (cubbyH + innerT)
1008
+ const boxMat = i === 0 ? p.fabricAccent : p.fabricNeutral
1009
+ const boxD = d * 0.86
1010
+ const boxZ = i === 0 ? 0.04 : 0.01
1011
+ addBox(g, innerW * 0.9, cubbyH * 0.86, boxD, 0, cy, boxZ, boxMat)
1012
+ // Finger pull cutout bar proudly offset from drawer front face
1013
+ addBox(g, 0.11, 0.026, 0.016, 0, cy + cubbyH * 0.16, boxZ + boxD / 2 + 0.008, p.metalDark)
1014
+ }
1015
+ return g
1016
+ },
1017
+
1018
+ closet: (w, h, d, p) => {
1019
+ const g = new THREE.Group()
1020
+ const plinthH = 0.08
1021
+ const crownH = 0.045
1022
+ const bodyH = h - plinthH - crownH
1023
+ const bodyY = plinthH + bodyH / 2
1024
+
1025
+ // Recessed toe-kick plinth & crown cornice
1026
+ addBox(g, w * 0.94, plinthH, d * 0.88, 0, plinthH / 2, -0.02, p.woodDark)
1027
+ addBox(g, w, crownH, d, 0, h - crownH / 2, 0, p.woodDark)
1028
+ // Main wardrobe carcase
1029
+ addBox(g, w * 0.98, bodyH, d * 0.94, 0, bodyY, -0.015, p.woodWarm)
1030
+
1031
+ // 3 full-height doors with subtle reveal seams & long brushed handles
1032
+ const doors = 3
1033
+ const gap = 0.012
1034
+ const doorW = (w * 0.96 - gap * (doors + 1)) / doors
1035
+ for (let i = 0; i < doors; i++) {
1036
+ const dx = -(w * 0.96) / 2 + gap + doorW / 2 + i * (doorW + gap)
1037
+ addBox(g, doorW, bodyH - 0.024, 0.024, dx, bodyY, d / 2 - 0.012, p.woodLight)
1038
+ // Center door features a tall vertical dressing mirror inset
1039
+ if (i === 1) {
1040
+ addBox(g, doorW * 0.72, bodyH * 0.78, 0.01, dx, bodyY + 0.04, d / 2 + 0.004, p.mirror)
1041
+ }
1042
+ // Long sleek vertical handle
1043
+ const hx = dx + (i === 0 ? doorW * 0.38 : -doorW * 0.38)
1044
+ addCyl(g, 0.009, 0.009, 0.42, hx, bodyY - 0.05, d / 2 + 0.022, p.metalBrushed, 10)
1045
+ }
1046
+ return g
1047
+ },
1048
+
1049
+ dresser: (w, h, d, p) => {
1050
+ const g = new THREE.Group()
1051
+ const plinthH = 0.075
1052
+ const topH = 0.032
1053
+ const bodyH = h - plinthH - topH
1054
+ const bodyY = plinthH + bodyH / 2
1055
+
1056
+ // Base plinth / feet & beveled top
1057
+ addBox(g, w * 0.92, plinthH, d * 0.88, 0, plinthH / 2, -0.01, p.woodDark)
1058
+ addRoundedRectExtrude(g, w, d, topH, 0.022, 0, h - topH / 2, 0, p.woodWarm)
1059
+ addBox(g, w * 0.96, bodyH, d * 0.92, 0, bodyY, -0.014, p.woodWarm)
1060
+
1061
+ // 2 columns x 3 rows = 6 drawers with twin knobs/bar pulls
1062
+ const cols = 2
1063
+ const rows = 3
1064
+ const gap = 0.014
1065
+ const dw = (w * 0.92 - gap * (cols + 1)) / cols
1066
+ const dh = (bodyH - gap * (rows + 1)) / rows
1067
+ for (let r = 0; r < rows; r++) {
1068
+ for (let c = 0; c < cols; c++) {
1069
+ const dx = -(w * 0.92) / 2 + gap + dw / 2 + c * (dw + gap)
1070
+ const dy = plinthH + gap + dh / 2 + r * (dh + gap)
1071
+ addBox(g, dw, dh, 0.022, dx, dy, d * 0.455, p.woodLight)
1072
+ addBox(g, dw * 0.34, 0.014, 0.024, dx, dy, d * 0.48, p.metalCopper)
1073
+ }
1074
+ }
1075
+ return g
1076
+ },
1077
+
1078
+ shelf: (w, h, d, p) => {
1079
+ const g = new THREE.Group()
1080
+ // Wall-mounted floating shelf (0.74 x 0.04 x 0.32, back at -Z)
1081
+ const plankH = Math.max(0.024, h * 0.68)
1082
+ addRoundedRectExtrude(g, w, d * 0.94, plankH, 0.012, 0, h - plankH / 2, d * 0.03, p.woodWarm)
1083
+ // Rear concealed mounting cleat plate at -Z
1084
+ addBox(g, w * 0.88, h * 0.88, 0.014, 0, h / 2, -d / 2 + 0.007, p.metalDark)
1085
+ // Twin slim minimal underside support brackets
1086
+ for (const side of [-1, 1]) {
1087
+ const bx = side * (w * 0.34)
1088
+ addBox(g, 0.018, h * 0.42, d * 0.65, bx, h * 0.21, -d * 0.14, p.metalDark)
1089
+ addBox(g, 0.024, h * 0.95, 0.014, bx, h / 2, -d / 2 + 0.012, p.metalDark)
1090
+ }
1091
+ return g
1092
+ },
1093
+
1094
+ 'coat-rack': (w, h, d, p) => {
1095
+ const g = new THREE.Group()
1096
+ const baseR = Math.min(w, d) * 0.48
1097
+ // Weighted marble/dark base disc + 3 splayed feet
1098
+ addCyl(g, baseR * 0.92, baseR, 0.036, 0, 0.018, 0, p.stoneDark, 20)
1099
+ // Central turned vertical pole
1100
+ addCyl(g, 0.02, 0.028, h * 0.96, 0, h * 0.5, 0, p.woodDark, 14)
1101
+ addSphere(g, 0.028, 0, h - 0.02, 0, p.metalCopper, undefined, 10)
1102
+ // Lower umbrella retainer ring
1103
+ addTorus(g, baseR * 0.58, 0.009, 0, h * 0.34, 0, p.metalDark, [Math.PI / 2, 0, 0])
1104
+ for (let i = 0; i < 3; i++) {
1105
+ const a = (i * Math.PI * 2) / 3
1106
+ addBox(g, 0.012, 0.012, baseR * 0.58, Math.sin(a) * baseR * 0.29, h * 0.34, Math.cos(a) * baseR * 0.29, p.metalDark, [0, a, 0])
1107
+ }
1108
+ // 6 upper angled coat hooks with ball finials (2 tiers of 3)
1109
+ for (let tier = 0; tier < 2; tier++) {
1110
+ const ty = h * (tier === 0 ? 0.88 : 0.77)
1111
+ const offset = tier * (Math.PI / 3)
1112
+ for (let i = 0; i < 3; i++) {
1113
+ const a = offset + (i * Math.PI * 2) / 3
1114
+ const hookLen = baseR * 0.82
1115
+ const hx = Math.sin(a) * (hookLen * 0.5)
1116
+ const hz = Math.cos(a) * (hookLen * 0.5)
1117
+ const hook = addCyl(g, 0.008, 0.011, hookLen, hx, ty, hz, p.woodWarm, 8)
1118
+ hook.rotation.order = 'YXZ'
1119
+ hook.rotation.y = a
1120
+ hook.rotation.x = 0.88
1121
+ addSphere(g, 0.018, Math.sin(a) * hookLen * 0.85, ty + hookLen * 0.36, Math.cos(a) * hookLen * 0.85, p.metalCopper, undefined, 10)
1122
+ }
1123
+ }
1124
+ return g
1125
+ },
1126
+
1127
+ 'trash-bin': (w, h, d, p) => {
1128
+ const g = new THREE.Group()
1129
+ const bodyW = w * 0.94
1130
+ const bodyD = d * 0.86
1131
+ const bodyH = h * 0.88
1132
+
1133
+ // Black rubber non-slip base skirt
1134
+ addRoundedRectExtrude(g, bodyW * 1.02, bodyD * 1.02, 0.04, 0.06, 0, 0.02, -d * 0.04, p.rubberBlack)
1135
+ // Brushed stainless steel bin body
1136
+ addRoundedRectExtrude(g, bodyW, bodyD, bodyH, 0.06, 0, 0.03 + bodyH / 2, -d * 0.04, p.metalBrushed)
1137
+ // Dark inner collar rim + domed hinged lid
1138
+ addRoundedRectExtrude(g, bodyW * 0.96, bodyD * 0.96, 0.025, 0.055, 0, 0.03 + bodyH + 0.01, -d * 0.04, p.plasticDark)
1139
+ addRoundedRectExtrude(g, bodyW * 0.94, bodyD * 0.94, h * 0.07, 0.055, 0, h - h * 0.035, -d * 0.04, p.metalChrome)
1140
+ // Rear lid hinge block
1141
+ addBox(g, bodyW * 0.3, 0.05, 0.035, 0, 0.03 + bodyH, -d * 0.47, p.plasticDark)
1142
+ // Protruding front foot pedal at +Z
1143
+ addBox(g, bodyW * 0.34, 0.024, d * 0.14, 0, 0.032, d * 0.43, p.metalDark)
1144
+ addBox(g, bodyW * 0.28, 0.016, d * 0.09, 0, 0.046, d * 0.44, p.rubberBlack)
1145
+ return g
1146
+ },
1147
+
1148
+ // ========================= SOFT GOODS, MIRRORS, ART & FIREPLACES (8) =========================
1149
+ 'rectangular-carpet': (w, h, d, p) => {
1150
+ const g = new THREE.Group()
1151
+ // Flat non-slip backing + woven main pile + inlaid border frame + short fringe ends
1152
+ addBox(g, w * 0.94, h * 0.35, d * 0.98, 0, h * 0.18, 0, p.rubberBlack)
1153
+ addRoundedRectExtrude(g, w * 0.94, d, h * 0.65, 0.04, 0, h * 0.58, 0, p.fabricNeutral)
1154
+ // Subtle contrasting geometric border bands
1155
+ const bw = 0.09
1156
+ addBox(g, w * 0.82, h * 0.15, bw, 0, h * 0.93, d * 0.39, p.fabricAccent)
1157
+ addBox(g, w * 0.82, h * 0.15, bw, 0, h * 0.93, -d * 0.39, p.fabricAccent)
1158
+ addBox(g, bw, h * 0.15, d * 0.84, -w * 0.38, h * 0.93, 0, p.fabricAccent)
1159
+ addBox(g, bw, h * 0.15, d * 0.84, w * 0.38, h * 0.93, 0, p.fabricAccent)
1160
+ // End fringes along ±X
1161
+ for (const side of [-1, 1]) {
1162
+ for (let i = -3; i <= 3; i++) {
1163
+ addBox(g, w * 0.03, h * 0.22, 0.04, side * (w * 0.485), h * 0.22, i * (d * 0.13), p.ceramicMatte)
1164
+ }
1165
+ }
1166
+ return g
1167
+ },
1168
+
1169
+ 'round-carpet': (w, h, d, p) => {
1170
+ const g = new THREE.Group()
1171
+ const r = Math.min(w, d) / 2
1172
+ // Concentric woven circular rug rings
1173
+ addCyl(g, r, r, h * 0.45, 0, h * 0.22, 0, p.fabricNeutral, 32)
1174
+ addCyl(g, r * 0.88, r * 0.88, h * 0.32, 0, h * 0.58, 0, p.fabricAccent, 32)
1175
+ addCyl(g, r * 0.68, r * 0.68, h * 0.24, 0, h * 0.78, 0, p.fabricNeutral, 28)
1176
+ addCyl(g, r * 0.34, r * 0.34, h * 0.14, 0, h * 0.93, 0, p.terracotta, 24)
1177
+ return g
1178
+ },
1179
+
1180
+ 'rectangular-mirror': (w, h, d, p) => {
1181
+ const g = new THREE.Group()
1182
+ // Wall-mounted framed mirror (back at -Z, glass facing +Z)
1183
+ const frameT = Math.max(0.032, Math.min(w, h) * 0.06)
1184
+ addBox(g, w * 0.96, h * 0.96, d * 0.36, 0, h / 2, -d * 0.32, p.woodDark)
1185
+ // 4 mitered outer frame bars
1186
+ addBox(g, w, frameT, d, 0, h - frameT / 2, 0, p.woodWarm)
1187
+ addBox(g, w, frameT, d, 0, frameT / 2, 0, p.woodWarm)
1188
+ addBox(g, frameT, h - frameT * 2, d, -w / 2 + frameT / 2, h / 2, 0, p.woodWarm)
1189
+ addBox(g, frameT, h - frameT * 2, d, w / 2 - frameT / 2, h / 2, 0, p.woodWarm)
1190
+ // Reflective mirror glass pane
1191
+ addBox(g, w - frameT * 2, h - frameT * 2, d * 0.28, 0, h / 2, d * 0.14, p.mirror)
1192
+ return g
1193
+ },
1194
+
1195
+ 'round-mirror': (w, h, d, p) => {
1196
+ const g = new THREE.Group()
1197
+ const r = Math.min(w, h) / 2
1198
+ const cy = h / 2
1199
+ // Backing disc
1200
+ addCyl(g, r * 0.94, r * 0.94, d * 0.35, 0, cy, -d * 0.28, p.woodDark, 28, [Math.PI / 2, 0, 0])
1201
+ // Reflective circular mirror pane
1202
+ addCyl(g, r * 0.9, r * 0.9, d * 0.22, 0, cy, d * 0.12, p.mirror, 28, [Math.PI / 2, 0, 0])
1203
+ // Deep metallic/brass circular rim torus
1204
+ addTorus(g, r * 0.93, Math.max(0.018, r * 0.07), 0, cy, 0.002, p.metalCopper)
1205
+ // Top decorative hanging knob & subtle leather accent tab
1206
+ addCyl(g, 0.022, 0.022, d * 0.6, 0, h - 0.018, 0, p.metalDark, 10, [Math.PI / 2, 0, 0])
1207
+ return g
1208
+ },
1209
+
1210
+ picture: (w, h, d, p) => {
1211
+ const g = new THREE.Group()
1212
+ // Framed landscape gallery artwork (1.47 x 0.82 x 0.06, facing +Z)
1213
+ const frameT = 0.042
1214
+ addBox(g, w * 0.98, h * 0.98, d * 0.32, 0, h / 2, -d * 0.32, p.woodDark)
1215
+ // 4 frame rails
1216
+ addBox(g, w, frameT, d, 0, h - frameT / 2, 0, p.metalDark)
1217
+ addBox(g, w, frameT, d, 0, frameT / 2, 0, p.metalDark)
1218
+ addBox(g, frameT, h - frameT * 2, d, -w / 2 + frameT / 2, h / 2, 0, p.metalDark)
1219
+ addBox(g, frameT, h - frameT * 2, d, w / 2 - frameT / 2, h / 2, 0, p.metalDark)
1220
+ // Matte white gallery mount board
1221
+ const innerW = w - frameT * 2
1222
+ const innerH = h - frameT * 2
1223
+ addBox(g, innerW, innerH, d * 0.2, 0, h / 2, -d * 0.04, p.ceramicWhite)
1224
+ // Abstract landscape composition inside mat
1225
+ const artW = innerW * 0.82
1226
+ const artH = innerH * 0.76
1227
+ addBox(g, artW, artH * 0.56, 0.006, 0, h / 2 + artH * 0.22, d * 0.08, p.paintBlue)
1228
+ addBox(g, artW, artH * 0.44, 0.006, 0, h / 2 - artH * 0.28, d * 0.08, p.terracotta)
1229
+ addCyl(g, artH * 0.16, artH * 0.16, 0.008, artW * 0.22, h / 2 + artH * 0.16, d * 0.1, p.paintYellow, 18, [Math.PI / 2, 0, 0])
1230
+ // Protective front glass
1231
+ addBox(g, innerW, innerH, 0.004, 0, h / 2, d * 0.26, p.glass)
1232
+ return g
1233
+ },
1234
+
1235
+ 'wall-art-06': (w, h, d, p) => {
1236
+ const g = new THREE.Group()
1237
+ // Tall portrait minimalist Bauhaus/mid-century relief art (0.9 x 1.15 x 0.04)
1238
+ const frameT = 0.032
1239
+ addBox(g, w, frameT, d, 0, h - frameT / 2, 0, p.woodWarm)
1240
+ addBox(g, w, frameT, d, 0, frameT / 2, 0, p.woodWarm)
1241
+ addBox(g, frameT, h - frameT * 2, d, -w / 2 + frameT / 2, h / 2, 0, p.woodWarm)
1242
+ addBox(g, frameT, h - frameT * 2, d, w / 2 - frameT / 2, h / 2, 0, p.woodWarm)
1243
+ const innerW = w - frameT * 2
1244
+ const innerH = h - frameT * 2
1245
+ addBox(g, innerW, innerH, d * 0.45, 0, h / 2, -d * 0.18, p.ceramicMatte)
1246
+ // Geometric relief elements
1247
+ addBox(g, innerW * 0.46, innerH * 0.52, d * 0.25, -innerW * 0.14, h * 0.42, d * 0.1, p.fabricAccent)
1248
+ addCyl(g, innerW * 0.22, innerW * 0.22, d * 0.28, innerW * 0.15, h * 0.64, d * 0.14, p.terracotta, 22, [Math.PI / 2, 0, 0])
1249
+ addBox(g, innerW * 0.58, 0.025, d * 0.3, 0, h * 0.28, d * 0.18, p.metalDark)
1250
+ return g
1251
+ },
1252
+
1253
+ 'fireplace-movn1fnn': (w, h, d, p) => {
1254
+ const g = new THREE.Group()
1255
+ // Architectural fireplace hearth + mantel surround + firebox + glowing logs
1256
+ const hearthH = h * 0.09
1257
+ const mantelH = h * 0.11
1258
+ const pierW = w * 0.2
1259
+ const fireW = w - pierW * 2
1260
+ const fireH = h - hearthH - mantelH
1261
+
1262
+ // Raised stone hearth slab & top mantel shelf
1263
+ addBox(g, w, hearthH, d, 0, hearthH / 2, 0, p.stoneDark)
1264
+ addBox(g, w, mantelH, d, 0, h - mantelH / 2, 0, p.stoneLight)
1265
+ // Left & right surround piers + upper lintel
1266
+ addBox(g, pierW, fireH, d * 0.88, -w / 2 + pierW / 2, hearthH + fireH / 2, -d * 0.04, p.stoneLight)
1267
+ addBox(g, pierW, fireH, d * 0.88, w / 2 - pierW / 2, hearthH + fireH / 2, -d * 0.04, p.stoneLight)
1268
+ addBox(g, fireW, fireH * 0.2, d * 0.88, 0, hearthH + fireH * 0.9, -d * 0.04, p.stoneLight)
1269
+ // Dark steel recessed firebox back & inner walls
1270
+ addBox(g, fireW, fireH * 0.82, 0.024, 0, hearthH + fireH * 0.41, -d * 0.44, p.metalDark)
1271
+ // Iron grate + glowing ember bed + horizontal charred firewood logs + vibrant tapered flames
1272
+ const flameOrange = p.custom(0xff7a1a, 0.3, 0.0)
1273
+ flameOrange.emissive.setHex(0xff6b1a)
1274
+ flameOrange.emissiveIntensity = 0.95
1275
+ const flameAmber = p.custom(0xffb830, 0.25, 0.0)
1276
+ flameAmber.emissive.setHex(0xffaa22)
1277
+ flameAmber.emissiveIntensity = 1.0
1278
+ addBox(g, fireW * 0.72, 0.025, d * 0.48, 0, hearthH + 0.03, 0, p.metalDark)
1279
+ addRoundedRectExtrude(g, fireW * 0.64, d * 0.4, 0.036, 0.02, 0, hearthH + 0.055, 0, flameOrange)
1280
+ addCyl(g, 0.036, 0.038, fireW * 0.58, 0, hearthH + 0.095, -0.02, p.woodDark, 10, [0, 0.12, Math.PI / 2])
1281
+ addCyl(g, 0.032, 0.034, fireW * 0.5, 0.03, hearthH + 0.13, 0.03, p.barkBrown, 10, [0, -0.22, Math.PI / 2 - 0.14])
1282
+ // Tapered fiery orange/amber conical flame tongues
1283
+ addCyl(g, 0.005, 0.048, 0.18, -0.06, hearthH + 0.21, 0, flameOrange, 8, [0, 0, 0.08])
1284
+ addCyl(g, 0.004, 0.042, 0.22, 0.01, hearthH + 0.23, 0.01, flameAmber, 8, [0, 0, -0.05])
1285
+ addCyl(g, 0.004, 0.038, 0.16, 0.08, hearthH + 0.2, -0.01, flameOrange, 8, [0, 0, -0.1])
1286
+ // Front tempered glass spark screen
1287
+ addBox(g, fireW * 0.92, fireH * 0.76, 0.01, 0, hearthH + fireH * 0.39, d * 0.36, p.glass)
1288
+ return g
1289
+ },
1290
+
1291
+ 'suspended-fireplace': (w, h, d, p) => {
1292
+ const g = new THREE.Group()
1293
+ // Iconic wide flattened oblate Gyrofocus ceiling-suspended hearth with open glowing front mouth
1294
+ const r = Math.min(w, d) * 0.495
1295
+ const bowlY = h * 0.16
1296
+ const flueR = r * 0.16
1297
+ const flameOrange = p.custom(0xff7a1a, 0.3, 0.0)
1298
+ flameOrange.emissive.setHex(0xff6b1a)
1299
+ flameOrange.emissiveIntensity = 0.95
1300
+ const flameAmber = p.custom(0xffb830, 0.25, 0.0)
1301
+ flameAmber.emissive.setHex(0xffaa22)
1302
+ flameAmber.emissiveIntensity = 1.0
1303
+
1304
+ // Ceiling mounting flange plate at y = h + sleek slender vertical matte-black flue pipe
1305
+ addCyl(g, flueR * 2.1, flueR * 2.1, 0.04, 0, h - 0.02, 0, p.metalDark, 22)
1306
+ const flueBottom = bowlY + r * 0.62
1307
+ const flueH = Math.max(0.2, h - 0.04 - flueBottom)
1308
+ addCyl(g, flueR, flueR, flueH, 0, flueBottom + flueH / 2, 0, p.metalDark, 20)
1309
+
1310
+ // Wide sculpted Gyrofocus oblate disc hood + smooth shallow curved fire bowl
1311
+ addCyl(g, flueR * 1.15, r * 0.99, r * 0.5, 0, bowlY + r * 0.42, 0, p.metalDark, 30)
1312
+ addSphere(g, 1, 0, bowlY + r * 0.1, 0, p.metalDark, [r, r * 0.32, r], 26)
1313
+ addTorus(g, r * 0.96, 0.02, 0, bowlY + r * 0.18, 0, p.metalDark, [Math.PI / 2, 0, 0])
1314
+
1315
+ // Wide open front firebox hearth mouth facing +Z (strictly within bowl radius r, clearly visible from 3/4 view!)
1316
+ addBox(g, r * 1.1, r * 0.34, r * 0.24, 0, bowlY + r * 0.28, r * 0.64, p.plasticDark)
1317
+ addRoundedRectExtrude(g, r * 0.94, r * 0.28, 0.032, 0.03, 0, bowlY + r * 0.16, r * 0.62, flameOrange)
1318
+ addCyl(g, 0.024, 0.028, r * 0.72, 0, bowlY + r * 0.21, r * 0.64, p.barkBrown, 8, [0, 0.15, Math.PI / 2])
1319
+ addCyl(g, 0.004, 0.042, r * 0.28, -r * 0.14, bowlY + r * 0.32, r * 0.66, flameOrange, 8)
1320
+ addCyl(g, 0.004, 0.048, r * 0.32, 0.02, bowlY + r * 0.34, r * 0.68, flameAmber, 8)
1321
+ addCyl(g, 0.004, 0.036, r * 0.24, r * 0.18, bowlY + r * 0.31, r * 0.65, flameOrange, 8)
1322
+ return g
1323
+ },
1324
+
1325
+ // ========================= INTERIOR LIGHTING (7) =========================
1326
+ 'floor-lamp': (w, h, d, p) => {
1327
+ const g = new THREE.Group()
1328
+ const baseR = Math.min(w, d) * 0.34
1329
+ const shadeR = Math.min(w, d) * 0.36
1330
+ const shadeH = h * 0.17
1331
+
1332
+ // Weighted circular marble base + brass collar
1333
+ addCyl(g, baseR * 0.92, baseR, 0.045, 0, 0.0225, 0, p.stoneDark, 22)
1334
+ addCyl(g, 0.032, 0.042, 0.06, 0, 0.07, -d * 0.18, p.metalCopper, 14)
1335
+
1336
+ // Tall slender angled/arched stem rising from rear of base
1337
+ addCyl(g, 0.015, 0.018, h * 0.74, 0, h * 0.42, -d * 0.18, p.metalDark, 12)
1338
+ // Cantilevered arch arm curving forward to shade center
1339
+ const armLen = d * 0.38
1340
+ addCyl(g, 0.013, 0.015, armLen, 0, h * 0.86, 0, p.metalCopper, 10, [Math.PI / 2 - 0.42, 0, 0])
1341
+ addSphere(g, 0.024, 0, h * 0.79, -d * 0.18, p.metalCopper, undefined, 10)
1342
+ // Vertical drop socket rod
1343
+ addCyl(g, 0.012, 0.012, 0.1, 0, h - shadeH * 0.4, d * 0.16, p.metalCopper, 10)
1344
+
1345
+ // Fabric drum shade + glowing warm inner bulb/diffuser
1346
+ addCyl(g, shadeR * 0.76, shadeR, shadeH, 0, h - shadeH * 0.65, d * 0.16, p.fabricNeutral, 22)
1347
+ addCyl(g, shadeR * 0.68, shadeR * 0.88, shadeH * 0.85, 0, h - shadeH * 0.68, d * 0.16, p.emissiveWarm, 18)
1348
+ addSphere(g, 0.048, 0, h - shadeH * 0.65, d * 0.16, p.emissiveWarm, undefined, 12)
1349
+ return g
1350
+ },
1351
+
1352
+ 'table-lamp': (w, h, d, p) => {
1353
+ const g = new THREE.Group()
1354
+ // Articulated architect desk/table lamp with exact kinematic joint connections (0.29 x 0.74 x 0.67)
1355
+ const baseR = Math.min(w * 0.48, 0.14)
1356
+ const baseZ = -d * 0.26
1357
+ const pivotY = 0.065
1358
+
1359
+ // Heavy circular base + brass pivot collar + toggle switch
1360
+ addCyl(g, baseR * 0.9, baseR, 0.036, 0, 0.018, baseZ, p.metalDark, 20)
1361
+ addCyl(g, 0.024, 0.03, 0.05, 0, 0.055, baseZ, p.metalCopper, 12)
1362
+ addCyl(g, 0.012, 0.012, 0.016, 0, 0.04, baseZ + baseR * 0.55, p.metalChrome, 8)
1363
+
1364
+ // Exact elbow joint & shade knuckle coordinates so arms connect with zero floating gap
1365
+ const elbowY = h * 0.56
1366
+ const elbowZ = baseZ - d * 0.14
1367
+ const lowerDy = elbowY - pivotY
1368
+ const lowerDz = elbowZ - baseZ
1369
+ const lowerLen = Math.hypot(lowerDy, lowerDz)
1370
+ const lowerTilt = Math.atan2(lowerDz, lowerDy)
1371
+
1372
+ for (const side of [-1, 1]) {
1373
+ addCyl(
1374
+ g,
1375
+ 0.008,
1376
+ 0.008,
1377
+ lowerLen,
1378
+ side * 0.022,
1379
+ (pivotY + elbowY) * 0.5,
1380
+ (baseZ + elbowZ) * 0.5,
1381
+ p.metalDark,
1382
+ 8,
1383
+ [lowerTilt, 0, 0],
1384
+ )
1385
+ }
1386
+ // Elbow hinge drum at exact (elbowY, elbowZ)
1387
+ addCyl(g, 0.024, 0.024, 0.064, 0, elbowY, elbowZ, p.metalCopper, 12, [0, 0, Math.PI / 2])
1388
+
1389
+ // Shade knuckle pivot at top of conical lamp head
1390
+ const headZ = d * 0.3
1391
+ const headY = h * 0.78
1392
+ const knuckleY = headY + 0.09
1393
+ const knuckleZ = headZ - 0.02
1394
+
1395
+ // Upper cantilevered boom arm spanning directly from elbow joint to shade knuckle
1396
+ const upperDy = knuckleY - elbowY
1397
+ const upperDz = knuckleZ - elbowZ
1398
+ const upperLen = Math.hypot(upperDy, upperDz)
1399
+ const upperTilt = Math.atan2(upperDz, upperDy)
1400
+ addCyl(
1401
+ g,
1402
+ 0.011,
1403
+ 0.011,
1404
+ upperLen,
1405
+ 0,
1406
+ (elbowY + knuckleY) * 0.5,
1407
+ (elbowZ + knuckleZ) * 0.5,
1408
+ p.metalDark,
1409
+ 10,
1410
+ [upperTilt, 0, 0],
1411
+ )
1412
+ // Brass ball knuckle joint + socket cap directly attaching arm to conical shade
1413
+ addSphere(g, 0.022, 0, knuckleY, knuckleZ, p.metalCopper, undefined, 12)
1414
+ addCyl(g, 0.028, 0.036, 0.05, 0, headY + 0.075, headZ - 0.01, p.metalCopper, 14, [0.2, 0, 0])
1415
+
1416
+ // Conical metal shade head + glowing warm diffuser bulb at +Z
1417
+ addCyl(g, 0.038, baseR * 0.9, 0.16, 0, headY, headZ, p.metalDark, 20, [0.2, 0, 0])
1418
+ addSphere(g, baseR * 0.46, 0, headY - 0.05, headZ + 0.01, p.emissiveWarm, undefined, 12)
1419
+ return g
1420
+ },
1421
+
1422
+ 'ceiling-lamp': (w, h, d, p) => {
1423
+ const g = new THREE.Group()
1424
+ // Sculptural hanging pendant fixture (0.55 x 0.86 x 0.55, ceiling at y = h)
1425
+ const r = Math.min(w, d) / 2
1426
+ const canopyH = 0.045
1427
+ const shadeH = h * 0.32
1428
+
1429
+ // Ceiling canopy disc & suspension stem
1430
+ addCyl(g, r * 0.32, r * 0.28, canopyH, 0, h - canopyH / 2, 0, p.metalDark, 18)
1431
+ const rodH = h - canopyH - shadeH
1432
+ addCyl(g, 0.01, 0.01, rodH, 0, shadeH + rodH / 2, 0, p.metalCopper, 10)
1433
+ // Brass socket collar above shade
1434
+ addCyl(g, 0.036, 0.048, 0.075, 0, shadeH + 0.03, 0, p.metalCopper, 14)
1435
+
1436
+ // Flared dome/conical pendant shade
1437
+ addCyl(g, r * 0.22, r, shadeH * 0.78, 0, shadeH * 0.6, 0, p.metalDark, 24)
1438
+ addTorus(g, r * 0.98, 0.012, 0, shadeH * 0.22, 0, p.metalCopper, [Math.PI / 2, 0, 0])
1439
+ // Glowing frosted globe diffuser suspended inside/below shade
1440
+ addSphere(g, r * 0.36, 0, shadeH * 0.24, 0, p.emissiveWarm, [1, 0.85, 1], 16)
1441
+ return g
1442
+ },
1443
+
1444
+ 'ceiling-light': (w, h, d, p) => {
1445
+ const g = new THREE.Group()
1446
+ // Square flush-mount architectural ceiling luminaire (0.42 x 0.14 x 0.42)
1447
+ addBox(g, w * 0.92, h * 0.28, d * 0.92, 0, h - h * 0.14, 0, p.metalBrushed)
1448
+ addRoundedRectExtrude(g, w, d, h * 0.36, 0.04, 0, h * 0.54, 0, p.metalDark)
1449
+ addRoundedRectExtrude(g, w * 0.88, d * 0.88, h * 0.44, 0.035, 0, h * 0.24, 0, p.emissiveWarm)
1450
+ // Corner accent clips
1451
+ for (const sx of [-1, 1]) {
1452
+ for (const sz of [-1, 1]) {
1453
+ addBox(g, 0.032, h * 0.42, 0.032, sx * (w * 0.46), h * 0.28, sz * (d * 0.46), p.metalChrome)
1454
+ }
1455
+ }
1456
+ return g
1457
+ },
1458
+
1459
+ 'circular-ceiling-light': (w, h, d, p) => {
1460
+ const g = new THREE.Group()
1461
+ const r = Math.min(w, d) / 2
1462
+ addCyl(g, r * 0.92, r * 0.92, h * 0.28, 0, h - h * 0.14, 0, p.metalBrushed, 24)
1463
+ addCyl(g, r, r * 0.98, h * 0.46, 0, h * 0.52, 0, p.paintWhite, 28)
1464
+ addCyl(g, r * 0.9, r * 0.86, h * 0.36, 0, h * 0.22, 0, p.emissiveWarm, 28)
1465
+ addTorus(g, r * 0.94, Math.max(0.008, h * 0.1), 0, h * 0.32, 0, p.metalCopper, [Math.PI / 2, 0, 0])
1466
+ return g
1467
+ },
1468
+
1469
+ 'rectangular-ceiling-light': (w, h, d, p) => {
1470
+ const g = new THREE.Group()
1471
+ // Linear LED architectural troffer / ceiling bar (1.2 x 0.09 x 0.32)
1472
+ addBox(g, w * 0.92, h * 0.26, d * 0.78, 0, h - h * 0.13, 0, p.metalBrushed)
1473
+ addRoundedRectExtrude(g, w, d, h * 0.52, 0.025, 0, h * 0.48, 0, p.metalDark)
1474
+ addRoundedRectExtrude(g, w * 0.94, d * 0.82, h * 0.34, 0.018, 0, h * 0.18, 0, p.emissiveWarm)
1475
+ // Subtle architectural cross-louvers
1476
+ for (let i = -2; i <= 2; i++) {
1477
+ addBox(g, 0.012, h * 0.18, d * 0.84, i * (w * 0.18), h * 0.09, 0, p.metalBrushed)
1478
+ }
1479
+ return g
1480
+ },
1481
+
1482
+ 'recessed-light': (w, h, d, p) => {
1483
+ const g = new THREE.Group()
1484
+ const r = Math.min(w, d) / 2
1485
+ // Recessed ceiling housing can + white trim flange + dark inner baffle + glowing LED lens
1486
+ addCyl(g, r * 0.72, r * 0.72, h * 0.65, 0, h * 0.66, 0, p.metalBrushed, 20)
1487
+ addCyl(g, r, r, h * 0.24, 0, h * 0.22, 0, p.paintWhite, 24)
1488
+ addTorus(g, r * 0.84, Math.max(0.006, h * 0.12), 0, h * 0.14, 0, p.metalDark, [Math.PI / 2, 0, 0])
1489
+ addCyl(g, r * 0.64, r * 0.64, h * 0.18, 0, h * 0.1, 0, p.emissiveWarm, 20)
1490
+ return g
1491
+ },
1492
+
1493
+ // ========================= HOME & LAUNDRY FURNITURE (4) =========================
1494
+ 'ironing-board': (w, h, d, p) => {
1495
+ const g = new THREE.Group()
1496
+ const boardH = 0.04
1497
+ const boardY = h - boardH / 2
1498
+ const mainLen = w * 0.68
1499
+
1500
+ // Main padded board body + tapered pointed ironing nose at +X
1501
+ addRoundedRectExtrude(g, mainLen, d, boardH, 0.06, -w * 0.08, boardY, 0, p.fabricNeutral)
1502
+ const nose = addCyl(g, d * 0.18, d * 0.48, w * 0.24, w * 0.36, boardY, 0, p.fabricNeutral, 12, [0, 0, -Math.PI / 2])
1503
+ nose.scale.set(boardH / (d * 0.96), 1, 1)
1504
+
1505
+ // Rear metal iron rest wire/tray at -X
1506
+ addRoundedRectExtrude(g, w * 0.18, d * 0.72, 0.02, 0.03, -w * 0.42, boardY - 0.01, 0, p.metalBrushed)
1507
+ addBox(g, 0.016, 0.045, d * 0.68, -w * 0.5, boardY + 0.015, 0, p.metalDark)
1508
+
1509
+ // Collapsible X-frame tubular legs
1510
+ const legLen = Math.hypot(w * 0.55, h * 0.92)
1511
+ const angle = Math.atan2(w * 0.55, h * 0.92)
1512
+ for (const side of [-1, 1]) {
1513
+ const lz = side * (d * 0.28)
1514
+ addCyl(g, 0.013, 0.013, legLen, -w * 0.04, h * 0.46, lz, p.metalDark, 10, [0, 0, angle])
1515
+ addCyl(g, 0.013, 0.013, legLen, -w * 0.04, h * 0.46, lz, p.metalDark, 10, [0, 0, -angle])
1516
+ }
1517
+ // Cross floor foot bars with rubber end caps
1518
+ for (const fx of [-w * 0.32, w * 0.24]) {
1519
+ addCyl(g, 0.015, 0.015, d * 0.88, fx, 0.016, 0, p.metalDark, 10, [Math.PI / 2, 0, 0])
1520
+ for (const sz of [-1, 1]) {
1521
+ addCyl(g, 0.019, 0.019, 0.04, fx, 0.016, sz * (d * 0.44), p.rubberBlack, 8, [Math.PI / 2, 0, 0])
1522
+ }
1523
+ }
1524
+ return g
1525
+ },
1526
+
1527
+ 'drying-rack': (w, h, d, p) => {
1528
+ const g = new THREE.Group()
1529
+ // Gullwing folding clothes drying rack (1.79 x 1.05 x 0.58)
1530
+ const deckY = h * 0.78
1531
+ const centerW = w * 0.52
1532
+ const wingLen = w * 0.26
1533
+
1534
+ // Central horizontal perimeter frame
1535
+ for (const sz of [-1, 1]) {
1536
+ addCyl(g, 0.011, 0.011, centerW, 0, deckY, sz * (d * 0.46), p.metalChrome, 8, [0, 0, Math.PI / 2])
1537
+ }
1538
+ for (const sx of [-1, 1]) {
1539
+ addCyl(g, 0.011, 0.011, d * 0.92, sx * (centerW / 2), deckY, 0, p.metalChrome, 8, [Math.PI / 2, 0, 0])
1540
+ }
1541
+ // 6 inner center drying wires
1542
+ for (let i = 0; i < 6; i++) {
1543
+ const rz = -d * 0.36 + (d * 0.72 * i) / 5
1544
+ addCyl(g, 0.004, 0.004, centerW, 0, deckY, rz, p.metalBrushed, 6, [0, 0, Math.PI / 2])
1545
+ }
1546
+
1547
+ // Left & right angled gullwings with parallel drying rods + diagonal support struts
1548
+ for (const side of [-1, 1]) {
1549
+ const pivotX = side * (centerW / 2)
1550
+ const wingTilt = 0.46
1551
+ const wx = pivotX + side * (Math.cos(wingTilt) * wingLen * 0.5)
1552
+ const wy = deckY + Math.sin(wingTilt) * wingLen * 0.5
1553
+ for (const sz of [-1, 1]) {
1554
+ addCyl(g, 0.01, 0.01, wingLen, wx, wy, sz * (d * 0.46), p.metalChrome, 8, [0, 0, Math.PI / 2 - side * wingTilt])
1555
+ }
1556
+ for (let i = 1; i <= 4; i++) {
1557
+ const frac = i / 4
1558
+ const rx = pivotX + side * Math.cos(wingTilt) * wingLen * frac
1559
+ const ry = deckY + Math.sin(wingTilt) * wingLen * frac
1560
+ addCyl(g, 0.004, 0.004, d * 0.92, rx, ry, 0, p.metalBrushed, 6, [Math.PI / 2, 0, 0])
1561
+ }
1562
+ // X-frame folding legs beneath center deck
1563
+ const legLen = Math.hypot(centerW * 0.42, deckY)
1564
+ const legAng = Math.atan2(centerW * 0.42, deckY)
1565
+ for (const sz of [-1, 1]) {
1566
+ addCyl(g, 0.011, 0.011, legLen, 0, deckY / 2, sz * (d * 0.44), p.paintWhite, 8, [0, 0, side * legAng])
1567
+ }
1568
+ // Floor cross-bar with plastic caps
1569
+ addCyl(g, 0.012, 0.012, d * 0.94, side * (centerW * 0.42), 0.014, 0, p.paintWhite, 8, [Math.PI / 2, 0, 0])
1570
+ for (const sz of [-1, 1]) {
1571
+ addBox(g, 0.036, 0.028, 0.036, side * (centerW * 0.42), 0.014, sz * (d * 0.47), p.plasticDark)
1572
+ }
1573
+ }
1574
+ return g
1575
+ },
1576
+
1577
+ 'laundry-bag': (w, h, d, p) => {
1578
+ const g = new THREE.Group()
1579
+ const r = Math.min(w, d) * 0.46
1580
+ // Bamboo/wood 4-post collapsible hamper frame + canvas laundry bag
1581
+ addTorus(g, r * 0.95, 0.014, 0, h * 0.94, 0, p.woodLight, [Math.PI / 2, 0, 0])
1582
+ addTorus(g, r * 0.88, 0.014, 0, 0.02, 0, p.woodLight, [Math.PI / 2, 0, 0])
1583
+ for (let i = 0; i < 4; i++) {
1584
+ const a = (i * Math.PI) / 2 + Math.PI / 4
1585
+ addCyl(g, 0.012, 0.012, h * 0.94, Math.sin(a) * r * 0.92, h * 0.47, Math.cos(a) * r * 0.92, p.woodLight, 8)
1586
+ }
1587
+ // Tapered woven canvas bag body + folded top cuff
1588
+ addCyl(g, r * 0.92, r * 0.8, h * 0.88, 0, h * 0.47, 0, p.fabricNeutral, 20)
1589
+ addCyl(g, r * 0.95, r * 0.92, h * 0.14, 0, h * 0.86, 0, p.fabricAccent, 20)
1590
+ // Stitched side carry handle loops
1591
+ for (const side of [-1, 1]) {
1592
+ addTorus(g, 0.06, 0.011, side * (r * 0.96), h * 0.84, 0, p.leatherDark, [0, Math.PI / 2, 0])
1593
+ }
1594
+ return g
1595
+ },
1596
+
1597
+ easel: (w, h, d, p) => {
1598
+ const g = new THREE.Group()
1599
+ // Studio A-frame wooden easel with canvas resting on adjustable ledge (0.99 x 2.32 x 0.55)
1600
+ const legH = h * 0.96
1601
+ // Twin angled front legs converging near top
1602
+ for (const side of [-1, 1]) {
1603
+ addBox(g, 0.044, legH, 0.036, side * (w * 0.24), legH / 2, d * 0.24, p.woodWarm, [-0.08, 0, side * 0.18])
1604
+ }
1605
+ // Central vertical slotted mast + top hinge block
1606
+ addBox(g, 0.055, h * 0.98, 0.038, 0, h * 0.49, d * 0.16, p.woodWarm, [-0.08, 0, 0])
1607
+ addBox(g, 0.14, 0.08, 0.07, 0, h * 0.92, d * 0.08, p.woodDark)
1608
+ // Rear hinged tripod support leg extending to -Z + horizontal brace
1609
+ addBox(g, 0.044, h * 0.95, 0.036, 0, h * 0.46, -d * 0.18, p.woodWarm, [0.24, 0, 0])
1610
+ addBox(g, 0.03, 0.03, d * 0.56, 0, h * 0.34, 0, p.metalDark)
1611
+ // Lower horizontal stretcher & paint-brush ledge tray
1612
+ addBox(g, w * 0.78, 0.045, 0.035, 0, h * 0.38, d * 0.26, p.woodWarm)
1613
+ addBox(g, w * 0.86, 0.032, 0.095, 0, h * 0.41, d * 0.32, p.woodDark)
1614
+ addBox(g, w * 0.86, 0.04, 0.018, 0, h * 0.43, d * 0.36, p.woodWarm)
1615
+ // Upper adjustable canvas clamp
1616
+ addBox(g, 0.14, 0.05, 0.075, 0, h * 0.81, d * 0.18, p.woodDark)
1617
+ // Stretched white artist canvas resting on the ledge
1618
+ const canvas = addBox(g, w * 0.72, h * 0.38, 0.028, 0, h * 0.61, d * 0.25, p.ceramicWhite)
1619
+ canvas.rotation.x = -0.08
1620
+ return g
1621
+ },
1622
+ }