-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path4704-Cavan.html
More file actions
602 lines (564 loc) · 37 KB
/
Copy path4704-Cavan.html
File metadata and controls
602 lines (564 loc) · 37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<title>🏠 4704 CAVAN ROAD — Named-Object Model (feet)</title>
<link href="https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;600;700&family=JetBrains+Mono:wght@400;700&display=swap" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
<style>
:root{--void:#0a0e0b;--panel:rgba(13,19,14,.92);--line:#1e2b21;--phos:#39ff6a;--phos-dim:#1d7a3a;--amber:#ffb347;--ink:#cfe6d4;--ink-dim:#7fa389}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;overflow:hidden;background:var(--void);color:var(--ink);font-family:'JetBrains Mono',monospace}
canvas{display:block;touch-action:none}
#hud{position:fixed;top:0;left:0;right:0;padding:.6rem .8rem;pointer-events:none;z-index:5;
display:flex;justify-content:space-between;align-items:flex-start;gap:.6rem;flex-wrap:wrap}
#hud h1{font-family:'Chakra Petch';font-size:clamp(.85rem,2.8vw,1.15rem);margin:0;color:var(--phos);
letter-spacing:.08em;text-shadow:0 0 12px rgba(57,255,106,.4)}
#hud h1 small{display:block;font-size:.6em;color:var(--ink-dim);font-weight:400;letter-spacing:.14em}
#bar{display:flex;gap:.4rem;pointer-events:auto;flex-wrap:wrap}
button{font-family:'Chakra Petch';font-weight:600;font-size:.72rem;letter-spacing:.06em;min-height:40px;
background:var(--panel);color:var(--phos);border:1px solid var(--phos-dim);border-radius:6px;
padding:.4rem .7rem;cursor:pointer}
button:hover{box-shadow:0 0 12px rgba(57,255,106,.3)}
button:focus-visible{outline:2px solid var(--amber);outline-offset:2px}
button.off{color:var(--ink-dim);border-color:var(--line)}
#tip{position:fixed;pointer-events:none;z-index:9;background:var(--panel);border:1px solid var(--phos);
border-radius:6px;padding:.35rem .6rem;font-size:.72rem;color:var(--phos);display:none;max-width:230px;
box-shadow:0 0 16px rgba(57,255,106,.25)}
#tip b{color:#eafff0;display:block;font-family:'Chakra Petch'}
#tip span{color:var(--amber)}
#index{position:fixed;top:0;right:0;bottom:0;width:min(300px,82vw);background:var(--panel);
border-left:1px solid var(--line);z-index:8;transform:translateX(100%);transition:transform .25s;
display:flex;flex-direction:column;backdrop-filter:blur(6px)}
#index.open{transform:none}
#index header{padding:.7rem .8rem;border-bottom:1px solid var(--line)}
#index header h2{font-family:'Chakra Petch';font-size:.9rem;margin:0;color:var(--phos);letter-spacing:.1em}
#index header p{margin:.2rem 0 0;font-size:.65rem;color:var(--ink-dim)}
#tree{flex:1;overflow-y:auto;padding:.4rem .5rem 2rem;font-size:.72rem}
#tree details{margin:.25rem 0;border-left:2px solid var(--phos-dim);padding-left:.5rem}
#tree summary{cursor:pointer;color:var(--amber);font-family:'Chakra Petch';letter-spacing:.05em;padding:.2rem 0}
#tree .obj{display:block;width:100%;text-align:left;background:none;border:none;color:var(--ink);
padding:.22rem .3rem;min-height:32px;font-size:.7rem;border-radius:4px;font-family:'JetBrains Mono'}
#tree .obj:hover{background:#152018;color:var(--phos)}
#tree .obj i{color:var(--ink-dim);font-style:normal;font-size:.62rem}
#foot{position:fixed;bottom:0;left:0;right:0;padding:.4rem .8rem;font-size:.62rem;color:var(--ink-dim);
z-index:5;pointer-events:none;letter-spacing:.05em;text-shadow:0 1px 3px #000}
</style>
</head>
<body>
<div id="hud">
<h1>🏠 4704 CAVAN ROAD · MOUND MN<small>PHELPS ISLAND · BLACK LAKE / LAKE MINNETONKA · 1988 LEGENDARY DESIGN · ALL UNITS IN FEET 🖐️</small></h1>
<div id="bar">
<button id="bRoof">🏠 ROOF</button>
<button id="bL2">2️⃣ UPPER</button>
<button id="bUnder">⛏️ CELLAR</button>
<button id="bIndex">📇 INDEX</button>
<button id="bLedger">💾 LEDGER.md</button>
<button id="bSnap">📸 SNAP</button>
</div>
</div>
<aside id="index" aria-label="Object index">
<header><h2>📇 OBJECT INDEX</h2><p id="count"></p></header>
<nav id="tree"></nav>
</aside>
<div id="tip" role="status"></div>
<div id="foot">🖱️ drag orbit · 🖐️ pinch zoom · tap object = name & feet · 🛗 tap the glass cab to ride · R roof · U upper · I index</div>
<script>
"use strict";
/* ═══ 4704 CAVAN RD — every object named, every dimension in feet ═══ */
const registry = []; // {mesh, name, zone, w,h,d, emoji}
const scene = new THREE.Scene();
scene.background = new THREE.Color(0x0a0e0b);
scene.fog = new THREE.Fog(0x0a0e0b, 160, 420);
const camera = new THREE.PerspectiveCamera(50, innerWidth/innerHeight, .1, 1000);
const renderer = new THREE.WebGLRenderer({antialias:true, preserveDrawingBuffer:true});
renderer.setSize(innerWidth, innerHeight);
renderer.setPixelRatio(Math.min(devicePixelRatio,2));
document.body.appendChild(renderer.domElement);
/* lights — Minnesota summer evening */
scene.add(new THREE.HemisphereLight(0xbfd8c2, 0x0e1a10, .85));
const sun = new THREE.DirectionalLight(0xffe9c4, .9);
sun.position.set(80,120,60); scene.add(sun);
const glow = new THREE.PointLight(0x39ff6a,.25,120); glow.position.set(0,14,0); scene.add(glow);
/* ── builder: 1 unit = 1 foot ── */
const groups = {};
function zone(name){ if(!groups[name]){ groups[name]=new THREE.Group(); groups[name].name=name; scene.add(groups[name]); } return groups[name]; }
function box(zoneName, emoji, name, w,h,d, x,y,z, color, opt={}){
const m = new THREE.Mesh(new THREE.BoxGeometry(w,h,d),
new THREE.MeshLambertMaterial({color, transparent:!!opt.op, opacity:opt.op||1}));
m.position.set(x, y + h/2, z);
if(opt.ry) m.rotation.y = opt.ry;
if(opt.rz) m.rotation.z = opt.rz;
if(opt.rx) m.rotation.x = opt.rx;
m.userData = {name, zone:zoneName, w,h,d, emoji};
zone(zoneName).add(m); registry.push(m.userData); m.userData.mesh = m;
return m;
}
function cyl(zoneName, emoji, name, r,h, x,y,z, color, seg=10){
const m = new THREE.Mesh(new THREE.CylinderGeometry(r,r,h,seg), new THREE.MeshLambertMaterial({color}));
m.position.set(x,y+h/2,z);
m.userData = {name, zone:zoneName, w:r*2,h, d:r*2, emoji, mesh:m};
zone(zoneName).add(m); registry.push(m.userData); return m;
}
/* palette */
const C={grass:0x1e4225,drive:0x2a2f2c,road:0x1b1e1c,siding:0x8a9a8f,trim:0xdde8dd,roof:0x3a3f3a,
floor:0x6b5236,wall:0xb8c4b6,carpet:0x4a5a50,tile:0x9aa8a2,wood:0x7a5a38,darkwood:0x4a3826,
sofa:0x35524a,bed:0x51607a,appl:0xc9d2cc,steel:0x8f9a96,counter:0x3c4a44,green:0x39ff6a,amber:0xffb347};
/* ════════ SITE ════════ */
box("🌲 Site & Yard","🌱","Front Lawn (Kentucky bluegrass)",120,.3,45, 0,0,42, C.grass);
box("🌲 Site & Yard","🌱","Back Yard Lawn",120,.3,45, 0,0,-42, C.grass);
box("🌲 Site & Yard","🌱","Side Yard East",30,.3,40, 60,.01,0, C.grass);
box("🌲 Site & Yard","🌱","Side Yard West",30,.3,40, -60,.01,0, C.grass);
box("🌲 Site & Yard","🛣️","Cavan Road (asphalt)",180,.32,18, 0,0,72, C.road);
box("🌲 Site & Yard","🚗","Driveway (concrete, 2-car width)",20,.34,38, 30,0,44, C.drive);
box("🌲 Site & Yard","📬","Mailbox Post",0.4,3.5,0.4, 42,0,62, C.darkwood);
box("🌲 Site & Yard","📬","Mailbox (4704)",1.6,1,0.8, 42,3.5,62, 0x2f6b3a);
box("🌲 Site & Yard","🧱","Front Walk (paver path)",4,.34,18, 6,0,34, 0x50564f);
box("🌲 Site & Yard","🌼","Garden Bed (hosta & fern)",14,.8,4, -14,.1,26, 0x27331f);
[[-52,30,"Bur Oak #1"],[52,-38,"Bur Oak #2"],[-48,-40,"White Pine #1"],[58,44,"White Pine #2"]].forEach(([x,z,n],i)=>{
cyl("🌲 Site & Yard","🌳",n+" — Trunk",0.9,12, x,0,z, 0x4a3220,8);
const c=cyl("🌲 Site & Yard","🌳",n+" — Canopy",7,14, x,10,z, i<2?0x1f5c2a:0x14401e,8);
});
box("🌲 Site & Yard","🔥","Fire Pit Ring (backyard)",4,1,4, -20,0,-58, 0x3a3a3a);
box("🌲 Site & Yard","🪑","Adirondack Chair A",2,3,2, -25,0,-54, 0x5a3f28,{ry:.6});
box("🌲 Site & Yard","🪑","Adirondack Chair B",2,3,2, -14,0,-54, 0x5a3f28,{ry:-.6});
/* ════════ SHELL — footprint 36 W × 26 D, two 8-ft levels ════════ */
const shell = "🏠 House Shell";
box(shell,"🧱","Foundation Slab (poured)",38,1,28, 0,-.7,0, 0x555a55);
box(shell,"🧱","Main Floor Deck/Subfloor",36,.6,26, 0,.3,0, C.floor);
box(shell,"🧱","South Wall (front, siding)",36,8,.6, 0,1,13, C.siding,{op:.9});
box(shell,"🧱","North Wall (rear, siding)",36,8,.6, 0,1,-13, C.siding,{op:.9});
box(shell,"🧱","East Wall (siding)",.6,8,26, 18,1,0, C.siding,{op:.9});
box(shell,"🧱","West Wall (siding)",.6,8,26, -18,1,0, C.siding,{op:.9});
box(shell,"🚪","Front Entry Door (3.0 × 6.7)",3,6.7,.7, 6,1,13.1, 0x6b1f1f);
box(shell,"🪟","Living Room Picture Window (6 × 4)",6,4,.7, -8,3.5,13.1, 0x9fd4e8);
box(shell,"🪟","Kitchen Window (3 × 3)",3,3,.7, 12,4,-13.1, 0x9fd4e8);
box(shell,"🪟","Dining Window (4 × 4)",4,4,.7, -10,3.5,-13.1, 0x9fd4e8);
box(shell,"🚪","Rear Sliding Patio Door (6 × 6.7)",6,6.7,.7, 2,1,-13.1, 0x9fd4e8);
box(shell,"🧱","Chimney (brick)",3,26,3, 14,0,-11, 0x6e3b2c);
/* deck */
box(shell,"🛝","Back Deck (cedar, 14 × 10)",14,1.2,10, -4,.2,-19, 0x8a6a42);
box(shell,"♨️","Gas Grill",2.5,3.5,2, -9,1.4,-21, 0x2c2c2c);
box(shell,"🪑","Deck Table & Umbrella",4,2.8,4, -2,1.4,-19, 0x5a4630);
/* garage 22×22 attached east */
box("🚙 Garage","🧱","Garage Slab & Walls (22 × 22)",22,9,22, 30,0,2, 0x7d8c81,{op:.85});
box("🚙 Garage","🚪","Overhead Garage Door (16 × 7)",16,7,.7, 30,.5,13.1, 0xcfd8cf);
box("🚙 Garage","🛠️","Workbench (CNC heritage corner)",8,3,2.5, 34,0,-6, C.darkwood);
box("🚙 Garage","🧰","Rolling Tool Chest",2.5,4,1.8, 27,0,-7, 0x8a1f1f);
box("🚙 Garage","🚲","Bicycle Rack",6,3.5,1, 22,0,-7, C.steel);
box("🚙 Garage","🥶","Chest Freezer",4,3,2.5, 38,0,-2, C.appl);
/* ════════ MAIN FLOOR (y base .6) ════════ */
const Y1=.6;
/* Living Room 16×14 SW */
const LR="🛋️ Living Room";
box(LR,"🟫","LR Carpet (16 × 14)",16,.15,14, -9,Y1,5.5, C.carpet);
box(LR,"🛋️","Sofa (7 ft, three-seat)",7,2.6,3, -13,Y1+.1,9, C.sofa);
box(LR,"🛋️","Loveseat (5 ft)",5,2.6,3, -14,Y1+.1,1, C.sofa,{ry:Math.PI/2});
box(LR,"🪵","Coffee Table (oak, 4 × 2)",4,1.4,2, -9,Y1+.1,5, C.wood);
box(LR,"📺","TV Console (6 ft)",6,1.8,1.5, -3.5,Y1+.1,9.5, C.darkwood,{ry:Math.PI});
box(LR,"📺","Television (65-inch)",4.8,2.8,.3, -3.5,Y1+2,9.5, 0x101010,{ry:Math.PI});
box(LR,"💡","Floor Lamp",0.5,5.5,0.5, -16.5,Y1,11.5, C.steel);
box(LR,"📚","Bookshelf (Levin, folklore, saints)",3.5,6.5,1.2, -17,Y1+.1,-1.5, C.darkwood);
box(LR,"🐦","Jake's Perch Station 🖤",2,5.5,2, -5,Y1+.1,1.5, 0x2f6b3a);
box(LR,"🌀","Area Rug (Norse knotwork)",8,.06,6, -9,Y1+.16,5.5, 0x233a4a);
/* Kitchen 12×12 NE */
const K="🍳 Kitchen";
box(K,"⬜","Kitchen Tile Floor (12 × 12)",12,.15,12, 11,Y1,-6.5, C.tile);
box(K,"🧱","Counter Run North (L-shape)",10,3,2, 11,Y1+.1,-11.5, C.counter);
box(K,"🧱","Counter Run East",2,3,7, 16.5,Y1+.1,-6, C.counter);
box(K,"🏝️","Kitchen Island (5 × 3)",5,3,3, 10,Y1+.1,-5, C.counter);
box(K,"🚰","Sink (double basin, under window)",2.5,.4,1.6, 12,Y1+3.1,-11.5, C.steel);
box(K,"🔥","Range / Stove (30-inch)",2.5,3.1,2.2, 8,Y1+.1,-11.4, C.appl);
box(K,"🧊","Refrigerator (36-inch)",3,5.8,2.6, 16.4,Y1+.1,-10.5, C.appl);
box(K,"🍽️","Dishwasher",2,2.9,2, 14.3,Y1+.1,-11.4, C.steel);
box(K,"🗄️","Upper Cabinets (north wall)",9,2.5,1.2, 11,Y1+4.6,-12.2, C.darkwood);
box(K,"☕","Coffee Station (episodic anchor ☕)",2,1.2,1.4, 16.5,Y1+3.1,-3, 0x3b2a1c);
/* Dining 10×12 NW */
const D="🍽️ Dining Room";
box(D,"🟫","Dining Hardwood (10 × 12)",10,.15,12, -11,Y1,-6.5, C.floor);
box(D,"🪵","Dining Table (oak, 6 × 3.5)",6,2.5,3.5, -11,Y1+.1,-6.5, C.wood);
["A -14 -9","B -8 -9","C -14 -4","D -8 -4"].forEach(s=>{const[p,x,z]=s.split(" ");
box(D,"🪑","Dining Chair "+p,1.6,3.2,1.6, +x,Y1+.1,+z, C.darkwood);});
box(D,"💡","Pendant Light (over table)",1.5,1,1.5, -11,Y1+6.8,-6.5, C.amber);
/* Studio / Bedroom 5 12×10 SE */
const S="🖥️ PHOTOFORGE Studio (Bed 5)";
box(S,"🟫","Studio Floor (12 × 10)",12,.15,10, 11,Y1,7.5, C.carpet);
box(S,"🖥️","Standing Desk (5 × 2.5)",5,2.4,2.5, 13,Y1+.1,10.5, C.darkwood,{ry:Math.PI});
box(S,"🖥️","Monitor L (27-inch)",2,1.3,.2, 11.9,Y1+2.6,10.9, 0x0d0d0d,{ry:Math.PI});
box(S,"🖥️","Monitor R (27-inch)",2,1.3,.2, 14.1,Y1+2.6,10.9, 0x0d0d0d,{ry:Math.PI});
box(S,"⌨️","Keyboard (2-ft reach arc origin)",1.4,.15,.5, 13,Y1+2.5,9.8, 0x1a1a1a);
box(S,"🪑","Task Chair (swivel, 3-ft clearance)",1.8,3,1.8, 13,Y1+.1,7.5, 0x232f28);
box(S,"🎛️","Synth / Audio Rack (140 BPM lives here)",3,3.5,1.5, 17,Y1+.1,5, 0x1c2420);
box(S,"🎸","Guitar Stand (death metal refrains)",1.2,3.8,1.2, 8,Y1+.1,11, 0x30201a);
box(S,"🎤","Mic Boom (scream texture)",0.4,5,0.4, 16.8,Y1+.1,9, C.steel);
/* Bath 1 + hall + stairs */
const B1="🛁 Bathroom 1 (Main)";
box(B1,"⬜","Bath 1 Tile (8 × 6)",8,.15,6, 2,Y1,-9.5, C.tile);
box(B1,"🛁","Tub / Shower Combo (5 ft)",5,2,2.5, 1,Y1+.1,-11.2, 0xe8ecea);
box(B1,"🚽","Toilet",1.4,2.4,2.2, 5,Y1+.1,-11, 0xe8ecea);
box(B1,"🧼","Vanity & Sink (3 ft)",3,2.8,1.8, 5,Y1+.1,-7.5, C.darkwood);
box("🏠 House Shell","🪜","Staircase (13 risers, 3 ft wide)",3,8,10, 0,Y1,-1.5, 0x5c4632);
/* ════════ UPPER FLOOR (y base 9) — group L2 for toggle ════════ */
const L2 = zone("2️⃣ Upper Floor"); const Y2=9;
box("2️⃣ Upper Floor","🧱","Upper Subfloor (36 × 26)",36,.6,26, 0,Y2-.6,0, C.floor);
box("2️⃣ Upper Floor","🧱","Upper Walls (perimeter)",36,8,26, 0,Y2,0, C.wall,{op:.28});
/* Bedroom 1 (primary) 14×13 SW */
function bedroom(tag,emoji,cx,cz,bw,bd,rug){
const Z="🛏️ "+tag;
box(Z,"🟫",tag+" — Carpet",bw,.15,bd, cx,Y2,cz, rug);
box(Z,"🛏️",tag+" — Bed",6.5,2.2,5, cx-1,Y2+.1,cz+1, C.bed);
box(Z,"🛏️",tag+" — Headboard",6.5,3.4,.5, cx-1,Y2+.1,cz+3.6, C.darkwood);
box(Z,"🗄️",tag+" — Dresser (4 ft)",4,3,1.6, cx+bw/2-2.4,Y2+.1,cz-bd/2+1, C.darkwood);
box(Z,"🕯️",tag+" — Nightstand",1.6,2,1.6, cx+3,Y2+.1,cz+2.5, C.wood);
box(Z,"💡",tag+" — Lamp",0.5,1.4,0.5, cx+3,Y2+2.1,cz+2.5, C.amber);
}
bedroom("Bedroom 1 (Primary)","🛏️",-10,6, 14,12, 0x3d4f46);
bedroom("Bedroom 2","🛏️", 10,6, 12,12, 0x46503d);
bedroom("Bedroom 3","🛏️",-10,-6.5, 14,11, 0x3d4550);
bedroom("Bedroom 4","🛏️", 10,-6.5, 12,11, 0x503d46);
const B2="🚿 Bathroom 2 (Upper)";
box(B2,"⬜","Bath 2 Tile (7 × 5)",7,.15,5, 0,Y2,-10, C.tile);
box(B2,"🚿","Walk-in Shower",3,6.5,3, -1.5,Y2+.1,-10.8, 0xd8e4e0,{op:.6});
box(B2,"🧼","Vanity 2 & Sink",3,2.8,1.8, 2,Y2+.1,-10.8, C.darkwood);
box(B2,"🚽","Toilet 2",1.4,2.4,2.2, 2,Y2+.1,-8, 0xe8ecea);
/* hall */
box("2️⃣ Upper Floor","🟫","Upper Hallway Runner",3,.16,20, 0,Y2+.01,2, 0x233a4a);
/* move bedroom groups into L2 so toggle hides them */
["🛏️ Bedroom 1 (Primary)","🛏️ Bedroom 2","🛏️ Bedroom 3","🛏️ Bedroom 4","🚿 Bathroom 2 (Upper)"]
.forEach(n=>{ const g=groups[n]; scene.remove(g); L2.add(g); });
/* ════════ ROOF — its own toggle group ════════ */
const RF = zone("⛰️ Roof");
(function(){
const geo = new THREE.ConeGeometry(27,9,4);
const m = new THREE.Mesh(geo,new THREE.MeshLambertMaterial({color:C.roof}));
m.rotation.y = Math.PI/4; m.scale.set(1,.9,.72); m.position.set(0,21.5,0);
m.userData={name:"Main Gable Roof (asphalt shingle)",zone:"⛰️ Roof",w:38,h:8,d:28,emoji:"⛰️",mesh:m};
RF.add(m); registry.push(m.userData);
})();
/* Great Room vault roof planes (cedar T&G underside, toggle with ROOF) */
box("⛰️ Roof","⛰️","Vault Roof Plane East (cedar T&G)",13.5,.5,24, 35.5,17.15,2, 0x8a6a42,{rz:-0.617});
box("⛰️ Roof","⛰️","Vault Roof Plane West (cedar T&G)",13.5,.5,24, 24.5,17.15,2, 0x8a6a42,{rz:0.617});
box("⛰️ Roof","🪟","Vault Skylight Panel (east slope)",5,.7,6, 34,18.2,-3, 0x9fd4e8,{rz:-0.617,op:.55});
box("⛰️ Roof","📡","Rooftop Antenna / Weather Vane",0.3,4,0.3, -6,26,0, C.steel);
/* ════════ 🌟 GREAT ROOM — vaulted bonus room above garage ════════ */
const anims=[];
function reg(zoneName,emoji,name,mesh,w,h,d){
mesh.userData={name,zone:zoneName,w,h,d,emoji,mesh};
zone(zoneName).add(mesh); registry.push(mesh.userData); return mesh;
}
const GR="🌟 Great Room (Vault)"; const Y3=9.6;
box(GR,"🟫","Great Room Floor (cedar plank, 22 × 22)",22,.6,22, 30,9,2, 0x8a6a42);
box(GR,"🧱","Knee Wall North (4 ft)",22,4,.5, 30,Y3,-8.8, C.wall,{op:.55});
box(GR,"🧱","Knee Wall South (4 ft)",22,4,.5, 30,Y3,12.8, C.wall,{op:.55});
box(GR,"🧱","Knee Wall East (4 ft)",.5,4,22, 40.8,Y3,2, C.wall,{op:.55});
box(GR,"🧱","Knee Wall West (4 ft)",.5,4,22, 19.2,Y3,2, C.wall,{op:.55});
box(GR,"🪟","South Gable Glass Wall (lake light ☀️)",14,6.5,.5, 30,13.7,12.9, 0x9fd4e8,{op:.35});
box(GR,"🪟","North Gable Clerestory",10,4,.5, 30,14.5,-8.9, 0x9fd4e8,{op:.35});
/* cedar laminated arches — the works */
[-6,2,10].forEach((z,i)=>{
const arch=new THREE.Mesh(new THREE.TorusGeometry(10,.4,8,28,Math.PI),
new THREE.MeshLambertMaterial({color:0x9a6f3f}));
arch.position.set(30,13.6,z); arch.scale.y=.78;
reg(GR,"🌈","Cedar Glulam Arch #"+(i+1)+" (20-ft span)",arch,20,7.8,.8);
});
/* steel — ridge + ties */
box(GR,"🩶","Steel Ridge Beam (W8 I-beam, 22 ft)",1,1.2,22, 30,20.7,2, C.steel);
box(GR,"🩶","Steel Tie Beam A (20-ft span)",20,.8,.8, 30,14.6,-4, C.steel);
box(GR,"🩶","Steel Tie Beam B (20-ft span)",20,.8,.8, 30,14.6,8, C.steel);
cyl(GR,"🩶","Steel King Post A",0.3,5.6, 30,15.4,-4, C.steel,8);
cyl(GR,"🩶","Steel King Post B",0.3,5.6, 30,15.4,8, C.steel,8);
/* hearth + media */
box(GR,"🔥","Gas Fireplace Column (stacked stone)",4,9,1.6, 30,Y3,-8.2, 0x5c564e);
box(GR,"🔥","Firebox (linear flame)",2.6,1,1.2, 30,Y3+1.4,-7.9, 0xff7733);
box(GR,"📽️","Projection Screen (120-inch, multiplayer wall)",8.7,4.9,.2, 36,Y3+2.2,-8.3, 0x0d0d0d);
/* furnishings */
box(GR,"🛋️","Sectional Sofa — Long Run (9 ft)",9,2.6,3, 29,Y3+.1,4.5, C.sofa);
box(GR,"🛋️","Sectional Sofa — Chaise (5 ft)",3,2.6,5, 24,Y3+.1,1.5, C.sofa);
box(GR,"🪵","Live-Edge Coffee Table (walnut slab)",4.5,1.3,2.2, 29,Y3+.1,0, 0x5a3c22);
box(GR,"🌀","Great Room Rug (Yggdrasil weave)",12,.08,9, 29,Y3+.61,1.5, 0x233a4a);
box(GR,"🍸","Bar Counter (live-edge, 7 ft)",7,3.4,2, 36.5,Y3+.1,8.5, C.darkwood);
["A 33.8","B 36.5","C 39.2"].forEach(s=>{const[p,x]=s.split(" ");
cyl(GR,"🪑","Bar Stool "+p,0.8,2.6, +x,Y3+.1,6.4, C.steel,10);});
box(GR,"🎛️","Performance Rig (keys + modular, 140 BPM)",5,3.2,2, 22.5,Y3+.1,9.5, 0x1c2420,{ry:.5});
cyl(GR,"🔭","Telescope on Tripod (aimed at the lake)",0.5,4.6, 34,Y3+.1,11, 0x2c3230,8);
cyl(GR,"💡","Ring Chandelier (steel + Edison)",2.6,.5, 30,16.6,2, C.amber,16);
box(GR,"🐦","Jake's Sky Perch (vault annex 🖤)",1.8,4.5,1.8, 21.5,Y3+.1,-6.5, 0x2f6b3a);
box(GR,"🌉","Glass Skybridge to Upper Hall",2.5,.5,3.5, 18.5,9.1,2, 0x9fd4e8,{op:.4});
/* ════════ 🛗 MODERN GLASS ELEVATOR — driveway side, tap cab to ride ════════ */
const EV="🛗 Glass Elevator";
box(EV,"🧱","Elevator Pad (concrete)",6,.4,6, 21.5,0,16, 0x555a55);
[[19.2,13.7],[23.8,13.7],[19.2,18.3],[23.8,18.3]].forEach(([x,z],i)=>
box(EV,"🩶","Shaft Post "+"NESW"[i]+" (steel, 19 ft)",0.5,19,0.5, x,0.4,z, C.steel));
box(EV,"🪟","Shaft Glass (frameless, 19 ft)",4.6,19,4.6, 21.5,0.4,16, 0x9fd4e8,{op:.14});
box(EV,"🩶","Shaft Crown & Hoist",5.2,.8,5.2, 21.5,19.4,16, C.steel);
box(EV,"🌉","Boarding Bridge to Great Room",1.6,.5,2.6, 21.5,9.8,13.2, 0x9fd4e8,{op:.4});
box(EV,"🔘","Call Pillar (ground)",0.6,3.6,0.6, 24.8,0.4,19, 0x1c2420);
const cab = box(EV,"🛗","Elevator Cab — TAP TO RIDE",3.8,7,3.8, 21.5,0.6,16, 0x39ff6a,{op:.28});
box(EV,"🟫","Cab Floor (cedar)",3.6,.3,3.6, 21.5,0.62,16, 0x8a6a42);
let cabUp=false, cabY=0.6;
cab.userData.action=()=>{ cabUp=!cabUp; };
anims.push(()=>{ const goal=cabUp?9.9:0.6; cabY+=(goal-cabY)*.04;
cab.position.y=cabY+3.5; cab.parent.children.forEach(c=>{ if(c.userData.name==="Cab Floor (cedar)") c.position.y=cabY+.15; }); });
/* ════════ 🗼 LIGHTHOUSE GAZEBO — backyard beacon ════════ */
const LH="🗼 Lighthouse Gazebo";
cyl(LH,"🛝","Gazebo Deck (octagon, 14-ft dia)",7,1, 48,0,-52, 0x8a6a42,8);
cyl(LH,"🛡️","Gazebo Railing (octagon)",6.6,2.6, 48,1,-52, 0x6b4f30,8).material.transparent=true;
groups[LH].children[1].material.opacity=.35;
box(LH,"🚪","Lighthouse Door (arched)",2.2,5,.4, 48,1,-48.2, 0x6b1f1f);
cyl(LH,"🗼","Tower Base Band (white, 10 ft)",4,10, 48,1,-52, 0xe8ecea,14);
cyl(LH,"🗼","Tower Upper Band (phosphor green, 7 ft)",3.3,7, 48,11,-52, 0x2f6b3a,14);
cyl(LH,"🛝","Gallery Deck & Rail",4.8,.6, 48,18,-52, C.steel,14);
cyl(LH,"🪟","Lantern Room (glass, 5 ft)",2.7,5, 48,18.6,-52, 0x9fd4e8,14).material.transparent=true;
groups[LH].children[6].material.opacity=.35;
const lamp=cyl(LH,"💡","Beacon Lamp (LED array)",0.9,2, 48,20,-52, C.green,10);
lamp.material.emissive=new THREE.Color(0x39ff6a);
const cone=new THREE.Mesh(new THREE.ConeGeometry(3.2,26,12,1,true),
new THREE.MeshBasicMaterial({color:0x39ff6a,transparent:true,opacity:.16,side:THREE.DoubleSide}));
cone.rotation.z=Math.PI/2; cone.position.x=13;
const pivot=new THREE.Group(); pivot.position.set(48,21,-52); pivot.add(cone); scene.add(pivot);
cone.userData={name:"Rotating Beacon Beam (26-ft throw)",zone:LH,w:26,h:6.4,d:6.4,emoji:"🌀",mesh:cone};
registry.push(cone.userData);
const lhLight=new THREE.PointLight(0x39ff6a,.9,60); lhLight.position.set(48,21,-52); scene.add(lhLight);
anims.push(t=>{ pivot.rotation.y = t*.0009; lamp.material.emissiveIntensity=.7+.3*Math.sin(t*.004); });
cyl(LH,"⛰️","Lantern Roof Cone (copper)",3.3,3.6, 48,23.4,-52, 0x7a4a30,14);
cyl(LH,"🌀","Finial & Lightning Rod",0.15,3, 48,26.8,-52, C.steel,6);
/* ════════ 🌊 BLACK LAKE — Lake Minnetonka, Phelps Island shore ════════ */
const BL="🌊 Black Lake";
const water = box(BL,"🌊","Black Lake Water (Lake Minnetonka bay)",220,.4,90, 0,-.6,-118, 0x0e2a3a,{op:.88});
box(BL,"🏖️","Shoreline (sand & granite)",220,.5,10, 0,-.3,-70, 0x4a4438);
box(BL,"🪨","Shore Boulder A (glacial erratic)",3,2,2.5, -30,0,-68, 0x5c5c58);
box(BL,"🪨","Shore Boulder B (glacial erratic)",2.2,1.6,2, 20,0,-69, 0x605c54);
box(BL,"🌾","Cattail Reed Bed",12,3,4, 30,-.2,-72, 0x3a4a1e);
box(BL,"🛝","Dock (cedar, 4 × 24)",4,.8,24, 0,.2,-84, 0x8a6a42);
box(BL,"🛥️","Runabout Boat (rum-runner legend, 16 ft)",6,2.6,16, 8,-.1,-88, 0x6b2418);
box(BL,"⚓","Boat Lift Frame",7,4,17, 8,-.4,-88, C.steel,{op:.3});
anims.push(t=>{ water.position.y = -.4 + Math.sin(t*.0011)*.12; });
/* ════════ 🌤️ LAKE DECKS (1988) — three up, three French doors out ════════ */
const DK="🌤️ Lake Decks (1988)";
/* full-height cedar columns carrying all three decks */
[[3,-23.5],[16,-23.5],[3,-14.5],[16,-14.5]].forEach(([x,z],i)=>
box(DK,"🪵","Deck Column "+"ABCD"[i]+" (6×6 cedar, 20 ft)",0.6,20,0.6, x,0,z, 0x6b4f30));
/* LEVEL 1 — main floor */
box(DK,"🛝","Deck Level 1 (cedar, 16 × 10)",16,1,10, 9.5,.2,-19, 0x8a6a42);
box(DK,"🛡️","Deck 1 Railing (wrap, 3 ft)",16.4,3,10.4, 9.5,1.2,-19, 0x6b4f30,{op:.22});
box(DK,"🚪","French Doors — Level 1 (frame, 1988 oak)",5.4,7,.5, 10,1,-13.05, 0x4a3018);
box(DK,"🪟","French Doors — Level 1 (glass pair)",4.6,6.4,.6, 10,1.2,-13.05, 0x9fd4e8,{op:.4});
/* LEVEL 2 — upper floor */
box(DK,"🛝","Deck Level 2 (cedar, 14 × 9)",14,1,9, 9.5,8.8,-18.5, 0x8a6a42);
box(DK,"🛡️","Deck 2 Railing (wrap, 3 ft)",14.4,3,9.4, 9.5,9.8,-18.5, 0x6b4f30,{op:.22});
box(DK,"🚪","French Doors — Level 2 (frame)",5.4,7,.5, 10,9.4,-13.05, 0x4a3018);
box(DK,"🪟","French Doors — Level 2 (glass pair)",4.6,6.4,.6, 10,9.6,-13.05, 0x9fd4e8,{op:.4});
/* LEVEL 3 — crow's nest off the north dormer */
box(DK,"🏠","North Gable Dormer (1988 signature)",9,6,5, 9,15.8,-10.5, C.siding);
box(DK,"🛝","Deck Level 3 — Crow's Nest (10 × 7)",10,1,7, 9.5,17,-17, 0x8a6a42);
box(DK,"🛡️","Deck 3 Railing (wrap, 3 ft)",10.4,3,7.4, 9.5,18,-17, 0x6b4f30,{op:.22});
box(DK,"🚪","French Doors — Level 3 (frame)",5.4,6,.5, 9,16,-13.15, 0x4a3018);
box(DK,"🪟","French Doors — Level 3 (glass pair)",4.6,5.4,.6, 9,16.2,-13.15, 0x9fd4e8,{op:.4});
/* stairs between decks + plaque */
box(DK,"🪜","Deck Stair L1→L2 (open riser)",3,.8,12, 17.8,4.4,-19, 0x6b4f30,{rx:.72});
box(DK,"🪜","Deck Stair L2→L3 (open riser)",3,.8,10.5, 1.4,13,-18.5, 0x6b4f30,{rx:.82});
box(DK,"🏅","Architect's Plaque — 1988, Phelps Island",1.4,1,.2, 12.8,3,-13.05, 0x8f7a3a);
box(DK,"🔭","Deck 3 Sunset Bench (lake watch)",5,1.6,1.6, 9.5,18,-19.6, 0x6b4f30);
/* ════════ ⛏️ THE UNDERGROUND — Prohibition cellar & older strata ════════ */
const UG="⛏️ Underground (Prohibition)";
box(UG,"🧱","Speakeasy Cellar Shell (fieldstone, 14 × 12 × 8)",14,8,12, 0,-9.2,0, 0x4c4a44,{op:.4});
box(UG,"🟫","Cellar Floor (packed earth & flagstone)",13,.5,11, 0,-9.2,0, 0x3a342a);
box(UG,"🪜","Hidden Hatch Stair (beneath the staircase!)",3,8.6,4, 0,-8.7,-1.5, 0x5c4632,{rx:.35});
[[-4.5,3,"Oak Whiskey Barrel #1"],[-4.5,-3,"Oak Whiskey Barrel #2"],[-2.2,4,"Oak Whiskey Barrel #3"]].forEach(([x,z,n])=>
cyl(UG,"🛢️",n,1.1,2.8, x,-8.7,z, 0x5a3c22,12));
box(UG,"🫙","Mason Jar Shelf (root cellar wall)",5,4,1, 4.5,-8.7,-5, 0x4a3826);
box(UG,"🃏","Card Table (green felt, 1926)",3.5,2.4,3.5, 2,-8.7,2, 0x1e4225);
["A 0.5 2","B 3.5 2","C 2 0.2","D 2 3.8"].forEach(s=>{const[p,x,z]=s.split(" ");
box(UG,"🪑","Speakeasy Chair "+p,1.2,2.6,1.2, +x,-8.7,+z, 0x3a2c1c);});
box(UG,"💡","Edison Bulb String (still wired)",12,.3,.3, 0,-2.2,0, C.amber);
box(UG,"🕳️","Coal Chute (to driveway side)",2,6,2, 6.5,-7,4.5, 0x2c2c2c,{rx:-.5});
/* the tunnel north, under the lawn, toward the boathouse */
box(UG,"🚇","Rum-Runner Tunnel (brick arch, 48 ft to shore)",4.5,5.5,48, 0,-8.5,-30, 0x5a3a30,{op:.55});
box(UG,"🚪","Boathouse Cellar Door (tunnel mouth)",4,5,.8, 0,-8.5,-54.2, 0x4a3018);
box(UG,"🏮","Tunnel Lantern Hook (mid-passage)",0.4,1,0.4, 1.8,-4.5,-30, C.amber);
/* older than the bottles — treated with respect */
box(UG,"🧱","Sealed Passage (older masonry, unexcavated 🙏)",4,5,2, -7.2,-8.5,-2, 0x3c3a34,{op:.7});
box(UG,"🌎","Prehistoric Stratum (undisturbed, protected)",60,2,60, 0,-14.5,-10, 0x2a2018,{op:.35});
/* surface earthwork — protected, marked, never modeled inside */
const em=new THREE.Mesh(new THREE.SphereGeometry(9,16,10,0,Math.PI*2,0,Math.PI/2),
new THREE.MeshLambertMaterial({color:0x1c3a22}));
em.scale.y=.32; em.position.set(-48,0.1,10);
reg("🌲 Site & Yard","⛰️","Earthwork Mound (protected · ancestral · do not disturb 🙏)",em,18,2.9,18);
box("🌲 Site & Yard","🪧","Interpretive Marker (honor the first peoples)",1.6,3.2,.3, -41,0,14, 0x6b4f30);
/* cellar view toggle */
const bUnder=document.getElementById("bUnder"); bUnder.classList.add("off");
groups[UG].visible=false;
bUnder.onclick=()=>{
const on = !groups[UG].visible;
groups[UG].visible = on;
groups["🌲 Site & Yard"].visible = !on;
groups["🗼 Lighthouse Gazebo"].visible = !on;
groups["🏊 Natatorium (Pool Wing)"] && (groups["🏊 Natatorium (Pool Wing)"].visible = !on);
groups["🛝 Grand Lower Deck (Hex)"] && (groups["🛝 Grand Lower Deck (Hex)"].visible = !on);
groups[BL].visible = !on;
bUnder.classList.toggle("off",!on);
if(on){ want.target.set(0,-8,-10); want.dist=70; want.phi=1.2; }
else { want.target.set(4,7,0); want.dist=95; }
};
/* ════════ 🏊 NATATORIUM — long pool wing, west side, 40 ft off Black Lake ════════ */
const NP="🏊 Natatorium (Pool Wing)";
box(NP,"⬜","Natatorium Tile Floor (40 × 16)",40,.4,16, -34,0,-22, C.tile);
box(NP,"🪟","Natatorium Glass Shell (lake-parallel, 40 × 16)",40,10,16, -34,.4,-22, 0x9fd4e8,{op:.18});
[-50,-40,-30,-20].forEach((x,i)=>{
const rib=new THREE.Mesh(new THREE.TorusGeometry(7.6,.35,8,24,Math.PI),
new THREE.MeshLambertMaterial({color:0x9a6f3f}));
rib.position.set(x,10.2,-22); rib.rotation.y=Math.PI/2; rib.scale.y=.6;
reg(NP,"🌈","Pool Wing Cedar Arch Rib #"+(i+1),rib,15.2,4.6,.7);
});
box(NP,"🩶","Pool Wing Steel Ridge (40 ft)",40,.8,.8, -34,13.6,-22, C.steel);
const pool = box(NP,"🌊","Lap Pool (30 × 10, 5 ft deep)",30,1,10, -36,.15,-22, 0x1d6f8a,{op:.85});
box(NP,"🧱","Pool Coping Edge (bullnose)",31.5,.5,11.5, -36,.55,-22, 0xd8ded8,{op:.35});
cyl(NP,"🪜","Pool Ladder (steel)",0.4,3, -21.5,.6,-19, C.steel,8);
cyl(NP,"♨️","Hot Tub (HEXAGON, 7-ft, lighthouse echo)",3.5,2.6, -16.5,.4,-27, 0x2f6b3a,6);
box(NP,"🪑","Pool Lounge Chair A",2,1.6,5.5, -46,.4,-15.5, 0x35524a);
box(NP,"🪑","Pool Lounge Chair B",2,1.6,5.5, -42.5,.4,-15.5, 0x35524a);
box(NP,"🧖","Cedar Sauna Cabin (6 × 7)",6,7,6, -50.5,.4,-26.5, 0x6b4f30);
box(NP,"🪴","Potted Fern Pair (north light)",1.6,3,1.6, -18,.4,-16, 0x27331f);
box(NP,"🚪","Pool Corridor French Doors (to Living Room)",4,7,3.5, -16,.4,-14.5, 0x9fd4e8,{op:.4});
box(NP,"📏","Shore Setback Marker — 40 FT TO BLACK LAKE 🌊",0.5,4,0.5, -34,0,-30.8, 0x8f7a3a);
anims.push(t=>{ pool.material.opacity=.78+.08*Math.sin(t*.0016); });
/* ════════ 🛝 GRAND LOWER DECK — huge, hex-framed, gazebo-integrated ════════ */
const GD="🛝 Grand Lower Deck (Hex)";
box(GD,"🛝","Grand Lower Deck Platform (46 × 26 — absolutely huge)",46,1,26, 9,0,-27, 0x8a6a42);
box(GD,"🛡️","Grand Deck Lakeside Railing (46 ft run)",46,3,.6, 9,1,-40.2, 0x6b4f30,{op:.3});
cyl(GD,"⬡","Hex Bay West (12-ft hexagon)",6,1, -8,0,-42, 0x8a6a42,6);
cyl(GD,"⬡","Hex Bay East (12-ft hexagon)",6,1, 24,0,-42, 0x8a6a42,6);
cyl(GD,"⬡","Hex Junction Node (boardwalk hub)",5,1, 36,-.1,-45, 0x8a6a42,6);
box(GD,"🛝","Boardwalk A — Deck → Hex Node",4,.8,14, 31,-.05,-38, 0x8a6a42,{ry:.55});
box(GD,"🛝","Boardwalk B — Hex Node → Lighthouse Gazebo",4,.8,12, 42,-.05,-49, 0x8a6a42,{ry:.5});
cyl(GD,"🔥","Hex Fire Table (deck centerpiece)",1.8,1.4, 10,1,-33, 0x3a3a3a,6);
/* lighthouse-design hex pergola framing — banded posts, hex ring, mini lantern */
[[18,-27],[14,-20.1],[6,-20.1],[2,-27],[6,-33.9],[14,-33.9]].forEach(([x,z],i)=>{
cyl(GD,"🗼","Pergola Post "+(i+1)+" (white band)",0.45,5, x,1,z, 0xe8ecea,8);
cyl(GD,"🗼","Pergola Post "+(i+1)+" (green band)",0.4,4, x,6,z, 0x2f6b3a,8);
});
cyl(GD,"⬡","Hex Ring Beam (lighthouse framing, 16-ft)",8.4,.6, 10,10,-27, 0x6b4f30,6).material.transparent=true;
groups[GD].children[groups[GD].children.length-1].material.opacity=.85;
cyl(GD,"🪟","Pergola Lantern Cupola (glass hex)",2,3, 10,10.6,-27, 0x9fd4e8,6).material.transparent=true;
groups[GD].children[groups[GD].children.length-1].material.opacity=.35;
const miniLamp=cyl(GD,"💡","Cupola Mini-Beacon (answers the lighthouse)",0.6,1.2, 10,11.4,-27, C.green,8);
miniLamp.material.emissive=new THREE.Color(0x39ff6a);
cyl(GD,"⛰️","Cupola Roof (copper hex cone)",2.4,1.8, 10,13.6,-27, 0x7a4a30,6);
anims.push(t=>{ miniLamp.material.emissiveIntensity=.5+.5*Math.sin(t*.004+Math.PI); });
box(GD,"🚪","Walkout French Doors (lower level, lake side)",5,7,.6, -8,0,-13.05, 0x9fd4e8,{op:.4});
box(GD,"🚪","Walkout Door Frame (1988 oak)",5.6,7.4,.4, -8,0,-13, 0x4a3018);
let theta=.85, phi=1.05, dist=95, target=new THREE.Vector3(4,7,0), want={theta,phi,dist,target:target.clone()};
function applyCam(){
theta+=(want.theta-theta)*.12; phi+=(want.phi-phi)*.12; dist+=(want.dist-dist)*.12;
target.lerp(want.target,.12);
camera.position.set(
target.x + dist*Math.sin(phi)*Math.cos(theta),
target.y + dist*Math.cos(phi),
target.z + dist*Math.sin(phi)*Math.sin(theta));
camera.lookAt(target);
}
const ptrs=new Map(); let lastPinch=0;
renderer.domElement.addEventListener("pointerdown",e=>{ptrs.set(e.pointerId,{x:e.clientX,y:e.clientY});renderer.domElement.setPointerCapture(e.pointerId);});
renderer.domElement.addEventListener("pointerup",e=>ptrs.delete(e.pointerId));
renderer.domElement.addEventListener("pointermove",e=>{
if(!ptrs.has(e.pointerId)){hover(e);return;}
const p=ptrs.get(e.pointerId);
if(ptrs.size===1){
want.theta += (e.clientX-p.x)*.006;
want.phi = Math.min(1.45,Math.max(.25, want.phi + (e.clientY-p.y)*.004));
moved=true;
} else if(ptrs.size===2){
const arr=[...ptrs.values()]; const other=arr.find(o=>o!==p)||arr[0];
const pinch=Math.hypot(e.clientX-other.x,e.clientY-other.y);
if(lastPinch) want.dist=Math.min(260,Math.max(18,want.dist*(lastPinch/pinch)));
lastPinch=pinch; moved=true;
}
p.x=e.clientX;p.y=e.clientY; hover(e);
});
renderer.domElement.addEventListener("pointerleave",()=>{lastPinch=0;});
addEventListener("wheel",e=>{want.dist=Math.min(260,Math.max(18,want.dist*(1+Math.sign(e.deltaY)*.08)));},{passive:true});
/* ════════ raycast hover / tap → named tooltip ════════ */
const ray=new THREE.Raycaster(), ndc=new THREE.Vector2(), tip=document.getElementById("tip");
let hot=null, moved=false;
function pick(e){
ndc.set(e.clientX/innerWidth*2-1, -(e.clientY/innerHeight)*2+1);
ray.setFromCamera(ndc,camera);
const hits=ray.intersectObjects(registry.map(r=>r.mesh).filter(m=>m.visible&&m.parent&&isShown(m)),false);
return hits[0]?hits[0].object:null;
}
function isShown(m){ let p=m; while(p){ if(!p.visible) return false; p=p.parent; } return true; }
function hover(e){
const m=pick(e);
if(hot&&hot!==m) hot.material.emissive&&hot.material.emissive.setHex(0);
hot=m;
if(m){
m.material.emissive&&m.material.emissive.setHex(0x114422);
const u=m.userData;
tip.innerHTML=`<b>${u.emoji} ${u.name}</b>${u.w.toFixed(1)} × ${u.d.toFixed(1)} ft · <span>${u.h.toFixed(1)} ft tall</span><br><i style="color:var(--ink-dim)">${u.zone}</i>`;
tip.style.display="block";
tip.style.left=Math.min(innerWidth-240,e.clientX+14)+"px";
tip.style.top=Math.min(innerHeight-90,e.clientY+14)+"px";
} else tip.style.display="none";
}
renderer.domElement.addEventListener("pointerdown",()=>{moved=false;});
renderer.domElement.addEventListener("pointerup",e=>{
if(moved) return;
const m=pick(e); if(!m) return;
if(m.userData.action) m.userData.action();
focusOn(m.userData); hover(e);
});
function focusOn(u){
const p=new THREE.Vector3(); u.mesh.getWorldPosition(p);
want.target.copy(p);
want.dist=Math.max(14, Math.max(u.w,u.h,u.d)*3.2);
}
/* ════════ toggles ════════ */
const bRoof=document.getElementById("bRoof"), bL2=document.getElementById("bL2");
function toggle(g,btn){ g.visible=!g.visible; btn.classList.toggle("off",!g.visible); }
bRoof.onclick=()=>toggle(RF,bRoof);
bL2.onclick=()=>{ toggle(L2,bL2); if(!L2.visible&&RF.visible) toggle(RF,bRoof); };
/* ════════ index panel ════════ */
const idx=document.getElementById("index"), tree=document.getElementById("tree");
document.getElementById("bIndex").onclick=()=>idx.classList.toggle("open");
const byZone={};
registry.forEach(u=>{(byZone[u.zone]=byZone[u.zone]||[]).push(u);});
Object.keys(byZone).forEach((z,zi)=>{
const det=document.createElement("details"); if(zi<2) det.open=true;
det.innerHTML=`<summary>${z} <i>· ${byZone[z].length}</i></summary>`;
byZone[z].forEach(u=>{
const b=document.createElement("button"); b.className="obj";
b.innerHTML=`${u.emoji} ${u.name} <i>${u.w.toFixed(1)}×${u.d.toFixed(1)}×${u.h.toFixed(1)} ft</i>`;
b.onclick=()=>{ if(!isShown(u.mesh)){ if(u.mesh.parent===RF||RF.getObjectById(u.mesh.id)) RF.visible=true; L2.visible=true; bRoof.classList.remove("off"); bL2.classList.remove("off"); } focusOn(u); if(innerWidth<700) idx.classList.remove("open"); };
det.appendChild(b);
});
tree.appendChild(det);
});
document.getElementById("count").textContent = registry.length+" named objects · every dimension in feet";
/* ════════ LEDGER.md export — ties back to ROOM-SPECIFICATION.md ════════ */
document.getElementById("bLedger").onclick=()=>{
let md="# 🏠 4704-CAVAN-ROAD-LEDGER.md\n### Contents Ledger · "+registry.length+" named objects · all in feet 🖐️\n";
Object.keys(byZone).forEach(z=>{
md+="\n## "+z+"\n\n| Object | W (ft) | D (ft) | H (ft) |\n|---|---|---|---|\n";
byZone[z].forEach(u=>{ md+=`| ${u.emoji} ${u.name} | ${u.w.toFixed(1)} | ${u.d.toFixed(1)} | ${u.h.toFixed(1)} |\n`; });
});
md+="\n---\n###### 🖤 Phoenix Voltage Productions · representative model — correct it corner-to-corner\n";
const url=URL.createObjectURL(new Blob([md],{type:"text/markdown;charset=utf-8"}));
const a=Object.assign(document.createElement("a"),{href:url,download:"4704-CAVAN-ROAD-LEDGER.md"});
document.body.appendChild(a);a.click();a.remove();setTimeout(()=>URL.revokeObjectURL(url),2000);
};
/* snapshot */
document.getElementById("bSnap").onclick=()=>{
const a=Object.assign(document.createElement("a"),{href:renderer.domElement.toDataURL("image/png"),download:"4704-cavan-road.png"});
document.body.appendChild(a);a.click();a.remove();
};
/* keys */
addEventListener("keydown",e=>{
const k=e.key.toLowerCase();
if(k==="r")bRoof.click(); else if(k==="u")bL2.click(); else if(k==="i")document.getElementById("bIndex").click();
});
addEventListener("resize",()=>{camera.aspect=innerWidth/innerHeight;camera.updateProjectionMatrix();renderer.setSize(innerWidth,innerHeight);});
(function loop(t){ requestAnimationFrame(loop); anims.forEach(f=>f(t||0)); applyCam(); renderer.render(scene,camera); })(0);
</script>
</body>
</html>