# 光校資料結構 > 這份筆記說明 **`data/data.json`** 的欄位與維度,方便日後擴充、除錯。 ## 1. 檔案概覽 * **資料夾**:`/data` * **檔案名稱**:`data.json` * **用途**:儲存每支舞衣的 LED 動畫資料 * **產生流程** * `generateblankdata.py` 第 10–38 行:初始化預設 JSON 骨架 * `editor.py` 第 115–150 行:呼叫 `savejson()` 將編輯結果寫入檔案 --- ## 2. JSON 骨架 ```json { "color": ["#000000"], "colornames": ["黑"], "frames": [[[0]]], "frametimes": [0] } ``` --- ## 3. 欄位說明 | 欄位 | 型別 / 維度 | 說明 | | ------------ | -------------------------- | --------------------- | | `color` | `string[]`,長度 = 色票數 | 六位 HEX,定義色票 | | `colornames` | `string[]`,與 `color` 等長 | 色票對應的中文名稱 | | `frames` | `int[][][]`,`[舞者][幀][LED]` | 存每位舞者在各幀的色票索引 | | `frametimes` | `int[]`,長度 = 幀數 | 每幀開始時間 (ms),相鄰差值即持續時間 | ### `frames` 維度示意 ``` frames └─ dancer 0 └─ frame 0 └─ [0, 1, 1, 0, ...] // 第 n 顆 LED 使用 color[n] ``` --- ## 4. 延伸檔案 | 檔案名稱 | 功能 | 互動位置 | | -------------- | ----------------- | --------------------- | | `pos.json` | 定義 LED 在服裝上的物理座標 | `dancer.js` 第 52–80 行 | | `setting.json` | 專案設定 (FPS、LED 數等) | `main.js` 第 20–45 行 | > 若未來新增欄位,請同步修改 `generateblankdata.py` 與 `editor.py`,確保初始化與儲存流程一致。
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up