Skip to content

Commit

Permalink
Add OpticalFiber module
Browse files Browse the repository at this point in the history
  • Loading branch information
ricktu288 committed Jul 27, 2024
1 parent c43507c commit 5a1bdbe
Show file tree
Hide file tree
Showing 11 changed files with 302 additions and 6 deletions.
5 changes: 3 additions & 2 deletions about.html
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ <h3><img src="icon128.png" alt="Icon" width="64" height="64"><br>
</p>
<p><strong>Main Author</strong></p>
<ul>
<li><a href="https://yitingtu.com">Yi-Ting Tu</a> (code, UI design, gallery, zh-TW and zh-CN translations)</li>
<li><a href="https://yitingtu.com">Yi-Ting Tu</a> (code, UI design, gallery, module, zh-TW and zh-CN translations)</li>
</ul>
<p><strong>Contributors</strong></p>
<ul>
<li>Stas Fainer (code, gallery)</li>
<li>Stas Fainer (code, gallery, module)</li>
<li>Wei-Fang Sun (code, UI design)</li>
<li>Paul Falstad (code, gallery)</li>
<li>James Garrard (code, gallery)</li>
Expand Down Expand Up @@ -166,6 +166,7 @@ <h3><img src="icon128.png" alt="Icon" width="64" height="64"><br>
<li>Georg Nadorff (gallery)</li>
<li>Rene (gallery)</li>
<li>Pedro (pt-BR translations)</li>
<li>josephernest (module)</li>
</ul>
(GitHub contributors first; others sorted chronologically.)

Expand Down
5 changes: 3 additions & 2 deletions cn/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ <h3><img src="../icon128.png" alt="Icon" width="64" height="64"><br>
</p>
<p><strong>主要作者</strong></p>
<ul>
<li><a href="https://yitingtu.com">凃懿庭 Yi-Ting Tu</a>(代码、介面设计、作品集、正体与简体中文翻译)</li>
<li><a href="https://yitingtu.com">凃懿庭 Yi-Ting Tu</a>(代码、介面设计、作品集、模块、正体与简体中文翻译)</li>
</ul>
<p><strong>贡献者</strong></p>
<ul>
<li>Stas Fainer(代码、作品集)</li>
<li>Stas Fainer(代码、作品集、模块</li>
<li>Wei-Fang Sun(代码、介面设计)</li>
<li>Paul Falstad(代码、作品集)</li>
<li>James Garrard(代码、作品集)</li>
Expand Down Expand Up @@ -167,6 +167,7 @@ <h3><img src="../icon128.png" alt="Icon" width="64" height="64"><br>
<li>Georg Nadorff(作品集)</li>
<li>Rene(作品集)</li>
<li>Pedro(巴西葡萄牙文翻译)</li>
<li>josephernest(模块)</li>
</ul>
(GitHub 贡献者优先;其余依时间排序。)

Expand Down
19 changes: 19 additions & 0 deletions cn/modules/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,25 @@
"d": "透镜之间的距离",
"N": "透镜的数量"
}
},
{
"id": "OpticalFiber",
"contributors": [
"josephernest",
"Yi-Ting Tu"
],
"title": "光纤",
"description": "<p>指定核心和包层折射率的线状光纤。</p>",
"points": [
"光纤的第一个端点",
"光纤的第二个端点(应与第一个点有相同的 \\(y\\))"
],
"params": {
"X": "核心的厚度",
"Y": "包层的厚度",
"n_1": "核心的折射率",
"n_2": "包层的折射率"
}
}
]
}
Expand Down
23 changes: 23 additions & 0 deletions cn/modules/modules.html
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,29 @@
<ul>
<li><code>f</code>: 透镜的焦距</li><li><code>d</code>: 透镜之间的距离</li><li><code>N</code>: 透镜的数量</li>
</ul>
</div><div class="row right-caption">
<img src="../../modules/OpticalFiber.png" alt="Thumbnail" class="img-rounded module-image" loading="lazy">
<div class="caption">
<p class="module-title">光纤 (<code>OpticalFiber</code>)<button class="btn btn-primary import-btn" onclick="window.parent.postMessage({rayOpticsModuleName: 'OpticalFiber'},'*');this.innerText='已导入';this.classList.remove('btn-primary');this.classList.add('btn-success');">导入</button></p>
<p class="module-contributor">josephernest, Yi-Ting Tu</p>
<span id="module-desc">
<p>指定核心和包层折射率的线状光纤。</p>
</span>
<button class="collapse-btn btn-link" data-toggle="collapse" data-target="#details-collapse-OpticalFiber">
规格
<span class="caret"></span>
</button>
</div>
</div>
<div id="details-collapse-OpticalFiber" class="collapse">
控制点顺序
<ol>
<li>光纤的第一个端点</li><li>光纤的第二个端点(应与第一个点有相同的 \(y\))</li>
</ol>
参数
<ul>
<li><code>X</code>: 核心的厚度</li><li><code>Y</code>: 包层的厚度</li><li><code>n_1</code>: 核心的折射率</li><li><code>n_2</code>: 包层的折射率</li>
</ul>
</div>

<h2>客制化</h2>
Expand Down
167 changes: 167 additions & 0 deletions modules/OpticalFiber.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
{
"version": 5,
"name": "OpticalFiber",
"modules": {
"OpticalFiber": {
"numPoints": 2,
"params": [
"X=1:1:100:80",
"Y=1:1:100:20",
"n_1=1:0.01:2:1.456",
"n_2=1:0.01:2:1.44"
],
"objs": [
{
"type": "Glass",
"path": [
{
"x": "`x_1`",
"y": "`y_1-X/2`",
"arc": false
},
{
"x": "`x_1`",
"y": "`y_1+X/2`",
"arc": false
},
{
"x": "`x_2`",
"y": "`y_2+X/2`",
"arc": false
},
{
"x": "`x_2`",
"y": "`y_2-X/2`",
"arc": false
}
],
"refIndex": "`n_1`"
},
{
"type": "Blocker",
"p1": {
"x": "`x_1`",
"y": "`y_1-X/2-Y`"
},
"p2": {
"x": "`x_2`",
"y": "`y_2-X/2-Y`"
}
},
{
"type": "Blocker",
"p1": {
"x": "`x_1`",
"y": "`y_1+X/2+Y`"
},
"p2": {
"x": "`x_2`",
"y": "`y_2+X/2+Y`"
}
},
{
"type": "Glass",
"path": [
{
"x": "`x_1`",
"y": "`y_1-X/2`",
"arc": false
},
{
"x": "`x_1`",
"y": "`y_1-X/2-Y`",
"arc": false
},
{
"x": "`x_2`",
"y": "`y_2-X/2-Y`",
"arc": false
},
{
"x": "`x_2`",
"y": "`y_2-X/2`",
"arc": false
}
],
"refIndex": "`n_2`"
},
{
"type": "Glass",
"path": [
{
"x": "`x_1`",
"y": "`y_1+X/2`",
"arc": false
},
{
"x": "`x_1`",
"y": "`y_1+X/2+Y`",
"arc": false
},
{
"x": "`x_2`",
"y": "`y_2+X/2+Y`",
"arc": false
},
{
"x": "`x_2`",
"y": "`y_2+X/2`",
"arc": false
}
],
"refIndex": "`n_2`"
}
]
}
},
"objs": [
{
"type": "ModuleObj",
"module": "OpticalFiber",
"points": [
{
"x": -2430,
"y": 440
},
{
"x": 460,
"y": 440
}
],
"params": {
"X": 80,
"Y": 20,
"n_1": 1.456,
"n_2": 1.44
}
},
{
"type": "PointSource",
"x": 910,
"y": 430,
"brightness": 3
},
{
"type": "CropBox",
"p1": {
"x": -2490,
"y": 360
},
"p4": {
"x": -2330,
"y": 520
},
"width": 300
}
],
"width": 1200,
"height": 700,
"rayModeDensity": 20.085536923187668,
"snapToGrid": true,
"gridSize": 10,
"origin": {
"x": 4920.548652877485,
"y": -448.74224272518126
},
"scale": 1.75
}
Binary file added modules/OpticalFiber.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions modules/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,25 @@
"d": "The distance between the lenses",
"N": "The number of lenses"
}
},
{
"id": "OpticalFiber",
"contributors": [
"josephernest",
"Yi-Ting Tu"
],
"title": "Optical Fiber",
"description": "<p>Line-shaped optical fiber with given core and cladding thickness and refractive indices.</p>",
"points": [
"The first endpoint of the optical fiber",
"The second endpoint of the optical fiber (should have the same \\(y\\) as the first point)"
],
"params": {
"X": "The thickness of the core",
"Y": "The thickness of the cladding",
"n_1": "The refractive index of the core",
"n_2": "The refractive index of the cladding"
}
}
]
}
Expand Down
23 changes: 23 additions & 0 deletions modules/modules.html
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,29 @@
<ul>
<li><code>f</code>: The focal length of the lenses</li><li><code>d</code>: The distance between the lenses</li><li><code>N</code>: The number of lenses</li>
</ul>
</div><div class="row right-caption">
<img src="OpticalFiber.png" alt="Thumbnail" class="img-rounded module-image" loading="lazy">
<div class="caption">
<p class="module-title">Optical Fiber (<code>OpticalFiber</code>)<button class="btn btn-primary import-btn" onclick="window.parent.postMessage({rayOpticsModuleName: 'OpticalFiber'},'*');this.innerText='Imported';this.classList.remove('btn-primary');this.classList.add('btn-success');">Import</button></p>
<p class="module-contributor">josephernest, Yi-Ting Tu</p>
<span id="module-desc">
<p>Line-shaped optical fiber with given core and cladding thickness and refractive indices.</p>
</span>
<button class="collapse-btn btn-link" data-toggle="collapse" data-target="#details-collapse-OpticalFiber">
Specification
<span class="caret"></span>
</button>
</div>
</div>
<div id="details-collapse-OpticalFiber" class="collapse">
Control point sequence
<ol>
<li>The first endpoint of the optical fiber</li><li>The second endpoint of the optical fiber (should have the same \(y\) as the first point)</li>
</ol>
Parameters
<ul>
<li><code>X</code>: The thickness of the core</li><li><code>Y</code>: The thickness of the cladding</li><li><code>n_1</code>: The refractive index of the core</li><li><code>n_2</code>: The refractive index of the cladding</li>
</ul>
</div>

<h2>Customization</h2>
Expand Down
5 changes: 3 additions & 2 deletions tw/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ <h3><img src="../icon128.png" alt="Icon" width="64" height="64"><br>
</p>
<p><strong>主要作者</strong></p>
<ul>
<li><a href="https://yitingtu.com">凃懿庭 Yi-Ting Tu</a>(程式碼、介面設計、作品集、正體與簡體中文翻譯)</li>
<li><a href="https://yitingtu.com">凃懿庭 Yi-Ting Tu</a>(程式碼、介面設計、作品集、模組、正體與簡體中文翻譯)</li>
</ul>
<p><strong>貢獻者</strong></p>
<ul>
<li>Stas Fainer(程式碼、作品集)</li>
<li>Stas Fainer(程式碼、作品集、模組</li>
<li>Wei-Fang Sun(程式碼、介面設計)</li>
<li>Paul Falstad(程式碼、作品集)</li>
<li>James Garrard(程式碼、作品集)</li>
Expand Down Expand Up @@ -167,6 +167,7 @@ <h3><img src="../icon128.png" alt="Icon" width="64" height="64"><br>
<li>Georg Nadorff(作品集)</li>
<li>Rene(作品集)</li>
<li>Pedro(巴西葡萄牙文翻譯)</li>
<li>josephernest(模組)</li>
</ul>
(GitHub 貢獻者優先;其餘依時間排序。)

Expand Down
19 changes: 19 additions & 0 deletions tw/modules/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,25 @@
"d": "透鏡之間的距離",
"N": "透鏡的數量"
}
},
{
"id": "OpticalFiber",
"contributors": [
"josephernest",
"Yi-Ting Tu"
],
"title": "光纖",
"description": "<p>指定核心和包層折射率的線狀光纖。</p>",
"points": [
"光纖的第一個端點",
"光纖的第二個端點(應與第一個點有相同的 \\(y\\))"
],
"params": {
"X": "核心的厚度",
"Y": "包層的厚度",
"n_1": "核心的折射率",
"n_2": "包層的折射率"
}
}
]
}
Expand Down
Loading

0 comments on commit 5a1bdbe

Please sign in to comment.