-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpolarization.html
More file actions
173 lines (161 loc) · 7.4 KB
/
polarization.html
File metadata and controls
173 lines (161 loc) · 7.4 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Light Polarization Simulation in 3D</title>
<link rel="icon" type="image/png" href="https://raw.githubusercontent.com/visuphy/visuphy.github.io/refs/heads/main/favicon.png">
<!-- Font Awesome CDN -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" />
<!-- Link to the updated external style sheet -->
<link rel="stylesheet" href="style.css">
<!-- Header & Footer Styles -->
<link rel="stylesheet" href="/header.css">
<link rel="stylesheet" href="/footer.css">
<!-- Library Includes -->
<script src="complex.min.js"></script>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
<script src="https://unpkg.com/three@0.128.0/examples/js/controls/OrbitControls.js"></script>
<script src="https://unpkg.com/three@0.128.0/examples/js/renderers/CSS2DRenderer.js"></script>
</head>
<body>
<!-- Dynamic Header Include -->
<div id="header-placeholder"></div>
<!-- Modified H1 -->
<h1>
<!-- Wrapper for title and copyright -->
<div class="h1-title-group">
<span class="h1-title">Light Polarization Simulation in 3D</span>
<!-- ADDED COPYRIGHT ELEMENT -->
<div class="h1-copyright">
© 2025 <a href="https://github.com/visuphy" target="_blank" title="Visit VisuPhy on GitHub">VisuPhy</a>
</div>
<!-- END ADDED COPYRIGHT ELEMENT -->
</div>
<!-- Updated h1-info structure -->
<div class="h1-info">
<div class="info-item">
<span class="info-label">About and discussion</span>
<div class="info-content">
<a href="." target="_blank" title="About and Discussion">
<i class="fa-solid fa-file-invoice"></i>
</a>
</div>
</div>
<div class="info-item">
<span class="info-label">Source</span>
<div class="info-content">
<a href="https://github.com/visuphy/Polarization" target="_blank" title="View Source on GitHub">
<i class="fab fa-github"></i>
</a>
</div>
</div>
<div class="info-item">
<span class="info-label">Original Author</span>
<div class="info-content">
<a href="https://github.com/Hussein-Tofaili" target="_blank">Hussein-Tofaili</a>
</div>
</div>
<div class="info-item">
<span class="info-label">Other Contributors</span>
<div class="info-content">
<a href="" target="_blank">none</a>
</div>
</div>
<!-- REMOVED COPYRIGHT ITEM FROM HERE -->
</div>
</h1>
<div class="container">
<!-- START: New Wrapper for Control Elements -->
<div class="control-column">
<!-- REMOVED Overall H2 Heading -->
<!-- Box for Adding Elements -->
<div class="add-element-box">
<h3>Add New Element</h3>
<div class="add-element-controls">
<label for="add-element">Select Type:</label>
<select id="add-element">
<option value="Linear Polarizer">Linear Polarizer (Angle θ)</option>
<option value="Mirror">Mirror</option>
<option value="HWP">Half-Wave Plate (HWP)</option>
<option value="QWP">Quarter-Wave Plate (QWP)</option>
<option value="General Waveplate">General Waveplate (Linear Retarder)</option>
<option value="Arbitrary Birefringent">Arbitrary Birefringent (Elliptical Retarder)</option>
<option value="Faraday Rotator">Faraday Rotator (Angle θ_rot)</option>
</select>
<button id="add-element-btn">Add</button>
</div>
</div>
<!-- Box for Optical Path Table -->
<div class="optical-path-box">
<div class="optical-path-header">
<h3>Optical Path</h3>
<div class="table-actions">
<button id="export-btn" title="Export current setup to XML file">
<i class="fa-solid fa-file-export"></i> Export Setup
</button>
<button id="import-btn" title="Import setup from XML file (replaces current)">
<i class="fa-solid fa-file-import"></i> Import Setup
</button>
<input type="file" id="import-file-input" accept=".xml,application/xml" style="display: none;">
</div>
</div>
<table id="elements-table">
<thead>
<tr>
<th>Type</th>
<th>Position (z)</th>
<th>Properties</th>
<th>Ellipse</th>
<th>Output Vector [Ex, Ey]</th>
<th>Intensity</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<!-- Table rows will be added here -->
</tbody>
</table>
<p>Note: Angles/Retardation in degrees.</p>
</div>
</div>
<!-- END: New Wrapper for Control Elements -->
<div class="visualization">
<h2>3D Visualization & Intensity</h2>
<div class="theme-toggle-container">
<button id="theme-toggle-btn" title="Toggle Canvas Theme (Light/Dark)">
<i class="fa-solid fa-circle-half-stroke"></i> Theme
</button>
</div>
<div id="canvas-container">
<canvas id="visualizationCanvas"></canvas>
<div id="css2d-renderer"></div>
</div>
<div class="visualization-controls">
<button id="play-pause-btn">
<i class="fa-solid fa-play"></i> Play
</button>
<span style="margin-left: 15px;">Show:</span>
<input type="checkbox" id="show-labels-checkbox" checked>
<label for="show-labels-checkbox">Labels</label>
<input type="checkbox" id="show-efield-checkbox" checked>
<label for="show-efield-checkbox">E-Field</label>
<input type="checkbox" id="show-envelope-checkbox" checked>
<label for="show-envelope-checkbox">Envelope</label>
</div>
<div class="plot-controls" style="margin-top: 15px;">
<input type="checkbox" id="show-elements-checkbox" checked>
<label for="show-elements-checkbox">Show Element Positions on Plot</label>
</div>
<div id="intensityPlot" style="width:100%;height:250px;"></div>
</div>
</div>
<script src="script.js"></script>
<script src="interactiveCanvas.js"></script>
<!-- Dynamic Footer Include -->
<div id="footer-placeholder"></div>
<!-- Script to include Header/Footer -->
<script src="/layout.js" defer></script>
</body>
</html>