Skip to content

Commit 0ae9ce8

Browse files
mbreiserclaude
andcommitted
Update documentation for Arena 3D Viewer
README.md: - Add Arena 3D Viewer section with feature list - Add arena_3d_viewer.html to repository structure CLAUDE.md: - Add LED specifications (0604 package, 1.5:1 ratio, 45° rotation) - Add comprehensive Arena 3D Viewer section with: - Key implementation details (Three.js, preserveDrawingBuffer, etc.) - State object structure - Pattern constraints (integer divisors) - Screenshot filename format - URL parameters from Arena Editor - Add Load Pattern placeholder note to TODOs Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 3380703 commit 0ae9ce8

2 files changed

Lines changed: 64 additions & 5 deletions

File tree

CLAUDE.md

Lines changed: 50 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,56 @@ Web calculations are validated against MATLAB reference data:
3939
## Panel Specifications
4040

4141
Standard panel generations:
42-
- G3: 32mm width, 8x8 pixels
43-
- G4: 40.45mm width, 16x16 pixels
44-
- G4.1: 40mm width, 16x16 pixels
45-
- G5: 40mm width, 20x20 pixels
46-
- G6: 45.4mm width, 20x20 pixels
42+
- G3: 32mm width, 8x8 pixels (circle LEDs)
43+
- G4: 40.45mm width, 16x16 pixels (circle LEDs)
44+
- G4.1: 40mm width, 16x16 pixels (rotated rectangle LEDs)
45+
- G5: 40mm width, 20x20 pixels (rotated rectangle LEDs)
46+
- G6: 45.4mm width, 20x20 pixels (rotated rectangle LEDs)
4747

4848
Arena radius formula: `cRadius = panelWidth / (tan(alpha/2)) / 2` where `alpha = 2*PI/numPanels`
4949

50+
### LED Specifications
51+
- G4.1, G5, G6 use 0604 LED package: 0.6mm × 0.4mm = 1.5:1 aspect ratio
52+
- LEDs are rectangles rotated 45° on the panel (not diamonds)
53+
- G3, G4 use circular LED visualization
54+
55+
## Arena 3D Viewer (`arena_3d_viewer.html`)
56+
57+
### Key Implementation Details
58+
- Uses Three.js r128 with OrbitControls
59+
- Renderer requires `preserveDrawingBuffer: true` for screenshot functionality
60+
- LED meshes stored in `ledMeshes[]` array for efficient animation (color-only updates)
61+
- Pattern rotation uses `state.phaseOffset` to shift pattern, not world rotation
62+
- Controls disabled during auto-rotate for performance
63+
64+
### State Object
65+
```javascript
66+
state = {
67+
panelType: 'G6', // G3, G4, G4.1, G5, G6
68+
numCols: 12, // panels around (from 2D editor URL params)
69+
numRows: 3, // panels vertically
70+
activePanels: null, // array of active column indices, null = all
71+
pattern: 'allOn', // 'allOn', 'grating', 'sine'
72+
gratingPixels: 20, // pixels on/off (must be integer divisor)
73+
sineWavelength: 120, // wavelength in pixels (must be integer divisor)
74+
phaseOffset: 0 // current phase for rotation animation
75+
}
76+
```
77+
78+
### Pattern Constraints
79+
- Grating and sine wavelengths must be integer divisors of total azimuth pixels
80+
- This ensures patterns tile seamlessly around the arena
81+
- Use `getIntegerDivisors()` to populate valid options
82+
83+
### Screenshot Filenames
84+
Format: `arena_{gen}_{cols}c{rows}r_{pattern}[_stats]_{timestamp}.png`
85+
Example: `arena_G6_12c3r_sine120_stats_2026-01-17T10-30-45.png`
86+
87+
### URL Parameters (from Arena Editor)
88+
- `gen`: Panel generation (G3, G4, G4.1, G5, G6)
89+
- `cols`: Number of columns (panels around)
90+
- `active`: Comma-separated 0-based indices of active panels (omitted if all active)
91+
5092
## TODO / Future Improvements
5193

5294
### Angular Resolution Display
@@ -59,3 +101,6 @@ A proper implementation should:
59101
- Consider both azimuth (constant) and vertical (varies with elevation) components
60102

61103
The azimuth resolution is constant (360° / total_azimuth_pixels), but vertical resolution varies based on viewing angle from center - pixels near the vertical center subtend smaller angles than those at the top/bottom edges.
104+
105+
### Load Pattern Feature
106+
The "Load Pattern (Coming Soon)" button is a placeholder for future functionality to load custom patterns from files or the pattern editor.

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,19 @@ Configure arena geometry and panel layout for G3-G6 display systems with:
3434

3535
**[Launch Arena Layout Editor →](https://reiserlab.github.io/webDisplayTools/arena_editor.html)**
3636

37+
### Arena 3D Viewer ✅ Ready
38+
Interactive 3D visualization of arena configurations with:
39+
- Three.js-based 3D rendering with orbit controls
40+
- Accurate LED visualization (rotated rectangles for G4.1/G5/G6, circles for G3/G4)
41+
- Pattern visualization: All On, Grating (square wave), Sine wave
42+
- Animated pattern rotation with efficient color-only updates
43+
- Standard view presets (top-down, cardinal directions, fly view from center)
44+
- Zoom controls and screenshot export with descriptive filenames
45+
- Linked from Arena Layout Editor with configuration pass-through
46+
- v3 (2026-01-17)
47+
48+
**[Launch Arena 3D Viewer →](https://reiserlab.github.io/webDisplayTools/arena_3d_viewer.html)**
49+
3750
### G4.1 Pattern Editor 🚧 Coming Soon
3851
Design patterns for G4.1 display systems with support for multiple panel configurations.
3952

@@ -73,6 +86,7 @@ webDisplayTools/
7386
├── index.html # Main landing page
7487
├── g6_panel_editor.html # G6 Panel Pattern Editor (ready)
7588
├── arena_editor.html # Arena Layout Editor (ready)
89+
├── arena_3d_viewer.html # Arena 3D Viewer (ready)
7690
├── g41_pattern_editor.html # G4.1 pattern editor (placeholder)
7791
├── g6_pattern_editor.html # G6 pattern editor (placeholder)
7892
├── experiment_designer.html # Experiment Designer (placeholder)

0 commit comments

Comments
 (0)