-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
708 lines (630 loc) · 35.8 KB
/
index.html
File metadata and controls
708 lines (630 loc) · 35.8 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
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Interactive 2D Medial Axis Transform (MAT) Visualizer</title>
<meta name="description" content="An interactive real-time visualizer for the fast sampling-based 2D Medial Axis Transform algorithm. Draw custom polygons and inspect skeleton branches, junction points, and maximal inscribed circles.">
<link rel="stylesheet" href="./src/styles.css">
</head>
<body>
<!-- App Body Container -->
<div class="app-container">
<!-- Drawing Mode Indicator -->
<div class="drawing-indicator" id="drawing-indicator" style="display: none;">
<span class="indicator-pulse"></span>
<span id="drawing-text">Drawing Mode: Click to add vertices (min 3). Click first vertex to close.</span>
</div>
<!-- Canvas Wrapper -->
<div class="canvas-wrapper" id="canvas-wrapper">
<canvas id="polygon-canvas" width="800" height="600"></canvas>
<!-- Cell Hover Tooltip Overlay -->
<div id="cell-tooltip" style="position: absolute; display: none; background: rgba(15, 23, 42, 0.9); color: #f8fafc; padding: 10px 14px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.15); font-family: system-ui, -apple-system, sans-serif; font-size: 13px; pointer-events: none; z-index: 1000; box-shadow: 0 4px 12px rgba(0,0,0,0.5); backdrop-filter: blur(4px); line-height: 1.4;"></div>
<!-- Floating Camera Controls HUD -->
<div class="camera-hud" id="camera-hud">
<button class="btn-hud active" id="btn-view-perspective" title="Perspective View">
<span>🎥</span> Perspective
</button>
<button class="btn-hud" id="btn-view-top" title="Top-Down View">
<span>📐</span> Top View
</button>
<button class="btn-hud" id="btn-reset-view" title="Reset Viewport">
<span>🔍</span> Reset View
</button>
<div class="camera-info" id="camera-info">
Zoom: 1.00x
</div>
</div>
</div>
<!-- HUD Control Sidebar -->
<aside class="control-sidebar" id="control-sidebar">
<div class="sidebar-header">
<h2>Visualizer Dashboard</h2>
<div style="display: flex; align-items: center; gap: 10px;">
<span class="hud-tips-icon" style="font-size: 1rem;">⚙</span>
<button class="btn-minimize" id="btn-minimize-sidebar" title="Minimize Panel">
<span>▼</span>
</button>
</div>
</div>
<div class="sidebar-tabs">
<button class="tab-btn active" id="btn-tab-workflow">Workflow</button>
<button class="tab-btn" id="btn-tab-shading">SSAO & Shading</button>
<button class="tab-btn" id="btn-tab-ai-render">AI Render</button>
<button class="tab-btn" id="btn-tab-shape-grammar">Shape Grammar</button>
</div>
<div class="sidebar-scroll" id="tab-content-workflow">
<!-- Presets Selection -->
<section class="control-group">
<h3>Shape Presets</h3>
<div class="presets-grid">
<div class="preset-card" data-preset="cross">
<span class="preset-name">Cross</span>
</div>
<div class="preset-card" data-preset="yshape">
<span class="preset-name">Y-Shape</span>
</div>
<div class="preset-card" data-preset="sqdonut">
<span class="preset-name">Sq. Donut</span>
</div>
<div class="preset-card" data-preset="donut">
<span class="preset-name">Circ. Donut</span>
</div>
<div class="preset-card" data-preset="pentagon">
<span class="preset-name">Pentagon</span>
</div>
<div class="preset-card active" data-preset="tree">
<span class="preset-name">Branched Tree</span>
</div>
<div class="preset-card" id="card-custom" style="display: none;">
<span class="preset-name">Custom</span>
</div>
</div>
<button class="btn" id="btn-draw-custom" style="width: 100%; margin-top: 12px; justify-content: center;">
Draw Custom Polygon
</button>
<button class="btn" id="btn-clear-custom" style="display: none; width: 100%; margin-top: 12px; justify-content: center; color: #ef4444; border-color: rgba(239, 68, 68, 0.2); background: rgba(239, 68, 68, 0.05);">
Clear Custom Polygon
</button>
</section>
<!-- Tracing Parameters -->
<section class="control-group collapsible collapsed" id="section-mat-params">
<h3 class="collapsible-header" id="header-mat-params">
MAT Parameters
<span class="chevron">▼</span>
</h3>
<div class="collapsible-content" id="content-mat-params">
<!-- Sampling Density Slider -->
<div class="slider-container" style="margin-top: 10px;">
<div class="slider-info">
<span class="slider-label">Samples per Edge</span>
<span class="slider-value" id="val-samples">25</span>
</div>
<input type="range" id="slider-samples" min="5" max="100" value="25">
</div>
<!-- Convergence Epsilon Slider -->
<div class="slider-container" style="margin-top: 10px;">
<div class="slider-info">
<span class="slider-label">Bisection Precision</span>
<span class="slider-value" id="val-precision">1e-5</span>
</div>
<input type="range" id="slider-precision" min="3" max="7" value="5">
</div>
</div>
</section>
<!-- Toggle Overlays -->
<section class="control-group">
<h3>Display Overlays</h3>
<!-- Show Skeleton -->
<div class="toggle-container" id="toggle-skeleton-container">
<div class="toggle-details">
<span class="toggle-label">Show Medial Axis</span>
<span class="toggle-sub">Draws the computed skeleton points</span>
</div>
<label class="switch">
<input type="checkbox" id="chk-show-skeleton" checked>
<span class="slider-switch"></span>
</label>
</div>
<!-- Simplify Medial Axis -->
<div class="toggle-container" id="toggle-simplify-skeleton-container">
<div class="toggle-details">
<span class="toggle-label">Simplify Medial Axis</span>
<span class="toggle-sub">Straighten branches (valence 3 to valence 1)</span>
</div>
<label class="switch">
<input type="checkbox" id="chk-simplify-skeleton" checked>
<span class="slider-switch"></span>
</label>
</div>
<!-- Merge Nodes Slider -->
<div class="slider-container" id="container-merge-slider" style="display: none; margin-top: 10px; margin-bottom: 15px;">
<div class="slider-info">
<span class="slider-label">Node Merge Distance</span>
<span class="slider-value" id="val-merge">2.0m</span>
</div>
<input type="range" id="slider-merge" min="0" max="10" step="0.1" value="2">
</div>
<!-- Display Mode -->
<div style="margin-top: 10px;">
<label style="display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 6px;">Display Mode</label>
<select id="display-mode-select" style="width: 100%; padding: 8px 10px; border: 1px solid var(--border-color); border-radius: 6px; background: #fff; font-size: 0.8rem; outline: none; box-sizing: border-box;">
<option value="STANDARD" selected>STANDARD</option>
<option value="DEPTH">DEPTH MAP</option>
</select>
</div>
</section>
<!-- Structural Workflow Section -->
<section class="control-group">
<h3>Structural Workflow</h3>
<!-- Step 1: Draw Structural Ribs -->
<div class="toggle-container" id="toggle-ribs-container" style="display: flex; align-items: center; justify-content: space-between;">
<div class="toggle-details" style="flex: 1;">
<span class="toggle-label">Draw Structural Ribs</span>
<span class="toggle-sub">Draws perpendicular columns/ribs to boundary</span>
</div>
<div style="display: flex; align-items: center; gap: 10px;">
<label class="switch">
<input type="checkbox" id="chk-show-ribs" checked>
<span class="slider-switch"></span>
</label>
<button class="btn-collapse-arrow collapsed" id="btn-collapse-ribs-workflow" aria-label="Collapse workflow" style="background: none; border: none; padding: 4px; cursor: pointer; color: var(--text-muted); font-size: 0.85rem; display: flex; align-items: center; justify-content: center; transition: transform 0.2s ease; outline: none; margin-left: 2px;">
▼
</button>
</div>
</div>
<!-- Nested dependents block -->
<div class="workflow-nested" id="ribs-workflow-dependents" style="margin-left: 15px; border-left: 2px solid var(--border-color); padding-left: 12px; margin-top: 10px; display: none;">
<!-- Step 2: Prune Corner Branches -->
<div class="toggle-container" id="toggle-prune-container" style="margin-bottom: 10px;">
<div class="toggle-details">
<span class="toggle-label" style="font-size: 0.82rem;">Prune Corner Branches</span>
<span class="toggle-sub" style="font-size: 0.7rem;">Deletes edges connecting corners to internal nodes</span>
</div>
<label class="switch">
<input type="checkbox" id="chk-prune-branches" checked>
<span class="slider-switch"></span>
</label>
</div>
<!-- Step 3: Rib Spacing Slider -->
<div class="slider-container" id="container-ribs-slider" style="margin-top: 10px; margin-bottom: 10px;">
<div class="slider-info">
<span class="slider-label" style="font-size: 0.82rem;">Rib Spacing (m)</span>
<span class="slider-value" id="val-ribs" style="font-size: 0.82rem;">10.0m</span>
</div>
<input type="range" id="slider-ribs" min="1" max="25" step="0.5" value="10">
</div>
<!-- Step 4: Show Structural Bays -->
<div class="toggle-container" id="toggle-bays-container" style="margin-top: 10px; margin-bottom: 10px;">
<div class="toggle-details">
<span class="toggle-label" style="font-size: 0.82rem;">Show Structural Bays</span>
<span class="toggle-sub" style="font-size: 0.7rem;">Draws enclosed cells as structural spaces</span>
</div>
<label class="switch">
<input type="checkbox" id="chk-show-bays" checked>
<span class="slider-switch"></span>
</label>
</div>
<!-- Edit Bays Sub-panel (visible by default since Show Bays is checked) -->
<div id="container-edit-bays" style="display: block; margin-top: 10px; margin-bottom: 10px; border: 1px dashed var(--border-color); padding: 12px; background: rgba(0,0,0,0.02);">
<div class="toggle-container" style="border: none; padding: 0 0 10px 0; background: transparent; cursor: default;">
<div class="toggle-details">
<span class="toggle-label" style="font-size: 0.82rem; font-weight: 600;">Edit Bays Mode</span>
<span class="toggle-sub" style="font-size: 0.7rem;">Click cells in viewport to select them</span>
</div>
<label class="switch">
<input type="checkbox" id="chk-edit-bays-mode" checked>
<span class="slider-switch"></span>
</label>
</div>
<div id="edit-bays-actions" style="display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 8px;">
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 8px;">
<button class="btn" id="btn-combine-bays" style="padding: 6px 10px; font-size: 0.75rem; justify-content: center;" disabled>Combine</button>
<button class="btn" id="btn-delete-bays" style="padding: 6px 10px; font-size: 0.75rem; justify-content: center; color: #ef4444; border-color: rgba(239, 68, 68, 0.2);" disabled>Delete</button>
</div>
<button class="btn" id="btn-reset-bay-edits" style="padding: 6px 10px; font-size: 0.75rem; justify-content: center; width: 100%;">Reset Edits</button>
</div>
</div>
</div>
</section>
<!-- 3D Structural Stack Section -->
<section class="control-group collapsible" id="section-3d-stack">
<h3 class="collapsible-header" id="header-3d-stack">
3D Structural Stack
<span class="chevron">▼</span>
</h3>
<div class="collapsible-content" id="content-3d-stack" style="display: block;">
<!-- Number of Floors Slider -->
<div class="slider-container" style="margin-top: 10px;">
<div class="slider-info">
<span class="slider-label">Number of Floors</span>
<span class="slider-value" id="val-floors">3</span>
</div>
<input type="range" id="slider-floors" min="1" max="5" value="3">
</div>
<!-- Floor Height Slider -->
<div class="slider-container" style="margin-top: 10px; margin-bottom: 10px;">
<div class="slider-info">
<span class="slider-label">Floor Height (m)</span>
<span class="slider-value" id="val-floor-height">4.0m</span>
</div>
<input type="range" id="slider-floor-height" min="2.5" max="5.0" step="0.1" value="4.0">
</div>
<!-- Ground Floor Height Factor (X) Slider -->
<div class="slider-container" style="margin-top: 10px; margin-bottom: 10px;">
<div class="slider-info">
<span class="slider-label">Ground Floor Height Factor (X)</span>
<span class="slider-value" id="val-ground-floor-factor">2.0</span>
</div>
<input type="range" id="slider-ground-floor-factor" min="1.0" max="4.0" step="0.1" value="2.0">
</div>
<!-- Toggle: Show 3D Columns -->
<div class="toggle-container" style="margin-top: 10px;">
<div class="toggle-details">
<span class="toggle-label">Show 3D Columns</span>
<span class="toggle-sub">Parametric column cylinders at grid nodes</span>
</div>
<label class="switch">
<input type="checkbox" id="chk-3d-columns" checked>
<span class="slider-switch"></span>
</label>
</div>
<!-- Toggle: Show 3D Beams -->
<div class="toggle-container" style="margin-top: 10px;">
<div class="toggle-details">
<span class="toggle-label">Show 3D Beams</span>
<span class="toggle-sub">Parametric beam profiles along grid edges</span>
</div>
<label class="switch">
<input type="checkbox" id="chk-3d-beams" checked>
<span class="slider-switch"></span>
</label>
</div>
<!-- Toggle: Show Floor Slabs -->
<div class="toggle-container" style="margin-top: 10px;">
<div class="toggle-details">
<span class="toggle-label">Show Floor Slabs</span>
<span class="toggle-sub">Solid concrete slab geometries</span>
</div>
<label class="switch">
<input type="checkbox" id="chk-3d-slabs" checked>
<span class="slider-switch"></span>
</label>
</div>
<!-- Toggle: Show Roof Slab -->
<div class="toggle-container" style="margin-top: 10px;">
<div class="toggle-details">
<span class="toggle-label">Show Roof Slab</span>
<span class="toggle-sub">Composite concrete & timber roof sheets</span>
</div>
<label class="switch">
<input type="checkbox" id="chk-3d-roof" checked>
<span class="slider-switch"></span>
</label>
</div>
<!-- Toggle: Show Hypar Ceilings -->
<div class="toggle-container" style="margin-top: 10px;">
<div class="toggle-details">
<span class="toggle-label">Show Hypar Ceilings</span>
<span class="toggle-sub">Timber hypar slatted ceilings over top-floor bays</span>
</div>
<label class="switch">
<input type="checkbox" id="chk-3d-vaults" checked>
<span class="slider-switch"></span>
</label>
</div>
<!-- Toggle: Show Balconies -->
<div class="toggle-container" style="margin-top: 10px;">
<div class="toggle-details">
<span class="toggle-label">Show Balconies</span>
<span class="toggle-sub">Cantilevered slabs along boundary edges</span>
</div>
<label class="switch">
<input type="checkbox" id="chk-3d-balconies" checked>
<span class="slider-switch"></span>
</label>
</div>
<!-- Toggle: Show Brise-Soleil -->
<div class="toggle-container" style="margin-top: 10px;">
<div class="toggle-details">
<span class="toggle-label">Show Brise-Soleil</span>
<span class="toggle-sub">Solar shading louvers on boundary facades</span>
</div>
<label class="switch">
<input type="checkbox" id="chk-3d-brisesoleil" checked>
<span class="slider-switch"></span>
</label>
</div>
<!-- Toggle: Show Cell Volumes -->
<div class="toggle-container" style="margin-top: 10px; margin-bottom: 10px;">
<div class="toggle-details">
<span class="toggle-label">Show Cell Volumes</span>
<span class="toggle-sub">Phenotypic 3D cells colored by classification</span>
</div>
<label class="switch">
<input type="checkbox" id="chk-3d-cells">
<span class="slider-switch"></span>
</label>
</div>
<!-- Toggle: Show Hover Labels -->
<div class="toggle-container" style="margin-top: 10px; margin-bottom: 10px;">
<div class="toggle-details">
<span class="toggle-label">Show Hover Labels</span>
<span class="toggle-sub">Display phenotypic labels in viewport on cell hover</span>
</div>
<label class="switch">
<input type="checkbox" id="chk-hover-labels" checked>
<span class="slider-switch"></span>
</label>
</div>
</div>
</section>
<!-- Other settings section -->
<section class="control-group collapsible collapsed" id="section-interactive-helpers">
<h3 class="collapsible-header" id="header-interactive-helpers">
Interactive Helpers
<span class="chevron">▼</span>
</h3>
<div class="collapsible-content" id="content-interactive-helpers">
<!-- Show Inscribed Circle on Hover -->
<div class="toggle-container" id="toggle-hover-circle-container" style="margin-top: 10px;">
<div class="toggle-details">
<span class="toggle-label">Interactive Circles</span>
<span class="toggle-sub">Hover near axis to see maximal inscribed discs</span>
</div>
<label class="switch">
<input type="checkbox" id="chk-hover-circle">
<span class="slider-switch"></span>
</label>
</div>
<!-- Show Governors -->
<div class="toggle-container" id="toggle-governors-container" style="margin-top: 10px;">
<div class="toggle-details">
<span class="toggle-label">Render Governors</span>
<span class="toggle-sub">Draw vectors linking center to tangency points</span>
</div>
<label class="switch">
<input type="checkbox" id="chk-show-governors">
<span class="slider-switch"></span>
</label>
</div>
</div>
</section>
<!-- Rhino 3DM IO -->
<section class="control-group collapsible collapsed" id="section-rhino-integration">
<h3 class="collapsible-header" id="header-rhino-integration">
Rhino 3DM Integration
<span class="chevron">▼</span>
</h3>
<div class="collapsible-content" id="content-rhino-integration">
<div style="display: flex; flex-direction: column; gap: 8px; margin-top: 10px;">
<input type="file" id="rhino-file-input" accept=".3dm" style="display: none;" />
<button class="btn btn-primary" id="btn-upload-rhino" style="width: 100%; justify-content: center;">Load .3DM File</button>
<div id="rhino-file-info" style="display: none; padding: 10px; background: rgba(0, 0, 0, 0.03); border: 1px solid var(--border-color); border-radius: 8px; font-size: 0.8rem;">
<div style="font-weight: 600;" id="rhino-filename">Filename.3dm</div>
<div style="color: var(--text-muted); font-size: 0.75rem; margin-top: 2px;" id="rhino-object-count">0 objects found</div>
</div>
<label style="display: none; font-size: 0.75rem; font-weight: 600; margin-top: 4px;" id="lbl-rhino-layers">Select Layers to Load</label>
<div id="rhino-layers-container" class="layers-scroll-container" style="display: none; max-height: 120px; overflow-y: auto; border: 1px solid var(--border-color); padding: 6px; border-radius: 8px; background: rgba(0,0,0,0.01);">
<!-- Checkboxes will be populated dynamically -->
</div>
<div id="rhino-actions" style="display: none; grid-template-columns: 1fr 1fr; gap: 8px;">
<button class="btn" id="btn-load-rhino-layers" style="padding: 6px 12px; font-size: 0.8rem; justify-content: center;">Load Layers</button>
<button class="btn" id="btn-clear-rhino" style="padding: 6px 12px; font-size: 0.8rem; justify-content: center; color: #ef4444; border-color: rgba(239, 68, 68, 0.2); background: rgba(239, 68, 68, 0.05);">Clear</button>
</div>
<div style="border-top: 1px solid var(--border-color); margin: 4px 0;"></div>
<div style="display: flex; flex-direction: column; gap: 4px;">
<label style="font-size: 0.75rem; font-weight: 600;">Export Filename</label>
<input type="text" id="rhino-export-filename" value="medial_axis_export.3dm" style="padding: 6px 10px; border: 1px solid var(--border-color); border-radius: 6px; background: #fff; font-size: 0.8rem; width: 100%; box-sizing: border-box;" />
</div>
<button class="btn btn-primary" id="btn-export-rhino" style="width: 100%; justify-content: center;">Export to 3DM</button>
</div>
</div>
</section>
<!-- Quick Tips HUD -->
<div class="hud-tips">
<span class="hud-tips-icon">💡</span>
<div>
<strong>Interactive Visualizer Tips:</strong>
<p style="margin-top: 4px; font-size: 0.8rem;">Click and drag vertices to modify shapes in real-time. Hover over the medial axis to see the maximal inscribed circle sweep.</p>
</div>
</div>
</div>
<!-- SSAO & Shading Tab Content -->
<div class="sidebar-scroll" id="tab-content-shading" style="display: none;">
<!-- SSAO Settings -->
<section class="control-group">
<h3>Ambient Occlusion (SSAO)</h3>
<!-- SSAO Enable/Disable -->
<div class="toggle-container" style="margin-top: 10px;">
<div class="toggle-details">
<span class="toggle-label">Enable SSAO</span>
<span class="toggle-sub">Soft contact shadows in corners</span>
</div>
<label class="switch">
<input type="checkbox" id="chk-ssao-enabled" checked>
<span class="slider-switch"></span>
</label>
</div>
<!-- SSAO Kernel Radius -->
<div class="slider-container" style="margin-top: 10px;">
<div class="slider-info">
<span class="slider-label">SSAO Radius</span>
<span class="slider-value" id="val-ssao-radius">2.0</span>
</div>
<input type="range" id="slider-ssao-radius" min="0.1" max="10.0" step="0.1" value="2.0">
</div>
<!-- SSAO Min Distance -->
<div class="slider-container" style="margin-top: 10px;">
<div class="slider-info">
<span class="slider-label">SSAO Min Dist</span>
<span class="slider-value" id="val-ssao-min-dist">0.10</span>
</div>
<input type="range" id="slider-ssao-min-dist" min="0.01" max="1.0" step="0.01" value="0.1">
</div>
<!-- SSAO Max Distance -->
<div class="slider-container" style="margin-top: 10px;">
<div class="slider-info">
<span class="slider-label">SSAO Max Dist</span>
<span class="slider-value" id="val-ssao-max-dist">8.0</span>
</div>
<input type="range" id="slider-ssao-max-dist" min="1.0" max="50.0" step="1.0" value="8.0">
</div>
<!-- SSAO Intensity / Contrast -->
<div class="slider-container" style="margin-top: 10px;">
<div class="slider-info">
<span class="slider-label">SSAO Intensity</span>
<span class="slider-value" id="val-ssao-intensity">2.0</span>
</div>
<input type="range" id="slider-ssao-intensity" min="1.0" max="5.0" step="0.1" value="2.0">
</div>
</section>
<!-- Lighting Intensities -->
<section class="control-group">
<h3>Lighting Control</h3>
<!-- Ambient Light Intensity -->
<div class="slider-container" style="margin-top: 10px;">
<div class="slider-info">
<span class="slider-label">Ambient Intensity</span>
<span class="slider-value" id="val-ambient-intensity">0.75</span>
</div>
<input type="range" id="slider-ambient-intensity" min="0.0" max="2.0" step="0.05" value="0.75">
</div>
<!-- Directional Light 1 Intensity -->
<div class="slider-container" style="margin-top: 10px;">
<div class="slider-info">
<span class="slider-label">Dir Light 1 (Key)</span>
<span class="slider-value" id="val-dir1-intensity">0.40</span>
</div>
<input type="range" id="slider-dir1-intensity" min="0.0" max="2.0" step="0.05" value="0.4">
</div>
<!-- Directional Light 2 Intensity -->
<div class="slider-container" style="margin-top: 10px;">
<div class="slider-info">
<span class="slider-label">Dir Light 2 (Fill)</span>
<span class="slider-value" id="val-dir2-intensity">0.20</span>
</div>
<input type="range" id="slider-dir2-intensity" min="0.0" max="2.0" step="0.05" value="0.2">
</div>
</section>
<!-- Environment Options -->
<section class="control-group">
<h3>Environment & Grid</h3>
<!-- Show Ground Plane -->
<div class="toggle-container" style="margin-top: 10px;">
<div class="toggle-details">
<span class="toggle-label">Show Ground Plane</span>
<span class="toggle-sub">Renders white plane for AO shadows</span>
</div>
<label class="switch">
<input type="checkbox" id="chk-ground-plane" checked>
<span class="slider-switch"></span>
</label>
</div>
<!-- Show Grid Helper -->
<div class="toggle-container" style="margin-top: 10px;">
<div class="toggle-details">
<span class="toggle-label">Show Grid Helper</span>
<span class="toggle-sub">Draws spacing grid lines</span>
</div>
<label class="switch">
<input type="checkbox" id="chk-grid-helper" checked>
<span class="slider-switch"></span>
</label>
</div>
</section>
</div>
<!-- AI Render Tab Content -->
<div class="sidebar-scroll" id="tab-content-ai-render" style="display: none;">
<div class="properties imagen-controls" style="border: none; padding: 0;">
<label style="display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 6px;">Render Resolution</label>
<select id="imagen-resolution" style="width: 100%; padding: 8px 10px; border: 1px solid var(--border-color); border-radius: 6px; background: #fff; font-size: 0.8rem; margin-bottom: 12px; outline: none; box-sizing: border-box;">
<option value="4k" selected>4K (3840x2160)</option>
<option value="2k">2K (2560x1440)</option>
<option value="1k">1K (1920x1080)</option>
</select>
<label style="display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 6px;">Prompt Constraints</label>
<textarea id="imagen-prompt" rows="4" placeholder="e.g. Cinematic render of a modern concrete building, evening light..." style="width: 100%; padding: 8px 10px; border: 1px solid var(--border-color); border-radius: 6px; background: #fff; font-size: 0.8rem; margin-bottom: 12px; resize: vertical; outline: none; box-sizing: border-box;"></textarea>
<button class="btn btn-primary" id="btn-generate-imagen" style="width: 100%; justify-content: center; font-weight: 700; margin-bottom: 8px;">GENERATE RENDER</button>
<button class="btn" id="btn-show-imagen" style="width: 100%; justify-content: center; font-weight: 700; display: none; margin-bottom: 8px;">SHOW LAST RENDER</button>
<div id="imagen-status" style="font-size: 11px; color: var(--text-muted); margin-bottom: 12px; margin-top: 5px; text-align: center;"></div>
<label style="display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 6px;">API Payload Log</label>
<textarea id="imagen-payload-display" rows="6" readonly style="width: 100%; padding: 8px 10px; border: 1px solid var(--border-color); border-radius: 6px; background: rgba(0,0,0,0.02); font-family: monospace; font-size: 10px; outline: none; resize: none; box-sizing: border-box;"></textarea>
</div>
</div>
<!-- Shape Grammar Tab Content -->
<div class="sidebar-scroll" id="tab-content-shape-grammar" style="display: none;">
<section class="control-group">
<h3>Shape Grammar Parameters</h3>
<!-- Roof Cantilever Scale Slider -->
<div class="slider-container" style="margin-top: 10px;">
<div class="slider-info">
<span class="slider-label">Roof Cantilever Scale</span>
<span class="slider-value" id="val-cantilever-scale">1.0</span>
</div>
<input type="range" id="slider-cantilever-scale" min="0.1" max="3.0" step="0.1" value="1.0">
</div>
<!-- Roof Hypar H Slider -->
<div class="slider-container" style="margin-top: 10px;">
<div class="slider-info">
<span class="slider-label">Roof Hypar H</span>
<span class="slider-value" id="val-roof-hypar-h">2.0m</span>
</div>
<input type="range" id="slider-roof-hypar-h" min="0.0" max="4.0" step="0.1" value="2.0">
</div>
<!-- Inverted Roof Pitch RH Slider -->
<div class="slider-container" style="margin-top: 10px;">
<div class="slider-info">
<span class="slider-label">Inverted Roof Pitch RH</span>
<span class="slider-value" id="val-roof-pitch-rh">1.0m</span>
</div>
<input type="range" id="slider-roof-pitch-rh" min="0.0" max="3.0" step="0.1" value="1.0">
</div>
<!-- Roof Hypar Slat Spacing Slider -->
<div class="slider-container" style="margin-top: 10px;">
<div class="slider-info">
<span class="slider-label">Roof Hypar Slat Spacing</span>
<span class="slider-value" id="val-roof-hypar-spacing">2.0m</span>
</div>
<input type="range" id="slider-roof-hypar-spacing" min="0.2" max="5.0" step="0.1" value="2.0">
</div>
<!-- Brise Soleil Fin Scale Slider -->
<div class="slider-container" style="margin-top: 10px;">
<div class="slider-info">
<span class="slider-label">Brise Soleil Fin Scale</span>
<span class="slider-value" id="val-brise-fin-scale">1.5</span>
</div>
<input type="range" id="slider-brise-fin-scale" min="0.5" max="3.0" step="0.1" value="1.5">
</div>
</section>
</div>
</aside>
</div>
<!-- Status Bar -->
<footer class="status-bar">
<div class="status-item">
<span class="status-dot" id="status-dot"></span>
<span id="status-text">Engine Ready.</span>
</div>
<div id="stats-render-time">Computation: --ms</div>
</footer>
<!-- IMAGEN Result Modal -->
<div id="imagen-modal" style="display: none; position: absolute; top:0; left:0; width:100%; height:100%; background: rgba(30,30,30,0.95); z-index: 9999; flex-direction: column; justify-content: center; align-items: center; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;">
<!-- Container conforming exactly to 1365 x 768 pixels -->
<div id="imagen-modal-content" style="position: relative; width: 1365px; height: 768px; box-shadow: 0 10px 40px rgba(0,0,0,0.8); background: #000;">
<!-- Header Overlay pinned to the inner wrapper -->
<div style="position: absolute; top: 15px; left: 15px; right: 15px; display: flex; justify-content: space-between; align-items: center; z-index: 10; pointer-events: none;">
<h3 id="imagen-modal-title" style="color: #fff; margin: 0; font-size: 13px; font-weight: 600; font-family: inherit; text-transform: uppercase; pointer-events: auto;">AI Render Result</h3>
<div style="display: flex; align-items: center; pointer-events: auto;">
<button id="btn-save-imagen">Download</button>
<button id="btn-close-imagen" style="background: none; border: none; outline: none; color: #fff; font-size: 28px; cursor: pointer; line-height: 1; padding: 0;">×</button>
</div>
</div>
<button id="btn-prev-imagen" style="position: absolute; left: 10px; top: 50%; transform: translateY(-50%); z-index: 10; color: #fff;">‹</button>
<img id="imagen-result-img" style="width: 100%; height: 100%; display: block; image-rendering: high-quality; transform: translateZ(0); object-fit: contain;" />
<button id="btn-next-imagen" style="position: absolute; right: 10px; top: 50%; transform: translateY(-50%); z-index: 10; color: #fff;">›</button>
</div>
</div>
<script type="module" src="./src/app.js"></script>
</body>
</html>