Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* text=auto eol=lf
*.png binary
*.jpg binary
*.jpeg binary
18 changes: 18 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: validate

on:
push:
pull_request:

permissions:
contents: read

jobs:
repository:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: python scripts/validate_repository.py
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
__pycache__/
*.pyc
*.blend1
*.blend2
*.log
.DS_Store
Thumbs.db
vendor-cad/
*.step
*.stp
10 changes: 10 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cff-version: 1.2.0
message: "If OpticalModeler helps your optical-path workflow, cite this repository."
title: "OpticalModeler: A Physically Auditable Blender Optical-Path Skill"
type: software
authors:
- family-names: "telux"
repository-code: "https://github.com/k-telux/OpticalModeler"
license: MIT
version: 1.0.0
date-released: 2026-07-15
11 changes: 11 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Contributing

Contributions are welcome when they improve transferable optical, mechanical, or evidence rules.

1. Open an issue describing the experimental role, hardware family, failure mode, and evidence.
2. Keep one rule per change and distinguish universal guidance from scene-specific measurements.
3. Add or update a representative case only when the saved-scene readback and visual evidence agree.
4. Do not commit vendor CAD, credentials, private laboratory documents, raw agent conversations, or absolute local paths.
5. Run `python scripts/validate_repository.py` before opening a pull request.

Rule changes must preserve fail-closed semantics. If the evidence cannot prove an assembly, use `UNVERIFIED`; do not weaken a global gate to make one example pass.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 k-telux

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
45 changes: 45 additions & 0 deletions README.ja.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<div align="center">

# OpticalModeler

**2D 光学回路図から、物理的に監査可能な Blender 光学テーブルへ。**

[English](README.md) · [简体中文](README.zh-CN.md) · [日本語](README.ja.md)

[![Validation](https://github.com/k-telux/OpticalModeler/actions/workflows/validate.yml/badge.svg)](https://github.com/k-telux/OpticalModeler/actions/workflows/validate.yml)
[![Agent Skills](https://img.shields.io/badge/Agent%20Skills-compatible-111827)](https://agentskills.io/)
[![License: MIT](https://img.shields.io/badge/License-MIT-2563EB.svg)](LICENSE)

<img src="examples/g1g2/output/v18_nature_hero_graphite_final_4k_preview.jpg" width="100%" alt="物理監査済み G1/G2 光学テーブルの Nature スタイルレンダー">

</div>

OpticalModeler は、実験室の光路を Blender で再構築する証拠優先の Agent Skill です。光学トポロジー、実開口、メーカー CAD、締結部、荷重経路、ファイバー配線、証拠の系譜を必須の受け入れゲートとして扱います。

> **独立したコミュニティプロジェクトです。** Thorlabs, Inc. との提携・承認関係はありません。製品名は互換ハードウェアの識別にのみ使用します。レンダリングされた CAD は、機械・分光・レーザー安全・実験性能の認証ではありません。

## 主な特徴

| 物理アセンブリ | 光学的整合性 | Fail-closed 証拠 |
|---|---|---|
| ポスト優先配置、実テーブル穴、締結部、荷重経路。 | 開口中心、ビームスプリッター面、分岐連続性、内部細線ビーム、ファイバー曲率。 | 再オープン監査、レイ/BVH 検査、ハッシュ、マニフェスト、注釈付きレンダー、明示的な状態。 |

## 2D 入力 → 検証済み 3D 出力

| 元の光学回路図 | 注釈付き 3D 再構築 |
|---|---|
| <img src="examples/g1g2/input/fig_s17_componentlibrary_g1g2.png" width="100%" alt="元の G1/G2 回路図"> | <img src="examples/g1g2/output/v18_nature_complete_top_annotated_final_4k_preview.jpg" width="100%" alt="3D 光学テーブルの注釈付き上面図"> |

匿名化済みの [G1/G2 ケーススタディ](examples/g1g2/README.md)には、2D 入力、3D レンダー、機械可読の受け入れ記録が含まれます。メーカー STEP/CAD と大容量の実験用 `.blend` は Git に含めません。

## インストール

```bash
npx skills add k-telux/OpticalModeler
```

または `skills/thorlabs-blender-optical-path` を Agent の skills ディレクトリへコピーします。

英語版 Skill が技術的な正本です。[日本語 Skill](i18n/ja/SKILL.md) は日本語の入口を提供し、形状・証拠ルールは英語版を継承します。

Maintainer: [telux](https://github.com/k-telux) · [MIT License](LICENSE)
89 changes: 88 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,88 @@
# OpticalModeler
<div align="center">

# OpticalModeler

**From 2D photonics schematics to physically auditable Blender optical tables.**

[English](README.md) · [简体中文](README.zh-CN.md) · [日本語](README.ja.md)

[![Validation](https://github.com/k-telux/OpticalModeler/actions/workflows/validate.yml/badge.svg)](https://github.com/k-telux/OpticalModeler/actions/workflows/validate.yml)
[![Agent Skills](https://img.shields.io/badge/Agent%20Skills-compatible-111827)](https://agentskills.io/)
[![Blender](https://img.shields.io/badge/Blender-4.x-E87D0D?logo=blender&logoColor=white)](https://www.blender.org/)
[![License: MIT](https://img.shields.io/badge/License-MIT-2563EB.svg)](LICENSE)

<img src="examples/g1g2/output/v18_nature_hero_graphite_final_4k_preview.jpg" width="100%" alt="Nature-style render of a physically audited G1/G2 optical table">

</div>

OpticalModeler is an evidence-first Agent Skill for reconstructing laboratory optical paths in Blender. It treats optical topology, real apertures, manufacturer CAD, fasteners, load paths, fiber routing, and artifact lineage as hard acceptance gates—not decorative details.

> **Independent community project.** Not affiliated with or endorsed by Thorlabs, Inc. Product names identify compatible hardware only. A rendered CAD assembly is not a mechanical, spectral, laser-safety, or experimental certification.

## Why OpticalModeler

| Physical assembly | Optical truth | Fail-closed evidence |
|---|---|---|
| Post-first placement, real table holes, fasteners, load paths, and supported hardware. | Centered apertures, splitter planes, branch continuity, internal fine beams, and fiber bend constraints. | Reopened-scene audits, ray/BVH checks, hashes, manifests, annotated renders, and explicit `PASS` / `BLOCKED` / `UNVERIFIED` states. |

## 2D input → verified 3D output

| Original schematic | Annotated 3D reconstruction |
|---|---|
| <img src="examples/g1g2/input/fig_s17_componentlibrary_g1g2.png" width="100%" alt="Original G1/G2 schematic"> | <img src="examples/g1g2/output/v18_nature_complete_top_annotated_final_4k_preview.jpg" width="100%" alt="Annotated top view of the reconstructed optical table"> |

The sanitized [G1/G2 case study](examples/g1g2/README.md) includes the original 2D input, editorial 3D renders, and a machine-readable acceptance record. Vendor STEP/CAD files and the large laboratory `.blend` are intentionally excluded.

## Install

With a compatible Agent Skills installer:

```bash
npx skills add k-telux/OpticalModeler
```

Or copy `skills/thorlabs-blender-optical-path` into your agent's skills directory.

## Quick start

```text
Use $thorlabs-blender-optical-path to reconstruct this pump-probe schematic in Blender and produce a fail-closed physical audit.
```

```text
Audit this optical table for real post/load paths, centered apertures, beam clearance, fiber bend radius, and stale evidence.
```

The skill guides the agent to:

1. map schematic nodes to experimental roles, real assets, ports, and support paths;
2. solve optical centers, surfaces, splitter planes, and branch continuity;
3. assemble hardware post-first from verified table holes;
4. prove one representative instance before propagation;
5. reopen the saved scene and run mesh, ray, and BVH checks;
6. package visual, GLB, report, manifest, hash, and rule-compliance evidence consistently.

## Repository map

```text
skills/thorlabs-blender-optical-path/ canonical English skill
i18n/zh-CN/ Simplified Chinese edition
i18n/ja/ Japanese edition
rules/ reusable project-memory template
examples/g1g2/ sanitized 2D-to-3D case study
scripts/validate_repository.py dependency-free release gate
```

The English skill is the technical source of truth. Localized editions are maintained as language entry points and explicitly defer to the canonical geometry and evidence references.

## Validation and limits

- Manufacturer CAD is an asset source, never proof of correct assembly.
- Free-space rays, guided fiber, and electrical cables remain semantically distinct.
- Whole-project success requires an active-rule compliance matrix; scoped evidence stays `PARTIAL/SCOPED`.
- The repository excludes third-party CAD, private paths, oversized Blend files, and unsupported real-world performance claims.
- Every release is checked for skill metadata, links, file size, privacy leaks, forbidden CAD binaries, and acceptance-state consistency.

See [CONTRIBUTING.md](CONTRIBUTING.md) for rule proposals and case-study submissions, and [SECURITY.md](SECURITY.md) for responsible disclosure.

Maintained by [telux](https://github.com/k-telux). Released under the [MIT License](LICENSE).
51 changes: 51 additions & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<div align="center">

# OpticalModeler

**从二维光路示意图到可物理审计的 Blender 光学平台。**

[English](README.md) · [简体中文](README.zh-CN.md) · [日本語](README.ja.md)

[![Validation](https://github.com/k-telux/OpticalModeler/actions/workflows/validate.yml/badge.svg)](https://github.com/k-telux/OpticalModeler/actions/workflows/validate.yml)
[![Agent Skills](https://img.shields.io/badge/Agent%20Skills-compatible-111827)](https://agentskills.io/)
[![License: MIT](https://img.shields.io/badge/License-MIT-2563EB.svg)](LICENSE)

<img src="examples/g1g2/output/v18_nature_hero_graphite_final_4k_preview.jpg" width="100%" alt="经过物理审计的 G1/G2 光学平台 Nature 风格渲染">

</div>

OpticalModeler 是一个证据优先的 Agent Skill,用于在 Blender 中重建实验室光路。它把光路拓扑、真实孔径、厂家 CAD、紧固件、承载链、光纤布线和证据血缘作为硬性验收门槛,而不是装饰细节。

> **独立社区项目。** 与 Thorlabs, Inc. 无隶属或背书关系。产品名称仅用于识别兼容硬件。渲染的 CAD 装配不构成机械、光谱、激光安全或实验性能认证。

## 核心能力

| 物理装配 | 光学真实性 | Fail-closed 证据 |
|---|---|---|
| 立柱优先、真实台孔、紧固件、承载链与受支撑硬件。 | 孔径居中、分束平面、支路连续、内部细束与光纤弯曲约束。 | 重开场景审计、光线/BVH 检查、哈希、清单、标注渲染与明确状态。 |

## 二维输入 → 已验证三维输出

| 原始光路图 | 标注后的三维重建 |
|---|---|
| <img src="examples/g1g2/input/fig_s17_componentlibrary_g1g2.png" width="100%" alt="原始 G1/G2 光路图"> | <img src="examples/g1g2/output/v18_nature_complete_top_annotated_final_4k_preview.jpg" width="100%" alt="三维光学平台标注俯视图"> |

脱敏的 [G1/G2 案例](examples/g1g2/README.md)包含二维原始输入、编辑级三维渲染和机器可读验收记录。厂家 STEP/CAD 与大型实验 `.blend` 不进入 Git。

## 安装

```bash
npx skills add k-telux/OpticalModeler
```

也可以把 `skills/thorlabs-blender-optical-path` 复制到 Agent 的 skills 目录。

## 调用示例

```text
使用 $thorlabs-blender-optical-path 把这张 pump-probe 示意图重建为 Blender 光学平台,并生成 fail-closed 物理审计。
```

英文 Skill 是技术权威源;[简体中文 Skill](i18n/zh-CN/SKILL.md)提供中文入口,并明确继承英文版的几何与证据合同。仓库还包含[项目规则模板](rules/OPTICAL_PATH_PROJECT_MEMORY_TEMPLATE.md)和无第三方依赖的发布验证器。

维护者:[telux](https://github.com/k-telux) · [MIT License](LICENSE)
5 changes: 5 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Security and safety

Report credential exposure or unsafe automation privately through GitHub's security-advisory interface.

This project produces modeling and audit guidance, not laser-safety, structural, electrical, or manufacturer certification. Validate real hardware with the relevant datasheets, laboratory procedures, qualified personnel, and calibrated measurements.
12 changes: 12 additions & 0 deletions examples/g1g2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# G1/G2 reconstruction example

This sanitized case study shows the transformation from a 2D pump-probe/G1/G2 schematic to a verified editorial 3D optical-table render.

| Stage | Artifact |
|---|---|
| 2D input | [fig_s17_componentlibrary_g1g2.png](input/fig_s17_componentlibrary_g1g2.png) |
| 3D hero | [v18_nature_hero_graphite_final_4k_preview.jpg](output/v18_nature_hero_graphite_final_4k_preview.jpg) |
| Annotated top view | [v18_nature_complete_top_annotated_final_4k_preview.jpg](output/v18_nature_complete_top_annotated_final_4k_preview.jpg) |
| Acceptance | [v18_nature_final_acceptance.json](evidence/v18_nature_final_acceptance.json) |

The example proves workflow output and evidence packaging. It does not ship or license the source laboratory Blend or manufacturer CAD, and it does not certify real-world mechanical fit or spectral performance.
26 changes: 26 additions & 0 deletions examples/g1g2/evidence/v18_nature_final_acceptance.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"schema": "g1g2_v18_public_example_acceptance_v1",
"status": "PASS_V18_NATURE_FINAL_VERIFIED",
"geometry_revision": "v18 fixed STEP leaf-solid mesh; geometry frozen during Nature rendering",
"render": {
"engine": "Cycles",
"samples": 96,
"master_resolution": [4096, 2304],
"annotated_resolution": [4096, 3072],
"public_artifacts": "compressed preview copies"
},
"gates": {
"render_geometry_signature_unchanged": true,
"opencv_image_qa": "PASS_V18_NATURE_IMAGE_QA",
"saved_blend_reopen": "PASS_V18_NATURE_FINAL_REOPEN",
"independent_publication_review": "PASS_3_OF_3_NATURE_REVIEWERS",
"p0_count": 0,
"p1_count": 0
},
"public_release_limits": {
"vendor_cad_included": false,
"laboratory_blend_included": false,
"mechanical_or_spectral_certification": false
},
"blockers": []
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions i18n/ja/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: thorlabs-blender-optical-path-ja
description: 2D 光学回路図とメーカー CAD から、物理的に妥当な Blender 光学テーブルを構築・監査・改訂します。Thorlabs 互換ミラーマウント、レンズマウント、ビームスプリッター、ポスト、ファイバー結合、開口、検出器、光学トポロジー、fail-closed 証拠、Nature スタイル描画に使用します。
---

# Thorlabs Blender Optical Path

2D 回路図を、説明可能で独立監査可能な Blender 光学テーブルへ変換します。

英語版を技術的な正本とします。形状作業の前に `../../skills/thorlabs-blender-optical-path/references/physical-gates.md`、合否判定の前に `evidence-contract.md`、既存シーンの改訂では `history-derived-rules.md`、実例では `project-case-study.md` を読みます。

## 権限と改訂

1. システム制約、最新のユーザー指示・注釈画像、active なプロジェクト規則、本 Skill、旧成果物・旧 PASS の順に優先します。
2. 合格済み成果物を凍結し、修正ごとに新しい revision を作ります。
3. 共有 Blender generator は single-writer とし、補助 agent は既定で read-only です。
4. 画像指摘を object family、world-space geometry、数値ゲート、必要証拠へ変換します。
5. 実形状で証明できない場合は `UNVERIFIED` または `BLOCKED` とします。CAD の存在、process success、AABB 接触、自己申告は証拠ではありません。

## コア手順

1. `schematic node -> experimental role -> real asset -> optical/fiber/electrical ports -> support path` を作成します。
2. 全 branch、部品、光線高さ、開口、検出端点を列挙します。
3. 公式 CAD の型番、URL、SHA-256、scale、bbox、local axis/normal、aperture、provenance を記録します。
4. 光学中心、鏡面、分割面、反射、branch continuity を先に解きます。
5. 実テーブル穴から fastener、clamp、holder、post、mount、device を post-first で組みます。
6. 共通の配置原因を修正し、代表 1 台を証明してから展開し、保存後に全コピーを再監査します。
7. beauty render より先に明るい mechanical/axial/cutaway 監査画像を作ります。
8. reopen、ray/BVH、OpenCV、GLB reimport、report、manifest、hash、active-rule matrix を完了します。

自由空間光、ガイドファイバー、電気ケーブルは別 family とします。開口は実際に開いていなければなりません。物理 PASS 後にのみ Nature スタイルの材質、照明、カメラ、注釈を変更できます。

`PASS` は全適用ゲートの新しい証拠、`PARTIAL/SCOPED` は限定範囲、`UNVERIFIED` は証拠不足、`BLOCKED` は既知の失敗を表します。
Loading
Loading