Skip to content

A toolbox of film styles made in code for Claude Code: 66 ready to use, and your own. Each style is a style prompt plus a demo film made entirely in code by Claude Opus 5.5, with no video model. By Lemomo. · 一套用代码做片的风格工具箱:66 种现成风格,也能做出你自己的

Checkpoint before the review fixes: 4 scene styles (engraving, hologram-hud, midcentury-toon, silkscreen-poster), readcheck and render slots, 43-style metadata

lemomo-ai00343a26ccfd
diff --git a/.gitignore b/.gitignore
index d8f7939..85de525 100644
--- a/.gitignore
+++ b/.gitignore
@@ -165,3 +165,7 @@ styles/*/PRODUCTION_LOG*
# 宣传物料(发帖用海报、预告片、教程片),只留本地,不上传 GitHub
/docs/social/
+
+# 整机渲染限流锁(core/render/slot.mjs)
+.render_slots/
+batch/.render_slots/
diff --git a/AGENTS.md b/AGENTS.md
index e4f4b40..962f183 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -10,6 +10,8 @@ This repository is a library of film styles. Each style is a prompt (`styles/<sl
**The style is fixed; the content is the user's.** From a `STYLE.md`, keep the look, the motion and camera language, the sound and music, and the directing craft. The content comes from the user's topic: the story and its shape, the characters, the settings, the data and how it is charted. Many choices in a `STYLE.md` were made for our demo's story, such as a line chart for a temperature series. When one doesn't fit the user's topic, use what fits, and don't bend the topic to match the demo. The same goes for the beat tables: the story arc in §2 and the beat-by-beat camera in §5 show how our demo used the style. Read them as grammar (which kind of move serves which kind of moment), then write a new arc and shot list from the user's story.
+**Scene styles.** Some styles have a practical scene as their demo instead of a story: a set-up guide, a spec walkthrough, a museum plate, a trail guide. Their `STYLE.md` §2 is **Use cases** (which jobs the style does, with shot structure, information order and reading time for each), and §11 **Swap in your content** says how the demo reads every word and number from `demo/content.json`. When the user's job matches one of those use cases, start from that demo's structure and pacing and write the user's own content. Still direct it: pick the camera, the order in which information arrives and the sound for the user's material, and don't just fill in the demo's fields.
+
**Finding the style.** Users name a style by its gallery name in English or Chinese ("Impasto Oil Painting", "油画厚涂") or by its folder (`impasto`). Look it up in [`styles/README.md`](styles/README.md), which maps every name to its folder. If nothing matches clearly, show the closest two or three and ask.
If the user hasn't picked a style:
@@ -18,14 +20,14 @@ If the user hasn't picked a style:
- Link the gallery, where every style has its demo film: https://lemomo-ai.github.io/lemo-opuscar/
<!-- style-list:start -->
-All 39 styles · 全部风格:
+All 43 styles · 全部风格:
- **手绘与绘画 Hand-drawn & Painting** (7): 蜡笔儿童绘本 Crayon Picture Book, 水彩笔刷 Watercolor Brush, 中国水墨 Chinese Ink Wash, 油画厚涂 Impasto Oil Painting, 一笔画 One-line Drawing, 白板讲解 Whiteboard Explainer, 钢笔淡彩 Urban Sketch · Pen & Wash
- **东方传统 East Asian Traditions** (4): 皮影戏 Shadow Puppetry, 浮世绘 Ukiyo-e, 红色窗花剪纸 Red Paper-cut, 纸雕灯影 Paper-cut Lightbox
-- **印刷与版画 Print & Printmaking** (3): Risograph 丝网印刷 Risograph Print, 复古半调案卷 Halftone Dossier, 木刻版画 Woodcut Print
+- **印刷与版画 Print & Printmaking** (5): Risograph 丝网印刷 Risograph Print, 复古半调案卷 Halftone Dossier, 木刻版画 Woodcut Print, 铜版画 Copperplate Engraving, 丝印旅行海报 Silkscreen Travel Poster
- **图形与排版 Graphic & Type** (7): 瑞士动态排版 Swiss Motion Graphics, 60s 间谍片头 60s Spy Title Sequence, 装饰艺术 Art Deco, 蓝图 / 工程制图 Blueprint, 彩色玻璃窗 Stained Glass, 象形运动图形 Pictogram Motion, ASCII / CRT 终端 ASCII / CRT Terminal
-- **信息与发布 Information & Keynote** (4): 数据叙事 Data Storytelling, 等距信息图 Isometric Infographic, 暗色科技发布 Dark Tech Keynote, 活体实机录屏 Living Screencast
-- **卡通与动画 Cartoon & Anime** (3): 1930s 橡皮管卡通 1930s Rubber Hose Cartoon, 80 年代赛璐璐动画 80s Cel Anime, 科幻情景喜剧卡通 Sci-Fi Sitcom Toon
+- **信息与发布 Information & Keynote** (5): 数据叙事 Data Storytelling, 等距信息图 Isometric Infographic, 暗色科技发布 Dark Tech Keynote, 活体实机录屏 Living Screencast, 科幻全息界面 Sci-fi Hologram HUD
+- **卡通与动画 Cartoon & Anime** (4): 1930s 橡皮管卡通 1930s Rubber Hose Cartoon, 80 年代赛璐璐动画 80s Cel Anime, 科幻情景喜剧卡通 Sci-Fi Sitcom Toon, 50s 扁平卡通 Mid-century Cartoon
- **游戏 Games** (4): 16-bit 像素 RPG 16-bit Pixel RPG, HD-2D, 微游戏快闪(瓦里奥制造式) Microgame Frenzy, 综艺节奏扁平 Game Show Flat
- **电影与时代 Cinema & Eras** (2): 1920s 默片 1920s Silent Film, 后室 / 新怪谈 Liminal Found Footage
- **材质与 3D Materials & 3D** (5): 积木玩具 Brick Toy, 纸片立体书 Paper Pop-up Book, 移轴微缩 Tilt-Shift Miniature, 低多边形等距 Low-poly Isometric Island, 玻璃质感产品 Glass Product Render
diff --git a/README.md b/README.md
index 488e8f6..fdc0190 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
# Lemo-Opuscar
-**39 film styles, each with a short film made entirely in code.**<br>
-**39 种影片风格,每种都配一支完全用代码做出来的短片。**
+**43 film styles, each with a short film made entirely in code.**<br>
+**43 种影片风格,每种都配一支完全用代码做出来的短片。**
Pick a style, bring your own story, and let your coding agent direct the film.<br>
选一个风格,带上你自己的故事,让你的编程 agent 来当导演。
@@ -39,7 +39,7 @@ I'm **Lemomo** ([@lemomo-ai](https://github.com/lemomo-ai)). More about me on my
>
> **这不是一个 awesome 合集。** 这里所有的片子都是我自己用 Claude Opus 5.5 做的。风格是按 Opus 5.5 调出来的,换成其他模型不保证能做出同样的效果。
-![All 39 styles · 全部 39 个风格](docs/cover.jpg)
+![All 43 styles · 全部 43 个风格](docs/cover.jpg)
Every film was directed, drawn, scored and mixed by an AI agent writing code: canvas and WebGL pages rendered frame by frame, original music from free sample libraries, local text-to-speech. No video generation, no stock footage.
@@ -142,6 +142,10 @@ Click a frame for its `STYLE.md` · 点图片看它的 `STYLE.md`。
<td width="33%" valign="top"><a href="styles/halftone-dossier/STYLE.md"><img src="docs/frames/halftone-dossier.jpg" alt="Halftone Dossier"></a><br><b>Halftone Dossier</b> · 复古半调案卷<br><i>Case File: Chubby</i><br><sub>A chubby orange cat stands trial for testing gravity and 4 a.m. parkour, and walks free.<br>橘猫胖橘被立案审查:测试重力、凌晨跑酷,最后无罪释放。</sub></td>
<td width="33%" valign="top"><a href="styles/woodcut/STYLE.md"><img src="docs/frames/woodcut.jpg" alt="Woodcut Print"></a><br><b>Woodcut Print</b> · 木刻版画<br><i>The Bell Founder</i><br><sub>A village spends a whole winter casting one bell; the first time it rings, the snow stops.<br>村子用一整个冬天铸一口钟,钟声第一次响起,雪停了。</sub></td>
</tr>
+<tr>
+<td width="33%" valign="top"><a href="styles/engraving/STYLE.md"><img src="docs/frames/engraving.jpg" alt="Copperplate Engraving"></a><br><b>Copperplate Engraving</b> · 铜版画<br><i>The Honeybee, Plate VII</i><br><sub>A natural-history plate engraves itself: the burin cuts the copper, the bee builds up line by line, and a watercolour wash brings it to life.<br>一张博物志图版自己刻出来:雕刀推开铜版,蜜蜂一线线成形,最后手工水彩上色。</sub></td>
+<td width="33%" valign="top"><a href="styles/silkscreen-poster/STYLE.md"><img src="docs/frames/silkscreen-poster.jpg" alt="Silkscreen Travel Poster"></a><br><b>Silkscreen Travel Poster</b> · 丝印旅行海报<br><i>Three Trails</i><br><sub>Three trail posters are screen-printed one ink at a time, then climbed in one long take from noon to dusk.<br>三条步道各一张丝印海报,一色一刮印出来,再沿山脊一镜到底从正午爬到黄昏。</sub></td>
+</tr>
</table>
### Graphic & Type · 图形与排版
@@ -172,6 +176,7 @@ Click a frame for its `STYLE.md` · 点图片看它的 `STYLE.md`。
</tr>
<tr>
<td width="33%" valign="top"><a href="styles/living-screencast/STYLE.md"><img src="docs/frames/living-screencast.jpg" alt="Living Screencast"></a><br><b>Living Screencast</b> · 活体实机录屏<br><i>Clawd Moves In</i><br><sub>Clawd, the Claude Code pixel mascot, hops out of the terminal into the Claude app and acts out plan mode, diff comments and self-checks in a one-take screencast.<br>像素小人 Clawd 跳出终端、搬进 Claude 应用,在一镜到底的录屏里演示 Plan 模式、diff 评论和自检。</sub></td>
+<td width="33%" valign="top"><a href="styles/hologram-hud/STYLE.md"><img src="docs/frames/hologram-hud.jpg" alt="Sci-fi Hologram HUD"></a><br><b>Sci-fi Hologram HUD</b> · 科幻全息界面<br><i>Volt · Spec Scan</i><br><sub>An e-bike is scanned into a hologram; target boxes lock onto the battery, motor and brakes, and each spec rolls into place.<br>一辆电助力车被扫描成全息线框,目标框依次锁定电池、电机、刹车,参数逐个滚到真值。</sub></td>
</tr>
</table>
@@ -183,6 +188,9 @@ Click a frame for its `STYLE.md` · 点图片看它的 `STYLE.md`。
<td width="33%" valign="top"><a href="styles/cel-anime-80s/STYLE.md"><img src="docs/frames/cel-anime-80s.jpg" alt="80s Cel Anime"></a><br><b>80s Cel Anime</b> · 80 年代赛璐璐动画<br><i>City Lights, 1987</i><br><sub>A courier girl rides through a rain-soaked neon city to deliver a tape before the dawn launch.<br>快递少女骑车穿过雨后霓虹都市,赶在黎明发射前送到一盘磁带。</sub></td>
<td width="33%" valign="top"><a href="styles/scifi-toon/STYLE.md"><img src="docs/frames/scifi-toon.jpg" alt="Sci-Fi Sitcom Toon"></a><br><b>Sci-Fi Sitcom Toon</b> · 科幻情景喜剧卡通<br><i>Coffee Run</i><br><sub>A jaded genius opens a portal just to buy coffee and tumbles through ever-stranger universes.<br>厌世天才开传送门只想买杯咖啡,却穿过越来越离谱的平行宇宙。</sub></td>
</tr>
+<tr>
+<td width="33%" valign="top"><a href="styles/midcentury-toon/STYLE.md"><img src="docs/frames/midcentury-toon.jpg" alt="Mid-century Cartoon"></a><br><b>Mid-century Cartoon</b> · 50s 扁平卡通<br><i>Meet Pip</i><br><sub>A robot vacuum set up in three steps, told like a 1950s classroom film: place the dock, connect the app, press start.<br>用 50 年代教育片的口吻,三步教你装好一台扫地机:放充电座、连 app、按开始。</sub></td>
+</tr>
</table>
### Games · 游戏
diff --git a/TECHNIQUE.md b/TECHNIQUE.md
index 915ee8f..687e573 100644
--- a/TECHNIQUE.md
+++ b/TECHNIQUE.md
@@ -52,8 +52,11 @@ Capture (`core/render/`):
node core/render/still.mjs <demo> 1.5 12 --range 0:50:2 # review stills; exits on page errors
node core/render/video.mjs <demo> --fps 24 --workers 3 # all frames → out/video24.mp4
node core/render/events.mjs <demo> # export DUR + EV → events.json
+node core/render/readcheck.mjs <demo> # every on-screen text stays long enough to read
```
+`video.mjs` renders at most three films at once on one machine and queues the rest, and it keeps its segments next to `--out`, so you can render a second version of the same demo in parallel. To render a version with other content, pass it to the page: `--q 'content=content_alt.json'` (the same flag works for `events.mjs`, with `--out` so the main event file is kept).
+
What made capture fast: **JPEG screenshots** (about 8× faster than PNG), **one browser per worker** (pages sharing a browser barely parallelise), and **film grain added in ffmpeg**, not drawn in the page: grain makes every frame incompressible and slow.
## 3. One timeline drives everything
diff --git a/core/README.md b/core/README.md
index ab884d0..9446f9d 100644
--- a/core/README.md
+++ b/core/README.md
@@ -13,8 +13,10 @@ demo 是一个静态页面 `styles/<slug>/demo/index.html`(仓库根作为静
| 命令 | 作用 |
|---|---|
| `node core/render/still.mjs <demo> 1.5 3 [--range 0:50:2.5] [--q 'k=v'] [--prefix t_] [--out dir]` | 渲静帧;页面报错立即退出 |
-| `node core/render/video.mjs <demo> --fps 24 [--workers 3] [--q 'k=v'] [--out <demo>/out/video24.mp4]` | 逐帧渲视频。多片并行时 workers 保持 3 |
-| `node core/render/events.mjs <demo>` | 导出 `<demo>/events.json`(dur + EV) |
+| `node core/render/video.mjs <demo> --fps 24 [--workers 3] [--q 'k=v'] [--out <demo>/out/video24.mp4]` | 逐帧渲视频。多片并行时 workers 保持 3。整机最多 3 个整片同时渲染(超出自动排队);分段文件放在 `--out` 旁的临时目录,渲完删除,同一个 demo 可以并行渲多个版本(例如换内容版用 `--q 'content=content_alt.json'`) |
+| `node core/render/events.mjs <demo> [--q 'content=content_alt.json'] [--out <file>]` | 导出 `<demo>/events.json`(dur + EV);换内容时 `--q` 传参给页面、`--out` 另存,不覆盖主片的事件表 |
+| `node core/render/readcheck.mjs <demo> [--q 'k=v'] [--cps 12] [--min 1.5]` | 阅读时长自检:页面提供 `window.TEXTS(t)` → `[{id, text, x0, y0, x1, y1}]`(屏幕像素),每段文字从出现起连续完整在画的时长要 ≥ 字符数 / 12 + 1 s(且 ≥ 1.5 s);有不达标的退出码为 1 |
+| `node core/render/slot.mjs -- <command…>` | 整机渲染限流(`video.mjs` 已自动使用):最多 `RENDER_SLOTS`(默认 3)个整片同时渲染,空闲内存低于 `RENDER_MIN_FREE`%(默认 30)时排队 |
| `.venv/bin/python core/render/sheet.py out.jpg img... [--cols 4] [--w 480]` | 缩略图总览(审片) |
| `.venv/bin/python core/render/srt.py cues.json out.srt` | 字幕导出(cues = [{t0,t1,text}]) |
| `sh core/render/mux.sh video.mp4 mix.wav out.mp4 24 [grain]` | 合成成片:两遍 loudnorm −14 LUFS;grain 默认 2,0 = 不加颗粒;结尾打印 ebur128 实测 |
diff --git a/core/render/events.mjs b/core/render/events.mjs
index 1cf5053..bdeb183 100644
--- a/core/render/events.mjs
+++ b/core/render/events.mjs
@@ -1,9 +1,12 @@
-// 导出音效事件:node core/render/events.mjs styles/<slug>/demo → <dir>/events.json
+// 导出音效事件:node core/render/events.mjs styles/<slug>/demo [--q 'content=content_alt.json'] [--out <file>]
+// 默认写 <demo>/events.json;换内容时用 --q 把参数传给页面,--out 写到别处,免得覆盖主片的事件表
import fs from 'fs'; import path from 'path';
import { openDemo, closeServer } from './page.mjs';
-const dir = process.argv[2];
-const { browser, page } = await openDemo(dir);
+const args = process.argv.slice(2), opt = (k, d) => { const i = args.indexOf(k); return i >= 0 ? args[i + 1] : d; };
+const dir = args[0], Q = opt('--q', ''), out = opt('--out', path.join(dir, 'events.json'));
+const { browser, page } = await openDemo(dir, { q: Q });
const ev = await page.evaluate(() => ({ dur: window.DUR, ev: window.EV || [] }));
-fs.writeFileSync(path.join(dir, 'events.json'), JSON.stringify(ev, null, 0));
-console.log('events', ev.ev.length, 'dur', ev.dur);
+fs.mkdirSync(path.dirname(path.resolve(out)), { recursive: true });
+fs.writeFileSync(out, JSON.stringify(ev, null, 0));
+console.log('events', ev.ev.length, 'dur', ev.dur, '→', out);
await browser.close(); closeServer();
diff --git a/core/render/readcheck.mjs b/core/render/readcheck.mjs
new file mode 100644
index 0000000..8cebf50
--- /dev/null
+++ b/core/render/readcheck.mjs
@@ -0,0 +1,33 @@
+// 阅读时长自检:node core/render/readcheck.mjs styles/<slug>/demo [--q 'k=v'] [--step 0.04] [--cps 12] [--min 1.5]
+// 页面提供 window.TEXTS(t) → [{id, text, x0, y0, x1, y1}]:t 秒时画面上看得见的每段文字和它的屏幕框(像素)。
+// 每段文字从第一次出现起,连续完整在画框内、而且还在 TEXTS 里的时长,要 ≥ 字符数 / cps + 1 s(且 ≥ min)。
+// 页面没有 TEXTS 就直接跳过。字幕条另算:它的停留由 .srt 决定。
+import { openDemo, closeServer } from './page.mjs';
+const args = process.argv.slice(2), opt = (k, d) => { const i = args.indexOf(k); return i >= 0 ? args[i + 1] : d; };
+const dir = args[0], Q = opt('--q', ''), STEP = +opt('--step', 0.04), CPS = +opt('--cps', 12), MIN = +opt('--min', 1.5);
+const { browser, page } = await openDemo(dir, { q: Q });
+const res = await page.evaluate(({ STEP }) => {
+ if (typeof window.TEXTS !== 'function') return null;
+ const W = innerWidth, H = innerHeight, seen = {};
+ for (let t = 0; t <= window.DUR; t += STEP) {
+ window.render(t);
+ const vis = new Set();
+ for (const b of window.TEXTS(t) || []) {
+ if (!(b.x0 >= 0 && b.y0 >= 0 && b.x1 <= W && b.y1 <= H)) continue;
+ vis.add(b.id);
+ const s = seen[b.id] ??= { text: b.text, t0: t, run: 0, done: false };
+ if (!s.done) s.run = t - s.t0 + STEP;
+ }
+ for (const id in seen) if (!vis.has(id)) seen[id].done = true; // 只算第一次连续在画的时长
+ }
+ return seen;
+}, { STEP });
+let bad = 0;
+if (!res) console.log('readcheck: page has no window.TEXTS(t); skipped');
+else for (const [id, s] of Object.entries(res)) {
+ const need = Math.max(MIN, s.text.length / CPS + 1), ok = s.run >= need - 1e-6;
+ if (!ok) bad++;
+ console.log(`${ok ? 'OK ' : 'BAD'} ${id.padEnd(18)} at ${s.t0.toFixed(2)}s ${String(s.text.length).padStart(3)} chars need ${need.toFixed(2)}s got ${s.run.toFixed(2)}s`);
+}
+await browser.close(); closeServer();
+process.exit(bad ? 1 : 0);
diff --git a/core/render/slot.mjs b/core/render/slot.mjs
new file mode 100644
index 0000000..e7d1d87
--- /dev/null
+++ b/core/render/slot.mjs
@@ -0,0 +1,39 @@
+// 整机渲染限流:同一时间最多 RENDER_SLOTS 个整片渲染(默认 3),空闲内存低于 RENDER_MIN_FREE%(默认 30)时排队等。
+// video.mjs 自动调用;也可以包住任何命令:node core/render/slot.mjs -- <command…>
+// 一个槽位 = 仓库根 .render_slots/ 下的一个目录,里面记着占用者的 pid;占用进程已不在的槽位会被接管。
+import fs from 'fs'; import path from 'path'; import { spawn, execFileSync } from 'child_process'; import { fileURLToPath } from 'url';
+
+const LOCKS = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../.render_slots');
+const alive = pid => { try { process.kill(pid, 0); return true; } catch { return false; } };
+const freePct = () => { // macOS memory_pressure;其它系统拿不到就不设门槛
+ try { return +(/free percentage:\s*(\d+)/.exec(execFileSync('memory_pressure', { encoding: 'utf8' }))?.[1] ?? 100); } catch { return 100; }
+};
+
+export async function acquire({ slots = +(process.env.RENDER_SLOTS || 3), minFree = +(process.env.RENDER_MIN_FREE || 30) } = {}) {
+ fs.mkdirSync(LOCKS, { recursive: true });
+ for (let waited = 0; ; waited++) {
+ if (freePct() >= minFree) {
+ for (let i = 0; i < slots; i++) {
+ const d = path.join(LOCKS, `slot${i}`);
+ try { if (!alive(+fs.readFileSync(path.join(d, 'pid'), 'utf8'))) fs.rmSync(d, { recursive: true, force: true }); } catch {}
+ try {
+ fs.mkdirSync(d); fs.writeFileSync(path.join(d, 'pid'), String(process.pid));
+ const release = () => { try { fs.rmSync(d, { recursive: true, force: true }); } catch {} };
+ process.on('exit', release);
+ return release;
+ } catch {}
+ }
+ }
+ if (waited % 30 === 0) console.log(`waiting for a render slot (max ${slots}, free memory ≥ ${minFree}%)…`);
+ await new Promise(r => setTimeout(r, 2000));
+ }
+}
+
+if (process.argv[1] === fileURLToPath(import.meta.url)) {
+ const i = process.argv.indexOf('--'), cmd = i >= 0 ? process.argv.slice(i + 1) : [];
+ if (!cmd.length) { console.error('usage: node core/render/slot.mjs -- <command…>'); process.exit(2); }
+ const release = await acquire();
+ const child = spawn(cmd[0], cmd.slice(1), { stdio: 'inherit', env: { ...process.env, RENDER_SLOT_HELD: '1' } });
+ for (const sig of ['SIGINT', 'SIGTERM']) process.on(sig, () => child.kill(sig));
+ child.on('exit', (code, sig) => { release(); process.exit(code ?? (sig ? 1 : 0)); });
+}
diff --git a/core/render/video.mjs b/core/render/video.mjs
index 615b3f7..5575b83 100644
--- a/core/render/video.mjs
+++ b/core/render/video.mjs
@@ -1,19 +1,23 @@
// 渲视频:node core/render/video.mjs styles/<slug>/demo [--fps 24] [--workers 3] [--q 'k=v'] [--out out/video.mp4]
// 多个片子并行制作时 workers 用 3(默认),单独渲染可开到 6
// 每个 worker 独立浏览器,JPEG 截图经管道交给 ffmpeg;最后无损拼接
+// 整机最多同时 3 个整片渲染(slot.mjs,RENDER_SLOTS 可改),分段文件放在 --out 旁边的临时目录,同一个 demo 可以并行渲多个版本
import fs from 'fs'; import path from 'path'; import { spawn, execFileSync } from 'child_process';
import { openDemo, closeServer } from './page.mjs';
+import { acquire } from './slot.mjs';
const args = process.argv.slice(2), opt = (k, d) => { const i = args.indexOf(k); return i >= 0 ? args[i + 1] : d; };
const dir = args[0], FPS = +opt('--fps', 24), WK = +opt('--workers', 3), Q = opt('--q', '');
-const outDir = path.join(dir, 'out'); fs.mkdirSync(outDir, { recursive: true });
-const out = opt('--out', path.join(outDir, 'video.mp4'));
+const out = path.resolve(opt('--out', path.join(dir, 'out', 'video.mp4')));
+const segDir = path.join(path.dirname(out), `.${path.basename(out, path.extname(out))}_segs`);
+fs.mkdirSync(segDir, { recursive: true });
+const release = process.env.RENDER_SLOT_HELD ? () => {} : await acquire();
const probe = await openDemo(dir, { q: Q }); const DUR = await probe.page.evaluate(() => window.DUR); await probe.browser.close();
const TOTAL = Math.round(DUR * FPS), per = Math.ceil(TOTAL / WK), t0 = Date.now();
await Promise.all([...Array(WK)].map(async (_, w) => {
const a = w * per, b = Math.min(TOTAL, a + per); if (a >= b) return;
const { browser, page } = await openDemo(dir, { q: Q });
const ff = spawn('ffmpeg', ['-y', '-loglevel', 'error', '-f', 'image2pipe', '-framerate', String(FPS), '-c:v', 'mjpeg', '-i', '-',
- '-c:v', 'libx264', '-preset', 'medium', '-crf', '14', '-pix_fmt', 'yuv420p', path.join(outDir, `seg_${w}.mp4`)]);
+ '-c:v', 'libx264', '-preset', 'medium', '-crf', '14', '-pix_fmt', 'yuv420p', path.join(segDir, `seg_${w}.mp4`)]);
for (let f = a; f < b; f++) {
await page.evaluate(t => window.render(t), f / FPS);
const buf = await page.screenshot({ type: 'jpeg', quality: 95 });
@@ -22,8 +26,10 @@ await Promise.all([...Array(WK)].map(async (_, w) => {
}
ff.stdin.end(); await new Promise(r => ff.on('close', r)); await browser.close();
}));
-const list = path.join(outDir, 'segs.txt');
+const list = path.join(segDir, 'segs.txt');
fs.writeFileSync(list, [...Array(WK)].map((_, w) => `file 'seg_${w}.mp4'`).filter((_, w) => w * per < TOTAL).join('\n'));
execFileSync('ffmpeg', ['-y', '-loglevel', 'error', '-f', 'concat', '-safe', '0', '-i', list, '-c', 'copy', out]);
+fs.rmSync(segDir, { recursive: true, force: true });
+release();
console.log('done', out, TOTAL, 'frames', ((Date.now() - t0) / 1000).toFixed(0) + 's');
closeServer();
diff --git a/docs/cover.jpg b/docs/cover.jpg
index 41347f4..76476e3 100644
Binary files a/docs/cover.jpg and b/docs/cover.jpg differ
diff --git a/docs/frames/engraving.jpg b/docs/frames/engraving.jpg
new file mode 100644
index 0000000..5c67678
Binary files /dev/null and b/docs/frames/engraving.jpg differ
diff --git a/docs/frames/hologram-hud.jpg b/docs/frames/hologram-hud.jpg
new file mode 100644
index 0000000..435add1
Binary files /dev/null and b/docs/frames/hologram-hud.jpg differ
diff --git a/docs/frames/midcentury-toon.jpg b/docs/frames/midcentury-toon.jpg
new file mode 100644
index 0000000..38f7d65
Binary files /dev/null and b/docs/frames/midcentury-toon.jpg differ
diff --git a/docs/frames/picks.json b/docs/frames/picks.json
index 81e20f9..e038075 100644
--- a/docs/frames/picks.json
+++ b/docs/frames/picks.json
@@ -37,5 +37,9 @@
"paper-popup": 26.6,
"tilt-shift": 22.8,
"lowpoly-island": 21.2,
- "glass-product": 19.2
+ "glass-product": 19.2,
+ "midcentury-toon": 3.2,
+ "hologram-hud": 25.5,
+ "engraving": 34.0,
+ "silkscreen-poster": 34.0
}
\ No newline at end of file
diff --git a/docs/frames/silkscreen-poster.jpg b/docs/frames/silkscreen-poster.jpg
new file mode 100644
index 0000000..87d1cc6
Binary files /dev/null and b/docs/frames/silkscreen-poster.jpg differ
diff --git a/docs/zh-CN/TECHNIQUE.md b/docs/zh-CN/TECHNIQUE.md
index a894268..4bc842c 100644
--- a/docs/zh-CN/TECHNIQUE.md
+++ b/docs/zh-CN/TECHNIQUE.md
@@ -52,8 +52,11 @@ window.EV = [{t, type, ...}]; // 可选:给混音用的音效 / 卡点事
node core/render/still.mjs <demo> 1.5 12 --range 0:50:2 # 审片静帧;页面报错立即退出
node core/render/video.mjs <demo> --fps 24 --workers 3 # 渲全部帧 → out/video24.mp4
node core/render/events.mjs <demo> # 导出 DUR + EV → events.json
+node core/render/readcheck.mjs <demo> # 画面上每段文字都停够阅读时间
```
+`video.mjs` 整机最多同时渲 3 支片,多了自动排队;分段文件放在 `--out` 旁边,所以同一个 demo 可以并行再渲一个版本。换内容渲另一版时把参数传给页面:`--q 'content=content_alt.json'`(`events.mjs` 同样支持,配合 `--out` 另存,不覆盖主片的事件表)。
+
提速的关键:**截图用 JPEG**(比 PNG 快约 8 倍);**每个 worker 各开一个浏览器**(共用一个浏览器几乎不并行);**胶片颗粒在 ffmpeg 里加**,不要画在页面里,否则每一帧都压缩不动,很慢。
## 3. 一条时间线驱动一切
diff --git a/plugin/.claude-plugin/plugin.json b/plugin/.claude-plugin/plugin.json
index e3f2b1d..13dbd90 100644
--- a/plugin/.claude-plugin/plugin.json
+++ b/plugin/.claude-plugin/plugin.json
@@ -1,6 +1,6 @@
{
"name": "lemo-opuscar",
- "description": "Make a film in one of 39 code-rendered styles: your agent directs, draws, scores and mixes it.",
+ "description": "Make a film in one of 43 code-rendered styles: your agent directs, draws, scores and mixes it.",
"author": { "name": "Lemomo", "url": "https://github.com/lemomo-ai" },
"homepage": "https://lemomo-ai.github.io/lemo-opuscar/",
"repository": "https://github.com/lemomo-ai/lemo-opuscar",
diff --git a/plugin/skills/lemo-opuscar/SKILL.md b/plugin/skills/lemo-opuscar/SKILL.md
index 3eabd16..7e6775b 100644
--- a/plugin/skills/lemo-opuscar/SKILL.md
+++ b/plugin/skills/lemo-opuscar/SKILL.md
@@ -1,6 +1,6 @@
---
name: lemo-opuscar
-description: Direct and produce a short film made entirely in code, in one of the 39 styles of the Lemo-Opuscar library (e.g. Impasto Oil Painting 油画厚涂, Watercolor Brush 水彩笔刷, Chinese Ink Wash 中国水墨, Ukiyo-e 浮世绘, Whiteboard Explainer 白板讲解). Use when the user asks for a video, film, short, promo or animation (视频、短片、动画、宣传片) in a named style, or asks which film styles there are.
+description: Direct and produce a short film made entirely in code, in one of the 43 styles of the Lemo-Opuscar library (e.g. Impasto Oil Painting 油画厚涂, Watercolor Brush 水彩笔刷, Chinese Ink Wash 中国水墨, Ukiyo-e 浮世绘, Whiteboard Explainer 白板讲解). Use when the user asks for a video, film, short, promo or animation (视频、短片、动画、宣传片) in a named style, or asks which film styles there are.
---
# Lemo-Opuscar
diff --git a/styleboard/build.py b/styleboard/build.py
index 4c19e58..c00216c 100644
--- a/styleboard/build.py
+++ b/styleboard/build.py
@@ -12,7 +12,7 @@ CN = {'pixel-rpg': '16-bit 像素 RPG', 'brick-toy': '积木玩具', 'paper-popu
'origami': '折纸', 'backrooms': '后室 / 新怪谈', 'blueprint': '蓝图 / 工程制图', 'microgame': '微游戏快闪(瓦里奥制造式)', 'synthwave': '霓虹合成波', 'swiss-motion': '瑞士动态排版', 'voxel': '体素', 'gameboy': 'Game Boy 四色',
'cardboard': '瓦楞纸板', 'dunhuang': '敦煌壁画', 'papercut-red': '红色窗花剪纸', 'impasto': '油画厚涂', 'one-line': '一笔画',
'stained-glass': '彩色玻璃窗', 'silent-film': '1920s 默片', 'spy-titles': '60s 间谍片头', 'ascii-crt': 'ASCII / CRT 终端',
- 'dataviz': '数据叙事', 'whiteboard': '白板讲解', 'iso-infographic': '等距信息图', 'hd-2d': 'HD-2D', 'urban-sketch': '钢笔淡彩', 'cel-anime-80s': '80 年代赛璐璐动画', 'scifi-toon': '科幻情景喜剧卡通', 'art-deco': '装饰艺术', 'woodcut': '木刻版画', 'pop-art': '波普漫画', 'paper-lantern': '纸雕灯影', 'pictogram-motion': '象形运动图形'}
+ 'dataviz': '数据叙事', 'whiteboard': '白板讲解', 'iso-infographic': '等距信息图', 'hd-2d': 'HD-2D', 'urban-sketch': '钢笔淡彩', 'cel-anime-80s': '80 年代赛璐璐动画', 'scifi-toon': '科幻情景喜剧卡通', 'art-deco': '装饰艺术', 'woodcut': '木刻版画', 'pop-art': '波普漫画', 'paper-lantern': '纸雕灯影', 'pictogram-motion': '象形运动图形', 'midcentury-toon': '50s 扁平卡通', 'hologram-hud': '科幻全息界面', 'engraving': '铜版画', 'silkscreen-poster': '丝印旅行海报'}
REPO = 'lemomo-ai/lemo-opuscar' # GitHub 仓库
FILMS_URL = f'https://github.com/{REPO}/releases/download/films' # 成片放在 Release「films」里,文件名 <slug>.mp4
diff --git a/styleboard/cards.json b/styleboard/cards.json
index 51f4361..5a68e30 100644
--- a/styleboard/cards.json
+++ b/styleboard/cards.json
@@ -399,5 +399,45 @@
"Feature launches",
"Onboarding"
]
+ },
+ "midcentury-toon": {
+ "film": "Meet Pip",
+ "line": "A robot vacuum set up in three steps, told like a 1950s classroom film: place the dock, connect the app, press start.",
+ "line_cn": "用 50 年代教育片的口吻,三步教你装好一台扫地机:放充电座、连 app、按开始。",
+ "uses": [
+ "Product set-up guides",
+ "Help-centre explainers",
+ "How-to steps"
+ ]
+ },
+ "hologram-hud": {
+ "film": "Volt · Spec Scan",
+ "line": "An e-bike is scanned into a hologram; target boxes lock onto the battery, motor and brakes, and each spec rolls into place.",
+ "line_cn": "一辆电助力车被扫描成全息线框,目标框依次锁定电池、电机、刹车,参数逐个滚到真值。",
+ "uses": [
+ "Product spec walkthroughs",
+ "Launch & crowdfunding videos",
+ "Trade-show screens"
+ ]
+ },
+ "engraving": {
+ "film": "The Honeybee, Plate VII",
+ "line": "A natural-history plate engraves itself: the burin cuts the copper, the bee builds up line by line, and a watercolour wash brings it to life.",
+ "line_cn": "一张博物志图版自己刻出来:雕刀推开铜版,蜜蜂一线线成形,最后手工水彩上色。",
+ "uses": [
+ "Museum labels",
+ "Science explainers",
+ "Brand heritage"
+ ]
+ },
+ "silkscreen-poster": {
+ "film": "Three Trails",
+ "line": "Three trail posters are screen-printed one ink at a time, then climbed in one long take from noon to dusk.",
+ "line_cn": "三条步道各一张丝印海报,一色一刮印出来,再沿山脊一镜到底从正午爬到黄昏。",
+ "uses": [
+ "Trail & destination guides",
+ "Tourism promos",
+ "Event posters"
+ ]
}
}
\ No newline at end of file
diff --git a/styleboard/catalog.json b/styleboard/catalog.json
index 1a56f8f..610dae1 100644
--- a/styleboard/catalog.json
+++ b/styleboard/catalog.json
@@ -237,6 +237,40 @@
],
"dur": 58.5
},
+ {
+ "slug": "engraving",
+ "num": "53",
+ "en": "Copperplate Engraving",
+ "cn": "铜版画",
+ "cat": "印刷与版画",
+ "cat_en": "Print & Printmaking",
+ "film": "The Honeybee, Plate VII",
+ "line": "A natural-history plate engraves itself: the burin cuts the copper, the bee builds up line by line, and a watercolour wash brings it to life.",
+ "line_cn": "一张博物志图版自己刻出来:雕刀推开铜版,蜜蜂一线线成形,最后手工水彩上色。",
+ "uses": [
+ "Museum labels",
+ "Science explainers",
+ "Brand heritage"
+ ],
+ "dur": 40.0
+ },
+ {
+ "slug": "silkscreen-poster",
+ "num": "54",
+ "en": "Silkscreen Travel Poster",
+ "cn": "丝印旅行海报",
+ "cat": "印刷与版画",
+ "cat_en": "Print & Printmaking",
+ "film": "Three Trails",
+ "line": "Three trail posters are screen-printed one ink at a time, then climbed in one long take from noon to dusk.",
+ "line_cn": "三条步道各一张丝印海报,一色一刮印出来,再沿山脊一镜到底从正午爬到黄昏。",
+ "uses": [
+ "Trail & destination guides",
+ "Tourism promos",
+ "Event posters"
+ ],
+ "dur": 38.4
+ },
{
"slug": "swiss-motion",
"num": "16",
@@ -424,6 +458,23 @@
],
"dur": 59.4
},
+ {
+ "slug": "hologram-hud",
+ "num": "52",
+ "en": "Sci-fi Hologram HUD",
+ "cn": "科幻全息界面",
+ "cat": "信息与发布",
+ "cat_en": "Information & Keynote",
+ "film": "Volt · Spec Scan",
+ "line": "An e-bike is scanned into a hologram; target boxes lock onto the battery, motor and brakes, and each spec rolls into place.",
+ "line_cn": "一辆电助力车被扫描成全息线框,目标框依次锁定电池、电机、刹车,参数逐个滚到真值。",
+ "uses": [
+ "Product spec walkthroughs",
+ "Launch & crowdfunding videos",
+ "Trade-show screens"
+ ],
+ "dur": 39.0
+ },
{
"slug": "rubber-hose",
"num": "26",
@@ -475,6 +526,23 @@
],
"dur": 57.5
},
+ {
+ "slug": "midcentury-toon",
+ "num": "48",
+ "en": "Mid-century Cartoon",
+ "cn": "50s 扁平卡通",
+ "cat": "卡通与动画",
+ "cat_en": "Cartoon & Anime",
+ "film": "Meet Pip",
+ "line": "A robot vacuum set up in three steps, told like a 1950s classroom film: place the dock, connect the app, press start.",
+ "line_cn": "用 50 年代教育片的口吻,三步教你装好一台扫地机:放充电座、连 app、按开始。",
+ "uses": [
+ "Product set-up guides",
+ "Help-centre explainers",
+ "How-to steps"
+ ],
+ "dur": 40.0
+ },
{
"slug": "pixel-rpg",
"num": "29",
diff --git a/styleboard/img/credits.json b/styleboard/img/credits.json
index ce6d438..edb49c2 100644
--- a/styleboard/img/credits.json
+++ b/styleboard/img/credits.json
@@ -187,5 +187,17 @@
},
"living-screencast_0.jpg": {
"frame": true
+ },
+ "hologram-hud_0.jpg": {
+ "frame": true
+ },
+ "engraving_0.jpg": {
+ "frame": true
+ },
+ "silkscreen-poster_0.jpg": {
+ "frame": true
+ },
+ "midcentury-toon_0.jpg": {
+ "frame": true
}
}
\ No newline at end of file
diff --git a/styleboard/img/engraving_0.jpg b/styleboard/img/engraving_0.jpg
new file mode 100644
index 0000000..726cbb1
Binary files /dev/null and b/styleboard/img/engraving_0.jpg differ
diff --git a/styleboard/img/hologram-hud_0.jpg b/styleboard/img/hologram-hud_0.jpg
new file mode 100644
index 0000000..d5a680c
Binary files /dev/null and b/styleboard/img/hologram-hud_0.jpg differ
diff --git a/styleboard/img/midcentury-toon_0.jpg b/styleboard/img/midcentury-toon_0.jpg
new file mode 100644
index 0000000..e05b987
Binary files /dev/null and b/styleboard/img/midcentury-toon_0.jpg differ
diff --git a/styleboard/img/silkscreen-poster_0.jpg b/styleboard/img/silkscreen-poster_0.jpg
new file mode 100644
index 0000000..c31bc19
Binary files /dev/null and b/styleboard/img/silkscreen-poster_0.jpg differ
diff --git a/styleboard/index.html b/styleboard/index.html
index 89a9b7f..1a68a41 100644
--- a/styleboard/index.html
+++ b/styleboard/index.html
@@ -232,9 +232,9 @@ footer .fine-cn{margin:6px 0 0;font:400 13px var(--cn);color:var(--dim)}
<p class="tagline-cn">每个风格是一份可复用的提示词,外加一支完全用代码导演、作画、配乐的短片。</p>
<a class="repo" href="https://github.com/lemomo-ai/lemo-opuscar" target="_blank" rel="noopener"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0016 8c0-4.42-3.58-8-8-8z"/></svg><span>Get the styles on GitHub</span></a>
<div class="stats">
- <div class="stat"><div class="wreath"><svg><use href="#laurel"/></svg><b>39</b></div><span>Nominees</span></div>
+ <div class="stat"><div class="wreath"><svg><use href="#laurel"/></svg><b>43</b></div><span>Nominees</span></div>
<div class="stat"><div class="wreath"><svg><use href="#laurel"/></svg><b>9</b></div><span>Categories</span></div>
- <div class="stat"><div class="wreath"><svg><use href="#laurel"/></svg><b>41</b></div><span>Minutes of film</span></div>
+ <div class="stat"><div class="wreath"><svg><use href="#laurel"/></svg><b>44</b></div><span>Minutes of film</span></div>
</div>
</div>
<div class="carpet"><i></i><i></i><i></i><i></i><b></b><b></b></div>
@@ -383,7 +383,7 @@ footer .fine-cn{margin:6px 0 0;font:400 13px var(--cn);color:var(--dim)}
</div>
</section>
<section class="category" id="print-printmaking">
- <header class="cat-head"><svg class="lf"><use href="#laurel"/></svg><div><p class="cat-no">Category 03</p><h2>Print &amp; Printmaking</h2><p class="cat-cn">印刷与版画 · 3 nominees</p></div><svg class="lf"><use href="#laurel"/></svg></header>
+ <header class="cat-head"><svg class="lf"><use href="#laurel"/></svg><div><p class="cat-no">Category 03</p><h2>Print &amp; Printmaking</h2><p class="cat-cn">印刷与版画 · 5 nominees</p></div><svg class="lf"><use href="#laurel"/></svg></header>
<div class="grid">
<article class="nominee" data-slug="risograph" data-en="Risograph Print" data-cn="Risograph 丝网印刷" data-film="Sunday Ride">
<div class="screen"><img class="still" src="img/risograph_0.jpg" alt="Risograph Print — Sunday Ride" loading="lazy"><button class="play" type="button" data-src="../styles/risograph/risograph.mp4" data-poster="../styles/risograph/poster.jpg" aria-label="Play Sunday Ride"><i></i><span>0:40</span></button></div>
@@ -414,6 +414,26 @@ footer .fine-cn{margin:6px 0 0;font:400 13px var(--cn);color:var(--dim)}
<ul class=uses aria-label="Best for"><li>Folk tales</li><li>Craft brands</li><li>Book trailers</li></ul>
<nav class="links"><a class="watch" href="../styles/woodcut/woodcut.mp4" data-play>Watch the film</a><a href="../styles/woodcut/STYLE.md" target="_blank" rel="noopener">STYLE.md</a></nav>
</div>
+</article>
+<article class="nominee" data-slug="engraving" data-en="Copperplate Engraving" data-cn="铜版画" data-film="The Honeybee, Plate VII">
+ <div class="screen"><img class="still" src="img/engraving_0.jpg" alt="Copperplate Engraving — The Honeybee, Plate VII" loading="lazy"><button class="play" type="button" data-src="../styles/engraving/engraving.mp4" data-poster="../styles/engraving/poster.jpg" aria-label="Play The Honeybee, Plate VII"><i></i><span>0:40</span></button></div>
+ <div class="plate">
+ <h3>Copperplate Engraving</h3><p class="cn">铜版画</p>
+ <p class="for">for <em>The Honeybee, Plate VII</em></p>
+ <p class="line">A natural-history plate engraves itself: the burin cuts the copper, the bee builds up line by line, and a watercolour wash brings it to life.</p><p class="line-cn">一张博物志图版自己刻出来:雕刀推开铜版,蜜蜂一线线成形,最后手工水彩上色。</p>
+ <ul class=uses aria-label="Best for"><li>Museum labels</li><li>Science explainers</li><li>Brand heritage</li></ul>
+ <nav class="links"><a class="watch" href="../styles/engraving/engraving.mp4" data-play>Watch the film</a><a href="../styles/engraving/STYLE.md" target="_blank" rel="noopener">STYLE.md</a></nav>
+ </div>
+</article>
+<article class="nominee" data-slug="silkscreen-poster" data-en="Silkscreen Travel Poster" data-cn="丝印旅行海报" data-film="Three Trails">
+ <div class="screen"><img class="still" src="img/silkscreen-poster_0.jpg" alt="Silkscreen Travel Poster — Three Trails" loading="lazy"><button class="play" type="button" data-src="../styles/silkscreen-poster/silkscreen-poster.mp4" data-poster="../styles/silkscreen-poster/poster.jpg" aria-label="Play Three Trails"><i></i><span>0:38</span></button></div>
+ <div class="plate">
+ <h3>Silkscreen Travel Poster</h3><p class="cn">丝印旅行海报</p>
+ <p class="for">for <em>Three Trails</em></p>
+ <p class="line">Three trail posters are screen-printed one ink at a time, then climbed in one long take from noon to dusk.</p><p class="line-cn">三条步道各一张丝印海报,一色一刮印出来,再沿山脊一镜到底从正午爬到黄昏。</p>
+ <ul class=uses aria-label="Best for"><li>Trail &amp; destination guides</li><li>Tourism promos</li><li>Event posters</li></ul>
+ <nav class="links"><a class="watch" href="../styles/silkscreen-poster/silkscreen-poster.mp4" data-play>Watch the film</a><a href="../styles/silkscreen-poster/STYLE.md" target="_blank" rel="noopener">STYLE.md</a></nav>
+ </div>
</article>
</div>
</section>
@@ -493,7 +513,7 @@ footer .fine-cn{margin:6px 0 0;font:400 13px var(--cn);color:var(--dim)}
</div>
</section>
<section class="category" id="information-keynote">
- <header class="cat-head"><svg class="lf"><use href="#laurel"/></svg><div><p class="cat-no">Category 05</p><h2>Information &amp; Keynote</h2><p class="cat-cn">信息与发布 · 4 nominees</p></div><svg class="lf"><use href="#laurel"/></svg></header>
+ <header class="cat-head"><svg class="lf"><use href="#laurel"/></svg><div><p class="cat-no">Category 05</p><h2>Information &amp; Keynote</h2><p class="cat-cn">信息与发布 · 5 nominees</p></div><svg class="lf"><use href="#laurel"/></svg></header>
<div class="grid">
<article class="nominee" data-slug="dataviz" data-en="Data Storytelling" data-cn="数据叙事" data-film="A Hundred Summers">
<div class="screen"><img class="still" src="img/dataviz_0.jpg" alt="Data Storytelling — A Hundred Summers" loading="lazy"><button class="play" type="button" data-src="../styles/dataviz/dataviz.mp4" data-poster="../styles/dataviz/poster.jpg" aria-label="Play A Hundred Summers"><i></i><span>0:50</span></button></div>
@@ -534,11 +554,21 @@ footer .fine-cn{margin:6px 0 0;font:400 13px var(--cn);color:var(--dim)}
<ul class=uses aria-label="Best for"><li>Product tutorials</li><li>Feature launches</li><li>Onboarding</li></ul>
<nav class="links"><a class="watch" href="../styles/living-screencast/living-screencast.mp4" data-play>Watch the film</a><a href="../styles/living-screencast/STYLE.md" target="_blank" rel="noopener">STYLE.md</a></nav>
</div>
+</article>
+<article class="nominee" data-slug="hologram-hud" data-en="Sci-fi Hologram HUD" data-cn="科幻全息界面" data-film="Volt · Spec Scan">
+ <div class="screen"><img class="still" src="img/hologram-hud_0.jpg" alt="Sci-fi Hologram HUD — Volt · Spec Scan" loading="lazy"><button class="play" type="button" data-src="../styles/hologram-hud/hologram-hud.mp4" data-poster="../styles/hologram-hud/poster.jpg" aria-label="Play Volt · Spec Scan"><i></i><span>0:39</span></button></div>
+ <div class="plate">
+ <h3>Sci-fi Hologram HUD</h3><p class="cn">科幻全息界面</p>
+ <p class="for">for <em>Volt · Spec Scan</em></p>
+ <p class="line">An e-bike is scanned into a hologram; target boxes lock onto the battery, motor and brakes, and each spec rolls into place.</p><p class="line-cn">一辆电助力车被扫描成全息线框,目标框依次锁定电池、电机、刹车,参数逐个滚到真值。</p>
+ <ul class=uses aria-label="Best for"><li>Product spec walkthroughs</li><li>Launch &amp; crowdfunding videos</li><li>Trade-show screens</li></ul>
+ <nav class="links"><a class="watch" href="../styles/hologram-hud/hologram-hud.mp4" data-play>Watch the film</a><a href="../styles/hologram-hud/STYLE.md" target="_blank" rel="noopener">STYLE.md</a></nav>
+ </div>
</article>
</div>
</section>
<section class="category" id="cartoon-anime">
- <header class="cat-head"><svg class="lf"><use href="#laurel"/></svg><div><p class="cat-no">Category 06</p><h2>Cartoon &amp; Anime</h2><p class="cat-cn">卡通与动画 · 3 nominees</p></div><svg class="lf"><use href="#laurel"/></svg></header>
+ <header class="cat-head"><svg class="lf"><use href="#laurel"/></svg><div><p class="cat-no">Category 06</p><h2>Cartoon &amp; Anime</h2><p class="cat-cn">卡通与动画 · 4 nominees</p></div><svg class="lf"><use href="#laurel"/></svg></header>
<div class="grid">
<article class="nominee" data-slug="rubber-hose" data-en="1930s Rubber Hose Cartoon" data-cn="1930s 橡皮管卡通" data-film="Coffee Cup Chase">
<div class="screen"><img class="still" src="img/rubber-hose_0.jpg" alt="1930s Rubber Hose Cartoon — Coffee Cup Chase" loading="lazy"><button class="play" type="button" data-src="../styles/rubber-hose/rubber-hose.mp4" data-poster="../styles/rubber-hose/poster.jpg" aria-label="Play Coffee Cup Chase"><i></i><span>0:50</span></button></div>
@@ -569,6 +599,16 @@ footer .fine-cn{margin:6px 0 0;font:400 13px var(--cn);color:var(--dim)}
<ul class=uses aria-label="Best for"><li>Comedy</li><li>Tech brands</li><li>Social shorts</li></ul>
<nav class="links"><a class="watch" href="../styles/scifi-toon/scifi-toon.mp4" data-play>Watch the film</a><a href="../styles/scifi-toon/STYLE.md" target="_blank" rel="noopener">STYLE.md</a></nav>
</div>
+</article>
+<article class="nominee" data-slug="midcentury-toon" data-en="Mid-century Cartoon" data-cn="50s 扁平卡通" data-film="Meet Pip">
+ <div class="screen"><img class="still" src="img/midcentury-toon_0.jpg" alt="Mid-century Cartoon — Meet Pip" loading="lazy"><button class="play" type="button" data-src="../styles/midcentury-toon/midcentury-toon.mp4" data-poster="../styles/midcentury-toon/poster.jpg" aria-label="Play Meet Pip"><i></i><span>0:40</span></button></div>
+ <div class="plate">
+ <h3>Mid-century Cartoon</h3><p class="cn">50s 扁平卡通</p>
+ <p class="for">for <em>Meet Pip</em></p>
+ <p class="line">A robot vacuum set up in three steps, told like a 1950s classroom film: place the dock, connect the app, press start.</p><p class="line-cn">用 50 年代教育片的口吻,三步教你装好一台扫地机:放充电座、连 app、按开始。</p>
+ <ul class=uses aria-label="Best for"><li>Product set-up guides</li><li>Help-centre explainers</li><li>How-to steps</li></ul>
+ <nav class="links"><a class="watch" href="../styles/midcentury-toon/midcentury-toon.mp4" data-play>Watch the film</a><a href="../styles/midcentury-toon/STYLE.md" target="_blank" rel="noopener">STYLE.md</a></nav>
+ </div>
</article>
</div>
</section>
diff --git a/styles/README.md b/styles/README.md
index bfdd8a3..9b931d3 100644
--- a/styles/README.md
+++ b/styles/README.md
@@ -32,6 +32,8 @@ Users may name a style in English, in Chinese, or by its folder. Find it here, t
| Risograph Print | Risograph 丝网印刷 | [`risograph`](risograph/STYLE.md) | *Sunday Ride* |
| Halftone Dossier | 复古半调案卷 | [`halftone-dossier`](halftone-dossier/STYLE.md) | *Case File: Chubby* |
| Woodcut Print | 木刻版画 | [`woodcut`](woodcut/STYLE.md) | *The Bell Founder* |
+| Copperplate Engraving | 铜版画 | [`engraving`](engraving/STYLE.md) | *The Honeybee, Plate VII* |
+| Silkscreen Travel Poster | 丝印旅行海报 | [`silkscreen-poster`](silkscreen-poster/STYLE.md) | *Three Trails* |
## Graphic & Type · 图形与排版
@@ -53,6 +55,7 @@ Users may name a style in English, in Chinese, or by its folder. Find it here, t
| Isometric Infographic | 等距信息图 | [`iso-infographic`](iso-infographic/STYLE.md) | *From Bean to Cup* |
| Dark Tech Keynote | 暗色科技发布 | [`dark-keynote`](dark-keynote/STYLE.md) | *Room to Think* |
| Living Screencast | 活体实机录屏 | [`living-screencast`](living-screencast/STYLE.md) | *Clawd Moves In* |
+| Sci-fi Hologram HUD | 科幻全息界面 | [`hologram-hud`](hologram-hud/STYLE.md) | *Volt · Spec Scan* |
## Cartoon & Anime · 卡通与动画
@@ -61,6 +64,7 @@ Users may name a style in English, in Chinese, or by its folder. Find it here, t
| 1930s Rubber Hose Cartoon | 1930s 橡皮管卡通 | [`rubber-hose`](rubber-hose/STYLE.md) | *Coffee Cup Chase* |
| 80s Cel Anime | 80 年代赛璐璐动画 | [`cel-anime-80s`](cel-anime-80s/STYLE.md) | *City Lights, 1987* |
| Sci-Fi Sitcom Toon | 科幻情景喜剧卡通 | [`scifi-toon`](scifi-toon/STYLE.md) | *Coffee Run* |
+| Mid-century Cartoon | 50s 扁平卡通 | [`midcentury-toon`](midcentury-toon/STYLE.md) | *Meet Pip* |
## Games · 游戏
diff --git a/styles/engraving/STYLE.md b/styles/engraving/STYLE.md
new file mode 100644
index 0000000..10c7e52
--- /dev/null
+++ b/styles/engraving/STYLE.md
@@ -0,0 +1,205 @@
+# Copperplate Engraving — Style Prompt
+
+> A natural-history plate that engraves itself: the burin cuts the first line in polished copper, the proof is pulled, and the figure builds up line by line — outline, hatching, cross-hatching — until magnified roundels, engraved lettering and a hand-applied watercolour wash turn it into a finished museum plate.
+> Demo: *The Honeybee, Plate VII* (40.0 s) · `engraving.mp4` · source in `demo/` · all words from `demo/content.json`
+> References (grammar only): 19th-century natural-history plates — Ernst Haeckel, Audubon, J. O. Westwood's entomology, the *Encyclopaedia Britannica* copperplates (layout: centred specimen, numbered magnification roundels, roman capital title over an italic Latin name, "del." and "sculp." credits, the pressed plate mark); Hogarth and Gustave Doré for the burin line itself (hatching that follows the form, cross-hatching only in the half-tones, a third family only in the deepest darks, lines that swell and taper); hand-coloured plates for the flat, transparent washes laid after printing. Never copy a plate, a specimen pose, a border or a title.
+
+You are directing a 30–40 second film in the **Copperplate Engraving** style. The user gives you a topic (a specimen, an object, a place, a machine). You decide everything else and deliver a finished film. Follow this guide.
+
+---
+
+## 1. What this style is
+
+An **intaglio print**: the line is ink held in a groove that a steel burin cut into copper. Three rules:
+
+1. **Tone is made of lines, never of fills.** Light is bare paper. Half-tone is one family of parallel lines. Shadow is a second family crossing it. The deepest dark gets a third, lozenge-making family. There are no grey fills anywhere in the ink.
+2. **Every line is a burin line: it swells and tapers.** The burin enters fine, bites deeper toward the middle of its run and lifts out to a point. Lines are thicker where the form turns away from the light and vanish where it faces it. Contours are cut in several runs, so they thin slightly where one run hands over to the next. A uniform-width line reads as a pen or a vector drawing — that is the one thing this style must never look like.
+3. **Colour comes afterwards, by hand.** The print is finished in black. Colour is transparent watercolour laid flat, region by region, spilling a few pixels past the lines, pooling at its edges, granulating in the paper. The ink always sits on top. A film may stay monochrome until the colour arrives — the arrival is the event.
+
+What it is not: not a woodcut (black block with white cuts, coarse gouges — see `woodcut`), not a pen sketch (loose, broken lines — see `urban-sketch`), not an engineering drawing (see `blueprint`).
+
+## 2. Use cases: what this style is for
+
+Scene demos show a real use, not a story. This style is an **explanation card**: one object, its name, a few things you did not know about it, and where to see the real one.
+
+| Use | Shot structure | Information layers (in order) | Hold per layer | Length |
+|---|---|---|---|---|
+| **Museum object label / screen next to a case** (the demo) | copper ECU → proof pulled → pull out to the plate → 1–4 magnified details, each flying to its slot → silence → hand colouring → locked final plate | title + Latin name → detail name + term + one-line note (×N) → call to action ("see the living hive in Gallery 4") | title ≥ 2.2 s; each note ≥ chars/12 + 1 s continuously in frame when it first appears; final plate ≥ 4 s | 30–40 s |
+| **Science account "one minute on …"** | same, with the narrator carrying the notes; end on the plate as the thumbnail | hook question → name → 2–3 facts → one "wow" number → follow prompt | same | 35–60 s |
+| **Textbook figure animation** | no copper opening; start on paper at 1×, engrave the figure, then label parts with leaders one by one; no colour or colour only on the part being taught | figure → labelled parts (Fig. 1, 2, 3…) → caption | each label ≥ chars/12 + 1 s | 20–45 s |
+| **Product heritage / "how it's made" for a crafted object** (a watch, a violin, a knife) | ECU of the burin on the object's contour → build → roundels on the mechanism → colour only the material that matters (gold, varnish) | object name → 2–3 craft details → maker / edition | as above | 30–45 s |
+| **Map or site plan as a plate** | engrave the coastline or plan, roundels become insets (a building, a harbour) | place → insets → legend → visiting info | as above | 30–45 s |
+
+**How the native moves serve information**
+
+- *The cut itself* is the hook: the first frame is the burin mid-stroke in copper, curl of copper rising ahead of the point. Nothing else is on screen, so the eye has one place to go.
+- *The build* (outline → first hatching → cross-hatching → darks and hair) is the "this is a serious, made thing" beat. Keep it under 5 s and under the title.
+- *The magnification roundel* is the information carrier: a ring is scribed around the part, the inside is burnished clean and re-engraved at magnification, and the roundel flies to its slot trailing a leader line. The viewer sees *where* the detail is and *what* it looks like in one move. Its label (roman capitals, italic term, script note) is engraved when it lands.
+- *Hand colouring* is the climax. Put it after a real silence and after all information is on the plate, so it reads as reward, not as new information.
+- *The final plate* is the poster: every label, the call to action and the engravers' credits at once, locked off.
+
+## 3. Visual language
+
+**The sheet**: 1920×1080 world units = one sheet of laid paper, `#f1e8d2`, with a world-space paper texture (fibres, laid lines, sparse foxing `#9a6a34`). Plate mark (the pressed, bevelled rectangle) at (70, 44)–(1850, 1036): plate tone `#e8ddc2` at 55 % inside; bevel dark on the top/left walls, light on bottom/right (light from the upper left). Ruled border: 2.4 px rule + 0.8 px hairline 9 px inside, (100, 72)–(1820, 1008).
+
+**Ink**: `#1c1510`. World line widths at 1× zoom: outlines 1.8–2.4 (swelling ×0.45–1.35), first hatching 0.18–2.0, cross-hatching ×0.78, third family ×0.6, hair and stipple 0.6–0.9. Hatch spacing on a 600-px figure: 3.1–3.7 px (first), ×1.1 (cross), ×1.25 (third). Hatch thresholds on a 0–1 tone: first family from 0.14, crossing from 0.46–0.5, third from 0.74–0.78. Every hatch line: width × (0.2 + 0.8 · sin(πu)^0.7), tapered over the first and last 22 % of its length.
+
+**Light**: always from the upper left (`{x: −0.55, y: −0.62, z: 0.56}`); heavier outlines on the side away from it.
+
+**Lettering**: roman capitals in Bodoni Moda (title 50 px, tracking 0.16; labels 17 px, tracking 0.14), italics for Latin (20–24 px), Pinyon Script for notes (29 px, fixed size, wrapped and balanced across two lines, never shrunk). Roman letters are cut glyph by glyph (each wipes in from the left); script is written in one continuous left-to-right stroke with a soft wet edge.
+
+**Roundels**: radius 120, double rule (2 px + 0.75 px, 4 px inside), a ruled-machine ground (horizontal lines, 11 local units) behind the specimen with a white halo around it; content is drawn for a 500-unit radius and scaled in. Slots in order: upper left (300, 300), lower left (300, 700), lower right (1620, 700), upper right (1620, 300). An unused slot shows the specimen at **natural size** (plate ≈ 20 cm wide, so a 13 mm bee is 0.19× the main figure).
+
+**Leaders**: 0.95 px, from a dot on the part to the roundel's rim, routed around wings and body with ≥ 34 px clearance (one waypoint), a small italic figure number near the root.
+
+**Hand colouring (demo palette)**: abdomen amber `#d9962a`, thorax ochre `#a8743e`, head `#8a6242`, eyes `#6e4a3c`, wings pale blue-grey `#a9c3cf` (alpha 0.5), legs `#7a5a3c`, pollen `#eaa21a` (alpha 0.95). Multiply over paper; 3.5 px spill, 2/1.5 px misregister, tide-line at the wet edge, low-frequency density lift (0.55), 1–2 backruns in large regions, granulation. Each region blooms from where the brush touched over 1.25–1.6 s; regions start 0.42 s apart.
+
+**The copper (opening only)**: base `#5e2a12 → #94502c → #4e220e`, a swirl of polishing hairlines (overlay), a soft studio window reflected across the plate (four panes, blurred 14 px, over a 90 px room glow), dark room toward the frame edges. Grooves: dark trough `#240c05`, a bright burr `rgba(255,226,186)` offset toward the light, a warm glint on the far wall. The traced design shows as faint pale scratches. Burin: lozenge-section steel shaft (lit face `#d9e0e6`, shadow face `#262b30`, sharp ridge highlight), bevelled lozenge face at the point, brass ferrule, mushroom-shaped wooden handle with grain; held low and pushed along the cut — the shaft lies along the direction of travel, turned ≤ 15° (0.22 rad) just enough to show the fresh groove; swarf: a thin, narrowing copper ribbon curling irregularly ahead of the point (turns open out as it grows, an occasional twist), one edge lit and one dark so it reads as sheet metal, not a spring.
+
+## 4. Motion language
+
+- **Cutting order is the animation.** Every stroke keeps its place in the engraver's order; a group's strokes are spread over a time window at constant burin speed with 6–90 lines in progress at once. Outline first, then the first hatching sweeping across each form, then crossing lines, then darks, hair and stipple.
+- **The first line** is one stroke followed by the camera: 5.4 s long, so at frame 0 it is already a third cut.
+- **Roundels** travel on an eased arc (30 px lift at mid-flight), growing log-linearly from the part's size to 120.
+- **Colour** blooms from one point with a ragged, noise-driven front and a darker wet rim that fades as it dries.
+- Nothing fades in. Text is cut or written; colour blooms; the end card arrives on a falling tissue guard.
+
+## 5. Camera language
+
+The camera is a loupe over the plate. Beat by beat in the demo:
+
+| Beat | Camera | Why |
+|---|---|---|
+| Hook (0–2.5 s) | 4.2× on copper, **follows** the burin tip, 3° roll | one point of attention; the cut is the hook |
+| Proof pulled (2.5–3.2) | locked while the sheet peels across | the medium's own transition |
+| Build (3.2–6.2) | **pull out** 4× → 1×, log-zoom with screen-linear dolly feel | scale reveal: the curve was a bee's abdomen |
+| Detail 1 (9.4–15.0) | **push** to 4.3× on the eye; **ride with the roundel** as it lifts off and flies to its slot, easing out to a 1.45× reading frame | the signature one-take: where → what → label |
+| Detail 2 (15.0–19.4) | **tilt down** at 1.45× from the upper to the lower left, keeping detail 1's note in frame | faster, same grammar |
+| Detail 3 (19.4–23.75) | **pull back** to the full plate while the roundel flies, then **push in** to read (after detail 2's note has had its time) | acceleration; reading time respected |
+| Gather, silence, colour | full plate; a 2 % breathing push during colour | the colour moves, not the camera |
+| Final plate | locked off | the poster |
+
+Rule of thumb: a note must stay continuously in frame for chars ÷ 12 + 1 s from the moment it starts writing; plan push-ins so they never cut a note short (they can return at the final plate).
+
+## 6. Sound
+
+Three layers: room tone (a quiet workroom with a faint clock on copper; paper room after), foley keyed to picture events, and a baroque chamber score.
+
+- **Foley by material**: burin = band-passed hiss (2.6–9 kHz) with chatter clicks and a faint plate resonance (1.18/2.31/3.47 kHz); swarf = tiny 5–9 kHz pings; lift = metallic tick; press = low roller rumble (J-cut 0.35 s early) and a thump; peel = dense paper crackle; hatching = granular micro-scratches whose density rises with each pass; ring = circular scribe; burnish = soft rub; roundel flight = paper whoosh; landing = paper tap; letters = dotted ticks; notes = pen scratch at ~4 Hz strokes; colour = a falling water "plip" then a wet brush swish per region; end card = tissue rustle (J-cut).
+- **Score**: harpsichord + string quartet, 96 BPM, D major. `music/score.py` reads `events.json`: each detail section (A long / B tilt / C pull-back) is written once and placed where the film puts it; the outro shifts with the end of the details, so any number of details gets a matching score. Under narration the melody sits an octave up, out of the voice's band. Engraving sections are **all pizzicato** (the burin's small precise cuts), density growing pass by pass; each roundel = a high "ting" as the ring is scribed, a rising line as it flies, a low pizz as it lands. Before the colour: a run that stops dead, then **true silence** (1.25 s). The colour is the first time the strings use the bow. The final plate lands on a V–I cadence.
+- **Silences**: 2.0–2.5 s (burin lifted, before the press thump and the downbeat) and 25.0–26.25 s (before the first drop of water).
+- Narrator: Kokoro `bm_fable` (en-gb), speed 0.92, a gentle naturalist; music ducked to ~50 % under him (the bowed strings duck least).
+
+## 7. Subtitles & titles
+
+- Subtitles: Pinyon Script 38 px, `#2b1e14`, on a deckled paper slip (`#f4eddb`, soft shadow) at the bottom centre, max width 860, up to two lines; on 0.1 s before the line, off 0.6 s after it; never over the call to action.
+- The title is part of the plate (engraved, not a separate card). End card: a translucent tissue guard falls over the plate; on it, engraved: film title, style name, `LEMO-OPUSCAR`, `LemoLab × Claude Opus 5.5`, three credit lines.
+
+## 8. Pitfalls we hit
+
+- **Uniform line width reads as a pen drawing.** Swell every hatch line along its length and pinch contours between runs (`hatch({swell})`, `outline({run, pinch})`); keep wMin ≈ 0.18 so light areas really thin out.
+- **Wing veins must close their cells.** Random vein strokes look fake; define long veins as curves and snap cross-veins onto them (`bee.js`, `FX`).
+- **Overlapping parts need occlusion.** One ink store has no z-order; pass the occluding shapes as `excl` so lines stop at them (hatch subtracts each excluded ring separately — overlapping rings would cancel under even-odd).
+- **Leg joints drawn as full capsules look like beads.** Exclude the previous segment so only the distal cap shows.
+- **The burin hides its own groove** if the shaft lies exactly along the cut, but a large skew (30°) reads as poking beside the line. Keep it ≤ 15°.
+- **A regular helix of swarf reads as a spring.** Vary the winding, open the coils out, twist the ribbon edge-on now and then, light one edge and darken the other.
+- **Outline-only limbs look unfinished** next to a densely hatched body: every leg segment needs hatching along its axis and a dark at each joint.
+- **Two renders of the same demo folder collide**: `video.mjs` writes its segments to `<demo>/out/`, so render the main and alt films one after the other.
+- **Reflections over grooves wash them out**: draw the copper light before the grooves.
+- **A roundel frozen at small scale**: author roundel content for radius 500 and scale in; widths then stay ≥ 0.5 px at 1×.
+- **Leaders hugging a wing read as crossing it**: route with ≥ 34 px clearance.
+- **Ink.draw's early exit** must look ahead by the longest stroke duration, or a long stroke that started early never draws.
+- **Reading time vs push-ins**: a push-in that crops a just-written note violates the reading rule even if the note returns later. Plan the order of slots so consecutive details share a side.
+- Latin names: Kokoro says "Apis mellifera" acceptably but whisper can't transcribe it; use the `asr` field.
+
+## 9. Production recipe (this repo)
+
+```
+sh styles/engraving/demo/build.sh # voice → check → score → events → mix → cue check → srt → frames → mux → stills
+```
+- `demo/engine/`: `burin.js` (lines), `plate.js` (sheet, lettering, roundels), `wash.js` (colour), `copper.js` (copper, burin, swarf), `index.js` (public entry + `engraveShape`).
+- `demo/subjects/`: `bee.js`, `details.js` (eye, hamuli, corbicula roundel drawings), `scallop.js` (second built-in subject).
+- `demo/film.js`: timeline (96 BPM grid), camera, render; reads `content.json`. `demo/mix.py`: foley + voice + ducked stems. `demo/music/score.py`: the score (written by a composer sub-agent against the cue map in `TREATMENT.md`). `demo/tools/cuecheck.py`: score accents vs picture events (all within 1 frame) and the silence level.
+- Render with `core/render/video.mjs --workers 2`; frames take 60–500 ms (copper and colour frames are the slowest).
+
+## 10. Engine usage
+
+```js
+import { B, engraveShape, Wash, drawSheet, engraveText } from './engine/index.js';
+
+// 1. any shape + a light direction → an engraved figure (contour lines follow the form), cut in order
+const { ink, shape: spark } = engraveShape(
+ 'M0 -120 C12 -40 40 -12 120 0 C40 12 12 40 0 120 C-12 40 -40 12 -120 0 C-40 -12 -12 -40 0 -120 Z', // a four-pointed spark
+ { at: B.xf(860, 560, 1.9), light: [-0.6, -0.7], spacing: 4.2, style: 'contour' }); // or style: 'hatch'
+engraveShape('M0 0 H150 V26 H0 Z', { at: B.xf(1140, 740, 1), ink, g: 't' }); // its cursor tail, same ink
+ink.schedule(['ol', 'tol'], 0, 1.1, { conc: 2 }); ink.schedule(['h1', 'th1'], 0.8, 2.2, { conc: 40 });
+ink.schedule(['h2', 'th2'], 1.6, 2.7, { conc: 40 }); ink.schedule(['h3', 'th3'], 2.2, 3.0, { conc: 40 }); ink.build();
+
+// 2. the "only colour": hand-colour one element and leave everything else in black ink
+const w = new Wash({ scale: 1.5 });
+w.add({ path: spark.path, polys: spark.polys, color: '#D97757', origin: [860, 560], t0: 3.0, dur: 1.2, alpha: 0.85 });
+
+window.render = t => {
+ drawSheet(ctx); // paper, plate tone, plate mark
+ w.draw(ctx, t); // colour under the ink (omit for pure black-and-white)
+ ink.draw(ctx, t); // everything cut by time t; lines being cut grow
+ engraveText(ctx, 'THE SPARK.', 960, 170, { size: 50, weight: 600, track: 0.16, p: t - 1.5 });
+};
+```
+Runnable as `demo/example/index.html` (`node core/render/still.mjs styles/engraving/demo/example 4.5`), output in `demo/stills/engine_example.jpg`.
+
+Main functions:
+
+| Function | What it does | Key parameters |
+|---|---|---|
+| `B.shape(d, xf)` | SVG path → world rings + Path2D | `xf(x, y, scale, rot, flip)` |
+| `B.Ink` | ordered, width-bucketed stroke store | `group(name)`, `schedule(group, t0, t1, {conc})`, `instant(group)`, `draw(ctx, t, {color, wScale, dx, dy})` → tips being cut |
+| `B.hatch(ink, polys, o)` | one family of swelling lines bent to the form | `angle, spacing, bend, tone(x,y), thr, wMin, wMax, swell, excl` |
+| `B.engraveTone(ink, polys, o)` | the engraver's three passes | `angle, cross, third, t2, t3, g` |
+| `B.formTone(polys, {light})` | any shape → pillow-lit tone field (+ `.df` distance) | `light, lz, base, radius, rim` |
+| `B.contourHatch(ink, polys, o)` | lines following the form (iso-distance contours) | `spacing, tone, thr, wMax` |
+| `B.outline / B.stroke` | swelling contour / open burin stroke | `w, light, vary, run, pinch, swell, excl` |
+| `B.stipple`, `B.fur` | dots by tone; combed hair flicks | `density, r, tone` / `len, dir(x,y), curl` |
+| `B.sphereTone`, `B.cylTone`, `B.linTone`, `B.blobTone` | analytic tone fields | light from `B.LIGHT` |
+| `Wash` | hand colouring, cached per region | `add({path, polys, color, alpha, origin, t0, dur, spill, offset, lift, pool})`, `draw(ctx, t)` |
+| `drawSheet`, `borderInk` | paper, plate tone, bevel; ruled border as ink | `plate: [x0, y0, x1, y1]` |
+| `engraveText`, `writeScript`, `wrapLines` | cut roman lettering; written script; fixed-size balanced wrap | `size, weight, italic, track, align, p` |
+| `roundelFrame` | double-ruled circle scribed by `p` | `x, y, r, p, w` |
+| `Copper.drawCopper / copperLight / drawGrooves / drawBurin / drawSwarf` | the copper close-up | `zoom, lift, skew, s` |
+
+A minimal runnable example of the whole thing is `demo/film.js` with `content_alt.json` (a different subject, two details).
+
+## 11. Swap in your content
+
+`demo/content.json` drives every word, number and colour.
+
+| Field | Type | Range | If out of range |
+|---|---|---|---|
+| `title` | string | ≤ 22 characters | longer titles run past the latin line's width; shorten or drop to 44 px in `film.js` |
+| `latin` | string | ≤ 30 characters | read time grows (chars/12 + 1 s must fit before the first push at 9.4 s) |
+| `plate_no`, `series` | string | ≤ 10 / ≤ 48 characters | series collides with the title above ~48 characters |
+| `subject` | `"bee"` \| `"scallop"` | built-in subjects | unknown → `bee`; a new subject is a module returning `{ink, regions, focus}` with an `ol0` first stroke (see `subjects/scallop.js`) |
+| `details[]` | array of `{name, latin, note, focus}` | 1–4 | >4 are ignored; fewer leaves slots → the first empty one shows the natural-size figure; the timeline re-flows (first 9 beats, others 7 beats each) |
+| `details[].focus` | string | bee: `eye`, `hamuli`, `corbicula` (drawn magnifications); any subject: its `focus` keys | a key with no drawn magnification gets a live magnification of the figure itself |
+| `details[].note` | string | ≤ 60 characters (2 lines at 29 px) | a third line starts to meet the next roundel |
+| `colors[]` | `{region, color}` | regions of the subject (bee: abdomen, thorax, head, eyes, wings, legs, pollen; scallop: shell, bands, ears) | unknown regions are skipped; order = order of colouring |
+| `caption` | string | ≤ 50 characters | must stay readable ≥ chars/12 + 1 s inside the 4.4 s final plate |
+| `signature.left/right` | string | short | — |
+| `nat_size_label` | string | ≤ 16 characters | — |
+| `voice.voice`, `voice.speed`, `voice.lines[]` | Kokoro voice, 0.8–1.0, `{id, text, asr?}` | ids: `title`, `d1`…`dN`, `close` | a line longer than its section overlaps the next one; keep d-lines ≤ 4.5 s |
+| `end.film_title`, `end.style_name`, `end.credits[]` | strings | credits ≤ 3 lines of ≤ 35 characters | longer lines break the end card's reading time |
+
+Steps: edit (or copy) the JSON → `sh styles/engraving/demo/build.sh my_content.json` (TTS + whisper check, events, score re-placed from the events, mix, cue check, subtitles, frames). To keep the main film untouched, `sh styles/engraving/demo/tools/build_alt.sh my_content.json` builds everything in `demo/out/alt/` instead (the demo's `content_alt.json`, 2 details, 35.6 s, passes the cue check).
+
+Minimal example:
+
+```json
+{
+ "title": "The Great Scallop", "latin": "Pecten maximus", "plate_no": "Pl. XII",
+ "series": "Shore Gallery · Shells of the Atlantic Coast", "subject": "scallop",
+ "details": [ { "name": "Hinge", "latin": "umbo", "note": "The oldest part of the shell.", "focus": "umbo" } ],
+ "colors": [ { "region": "shell", "color": "#d98a5c" }, { "region": "bands", "color": "#a8423a" } ],
+ "caption": "Hold a real shell at the Discovery Table",
+ "voice": { "voice": "bm_fable", "speed": 0.92, "lines": [ { "id": "title", "text": "Plate twelve. The great scallop." } ] }
+}
+```
diff --git a/styles/engraving/TREATMENT.md b/styles/engraving/TREATMENT.md
new file mode 100644
index 0000000..4162006
--- /dev/null
+++ b/styles/engraving/TREATMENT.md
@@ -0,0 +1,158 @@
+# TREATMENT · 53 Copperplate Engraving · `engraving`
+
+**片名**:*The Honeybee, Plate VII*
+**场景**:博物馆展品说明屏 / 科普账号"一分钟认识 ××" / 教材配图动画。演一块真实的展柜屏:一张 19 世纪博物志图版,从铜版上的第一刀刻起,到三处放大细节、手工上色,最后落成一张能直接当展签或封面的完整图版。
+**时长**:40.0 s(场景 36.25 s + 结尾卡 3.75 s),96 BPM 网格,16 小节。
+**旁白**:要。温和的英国博物学家口吻,Kokoro `bm_fable`(备选 `bm_lewis`,制作时两者都试,选更像"讲解员"而不是"播音员"的那个)。字幕用铜版手写体(Pinyon Script),印在一张纸签上。
+**所有文字**:`demo/content.json`(标题、图版号、系列名、1–4 个细节的名称/拉丁名/注释/放大部位、配色、展签行动号召、署名、旁白台词)。
+
+---
+
+## 1. 对标(只学语法)
+
+| 对标 | 学什么 | 刻意不学 |
+|---|---|---|
+| 19 世纪博物志图版:Ernst Haeckel《自然界的艺术形态》、Audubon、Westwood/Harris 的昆虫图版、《大英百科》铜版插图 | 图版的**版式语法**:居中标本、四周编号放大圆框、罗马大写标题 + 斜体拉丁名、底部图注、左下"del."右下"sculp."署名、印压凹框 | 不抄任何一张图版的构图、标本姿态、字体设计、边饰 |
+| 贺加斯、杜雷的铜版线 | 明暗**全靠线**:顺形体的排线,半调处加交叉,最暗处再加第三组;线在暗部变粗、两端收尖;点刻做绒毛和粉末 | 不学杜雷的戏剧性黑场(那是 woodcut 和宣传片里已用过的方向) |
+| 手工上色版画(18–19 世纪着色铜版) | 墨线印完再上透明水彩:**一块一块平涂**,颜色略溢出线,边缘积色,墨线始终压在上面 | 不做厚涂、不做渐变晕染插画感 |
+| 博物馆展签 / 自然科学馆的展柜屏 | 信息层级:名称 → 学名 → 三个"你不知道的细节" → 去哪看真的 | 不做 UI、不做图标、不做数据图表 |
+
+## 2. 和库内风格的区别
+
+- **木刻 woodcut**:黑版刻白,粗刀痕,一色套印,镜像字是它的招式。本风格正相反:**凹版**,线是墨,纸是白;线是金属雕刀推出的**极细均匀线**(屏上 0.3–2 px),明暗靠疏密和交叉;彩色是**印后手涂的透明水彩**,不是第二块版。开场虽然也"刻出来",但刻的是铜(有金属屑、刻槽亮边),而且一刀之后就印成纸。
+- **钢笔淡彩 urban-sketch**:速写线松、会断、有抖动,颜色是现场淡彩。本风格的线是机械般均匀、按三遍工序严格排布,淡彩是平涂而不是洇染写生。
+- **蓝图 blueprint**:工程制图、标注尺寸、白线蓝底。本风格是博物学图版:标本、放大圆框、拉丁名、手写体注释。
+- **白板讲解 whiteboard**:边讲边画的讲解。本风格不画示意图,只刻一件标本,信息靠图版版式分层。
+- 场景用途和已有 demo 不撞:不是发布会、产地旅程、原理讲解、数据、开箱、海报、教程。是**展品说明屏**。
+- 配乐:巴洛克室内乐(羽管键琴 + 弦乐四重奏拨弦),库里没有。
+
+## 3. 信息弧
+
+| 层 | 时间 | 信息 | 这一层的动作 | 声音落点 |
+|---|---|---|---|---|
+| 钩子 | 0–2.5 | (无字)一件标本正在被刻 | 铜版大特写,雕刀推着刻槽顺着蜂腹弧线走,铜屑卷起;描稿划痕隐约露出整只蜂 | 刻刀的金属嘶声 + 屑的细碎叮声;第 1 小节后两拍羽管键琴弱起 |
+| 主标题 | 2.5–9.4 | 整体形态 → 标题 + 学名 + 图版号 | 揭印转场成纸;轮廓 → 第一遍排线 → 交叉排线 → 暗部第三遍 + 绒毛,镜头一路拉到全版;7.5 s 标题逐字刻出 | 拨弦网格进入,每遍排线一层声部;标题落在第 4 小节重拍;旁白"Plate seven…" |
+| 细节 1(签名) | 9.4–15.0 | Fig. 1 复眼 / oculus compositus / 注释 | 推进到蜂眼 → 放大圆环刻出 → 环内磨光重刻成六边形小眼 → 圆框带着引线飞到左上 → 标签刻出、注释手写 | 推镜时声部收窄;圆环一声高音"叮";圆框落位一个低音拨弦;旁白 d1 |
+| 细节 2 | 15.0–19.4 | Fig. 2 翅钩 / hamuli | 镜头下摇到左下;圆框在后翅前缘诞生,飞到左下 | 同一语法,加快 |
+| 细节 3 | 19.4–23.75 | Fig. 3 花粉篮 / corbicula | 镜头不动(全景),圆框在后腿上诞生,跳到右下 | 更快;旁白 d3 |
+| 收拢 | 23.75–25.0 | 自然大小 | 空槽里刻出一只"原大"小蜂;全版齐 | 键琴下行跑句收束 |
+| 静音 | 25.0–26.25 | — | 全版单色静止,呼吸 | **静音**(只剩极轻房间底噪) |
+| 高点 | 26.25–31.25 | 颜色 | 第一滴水落下:琥珀从蜂腹一点晕开,赭石、棕、淡蓝翅、橙色花粉依次平涂,放大圆框同步上色;旁白 close | 静音后第一个声音是水滴(全片最重要的声音之一);弦乐长音拉开 |
+| 落版 | 31.25–36.25 | 行动号召 + 署名 | 底部展签"See the living hive · Gallery 4, Observation Case 12"刻出,del./sculp. 署名;**全版静止 ≥ 4 s** | 终止式和弦,余音 |
+| 结尾卡 | 36.25–40.0 | 片名、风格名、Lemo-Opuscar、LemoLab × Claude Opus 5.5、素材署名 | 书中护页薄纸落下盖住图版,字印在薄纸上,底下图版隐约透出 | 薄纸沙沙声(J-cut 提前 0.2 s) |
+
+阅读时间:三条注释都 ≤ 45 字符,写完后在画面里一直留到片尾(细节 2、3 的机位都包含细节 1/2 的标签),另在落版全部同时在场 5 s;旁白同时念出同一信息。
+
+## 4. 原生招式
+
+1. **刻出来的明暗**:同一块形体上能看到三遍工序一层层加密——轮廓、顺形排线、交叉排线、暗部第三组、点刻绒毛。引擎按"雕刻顺序"记录每一根线,所以任何图都能按刻的顺序长出来。
+2. **放大圆框(签名镜头)**:镜头推到蜂眼,一个圆环在眼睛周围刻出来,圈内被"磨光"成白纸(铜版刻错时用刮刀磨平,这是真实工序),再以放大倍率重刻出六边形小眼;然后圆框带着引线从蜂眼飞到版面左上角,镜头一路跟着拉开。一镜到底,把"放大"这个博物志版式动作化。
+3. **手工上色**:透明水彩从笔落点晕开,湿边往外推,一块一块平涂,略溢出墨线,墨线始终压在上面。颜色是独立图层,全片前 26 秒完全单色。
+4. **印压凹框**:图版四周的斜面压痕(上左背光、下右迎光),纸纹、狐斑都在世界坐标里,镜头动时它们跟着纸走。
+5. **开场的铜版**:抛光铜面、雕刀、刻槽亮边、卷起的铜屑,然后"揭印"转成纸——告诉观众这是铜版画,不是钢笔画。
+
+## 5. 镜头表
+
+| # | 时间 | 景别 | 角度 | 运动 | 时长 | 为什么 |
+|---|---|---|---|---|---|---|
+| 1 | 0–2.5 | 大特写(铜版 5.2×) | 俯视,微斜 −3° | **跟**:机位跟着刀尖走 | 2.5 | 第一帧就是媒介最迷人的动作;跟刀尖让观众的眼睛只看一个点 |
+| 2 | 2.5–3.1 | 大特写 | 俯视 | 揭印转场(纸从铜上揭起的折线扫过画面) | 0.6 | 媒介内转场:铜 → 纸 |
+| 3 | 3.1–7.4 | 大特写 → 全景 | 俯视 | **拉**(对数变焦,屏幕线性的推拉手感) | 4.3 | 尺度揭示:那条弧线原来是一只蜂的腹部;拉的过程中排线一遍遍加密 |
+| 4 | 7.4–9.4 | 全景(整版) | 正俯 | 定 | 2.0 | 标题落版,给观众看清整张图 |
+| 5 | 9.4–10.5 | 全景 → 特写(4.3×) | 正俯 | **推** | 1.1 | 眼睛被带到唯一的信息点:蜂眼 |
+| 6 | 10.5–13.4 | 特写 → 中景(1.45×) | 正俯,微滚 0.6° → 0 | **跟 + 拉**:机位骑着圆框飞到左上 | 2.9 | 签名镜头:放大圆框和引线的因果关系在一个镜头里说完 |
+| 7 | 13.4–15.0 | 中景(左上半版) | 正俯 | 定 | 1.6 | 读标签 |
+| 8 | 15.0–17.9 | 中景 | 正俯 | **下摇**(左上 → 左下),过程中轻推到 2× 再回 1.45× | 2.9 | 第二个细节,同语法加速;机位保留细节 1 的标签 |
+| 9 | 17.9–19.4 | 中景(左下半版) | 正俯 | 定 | 1.5 | 读标签 |
+| 10 | 19.4–25.0 | 全景 | 正俯 | 定(锁定,只有 1.2% 的呼吸推) | 5.6 | 节奏收:机位不动,动作只在版上;让前两条标签全程可读 |
+| 11 | 25.0–26.25 | 全景 | 正俯 | 定 | 1.25 | 静音、呼吸 |
+| 12 | 26.25–31.25 | 全景 | 正俯,滚 −0.1° | **缓推**(1.0 → 1.018 → 1.0,几乎不可察) | 5.0 | 高点时镜头克制,运动交给颜色 |
+| 13 | 31.25–36.25 | 全景 | 正俯 | 锁定 | 5.0 | 落版,可截图 |
+| 14 | 36.25–40.0 | 全景 | — | 护页薄纸**降下**(画内元素的垂直运动) | 3.75 | 媒介内转场到结尾卡 |
+
+运动种类:跟、拉、推、跟拉复合、下摇、微推、画内元素降下,≥ 4 种。景别:大特写 / 特写 / 中景 / 全景。
+
+## 6. 分镜节拍表 & cue map(96 BPM,1 拍 = 0.625 s,1 小节 = 2.5 s)
+
+| 小节 | 时间 | 配器 | 情绪 | 卡点 |
+|---|---|---|---|---|
+| 1 | 0.0 | 无音乐;刻刀嘶声 + 铜屑 | 专注 | 1.875(第 4 拍)羽管键琴弱起两音;2.0 刀抬起,0.5 s 近静音 |
+| 2 | 2.5 | 拨弦四重奏(大提琴根音 + 中提琴八分音)+ 羽管键琴通奏低音 | 开始工作 | **2.5 揭印 = 下拍**;轮廓线落在八分音网格 |
+| 3 | 5.0 | + 第二小提琴拨弦十六分音 | 加密 | 4.9 交叉排线开始(≈ 第 3 小节 4 拍前);5.6 第三遍 |
+| 4 | 7.5 | + 羽管键琴分解和弦 | 成形 | **7.5 标题刻出 = 下拍**;旁白 title 7.65 |
+| 5 | 10.0 | 声部收窄,只剩键琴高音 + 大提琴持续音 | 凝视 | 10.48 推镜到位;10.43 圆环"叮"(第 5 小节第 2 拍前);11.28 起飞 |
+| 6 | 12.5 | 拨弦回来 | 揭示 | 12.78 圆框落位 = 第 6 小节第 1 拍后半,低音拨弦;12.68 名称 |
+| 7 | 15.0 | 同 5–6,缩短 | 加速 | 15.0 下摇起;15.7 圆环;16.8 落位 |
+| 8 | 17.5 | | | 17.3 名称;17.8 注释 |
+| 9 | 20.0 | 第一小提琴旋律进入(一句,8 拍) | 更快 | 19.4 细节 3 开始(小节中);20.1 圆环;21.6 落位 |
+| 10 | 22.5 | | | 21.7 名称 |
+| 11 | 25.0 | 键琴下行跑句(23.75–25.0)→ **25.0 全静音** | 屏息 | 23.75 原大小蜂开始刻;**25.0–26.25 静音** |
+| 12 | 26.25 | 水滴;弦乐四重奏拉弓长音(第一次用弓) | 绽放 | **26.35 第一滴水 = 静音后第一个声音**;之后每 0.42 s 一滴 |
+| 13 | 28.75 | 弦乐 + 键琴装饰 | 温暖 | 旁白 close 26.8 |
+| 14 | 31.25 | 终止式(V–I),31.25 下拍 | 完成 | **31.25 展签刻出 = 下拍**;32.25/32.45 署名两下 |
+| 15 | 33.75 | 主和弦余音 + 拨弦一声 | 回响 | 33.75 最后一拨 |
+| 16 | 36.25 | 余音消失,薄纸沙沙 | 合上 | 36.05 薄纸声 J-cut;36.25 结尾卡 |
+
+快慢:开场极慢(一根线)→ 第 2–4 小节快速加密(几千根线)→ 细节 1 长(9 拍)→ 细节 2、3 各 7 拍,镜头越来越少动 → 静音 → 上色慢 → 落版定。
+
+卡点自检:制作时仿 microgame 的 `cuecheck.py`,把 `window.EV` 导出的每个事件对齐 96 BPM 网格(容差 ±1 帧),不在网格上的写明理由(例如旁白起点按语句重音对齐)。
+
+## 7. 声音设计表
+
+| 段落 | 环境底 | 主要拟音 | 音乐状态 |
+|---|---|---|---|
+| 钩子(铜版) | 安静的刻版室:极低的房间底噪 + 远处座钟滴答(很轻) | 雕刀推进的金属嘶声(连续、随曲率变调)、铜屑卷起的细碎高频叮声、刀抬起的一下"嗒" | 无,最后两拍键琴弱起(J-cut 进下一场) |
+| 揭印 | 同上 → 纸的房间音 | 压印机滚筒的低沉滚动(提前 0.25 s,J-cut)、纸从铜版揭起的撕贴声;刻刀嘶声尾巴拖进纸面(L-cut) | 拨弦进入 |
+| 排线加密 | 纸面房间音 | 细密的刻线沙沙声(颗粒合成,密度跟当前正在刻的线数走)、每一遍开始时一声轻"刮" | 拨弦逐层加声部 |
+| 标题 | 同 | 每个字母一下极轻的点刻"嗒" | 键琴分解和弦 |
+| 放大细节 | 同 | 圆环:一声金属"叮"(刀尖划圆);磨光:刮刀的软"嘘";圆框飞行:纸滑动的轻 whoosh;落位:一个低音拨弦 + 纸"啪";手写注释:鹅毛笔在纸上的划写声 | 推镜时收窄,落位后回来;旁白时 ducking −6 dB |
+| 静音 | 近乎无声(只留 −50 dB 底噪) | 无 | 无 |
+| 上色 | 纸面房间音 + 极轻的水杯声 | 第一滴水"嘀"、笔毛落纸的湿声、颜料晕开的细微湿响(每块颜色一声) | 弦乐拉弓长音 |
+| 落版 | 纸面房间音 | 展签刻字的"嗒"、两个署名的轻点 | 终止式,余音 |
+| 结尾卡 | 渐弱 | 护页薄纸落下的沙沙声(J-cut) | 余音消失 |
+
+两处静音:2.0–2.5(刀抬起后的一口气,之后是揭印的"咚"+ 音乐下拍);25.0–26.25(上色前,之后是第一滴水)。
+J/L-cut:①键琴弱起提前进揭印 ②压印滚筒提前 0.25 s ③刻刀嘶声拖进纸面 ④水滴先于颜色可见 ⑤护页沙沙声先于画面。
+
+## 8. 字幕设计
+
+- 旁白字幕印在一张**手裁纸签**上(米白、毛边、一点投影),位于画面底部中央,最宽 860 px;字体 Pinyon Script(铜版手写体)40 px,最多两行,墨色 `#2b1e14`。
+- 纸签避开标签区:细节 2 的机位把左下标签抬到屏幕 y < 910,字幕在 y > 960。
+- 每句字幕停留 = 语音 + 0.6 s(至少 1.8 s),淡入 0.25 s。落版和结尾卡无字幕。
+- `.srt` 由同一份 subs 数据导出。
+
+## 9. 版面系统(content.json 驱动)
+
+- 1920×1080 世界坐标 = 一张纸;印压凹框 (70,44)–(1850,1036);双线边框 (100,72)–(1820,1008)。
+- 标本居中 (960, 606);四个圆框槽位 UL / LL / LR / UR(中心 x 300 / 1620,y 300 / 700,半径 120),细节按顺序占 UL → LL → LR → UR,放大部位自动取离槽位同侧的那只眼 / 翅 / 腿。
+- 细节 1–4 条:第一条 9 拍(签名镜头),其余各 7 拍;后面的段落整体顺延。细节少于 4 条时,第一个空槽刻"原大小"标本。
+- 注释超宽先缩字号(29 → 25 px),再自动折两行。
+- 换内容 = 改 JSON(关卡 2 交 `content_alt.json` 证明)。
+
+## 10. 风险与待定
+
+- 标本是代码画的"蜂":主体比例和解剖做了功课(复眼、单眼、膝状触角、翅脉、翅钩、花粉篮),但腹部条纹仍偏规整,腿偏细。制作阶段继续打磨。
+- `subject` 字段目前只有内置 `bee`;换成别的标本需要写新的 subject 模块(引擎的 `engraveShape()` 可以把任意 SVG 形状刻出来,但复杂标本仍需手写)。这点在 STYLE.md §11 写清楚。
+
+---
+
+## 11. 关卡 1 之后的修订(制作版,以此为准)
+
+按关卡 1 审查意见改动,成片以下列时间为准(96 BPM 网格不变,总长 40.0 s):
+
+| 段落 | 时间 | 变化 |
+|---|---|---|
+| 钩子 | 0–2.5 | 铜版重做:抛光划痕 + 窗户倒影;刻槽内暗外亮(铜毛刺);蘑菇木柄、菱形截面钢杆、斜切刀面、铜箍;铜屑是刀尖**前方**长出的螺旋薄带。镜头 4.2× 跟刀尖 |
+| 揭印 | 2.5–3.2 | 折线从右下扫向左上,先揭到刻线;卷起的纸背透出**反向**的印痕 |
+| 成形 + 拉远 | 2.6–6.9 | 全片线条改为雕刀线:两头尖、中间粗,轮廓分几刀、交接处收细;暗部粗密、亮部细到消失 |
+| 标题 | 6.25 | 拉丁名改短为 *Apis mellifera*(阅读时间够到 9.4 的推镜前);系列名和图版号挪到 23.75 全景时刻出 |
+| 细节 1 | 9.375–15.0 | 不变(签名一镜到底,机位骑着圆框飞) |
+| 细节 2 | 15.0–19.375 | 从细节 1 的机位**下摇**到左下,细节 1 的注释全程在画内 |
+| 细节 3 | 19.375–23.75 | 先**拉回全景**(圆框在全景里飞到右下),22.3 细节 2 注释读够后再**推进**读细节 3 |
+| 收拢 | 23.75–25.0 | 拉回全景,刻出"Natural size"原大小蜂、系列名、图版号 |
+| 静音 | 25.0–26.25 | 实测 −52.8 dBFS(只剩房间底噪) |
+| 上色 | 26.25–31.25 | 水彩重做:水痕边(外缘积色)、局部浓淡、回流花、纸纹颗粒、略溢出墨线、错版 |
+| 落版 | 31.25–35.625 | 展签改为 "See the living hive in Gallery 4"(32 字符,4.3 s 可读) |
+| 结尾卡 | 35.625–40.0 | 护页落下;署名三行各 ≤ 35 字符 |
+
+其它:注释字号统一 29 px,超宽折行并两行均衡;引线 1 改道从翅膀上方绕过(与翅、体保持 ≥ 34 px);蜜蜂复眼改为贴头两侧的肾形,腹节改为前后覆叠 + 绒毛带 + 轮廓台阶,翅脉按蜜蜂真实翅脉重画(长缘室 + 3 个亚缘室 + 2 个中室,横脉吸附到纵脉上);FIG. 3 重画为直立胫节:凹面、两侧长毛流苏、压实的花粉团、下方基跗节的花粉梳。
diff --git a/styles/engraving/demo/CREDITS b/styles/engraving/demo/CREDITS
new file mode 100644
index 0000000..0a1d233
--- /dev/null
+++ b/styles/engraving/demo/CREDITS
@@ -0,0 +1,27 @@
+The Honeybee, Plate VII — Copperplate Engraving (Lemo-Opuscar)
+All drawings, lettering layout, animation, sound effects and music are original and generated by code in this folder.
+
+MUSIC (music/score.py, original composition, D major, 96 BPM)
+Harpsichord; solo violin, violins, violas, cellos, contrabass (pizzicato and arco).
+Samples (CC0): VS Chamber Orchestra: Community Edition and the Versilian Community Sample Library (Versilian Studios).
+
+SOUND EFFECTS
+Synthesised in mix.py with numpy / core/audio/sfx.py: burin scrape and plate ring, swarf pings, press roller,
+paper peel, granular hatching, pen scratch, water drop, wet brush, tissue rustle, room tone.
+
+VOICE
+Kokoro-82M (Apache-2.0) via kokoro-onnx, voice bm_fable (en-gb).
+
+FONTS (SIL Open Font License 1.1, OFL.txt in fonts/)
+Bodoni Moda (engraved roman capitals and italics) · Pinyon Script (copperplate script notes and subtitles).
+
+ANATOMY REFERENCE (reference only, nothing traced or copied)
+Honeybee wing venation, hamuli and corbicula after the public-domain diagrams in R. E. Snodgrass,
+"Anatomy and Physiology of the Honeybee" (1925) and "The Anatomy of the Honey Bee" (USDA Bulletin 18, 1910).
+Facts: compound eye of the worker ≈ 4,500–7,000 ommatidia ("some six thousand"); a worker's lifetime yield
+≈ 1/12 teaspoon of honey (commonly cited figure from beekeeping extension literature).
+
+STYLE REFERENCES (grammar only, nothing copied)
+19th-century natural-history plates (Haeckel, Audubon, Westwood, the Encyclopaedia Britannica copperplates);
+Hogarth and Doré for burin line and cross-hatching; hand-coloured plates for the watercolour washes.
+The burin line engine began as a copy of the Opuscar 98 set engine (promo, not published) and was extended here.
diff --git a/styles/engraving/demo/build.sh b/styles/engraving/demo/build.sh
new file mode 100644
index 0000000..865cc88
--- /dev/null
+++ b/styles/engraving/demo/build.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+# Rebuild "The Honeybee, Plate VII" from scratch: sh styles/engraving/demo/build.sh [content.json]
+# Swap in your own content: write a JSON like content.json and pass its name (it must live in this demo folder).
+set -e
+cd "$(dirname "$0")/../../.."
+PY=.venv/bin/python; D=styles/engraving/demo; O=styles/engraving; C=${1:-content.json}
+# 1. voice lines from the content file → Kokoro (bm_fable, en-gb) → whisper check
+$PY -c "import json,sys; c=json.load(open('$D/$C')); v=c['voice']; json.dump([dict(id=l['id'],text=l['text'],voice=v['voice'],speed=v.get('speed',.92),lang='en-gb',**({'asr':l['asr']} if 'asr' in l else {})) for l in v['lines']], open('$D/lines.json','w'), indent=1)"
+$PY core/tts/tts.py $D/lines.json $D/voices
+$PY core/tts/asr_check.py $D/lines.json $D/voices
+# 2. original baroque score → music/score.wav + stems
+$PY $D/music/score.py
+# 3. picture events → events.json; cue check (score accents ↔ picture); sound mix
+node $D/tools/events.mjs $D $C
+$PY $D/mix.py
+$PY $D/tools/cuecheck.py
+# 4. subtitles
+$PY $D/tools/subs.py $C && $PY core/render/srt.py $D/out/subs.json $O/engraving.srt
+# 5. frames (through the batch render gate when it exists) → mux at −14 LUFS with grain 4
+G="" # 整机渲染限流已在 core/render/video.mjs 里
+$G node core/render/video.mjs $D --fps 24 --workers 2 --q "content=$C" --out $D/out/video.mp4
+sh core/render/mux.sh $D/out/video.mp4 $D/mix.wav $O/engraving.mp4 24 4
+# 6. stills
+node core/render/still.mjs $D 30.9 --q "content=$C&nosub=1" --out $D/out/still --prefix sf_ && cp $D/out/still/sf_30.9.jpg $D/stills/styleframe.jpg
+node core/render/still.mjs $D 33.5 --q "content=$C&nosub=1" --out $D/out/still --prefix po_ && cp $D/out/still/po_33.5.jpg $O/poster.jpg
diff --git a/styles/engraving/demo/content.json b/styles/engraving/demo/content.json
new file mode 100644
index 0000000..cc1fd65
--- /dev/null
+++ b/styles/engraving/demo/content.json
@@ -0,0 +1,100 @@
+{
+ "plate_no": "Pl. VII",
+ "series": "Natural History Gallery · Insects of the Garden",
+ "title": "The Honeybee",
+ "latin": "Apis mellifera",
+ "subject": "bee",
+ "details": [
+ {
+ "name": "Compound Eye",
+ "latin": "oculus compositus",
+ "note": "Some six thousand facets, each one a lens.",
+ "focus": "eye"
+ },
+ {
+ "name": "Wing Hooks",
+ "latin": "hamuli",
+ "note": "A row of tiny hooks locks both wings as one.",
+ "focus": "hamuli"
+ },
+ {
+ "name": "Pollen Basket",
+ "latin": "corbicula",
+ "note": "A fringed hollow that carries pollen home.",
+ "focus": "corbicula"
+ }
+ ],
+ "colors": [
+ {
+ "region": "abdomen",
+ "color": "#d9962a"
+ },
+ {
+ "region": "thorax",
+ "color": "#a8743e"
+ },
+ {
+ "region": "head",
+ "color": "#8a6242"
+ },
+ {
+ "region": "eyes",
+ "color": "#6e4a3c"
+ },
+ {
+ "region": "wings",
+ "color": "#a9c3cf"
+ },
+ {
+ "region": "legs",
+ "color": "#7a5a3c"
+ },
+ {
+ "region": "pollen",
+ "color": "#eaa21a"
+ }
+ ],
+ "caption": "See the living hive in Gallery 4",
+ "signature": {
+ "left": "Lemo del.",
+ "right": "Opus sculp."
+ },
+ "voice": {
+ "voice": "bm_fable",
+ "speed": 0.92,
+ "lines": [
+ {
+ "id": "title",
+ "text": "Plate seven. The honeybee: Apis mellifera.",
+ "asr": "Plate seven the honeybee a piece mellafura"
+ },
+ {
+ "id": "d1",
+ "text": "Each eye is built from some six thousand facets, and every one of them is a lens.",
+ "asr": "Each eye is built from some 6000 facets and every one of them is a lens"
+ },
+ {
+ "id": "d2",
+ "text": "In flight, a row of tiny hooks locks the two wings into one."
+ },
+ {
+ "id": "d3",
+ "text": "And on the hind leg, a basket, for carrying pollen home."
+ },
+ {
+ "id": "close",
+ "text": "A lifetime of such work makes a twelfth of a teaspoon of honey."
+ }
+ ]
+ },
+ "end": {
+ "film_title": "The Honeybee, Plate VII",
+ "style_name": "Copperplate Engraving",
+ "credits": [
+ "Voice · Kokoro TTS (Apache-2.0)",
+ "Type · Bodoni Moda · Pinyon Script",
+ "Score & sound · written in code"
+ ]
+ },
+ "nat_size_label": "Natural size"
+}
\ No newline at end of file
diff --git a/styles/engraving/demo/content_alt.json b/styles/engraving/demo/content_alt.json
new file mode 100644
index 0000000..4206f17
--- /dev/null
+++ b/styles/engraving/demo/content_alt.json
@@ -0,0 +1,74 @@
+{
+ "plate_no": "Pl. XII",
+ "series": "Shore Gallery · Shells of the Atlantic Coast",
+ "title": "The Great Scallop",
+ "latin": "Pecten maximus",
+ "subject": "scallop",
+ "details": [
+ {
+ "name": "Hinge",
+ "latin": "umbo",
+ "note": "The oldest part of the shell, where its growth began.",
+ "focus": "umbo"
+ },
+ {
+ "name": "Growth Lines",
+ "latin": "lineae incrementi",
+ "note": "One ring for every season of slow growth.",
+ "focus": "growth"
+ }
+ ],
+ "colors": [
+ {
+ "region": "shell",
+ "color": "#d98a5c"
+ },
+ {
+ "region": "bands",
+ "color": "#a8423a"
+ },
+ {
+ "region": "ears",
+ "color": "#e0b27a"
+ }
+ ],
+ "caption": "Hold a real shell at the Discovery Table",
+ "nat_size_label": "Natural size",
+ "signature": {
+ "left": "Lemo del.",
+ "right": "Opus sculp."
+ },
+ "voice": {
+ "voice": "bm_fable",
+ "speed": 0.92,
+ "lines": [
+ {
+ "id": "title",
+ "text": "Plate twelve. The great scallop.",
+ "asr": "Plate 12 the great scallop"
+ },
+ {
+ "id": "d1",
+ "text": "Every shell begins here, at the hinge, and grows outward from it."
+ },
+ {
+ "id": "d2",
+ "text": "Each fine ring marks a season, so a shell keeps its own diary."
+ },
+ {
+ "id": "close",
+ "text": "Some live for more than twenty years, and the rings count them all.",
+ "asr": "Some live for more than 20 years and the rings count them all"
+ }
+ ]
+ },
+ "end": {
+ "film_title": "The Great Scallop, Plate XII",
+ "style_name": "Copperplate Engraving",
+ "credits": [
+ "Voice · Kokoro TTS (Apache-2.0)",
+ "Type · Bodoni Moda · Pinyon Script",
+ "Score & sound · written in code"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/styles/engraving/demo/engine/burin.js b/styles/engraving/demo/engine/burin.js
new file mode 100644
index 0000000..c579792
--- /dev/null
+++ b/styles/engraving/demo/engine/burin.js
@@ -0,0 +1,463 @@
+// burin.js — a line engine for copperplate engraving in Canvas 2D.
+// Adapted from the Opuscar 98 set engine (copied, not imported) and extended for this library:
+// * every stroke keeps its place in the engraver's cutting order, so any drawing can be "cut" line by line
+// (Ink.schedule + Ink.draw(ctx, t));
+// * formTone(): any closed shape + a light direction → a modelled tone field (distance-field "pillow");
+// * contourHatch(): lines that follow the form (iso-lines of the shape's distance field);
+// * all ink is vector and bucketed by width into Path2D chunks, so a frame strokes fast and stays sharp at any zoom.
+//
+// const sh = shape('M0 0 C…Z', xf(x, y, s));
+// const ink = new Ink();
+// ink.group('outline'); outline(ink, sh.polys[0], { w: 2 });
+// ink.group('hatch'); engraveTone(ink, sh.polys, { tone: formTone(sh.polys, { light: [-1, -1] }) });
+// ink.schedule('outline', 0, 2); ink.schedule('hatch', 2, 6); ink.build();
+// ink.draw(ctx, t); // t = seconds; lines not yet cut are absent, the ones being cut grow
+export const INK = '#1c1510', PAPER = '#efe6cf';
+
+// ---------- randomness (deterministic) ----------
+export function RNG(seed = 1) {
+ let s = (seed * 2654435761) >>> 0 || 1;
+ return () => { s = (s + 0x6D2B79F5) >>> 0; let t = s; t = Math.imul(t ^ (t >>> 15), t | 1); t ^= t + Math.imul(t ^ (t >>> 7), t | 61); return ((t ^ (t >>> 14)) >>> 0) / 4294967296; };
+}
+export const hash = (a, b = 0) => { const n = Math.sin(a * 127.1 + b * 311.7) * 43758.5453; return n - Math.floor(n); };
+export function noise1(x, seed = 0) { const i = Math.floor(x), f = x - i, u = f * f * (3 - 2 * f); return hash(i, seed) * (1 - u) + hash(i + 1, seed) * u; }
+export function noise2(x, y, seed = 0) {
+ const i = Math.floor(x), j = Math.floor(y), fx = x - i, fy = y - j, ux = fx * fx * (3 - 2 * fx), uy = fy * fy * (3 - 2 * fy);
+ const a = hash(i + j * 57.1, seed), b = hash(i + 1 + j * 57.1, seed), c = hash(i + (j + 1) * 57.1, seed), d = hash(i + 1 + (j + 1) * 57.1, seed);
+ return (a * (1 - ux) + b * ux) * (1 - uy) + (c * (1 - ux) + d * ux) * uy;
+}
+export const clamp = (v, a = 0, b = 1) => v < a ? a : v > b ? b : v;
+export const mix = (a, b, t) => a + (b - a) * t;
+export const sstep = (a, b, x) => { const t = clamp((x - a) / (b - a)); return t * t * (3 - 2 * t); };
+
+// ---------- transforms ----------
+export function xf(x = 0, y = 0, s = 1, rot = 0, flip = false) {
+ const c = Math.cos(rot) * s, sn = Math.sin(rot) * s, fx = flip ? -1 : 1;
+ const f = ([px, py]) => { const X = px * fx; return [x + c * X - sn * py, y + sn * X + c * py]; };
+ f.scale = s; return f;
+}
+export const compose = (outer, inner) => { const f = p => outer(inner(p)); f.scale = (outer.scale || 1) * (inner.scale || 1); return f; };
+
+// ---------- SVG path → polylines ----------
+export function parseD(d, step = 2) {
+ const tok = d.match(/[MmLlHhVvCcSsQqTtZz]|-?(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?/g) || [];
+ const subs = []; let cur = null, x = 0, y = 0, sx = 0, sy = 0, cmd = '', lcx = 0, lcy = 0, lq = null, i = 0;
+ const num = () => +tok[i++];
+ const push = (px, py) => { cur.pts.push([px, py]); };
+ const cubic = (x1, y1, x2, y2, x3, y3) => {
+ const L = Math.hypot(x1 - x, y1 - y) + Math.hypot(x2 - x1, y2 - y1) + Math.hypot(x3 - x2, y3 - y2), n = Math.max(2, Math.ceil(L / step));
+ for (let k = 1; k <= n; k++) { const t = k / n, u = 1 - t; push(u * u * u * x + 3 * u * u * t * x1 + 3 * u * t * t * x2 + t * t * t * x3, u * u * u * y + 3 * u * u * t * y1 + 3 * u * t * t * y2 + t * t * t * y3); }
+ lcx = x2; lcy = y2; x = x3; y = y3;
+ };
+ const quad = (x1, y1, x2, y2) => {
+ const L = Math.hypot(x1 - x, y1 - y) + Math.hypot(x2 - x1, y2 - y1), n = Math.max(2, Math.ceil(L / step));
+ for (let k = 1; k <= n; k++) { const t = k / n, u = 1 - t; push(u * u * x + 2 * u * t * x1 + t * t * x2, u * u * y + 2 * u * t * y1 + t * t * y2); }
+ lq = [x1, y1]; x = x2; y = y2;
+ };
+ const line = (x2, y2) => {
+ const L = Math.hypot(x2 - x, y2 - y), n = Math.max(1, Math.ceil(L / (step * 3)));
+ for (let k = 1; k <= n; k++) push(x + (x2 - x) * k / n, y + (y2 - y) * k / n);
+ x = x2; y = y2;
+ };
+ while (i < tok.length) {
+ if (/[A-Za-z]/.test(tok[i])) cmd = tok[i++];
+ const rel = cmd === cmd.toLowerCase(), C = cmd.toUpperCase(), ox = rel ? x : 0, oy = rel ? y : 0;
+ if (C !== 'C' && C !== 'S') lcx = NaN;
+ if (C !== 'Q' && C !== 'T') lq = null;
+ switch (C) {
+ case 'M': { x = num() + ox; y = num() + oy; sx = x; sy = y; cur = { pts: [[x, y]], closed: false }; subs.push(cur); cmd = rel ? 'l' : 'L'; break; }
+ case 'L': line(num() + ox, num() + oy); break;
+ case 'H': line(num() + ox, y); break;
+ case 'V': line(x, num() + oy); break;
+ case 'C': { const a = num() + ox, b = num() + oy, c = num() + ox, dd = num() + oy, e = num() + ox, f = num() + oy; cubic(a, b, c, dd, e, f); break; }
+ case 'S': { const a = isNaN(lcx) ? x : 2 * x - lcx, b = isNaN(lcx) ? y : 2 * y - lcy; const c = num() + ox, dd = num() + oy, e = num() + ox, f = num() + oy; cubic(a, b, c, dd, e, f); break; }
+ case 'Q': { const a = num() + ox, b = num() + oy, c = num() + ox, dd = num() + oy; quad(a, b, c, dd); break; }
+ case 'T': { const a = lq ? 2 * x - lq[0] : x, b = lq ? 2 * y - lq[1] : y; quad(a, b, num() + ox, num() + oy); break; }
+ case 'Z': { if (Math.hypot(x - sx, y - sy) > 0.01) line(sx, sy); cur.closed = true; x = sx; y = sy; cur.pts.pop(); break; }
+ default: i++;
+ }
+ }
+ return subs.filter(s => s.pts.length > 1);
+}
+export function toPath(subs, path = new Path2D()) {
+ for (const s of subs) { s.pts.forEach(([x, y], k) => k ? path.lineTo(x, y) : path.moveTo(x, y)); if (s.closed) path.closePath(); }
+ return path;
+}
+export function bboxOf(polys, pad = 0) {
+ let x0 = Infinity, y0 = Infinity, x1 = -Infinity, y1 = -Infinity;
+ for (const p of polys) for (const [x, y] of p) { if (x < x0) x0 = x; if (y < y0) y0 = y; if (x > x1) x1 = x; if (y > y1) y1 = y; }
+ return [x0 - pad, y0 - pad, x1 + pad, y1 + pad];
+}
+// shape(d, f): an SVG path placed in the world. polys = closed rings, lines = open subpaths.
+export function shape(d, f = xf(), step = 2) {
+ const s = f.scale || 1, subs = parseD(d, step / s).map(sp => ({ pts: sp.pts.map(f), closed: sp.closed }));
+ return fromSubs(subs);
+}
+export function fromSubs(subs) {
+ const polys = subs.filter(x => x.closed).map(x => x.pts), lines = subs.filter(x => !x.closed).map(x => x.pts);
+ return { subs, polys, lines, path: toPath(subs), bbox: bboxOf(subs.map(x => x.pts)) };
+}
+export const ring = pts => fromSubs([{ pts, closed: true }]);
+export function ellipsePts(cx, cy, rx, ry, rot = 0, n = 64, a0 = 0, a1 = Math.PI * 2) {
+ const c = Math.cos(rot), s = Math.sin(rot), out = [];
+ const full = Math.abs(a1 - a0 - Math.PI * 2) < 1e-6;
+ for (let k = 0; k < (full ? n : n + 1); k++) { const a = a0 + (a1 - a0) * k / n, x = Math.cos(a) * rx, y = Math.sin(a) * ry; out.push([cx + c * x - s * y, cy + s * x + c * y]); }
+ return out;
+}
+export const ellipse = (cx, cy, rx, ry, rot = 0, n = 72) => ring(ellipsePts(cx, cy, rx, ry, rot, n));
+export function inPoly(polys, x, y) {
+ let ins = false;
+ for (const p of polys) for (let i = 0, j = p.length - 1; i < p.length; j = i++) {
+ const [xi, yi] = p[i], [xj, yj] = p[j];
+ if ((yi > y) !== (yj > y) && x < (xj - xi) * (y - yi) / (yj - yi) + xi) ins = !ins;
+ }
+ return ins;
+}
+// inside any of several (possibly overlapping) rings
+export const inAny = (polys, x, y) => { for (const p of polys) if (inPoly([p], x, y)) return true; return false; };
+export function resample(pts, step) {
+ const out = [pts[0]]; let acc = 0;
+ for (let i = 1; i < pts.length; i++) {
+ const [ax, ay] = pts[i - 1], [bx, by] = pts[i]; const d = Math.hypot(bx - ax, by - ay); let t0 = 0;
+ if (d < 1e-9) continue;
+ while (acc + d * (1 - t0) >= step) { const need = step - acc, t = t0 + need / d; out.push([ax + (bx - ax) * t, ay + (by - ay) * t]); t0 = t; acc = 0; }
+ acc += d * (1 - t0);
+ }
+ const last = pts[pts.length - 1], o = out[out.length - 1];
+ if (Math.hypot(o[0] - last[0], o[1] - last[1]) > 0.5) out.push(last);
+ return out;
+}
+export function normals(P, closed) {
+ const n = P.length, N = [];
+ for (let i = 0; i < n; i++) {
+ const a = P[closed ? (i - 1 + n) % n : Math.max(0, i - 1)], b = P[closed ? (i + 1) % n : Math.min(n - 1, i + 1)];
+ const dx = b[0] - a[0], dy = b[1] - a[1], L = Math.hypot(dx, dy) || 1; N.push([dy / L, -dx / L]);
+ }
+ return N;
+}
+export const polyArea = P => { let s = 0; for (let i = 0; i < P.length; i++) { const [x1, y1] = P[i], [x2, y2] = P[(i + 1) % P.length]; s += x1 * y2 - x2 * y1; } return s / 2; };
+// offset a closed ring outward by d(i) (negative = inward). Fine for the mostly convex shapes of a specimen.
+export function offsetRing(P, d) {
+ const N = normals(P, true), sg = polyArea(P) > 0 ? 1 : -1;
+ return P.map((p, i) => { const k = typeof d === 'function' ? d(i, p) : d; return [p[0] - N[i][0] * sg * k, p[1] - N[i][1] * sg * k]; });
+}
+// sample a polyline by arc length: returns point + tangent at fraction u
+export function along(P, u) {
+ let L = 0; const seg = []; for (let i = 1; i < P.length; i++) { const d = Math.hypot(P[i][0] - P[i - 1][0], P[i][1] - P[i - 1][1]); seg.push(d); L += d; }
+ let s = clamp(u) * L;
+ for (let i = 0; i < seg.length; i++) {
+ if (s <= seg[i] || i === seg.length - 1) { const f = seg[i] ? clamp(s / seg[i]) : 0, a = P[i], b = P[i + 1]; return { x: a[0] + (b[0] - a[0]) * f, y: a[1] + (b[1] - a[1]) * f, dx: (b[0] - a[0]) / (seg[i] || 1), dy: (b[1] - a[1]) / (seg[i] || 1), L }; }
+ s -= seg[i];
+ }
+ return { x: P[0][0], y: P[0][1], dx: 1, dy: 0, L };
+}
+
+// ---------- the ink store: ordered strokes, width-bucketed Path2D chunks ----------
+const WB0 = 0.22, WBR = 1.13, NB = 34;
+export const BW = Array.from({ length: NB }, (_, b) => WB0 * Math.pow(WBR, b));
+const bucket = w => Math.max(0, Math.min(NB - 1, Math.round(Math.log(w / WB0) / Math.log(WBR))));
+export class Ink {
+ constructor({ color = INK, minW = 0.16, chunk = 160 } = {}) { this.color = color; this.minW = minW; this.chunk = chunk; this.S = []; this.g = 'main'; this.built = false; }
+ group(name) { this.g = name; return this; }
+ // pts [[x,y]…], w number | per-point array. A width ≤ minW breaks the line (the burin lifts).
+ add(pts, w) {
+ const n = pts.length; if (n < 2) return;
+ const xy = new Float32Array(n * 2), ws = new Float32Array(n); let len = 0;
+ for (let i = 0; i < n; i++) { xy[2 * i] = pts[i][0]; xy[2 * i + 1] = pts[i][1]; ws[i] = typeof w === 'number' ? w : w[i]; if (i) len += Math.hypot(pts[i][0] - pts[i - 1][0], pts[i][1] - pts[i - 1][1]); }
+ let any = false; for (let i = 0; i < n - 1; i++) if ((ws[i] + ws[i + 1]) * 0.5 > this.minW) { any = true; break; }
+ if (!any) return;
+ let x0 = Infinity, y0 = Infinity, x1 = -Infinity, y1 = -Infinity;
+ for (let i = 0; i < n; i++) { const x = xy[2 * i], y = xy[2 * i + 1]; if (x < x0) x0 = x; if (x > x1) x1 = x; if (y < y0) y0 = y; if (y > y1) y1 = y; }
+ this.S.push({ xy, ws, n, len, g: this.g, s0: 0, s1: 0, bb: [x0, y0, x1, y1], i: this.S.length });
+ this.built = false;
+ }
+ dot(x, y, r) { this.add([[x - r * 0.02, y], [x + r * 0.02, y]], r * 2); }
+ groups() { return [...new Set(this.S.map(s => s.g))]; }
+ // Give every stroke of a group a cutting window inside [t0, t1]. Order = the order the strokes were added
+ // (hatch families sweep across the form), time ∝ cumulative cut length, so the burin keeps an even speed.
+ // conc: how many lines are being cut at once (≥1). Strokes may be reordered with opts.key(stroke).
+ schedule(group, t0, t1, { conc = 6, key = null, minDur = 0.06 } = {}) {
+ const gs = Array.isArray(group) ? group : [group];
+ let L = this.S.filter(s => gs.includes(s.g));
+ if (key) L = L.map(s => [key(s), s]).sort((a, b) => a[0] - b[0]).map(x => x[1]);
+ const tot = L.reduce((a, s) => a + s.len, 0) || 1, T = t1 - t0, v = tot / (T * conc); // burin speed, px/s
+ let acc = 0;
+ for (const s of L) {
+ const d = Math.min(T, Math.max(minDur, s.len / v));
+ let st = t0 + (acc / tot) * T, en = Math.min(t1, st + d); if (en - st < minDur) st = en - minDur;
+ s.s0 = st; s.s1 = en; acc += s.len;
+ }
+ this.built = false; return this;
+ }
+ // strokes of a group appear at once (no growth), e.g. for a finished figure
+ instant(group, t = -1) { for (const s of this.S) if (s.g === group) { s.s0 = t - 1e-3; s.s1 = t; } this.built = false; return this; }
+ build() {
+ const S = this.S.slice().sort((a, b) => a.s1 - b.s1); this.sorted = S; this.maxDur = S.reduce((m, x) => Math.max(m, x.s1 - x.s0), 0);
+ this.chunks = [];
+ for (let a = 0; a < S.length; a += this.chunk) {
+ const b = Math.min(S.length, a + this.chunk), per = new Map(); let bb = [Infinity, Infinity, -Infinity, -Infinity];
+ for (let k = a; k < b; k++) { const s = S[k]; this._runs(s, s.n - 1, per); bb = [Math.min(bb[0], s.bb[0]), Math.min(bb[1], s.bb[1]), Math.max(bb[2], s.bb[2]), Math.max(bb[3], s.bb[3])]; }
+ this.chunks.push({ a, b, t: S[b - 1].s1, bb: [bb[0] - 8, bb[1] - 8, bb[2] + 8, bb[3] + 8], paths: [...per.entries()].map(([k, p]) => [BW[k], p]) });
+ }
+ this.built = true; return this;
+ }
+ // append the runs of stroke s up to point position f (float index) into per-bucket paths
+ _runs(s, f, per) {
+ const { xy, ws } = s, last = Math.min(s.n - 1, f); let rb = -1, p = null;
+ for (let i = 0; i < last; i++) {
+ const seg = Math.min(1, last - i); if (seg <= 0) break;
+ const w = (ws[i] + ws[i + 1]) * 0.5; if (!(w > this.minW)) { rb = -1; continue; }
+ const b = bucket(w);
+ if (b !== rb) { p = per.get(b); if (!p) per.set(b, p = new Path2D()); p.moveTo(xy[2 * i], xy[2 * i + 1]); rb = b; }
+ p.lineTo(xy[2 * i] + (xy[2 * i + 2] - xy[2 * i]) * seg, xy[2 * i + 1] + (xy[2 * i + 3] - xy[2 * i + 1]) * seg);
+ }
+ }
+ // draw everything cut by time t (Infinity = all). Returns the tips being cut right now (for glints and sound).
+ draw(ctx, t = Infinity, { view = viewRect(ctx), color = this.color, wScale = 1, dx = 0, dy = 0 } = {}) {
+ if (!this.built) this.build();
+ ctx.save(); if (dx || dy) ctx.translate(dx, dy);
+ ctx.strokeStyle = color; ctx.lineCap = 'round'; ctx.lineJoin = 'round';
+ const vis = bb => !view || !(bb[2] < view[0] || bb[0] > view[2] || bb[3] < view[1] || bb[1] > view[3]);
+ let k = 0; const tips = [];
+ for (; k < this.chunks.length; k++) {
+ const c = this.chunks[k]; if (c.t > t) break;
+ if (!vis(c.bb)) continue;
+ for (const [w, p] of c.paths) { ctx.lineWidth = w * wScale; ctx.stroke(p); }
+ }
+ if (k < this.chunks.length) {
+ const per = new Map(), S = this.sorted;
+ for (let i = this.chunks[k].a; i < S.length; i++) {
+ const s = S[i]; if (s.s0 >= t) { if (s.s1 > t + this.maxDur + 1e-3) break; continue; }
+ const f = s.s1 <= t ? s.n - 1 : (s.n - 1) * clamp((t - s.s0) / (s.s1 - s.s0));
+ if (!vis(s.bb)) continue;
+ this._runs(s, f, per);
+ if (s.s1 > t) { const j = Math.min(s.n - 2, Math.floor(f)), u = f - j; tips.push([s.xy[2 * j] + (s.xy[2 * j + 2] - s.xy[2 * j]) * u, s.xy[2 * j + 1] + (s.xy[2 * j + 3] - s.xy[2 * j + 1]) * u, s.ws[j]]); }
+ }
+ for (const [b, p] of per) { ctx.lineWidth = BW[b] * wScale; ctx.stroke(p); }
+ }
+ ctx.restore();
+ return tips;
+ }
+ // time span of a group (after schedule)
+ span(group) { let a = Infinity, b = -Infinity; for (const s of this.S) if (s.g === group) { a = Math.min(a, s.s0); b = Math.max(b, s.s1); } return [a, b]; }
+ count(group) { return this.S.filter(s => !group || s.g === group).length; }
+}
+// visible world rectangle under the current transform
+export function viewRect(ctx, pad = 20) {
+ const m = ctx.getTransform().inverse(), W = ctx.canvas.width, H = ctx.canvas.height;
+ let x0 = Infinity, y0 = Infinity, x1 = -Infinity, y1 = -Infinity;
+ for (const [x, y] of [[0, 0], [W, 0], [0, H], [W, H]]) { const X = m.a * x + m.c * y + m.e, Y = m.b * x + m.d * y + m.f; x0 = Math.min(x0, X); x1 = Math.max(x1, X); y0 = Math.min(y0, Y); y1 = Math.max(y1, Y); }
+ const s = Math.hypot(m.a, m.b) * pad; return [x0 - s, y0 - s, x1 + s, y1 + s];
+}
+
+// ---------- hatching ----------
+function spans(E, b) {
+ const xs = [];
+ for (let k = 0; k < E.length; k += 4) { const B1 = E[k + 1], B2 = E[k + 3]; if ((B1 <= b) !== (B2 <= b)) xs.push(E[k] + (b - B1) / (B2 - B1) * (E[k + 2] - E[k])); }
+ xs.sort((p, q) => p - q); return xs;
+}
+function subtract(a, e) {
+ if (!e.length) return a;
+ const out = [];
+ for (let i = 0; i < a.length; i += 2) {
+ let s = a[i]; const f = a[i + 1];
+ for (let j = 0; j < e.length; j += 2) { if (e[j + 1] <= s || e[j] >= f) continue; if (e[j] > s) out.push(s, e[j]); s = Math.max(s, e[j + 1]); if (s >= f) break; }
+ if (s < f) out.push(s, f);
+ }
+ return out;
+}
+// One family of parallel lines at `angle`, bent by `bend` (parabolic about a0) so they wrap the form,
+// clipped to polys minus excl. Width follows tone(x, y): absent below thr, swelling to wMax in the darks.
+// The engraver's convention: lines taper at both ends and swell where the form turns away from the light.
+export function hatch(ink, polys, o = {}) {
+ const { angle = 0, spacing = 6, bend = 0, tone = () => 0.5, thr = 0.15, wMin = 0.18, wMax = 2.0, gamma = 1.0, step = 2.5, taper = 10,
+ jitter = 0.12, wobble = 0.35, seed = 1, excl = null, origin = null, a0 = 0, dash = 0, bend2 = 0, flipDir = false, swell = 0.8 } = o;
+ if (!polys || !polys.length) return;
+ const c = Math.cos(angle), s = Math.sin(angle), bb = bboxOf(polys), O = origin || [(bb[0] + bb[2]) / 2, (bb[1] + bb[3]) / 2];
+ const tr = ([x, y]) => { const dx = x - O[0], dy = y - O[1], A = dx * c + dy * s; return [A, -dx * s + dy * c - bend * (A - a0) * (A - a0) - bend2 * (A - a0) ** 3]; };
+ const edges = pl => { const E = []; for (const p of pl) for (let i = 0; i < p.length; i++) { const [a1, b1] = tr(p[i]), [a2, b2] = tr(p[(i + 1) % p.length]); E.push(a1, b1, a2, b2); } return E; };
+ const E = edges(polys), X = excl && excl.length ? excl.map(q => edges([q])) : null;
+ let bmin = Infinity, bmax = -Infinity; for (let k = 1; k < E.length; k += 2) { bmin = Math.min(bmin, E[k]); bmax = Math.max(bmax, E[k]); }
+ const R = RNG(seed); let li = 0;
+ for (let b = bmin + spacing * (0.3 + 0.5 * R()); b < bmax; b += spacing * (1 + (R() - 0.5) * jitter), li++) {
+ let iv = spans(E, b); if (X) for (const xe of X) { const ev = spans(xe, b); if (ev.length) iv = subtract(iv, ev); }
+ for (let k = 0; k + 1 < iv.length; k += 2) {
+ const A0 = iv[k], A1 = iv[k + 1], L = A1 - A0; if (L < 1) continue;
+ const n = Math.max(2, Math.ceil(L / step)), pts = [], ws = [];
+ for (let j = 0; j <= n; j++) {
+ const A = A0 + L * j / n, wob = (noise1(A * 0.015 + li * 3.7, seed) - 0.5) * wobble * 2;
+ const B = b + bend * (A - a0) * (A - a0) + bend2 * (A - a0) ** 3 + wob;
+ const x = O[0] + A * c - B * s, y = O[1] + A * s + B * c;
+ const tv = tone(x, y); const v = (tv - thr) / (1 - thr); let w = 0;
+ if (v > 0) w = wMin + (wMax - wMin) * Math.pow(Math.min(1, v * 1.25), gamma);
+ // the burin's swelling line: it enters fine, bites deeper toward the middle of its run and lifts out to a point
+ const uu = (A - A0) / L, tp = Math.max(taper, L * 0.22), e = Math.min(A - A0, A1 - A);
+ w *= (1 - swell) + swell * Math.pow(Math.sin(Math.PI * uu), 0.7);
+ if (e < tp) w *= Math.pow(e / tp, 0.8);
+ if (dash && noise1(A * dash + li * 9.1, seed + 7) < 0.28) w = 0;
+ pts.push([x, y]); ws.push(w);
+ }
+ if (flipDir !== (li % 2 === 1 && o.boustro)) ink.add(pts, ws); else ink.add(pts.reverse(), ws.reverse());
+ }
+ }
+}
+// the engraver's three passes: a first family where the tone asks, a crossing family in the half-tones,
+// a third (lozenge) family in the deep darks. Each pass goes in its own ink group (`${g}`, `${g}2`, `${g}3`)
+// so a film can cut them one after another.
+export function engraveTone(ink, polys, o = {}) {
+ const { angle = -0.7, spacing = 6, cross = 1.05, third = -0.5, t2 = 0.5, t3 = 0.78, wMax = 1.9, bend = 0, excl, seed = 1, g = null } = o;
+ const G = ink.g;
+ if (g) ink.group(g);
+ hatch(ink, polys, { ...o, angle, spacing, bend, wMax, seed });
+ if (g) ink.group(g + '2');
+ if (t2 !== null) hatch(ink, polys, { ...o, angle: angle + cross, spacing: spacing * 1.1, bend: -bend * 0.6, thr: t2, wMax: wMax * 0.78, seed: seed + 11, excl });
+ if (g) ink.group(g + '3');
+ if (t3 !== null) hatch(ink, polys, { ...o, angle: angle + third, spacing: spacing * 1.25, bend: bend * 0.3, thr: t3, wMax: wMax * 0.6, seed: seed + 23, excl });
+ ink.group(G);
+}
+// contour hatching along a guide curve (sleeves of a leg, the rim of an eye)
+export function hatchAlong(ink, polys, guide, o = {}) {
+ const { spacing = 6, from = 0, to = 20, tone = () => 0.5, thr = 0.15, wMin = 0.3, wMax = 1.8, taper = 10, seed = 1, excl = null, step = 2.5, wobble = 0.3 } = o;
+ const G = resample(guide, step), N = normals(G, false), R = RNG(seed);
+ for (let k = from; k <= to; k++) {
+ const off = k * spacing + (R() - 0.5) * spacing * 0.2, pts = [], ws = [];
+ const flush = () => { if (pts.length > 1) { const L = pts.length; for (let j = 0; j < L; j++) { const e = Math.min(j, L - 1 - j) * step; if (e < taper) ws[j] *= Math.pow(e / taper, 0.6); } ink.add(pts.slice(), ws.slice()); } pts.length = 0; ws.length = 0; };
+ for (let j = 0; j < G.length; j++) {
+ const wob = (noise1(j * 0.08 + k * 5.3, seed) - 0.5) * wobble * 2;
+ const x = G[j][0] + N[j][0] * (off + wob), y = G[j][1] + N[j][1] * (off + wob);
+ if (!inPoly(polys, x, y) || (excl && inPoly(excl, x, y))) { flush(); continue; }
+ const v = (tone(x, y) - thr) / (1 - thr); const w = v > 0 ? wMin + (wMax - wMin) * Math.min(1, v * 1.25) : 0;
+ pts.push([x, y]); ws.push(w);
+ }
+ flush();
+ }
+}
+// swelling outline: heavier on the side turned from the light, slightly irregular, tapered on open strokes
+export function outline(ink, pts, o = {}) {
+ const { w = 2, closed = true, light = [-0.6, -0.8], vary = 0.8, taper = 14, seed = 3, step = 2, excl = null, grain = 0.2, w0 = null, w1 = null, run = 110, pinch = 0.55, swell = true } = o;
+ let P = resample(closed ? [...pts, pts[0]] : pts, step); if (closed) P.pop();
+ const n = P.length; if (n < 2) return;
+ const N = normals(P, closed), sg = closed ? (polyArea(P) > 0 ? 1 : -1) : 1, L = Math.hypot(...light), lx = light[0] / L, ly = light[1] / L;
+ const ws = [];
+ for (let i = 0; i < n; i++) {
+ let wi = w;
+ if (closed) { const sh = -(N[i][0] * sg * lx + N[i][1] * sg * ly); wi *= 1 - vary * 0.45 + vary * 0.9 * clamp(sh * 0.5 + 0.5); }
+ wi *= 1 + (noise1(i * step * 0.03, seed) - 0.5) * grain * 2;
+ // a contour is cut in several runs of the burin; each run swells and thins where the next one takes over
+ if (closed && run) { const ph = (i * step) / run + noise1(i * step / run * 0.7, seed + 5) * 0.6; wi *= (1 - pinch) + pinch * Math.pow(Math.abs(Math.sin(Math.PI * ph)), 0.55); }
+ if (!closed) { const Lt = (n - 1) * step, tp = swell ? Math.max(taper, Lt * 0.3) : taper, e0 = i * step, e1 = (n - 1 - i) * step; wi *= Math.pow(Math.min(1, e0 / tp), 0.75) * Math.pow(Math.min(1, e1 / tp), 0.75) * (swell ? 0.75 + 0.25 * Math.sin(Math.PI * i / (n - 1)) : 1); if (w0 != null || w1 != null) wi *= mix(w0 ?? 1, w1 ?? 1, i / (n - 1)); }
+ if (excl && inAny(excl, P[i][0], P[i][1])) wi = 0;
+ ws.push(wi);
+ }
+ if (closed) { P.push(P[0]); ws.push(ws[0]); }
+ ink.add(P, ws);
+}
+export const stroke = (ink, pts, w = 1.4, o = {}) => outline(ink, pts, { closed: false, w, taper: o.taper ?? 16, grain: 0.15, ...o });
+// stipple (flesh of a surface, dust, pollen): dots whose density follows tone
+export function stipple(ink, polys, { density = 0.02, tone = () => 0.5, r = 0.7, seed = 5, thr = 0.2, excl = null } = {}) {
+ const bb = bboxOf(polys), R = RNG(seed), n = Math.floor((bb[2] - bb[0]) * (bb[3] - bb[1]) * density);
+ const pts = [];
+ for (let i = 0; i < n; i++) { const x = bb[0] + R() * (bb[2] - bb[0]), y = bb[1] + R() * (bb[3] - bb[1]); if (!inPoly(polys, x, y) || (excl && inAny(excl, x, y))) continue; const t = tone(x, y); if (R() < (t - thr) * 1.4) pts.push([x, y, r * (0.6 + t)]); }
+ pts.sort((a, b) => a[1] - b[1] || a[0] - b[0]);
+ for (const [x, y, rr] of pts) ink.dot(x, y, rr);
+}
+// hair / fur: short tapered flicks rooted inside the shape, combed along dir(x,y) (unit vector), longer at the rim.
+export function fur(ink, polys, { density = 0.01, len = 10, dir = () => [0, 1], w = 0.9, seed = 9, tone = () => 0.6, curl = 0.25, rimOut = 1, excl = null } = {}) {
+ const bb = bboxOf(polys), R = RNG(seed), n = Math.floor((bb[2] - bb[0]) * (bb[3] - bb[1]) * density);
+ const out = [];
+ for (let i = 0; i < n; i++) {
+ const x = bb[0] + R() * (bb[2] - bb[0]), y = bb[1] + R() * (bb[3] - bb[1]); if (!inPoly(polys, x, y) || (excl && inAny(excl, x, y))) continue;
+ const t = tone(x, y); if (R() > 0.35 + t * 0.9) continue;
+ let [dx, dy] = dir(x, y); const L = len * (0.6 + R() * 0.8) * (1 + rimOut * 0), c = (R() - 0.5) * curl;
+ const pts = [], ws = []; let px = x, py = y;
+ for (let k = 0; k <= 5; k++) { pts.push([px, py]); ws.push(w * (0.5 + t * 0.9) * Math.sin(Math.PI * (0.15 + 0.85 * k / 5)) ** 0.6 * (1 - k / 7)); const a = c * k / 5; const ca = Math.cos(a), sa = Math.sin(a); const nx = dx * ca - dy * sa, ny = dx * sa + dy * ca; px += nx * L / 5; py += ny * L / 5; }
+ out.push([y, pts, ws]);
+ }
+ out.sort((a, b) => a[0] - b[0]);
+ for (const [, pts, ws] of out) ink.add(pts, ws);
+}
+
+// ---------- tone fields ----------
+export const LIGHT = { x: -0.55, y: -0.6, z: 0.58 };
+const normL = L => { const l = Math.hypot(L.x, L.y, L.z); return { x: L.x / l, y: L.y / l, z: L.z / l }; };
+export function sphereTone(cx, cy, rx, ry, { base = 0, k = 1, L = LIGHT, rot = 0 } = {}) {
+ const c = Math.cos(-rot), s = Math.sin(-rot); L = normL(L);
+ return (x, y) => {
+ let dx = (x - cx), dy = (y - cy); [dx, dy] = [(dx * c - dy * s) / rx, (dx * s + dy * c) / ry];
+ const r2 = dx * dx + dy * dy, nz = Math.sqrt(Math.max(0, 1 - Math.min(1, r2))), d = dx * L.x + dy * L.y + nz * L.z;
+ return clamp(base + k * (1 - clamp(d)) * 0.9 + (r2 > 0.85 ? (r2 - 0.85) * 1.2 : 0));
+ };
+}
+export function cylTone(cx, cy, r, a, { base = 0, k = 1, L = LIGHT } = {}) {
+ const c = Math.cos(a), s = Math.sin(a); L = normL(L);
+ return (x, y) => {
+ const u = clamp((-(x - cx) * s + (y - cy) * c) / r, -1, 1), nx = -s * u, ny = c * u, nz = Math.sqrt(1 - u * u);
+ const d = nx * L.x + ny * L.y + nz * L.z; return clamp(base + k * (1 - clamp(d)) * 0.9);
+ };
+}
+export const linTone = (x0, y0, x1, y1, t0, t1) => { const dx = x1 - x0, dy = y1 - y0, L2 = dx * dx + dy * dy; return (x, y) => mix(t0, t1, clamp(((x - x0) * dx + (y - y0) * dy) / L2)); };
+export const addT = (...fs) => (x, y) => clamp(fs.reduce((a, f) => a + (typeof f === 'number' ? f : f(x, y)), 0));
+export const maxT = (...fs) => (x, y) => Math.max(...fs.map(f => typeof f === 'number' ? f : f(x, y)));
+export const mulT = (f, k) => (x, y) => clamp(f(x, y) * k);
+export const blobTone = (cx, cy, rx, ry, v = 0.6, soft = 0.5) => (x, y) => { const d = Math.hypot((x - cx) / rx, (y - cy) / ry); return v * (1 - sstep(1 - soft, 1, d)); };
+
+// ---------- any shape + a light → a modelled tone field ----------
+// Rasterise the shape, take its distance field, inflate it into a pillow (height ∝ √ of the distance),
+// light the pillow with a Lambert term. Returns tone(x,y) in 0 (lit) … 1 (turned away), plus .df(x,y) (distance
+// to the edge in world px) and .grad(x,y) for contour hatching.
+export function formTone(polys, { light = [-0.6, -0.7], lz = 0.55, base = 0.05, k = 1, res = 180, radius = null, rim = 0.25, ambient = 0 } = {}) {
+ const bb = bboxOf(polys, 2), W = bb[2] - bb[0], H = bb[3] - bb[1], g = Math.max(W, H) / res;
+ const nx = Math.ceil(W / g) + 1, ny = Math.ceil(H / g) + 1, D = new Float32Array(nx * ny), INF = 1e9;
+ for (let j = 0; j < ny; j++) for (let i = 0; i < nx; i++) D[j * nx + i] = inPoly(polys, bb[0] + i * g, bb[1] + j * g) ? INF : 0;
+ // two-pass chamfer (3-4) distance transform, in grid units
+ const a = 1, b = 1.4142;
+ for (let j = 0; j < ny; j++) for (let i = 0; i < nx; i++) { const id = j * nx + i; if (!D[id]) continue; let m = D[id];
+ if (i > 0) m = Math.min(m, D[id - 1] + a); if (j > 0) m = Math.min(m, D[id - nx] + a); if (i > 0 && j > 0) m = Math.min(m, D[id - nx - 1] + b); if (i < nx - 1 && j > 0) m = Math.min(m, D[id - nx + 1] + b); D[id] = m; }
+ for (let j = ny - 1; j >= 0; j--) for (let i = nx - 1; i >= 0; i--) { const id = j * nx + i; if (!D[id]) continue; let m = D[id];
+ if (i < nx - 1) m = Math.min(m, D[id + 1] + a); if (j < ny - 1) m = Math.min(m, D[id + nx] + a); if (i < nx - 1 && j < ny - 1) m = Math.min(m, D[id + nx + 1] + b); if (i > 0 && j < ny - 1) m = Math.min(m, D[id + nx - 1] + b); D[id] = m; }
+ let dmax = 0; for (const v of D) if (v > dmax) dmax = v;
+ const R = (radius ? radius / g : dmax) || 1;
+ const Hh = new Float32Array(nx * ny); for (let i = 0; i < D.length; i++) { const u = Math.min(1, D[i] / R); Hh[i] = Math.sqrt(1 - (1 - u) * (1 - u)) * R; }
+ const Ll = Math.hypot(light[0], light[1], lz), lx = light[0] / Ll, ly = light[1] / Ll, lzz = lz / Ll;
+ const T = new Float32Array(nx * ny);
+ for (let j = 0; j < ny; j++) for (let i = 0; i < nx; i++) {
+ const id = j * nx + i; if (!D[id]) { T[id] = 0; continue; }
+ const hx = (Hh[j * nx + Math.min(nx - 1, i + 1)] - Hh[j * nx + Math.max(0, i - 1)]) / 2, hy = (Hh[Math.min(ny - 1, j + 1) * nx + i] - Hh[Math.max(0, j - 1) * nx + i]) / 2;
+ const L = Math.hypot(hx, hy, 1), nX = -hx / L, nY = -hy / L, nZ = 1 / L;
+ const lam = clamp(nX * lx + nY * ly + nZ * lzz);
+ T[id] = clamp(base + k * (1 - lam) * 0.95 + rim * Math.max(0, 1 - D[id] / (R * 0.18)) * 0.6 - ambient);
+ }
+ const samp = A => (x, y) => { const fx = (x - bb[0]) / g, fy = (y - bb[1]) / g, i = Math.floor(fx), j = Math.floor(fy); if (i < 0 || j < 0 || i >= nx - 1 || j >= ny - 1) return 0; const u = fx - i, v = fy - j, id = j * nx + i; return (A[id] * (1 - u) + A[id + 1] * u) * (1 - v) + (A[id + nx] * (1 - u) + A[id + nx + 1] * u) * v; };
+ const f = samp(T); const dg = samp(D); f.df = (x, y) => dg(x, y) * g; f.grid = { D, nx, ny, g, bb }; return f;
+}
+// lines that follow the form: iso-distance contours of the shape (marching squares on the distance field),
+// widths by tone. The classic engraver's "contour lines" on a rounded body.
+export function contourHatch(ink, polys, { spacing = 6, tone = null, thr = 0.15, wMin = 0.3, wMax = 1.8, from = 0.5, maxLevels = 200, taper = 8, seed = 4, light } = {}) {
+ const f = tone || formTone(polys, { light }); const { D, nx, ny, g, bb } = f.grid;
+ const R = RNG(seed);
+ for (let lv = 0; lv < maxLevels; lv++) {
+ const iso = (from + lv) * spacing / g + (R() - 0.5) * 0.15; let any = false;
+ const segs = [];
+ for (let j = 0; j < ny - 1; j++) for (let i = 0; i < nx - 1; i++) {
+ const id = j * nx + i, v0 = D[id], v1 = D[id + 1], v2 = D[id + nx + 1], v3 = D[id + nx];
+ let c = 0; if (v0 > iso) c |= 1; if (v1 > iso) c |= 2; if (v2 > iso) c |= 4; if (v3 > iso) c |= 8;
+ if (c === 0 || c === 15) continue; any = true;
+ const P = (ax, ay, va, bx, by, vb) => { const u = (iso - va) / (vb - va); return [bb[0] + (ax + (bx - ax) * u) * g, bb[1] + (ay + (by - ay) * u) * g]; };
+ const e = [P(i, j, v0, i + 1, j, v1), P(i + 1, j, v1, i + 1, j + 1, v2), P(i + 1, j + 1, v2, i, j + 1, v3), P(i, j + 1, v3, i, j, v0)];
+ const T = { 1: [[3, 0]], 2: [[0, 1]], 3: [[3, 1]], 4: [[1, 2]], 5: [[3, 0], [1, 2]], 6: [[0, 2]], 7: [[3, 2]], 8: [[2, 3]], 9: [[0, 2]], 10: [[0, 1], [2, 3]], 11: [[1, 2]], 12: [[1, 3]], 13: [[0, 1]], 14: [[0, 3]] }[c];
+ for (const [p, q] of T) segs.push([e[p], e[q]]);
+ }
+ if (!any) break;
+ // chain segments into polylines
+ const key = p => Math.round(p[0] * 20) + ',' + Math.round(p[1] * 20), ends = new Map(), used = new Uint8Array(segs.length);
+ segs.forEach((s, k) => { for (const e of [0, 1]) { const kk = key(s[e]); (ends.get(kk) || ends.set(kk, []).get(kk)).push(k); } });
+ for (let k0 = 0; k0 < segs.length; k0++) {
+ if (used[k0]) continue; used[k0] = 1; const line = [segs[k0][0], segs[k0][1]];
+ for (const dir of [1, 0]) { for (;;) { const end = dir ? line[line.length - 1] : line[0]; const cand = (ends.get(key(end)) || []).find(k => !used[k]); if (cand == null) break; used[cand] = 1; const s = segs[cand]; const nxt = key(s[0]) === key(end) ? s[1] : s[0]; if (dir) line.push(nxt); else line.unshift(nxt); } }
+ if (line.length < 3) continue;
+ const P = resample(line, 2.5), ws = P.map(([x, y]) => { const v = (f(x, y) - thr) / (1 - thr); return v > 0 ? wMin + (wMax - wMin) * Math.min(1, v * 1.25) : 0; });
+ const n = P.length; for (let j = 0; j < n; j++) { const e = Math.min(j, n - 1 - j) * 2.5; if (e < taper) ws[j] *= Math.pow(e / taper, 0.6); }
+ ink.add(P, ws);
+ }
+ }
+}
diff --git a/styles/engraving/demo/engine/copper.js b/styles/engraving/demo/engine/copper.js
new file mode 100644
index 0000000..37b46a8
--- /dev/null
+++ b/styles/engraving/demo/engine/copper.js
@@ -0,0 +1,137 @@
+// copper.js — the plate before it is printed: polished copper with fine polishing scratches and the soft reflection
+// of a studio window, the engraved grooves (dark trough, a bright burr on the lip), the burin — mushroom-shaped
+// wooden handle, lozenge-section steel shaft, a bevelled lozenge face at the point — held low and pushed forward,
+// and the thin spiral of copper it raises ahead of the point, growing as the cut lengthens.
+import * as B from './burin.js';
+const { clamp, RNG, noise1, noise2 } = B;
+
+let scratchC = null;
+function scratches() { // polishing scratches: thousands of hairlines, mostly in swirls
+ if (scratchC) return scratchC;
+ const N = 1024, c = document.createElement('canvas'); c.width = c.height = N; const g = c.getContext('2d'), R = RNG(21);
+ g.fillStyle = 'rgb(128,128,128)'; g.fillRect(0, 0, N, N);
+ g.lineCap = 'round';
+ for (let k = 0; k < 5200; k++) {
+ const cx = R() * N, cy = R() * N, rad = 200 + R() * 900, a0 = R() * 6.28, span = (0.02 + R() * 0.08), bright = R() < 0.55;
+ g.strokeStyle = bright ? `rgba(255,255,255,${0.05 + R() * 0.12})` : `rgba(0,0,0,${0.04 + R() * 0.1})`; g.lineWidth = 0.4 + R() * 0.7;
+ g.beginPath(); g.arc(cx, cy, rad, a0, a0 + span); g.stroke();
+ }
+ for (let k = 0; k < 900; k++) { const x = R() * N, y = R() * N, a = -0.15 + R() * 0.3, l = 20 + R() * 120; g.strokeStyle = `rgba(255,255,255,${0.04 + R() * 0.08})`; g.lineWidth = 0.4; g.beginPath(); g.moveTo(x, y); g.lineTo(x + Math.cos(a) * l, y + Math.sin(a) * l); g.stroke(); }
+ scratchC = c; return c;
+}
+// the copper surface over a world rectangle
+export function drawCopper(ctx, rect) {
+ const [x0, y0, x1, y1] = rect;
+ ctx.save();
+ const g = ctx.createLinearGradient(x0, y0, x1, y1);
+ g.addColorStop(0, '#5e2a12'); g.addColorStop(0.4, '#94502c'); g.addColorStop(0.7, '#86441f'); g.addColorStop(1, '#4e220e');
+ ctx.fillStyle = g; ctx.fillRect(x0, y0, x1 - x0, y1 - y0);
+ ctx.globalCompositeOperation = 'overlay'; ctx.globalAlpha = 0.9;
+ const pat = ctx.createPattern(scratches(), 'repeat'); pat.setTransform(new DOMMatrix().scaleSelf(0.35, 0.35));
+ ctx.fillStyle = pat; ctx.fillRect(x0, y0, x1 - x0, y1 - y0);
+ ctx.restore();
+}
+// screen-space reflections: a studio window (softbox with mullions) sliding across as the camera moves, dark room elsewhere
+export function copperLight(ctx, W, H, cam) {
+ ctx.save(); ctx.setTransform(1, 0, 0, 1, 0, 0);
+ const ox = -(cam.cx - 960) * 0.45 * cam.z * 0.2, oy = -(cam.cy - 540) * 0.45 * cam.z * 0.2;
+ ctx.globalCompositeOperation = 'multiply'; // the room: dark toward the edges
+ const v = ctx.createRadialGradient(W * 0.46 + ox * 0.3, H * 0.4, H * 0.15, W * 0.5, H * 0.5, H * 1.05); v.addColorStop(0, 'rgb(255,250,245)'); v.addColorStop(1, 'rgb(60,26,12)');
+ ctx.fillStyle = v; ctx.fillRect(0, 0, W, H);
+ ctx.globalCompositeOperation = 'screen';
+ ctx.translate(W * 0.5 + ox, H * 0.46 + oy); ctx.rotate(-0.22);
+ ctx.filter = 'blur(90px)'; ctx.fillStyle = 'rgba(255,190,140,0.45)'; ctx.fillRect(-700, -380, 1400, 760); // glow of the room
+ ctx.filter = 'blur(14px)'; // the window: four panes, crisp enough to read as a reflection
+ const pane = (x, y) => { const g2 = ctx.createLinearGradient(x, y, x + 300, y + 190); g2.addColorStop(0, 'rgba(255,238,215,0.75)'); g2.addColorStop(1, 'rgba(255,214,176,0.45)'); ctx.fillStyle = g2; ctx.fillRect(x, y, 300, 190); };
+ pane(-330, -210); pane(-10, -210); pane(-330, 2); pane(-10, 2);
+ ctx.filter = 'none';
+ ctx.globalCompositeOperation = 'overlay'; ctx.setTransform(1, 0, 0, 1, 0, 0); const sp = ctx.createPattern(scratches(), 'repeat'); sp.setTransform(new DOMMatrix().scaleSelf(0.7, 0.7)); ctx.globalAlpha = 0.5; ctx.fillStyle = sp; ctx.fillRect(0, 0, W, H);
+ ctx.restore();
+}
+// engraved grooves: shadowed trough, the lit lip with its burr, a glint on the far wall
+export function drawGrooves(ctx, ink, t, { zoom = 1, light = [-0.6, -0.8] } = {}) {
+ const px = 1 / Math.max(0.5, zoom);
+ ink.draw(ctx, t, { color: 'rgba(50,16,4,0.45)', wScale: 1.9, dx: -light[0] * px * 2.5, dy: -light[1] * px * 2.5 }); // shade of the burr on the far side
+ ink.draw(ctx, t, { color: 'rgba(255,226,186,1)', wScale: 1.35, dx: light[0] * px * 2.6, dy: light[1] * px * 2.6 }); // the burr: a bright raised lip
+ ink.draw(ctx, t, { color: '#240c05', wScale: 1.0 }); // the trough
+ return ink.draw(ctx, t, { color: 'rgba(214,128,78,0.75)', wScale: 0.25, dx: -light[0] * px * 1.4, dy: -light[1] * px * 1.4 }); // far wall catching light
+}
+
+// ---------- the burin (screen space) ----------
+// tip: [x, y] px; dir: unit direction of the cut; s: scale; lift 0..1 raises it off the plate; skew: the shaft trails the cut at an angle
+export function drawBurin(ctx, tip, dir, { s = 1, lift = 0, skew = 0.22 } = {}) {
+ // the shaft lies along the direction the point travels, turned only ~13° so the fresh groove stays visible
+ const ca = Math.cos(skew), sa = Math.sin(skew), dx = dir[0] * ca - dir[1] * sa, dy = dir[0] * sa + dir[1] * ca, nx = -dy, ny = dx;
+ const L = 470 * s, w = 34 * s, bev = 66 * s;
+ const P = (d, o = 0) => [tip[0] - dx * d + nx * o, tip[1] - dy * d + ny * o];
+ const poly = pts => { ctx.beginPath(); pts.forEach((p, i) => i ? ctx.lineTo(...p) : ctx.moveTo(...p)); ctx.closePath(); };
+ const up = lift * 70 * s;
+ ctx.save(); ctx.translate(-up * 0.3, -up);
+ // cast shadow: the tool is held low, so the shadow hugs it
+ ctx.save(); ctx.translate(18 * s + up * 0.8, 26 * s + up * 1.2); ctx.filter = `blur(${9 * s + up * 0.15}px)`; ctx.fillStyle = 'rgba(30,8,2,0.55)';
+ poly([P(4), P(L, w * 0.7), P(L + 330 * s, w * 3.6), P(L + 330 * s, -w * 3.6), P(L, -w * 0.7)]); ctx.fill(); ctx.restore();
+ // the shaft: a lozenge section seen from above — two long faces meeting at a sharp ridge
+ const faceA = [P(bev, 0), P(bev, w * 0.5), P(L, w * 0.5), P(L, 0)], faceB = [P(bev, 0), P(L, 0), P(L, -w * 0.5), P(bev, -w * 0.5)];
+ const grad = (a, b, stops) => { const g = ctx.createLinearGradient(...a, ...b); stops.forEach(([o, c]) => g.addColorStop(o, c)); return g; };
+ ctx.fillStyle = grad(P(bev, w * 0.5), P(bev, 0), [[0, '#8e98a2'], [0.6, '#d9e0e6'], [1, '#f4f7f9']]); poly(faceA); ctx.fill();
+ ctx.fillStyle = grad(P(bev, 0), P(bev, -w * 0.5), [[0, '#3a4148'], [0.5, '#262b30'], [1, '#4a525a']]); poly(faceB); ctx.fill();
+ // the bevelled face at the point: a lozenge, polished flat, catching the window
+ const face = [tip, P(bev, w * 0.5), P(bev * 1.18, 0), P(bev, -w * 0.5)];
+ ctx.fillStyle = grad(tip, P(bev * 1.18, 0), [[0, '#ffffff'], [0.5, '#e6edf2'], [1, '#aab4bd']]); poly(face); ctx.fill();
+ ctx.strokeStyle = 'rgba(255,255,255,0.95)'; ctx.lineWidth = 1.6 * s; ctx.beginPath(); ctx.moveTo(...tip); ctx.lineTo(...P(bev, w * 0.5)); ctx.stroke(); // the sharp edges
+ ctx.strokeStyle = 'rgba(20,24,28,0.9)'; ctx.lineWidth = 1.2 * s; ctx.beginPath(); ctx.moveTo(...tip); ctx.lineTo(...P(bev, -w * 0.5)); ctx.stroke();
+ ctx.strokeStyle = 'rgba(255,255,255,0.9)'; ctx.lineWidth = 2 * s; ctx.beginPath(); ctx.moveTo(...P(bev * 1.18, 0)); ctx.lineTo(...P(L, 0)); ctx.stroke(); // the ridge highlight
+ ctx.strokeStyle = 'rgba(15,18,22,0.85)'; ctx.lineWidth = 1.2 * s; poly([tip, P(bev, w * 0.5), P(L, w * 0.5), P(L, -w * 0.5), P(bev, -w * 0.5)]); ctx.stroke();
+ // ferrule
+ const fe = [P(L - 6 * s, w * 0.9), P(L + 40 * s, w * 0.95), P(L + 40 * s, -w * 0.95), P(L - 6 * s, -w * 0.9)];
+ ctx.fillStyle = grad(P(L, w), P(L, -w), [[0, '#c9a45a'], [0.35, '#f3dd9a'], [0.7, '#8a6a2e'], [1, '#5a4520']]); poly(fe); ctx.fill();
+ // the mushroom handle: a turned wooden knob, its flat side toward the plate
+ const hc = P(L + 40 * s + 145 * s, 0), ang = Math.atan2(-dy, -dx);
+ ctx.save(); ctx.translate(...hc); ctx.rotate(ang);
+ const hg = ctx.createRadialGradient(-50 * s, -70 * s, 10 * s, 0, 0, 200 * s); hg.addColorStop(0, '#c98a4e'); hg.addColorStop(0.5, '#8a4f24'); hg.addColorStop(1, '#3e1f0c');
+ // mushroom: a neck flaring into a dome, the flat cut on the plate side
+ const knob = new Path2D(); knob.moveTo(-150 * s, -26 * s); knob.bezierCurveTo(-110 * s, -30 * s, -80 * s, -118 * s, 10 * s, -120 * s); knob.bezierCurveTo(110 * s, -120 * s, 150 * s, -60 * s, 150 * s, 0); knob.bezierCurveTo(150 * s, 60 * s, 110 * s, 120 * s, 10 * s, 120 * s); knob.bezierCurveTo(-80 * s, 118 * s, -110 * s, 30 * s, -150 * s, 26 * s); knob.closePath();
+ ctx.fillStyle = hg; ctx.fill(knob);
+ ctx.save(); ctx.clip(knob); ctx.strokeStyle = 'rgba(40,18,6,0.35)'; ctx.lineWidth = 1.4 * s; // wood grain
+ for (let k = -9; k <= 9; k++) { ctx.beginPath(); for (let i = 0; i <= 40; i++) { const x = -190 * s + i * 9.5 * s, y = k * 17 * s + Math.sin(i * 0.3 + k) * 5 * s + (noise1(i * 0.2 + k * 3, 4) - 0.5) * 8 * s; i ? ctx.lineTo(x, y) : ctx.moveTo(x, y); } ctx.stroke(); }
+ ctx.fillStyle = 'rgba(40,18,6,0.4)'; ctx.fillRect(-175 * s, 80 * s, 350 * s, 80 * s); // the flat cut
+ ctx.restore();
+ ctx.globalCompositeOperation = 'screen'; ctx.fillStyle = 'rgba(255,220,180,0.35)'; ctx.filter = `blur(${10 * s}px)`; ctx.beginPath(); ctx.ellipse(-60 * s, -65 * s, 70 * s, 32 * s, -0.4, 0, Math.PI * 2); ctx.fill(); // varnish highlight
+ ctx.filter = 'none'; ctx.restore();
+ ctx.restore();
+}
+// the swarf: a thin, thinning ribbon of copper curling up ahead of the point — irregular turns that open out as it grows,
+// an occasional twist; one edge catches the light, the other falls dark, so it reads as sheet metal, not a spring.
+// len = screen px of line cut so far
+export function drawSwarf(ctx, tip, dir, len, { s = 1, seed = 3 } = {}) {
+ if (len < 4) return;
+ const [dx, dy] = dir, nx = -dy, ny = dx, L = Math.min(1, len / (520 * s)), N = 160;
+ const turns = 0.6 + 2.6 * L, P = [];
+ let a = 0;
+ for (let i = 0; i <= N; i++) {
+ const u = i / N;
+ a += (turns * Math.PI * 2 / N) * (0.75 + 0.5 * noise1(u * 6 + seed, seed)); // uneven winding
+ const r = s * (6 + 44 * Math.pow(u, 0.8) * (0.55 + 0.45 * L)) * (0.85 + 0.3 * noise1(u * 9, seed + 1)); // small at the point, opening out
+ const ax = s * (8 + 46 * u * L), rise = r * 0.55; // the coil drifts ahead and lifts
+ const cx = tip[0] + dx * (ax + r * Math.sin(a)) + nx * (-r * (1 - Math.cos(a)) * 0.9), cy = tip[1] + dy * (ax + r * Math.sin(a)) + ny * (-r * (1 - Math.cos(a)) * 0.9) - rise * (1 - Math.cos(a)) * 0.5;
+ const tw = Math.cos(u * 7 + noise1(u * 3, seed + 2) * 4); // twist: the ribbon turns edge-on now and then
+ P.push({ x: cx, y: cy, a, depth: Math.cos(a), w: s * (10 - 6.5 * u) * (0.3 + 0.7 * Math.abs(tw)), flip: tw < 0 });
+ }
+ // ribbon edges
+ for (let i = 0; i <= N; i++) { const p = P[i], q = P[Math.min(N, i + 1)], o = P[Math.max(0, i - 1)], tx = q.x - o.x, ty = q.y - o.y, tl = Math.hypot(tx, ty) || 1; p.nx = -ty / tl; p.ny = tx / tl; }
+ ctx.save();
+ ctx.fillStyle = 'rgba(30,8,2,0.4)'; ctx.filter = `blur(${3 * s}px)`; // shadow on the plate
+ ctx.beginPath(); P.forEach((p, i) => i ? ctx.lineTo(p.x + 7 * s, p.y + 11 * s) : ctx.moveTo(p.x + 7 * s, p.y + 11 * s)); ctx.lineWidth = 4 * s; ctx.strokeStyle = 'rgba(30,8,2,0.4)'; ctx.stroke(); ctx.filter = 'none';
+ for (const front of [false, true]) for (let i = 0; i < N; i++) {
+ const p = P[i], q = P[i + 1]; if ((p.depth > 0) !== front) continue;
+ const e = (pt, k) => [pt.x + pt.nx * pt.w * 0.5 * k, pt.y + pt.ny * pt.w * 0.5 * k];
+ const face = 0.5 + 0.5 * Math.sin(p.a + 0.8), k = front ? 1 : 0.5;
+ ctx.fillStyle = `rgb(${Math.round((150 + 90 * face) * k + 20)},${Math.round((72 + 105 * face) * k + 8)},${Math.round((36 + 80 * face) * k + 4)})`;
+ ctx.beginPath(); ctx.moveTo(...e(p, 1)); ctx.lineTo(...e(q, 1)); ctx.lineTo(...e(q, -1)); ctx.lineTo(...e(p, -1)); ctx.closePath(); ctx.fill();
+ // one edge bright, one dark (which is which flips where the ribbon twists)
+ const lit = p.flip ? -1 : 1;
+ ctx.lineWidth = 1.4 * s; ctx.strokeStyle = front ? 'rgba(255,238,210,0.95)' : 'rgba(230,170,120,0.6)'; ctx.beginPath(); ctx.moveTo(...e(p, lit)); ctx.lineTo(...e(q, lit)); ctx.stroke();
+ ctx.lineWidth = 1.2 * s; ctx.strokeStyle = 'rgba(40,12,4,0.9)'; ctx.beginPath(); ctx.moveTo(...e(p, -lit)); ctx.lineTo(...e(q, -lit)); ctx.stroke();
+ }
+ ctx.restore();
+}
diff --git a/styles/engraving/demo/engine/index.js b/styles/engraving/demo/engine/index.js
new file mode 100644
index 0000000..f6ddb64
--- /dev/null
+++ b/styles/engraving/demo/engine/index.js
@@ -0,0 +1,25 @@
+// Copperplate engraving engine — public entry.
+// burin.js line engine: ordered strokes, hatching, cross-hatching, stipple, fur, tone fields, formTone, contourHatch
+// plate.js paper, plate mark, border, engraved lettering, roundels, leader lines
+// wash.js hand colouring (independent layer)
+// copper.js the copper plate, grooves, burin and swarf (for close-ups of the cutting)
+export * as B from './burin.js';
+export * from './plate.js';
+export { Wash } from './wash.js';
+export * as Copper from './copper.js';
+import * as B from './burin.js';
+
+// Engrave any closed shape with a light direction: outline + form-following hatching in the engraver's three passes.
+// d: SVG path string (or { polys }), at: B.xf(x, y, scale, rot)
+// light: [x, y] toward the light (screen space). style: 'hatch' (straight families bent to the form) | 'contour'.
+// Returns { ink, shape, tone } — the ink groups are `${g}ol`, `${g}h1`, `${g}h2`, `${g}h3`, ready for ink.schedule().
+export function engraveShape(d, { at = B.xf(), light = [-0.6, -0.7], spacing = 4, wMax = 1.6, outlineW = 1.8, style = 'hatch', angle = -0.6, ink = new B.Ink(), g = '', base = 0.05, seed = 1 } = {}) {
+ const sh = typeof d === 'string' ? B.shape(d, at) : d;
+ const tone = B.formTone(sh.polys, { light, base });
+ ink.group(g + 'ol'); for (const p of sh.polys) B.outline(ink, p, { w: outlineW, light, seed });
+ for (const l of sh.lines || []) B.stroke(ink, l, outlineW * 0.8);
+ if (style === 'contour') { ink.group(g + 'h1'); B.contourHatch(ink, sh.polys, { spacing, tone, wMax, thr: 0.12, seed }); ink.group(g + 'h2'); B.hatch(ink, sh.polys, { angle, spacing: spacing * 1.15, tone, thr: 0.55, wMax: wMax * 0.8, seed: seed + 1 }); }
+ else { ink.group(g + 'h1'); B.hatch(ink, sh.polys, { angle, spacing, tone, thr: 0.12, wMax, seed }); ink.group(g + 'h2'); B.hatch(ink, sh.polys, { angle: angle + 1.05, spacing: spacing * 1.1, tone, thr: 0.5, wMax: wMax * 0.8, seed: seed + 1 }); }
+ ink.group(g + 'h3'); B.hatch(ink, sh.polys, { angle: angle - 0.5, spacing: spacing * 1.25, tone, thr: 0.78, wMax: wMax * 0.6, seed: seed + 2 });
+ return { ink, shape: sh, tone };
+}
diff --git a/styles/engraving/demo/engine/plate.js b/styles/engraving/demo/engine/plate.js
new file mode 100644
index 0000000..51c322f
--- /dev/null
+++ b/styles/engraving/demo/engine/plate.js
@@ -0,0 +1,144 @@
+// plate.js — the printed sheet around an engraving: laid paper, the pressed plate mark, ruled border,
+// engraved lettering (roman capitals and copperplate script), magnification roundels and leader lines.
+// Everything draws in world coordinates under the camera transform, so it stays sharp at any zoom.
+import * as B from './burin.js';
+const { clamp, RNG, noise2, sstep } = B;
+
+export const PAL = {
+ paper: '#f1e8d2', plateTone: '#e8ddc2', ink: '#1c1510', inkSoft: '#3a2c20', foxing: '#9a6a34',
+ bevelDark: 'rgba(96,70,40,0.42)', bevelLight: 'rgba(255,251,240,0.95)',
+};
+export const FONTS = { roman: 'Bodoni Moda', script: 'Pinyon Script' };
+
+// ---------- paper: a world-space texture (laid lines, fibres, foxing), built once ----------
+let paperCache = null;
+export function paperTexture(W = 1920, H = 1080, seed = 53) {
+ if (paperCache && paperCache.W === W && paperCache.H === H) return paperCache.c;
+ const c = document.createElement('canvas'); c.width = W; c.height = H; const g = c.getContext('2d'), R = RNG(seed);
+ const im = g.createImageData(W, H), d = im.data;
+ for (let y = 0; y < H; y++) for (let x = 0; x < W; x++) {
+ const n = noise2(x / 2.2, y / 2.2, 1) * 0.45 + noise2(x / 34, y / 34, 2) * 0.35 + noise2(x / 190, y / 190, 3) * 0.45;
+ const laid = (y % 4 === 0 ? 0.03 : 0) + (x % 72 < 1 ? 0.035 : 0);
+ const v = 255 - (n * 13 + laid * 90);
+ const i = (y * W + x) * 4; d[i] = v; d[i + 1] = v - 1.5; d[i + 2] = v - 6; d[i + 3] = 255;
+ }
+ g.putImageData(im, 0, 0);
+ // fibres
+ g.globalAlpha = 0.06; g.strokeStyle = '#6b5030'; g.lineWidth = 0.6;
+ for (let k = 0; k < 900; k++) { const x = R() * W, y = R() * H, a = R() * 6.28, l = 3 + R() * 9; g.beginPath(); g.moveTo(x, y); g.quadraticCurveTo(x + Math.cos(a + 0.6) * l * 0.6, y + Math.sin(a + 0.6) * l * 0.6, x + Math.cos(a) * l, y + Math.sin(a) * l); g.stroke(); }
+ // foxing: small rust spots, mostly toward the edges
+ for (let k = 0; k < 70; k++) { let x = R() * W, y = R() * H; if (R() < 0.7) { if (R() < 0.5) x = R() < 0.5 ? R() * 120 : W - R() * 120; else y = R() < 0.5 ? R() * 90 : H - R() * 90; } const r = 1 + R() * 5; g.globalAlpha = 0.05 + R() * 0.1; g.fillStyle = PAL.foxing; g.beginPath(); g.arc(x, y, r, 0, 7); g.fill(); }
+ g.globalAlpha = 1;
+ paperCache = { W, H, c };
+ return c;
+}
+
+// the sheet: paper, plate tone inside the plate mark, the bevel of the mark (debossed, lit from the upper left)
+export function drawSheet(ctx, { W = 1920, H = 1080, plate = [70, 44, 1850, 1036], tone = 1 } = {}) {
+ const [x0, y0, x1, y1] = plate;
+ ctx.save();
+ ctx.fillStyle = PAL.paper; ctx.fillRect(-2000, -2000, W + 4000, H + 4000);
+ ctx.globalCompositeOperation = 'multiply'; ctx.drawImage(paperTexture(W, H), 0, 0, W, H);
+ // plate tone: the thin film of ink the printer leaves when wiping the plate
+ ctx.globalAlpha = 0.55 * tone; ctx.fillStyle = PAL.plateTone; ctx.fillRect(x0, y0, x1 - x0, y1 - y0);
+ ctx.globalAlpha = 1; ctx.globalCompositeOperation = 'source-over';
+ // the bevel: top and left walls turn from the light, bottom and right catch it
+ const b = 5;
+ ctx.fillStyle = PAL.bevelDark;
+ ctx.beginPath(); ctx.moveTo(x0 - b, y0 - b); ctx.lineTo(x1 + b, y0 - b); ctx.lineTo(x1, y0); ctx.lineTo(x0, y0); ctx.lineTo(x0, y1); ctx.lineTo(x0 - b, y1 + b); ctx.closePath(); ctx.fill();
+ ctx.fillStyle = PAL.bevelLight;
+ ctx.beginPath(); ctx.moveTo(x1 + b, y0 - b); ctx.lineTo(x1 + b, y1 + b); ctx.lineTo(x0 - b, y1 + b); ctx.lineTo(x0, y1); ctx.lineTo(x1, y1); ctx.lineTo(x1, y0); ctx.closePath(); ctx.fill();
+ ctx.strokeStyle = 'rgba(90,64,36,0.25)'; ctx.lineWidth = 1; ctx.strokeRect(x0 - b, y0 - b, x1 - x0 + 2 * b, y1 - y0 + 2 * b);
+ ctx.restore();
+}
+
+// ruled border: a heavy line and a hairline, cut as ink so it can be engraved in time
+export function borderInk(ink, [x0, y0, x1, y1], { gap = 9 } = {}) {
+ B.outline(ink, [[x0, y0], [x1, y0], [x1, y1], [x0, y1]], { w: 2.4, vary: 0.15, grain: 0.04, step: 4 });
+ B.outline(ink, [[x0 + gap, y0 + gap], [x1 - gap, y0 + gap], [x1 - gap, y1 - gap], [x0 + gap, y1 - gap]], { w: 0.8, vary: 0.1, grain: 0.04, step: 4 });
+}
+
+// ---------- engraved lettering ----------
+// Roman capitals are cut glyph by glyph (each glyph wipes in from the left, as the burin travels);
+// script is written in one continuous stroke from left to right with a soft wet edge.
+export function measure(ctx, str, { size = 40, font = FONTS.roman, weight = 500, italic = false, track = 0 } = {}) {
+ ctx.save(); ctx.font = `${italic ? 'italic ' : ''}${weight} ${size}px "${font}"`;
+ const chars = [...str], ws = chars.map(ch => ctx.measureText(ch).width), tw = ws.reduce((a, b) => a + b, 0) + track * size * Math.max(0, chars.length - 1);
+ ctx.restore(); return { chars, ws, tw };
+}
+export function engraveText(ctx, str, x, y, o = {}) {
+ const { size = 40, font = FONTS.roman, weight = 500, italic = false, track = 0, align = 'center', color = PAL.ink, p = 1, alpha = 1 } = o;
+ if (p <= 0 || !str) return;
+ const { chars, ws, tw } = measure(ctx, str, o);
+ ctx.save(); ctx.font = `${italic ? 'italic ' : ''}${weight} ${size}px "${font}"`; ctx.fillStyle = color; ctx.textBaseline = 'alphabetic'; ctx.globalAlpha = alpha;
+ let cx = align === 'center' ? x - tw / 2 : align === 'right' ? x - tw : x;
+ const N = chars.length, shown = p * (N + 2);
+ for (let i = 0; i < N; i++) {
+ const f = clamp(shown - i * 1.0 - 0.5, 0, 1.5) / 1.5;
+ if (f > 0) {
+ if (f < 1) { ctx.save(); ctx.beginPath(); ctx.rect(cx - 2, y - size * 1.2, (ws[i] + 4) * f, size * 1.6); ctx.clip(); ctx.fillText(chars[i], cx, y); ctx.restore(); }
+ else ctx.fillText(chars[i], cx, y);
+ }
+ cx += ws[i] + track * size;
+ }
+ ctx.restore();
+}
+export function writeScript(ctx, str, x, y, o = {}) {
+ const { size = 40, font = FONTS.script, color = PAL.ink, align = 'center', p = 1, alpha = 1, weight = 400 } = o;
+ if (p <= 0 || !str) return;
+ ctx.save(); ctx.font = `${weight} ${size}px "${font}"`; ctx.textBaseline = 'alphabetic';
+ const tw = ctx.measureText(str).width, x0 = align === 'center' ? x - tw / 2 : align === 'right' ? x - tw : x;
+ const edge = x0 - size * 0.3 + (tw + size * 0.6) * clamp(p);
+ ctx.globalAlpha = alpha;
+ if (p < 1) {
+ const g = ctx.createLinearGradient(edge - size * 0.9, 0, edge, 0); g.addColorStop(0, color); g.addColorStop(1, 'rgba(0,0,0,0)');
+ ctx.beginPath(); ctx.rect(x0 - size, y - size * 1.5, edge - x0 + size, size * 2.2); ctx.clip(); ctx.fillStyle = g;
+ // solid part
+ ctx.save(); ctx.beginPath(); ctx.rect(x0 - size, y - size * 1.5, Math.max(0, edge - size * 0.9 - x0 + size), size * 2.2); ctx.clip(); ctx.fillStyle = color; ctx.fillText(str, x0, y); ctx.restore();
+ ctx.fillText(str, x0, y);
+ } else { ctx.fillStyle = color; ctx.fillText(str, x0, y); }
+ ctx.restore();
+}
+// fit a string into a width: shrink to minSize, then wrap into two lines
+export function fitLines(ctx, str, maxW, o) {
+ let size = o.size; const min = o.minSize ?? o.size * 0.8;
+ for (; size >= min; size -= 1) { if (measure(ctx, str, { ...o, size }).tw <= maxW) return { lines: [str], size }; }
+ const words = str.split(' '); let best = null;
+ for (let k = 1; k < words.length; k++) { const a = words.slice(0, k).join(' '), b = words.slice(k).join(' '), w = Math.max(measure(ctx, a, { ...o, size: o.size }).tw, measure(ctx, b, { ...o, size: o.size }).tw); if (!best || w < best.w) best = { w, lines: [a, b] }; }
+ size = o.size; while (size > min * 0.85 && best.w * size / o.size > maxW) size -= 1;
+ return { lines: best.lines, size };
+}
+
+// ---------- roundel: a magnification in a double-ruled circle ----------
+// content: { ink, regions } built for radius 500 local units. The roundel draws at centre (x, y) with radius r.
+export function roundelFrame(ctx, x, y, r, { p = 1, w = 2.2 } = {}) {
+ if (p <= 0) return;
+ ctx.save(); ctx.strokeStyle = PAL.ink; ctx.lineCap = 'round';
+ const a0 = -Math.PI / 2 - 0.4, a1 = a0 + Math.PI * 2 * clamp(p);
+ ctx.lineWidth = w; ctx.beginPath(); ctx.arc(x, y, r, a0, a1); ctx.stroke();
+ ctx.lineWidth = w * 0.38; ctx.beginPath(); ctx.arc(x, y, r - Math.max(3.5, r * 0.035), a0, a0 + Math.PI * 2 * clamp(p * 1.1 - 0.1)); ctx.stroke();
+ ctx.restore();
+}
+// leader line from a point on the figure to the rim of a roundel, with a tiny reference number near its root
+export function leader(ctx, from, to, { p = 1, w = 0.9, num = null, numP = 1, size = 16 } = {}) {
+ if (p <= 0) return;
+ const x = from[0] + (to[0] - from[0]) * clamp(p), y = from[1] + (to[1] - from[1]) * clamp(p);
+ ctx.save(); ctx.strokeStyle = PAL.ink; ctx.lineWidth = w; ctx.lineCap = 'round';
+ ctx.beginPath(); ctx.moveTo(from[0], from[1]); ctx.lineTo(x, y); ctx.stroke();
+ ctx.fillStyle = PAL.ink; ctx.beginPath(); ctx.arc(from[0], from[1], w * 1.6, 0, 7); ctx.fill();
+ ctx.restore();
+ if (num != null && numP > 0) {
+ const dx = to[0] - from[0], dy = to[1] - from[1], L = Math.hypot(dx, dy) || 1, nx = -dy / L, ny = dx / L;
+ const m = [from[0] + dx * 0.16 + nx * 12, from[1] + dy * 0.16 + ny * 12 + size * 0.35];
+ engraveText(ctx, num, m[0], m[1], { size, italic: true, weight: 500, p: numP });
+ }
+}
+// wrap a string into lines no wider than maxW at a fixed size (the size never changes; long text gets more lines)
+export function wrapLines(ctx, str, maxW, o) {
+ const words = String(str || '').split(/\s+/).filter(Boolean), lines = []; let cur = '';
+ for (const w of words) { const t = cur ? cur + ' ' + w : w; if (!cur || measure(ctx, t, o).tw <= maxW) cur = t; else { lines.push(cur); cur = w; } }
+ if (cur) lines.push(cur);
+ // balance two-line notes so no word is left alone on the second line
+ if (lines.length === 2) { let best = null; for (let k = 1; k < words.length; k++) { const a = words.slice(0, k).join(' '), b = words.slice(k).join(' '), wa = measure(ctx, a, o).tw, wb = measure(ctx, b, o).tw; if (wa > maxW || wb > maxW) continue; const m = Math.max(wa, wb); if (!best || m < best.m) best = { m, l: [a, b] }; } if (best) return best.l; }
+ return lines;
+}
diff --git a/styles/engraving/demo/engine/wash.js b/styles/engraving/demo/engine/wash.js
new file mode 100644
index 0000000..b4e7d40
--- /dev/null
+++ b/styles/engraving/demo/engine/wash.js
@@ -0,0 +1,95 @@
+// wash.js — hand colouring, the way plates were coloured after printing: transparent watercolour laid region by
+// region, blooming out from where the brush touched. Each region is painted once into its own cached sheet:
+// · the colour spills a few px past the engraved line and sits a little off register (the colourist worked fast);
+// · the pigment is uneven — lighter and heavier patches from a low-frequency density field;
+// · it pools into a darker tide-line at the edge of the wet area (the "water mark" edge);
+// · a backrun or two (cauliflower bloom) in large regions;
+// · granulation: pigment settles into the valleys of the paper, so the paper's tooth shows through.
+// It is an independent layer: draw it between the paper and the ink (multiply), or leave it out entirely.
+// const w = new Wash({ scale: 1.5 });
+// w.add({ path, polys, color: '#d9962a', origin: [x, y], t0: 26.3, dur: 1.4 });
+// w.draw(ctx, t);
+import * as B from './burin.js';
+const { clamp, noise1, noise2, RNG, bboxOf } = B;
+
+const hex = c => { const n = parseInt(c.slice(1), 16); return [(n >> 16) & 255, (n >> 8) & 255, n & 255]; };
+const rgba = ([r, g, b], a = 1) => `rgba(${r | 0},${g | 0},${b | 0},${a})`;
+
+function densityTex(W, H, seed) { // low-frequency density field, alpha = how much pigment to lift
+ const c = document.createElement('canvas'); c.width = Math.ceil(W / 4); c.height = Math.ceil(H / 4); const g = c.getContext('2d'), im = g.createImageData(c.width, c.height);
+ for (let y = 0; y < c.height; y++) for (let x = 0; x < c.width; x++) {
+ const n = noise2(x / 22, y / 22, seed) * 0.6 + noise2(x / 7, y / 7, seed + 1) * 0.4;
+ const i = (y * c.width + x) * 4; im.data[i] = im.data[i + 1] = im.data[i + 2] = 0; im.data[i + 3] = Math.max(0, (n - 0.35)) * 255 * 0.75;
+ }
+ g.putImageData(im, 0, 0); return c;
+}
+let grainC = null;
+function grainTex() { // paper tooth: speckles where pigment does not settle
+ if (grainC) return grainC;
+ const c = document.createElement('canvas'); c.width = c.height = 512; const g = c.getContext('2d'), im = g.createImageData(512, 512);
+ for (let y = 0; y < 512; y++) for (let x = 0; x < 512; x++) { const n = noise2(x / 1.6, y / 1.6, 3) * 0.6 + noise2(x / 5, y / 5, 4) * 0.4; const i = (y * 512 + x) * 4; im.data[i + 3] = Math.max(0, n - 0.48) * 255 * 1.6; }
+ g.putImageData(im, 0, 0); grainC = c; return c;
+}
+
+export class Wash {
+ // scale: cache resolution (canvas px per world unit)
+ constructor({ scale = 1.5 } = {}) { this.items = []; this.k = scale; }
+ add({ path, polys, color, alpha = 0.62, origin = null, t0 = 0, dur = 1.2, spill = 3.5, offset = [2, 1.5], seed = 1, pool = 0.5, lift = 0.6, backruns = null }) {
+ const bb = bboxOf(polys), o = origin || [(bb[0] + bb[2]) / 2, (bb[1] + bb[3]) / 2];
+ const far = Math.max(...[[bb[0], bb[1]], [bb[2], bb[1]], [bb[0], bb[3]], [bb[2], bb[3]]].map(([x, y]) => Math.hypot(x - o[0], y - o[1]))) + spill * 3;
+ const it = { path, polys, color, alpha, o, far, t0, dur, spill, offset, seed, pool, lift, bb, cache: null };
+ it.backruns = backruns ?? ((bb[2] - bb[0]) * (bb[3] - bb[1]) > 12000 ? 2 : 0);
+ this.items.push(it); return this;
+ }
+ _paint(it) {
+ const k = this.k, pad = it.spill * 2 + 12, x0 = it.bb[0] - pad, y0 = it.bb[1] - pad, W = Math.ceil((it.bb[2] - it.bb[0] + 2 * pad) * k), H = Math.ceil((it.bb[3] - it.bb[1] + 2 * pad) * k);
+ const c = document.createElement('canvas'); c.width = W; c.height = H; const g = c.getContext('2d');
+ const col = hex(it.color), dark = col.map(v => v * 0.62);
+ const toLocal = ctx => { ctx.setTransform(k, 0, 0, k, (-x0 + it.offset[0]) * k, (-y0 + it.offset[1]) * k); };
+ // 1. the body of the wash, spilling past the line
+ toLocal(g); g.fillStyle = rgba(col); g.strokeStyle = rgba(col); g.lineJoin = 'round';
+ g.globalAlpha = 1; g.fill(it.path); g.lineWidth = it.spill * 2; g.stroke(it.path);
+ // 2. uneven pigment: lift some of it away in soft patches
+ g.setTransform(1, 0, 0, 1, 0, 0); g.globalCompositeOperation = 'destination-out'; g.globalAlpha = it.lift; g.imageSmoothingEnabled = true;
+ g.drawImage(densityTex(W, H, it.seed * 7 + 1), 0, 0, W, H);
+ // 3. backruns: a pale bloom with a darker rim where wet paint crept back into drying paint
+ const R = RNG(it.seed * 31 + 5);
+ for (let b = 0; b < it.backruns; b++) {
+ let bx, by, tries = 0; do { bx = it.bb[0] + R() * (it.bb[2] - it.bb[0]); by = it.bb[1] + R() * (it.bb[3] - it.bb[1]); } while (!B.inPoly(it.polys, bx, by) && ++tries < 40);
+ const r = Math.min(it.bb[2] - it.bb[0], it.bb[3] - it.bb[1]) * (0.12 + R() * 0.12), blob = new Path2D();
+ for (let i = 0; i <= 48; i++) { const a = i / 48 * Math.PI * 2, rr = r * (0.75 + 0.5 * noise1(a * 3 + b * 9, it.seed + b)); const x = bx + Math.cos(a) * rr, y = by + Math.sin(a) * rr; i ? blob.lineTo(x, y) : blob.moveTo(x, y); }
+ toLocal(g); g.save(); g.clip(it.path); g.globalCompositeOperation = 'destination-out'; g.globalAlpha = 0.35; g.fillStyle = '#000'; g.fill(blob);
+ g.globalCompositeOperation = 'source-over'; g.globalAlpha = 0.45; g.strokeStyle = rgba(dark); g.lineWidth = 1.6; g.stroke(blob); g.restore();
+ }
+ // 4. the tide-line: pigment pooled at the outer edge of the wet area
+ const E = document.createElement('canvas'); E.width = W; E.height = H; const e = E.getContext('2d');
+ toLocal(e); e.lineJoin = 'round'; e.strokeStyle = rgba(dark); e.lineWidth = it.spill * 2 + 3.2; e.stroke(it.path);
+ e.globalCompositeOperation = 'destination-out'; e.lineWidth = Math.max(0.5, it.spill * 2 - 1.6); e.stroke(it.path); e.fill(it.path);
+ g.setTransform(1, 0, 0, 1, 0, 0); g.globalCompositeOperation = 'source-over'; g.globalAlpha = it.pool; g.filter = 'blur(0.8px)'; g.drawImage(E, 0, 0); g.filter = 'none';
+ // a softer inner pooling just inside the line
+ toLocal(g); g.save(); g.clip(it.path); g.globalAlpha = it.pool * 0.35; g.strokeStyle = rgba(dark); g.lineWidth = 6; g.filter = 'blur(2px)'; g.stroke(it.path); g.restore(); g.filter = 'none';
+ // 5. granulation: the paper's tooth
+ g.setTransform(1, 0, 0, 1, 0, 0); g.globalCompositeOperation = 'destination-out'; g.globalAlpha = 0.55;
+ const pat = g.createPattern(grainTex(), 'repeat'); g.fillStyle = pat; g.fillRect(0, 0, W, H);
+ it.cache = { c, x0: x0, y0: y0, w: W / k, h: H / k };
+ }
+ draw(ctx, t, { k = 1 } = {}) {
+ for (const it of this.items) {
+ const p = clamp((t - it.t0) / it.dur); if (p <= 0) continue;
+ if (!it.cache) this._paint(it);
+ const e = 1 - Math.pow(1 - p, 2.2), R = it.far * e * 1.08;
+ const ring = (ctx2, dx = 0, dy = 0) => { ctx2.beginPath(); for (let i = 0; i <= 72; i++) { const a = i / 72 * Math.PI * 2, rr = R * (0.86 + 0.28 * noise1(a * 2.2 + it.seed * 7, it.seed) + 0.06 * noise1(a * 9, it.seed + 3)); const x = it.o[0] + dx + Math.cos(a) * rr, y = it.o[1] + dy + Math.sin(a) * rr; i ? ctx2.lineTo(x, y) : ctx2.moveTo(x, y); } ctx2.closePath(); };
+ ctx.save();
+ if (p < 1) { ring(ctx); ctx.clip(); }
+ ctx.globalCompositeOperation = 'multiply'; ctx.globalAlpha = it.alpha * k;
+ ctx.drawImage(it.cache.c, it.cache.x0, it.cache.y0, it.cache.w, it.cache.h);
+ ctx.restore();
+ // the wet front travelling with the bloom
+ if (p < 1 && p > 0.02) {
+ ctx.save(); ctx.translate(it.offset[0], it.offset[1]); ctx.clip(it.path); ctx.translate(-it.offset[0], -it.offset[1]);
+ ctx.globalCompositeOperation = 'multiply'; ctx.globalAlpha = 0.35 * (1 - p) * k; ctx.strokeStyle = it.color; ctx.lineWidth = 5;
+ ring(ctx, it.offset[0], it.offset[1]); ctx.stroke(); ctx.restore();
+ }
+ }
+ }
+}
diff --git a/styles/engraving/demo/events.json b/styles/engraving/demo/events.json
new file mode 100644
index 0000000..e3316a9
--- /dev/null
+++ b/styles/engraving/demo/events.json
@@ -0,0 +1 @@
+{"dur":40,"ev":[{"t":0,"type":"burin","until":2},{"t":2,"type":"lift"},{"t":2.25,"type":"press"},{"t":2.5,"type":"peel"},{"t":2.6,"type":"hatch","until":6.9},{"t":2.6,"type":"pass","g":"ol"},{"t":3.3,"type":"pass","g":"h1"},{"t":4.4,"type":"pass","g":"h2"},{"t":5,"type":"pass","g":"h3"},{"t":6.25,"type":"title","n":13,"dur":0.9},{"t":6.4,"type":"vo","id":"title","dur":3.1639999999999997},{"t":9.375,"type":"push","i":0,"role":"A","dur":5.625},{"t":9.825,"type":"vo","id":"d1","dur":4.625},{"t":10.425,"type":"ring","i":0},{"t":10.475,"type":"burnish","i":0},{"t":10.725,"type":"cut","until":12.875,"i":0},{"t":11.275,"type":"travel","until":12.775,"i":0},{"t":12.675,"type":"letters","dur":0.6},{"t":12.775,"type":"land","i":0},{"t":13.275,"type":"quill","dur":1.1,"i":0},{"t":15,"type":"push","i":1,"role":"B","dur":4.375},{"t":15.3,"type":"vo","id":"d2","dur":3.5809999999999995},{"t":15.5,"type":"ring","i":1},{"t":15.52,"type":"burnish","i":1},{"t":15.7,"type":"cut","until":17.2,"i":1},{"t":15.8,"type":"travel","until":16.8,"i":1},{"t":16.8,"type":"land","i":1},{"t":16.9,"type":"letters","dur":0.6},{"t":17.4,"type":"quill","dur":1.1,"i":1},{"t":19.375,"type":"push","i":2,"role":"C","dur":4.375},{"t":19.675,"type":"vo","id":"d3","dur":3.1759999999999984},{"t":19.875,"type":"ring","i":2},{"t":19.895,"type":"burnish","i":2},{"t":20.075,"type":"cut","until":21.575,"i":2},{"t":20.275,"type":"travel","until":21.475,"i":2},{"t":21.375,"type":"letters","dur":0.6},{"t":21.475,"type":"land","i":2},{"t":21.875,"type":"quill","dur":1.1,"i":2},{"t":23.75,"type":"natsize"},{"t":25,"type":"silence","until":26.25},{"t":26.35,"type":"drop","region":"abdomen"},{"t":26.75,"type":"vo","id":"close","dur":3.779},{"t":26.770000000000003,"type":"drop","region":"thorax"},{"t":27.19,"type":"drop","region":"head"},{"t":27.610000000000003,"type":"drop","region":"eyes"},{"t":28.03,"type":"drop","region":"wings"},{"t":28.450000000000003,"type":"drop","region":"legs"},{"t":28.87,"type":"drop","region":"pollen"},{"t":31.25,"type":"landing"},{"t":31.3,"type":"letters","dur":0.75},{"t":32.25,"type":"dot"},{"t":32.45,"type":"dot"},{"t":35.425,"type":"tissue"}]}
\ No newline at end of file
diff --git a/styles/engraving/demo/example/index.html b/styles/engraving/demo/example/index.html
new file mode 100644
index 0000000..6022126
--- /dev/null
+++ b/styles/engraving/demo/example/index.html
@@ -0,0 +1,24 @@
+<!doctype html><html><head><meta charset="utf-8"><title>Engraving engine example</title>
+<link rel="stylesheet" href="../fonts/fonts.css">
+<style>html,body{margin:0;background:#000}canvas{display:block}</style></head>
+<body><canvas id="c" width="1920" height="1080"></canvas>
+<script type="module">
+// STYLE.md §10: any shape + a light direction, engraved in cutting order, with one hand-coloured element.
+import { B, engraveShape, Wash, drawSheet, engraveText } from '../engine/index.js';
+const ctx = document.getElementById('c').getContext('2d');
+await document.fonts.load('600 40px "Bodoni Moda"');
+// a four-pointed spark in Claude orange, with a short cursor tail
+const { ink, shape: spark } = engraveShape('M0 -120 C12 -40 40 -12 120 0 C40 12 12 40 0 120 C-12 40 -40 12 -120 0 C-40 -12 -12 -40 0 -120 Z',
+ { at: B.xf(860, 560, 1.9), light: [-0.6, -0.7], spacing: 4.2, style: 'contour', wMax: 2.1 });
+const tail = engraveShape('M0 0 H150 V26 H0 Z', { at: B.xf(1140, 740, 1), light: [-0.6, -0.7], spacing: 3.6, ink, g: 't' });
+ink.schedule(['ol', 'tol'], 0, 1.1, { conc: 2 }); ink.schedule(['h1', 'th1'], 0.8, 2.2, { conc: 40 }); ink.schedule(['h2', 'th2'], 1.6, 2.7, { conc: 40 }); ink.schedule(['h3', 'th3'], 2.2, 3.0, { conc: 40 }); ink.build();
+const w = new Wash({ scale: 1.5 });
+w.add({ path: spark.path, polys: spark.polys, color: '#D97757', origin: [860, 560], t0: 3.0, dur: 1.2, alpha: 0.85 });
+window.render = t => {
+ ctx.setTransform(1, 0, 0, 1, 0, 0); drawSheet(ctx);
+ w.draw(ctx, t); ink.draw(ctx, t);
+ engraveText(ctx, 'THE SPARK.', 960, 170, { size: 50, weight: 600, track: 0.16, p: (t - 1.5) / 1 });
+ engraveText(ctx, 'engraveShape() · contour hatching · one hand-coloured element', 960, 960, { size: 20, italic: true, p: (t - 2) / 1 });
+};
+window.DUR = 5; window.READY = true;
+</script></body></html>
diff --git a/styles/engraving/demo/film.js b/styles/engraving/demo/film.js
new file mode 100644
index 0000000..766da13
--- /dev/null
+++ b/styles/engraving/demo/film.js
@@ -0,0 +1,356 @@
+// "The Honeybee, Plate VII" — a museum / science-card film in the copperplate engraving style.
+// All words and data come from content.json. Timing is on a 96 BPM grid (1 beat = 0.625 s) and re-flows with the
+// number of details (1–4). The scene only calls the engine (engine/*) and the specimen builders (subjects/*).
+import * as B from './engine/burin.js';
+import { drawSheet, paperTexture, borderInk, engraveText, writeScript, wrapLines, roundelFrame, PAL, FONTS, measure } from './engine/plate.js';
+import { Wash } from './engine/wash.js';
+import * as Cu from './engine/copper.js';
+import { buildBee } from './subjects/bee.js';
+import { buildDetail, DETAILS } from './subjects/details.js';
+import { buildScallop } from './subjects/scallop.js';
+const SUBJECTS = { bee: buildBee, scallop: buildScallop };
+import { clamp, eio, eo, ss } from '/core/lib.js';
+
+export const W = 1920, H = 1080, BEAT = 0.625;
+const PLATE = [70, 44, 1850, 1036], BORDER = [100, 72, 1820, 1008];
+const SLOTS = { UL: [300, 300], LL: [300, 700], LR: [1620, 700], UR: [1620, 300] }, SLOT_ORDER = ['UL', 'LL', 'LR', 'UR'], RR = 120;
+const NOTE = { size: 29, width: 380, lead: 1.12 }; // one size for every note; long notes wrap, never shrink
+const seg = (t, a, b) => clamp((t - a) / (b - a));
+const lerp = (a, b, t) => a + (b - a) * t;
+
+export function makeFilm(C, voiceDur = {}) {
+ const subject = SUBJECTS[C.subject] ? C.subject : 'bee';
+ const bee = SUBJECTS[subject]({ x: 960, y: 606, s: 1 });
+ const details = (C.details || []).slice(0, 4);
+
+ // ------------------------------------------------------------------ timeline (seconds)
+ const T = {};
+ T.hook = [0, 2.5]; T.lift = 2.0; T.peel = [2.5, 3.2];
+ T.build = { ol: [2.6, 4.6], h1: [3.3, 5.5], h2: [4.4, 6.2], h3: [5.0, 6.9], border: [3.0, 5.6] };
+ T.title = 6.25;
+ T.d0 = 9.375;
+ const dets = []; let s = T.d0;
+ // role: 'A' the long signature detail, 'B' a tilt-down detail (only as the 2nd of 3–4), 'C' pull-back-then-push; the score uses the same roles
+ const roleOf = i => i === 0 ? 'A' : (i === 1 && details.length > 2) ? 'B' : 'C';
+ details.forEach((d, i) => { const D = i === 0 ? 9 * BEAT : 7 * BEAT; dets.push({ ...d, i, s, D, long: i === 0, role: roleOf(i) }); s += D; });
+ T.dEnd = s; T.gather = [s, s + 2 * BEAT]; T.silence = [s + 2 * BEAT, s + 4 * BEAT];
+ T.colour = [s + 4 * BEAT, s + 12 * BEAT]; T.landing = [s + 12 * BEAT, s + 19 * BEAT]; T.end = [s + 19 * BEAT, s + 26 * BEAT];
+ const DUR = T.end[1];
+
+ // ------------------------------------------------------------------ ink schedules
+ const ink = bee.ink;
+ ink.schedule('ol0', -2.6, 4.2, { conc: 1 });
+ ink.schedule('ol', ...T.build.ol, { conc: 16 });
+ ink.schedule('h1', ...T.build.h1, { conc: 70 });
+ ink.schedule('h2', ...T.build.h2, { conc: 70 });
+ ink.schedule('h3', ...T.build.h3, { conc: 90 });
+ ink.build();
+ // the traced design: faint scratches on the copper that the burin will follow
+ const guide = new B.Ink(); guide.S = ink.S.filter(x => x.g === 'ol' || x.g === 'ol0').map(x => ({ ...x, s0: -20, s1: -19 })); guide.build();
+ const frameInk = new B.Ink(); borderInk(frameInk, BORDER); frameInk.schedule('main', ...T.build.border, { conc: 1.2 }); frameInk.build();
+
+ // ------------------------------------------------------------------ details: slots, focus side, roundel content, timing
+ const natSlot = SLOT_ORDER[details.length] || null;
+ const OBST = subject === 'bee' ? ['wings', 'thorax', 'abdomen', 'head'] : Object.keys(bee.regions);
+ const obstacles = name => OBST.filter(k => k !== name).flatMap(k => bee.regions[k] ? bee.regions[k].polys : []);
+ for (const d of dets) {
+ d.slotName = SLOT_ORDER[d.i]; d.slot = SLOTS[d.slotName];
+ const f = bee.focus[d.focus] || bee.focus.eye;
+ const left = d.slot[0] < W / 2, mx = x => left === (x < 960) ? x : 1920 - x; // the instance on the slot's side
+ d.f = { x: mx(f.x), y: f.y, r: f.r };
+ // a drawn magnification when the library has one for this part; otherwise the roundel magnifies the figure itself
+ d.art = subject === 'bee' && DETAILS[d.focus] ? buildDetail(d.focus) : { magnify: true, regions: {} };
+ // relative timing: the first detail is the long signature move; the second rides a tilt; later ones play wide
+ const a = d.i === 0 ? { push: [0, 1.1], ring: [1.05, 1.45], burn: [1.1, 1.4], cont: [1.35, 3.5], travel: [1.9, 3.4], name: 3.3, latin: 3.6, note: 3.9 }
+ : d.role === 'B' ? { push: [0, 1.0], ring: [0.5, 0.8], burn: [0.52, 0.75], cont: [0.7, 2.2], travel: [0.8, 1.8], name: 1.9, latin: 2.15, note: 2.4 }
+ : { push: [0, 1.0], ring: [0.5, 0.8], burn: [0.52, 0.75], cont: [0.7, 2.2], travel: [0.9, 2.1], name: 2.0, latin: 2.25, note: 2.5 };
+ for (const k in a) a[k] = Array.isArray(a[k]) ? a[k].map(v => v + d.s) : a[k] + d.s;
+ d.a = a;
+ const [c0, c1] = a.cont, D = c1 - c0;
+ if (!d.art.magnify) {
+ d.art.ink.schedule('ol', c0, c0 + 0.5 * D, { conc: 12 });
+ d.art.ink.schedule('h1', c0 + 0.2 * D, c0 + 0.78 * D, { conc: 60 });
+ d.art.ink.schedule('h2', c0 + 0.42 * D, c0 + 0.92 * D, { conc: 60 });
+ d.art.ink.schedule('h3', c0 + 0.5 * D, c1, { conc: 60 });
+ d.art.ink.schedule('rule', c0 + 0.55 * D, c1, { conc: 30 });
+ d.art.ink.build(); }
+ d.lab = { name: `FIG. ${d.i + 1} · ${String(d.name || '').toUpperCase()}`, latin: d.latin || '', note: d.note || '' };
+ // the leader: straight if it can reach the roundel without crossing a wing or the body, else via a waypoint
+ const obs = obstacles(subject === 'bee' ? ({ eye: 'head', hamuli: 'wings', corbicula: '' }[d.focus] ?? '') : '').filter(p => !B.inPoly([p], d.f.x, d.f.y));
+ const rim = (px, py) => { const dx = px - d.slot[0], dy = py - d.slot[1], L = Math.hypot(dx, dy); return [d.slot[0] + dx / L * RR, d.slot[1] + dy / L * RR]; };
+ const clear = (a0, b0) => { const L = Math.hypot(b0[0] - a0[0], b0[1] - a0[1]); for (let q = 14; q < L; q += 4) { const x = a0[0] + (b0[0] - a0[0]) * q / L, y = a0[1] + (b0[1] - a0[1]) * q / L; for (let k = 0; k < 9; k++) { const rr = k ? 34 : 0, an = k * Math.PI / 4; if (B.inAny(obs, x + Math.cos(an) * rr, y + Math.sin(an) * rr)) return false; } } return true; };
+ const len = (p, q) => Math.hypot(p[0] - q[0], p[1] - q[1]);
+ let best = null; const r0 = rim(d.f.x, d.f.y);
+ if (clear([d.f.x, d.f.y], r0)) best = { wp: null, L: len([d.f.x, d.f.y], r0) };
+ else for (let gx = 140; gx <= 1780; gx += 20) for (let gy = 90; gy <= 990; gy += 20) {
+ const wp = [gx, gy], r1 = rim(gx, gy); if (Math.hypot(gx - d.slot[0], gy - d.slot[1]) < RR + 20) continue;
+ if (!clear([d.f.x, d.f.y], wp) || !clear(wp, r1)) continue; const L = len([d.f.x, d.f.y], wp) + len(wp, r1);
+ if (!best || L < best.L) best = { wp, L };
+ }
+ d.wp = best ? best.wp : null;
+ if (typeof location !== 'undefined' && location.search.includes('dbg')) console.warn('leader', d.focus, JSON.stringify(d.f), JSON.stringify(best), obs.length, obs.map(p => p.length).join(','));
+ }
+
+ // ------------------------------------------------------------------ hand colouring
+ const colours = Object.fromEntries((C.colors || []).map(c => [c.region, c.color]));
+ const wash = new Wash({ scale: 1.5 }), dWash = dets.map(() => new Wash({ scale: 0.55 }));
+ const cOrder = (C.colors || []).map(c => c.region);
+ const c0 = T.colour[0] + 0.1;
+ cOrder.forEach((name, k) => {
+ const r = bee.regions[name]; if (!r) return;
+ const t0 = c0 + k * 0.42, origin = name === 'abdomen' ? [r.bbox[0] + (r.bbox[2] - r.bbox[0]) * 0.35, r.bbox[1] + (r.bbox[3] - r.bbox[1]) * 0.3] : null;
+ wash.add({ path: r.path, polys: r.polys, color: colours[name], alpha: name === 'wings' ? 0.5 : name === 'pollen' ? 0.95 : 0.72, origin, t0, dur: name === 'wings' ? 1.6 : 1.25, seed: k + 1, spill: name === 'pollen' ? 2.5 : 3.5, lift: name === 'wings' ? 0.8 : 0.55 });
+ dets.forEach((d, j) => { for (const [rn, rr] of Object.entries(d.art.regions)) { if (rn !== name && !(rn === 'hooks' && name === 'legs')) continue; dWash[j].add({ path: rr.path, polys: rr.polys, color: colours[name], alpha: name === 'wings' ? 0.45 : name === 'pollen' ? 0.92 : name === 'head' ? 0.4 : name === 'eyes' ? 0.55 : 0.6, t0: t0 + 0.15, dur: 1.3, seed: k + 11 + j, spill: 12, offset: [7, 5] }); } });
+ });
+
+ // ------------------------------------------------------------------ voice plan (lines from content.json; durations from the TTS)
+ const lines = (C.voice && C.voice.lines) || [];
+ const vd = id => voiceDur[id] || Math.max(1.6, (lines.find(l => l.id === id)?.text.length || 30) / 14);
+ const vo = [];
+ const put = (id, t) => { const l = lines.find(x => x.id === id); if (l) vo.push({ id, t0: t, t1: t + vd(id), text: l.text }); };
+ put('title', T.title + 0.15);
+ dets.forEach((d, i) => put('d' + (i + 1), d.s + (d.long ? 0.45 : 0.3)));
+ put('close', T.colour[0] + 0.5);
+ const subs = vo.map((v, i) => ({ t0: v.t0 - 0.1, t1: Math.min(v.t1 + 0.6, vo[i + 1] ? vo[i + 1].t0 - 0.2 : 1e9), text: v.text }));
+
+ // ------------------------------------------------------------------ camera
+ const first = ink.S.find(x => x.g === 'ol0');
+ const tipAt = t => { const f = (first.n - 1) * clamp((t - first.s0) / (first.s1 - first.s0)), j = Math.min(first.n - 2, Math.floor(f)), u = f - j, xy = first.xy;
+ const x = xy[2 * j] + (xy[2 * j + 2] - xy[2 * j]) * u, y = xy[2 * j + 1] + (xy[2 * j + 3] - xy[2 * j + 1]) * u;
+ const k0 = Math.max(0, j - 3), k1 = Math.min(first.n - 1, j + 4), dx = xy[2 * k1] - xy[2 * k0], dy = xy[2 * k1 + 1] - xy[2 * k0 + 1], L = Math.hypot(dx, dy) || 1;
+ return { x, y, dx: dx / L, dy: dy / L }; };
+ const HOOKZ = 4.2;
+ const followCam = t => { const tp = tipAt(Math.min(t, T.lift)); return { cx: tp.x + 20, cy: tp.y + 30, z: HOOKZ * (1 - 0.03 * Math.min(t, 3)), rot: -0.05 + 0.012 * Math.min(t, 3) }; };
+ const WIDE = { cx: 960, cy: 540, z: 1, rot: 0 };
+ const keys = [];
+ const K = (t, c, e = eio) => keys.push([t, c, e]);
+ K(T.peel[1], followCam(T.peel[1]));
+ K(6.2, WIDE);
+ K(T.d0, WIDE);
+ const frameFor = d => {
+ const cx = d.slot[0] < 960 ? 700 : 1258;
+ if (d.i === 0) return { cx, cy: d.slot[1] < 540 ? 440 : 640, z: 1.45, rot: 0 };
+ if (d.role === 'B') return { cx, cy: 702, z: 1.45, rot: 0 };
+ return { cx, cy: d.slot[1] < 540 ? 378 : 702, z: 1.45, rot: 0 }; // read-in framing after the wide
+ };
+ for (const d of dets) {
+ const a = d.a, fr = frameFor(d);
+ if (d.i === 0) { d.st = { x: d.f.x + 14, y: d.f.y + 2 }; K(a.push[1], { cx: d.f.x + 18, cy: d.f.y + 4, z: 4.3, rot: 0.012 }); K(a.travel[0], { cx: d.st.x, cy: d.st.y, z: 4.5, rot: 0.01 }, x => x); K(a.travel[1] + 0.6, fr); K(d.s + d.D, fr, x => x); }
+ else if (d.role === 'B') { K(a.push[1], fr); K(d.s + d.D, fr, x => x); }
+ else { K(a.push[1], WIDE); K(d.s + 2.9, WIDE, x => x); K(d.s + 3.9, fr); K(d.s + d.D, fr, x => x); }
+ }
+ K(T.gather[1] - 0.1, WIDE); K(T.colour[0], WIDE);
+ K(T.colour[0] + 2.5, { cx: 962, cy: 546, z: 1.02, rot: -0.0015 }); K(T.colour[1], WIDE);
+ K(T.end[1] + 1, WIDE);
+ const camAt = t => {
+ if (t <= T.peel[1]) return followCam(t);
+ // the signature move: the camera rides with the magnifying roundel as it lifts off the eye and carries it to its slot
+ const d0 = dets[0];
+ if (d0 && t >= d0.a.travel[0] && t <= d0.a.travel[1] + 0.6) {
+ const a = d0.a, u = seg(t, a.travel[0], a.travel[1] + 0.6), r = roundelAt(d0, Math.min(t, a.travel[1])), fr = frameFor(d0);
+ const z = Math.exp(lerp(Math.log(4.5), Math.log(fr.z), eio(u))), w = Math.pow(ss(u), 1.6), k0 = ss(seg(t, a.travel[0], a.travel[0] + 0.5));
+ const fx = lerp(d0.st.x, r.x + (fr.cx - d0.slot[0]) * 0.35, k0), fy = lerp(d0.st.y, r.y + (fr.cy - d0.slot[1]) * 0.35, k0);
+ return { cx: lerp(fx, fr.cx, w), cy: lerp(fy, fr.cy, w), z, rot: lerp(0.01, 0, u) };
+ }
+ let i = 0; while (i < keys.length - 1 && keys[i + 1][0] <= t) i++;
+ const [ta, ca] = keys[i], nx = keys[i + 1]; if (!nx) return ca;
+ const [tb, cb, e] = nx; const u = e(seg(t, ta, tb));
+ const za = Math.log(ca.z), zb = Math.log(cb.z), z = Math.exp(lerp(za, zb, u));
+ const wa = 1 / ca.z, wb = 1 / cb.z, v = Math.abs(wb - wa) > 1e-6 ? (1 / z - wa) / (wb - wa) : u;
+ const k = Math.abs(za - zb) > 0.3 ? clamp(v) : u;
+ return { cx: lerp(ca.cx, cb.cx, k), cy: lerp(ca.cy, cb.cy, k), z, rot: lerp(ca.rot || 0, cb.rot || 0, u) };
+ };
+
+ // ------------------------------------------------------------------ roundel state
+ function roundelAt(d, t) {
+ const a = d.a; if (t < a.ring[0]) return null;
+ const u = eio(seg(t, ...a.travel));
+ const x = lerp(d.f.x, d.slot[0], u), y = lerp(d.f.y, d.slot[1], u) - Math.sin(u * Math.PI) * 30, r = Math.exp(lerp(Math.log(d.f.r), Math.log(RR), u));
+ return { x, y, r, ring: seg(t, ...a.ring), burn: seg(t, ...a.burn), travel: u };
+ }
+
+ // ------------------------------------------------------------------ render
+ function applyCam(ctx, c, pre = null) { ctx.setTransform(1, 0, 0, 1, 0, 0); if (pre) ctx.transform(...pre); ctx.translate(W / 2, H / 2); ctx.rotate(c.rot || 0); ctx.scale(c.z, c.z); ctx.translate(-c.cx, -c.cy); }
+
+ function drawLeader(ctx, d, r, t) {
+ const f = [d.f.x, d.f.y];
+ let wp = null; if (d.wp) { const m = [(f[0] + r.x) / 2, (f[1] + r.y) / 2]; wp = [lerp(m[0], d.wp[0], r.travel), lerp(m[1], d.wp[1], r.travel)]; }
+ const aim = wp || f, dx = aim[0] - r.x, dy = aim[1] - r.y, L = Math.hypot(dx, dy) || 1; if (L < r.r + 6) return;
+ const end = [r.x + dx / L * r.r, r.y + dy / L * r.r];
+ ctx.save(); ctx.strokeStyle = PAL.ink; ctx.lineCap = 'round'; ctx.lineJoin = 'round'; ctx.lineWidth = 0.95;
+ ctx.beginPath(); ctx.moveTo(...f); if (wp) ctx.lineTo(...wp); ctx.lineTo(...end); ctx.stroke();
+ ctx.fillStyle = PAL.ink; ctx.beginPath(); ctx.arc(f[0], f[1], 1.7, 0, 7); ctx.fill(); ctx.restore();
+ const nxt = wp || end, ddx = nxt[0] - f[0], ddy = nxt[1] - f[1], LL = Math.hypot(ddx, ddy) || 1;
+ engraveText(ctx, String(d.i + 1), f[0] + ddx / LL * 26 + (-ddy / LL) * 11, f[1] + ddy / LL * 26 + (ddx / LL) * 11 + 5, { size: 15, italic: true, p: seg(t, d.a.travel[1] - 0.3, d.a.travel[1] + 0.2) });
+ }
+
+ function drawPaperScene(ctx, t, cam, { noColour = false, pre = null, inkOnly = false } = {}) {
+ applyCam(ctx, cam, pre);
+ if (!inkOnly) drawSheet(ctx, { W, H, plate: PLATE });
+ if (!noColour) wash.draw(ctx, t);
+ ink.draw(ctx, t);
+ frameInk.draw(ctx, t);
+ if (inkOnly) return;
+ // titles
+ const tt = T.title;
+ engraveText(ctx, String(C.title || '').toUpperCase() + '.', 960, 132, { size: 50, weight: 600, track: 0.16, p: seg(t, tt, tt + 0.9) });
+ engraveText(ctx, C.latin || '', 960, 170, { size: 24, italic: true, weight: 400, p: seg(t, tt + 0.45, tt + 1.1) });
+ const tg = T.gather[0];
+ engraveText(ctx, String(C.plate_no || '').toUpperCase() + '.', BORDER[2] - 16, 116, { size: 22, weight: 600, track: 0.12, align: 'right', p: seg(t, tg + 0.1, tg + 0.6) });
+ engraveText(ctx, String(C.series || '').toUpperCase(), BORDER[0] + 16, 112, { size: 13, weight: 500, track: 0.22, align: 'left', p: seg(t, tg + 0.2, tg + 1.0) });
+ // leaders under the roundels
+ for (const d of dets) { const r = roundelAt(d, t); if (r && r.travel > 0) drawLeader(ctx, d, r, t); }
+ // roundels
+ dets.forEach((d, j) => {
+ const r = roundelAt(d, t); if (!r) return;
+ ctx.save(); ctx.beginPath(); ctx.arc(r.x, r.y, r.r, 0, Math.PI * 2); ctx.clip();
+ ctx.globalAlpha = ss(r.burn);
+ ctx.fillStyle = PAL.paper; ctx.fillRect(r.x - r.r, r.y - r.r, r.r * 2, r.r * 2);
+ ctx.globalCompositeOperation = 'multiply'; ctx.drawImage(paperTexture(W, H), 0, 0, W, H);
+ ctx.globalAlpha = 0.55 * ss(r.burn); ctx.fillStyle = PAL.plateTone; ctx.fillRect(r.x - r.r, r.y - r.r, r.r * 2, r.r * 2);
+ ctx.globalAlpha = 1; ctx.globalCompositeOperation = 'source-over';
+ ctx.translate(r.x, r.y); const k = r.r / 500; ctx.scale(k, k);
+ if (d.art.magnify) {
+ const M = 500 / (d.f.r * 2.4), tb = t < d.a.cont[0] ? -99 : lerp(-2.7, 7.0, seg(t, ...d.a.cont));
+ ctx.scale(M, M); ctx.translate(-d.f.x, -d.f.y);
+ if (!noColour) wash.draw(ctx, t);
+ ink.draw(ctx, tb, { wScale: 0.55 });
+ } else {
+ if (!noColour) dWash[j].draw(ctx, t);
+ d.art.ink.draw(ctx, t, { wScale: Math.max(1, 0.55 / (k * cam.z)) ** 0.6 });
+ }
+ ctx.restore();
+ roundelFrame(ctx, r.x, r.y, r.r, { p: r.ring, w: 2.0 });
+ const lx = d.slot[0], ly = d.slot[1] + RR;
+ if (t > d.a.name) {
+ engraveText(ctx, d.lab.name, lx, ly + 36, { size: 17, weight: 600, track: 0.14, p: seg(t, d.a.name, d.a.name + 0.6) });
+ engraveText(ctx, d.lab.latin, lx, ly + 64, { size: 20, italic: true, weight: 400, p: seg(t, d.a.latin, d.a.latin + 0.55) });
+ const lines = wrapLines(ctx, d.lab.note, NOTE.width, { size: NOTE.size, font: FONTS.script });
+ const np = seg(t, d.a.note, d.a.note + 1.1);
+ lines.forEach((ln, q) => writeScript(ctx, ln, lx, ly + 100 + q * NOTE.size * NOTE.lead, { size: NOTE.size, p: clamp(np * lines.length - q) }));
+ }
+ });
+ // an empty slot shows the specimen at natural size (the plate is ~20 cm wide, the bee ~13 mm long)
+ if (natSlot && t > T.gather[0]) {
+ const [sx, sy] = SLOTS[natSlot], k = 0.19, tb = lerp(2.4, 6.9, seg(t, T.gather[0], T.gather[1] - 0.1));
+ ctx.save(); ctx.translate(sx, sy - 6); ctx.scale(k, k); ctx.translate(-960, -606);
+ if (!noColour) wash.draw(ctx, t);
+ ink.draw(ctx, tb, { wScale: 2.1 }); ctx.restore();
+ engraveText(ctx, (C.nat_size_label || 'Natural size').toUpperCase(), sx, sy + 110, { size: 15, weight: 600, track: 0.2, p: seg(t, T.gather[0] + 0.4, T.gather[1]) });
+ }
+ // the caption (the call to action) and the engravers' signatures
+ const tl = T.landing[0];
+ engraveText(ctx, C.caption || '', 960, 988, { size: 22, italic: true, weight: 500, p: seg(t, tl + 0.05, tl + 0.8) });
+ if (C.signature) {
+ engraveText(ctx, C.signature.left || '', BORDER[0] + 4, 1026, { size: 13, italic: true, align: 'left', p: seg(t, tl + 1.0, tl + 1.4) });
+ engraveText(ctx, C.signature.right || '', BORDER[2] - 4, 1026, { size: 13, italic: true, align: 'right', p: seg(t, tl + 1.2, tl + 1.6) });
+ }
+ }
+
+ function screenOf(cam, x, y) { const m = new DOMMatrix().translateSelf(W / 2, H / 2).rotateSelf(cam.rot * 180 / Math.PI).scaleSelf(cam.z, cam.z).translateSelf(-cam.cx, -cam.cy); const p = m.transformPoint(new DOMPoint(x, y)); return [p.x, p.y]; }
+ function drawCopperScene(ctx, t, cam) {
+ applyCam(ctx, cam);
+ Cu.drawCopper(ctx, [-300, -300, W + 300, H + 300]);
+ Cu.copperLight(ctx, W, H, cam); applyCam(ctx, cam);
+ guide.draw(ctx, Infinity, { color: 'rgba(255,226,196,0.4)', wScale: 0.3, dx: -0.25, dy: -0.25 });
+ guide.draw(ctx, Infinity, { color: 'rgba(60,24,8,0.25)', wScale: 0.2, dx: 0.2, dy: 0.2 });
+ Cu.drawGrooves(ctx, ink, Math.min(t, T.lift + 0.001), { zoom: cam.z });
+ const tp = tipAt(Math.min(t, T.lift)), sp = screenOf(cam, tp.x, tp.y), dv = [tp.dx * Math.cos(cam.rot) - tp.dy * Math.sin(cam.rot), tp.dx * Math.sin(cam.rot) + tp.dy * Math.cos(cam.rot)];
+ const lift = ss(seg(t, T.lift, T.lift + 0.35));
+ const cut = (Math.min(t, T.lift) + 1.6) * 150;
+ ctx.save(); ctx.setTransform(1, 0, 0, 1, 0, 0);
+ Cu.drawSwarf(ctx, sp, dv, cut, { s: 1.25 });
+ Cu.drawBurin(ctx, sp, dv, { s: 1.1, lift });
+ ctx.restore();
+ }
+
+ function drawSubs(ctx, t) {
+ const sb = subs.find(x => t >= x.t0 && t < x.t1); if (!sb) return;
+ const a = Math.min(seg(t, sb.t0, sb.t0 + 0.25), 1 - seg(t, sb.t1 - 0.2, sb.t1));
+ ctx.save(); ctx.setTransform(1, 0, 0, 1, 0, 0);
+ const size = 38, lines = wrapLines(ctx, sb.text, 860, { size, font: FONTS.script });
+ const lh = size * 1.12, hgt = lines.length * lh + 24, wid = Math.max(...lines.map(l => measure(ctx, l, { size, font: FONTS.script, weight: 400 }).tw)) + 70;
+ const y1 = 1058, y0 = y1 - hgt, x0 = 960 - wid / 2;
+ ctx.globalAlpha = a;
+ ctx.shadowColor = 'rgba(60,40,20,0.28)'; ctx.shadowBlur = 14; ctx.shadowOffsetY = 4;
+ ctx.fillStyle = '#f4eddb'; ctx.beginPath();
+ const R = B.RNG(7); ctx.moveTo(x0, y0); for (let x = x0; x <= x0 + wid; x += 14) ctx.lineTo(x, y0 + (R() - 0.5) * 2.2); for (let y = y0; y <= y1; y += 12) ctx.lineTo(x0 + wid + (R() - 0.5) * 2, y); for (let x = x0 + wid; x >= x0; x -= 14) ctx.lineTo(x, y1 + (R() - 0.5) * 2.2); for (let y = y1; y >= y0; y -= 12) ctx.lineTo(x0 + (R() - 0.5) * 2, y); ctx.closePath(); ctx.fill();
+ ctx.shadowColor = 'transparent';
+ lines.forEach((ln, i) => writeScript(ctx, ln, 960, y0 + 12 + lh * (i + 0.8), { size, color: '#2b1e14', p: 1, alpha: a }));
+ ctx.restore();
+ }
+
+ function drawEnd(ctx, t) {
+ const p = seg(t, T.end[0], T.end[0] + 0.7); if (p <= 0) return;
+ const y = lerp(-H - 40, 0, eo(p));
+ ctx.save(); ctx.setTransform(1, 0, 0, 1, 0, 0); ctx.translate(0, y);
+ // tissue guard: translucent, faintly creased, falling over the plate
+ ctx.fillStyle = 'rgba(246,241,229,0.9)'; ctx.fillRect(0, 0, W, H + 40);
+ ctx.globalCompositeOperation = 'multiply'; ctx.globalAlpha = 0.25; ctx.drawImage(paperTexture(W, H), 0, 0, W, H); ctx.globalAlpha = 1; ctx.globalCompositeOperation = 'source-over';
+ const g = ctx.createLinearGradient(0, H - 40, 0, H + 40); g.addColorStop(0, 'rgba(120,100,70,0)'); g.addColorStop(1, 'rgba(120,100,70,0.25)'); ctx.fillStyle = g; ctx.fillRect(0, H - 40, W, 80);
+ const e0 = T.end[0] + 0.3, E = C.end || {}, q = (a, b) => seg(t, e0 + a, e0 + b);
+ engraveText(ctx, String(E.film_title || C.title || '').toUpperCase(), 960, 420, { size: 46, weight: 600, track: 0.14, p: q(0, 0.5) });
+ engraveText(ctx, E.style_name || 'Copperplate Engraving', 960, 478, { size: 27, italic: true, p: q(0.05, 0.45) });
+ engraveText(ctx, 'LEMO-OPUSCAR', 960, 580, { size: 20, weight: 600, track: 0.3, p: q(0.1, 0.45) });
+ engraveText(ctx, 'LemoLab × Claude Opus 5.5', 960, 622, { size: 23, italic: true, p: q(0.1, 0.45) });
+ (E.credits || []).forEach((c, i) => engraveText(ctx, c, 960, 720 + i * 30, { size: 17, weight: 500, track: 0.04, p: q(0.15, 0.5) }));
+ ctx.restore();
+ }
+
+ function render(ctx, t) {
+ ctx.setTransform(1, 0, 0, 1, 0, 0); ctx.globalAlpha = 1; ctx.globalCompositeOperation = 'source-over'; ctx.filter = 'none';
+ const cam = camAt(t);
+ if (t < T.peel[0]) drawCopperScene(ctx, t, cam);
+ else if (t < T.peel[1]) drawPeel(ctx, t, cam);
+ else drawPaperScene(ctx, t, cam);
+ // print finish: a warm vignette
+ ctx.setTransform(1, 0, 0, 1, 0, 0);
+ if (t >= T.peel[0]) { const vg = ctx.createRadialGradient(W / 2, H * 0.5, H * 0.55, W / 2, H / 2, H * 1.15); vg.addColorStop(0, 'rgba(255,255,255,0)'); vg.addColorStop(1, 'rgba(120,86,46,0.2)'); ctx.globalCompositeOperation = 'multiply'; ctx.fillStyle = vg; ctx.fillRect(0, 0, W, H); ctx.globalCompositeOperation = 'source-over'; }
+ if (t >= T.peel[1] && !(typeof location !== 'undefined' && location.search.includes('nosub'))) drawSubs(ctx, t);
+ drawEnd(ctx, t);
+ }
+
+ // the proof is pulled: the sheet peels back across the frame. Behind the fold, the printed face; ahead of it, the copper;
+ // on the fold, the curling sheet shows its back with the print showing through, mirrored.
+ function drawPeel(ctx, t, cam) {
+ const u = ss(seg(t, ...T.peel)) * 0.7 + seg(t, ...T.peel) * 0.3, dir = [0.8, 0.6], span = 2700, off = lerp(-span / 2 - 260, span / 2 + 260, u);
+ const c = [W / 2 - dir[0] * off, H / 2 - dir[1] * off], n = [-dir[1], dir[0]], fw = 380;
+ const band = (d0, d1) => { const A = [c[0] + dir[0] * d0, c[1] + dir[1] * d0], Bp = [c[0] + dir[0] * d1, c[1] + dir[1] * d1]; ctx.beginPath(); ctx.moveTo(A[0] + n[0] * 3000, A[1] + n[1] * 3000); ctx.lineTo(A[0] - n[0] * 3000, A[1] - n[1] * 3000); ctx.lineTo(Bp[0] - n[0] * 3000, Bp[1] - n[1] * 3000); ctx.lineTo(Bp[0] + n[0] * 3000, Bp[1] + n[1] * 3000); ctx.closePath(); };
+ drawCopperScene(ctx, t, cam);
+ ctx.save(); ctx.setTransform(1, 0, 0, 1, 0, 0); band(0, 4000); ctx.clip(); drawPaperScene(ctx, t, cam, { noColour: true }); ctx.restore();
+ // shadow of the lifted sheet on the copper
+ ctx.save(); ctx.setTransform(1, 0, 0, 1, 0, 0); band(-fw * 0.9, -fw * 2.2); ctx.clip();
+ const sg = ctx.createLinearGradient(c[0] - dir[0] * fw * 0.9, c[1] - dir[1] * fw * 0.9, c[0] - dir[0] * fw * 2.2, c[1] - dir[1] * fw * 2.2); sg.addColorStop(0, 'rgba(30,10,2,0.6)'); sg.addColorStop(1, 'rgba(30,10,2,0)'); ctx.fillStyle = sg; ctx.fillRect(0, 0, W, H); ctx.restore();
+ // the flap: mirror of the paper just behind the fold, seen from its back
+ ctx.save(); ctx.setTransform(1, 0, 0, 1, 0, 0); band(0, -fw); ctx.clip();
+ ctx.fillStyle = '#efe6d0'; ctx.fillRect(0, 0, W, H);
+ ctx.globalCompositeOperation = 'multiply'; ctx.drawImage(paperTexture(W, H), 0, 0, W, H); ctx.globalCompositeOperation = 'source-over';
+ const dx = dir[0], dy = dir[1], cd = c[0] * dx + c[1] * dy, M = [1 - 2 * dx * dx, -2 * dx * dy, -2 * dx * dy, 1 - 2 * dy * dy, 2 * cd * dx, 2 * cd * dy];
+ ctx.globalAlpha = 0.28; ctx.filter = 'blur(0.8px)';
+ drawPaperScene(ctx, t, cam, { noColour: true, pre: M, inkOnly: true });
+ ctx.filter = 'none'; ctx.globalAlpha = 1; ctx.setTransform(1, 0, 0, 1, 0, 0);
+ const fg = ctx.createLinearGradient(c[0], c[1], c[0] - dir[0] * fw, c[1] - dir[1] * fw);
+ // the sheet bends like a cylinder: a dark crease at the fold, a bright roll, then it turns away from the light
+ fg.addColorStop(0, 'rgba(70,52,28,0.55)'); fg.addColorStop(0.06, 'rgba(120,96,60,0.2)'); fg.addColorStop(0.22, 'rgba(255,252,242,0.55)'); fg.addColorStop(0.5, 'rgba(255,255,255,0.05)'); fg.addColorStop(0.85, 'rgba(120,96,60,0.25)'); fg.addColorStop(1, 'rgba(80,60,34,0.45)');
+ ctx.fillStyle = fg; ctx.fillRect(0, 0, W, H);
+ ctx.restore();
+ ctx.save(); ctx.setTransform(1, 0, 0, 1, 0, 0); ctx.strokeStyle = 'rgba(80,60,34,0.5)'; ctx.lineWidth = 1.4; band(-fw, -fw - 0.01); ctx.stroke(); ctx.restore();
+ }
+
+ // ------------------------------------------------------------------ events (sound cues) for the mixer
+ const EV = [];
+ EV.push({ t: 0, type: 'burin', until: T.lift });
+ EV.push({ t: T.lift, type: 'lift' });
+ EV.push({ t: T.peel[0] - 0.25, type: 'press' }, { t: T.peel[0], type: 'peel' });
+ EV.push({ t: T.build.ol[0], type: 'hatch', until: T.build.h3[1] });
+ for (const g of ['ol', 'h1', 'h2', 'h3']) EV.push({ t: T.build[g][0], type: 'pass', g });
+ EV.push({ t: T.title, type: 'title', n: [...String(C.title || '')].length + 1, dur: 0.9 });
+ for (const d of dets) EV.push({ t: d.a.push[0], type: 'push', i: d.i, role: d.role, dur: d.D }, { t: d.a.ring[0], type: 'ring', i: d.i }, { t: d.a.burn[0], type: 'burnish', i: d.i }, { t: d.a.cont[0], type: 'cut', until: d.a.cont[1], i: d.i }, { t: d.a.travel[0], type: 'travel', until: d.a.travel[1], i: d.i }, { t: d.a.travel[1], type: 'land', i: d.i }, { t: d.a.name, type: 'letters', dur: 0.6 }, { t: d.a.note, type: 'quill', dur: 1.1, i: d.i });
+ EV.push({ t: T.gather[0], type: 'natsize' }, { t: T.silence[0], type: 'silence', until: T.silence[1] });
+ cOrder.forEach((name, k) => EV.push({ t: c0 + k * 0.42, type: 'drop', region: name }));
+ EV.push({ t: T.landing[0], type: 'landing' }, { t: T.landing[0] + 0.05, type: 'letters', dur: 0.75 }, { t: T.landing[0] + 1.0, type: 'dot' }, { t: T.landing[0] + 1.2, type: 'dot' }, { t: T.end[0] - 0.2, type: 'tissue' });
+ vo.forEach(v => EV.push({ t: v.t0, type: 'vo', id: v.id, dur: v.t1 - v.t0 }));
+ EV.sort((a, b) => a.t - b.t);
+
+ return { render, DUR, T, EV, subs, dets, cam: camAt };
+}
diff --git a/styles/engraving/demo/fonts/OFL.txt b/styles/engraving/demo/fonts/OFL.txt
new file mode 100644
index 0000000..75bbb47
--- /dev/null
+++ b/styles/engraving/demo/fonts/OFL.txt
@@ -0,0 +1,93 @@
+Copyright 2024 The Pinyon Project Authors (https://github.com/SorkinType/Pinyon)
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+https://openfontlicense.org
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
\ No newline at end of file
diff --git a/styles/engraving/demo/fonts/fonts.css b/styles/engraving/demo/fonts/fonts.css
new file mode 100644
index 0000000..e11e8fd
--- /dev/null
+++ b/styles/engraving/demo/fonts/fonts.css
@@ -0,0 +1,3 @@
+@font-face { font-family: "Bodoni Moda"; src: url("BodoniModa-VF.ttf") format("truetype"); font-weight: 400 900; font-style: normal; }
+@font-face { font-family: "Bodoni Moda"; src: url("BodoniModa-Italic-VF.ttf") format("truetype"); font-weight: 400 900; font-style: italic; }
+@font-face { font-family: "Pinyon Script"; src: url("PinyonScript-Regular.ttf") format("truetype"); font-weight: 400; }
diff --git a/styles/engraving/demo/index.html b/styles/engraving/demo/index.html
new file mode 100644
index 0000000..cfb6da3
--- /dev/null
+++ b/styles/engraving/demo/index.html
@@ -0,0 +1,6 @@
+<!doctype html>
+<html><head><meta charset="utf-8"><title>The Honeybee, Plate VII</title>
+<link rel="stylesheet" href="fonts/fonts.css">
+<style>html,body{margin:0;background:#000;overflow:hidden}canvas{position:absolute;left:0;top:0;display:block}</style>
+</head><body><canvas id="c" width="1920" height="1080"></canvas>
+<script type="module" src="main.js"></script></body></html>
diff --git a/styles/engraving/demo/lines.json b/styles/engraving/demo/lines.json
new file mode 100644
index 0000000..cc70dc2
--- /dev/null
+++ b/styles/engraving/demo/lines.json
@@ -0,0 +1,39 @@
+[
+ {
+ "id": "title",
+ "text": "Plate seven. The honeybee: Apis mellifera.",
+ "voice": "bm_fable",
+ "speed": 0.92,
+ "lang": "en-gb",
+ "asr": "Plate seven the honeybee a piece mellafura"
+ },
+ {
+ "id": "d1",
+ "text": "Each eye is built from some six thousand facets, and every one of them is a lens.",
+ "voice": "bm_fable",
+ "speed": 0.92,
+ "lang": "en-gb",
+ "asr": "Each eye is built from some 6000 facets and every one of them is a lens"
+ },
+ {
+ "id": "d2",
+ "text": "In flight, a row of tiny hooks locks the two wings into one.",
+ "voice": "bm_fable",
+ "speed": 0.92,
+ "lang": "en-gb"
+ },
+ {
+ "id": "d3",
+ "text": "And on the hind leg, a basket, for carrying pollen home.",
+ "voice": "bm_fable",
+ "speed": 0.92,
+ "lang": "en-gb"
+ },
+ {
+ "id": "close",
+ "text": "A lifetime of such work makes a twelfth of a teaspoon of honey.",
+ "voice": "bm_fable",
+ "speed": 0.92,
+ "lang": "en-gb"
+ }
+]
\ No newline at end of file
diff --git a/styles/engraving/demo/main.js b/styles/engraving/demo/main.js
new file mode 100644
index 0000000..f19d91a
--- /dev/null
+++ b/styles/engraving/demo/main.js
@@ -0,0 +1,13 @@
+// page contract for core/render: window.READY, window.render(t), window.DUR, window.EV
+// ?content=content_alt.json swaps the content file.
+import { makeFilm } from './film.js';
+const q = new URLSearchParams(location.search);
+const ctx = document.getElementById('c').getContext('2d');
+const C = await (await fetch(q.get('content') || 'content.json')).json();
+let dur = {};
+try { const r = await fetch(q.get('voices') || 'voices/dur.json'); if (r.ok) dur = await r.json(); } catch {}
+await Promise.all(['600 40px "Bodoni Moda"', 'italic 400 40px "Bodoni Moda"', '400 40px "Pinyon Script"'].map(f => document.fonts.load(f)));
+const film = makeFilm(C, dur);
+window.DUR = film.DUR; window.EV = film.EV; window.T = film.T;
+window.render = t => film.render(ctx, t);
+window.READY = true;
diff --git a/styles/engraving/demo/mix.py b/styles/engraving/demo/mix.py
new file mode 100644
index 0000000..1c5e088
--- /dev/null
+++ b/styles/engraving/demo/mix.py
@@ -0,0 +1,156 @@
+# Sound for "The Honeybee, Plate VII": three layers (room tone, foley keyed to the film's events, the baroque score),
+# the narrator on top with the score ducked under him. Run from the repo root:
+# .venv/bin/python styles/engraving/demo/mix.py
+# reads demo/events.json (node core/render/events.mjs), demo/voices/*.wav, demo/music/stems/*.wav; writes demo/mix.wav
+import sys, os, json, numpy as np, soundfile as sf, soxr
+sys.path.insert(0, '.')
+from core.audio.sfx import SR, add, bp, lp, hp, noise, brown, env_exp, t_, limit, compress, norm
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+WORK = os.environ.get('ENG_WORK') or HERE # ENG_WORK: work folder with events.json, voices/, music/stems (alt content)
+E = json.load(open(os.path.join(WORK, 'events.json'))); DUR = E['dur']; EV = E['ev']
+N = int(DUR * SR)
+rng = np.random.default_rng(53)
+room, foley, voice = np.zeros((N, 2)), np.zeros((N, 2)), np.zeros((N, 2))
+first = lambda typ: next(e for e in EV if e['type'] == typ)
+allof = lambda typ: [e for e in EV if e['type'] == typ]
+fade = lambda x, a=0.01, b=0.02: x * np.minimum(1, np.minimum(np.arange(len(x)) / max(1, int(a * SR)), (len(x) - np.arange(len(x))) / max(1, int(b * SR))))
+
+# ---------------- room tone: the engraver's workroom, then paper (both near-silent) ----------------
+def roomtone(d, lo, hi, gain):
+ x = bp(brown(d) * 0.6 + noise(d) * 0.05, lo, hi); return norm(x, 1) * gain
+peel = first('peel')['t']; sil = first('silence')
+rt = roomtone(DUR, 60, 1800, 0.012)
+envr = np.ones(N); s0, s1 = int(sil['t'] * SR), int(sil['until'] * SR); r_ = int(0.05 * SR)
+envr[s0:s1] = 0.25 # the silence: the room nearly vanishes too
+envr[s0 - r_:s0] = np.linspace(1, 0.25, r_); envr[s1:s1 + r_] = np.linspace(0.25, 1, r_)
+add(room, rt * envr, 0, 1.0, 0)
+# a faint clock in the workroom during the copper close-up
+for i, tt in enumerate(np.arange(0.15, peel, 0.5)):
+ tick = hp(noise(0.012), 2500) * env_exp(0.012, 0.002) * (0.012 if i % 2 else 0.009); add(room, tick, tt, 1.0, -0.6)
+
+# ---------------- the burin in copper ----------------
+b = first('burin'); d = b['until'] - b['t'] + 0.02
+sc = bp(noise(d), 2600, 9000, 2) * 0.55 + bp(noise(d), 900, 1800, 2) * 0.25 # the hiss of metal being ploughed
+tt = t_(d); am = 0.7 + 0.3 * np.sin(2 * np.pi * 5.3 * tt) * np.sin(2 * np.pi * 0.7 * tt) + 0.15 * rng.standard_normal(len(tt)).cumsum()[:len(tt)] * 0
+chatter = np.zeros(len(tt))
+for c in np.cumsum(rng.uniform(0.012, 0.045, 400)):
+ if c >= d: break
+ k = int(c * SR); L = min(len(chatter) - k, 120); chatter[k:k + L] += np.exp(-np.arange(L) / 18) * rng.uniform(0.3, 1)
+sc = sc * am + hp(chatter * rng.standard_normal(len(chatter)), 3000) * 0.5
+sc = fade(norm(sc, 1), 0.04, 0.03) * 0.16
+ring_ = sum(np.sin(2 * np.pi * f * tt) * a for f, a in [(1180, 1), (2310, 0.5), (3470, 0.3)]) * 0.012 * (0.6 + 0.4 * np.sin(2 * np.pi * 3 * tt)) # plate resonance
+add(foley, sc + ring_, b['t'], 1.0, 0.15)
+# swarf: tiny bright pings as the curl grows
+for c in np.cumsum(rng.uniform(0.07, 0.2, 40)):
+ if c >= d: break
+ f = rng.uniform(5200, 8800); p = np.sin(2 * np.pi * f * t_(0.05)) * env_exp(0.05, 0.008); add(foley, p * 0.02, b['t'] + c, 1.0, rng.uniform(-0.2, 0.4))
+# the lift: a small metallic tick, then air
+lf = first('lift')['t']
+add(foley, hp(noise(0.02), 3000) * env_exp(0.02, 0.003) * 0.18, lf, 1.0, 0.2)
+add(foley, np.sin(2 * np.pi * 2310 * t_(0.35)) * env_exp(0.35, 0.09) * 0.02, lf, 1.0, 0.2)
+
+# ---------------- the press and the pulled proof ----------------
+pr = first('press')['t']
+roll = lp(brown(0.6), 180) ; roll = norm(roll, 1) * np.linspace(0, 1, len(roll)) ** 1.5 * 0.2
+add(foley, roll, pr - 0.35, 1.0, 0) # J-cut: the roller before the image
+thump = np.sin(2 * np.pi * 58 * t_(0.35) * (1 - 0.3 * t_(0.35))) * env_exp(0.35, 0.08) * 0.35
+add(foley, thump, peel, 1.0, 0)
+pd = 0.72; crack = np.zeros(int(pd * SR))
+for c in np.cumsum(rng.exponential(0.006, 400)):
+ if c >= pd: break
+ k = int(c * SR); L = min(len(crack) - k, 200); crack[k:k + L] += rng.standard_normal(L) * np.exp(-np.arange(L) / 40) * rng.uniform(0.2, 1)
+crack = bp(crack, 900, 7000) * np.sin(np.pi * np.linspace(0, 1, len(crack))) ** 0.6
+add(foley, norm(crack, 1) * 0.16, peel + 0.02, 1.0, -0.2)
+add(foley, fade(bp(noise(0.6), 300, 2500)) * np.sin(np.pi * np.linspace(0, 1, int(0.6 * SR))) * 0.05, peel + 0.1, 1.0, -0.5)
+# the burin's hiss tails into the paper (L-cut): a soft echo of the scrape under the first printed line
+add(foley, sc[-int(0.5 * SR):] * np.linspace(0.6, 0, int(0.5 * SR)), peel + 0.05, 0.5, 0.15)
+
+# ---------------- engraving on the plate: fine granular scratching, one layer per pass ----------------
+def scratches(t0, t1, dens, gain, lo=3000, hi=10000, pan=0.0, seed=1):
+ r = np.random.default_rng(seed); d = t1 - t0; x = np.zeros(int(d * SR) + 400)
+ for c in np.cumsum(r.exponential(1 / dens, int(dens * d * 2) + 10)):
+ if c >= d: break
+ k = int(c * SR); L = int(r.uniform(0.004, 0.03) * SR); seg = r.standard_normal(L) * np.hanning(L) * r.uniform(0.2, 1)
+ x[k:k + L] += seg[:len(x) - k]
+ x = bp(x, lo, hi); env = np.sin(np.pi * np.linspace(0, 1, len(x))) ** 0.35
+ return norm(x * env, 1) * gain
+hat = first('hatch')
+passes = {e['g']: e['t'] for e in allof('pass')}
+add(foley, scratches(passes['ol'], passes['h1'] + 0.4, 60, 0.07, pan=0, seed=2), passes['ol'], 1.0, -0.1)
+add(foley, scratches(passes['h1'], passes['h2'] + 0.6, 180, 0.09, seed=3), passes['h1'], 1.0, 0.1)
+add(foley, scratches(passes['h2'], passes['h3'] + 0.8, 260, 0.085, lo=3500, seed=4), passes['h2'], 1.0, -0.15)
+add(foley, scratches(passes['h3'], hat['until'], 320, 0.07, lo=4500, hi=12000, seed=5), passes['h3'], 1.0, 0.2)
+for g, tt0 in passes.items(): # each pass opens with a soft scrape
+ add(foley, fade(bp(noise(0.18), 1800, 6000)) * env_exp(0.18, 0.06) * 0.05, tt0, 1.0, 0)
+
+def ticks(t0, n, dur, gain, pan=0.0, seed=7):
+ r = np.random.default_rng(seed)
+ for i in range(n):
+ x = hp(r.standard_normal(int(0.008 * SR)), 2500) * env_exp(0.008, 0.0015) * r.uniform(0.6, 1)
+ add(foley, x * gain, t0 + dur * i / max(1, n), 1.0, pan + r.uniform(-0.1, 0.1))
+ti = first('title'); ticks(ti['t'], ti['n'], ti['dur'], 0.07)
+
+# ---------------- the magnified details ----------------
+def whoosh(d, lo, hi, gain):
+ x = bp(noise(d), lo, hi); e = np.sin(np.pi * np.linspace(0, 1, len(x))) ** 1.5; return x * e * gain
+for e in allof('push'): add(foley, whoosh(0.9, 150, 900, 0.05), e['t'], 1.0, 0)
+for e in allof('ring'): # the burin scribing a circle
+ d = 0.4; x = bp(noise(d), 3500, 9000) * (0.6 + 0.4 * np.sin(2 * np.pi * 9 * t_(d))); add(foley, fade(x) * 0.06, e['t'], 1.0, 0.1)
+for e in allof('burnish'): add(foley, fade(lp(brown(0.3), 900)) * np.sin(np.pi * np.linspace(0, 1, int(0.3 * SR))) * 0.05, e['t'], 1.0, 0)
+for e in allof('cut'): add(foley, scratches(e['t'], e['until'], 140, 0.05, lo=4000, seed=10 + e['i']), e['t'], 1.0, [-.4, -.4, .4, .4][e['i']])
+for e in allof('travel'): add(foley, whoosh(e['until'] - e['t'], 400, 3000, 0.035), e['t'], 1.0, 0)
+for e in allof('land'):
+ x = (lp(noise(0.06), 1200) * env_exp(0.06, 0.012)) * 0.14; add(foley, x, e['t'], 1.0, [-.5, -.5, .5, .5][e['i']])
+for e in allof('letters'): ticks(e['t'], 12, e['dur'], 0.045, seed=int(e['t'] * 10))
+for e in allof('quill'): # a pen scratching the script note
+ d = e['dur']; tt = t_(d); x = bp(noise(d), 2200, 6500) * (0.35 + 0.65 * np.abs(np.sin(2 * np.pi * 4.2 * tt)) ** 2)
+ add(foley, fade(x, 0.03, 0.1) * 0.03, e['t'], 1.0, [-.5, -.5, .5, .5][e['i']])
+ns = first('natsize'); add(foley, scratches(ns['t'], ns['t'] + 1.1, 200, 0.03, lo=5000, seed=20), ns['t'], 1.0, 0.5)
+
+# ---------------- hand colouring: a drop, then the wet brush ----------------
+pans = {'abdomen': 0, 'thorax': 0, 'head': 0, 'eyes': -0.2, 'wings': 0.3, 'legs': -0.3, 'pollen': 0.35}
+for i, e in enumerate(allof('drop')):
+ d = 0.22; tt = t_(d); f = 1500 * np.exp(-tt * 9) + 520
+ plip = np.sin(2 * np.pi * np.cumsum(f) / SR) * env_exp(d, 0.035) * (0.22 if i == 0 else 0.07)
+ add(foley, plip + hp(noise(d), 4000) * env_exp(d, 0.003) * 0.05, e['t'], 1.0, pans.get(e['region'], 0))
+ w = bp(noise(0.8), 500, 4000) * np.sin(np.pi * np.linspace(0, 1, int(0.8 * SR))) ** 2
+ add(foley, w * (0.028 if i else 0.04), e['t'] + 0.05, 1.0, pans.get(e['region'], 0))
+lnd = first('landing')
+for e in allof('dot'): add(foley, hp(noise(0.01), 2000) * env_exp(0.01, 0.002) * 0.08, e['t'], 1.0, 0)
+tis = first('tissue')
+tissue = np.zeros(int(1.2 * SR))
+for c in np.cumsum(rng.exponential(0.01, 200)):
+ if c >= 1.15: break
+ k = int(c * SR); L = min(len(tissue) - k, 300); tissue[k:k + L] += rng.standard_normal(L) * np.exp(-np.arange(L) / 70) * rng.uniform(0.2, 1)
+tissue = bp(tissue, 1500, 9000) * np.sin(np.pi * np.linspace(0, 1, len(tissue))) ** 0.8
+add(foley, norm(tissue, 1) * 0.1, tis['t'], 1.0, 0)
+add(foley, whoosh(0.7, 200, 1500, 0.05), tis['t'] + 0.1, 1.0, 0)
+
+# ---------------- voice ----------------
+vd = os.path.join(WORK, 'voices'); vwin = []
+for e in allof('vo'):
+ y, sr = sf.read(os.path.join(vd, e['id'] + '.wav'))
+ if y.ndim > 1: y = y.mean(1)
+ y = soxr.resample(y, sr, SR); y = hp(y, 90)
+ y = compress(y / (np.abs(y).max() + 1e-9) * 0.8, thr=0.3, ratio=3)
+ add(voice, y, e['t'], 0.62, 0); vwin.append((e['t'], e['t'] + len(y) / SR))
+
+# ---------------- music, ducked under the voice (stems: the bowed strings duck least) ----------------
+st = os.path.join(WORK, 'music', 'stems')
+def load(n):
+ y, sr = sf.read(os.path.join(st, n)); y = y if y.ndim > 1 else np.stack([y, y], 1)
+ if sr != SR: y = soxr.resample(y, sr, SR)
+ out = np.zeros((N, 2)); out[:min(N, len(y))] = y[:N]; return out
+duck = np.ones(N)
+for a, b2 in vwin:
+ i0, i1 = int((a - 0.15) * SR), int((b2 + 0.25) * SR); duck[max(0, i0):i1] = np.minimum(duck[max(0, i0):i1], 0.5)
+k = int(0.12 * SR); duck = np.convolve(duck, np.ones(k) / k, mode='same')
+music = load('harpsichord.wav') * duck[:, None] ** 0.8 + load('pizz.wav') * duck[:, None] + load('bowed.wav') * (0.3 + 0.7 * duck[:, None])
+music *= 0.9
+
+mix = room + foley * 1.0 + music + voice
+mix = limit(mix, 0.95)
+sf.write(os.path.join(WORK, 'mix.wav'), mix.astype(np.float32), SR)
+os.makedirs(os.path.join(HERE, 'out'), exist_ok=True); json.dump([dict(t0=a, t1=b2) for a, b2 in vwin], open(os.path.join(HERE, 'out', 'vo_windows.json'), 'w'))
+print('mix.wav', mix.shape, 'peak', float(np.abs(mix).max()))
diff --git a/styles/engraving/demo/music/.gitignore b/styles/engraving/demo/music/.gitignore
new file mode 100644
index 0000000..4525ab9
--- /dev/null
+++ b/styles/engraving/demo/music/.gitignore
@@ -0,0 +1,2 @@
+stems/
+*.wav
diff --git a/styles/engraving/demo/music/CREDITS_music.txt b/styles/engraving/demo/music/CREDITS_music.txt
new file mode 100644
index 0000000..d981374
--- /dev/null
+++ b/styles/engraving/demo/music/CREDITS_music.txt
@@ -0,0 +1,3 @@
+Original score for "The Honeybee, Plate VII" (Copperplate Engraving demo, Lemo-Opuscar), composed in code (music/score.py).
+Instruments: harpsichord; violin, violins, violas, cellos, contrabass (pizzicato and arco).
+Samples (CC0): VS Chamber Orchestra: Community Edition (Versilian Studios), Versilian Community Sample Library (Versilian Studios)
diff --git a/styles/engraving/demo/music/NOTES.md b/styles/engraving/demo/music/NOTES.md
new file mode 100644
index 0000000..031a0b6
--- /dev/null
+++ b/styles/engraving/demo/music/NOTES.md
@@ -0,0 +1,77 @@
+# Music notes: "The Honeybee, Plate VII"
+
+Original score written in code (`score.py`; deterministic, and a rebuild gives a byte-identical `score.wav`). All melodies and progressions are new. It uses no existing or public-domain tunes.
+
+- **Key:** D major. **Tempo:** 96 BPM in 4/4 (beat 0.625 s, bar 2.5 s, 16 bars = 40.0 s).
+- **Forces:** harpsichord (continuo and solo figures) plus a string quartet: solo violin I and ensemble violin II, violas, cellos and contrabass. The strings play pizzicato up to 25.0 s and use the bow only from 26.25 s.
+- **Rebuild:** from the repo root, run `.venv/bin/python styles/engraving/demo/music/score.py`. It takes about 5 s and writes `score.wav`, `stems/`, `cues.json`, `CREDITS_music.txt` and `timing_report.txt`.
+- **Level:** integrated loudness is -18.0 LUFS (BS.1770, checked with ffmpeg ebur128). Peak is -1.2 dBFS. The file is 48 kHz stereo, 24-bit.
+- **Stems:** `harpsichord.wav`, `pizz.wav` and `bowed.wav`. Each is 40.0 s and uses the same gain as the mix, so the three sum to the mix before the limiter (about 1 dB of peak limiting on two hits).
+
+## Form (trio-sonata texture, the grammar of engraving followed by colour)
+
+| Bars / time | Harmony | What happens |
+|---|---|---|
+| 1 (0–2.5) | — | Silent for burin foley. **1.875 / 2.1875** harpsichord pickup A4 → C#5, damped short (below -28 dBFS by 2.3). |
+| 2 (2.5) | D, A/C# | **The print is pulled:** tutti downbeat accent (harpsichord D chord, cello, contrabass and viola pizz). Cello walking bass and viola in pizz 8ths. |
+| 3 (5.0) | Bm, G, A7 | **5.0** violin II enters in 16th pizz, broken-chord "cross-hatching". **6.25** harpsichord 32nd-note arpeggio flourish (G, then A7) rises into **7.5**. |
+| 4 (7.5) | D, G | Full texture. **9.375** it thins to a cello pizz A pedal plus a high harpsichord 8th figure (dominant, "curious"). |
+| 5 (10.0) | A pedal | **10.425** ring "ting": solo violin pizz A6 with harpsichord A5. **11.275–12.5875** rising pizz and harpsichord scale A4 → A5 (8 notes, 0.1875 s apart). **12.775** landing on low D (cello, contrabass and harpsichord D). |
+| 6 (12.5) | D, Bm | The pizz texture comes back lighter (it restarts at 13.125). |
+| 7 (15.0) | Em7, A7, D | **15.0** Em7 downbeat. **15.5** ting (B6). **15.8–16.66** faster rise (7 notes, 1/7 s apart). **16.8** landing on D. |
+| 8 (17.5) | Bm, G, A | Fuller texture. **19.375** thins to an A pedal (third detail). **19.875** ting (A6). |
+| 9 (20.0) | D, G | **20.0** the violin I pizz melody, the most tuneful moment: A5 F#5 D6 · B5 G5-A5 B5 C#6-D6 · E6 G5 F#5. **21.475** landing on low G. **22.19** the lift: violin II 16th crescendo plus a harpsichord roll. |
+| 10 (22.5) | Em, A7 | **23.75** harpsichord descending 16th run A5 → A4 (in octaves), ending on the dominant. The last note is 90 ms long and everything is gated to zero at 25.0. The expected tonic never comes, which is the joke. |
+| 11 (25.0–26.25) | — | **Total digital silence** (-inf dBFS, reverb tails included). |
+| 11b–13 (26.25) | D, Bm, G, Em7, A7 → **D** | **26.25** the first bowed notes of the film. Cellos, violas and violins enter pp on D and swell to mp by 27.6. Soprano line A5 B5 · D6 C#6 → D6, bass line descending in thirds D-B-G-E then A → D. The harpsichord is sparse and high: slow broken chords at 27.5, 28.75 and 30.0. **31.25** perfect cadence V7 → I: a low harpsichord D (not rolled) with the upper chord rolled after it, contrabass pizz, and bowed D chord. The tonic then rings. |
+| 14 (32.5) | D | **33.75** wink: one soft solo-violin pizz D6. |
+| 15–16 (35.0–40.0) | D | **35.625** a very soft harpsichord D-A-D roll for the end card. A fade from 36.6 reaches zero at 38.9. Digital silence from 39.0 to 40.0. |
+
+**Narration windows.** Inside 6.4–9.6, 9.8–14.9, 15.3–19.2 and 19.7–23.3 the pizz is short and dry, which keeps 300 Hz–3 kHz transient rather than sustained. During 26.9–30.9 the bowed chords sit mostly in the bass (cellos and contrabass below 300 Hz) and above 900 Hz (violins at A5–D6), with only violas and violin II in the voice band at pp. The harpsichord plays only four soft broken chords there.
+
+**Reverb.** `S.room` per stem, applied before the silence gates, so no tail leaks into 25.0–26.25: harpsichord size .28 / mix .16, pizz .30 / .18, bowed .42 / .24. There is a 35 Hz high-pass on every stem.
+
+## Timing check
+
+Method: each accent in `cues.json` is measured on its own rendered stem, after reverb. The detector finds the first 30 % rise from the local trough to the local peak in [t-60 ms, t+120 ms]. Low landings are measured below 300 Hz and tings above 2 kHz. The results are then matched to the brief's cue map. Tolerance is ±42 ms (one frame at 24 fps). For the bowed entry, the measure is the first bowed sample above -100 dBFS.
+
+```
+Against the brief cue map (nearest measured accent):
+OK map 1.8750s <- 1.8730s err -2.0 ms pickup 1: harpsichord A4
+OK map 2.1875s <- 2.1855s err -2.0 ms pickup 2: harpsichord C#5
+OK map 2.5000s <- 2.4990s err -1.0 ms bar 2 downbeat: print pulled (tutti D accent)
+OK map 5.0000s <- 5.0030s err +3.0 ms bar 3: 2nd violin 16th pizz hatching enters
+OK map 6.2500s <- 6.2500s err +0.0 ms harpsichord flourish starts (title engraved)
+OK map 7.5000s <- 7.5130s err +13.0 ms bar 4: flourish lands, full texture
+OK map 9.3750s <- 9.3800s err +5.0 ms texture thins: cello A pedal + high harpsichord figure
+OK map 10.4250s <- 10.4230s err -2.0 ms ring ting #1 (violin pizz A6 + harpsichord A5)
+OK map 11.2750s <- 11.2740s err -1.0 ms rising line #1 starts
+OK map 12.7750s <- 12.7970s err +22.0 ms landing #1: low cello + bass pizz D
+OK map 15.0000s <- 15.0070s err +7.0 ms bar 7: second detail begins (Em7 downbeat)
+OK map 15.5000s <- 15.4980s err -2.0 ms ring ting #2 (violin pizz B6)
+OK map 15.8000s <- 15.7940s err -6.0 ms rising line #2 starts
+OK map 16.8000s <- 16.8210s err +21.0 ms landing #2: low cello + bass pizz D
+OK map 19.3750s <- 19.3730s err -2.0 ms third detail: thins to cello A pedal (+ harpsichord A2 / E5 figure)
+OK map 19.8750s <- 19.8730s err -2.0 ms ring ting #3 (violin pizz A6)
+OK map 20.0000s <- 19.9980s err -2.0 ms 1st violin pizz melody begins
+OK map 21.4750s <- 21.4810s err +6.0 ms landing #3: low cello + bass pizz G
+OK map 22.2000s <- 22.1915s err -8.5 ms gentle lift (swell into bar 10)
+OK map 23.7500s <- 23.7470s err -3.0 ms harpsichord descending run starts
+OK map 26.2500s <- 26.2616s err +11.6 ms FIRST BOWED NOTE: strings enter pp on D (cellos/violas/violins)
+OK map 31.2500s <- 31.2520s err +2.0 ms perfect cadence V-I: tonic D lands (harpsichord roll + bass pizz + bowed D)
+OK map 33.7500s <- 33.7490s err -1.0 ms wink: soft violin pizz D6
+OK map 35.6250s <- 35.6270s err +2.0 ms end card: soft harpsichord tonic, fade begins
+
+Silence 0.0–1.87 s: peak -240.0 dBFS
+Silence 25.0–26.25 s: peak -240.0 dBFS (25.3–26.25: -240.0)
+Pickup ring 2.0–2.18 s: peak -31.6 dBFS; 2.3–2.49 s: peak -28.7 dBFS
+Tail 39.0–40.0 s: peak -240.0 dBFS
+Bowed stem silent before 26.25: peak -162.1 dBFS; first bowed sample above -100 dB at 26.2616 s
+Bowed stem reaches -50 dBFS at 26.4148 s, -40 dBFS at 26.5168 s
+Per-bar RMS (dBFS): b1:-35 b2:-20 b3:-21 b4:-19 b5:-21 b6:-23 b7:-20 b8:-22 b9:-20 b10:-19 b11:-36 b12:-24 b13:-20 b14:-21 b15:-25 b16:-74
+Mix: 40.000 s, 2 ch, 48000 Hz, peak -1.20 dBFS, integrated -18.0 LUFS
+
+ALL CUES WITHIN TOLERANCE
+```
+
+The full per-accent list, including the extra accents at 12.5875 and 24.8438, is in `timing_report.txt`.
diff --git a/styles/engraving/demo/music/cues.json b/styles/engraving/demo/music/cues.json
new file mode 100644
index 0000000..7f7f875
--- /dev/null
+++ b/styles/engraving/demo/music/cues.json
@@ -0,0 +1,139 @@
+[
+ {
+ "t": 1.875,
+ "what": "pickup 1: harpsichord A4",
+ "stem": "harpsichord"
+ },
+ {
+ "t": 2.1875,
+ "what": "pickup 2: harpsichord C#5",
+ "stem": "harpsichord"
+ },
+ {
+ "t": 2.5,
+ "what": "bar 2 downbeat: print pulled (tutti D accent)",
+ "stem": "pizz"
+ },
+ {
+ "t": 5.0,
+ "what": "bar 3: 2nd violin 16th pizz hatching enters",
+ "stem": "pizz"
+ },
+ {
+ "t": 6.25,
+ "what": "harpsichord flourish starts (title engraved)",
+ "stem": "harpsichord"
+ },
+ {
+ "t": 7.5,
+ "what": "bar 4: flourish lands, full texture",
+ "stem": "harpsichord"
+ },
+ {
+ "t": 9.375,
+ "what": "texture thins: cello A pedal + high harpsichord figure",
+ "stem": "pizz",
+ "band": "low"
+ },
+ {
+ "t": 10.425,
+ "what": "ring ting #1 (violin pizz A6 + harpsichord A5)",
+ "stem": "pizz",
+ "band": "high"
+ },
+ {
+ "t": 11.275,
+ "what": "rising line #1 starts",
+ "stem": "pizz"
+ },
+ {
+ "t": 12.5875,
+ "what": "rising line #1 top note",
+ "stem": "pizz"
+ },
+ {
+ "t": 12.775,
+ "what": "landing #1: low cello + bass pizz D",
+ "stem": "pizz",
+ "band": "low"
+ },
+ {
+ "t": 15.0,
+ "what": "bar 7: second detail begins (Em7 downbeat)",
+ "stem": "harpsichord"
+ },
+ {
+ "t": 15.5,
+ "what": "ring ting #2 (violin pizz B6)",
+ "stem": "pizz",
+ "band": "high"
+ },
+ {
+ "t": 15.8,
+ "what": "rising line #2 starts",
+ "stem": "pizz"
+ },
+ {
+ "t": 16.8,
+ "what": "landing #2: low cello + bass pizz D",
+ "stem": "pizz",
+ "band": "low"
+ },
+ {
+ "t": 19.375,
+ "what": "third detail: thins to cello A pedal (+ harpsichord A2 / E5 figure)",
+ "stem": "harpsichord"
+ },
+ {
+ "t": 19.875,
+ "what": "ring ting #3 (violin pizz A6)",
+ "stem": "pizz",
+ "band": "high"
+ },
+ {
+ "t": 20.0,
+ "what": "1st violin pizz melody begins",
+ "stem": "pizz"
+ },
+ {
+ "t": 21.475,
+ "what": "landing #3: low cello + bass pizz G",
+ "stem": "pizz",
+ "band": "low"
+ },
+ {
+ "t": 22.1875,
+ "what": "gentle lift (swell into bar 10)",
+ "stem": "harpsichord"
+ },
+ {
+ "t": 23.75,
+ "what": "harpsichord descending run starts",
+ "stem": "harpsichord"
+ },
+ {
+ "t": 24.8438,
+ "what": "run last note A4 (short) -> dead stop by 25.0",
+ "stem": "harpsichord"
+ },
+ {
+ "t": 26.25,
+ "what": "FIRST BOWED NOTE: strings enter pp on D (cellos/violas/violins)",
+ "stem": "bowed"
+ },
+ {
+ "t": 31.25,
+ "what": "perfect cadence V-I: tonic D lands (harpsichord roll + bass pizz + bowed D)",
+ "stem": "harpsichord"
+ },
+ {
+ "t": 33.75,
+ "what": "wink: soft violin pizz D6",
+ "stem": "pizz"
+ },
+ {
+ "t": 35.625,
+ "what": "end card: soft harpsichord tonic, fade begins",
+ "stem": "harpsichord"
+ }
+]
\ No newline at end of file
diff --git a/styles/engraving/demo/music/score.py b/styles/engraving/demo/music/score.py
new file mode 100644
index 0000000..4248232
--- /dev/null
+++ b/styles/engraving/demo/music/score.py
@@ -0,0 +1,418 @@
+"""《The Honeybee, Plate VII》原创配乐 —— 巴洛克室内乐:羽管键琴 + 弦乐四重奏(拨奏 → 首次拉弓)
+D 大调,96 BPM,4/4,一拍 0.625 s,一小节 2.5 s,16 小节 = 40.0 s。
+运行(仓库根目录):.venv/bin/python styles/engraving/demo/music/score.py
+输出:music/score.wav、music/stems/{harpsichord,pizz,bowed}.wav、music/cues.json、music/CREDITS_music.txt,
+ 并打印卡点校验报告(同时写入 music/timing_report.txt,NOTES.md 引用)。
+
+雕版段(2.5–25.0)= 细碎拨奏,像刻刀一刀一刀;上色段(26.25 起)= 全片第一次拉弓,长音舒展。
+"""
+import sys, os, json
+ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../..'))
+sys.path.insert(0, ROOT)
+import numpy as np, soundfile as sf
+from scipy.signal import butter, sosfilt, lfilter
+from core.audio import sampler as S
+from core.audio.sfx import SR, add, limit
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+# The score follows the picture: events.json (node demo/tools/events.mjs) gives the number of details, their roles
+# (A = long signature detail, B = tilt-down middle detail, C = pull-back detail) and where the outro starts.
+# Every section below is written once on the demo's own grid and placed by shifting it (OFF) to where the film has it.
+# ENG_WORK (optional): a work folder holding events.json and receiving the score outputs (used for the alt-content film)
+WORK = os.environ.get('ENG_WORK'); MOUT = os.path.join(WORK, 'music') if WORK else HERE; os.makedirs(MOUT, exist_ok=True)
+EVJ = json.load(open(os.path.join(WORK, 'events.json') if WORK else os.path.join(HERE, '..', 'events.json')))
+DUR = float(EVJ['dur']); N = int(round(DUR * SR))
+DETS = [e for e in EVJ['ev'] if e['type'] == 'push']
+OUTRO = next(e['t'] for e in EVJ['ev'] if e['type'] == 'natsize') # the gather/run starts here (23.75 in the demo)
+O2 = OUTRO - 23.75 # shift of everything after the details
+OFF = 0.0
+BEAT = .625; BAR = 2.5; E8 = BEAT / 2; E16 = BEAT / 4
+S.seed(7); RNG = np.random.default_rng(7)
+
+STEMS = ['harpsichord', 'pizz', 'bowed']
+bus = {k: np.zeros((N, 2), np.float32) for k in STEMS}
+CUES = [] # {t, what, stem}
+USED = set()
+
+def T(bar, beat=1.0):
+ """小节号(1 起)+ 拍(1 起,可小数)→ 秒"""
+ return (bar - 1) * BAR + (beat - 1) * BEAT
+
+def cue(t, what, stem, band=None):
+ """band='low' 只看 <300 Hz(低音落地),'high' 只看 >2 kHz(高音“叮”)"""
+ CUES.append(dict(t=round(float(t) + OFF, 4), what=what, stem=stem, **({'band': band} if band else {})))
+
+PRE = .003
+def tr(x):
+ """起音对齐:切掉 30% 峰值前 3 ms 以前的部分 → 放在 t-PRE 时冲击点正好落在 t"""
+ x = np.asarray(x, np.float32); a = np.abs(x); i = int(np.argmax(a > .3 * a.max()))
+ return x[max(0, i - int(PRE * SR)):]
+
+PAN = {'harpsichord': -.12, 'violin_pizz': -.4, 'violins_pizz': .35, 'violas_pizz': .15,
+ 'cellos_pizz': -.08, 'contrabass_pizz': -.15,
+ 'violins': .3, 'violin': -.4, 'violas': .12, 'cellos': -.1, 'contrabass': -.18}
+STEM_OF = lambda inst: 'harpsichord' if inst == 'harpsichord' else ('pizz' if inst.endswith('pizz') else 'bowed')
+
+def pl(t, inst, p, d=.25, v=.6, g=1.0, exact=False, pan=None, release=None):
+ """拨奏 / 羽管键琴一音。exact=False 时加 ±4 ms 人味和 ±0.04 力度浮动(卡点音一律 exact)"""
+ USED.add(inst)
+ if not exact:
+ t = t + RNG.uniform(-.004, .004); v = float(np.clip(v + RNG.uniform(-.04, .04), .05, 1))
+ kw = {} if release is None else dict(release=release)
+ x = tr(S.note(inst, p, d, vel=v, **kw))
+ add(bus[STEM_OF(inst)], x, t + OFF - PRE, g, PAN[inst] if pan is None else pan)
+
+def hch(t, ps, d=.4, v=.55, g=1.0, strum=.012, exact=False):
+ """羽管键琴和弦(轻琶,最低音落在 t)"""
+ for i, p in enumerate(ps): pl(t + i * strum, 'harpsichord', p, d, v, g, exact=(exact and i == 0))
+
+def bow(t, inst, p, d, v=.45, g=1.0, attack=.5, release=.6, pan=None):
+ """拉弓长音:从 t 开始(采样起点即 t,不做起音裁切),attack 秒淡入"""
+ USED.add(inst)
+ x = S.note(inst, p, d, vel=v, release=release)
+ a = np.abs(x); i0 = int(np.argmax(a > a.max() * 10 ** (-40 / 20))) # 去掉采样开头的空白,弓毛接触即 t
+ x = x[i0:].copy(); na = int(attack * SR); x[:na] *= np.linspace(0, 1, na) ** 1.5
+ add(bus['bowed'], x, t + OFF, g, PAN[inst] if pan is None else pan)
+
+# ════════════════════════════════════════════════════════════════════
+# 0.0–1.875:无音乐(刻刀拟音)
+# 1.875 / 2.1875:羽管键琴两音弱起(A4 → C#5,导入 D)
+pl(1.875, 'harpsichord', 'A4', .09, .62, exact=True, release=.03); cue(1.875, 'pickup 1: harpsichord A4', 'harpsichord')
+pl(2.1875, 'harpsichord', 'C#5', .09, .66, exact=True, release=.03); cue(2.1875, 'pickup 2: harpsichord C#5', 'harpsichord')
+
+# ─── 和声与声部素材 ───
+RH = {'D': ['D4', 'F#4', 'A4'], 'A/C#': ['C#4', 'E4', 'A4'], 'Bm': ['D4', 'F#4', 'B4'], 'G': ['D4', 'G4', 'B4'],
+ 'A7': ['C#4', 'E4', 'G4'], 'Em': ['E4', 'G4', 'B4'], 'Em7': ['D4', 'G4', 'B4']}
+HATCH = {'D': ['F#4', 'A4', 'D5', 'A4'], 'A/C#': ['E4', 'A4', 'C#5', 'A4'], 'Bm': ['D4', 'F#4', 'B4', 'F#4'],
+ 'G': ['G4', 'B4', 'D5', 'B4'], 'A7': ['E4', 'G4', 'C#5', 'G4'], 'Em': ['E4', 'G4', 'B4', 'G4'],
+ 'Em7': ['D4', 'G4', 'B4', 'G4']}
+VLA = {'D': ['A3', 'F#3'], 'A/C#': ['A3', 'E3'], 'Bm': ['B3', 'F#3'], 'G': ['B3', 'G3'], 'A7': ['G3', 'E3'],
+ 'Em': ['B3', 'G3'], 'Em7': ['B3', 'G3']}
+
+def cello8(t0, notes, v=.62, g=1.0):
+ for i, p in enumerate(notes):
+ if p: pl(t0 + i * E8, 'cellos_pizz', p, .3, v, g)
+
+def viola8(t0, chord, n, v=.42, g=1.0, off_only=False):
+ for i in range(n):
+ if off_only and i % 2 == 0: continue
+ pl(t0 + i * E8, 'violas_pizz', VLA[chord][i % 2], .25, v * (.85 if i % 2 == 0 else 1), g)
+
+def hatch16(t0, chord, beats, v=.36, g=1.0, cresc=0.0):
+ """第二小提琴十六分拨奏交叉排线"""
+ n = int(round(beats * 4))
+ for i in range(n):
+ vv = v + cresc * i / max(1, n - 1) + (.05 if i % 4 == 0 else 0)
+ pl(t0 + i * E16, 'violins_pizz', HATCH[chord][i % 4], .16, vv, g)
+
+def cont(t0, chord, beats, v=.5, g=1.0, every=1):
+ for k in range(0, beats, every): hch(t0 + k * BEAT, RH[chord], .3, v, g)
+
+# ─── 第 2 小节(2.5):拉印 —— 大提琴 + 中提琴八分拨奏 + 羽管键琴通奏低音,强下拍 ───
+t = T(2)
+hch(t, ['D3', 'A3', 'D4', 'F#4', 'A4'], .5, .78, .95, strum=.008, exact=True)
+pl(t, 'contrabass_pizz', 'D2', .5, .85, 1.1, exact=True)
+pl(t, 'cellos_pizz', 'D3', .35, .85, 1.1, exact=True)
+pl(t, 'violas_pizz', 'A3', .3, .7, 1.0, exact=True)
+cue(t, 'bar 2 downbeat: print pulled (tutti D accent)', 'pizz')
+cello8(t + E8, ['A2', 'D3', 'F#3'])
+cello8(T(2, 3), ['C#3', 'A2', 'C#3', 'E3'])
+viola8(t + E8, 'D', 3, off_only=False); viola8(T(2, 3), 'A/C#', 4)
+hch(T(2, 3), RH['A/C#'], .3, .5)
+
+# ─── 第 3 小节(5.0):第二小提琴十六分交叉排线进入;6.25 羽管键琴琶音华彩落 7.5 ───
+t = T(3)
+cello8(t, ['B2', 'F#2', 'B2', 'D3']); cello8(T(3, 3), ['G2', 'D3', 'A2', 'E3'], v=.55)
+viola8(t, 'Bm', 4); viola8(T(3, 3), 'G', 2, v=.34); viola8(T(3, 4), 'A7', 2, v=.34)
+pl(t, 'violins_pizz', 'D4', .16, .5, exact=True); cue(t, 'bar 3: 2nd violin 16th pizz hatching enters', 'pizz')
+hatch16(t + E16, 'Bm', 2 - .25, v=.34)
+hatch16(T(3, 3), 'G', 1, v=.26); hatch16(T(3, 4), 'A7', 1, v=.26)
+hch(t, RH['Bm'], .3, .5); hch(T(3, 2), RH['Bm'], .25, .4)
+# 华彩:G 大调琶音上行 8 音 + A7 琶音上行 8 音(三十二分),7.5 落 F#5 于 D 和弦
+FL = ['G2', 'B2', 'D3', 'G3', 'B3', 'D4', 'G4', 'B4', 'A3', 'C#4', 'E4', 'G4', 'A4', 'C#5', 'E5', 'G5']
+for i, p in enumerate(FL):
+ pl(T(3, 3) + i * (BAR / 2 / 16), 'harpsichord', p, .18, .44 + .01 * i, .9, exact=(i == 0))
+cue(T(3, 3), 'harpsichord flourish starts (title engraved)', 'harpsichord')
+
+# ─── 第 4 小节(7.5):全奏,自信 ───
+t = T(4)
+hch(t, ['D3', 'A3', 'D4', 'F#4', 'A4', 'D5', 'F#5'], .5, .72, .9, strum=.006, exact=True)
+pl(t, 'contrabass_pizz', 'D2', .5, .75, 1.0, exact=True); pl(t, 'cellos_pizz', 'D3', .3, .75, exact=True)
+cue(t, 'bar 4: flourish lands, full texture', 'harpsichord')
+cello8(t + E8, ['A2', 'D3', 'F#3']); cello8(T(4, 3), ['G2', 'D3'])
+viola8(t, 'D', 4, v=.44); viola8(T(4, 3), 'G', 2, v=.44)
+hatch16(t, 'D', 2, v=.38); hatch16(T(4, 3), 'G', 1, v=.36)
+cont(T(4, 2), 'D', 1, .45); cont(T(4, 3), 'G', 1, .5)
+pl(T(4, 3), 'contrabass_pizz', 'G1', .4, .6)
+
+def sec_A():
+ # ─── 9.375(第 4 小节第 4 拍):织体变薄 —— 只留高音羽管键琴音型 + 大提琴 A 持续低音 ───
+ t = T(4, 4)
+ pl(t, 'cellos_pizz', 'A2', .4, .6, exact=True); cue(t, 'texture thins: cello A pedal + high harpsichord figure', 'pizz', 'low')
+ for k in range(1, 3): pl(t + k * BEAT, 'cellos_pizz', 'A2', .4, .44) # 10.0, 10.625(11.25 让给上行线)
+ FIG = ['E5', 'A5', 'C#5', 'A5', 'D5', 'A5', 'C#5', 'A5']
+ for i in range(6): # 9.375 … 10.9375(8 分)
+ pl(t + i * E8, 'harpsichord', FIG[i % 8], .2, .36, exact=(i == 0))
+ # 10.425:放大镜圆环被刻出 —— 一声高亮 "叮"
+ pl(10.425, 'violin_pizz', 'A6', .5, .72, 1.1, exact=True)
+ pl(10.425, 'harpsichord', 'A5', .3, .35, .5, exact=True)
+ cue(10.425, 'ring ting #1 (violin pizz A6 + harpsichord A5)', 'pizz', 'high')
+ # 11.275–12.775:圆框飞过 —— 上行音阶;12.775 落地
+ RISE1 = ['A4', 'B4', 'C#5', 'D5', 'E5', 'F#5', 'G5', 'A5']
+ for i, p in enumerate(RISE1):
+ tt = 11.275 + i * .1875
+ pl(tt, 'violin_pizz', p, .2, .5 + .02 * i, .8, exact=True)
+ pl(tt, 'harpsichord', p, .15, .34 + .02 * i, .55, exact=True)
+ cue(11.275, 'rising line #1 starts', 'pizz'); cue(11.275 + 7 * .1875, 'rising line #1 top note', 'pizz')
+ pl(12.775, 'cellos_pizz', 'D2', .5, .85, 1.2, exact=True)
+ pl(12.775, 'contrabass_pizz', 'D2', .5, .85, 1.1, exact=True)
+ pl(12.775, 'harpsichord', 'D3', .3, .5, .7, exact=True)
+ cue(12.775, 'landing #1: low cello + bass pizz D', 'pizz', 'low')
+
+ # ─── 第 6 小节(12.5–15.0):拨奏回来,更轻 ───
+ cello8(T(6, 2), ['A2', 'D3', 'F#3'], v=.5)
+ cello8(T(6, 3), ['B2', 'F#2', 'B2', 'D3'], v=.5)
+ viola8(T(6, 2), 'D', 2, v=.34, off_only=True); viola8(T(6, 3), 'Bm', 4, v=.34, off_only=True)
+ hch(T(6, 3), RH['Bm'], .3, .42); hch(T(6, 4), RH['Bm'], .25, .34)
+ hatch16(T(6, 3), 'Bm', 2, v=.24)
+
+
+def sec_B():
+ # ─── 第 7 小节(15.0):第二个局部,同样语法更快 ───
+ t = T(7)
+ cello8(t, ['E3', 'B2', 'E3', 'G3'], v=.5)
+ hch(t, ['E3'] + RH['Em7'], .3, .5, exact=True); cue(t, 'bar 7: second detail begins (Em7 downbeat)', 'harpsichord')
+ for i, p in enumerate(['B5', 'E5', 'G5', 'E5']): pl(t + i * E8, 'harpsichord', p, .18, .33) # 高音音型到 15.9
+ pl(15.5, 'violin_pizz', 'B6', .5, .72, 1.1, exact=True); pl(15.5, 'harpsichord', 'B5', .3, .35, .5, exact=True)
+ cue(15.5, 'ring ting #2 (violin pizz B6)', 'pizz', 'high')
+ pl(T(7, 3), 'cellos_pizz', 'A2', .4, .5)
+ RISE2 = ['B4', 'C#5', 'D5', 'E5', 'F#5', 'G5', 'A5']
+ for i, p in enumerate(RISE2):
+ tt = 15.8 + i * (1.0 / 7)
+ pl(tt, 'violin_pizz', p, .18, .5 + .02 * i, .75, exact=True)
+ pl(tt, 'harpsichord', p, .14, .36 + .02 * i, .55, exact=True)
+ cue(15.8, 'rising line #2 starts', 'pizz')
+ pl(16.8, 'cellos_pizz', 'D2', .5, .85, 1.2, exact=True); pl(16.8, 'contrabass_pizz', 'D2', .5, .85, 1.1, exact=True)
+ pl(16.8, 'harpsichord', 'D3', .3, .5, .7, exact=True)
+ cue(16.8, 'landing #2: low cello + bass pizz D', 'pizz', 'low')
+ cello8(T(7, 4), ['D3', 'F#3'], v=.5); viola8(T(7, 4), 'D', 2, v=.34)
+
+ # ─── 第 8 小节(17.5):织体再满一点;19.375 第三个局部 ───
+ t = T(8)
+ pl(t, 'contrabass_pizz', 'B1', .4, .6)
+ cello8(t, ['B2', 'F#2', 'B2', 'D3'], v=.58); cello8(T(8, 3), ['G2', 'D3'], v=.55)
+ viola8(t, 'Bm', 4, v=.4); viola8(T(8, 3), 'G', 2, v=.38)
+ hatch16(t, 'Bm', 2, v=.34); hatch16(T(8, 3), 'G', 1, v=.3)
+ cont(t, 'Bm', 2, .46); cont(T(8, 3), 'G', 1, .44)
+
+def sec_C():
+ t = T(8, 4)
+ pl(t, 'cellos_pizz', 'A2', .4, .66, exact=True); pl(t, 'harpsichord', 'A2', .3, .5, .7, exact=True)
+ cue(t, 'third detail: thins to cello A pedal (+ harpsichord A2 / E5 figure)', 'harpsichord')
+ for i, p in enumerate(['E5', 'A5']): pl(t + i * E8, 'harpsichord', p, .2, .34, exact=(i == 0))
+ pl(19.875, 'violin_pizz', 'A6', .5, .72, 1.1, exact=True); pl(19.875, 'harpsichord', 'A5', .3, .35, .5, exact=True)
+ cue(19.875, 'ring ting #3 (violin pizz A6)', 'pizz', 'high')
+
+ # ─── 第 9 小节(20.0):第一小提琴的拨奏旋律 —— 旁白之下整条上移八度,让出人声频段 ───
+ MEL = [(0, 'A5', .5), (.5, 'F#5', .5), (1, 'D6', 1), (2, 'B5', .5), (2.5, 'G5', .25), (2.75, 'A5', .25),
+ (3, 'B5', .5), (3.5, 'C#6', .25), (3.75, 'D6', .25), (4, 'E6', 1), (5, 'G5', .5), (5.5, 'F#5', .5)]
+ for i, (b, p, d) in enumerate(MEL):
+ pl(T(9) + b * BEAT, 'violin_pizz', S.midi(p) + 12, d * BEAT, .66 if b < 4 else .6, 1.0, exact=(i == 0))
+ cue(T(9), '1st violin pizz melody begins', 'pizz')
+ cello8(T(9), ['D3', 'A2', 'D3', 'F#3'], v=.46)
+ viola8(T(9), 'D', 4, v=.3, off_only=True)
+ hch(T(9), RH['D'], .3, .4); hch(T(9, 2), RH['D'], .25, .32)
+ # 21.475:第三个落地(G)
+ pl(21.475, 'cellos_pizz', 'G2', .5, .85, 1.2, exact=True); pl(21.475, 'contrabass_pizz', 'G1', .5, .85, 1.1, exact=True)
+ pl(21.475, 'harpsichord', 'G2', .3, .5, .7, exact=True)
+ cue(21.475, 'landing #3: low cello + bass pizz G', 'pizz', 'low')
+ cello8(T(9, 4), ['D3', 'B2'], v=.46)
+ hch(T(9, 4), RH['G'], .25, .36)
+ # 22.2:小小的托起 —— 第二小提琴十六分渐强 + 羽管键琴轻琶
+ pl(22.1875, 'violins_pizz', 'G4', .16, .34, exact=True)
+ hatch16(22.1875 + E16, 'G', .25, v=.36, cresc=.04)
+ hch(22.1875, ['B3', 'D4', 'G4', 'B4'], .35, .45, .9, strum=.03, exact=True)
+ cue(22.1875, 'gentle lift (swell into bar 10)', 'harpsichord')
+
+ # ─── 第 10 小节(22.5):Em | A7,23.75 羽管键琴下行音阶,25.0 戛然而止 ───
+ t = T(10)
+ cello8(t, ['E3', 'B2', 'E3', 'G3'], v=.55)
+ viola8(t, 'Em', 4, v=.36)
+ hatch16(t, 'Em', 2, v=.42, cresc=-.14)
+ hch(t, RH['Em'], .3, .5); hch(T(10, 2), RH['Em'], .25, .4)
+
+def sec_outro():
+ pl(T(10, 3), 'cellos_pizz', 'A2', .35, .6); pl(T(10, 3), 'contrabass_pizz', 'A1', .35, .55)
+ pl(T(10, 4), 'cellos_pizz', 'A2', .3, .5)
+ RUN = ['A5', 'G5', 'F#5', 'E5', 'D5', 'C#5', 'B4', 'A4']
+ for i, p in enumerate(RUN):
+ last = i == len(RUN) - 1
+ pl(T(10, 3) + i * E16, 'harpsichord', p, .09 if last else .15, .55 + (.12 if last else 0), exact=(i == 0 or last),
+ release=.03 if last else None)
+ if i % 2 == 0: pl(T(10, 3) + i * E16, 'harpsichord', S.midi(p) - 12, .09 if i == 6 else .14, .4)
+ cue(T(10, 3), 'harpsichord descending run starts', 'harpsichord')
+ cue(T(10, 3) + 7 * E16, 'run last note A4 (short) -> dead stop by 25.0', 'harpsichord')
+
+ # ════════════════════════════════════════════════════════════════════
+ # 25.0–26.25:绝对静音
+ # 26.25 起:全片第一次拉弓 —— pp 渐强的长音,颜色晕开;羽管键琴稀疏轻琶
+ CH = [ # (t, cellos, violas, vln2, vln1, contrabass)
+ (26.25, 'D3', 'A3', 'F#4', 'A5', None),
+ (27.5, 'B2', 'B3', 'F#4', 'B5', None),
+ (28.75, 'G2', 'B3', 'G4', 'B5', 'G1'),
+ (30.0, 'E2', 'B3', 'G4', 'D6', 'E1'),
+ (30.625, 'A2', 'C#4', 'G4', 'C#6', 'A1'),
+ (31.25, 'D3', 'D4', 'F#4', 'D6', 'D2'),
+ ]
+ END_BOW = 36.0
+ def legato(col, inst, g, v0, pan=None):
+ """把某声部的长音连起来:同音延续不换弓"""
+ seq = [(c[0], c[col]) for c in CH if c[col] is not None]
+ merged = []
+ for tt, p in seq:
+ if merged and merged[-1][1] == p: continue
+ merged.append((tt, p))
+ for i, (tt, p) in enumerate(merged):
+ t1 = merged[i + 1][0] if i + 1 < len(merged) else END_BOW
+ first = tt == 26.25
+ att = .3 if first else (.12 if tt == 31.25 else .3)
+ bow(tt, inst, p, t1 - tt + .12, v0 + (.08 if tt >= 30 else 0), g, attack=att,
+ release=2.4 if t1 == END_BOW else .35, pan=pan)
+ legato(1, 'cellos', 1.0, .42)
+ legato(2, 'violas', .8, .38)
+ legato(3, 'violins', .7, .36, pan=.3)
+ legato(4, 'violins', .8, .4, pan=-.35)
+ legato(5, 'contrabass', .75, .4)
+ cue(26.25, 'FIRST BOWED NOTE: strings enter pp on D (cellos/violas/violins)', 'bowed')
+ # 渐强包络:26.25 pp → 27.6 mp,30.0–31.25 再微托起
+ env = np.ones(N, np.float32); tt_ = np.arange(N) / SR
+ tt_ = tt_ - O2
+ env = np.where(tt_ < 27.6, .55 + .45 * np.clip((tt_ - 26.25) / 1.35, 0, 1), 1.0)
+ env = env * (1 + .15 * np.clip((tt_ - 30.0) / 1.25, 0, 1) * (tt_ < 33.0) + .15 * (tt_ >= 33.0) * np.clip(1 - (tt_ - 33.0) / 1.0, 0, 1))
+ bus['bowed'] *= env[:, None].astype(np.float32)
+
+ # 羽管键琴:稀疏、高音区、轻(旁白 26.9–30.9 让开中频)
+ for t0, ps in [(27.5, ['B4', 'D5', 'F#5', 'B5']), (28.75, ['G4', 'B4', 'D5', 'G5']), (30.0, ['E4', 'G4', 'B4', 'E5'])]:
+ for i, p in enumerate(ps): pl(t0 + i * E8, 'harpsichord', p, .25, .28)
+ for i, p in enumerate(['A4', 'C#5', 'E5']): pl(30.625 + i * E16, 'harpsichord', p, .2, .3)
+ # 31.25:完满终止 V–I 落在第 13 小节第 3 拍 —— 成品揭晓
+ for p in ['D2', 'A2', 'D3']: pl(31.25, 'harpsichord', p, 1.6, .66, 1.0, exact=True) # 低音三音齐下,不琶
+ hch(31.25 + .014, ['F#3', 'A3', 'D4', 'F#4', 'A4', 'D5'], 1.6, .6, 1.0, strum=.014)
+ pl(31.25, 'contrabass_pizz', 'D2', .8, .6, .9, exact=True)
+ cue(31.25, 'perfect cadence V-I: tonic D lands (harpsichord roll + bass pizz + bowed D)', 'harpsichord')
+ # 33.75:最后一个轻轻的拨弦(眨眼)
+ pl(33.75, 'violin_pizz', 'D6', .4, .46, .9, exact=True); cue(33.75, 'wink: soft violin pizz D6', 'pizz')
+ # 35.625:片尾卡 —— 极轻的羽管键琴主和弦,随后自然淡出
+ hch(35.625, ['D4', 'A4', 'D5'], .9, .3, .7, strum=.05, exact=True)
+ cue(35.625, 'end card: soft harpsichord tonic, fade begins', 'harpsichord')
+
+
+# ─── place the sections where the film has them ───
+TEMPLATE = {'A': 9.375, 'B': 15.0, 'C': 19.375}
+for e in DETS:
+ role = e.get('role', 'A' if e['i'] == 0 else 'C')
+ OFF = e['t'] - TEMPLATE[role]
+ {'A': sec_A, 'B': sec_B, 'C': sec_C}[role]()
+OFF = O2
+sec_outro()
+OFF = 0.0
+
+# ════════════════════════════════════════════════════════════════════
+# 混响 → 静音门 → 电平
+ROOM = {'harpsichord': dict(size=.28, mix=.16), 'pizz': dict(size=.3, mix=.18), 'bowed': dict(size=.42, mix=.24)}
+for k in STEMS: bus[k] = S.room(bus[k], damp=.55, **ROOM[k]).astype(np.float32)
+
+def gate(a, b, fin=.012, fout=.02):
+ g = np.ones(N, np.float32); ia, ib = int(a * SR), int(b * SR)
+ g[ia:ib] = 0; f = int(fin * SR); g[max(0, ia - f):ia] = np.linspace(1, 0, min(f, ia))
+ fo = int(fout * SR); g[ib:ib + fo] = np.minimum(g[ib:ib + fo], np.linspace(0, 1, len(g[ib:ib + fo])))
+ return g
+G = gate(0.0, 1.874, 0, 0) * gate(24.985 + O2, 26.25 + O2, .02, 0)
+tt_ = np.arange(N) / SR
+G *= np.clip(1 - (tt_ - 36.6 - O2) / 2.3, 0, 1).astype(np.float32) # 36.6 起自然淡出,38.9 归零
+for k in STEMS: bus[k] *= G[:, None]
+_HP = butter(2, 35, 'high', fs=SR, output='sos')
+for k in STEMS: bus[k] = sosfilt(_HP, bus[k], axis=0).astype(np.float32) * G[:, None] # 去超低频隆隆声
+
+GAIN = {'harpsichord': 1.0, 'pizz': 1.0, 'bowed': 1.45}
+mix = sum(bus[k] * GAIN[k] for k in STEMS)
+
+def lufs(x):
+ """ITU-R BS.1770-4 积分响度(48 kHz K 计权 + 双门限)"""
+ b1, a1 = [1.53512485958697, -2.69169618940638, 1.19839281085285], [1, -1.69065929318241, .73248077421585]
+ b2, a2 = [1, -2, 1], [1, -1.99004745483398, .99007225036621]
+ y = lfilter(b2, a2, lfilter(b1, a1, x, axis=0), axis=0)
+ blk, hop = int(.4 * SR), int(.1 * SR)
+ ms = np.array([np.sum(np.mean(y[i:i + blk] ** 2, 0)) for i in range(0, len(y) - blk, hop)])
+ L = -.691 + 10 * np.log10(ms + 1e-12); ms = ms[L > -70]
+ if not len(ms): return -99
+ rel = -.691 + 10 * np.log10(ms.mean()) - 10
+ ms = ms[-.691 + 10 * np.log10(ms) > rel]
+ return -.691 + 10 * np.log10(ms.mean())
+
+sc = 10 ** ((-18.0 - lufs(mix)) / 20)
+_pre = np.abs(mix * sc).max(1)
+for _ in range(4):
+ _i = int(np.argmax(_pre)); print(f'pre-limit peak {20*np.log10(_pre[_i]):+.1f} dBFS at {_i/SR:.3f}s', {k: round(float(20*np.log10(np.abs(bus[k][_i]*GAIN[k]*sc).max()+1e-9)),1) for k in STEMS}); _pre[max(0,_i-SR//4):_i+SR//4] = 0
+mix = mix * sc
+CEIL = 10 ** (-1.2 / 20)
+mix = np.stack([limit(mix[:, 0], CEIL), limit(mix[:, 1], CEIL)], 1).astype(np.float32)
+mix = np.clip(mix, -CEIL, CEIL)[:N]
+sf.write(os.path.join(MOUT, 'score.wav'), mix, SR, subtype='PCM_24')
+os.makedirs(os.path.join(MOUT, 'stems'), exist_ok=True)
+for k in STEMS: sf.write(os.path.join(MOUT, 'stems', k + '.wav'), np.clip(bus[k] * GAIN[k] * sc, -1, 1).astype(np.float32), SR, subtype='PCM_24')
+json.dump(sorted(CUES, key=lambda c: c['t']), open(os.path.join(MOUT, 'cues.json'), 'w'), indent=1, ensure_ascii=False)
+open(os.path.join(MOUT, 'CREDITS_music.txt'), 'w').write(
+ 'Original score for "The Honeybee, Plate VII" (Copperplate Engraving demo, Lemo-Opuscar), composed in code (music/score.py).\n'
+ 'Instruments: harpsichord; violin, violins, violas, cellos, contrabass (pizzicato and arco).\n'
+ + '\n'.join(S.credits(sorted(USED))) + '\n')
+
+# ════════════════════════════════════════════════════════════════════
+# 卡点校验:在对应 stem(混响后)上找 cue 附近 ±60 ms 内的最大能量跃升(5 ms 帧,log 能量差分)
+TOL = .042
+def onset_near(x, t, win=.06):
+ """攻击点:窗口 [t-60ms, t+120ms] 内,包络从局部谷底升到 (谷底 + 30%×(峰-谷)) 的首个时刻"""
+ m = x.mean(1) if x.ndim == 2 else x
+ hop = int(.001 * SR); w = int(.004 * SR)
+ a = int((t - win) * SR); b = int((t + .12) * SR)
+ A = np.array([np.sqrt(np.mean(m[i:i + w] ** 2)) for i in range(a, b, hop)])
+ ts = (np.arange(len(A)) * hop + a + w / 2) / SR
+ k0 = int(np.argmax(A)); lo_i = int(np.argmin(A[:k0 + 1])); lo, hi = A[lo_i], A[k0]
+ k = lo_i + int(np.argmax(A[lo_i:k0 + 1] >= lo + .3 * (hi - lo)))
+ return float(ts[k]), float(20 * np.log10(hi / max(lo, 1e-9)))
+
+lines = ['Timing check (onset = first 30% rise from local trough to local peak in [t-60 ms, t+120 ms], measured on the rendered stem; tol ±0.042 s = 1 frame @24fps)', '']
+allok = True
+for c in sorted(CUES, key=lambda c: c['t']):
+ x = bus[c['stem']]
+ if c['stem'] == 'bowed':
+ m = np.abs(x.mean(1)); i = int(np.argmax(m > 1e-5)); got = i / SR; rise = 0.0 # 首个 > -100 dBFS 的弓奏样本
+ else:
+ if c.get('band') == 'low': x = sosfilt(butter(4, 300, 'low', fs=SR, output='sos'), x, axis=0)
+ if c.get('band') == 'high': x = sosfilt(butter(4, 2000, 'high', fs=SR, output='sos'), x, axis=0)
+ got, rise = onset_near(x, c['t'])
+ err = got - c['t']; ok = abs(err) <= TOL; allok &= ok
+ c['got'] = got
+ lines.append(f"{'OK ' if ok else 'BAD'} {c['t']:7.4f}s got {got:7.4f}s err {err*1000:+6.1f} ms (rise {rise:4.1f} dB) {c['what']}")
+CUE_MAP = sorted({c['t'] for c in CUES})
+lines += ['', 'Against the brief cue map (nearest measured accent):']
+for tm in CUE_MAP:
+ c = min(CUES, key=lambda c: abs(c['got'] - tm)); err = c['got'] - tm
+ if abs(tm - (26.25 + O2)) < 1e-6: ok = 26.25 + O2 <= c['got'] <= 26.35 + O2
+ else: ok = abs(err) <= TOL
+ allok &= ok
+ lines.append(f"{'OK ' if ok else 'BAD'} map {tm:7.4f}s <- {c['got']:7.4f}s err {err*1000:+6.1f} ms {c['what']}")
+def rms_db(a, b): s = mix[int(a * SR):int(b * SR)]; return 20 * np.log10(np.sqrt(np.mean(s ** 2)) + 1e-12)
+def pk_db(a, b): s = mix[int(a * SR):int(b * SR)]; return 20 * np.log10(np.abs(s).max() + 1e-12)
+bw = np.abs(bus['bowed'].mean(1)); first_bow = int(np.argmax(bw > 1e-5)) / SR
+lines += ['', f'Silence 0.0–1.87 s: peak {pk_db(0, 1.87):.1f} dBFS',
+ f'Silence {25.0 + O2:.2f}–{26.25 + O2:.2f} s: peak {pk_db(25.0 + O2, 26.25 + O2):.1f} dBFS',
+ f'Pickup ring 2.0–2.18 s: peak {pk_db(2.0, 2.18):.1f} dBFS; 2.3–2.49 s: peak {pk_db(2.3, 2.49):.1f} dBFS',
+ f'Tail {DUR - 1:.1f}–{DUR:.1f} s: peak {pk_db(DUR - 1, DUR):.1f} dBFS',
+ f'Bowed stem silent before 26.25: peak {20*np.log10(np.abs(bus["bowed"][:int((26.25 + O2)*SR)]).max()+1e-12):.1f} dBFS; first bowed sample above -100 dB at {first_bow:.4f} s',
+ f'Bowed stem reaches -50 dBFS at {int(np.argmax(bw > 10**(-50/20)))/SR:.4f} s, -40 dBFS at {int(np.argmax(bw > 10**(-40/20)))/SR:.4f} s',
+ 'Per-bar RMS (dBFS): ' + ' '.join(f"b{n+1}:{rms_db(n*BAR,(n+1)*BAR):.0f}" for n in range(int(DUR // BAR))),
+ f'Mix: {len(mix)/SR:.3f} s, {mix.shape[1]} ch, {SR} Hz, peak {20*np.log10(np.abs(mix).max()):.2f} dBFS, integrated {lufs(mix):.1f} LUFS',
+ '', 'ALL CUES WITHIN TOLERANCE' if allok else 'SOME CUES OUT OF TOLERANCE']
+rep = '\n'.join(lines); print(rep)
+open(os.path.join(MOUT, 'timing_report.txt'), 'w').write(rep + '\n')
diff --git a/styles/engraving/demo/music/timing_report.txt b/styles/engraving/demo/music/timing_report.txt
new file mode 100644
index 0000000..deaed70
--- /dev/null
+++ b/styles/engraving/demo/music/timing_report.txt
@@ -0,0 +1,67 @@
+Timing check (onset = first 30% rise from local trough to local peak in [t-60 ms, t+120 ms], measured on the rendered stem; tol ±0.042 s = 1 frame @24fps)
+
+OK 1.8750s got 1.8730s err -2.0 ms (rise 157.2 dB) pickup 1: harpsichord A4
+OK 2.1875s got 2.1855s err -2.0 ms (rise 34.2 dB) pickup 2: harpsichord C#5
+OK 2.5000s got 2.4990s err -1.0 ms (rise 169.1 dB) bar 2 downbeat: print pulled (tutti D accent)
+OK 5.0000s got 5.0030s err +3.0 ms (rise 26.3 dB) bar 3: 2nd violin 16th pizz hatching enters
+OK 6.2500s got 6.2500s err +0.0 ms (rise 30.3 dB) harpsichord flourish starts (title engraved)
+OK 7.5000s got 7.5130s err +13.0 ms (rise 13.1 dB) bar 4: flourish lands, full texture
+OK 9.3750s got 9.3800s err +5.0 ms (rise 30.1 dB) texture thins: cello A pedal + high harpsichord figure
+OK 10.4250s got 10.4230s err -2.0 ms (rise 82.5 dB) ring ting #1 (violin pizz A6 + harpsichord A5)
+OK 11.2750s got 11.2740s err -1.0 ms (rise 35.8 dB) rising line #1 starts
+OK 12.5875s got 12.5855s err -2.0 ms (rise 31.0 dB) rising line #1 top note
+OK 12.7750s got 12.7970s err +22.0 ms (rise 61.6 dB) landing #1: low cello + bass pizz D
+OK 15.0000s got 15.0070s err +7.0 ms (rise 47.3 dB) bar 7: second detail begins (Em7 downbeat)
+OK 15.5000s got 15.4980s err -2.0 ms (rise 61.9 dB) ring ting #2 (violin pizz B6)
+OK 15.8000s got 15.7940s err -6.0 ms (rise 14.2 dB) rising line #2 starts
+OK 16.8000s got 16.8210s err +21.0 ms (rise 41.0 dB) landing #2: low cello + bass pizz D
+OK 19.3750s got 19.3730s err -2.0 ms (rise 29.7 dB) third detail: thins to cello A pedal (+ harpsichord A2 / E5 figure)
+OK 19.8750s got 19.8730s err -2.0 ms (rise 67.8 dB) ring ting #3 (violin pizz A6)
+OK 20.0000s got 19.9980s err -2.0 ms (rise 24.3 dB) 1st violin pizz melody begins
+OK 21.4750s got 21.4810s err +6.0 ms (rise 56.6 dB) landing #3: low cello + bass pizz G
+OK 22.1875s got 22.1915s err +4.0 ms (rise 28.9 dB) gentle lift (swell into bar 10)
+OK 23.7500s got 23.7470s err -3.0 ms (rise 36.4 dB) harpsichord descending run starts
+OK 24.8438s got 24.8408s err -3.0 ms (rise 8.7 dB) run last note A4 (short) -> dead stop by 25.0
+OK 26.2500s got 26.2616s err +11.6 ms (rise 0.0 dB) FIRST BOWED NOTE: strings enter pp on D (cellos/violas/violins)
+OK 31.2500s got 31.2520s err +2.0 ms (rise 40.1 dB) perfect cadence V-I: tonic D lands (harpsichord roll + bass pizz + bowed D)
+OK 33.7500s got 33.7490s err -1.0 ms (rise 152.0 dB) wink: soft violin pizz D6
+OK 35.6250s got 35.6270s err +2.0 ms (rise 152.1 dB) end card: soft harpsichord tonic, fade begins
+
+Against the brief cue map (nearest measured accent):
+OK map 1.8750s <- 1.8730s err -2.0 ms pickup 1: harpsichord A4
+OK map 2.1875s <- 2.1855s err -2.0 ms pickup 2: harpsichord C#5
+OK map 2.5000s <- 2.4990s err -1.0 ms bar 2 downbeat: print pulled (tutti D accent)
+OK map 5.0000s <- 5.0030s err +3.0 ms bar 3: 2nd violin 16th pizz hatching enters
+OK map 6.2500s <- 6.2500s err +0.0 ms harpsichord flourish starts (title engraved)
+OK map 7.5000s <- 7.5130s err +13.0 ms bar 4: flourish lands, full texture
+OK map 9.3750s <- 9.3800s err +5.0 ms texture thins: cello A pedal + high harpsichord figure
+OK map 10.4250s <- 10.4230s err -2.0 ms ring ting #1 (violin pizz A6 + harpsichord A5)
+OK map 11.2750s <- 11.2740s err -1.0 ms rising line #1 starts
+OK map 12.5875s <- 12.5855s err -2.0 ms rising line #1 top note
+OK map 12.7750s <- 12.7970s err +22.0 ms landing #1: low cello + bass pizz D
+OK map 15.0000s <- 15.0070s err +7.0 ms bar 7: second detail begins (Em7 downbeat)
+OK map 15.5000s <- 15.4980s err -2.0 ms ring ting #2 (violin pizz B6)
+OK map 15.8000s <- 15.7940s err -6.0 ms rising line #2 starts
+OK map 16.8000s <- 16.8210s err +21.0 ms landing #2: low cello + bass pizz D
+OK map 19.3750s <- 19.3730s err -2.0 ms third detail: thins to cello A pedal (+ harpsichord A2 / E5 figure)
+OK map 19.8750s <- 19.8730s err -2.0 ms ring ting #3 (violin pizz A6)
+OK map 20.0000s <- 19.9980s err -2.0 ms 1st violin pizz melody begins
+OK map 21.4750s <- 21.4810s err +6.0 ms landing #3: low cello + bass pizz G
+OK map 22.1875s <- 22.1915s err +4.0 ms gentle lift (swell into bar 10)
+OK map 23.7500s <- 23.7470s err -3.0 ms harpsichord descending run starts
+OK map 24.8438s <- 24.8408s err -3.0 ms run last note A4 (short) -> dead stop by 25.0
+OK map 26.2500s <- 26.2616s err +11.6 ms FIRST BOWED NOTE: strings enter pp on D (cellos/violas/violins)
+OK map 31.2500s <- 31.2520s err +2.0 ms perfect cadence V-I: tonic D lands (harpsichord roll + bass pizz + bowed D)
+OK map 33.7500s <- 33.7490s err -1.0 ms wink: soft violin pizz D6
+OK map 35.6250s <- 35.6270s err +2.0 ms end card: soft harpsichord tonic, fade begins
+
+Silence 0.0–1.87 s: peak -240.0 dBFS
+Silence 25.00–26.25 s: peak -240.0 dBFS
+Pickup ring 2.0–2.18 s: peak -31.1 dBFS; 2.3–2.49 s: peak -28.3 dBFS
+Tail 39.0–40.0 s: peak -240.0 dBFS
+Bowed stem silent before 26.25: peak -162.1 dBFS; first bowed sample above -100 dB at 26.2616 s
+Bowed stem reaches -50 dBFS at 26.4148 s, -40 dBFS at 26.5168 s
+Per-bar RMS (dBFS): b1:-35 b2:-19 b3:-20 b4:-19 b5:-21 b6:-23 b7:-20 b8:-22 b9:-25 b10:-20 b11:-36 b12:-24 b13:-19 b14:-20 b15:-24 b16:-73
+Mix: 40.000 s, 2 ch, 48000 Hz, peak -1.20 dBFS, integrated -18.0 LUFS
+
+ALL CUES WITHIN TOLERANCE
diff --git a/styles/engraving/demo/subjects/bee.js b/styles/engraving/demo/subjects/bee.js
new file mode 100644
index 0000000..288d966
--- /dev/null
+++ b/styles/engraving/demo/subjects/bee.js
@@ -0,0 +1,285 @@
+// The honeybee (Apis mellifera, worker), dorsal view, wings spread as on a 19th-century natural-history plate.
+// Built entirely from the burin engine. Local frame: plate px at scale 1, thorax/abdomen junction at (0,0), head up (−y).
+// buildBee({ x, y, s }) → { ink, regions, focus, groups }
+// ink groups, in cutting order: 'ol' (outlines + veins), 'h1' (first hatch families), 'h2' (cross-hatching),
+// 'h3' (deep darks, stipple, hair).
+// regions: named Path2D + polys for hand-colouring (abdomen, thorax, head, eyes, wings, legs, pollen).
+// focus: named world points for the magnified details (eye, hamuli, corbicula) + which side of the plate they sit.
+import * as B from '../engine/burin.js';
+const { shape, ring, xf, clamp, ellipsePts, sphereTone, cylTone, hatch, engraveTone, outline, stroke, stipple, fur, RNG, noise2, inPoly, addT } = B;
+
+const L = { x: -0.55, y: -0.62, z: 0.56 }; // light from the upper left, as on every plate of the period
+const LV = [L.x, L.y];
+
+// a tapered capsule between two points (leg and antenna segments)
+function capsule(a, b, w0, w1, n = 10) {
+ const dx = b[0] - a[0], dy = b[1] - a[1], len = Math.hypot(dx, dy), ux = dx / len, uy = dy / len, px = -uy, py = ux, pts = [];
+ for (let i = 0; i <= n; i++) { const t = i / n, w = (w0 + (w1 - w0) * t) / 2, bulge = 1 + 0.12 * Math.sin(Math.PI * t); pts.push([a[0] + dx * t + px * w * bulge, a[1] + dy * t + py * w * bulge]); }
+ for (let i = 0; i <= 8; i++) { const th = -Math.PI / 2 + Math.PI * i / 8; pts.push([b[0] + (ux * Math.cos(th) - px * Math.sin(th)) * w1 / 2 * 0.9, b[1] + (uy * Math.cos(th) - py * Math.sin(th)) * w1 / 2 * 0.9]); }
+ for (let i = n; i >= 0; i--) { const t = i / n, w = (w0 + (w1 - w0) * t) / 2, bulge = 1 + 0.12 * Math.sin(Math.PI * t); pts.push([a[0] + dx * t - px * w * bulge, a[1] + dy * t - py * w * bulge]); }
+ for (let i = 0; i <= 8; i++) { const th = Math.PI / 2 + Math.PI * i / 8; pts.push([a[0] + (ux * Math.cos(th) - px * Math.sin(th)) * w0 / 2 * 0.9, a[1] + (uy * Math.cos(th) - py * Math.sin(th)) * w0 / 2 * 0.9]); }
+ return { ...ring(pts), a, b, ang: Math.atan2(dy, dx), len, w0, w1 };
+}
+const mid = (a, b, t = 0.5) => [a[0] + (b[0] - a[0]) * t, a[1] + (b[1] - a[1]) * t];
+
+// engrave a tube-like segment: outline, hatching along its axis in the shadow, rings across it in the deep dark
+function tube(ink, c, { w = 1.3, spacing = 3.2, dark = 0, seed = 1, hairs = 0, hairLen = 9, hairSide = 1, excl = null } = {}) {
+ const r = Math.max(c.w0, c.w1) / 2, cm = mid(c.a, c.b);
+ // cylinder shading along the segment, deepened at both joints (where the next segment's rim shadows it)
+ const joint = (x, y) => { const ux = Math.cos(c.ang), uy = Math.sin(c.ang), along = (x - c.a[0]) * ux + (y - c.a[1]) * uy, e = Math.min(along, c.len - along); return 0.38 * Math.exp(-((e / (r * 0.9)) ** 2)); };
+ const tone = addT(cylTone(cm[0], cm[1], r * 1.05, c.ang, { L }), dark, 0.12, joint);
+ ink.group('ol'); outline(ink, c.polys[0], { w, light: LV, vary: 0.9, seed, excl });
+ ink.group('h1'); hatch(ink, c.polys, { angle: c.ang, spacing: spacing * 0.8, tone, thr: 0.16, wMax: 1.3, wMin: 0.16, seed, taper: 5, excl });
+ ink.group('h2'); hatch(ink, c.polys, { angle: c.ang + Math.PI / 2 - 0.25, spacing: spacing * 1.05, tone, thr: 0.5, wMax: 1.0, wMin: 0.16, seed: seed + 3, taper: 3, excl });
+ if (hairs) {
+ ink.group('h3');
+ const R = RNG(seed + 40), ux = Math.cos(c.ang), uy = Math.sin(c.ang), px = -uy, py = ux;
+ for (let i = 0; i < hairs; i++) {
+ const t = 0.08 + 0.84 * R(), side = R() < 0.72 ? hairSide : -hairSide, ww = (c.w0 + (c.w1 - c.w0) * t) / 2;
+ const bx = c.a[0] + (c.b[0] - c.a[0]) * t + px * ww * side * 0.92, by = c.a[1] + (c.b[1] - c.a[1]) * t + py * ww * side * 0.92;
+ const ln = hairLen * (0.6 + R() * 0.7), lean = 0.55 + R() * 0.3;
+ if (excl && B.inAny(excl, bx, by)) continue;
+ stroke(ink, [[bx, by], [bx + (px * side * (1 - lean) + ux * lean) * ln * 0.5, by + (py * side * (1 - lean) + uy * lean) * ln * 0.5], [bx + (px * side * (1 - lean) * 0.8 + ux * lean) * ln, by + (py * side * (1 - lean) * 0.8 + uy * lean) * ln]], 0.75, { taper: 5 });
+ }
+ }
+ return c;
+}
+
+// ---- wing outlines and venation in wing-local units (x along the wing, −y = leading edge) ----
+// Apis forewing, after the classic honeybee venation diagrams (Snodgrass 1910/1925, public domain; reference only):
+// a long narrow marginal cell along the leading edge beyond the stigma, three submarginal cells beneath it
+// (the 2nd narrowest, the 3rd oblique), the long medial (basal) cell, two discoidal cells, and bare membrane
+// beyond about 85 % of the length — the veins never reach the tip.
+export const FORE = 'M0 -7 C70 -22 200 -31 288 -23 C327 -19 339 6 322 27 C296 51 218 64 150 58 C96 52 46 37 0 11 Z';
+// long veins as named curves; cross-veins are snapped onto them so every cell closes
+const FV = {
+ R: ['M3 -4 C40 -12 80 -17 104 -18 C124 -19 140 -20 150 -21', 2.3], // Sc + R, the heavy leading vein
+ C: ['M150 -23 C190 -26 250 -25 297 -13', 1.35], // marginal cell, costal side
+ Rs: ['M152 -18 C196 -13 250 -9 297 -13', 1.3], // marginal cell, lower side
+ S1: ['M104 -18 C122 -17.5 140 -17.5 152 -18', 1.15], // roof of the 1st submarginal cell
+ Ms: ['M4 5 C40 8 70 10 96 13', 1.7], // M + Cu stem
+ M: ['M96 13 C130 9 160 7 176 7 C200 7 230 9 262 11', 1.25], // floor of the submarginal cells
+ Cu: ['M96 13 C120 22 150 28 180 31 C206 33 228 32 244 29', 1.3], // floor of the discoidal cells
+ A: ['M8 13 C30 26 58 36 86 42', 1.15], // 1st anal vein
+ Sp: ['M244 29 C256 32 266 36 274 41', 0.7], // spectral vein, fading
+};
+const FX = [['R', 104, 'Ms', 96, 1.45], ['Rs', 172, 'M', 176, 1.05], ['Rs', 204, 'M', 214, 1.05], ['Rs', 248, 'M', 262, 1.0],
+ ['M', 150, 'Cu', 153, 1.05], ['M', 214, 'Cu', 217, 1.0], ['Ms', 60, 'A', 64, 0.95]];
+function yOn(d, x) { const P = B.parseD(d, 1)[0].pts; let best = P[0], bd = Infinity; for (const p of P) { const e = Math.abs(p[0] - x); if (e < bd) { bd = e; best = p; } } return best[1]; }
+export const FORE_VEINS = [...Object.values(FV), ['M138 -21 C146 -22 152 -21 156 -17', 2.6],
+ ...FX.map(([a, xa, b, xb, w]) => { const ya = yOn(FV[a][0], xa), yb = yOn(FV[b][0], xb); return [`M${xa} ${ya} C${xa + (xb - xa) * 0.33} ${ya + (yb - ya) * 0.33} ${xa + (xb - xa) * 0.66} ${ya + (yb - ya) * 0.66} ${xb} ${yb}`, w]; })];
+export const HIND = 'M0 -5 C60 -15 150 -19 208 -9 C236 -3 241 20 222 34 C190 52 120 50 70 36 C36 26 12 14 0 7 Z';
+export const HIND_VEINS = [
+ ['M4 -3 C40 -9 80 -12 118 -12', 1.6], // R
+ ['M6 5 C40 8 70 11 96 13', 1.4], // M + Cu
+ ['M96 13 C130 15 160 18 190 20', 0.95], // M
+ ['M96 13 C116 22 136 30 156 36', 0.95], // Cu
+ ['M112 -12 C109 -3 103 6 96 13', 1.0], // r-m cross-vein
+ ['M8 12 C28 20 48 27 70 31', 1.0], // anal
+];
+export const HAMULI_U = [118, 152]; // hooks along the hindwing leading edge (wing-local x)
+
+export function wing(ink, d, veins, f, seed, { hamuli = false, excl = null } = {}) {
+ const sh = shape(d, f, 1.5);
+ ink.group('ol'); outline(ink, sh.polys[0], { w: 1.15, light: LV, vary: 0.5, seed, excl });
+ for (const [vd, w] of veins) { const v = shape(vd, f, 1.5); for (const l of v.lines) stroke(ink, l, w * 0.85, { taper: 2.5, swell: false, w0: 1.15, w1: 0.8, excl }); }
+ // membrane: a very pale, open hatching near the root, fading to bare paper toward the tip (the wing is glass)
+ const [rx, ry] = f([0, 0]), [tx, ty] = f([300, 0]);
+ const tone = (x, y) => { const u = ((x - rx) * (tx - rx) + (y - ry) * (ty - ry)) / ((tx - rx) ** 2 + (ty - ry) ** 2); return clamp(0.5 - u * 0.55 + 0.12 * (noise2(x / 30, y / 30, seed) - 0.5)); };
+ ink.group('h1'); hatch(ink, sh.polys, { angle: Math.atan2(ty - ry, tx - rx) + 0.55, spacing: 4.4, tone, thr: 0.14, wMax: 0.75, wMin: 0.182, gamma: 0.9, seed, taper: 6, wobble: 0.25, excl });
+ ink.group('h3'); stipple(ink, sh.polys, { density: 0.006, tone: (x, y) => 0.25 + tone(x, y) * 0.6, r: 0.45, seed: seed + 5, thr: 0.1, excl });
+ if (hamuli) {
+ ink.group('h3');
+ for (let u = HAMULI_U[0]; u <= HAMULI_U[1]; u += 6) { const a = f([u, -13]), b = f([u + 1, -15.5]), c = f([u - 0.6, -16.4]); stroke(ink, [a, b, c], 0.45, { taper: 1.5 }); }
+ }
+ return sh;
+}
+
+export function buildBee({ x = 960, y = 560, s = 1, seed = 7 } = {}) {
+ const W = xf(x, y, s), P = p => W(p);
+ const ink = new B.Ink(), regions = {}, add = (name, sh) => { (regions[name] ||= []).push(sh); };
+ const S = v => v * s;
+ // the body shapes come first: they occlude wings and legs (the engraver simply stops the lines at them)
+ const ABD = null;
+ const TH = 'M0 -172 C50 -172 80 -140 80 -92 C80 -44 52 -8 0 -6 C-52 -8 -80 -44 -80 -92 C-80 -140 -50 -172 0 -172 Z';
+ const HD = 'M0 -242 C40 -242 70 -230 75 -202 C79 -174 56 -150 0 -148 C-56 -150 -79 -174 -75 -202 C-70 -230 -40 -242 0 -242 Z';
+ const CUTS = [32, 84, 134, 182, 224, 258];
+ const hwAbd = yy => { const t = clamp((yy - 6) / 284); let h = 93 * Math.pow(Math.sin(Math.PI * Math.pow(t, 0.72)), 0.72) * (1 - 0.06 * t);
+ if (t > 0.9) h *= 0.55 + 0.45 * Math.cos((t - 0.9) / 0.1 * Math.PI / 2) ** 0.6;
+ for (const c of CUTS) h *= 1 - 0.02 * Math.exp(-(((yy - c - 5) / 8) ** 2)) + 0.008 * Math.exp(-(((yy - c + 8) / 12) ** 2)); // each rim overhangs the next segment
+ return h; };
+ const abdPts = []; for (let yy = 6; yy <= 290; yy += 1.5) abdPts.push([hwAbd(yy), yy]); for (let yy = 290; yy >= 6; yy -= 1.5) abdPts.push([-hwAbd(yy), yy]);
+ const abd = ring(abdPts.map(W)), th = shape(TH, W, 1.2), hd = shape(HD, W, 1.2);
+ const eyes = [];
+ // kidney-shaped compound eyes lying along the sides of the head: their outer edge IS the head's silhouette
+ for (const sg of [1, -1]) eyes.push(shape(`M${40 * sg} -238 C${58 * sg} -236 ${73 * sg} -224 ${76 * sg} -202 C${79 * sg} -178 ${66 * sg} -158 ${50 * sg} -151 C${44 * sg} -160 ${47 * sg} -172 ${49 * sg} -186 C${51 * sg} -200 ${47 * sg} -214 ${44 * sg} -224 C${42 * sg} -230 ${40 * sg} -234 ${40 * sg} -238 Z`, W, 1));
+ const eyePolys = eyes.flatMap(e => e.polys);
+ const pet = B.ellipse(P([0, 2])[0], P([0, 2])[1], S(14), S(8));
+ const headX = [...hd.polys, ...eyePolys], bodyX = [...abd.polys, ...th.polys, ...headX, ...pet.polys];
+ // ================= wings (drawn first so body and legs sit over their roots) =================
+ const wingsSh = [];
+ for (const sg of [1, -1]) {
+ const mir = p => [p[0] * sg, p[1]];
+ const fh0 = xf(54, -76, 1, 0.06), ff0 = xf(58, -118, 1, -0.43);
+ const fh = p => W(mir(fh0(p))), ff = p => W(mir(ff0(p))); fh.scale = ff.scale = s;
+ wingsSh.push(wing(ink, HIND, HIND_VEINS, fh, seed + 20 + sg, { hamuli: true, excl: bodyX }));
+ wingsSh.push(wing(ink, FORE, FORE_VEINS, ff, seed + 30 + sg, { excl: bodyX }));
+ if (sg > 0) { regions._hamuliF = fh; }
+ }
+ for (const w of wingsSh) add('wings', w);
+
+ // ================= legs =================
+ const legSeg = [];
+ const LEGS = [ // right side; mirrored for the left. [points…], widths
+ { pts: [[44, -146], [98, -166], [122, -212], [130, -236], [134, -247], [137, -256], [139, -264], [141, -272]], w: [15, 13, 10, 9, 7, 6, 5.5, 5, 4.5], hair: 1 },
+ { pts: [[54, -58], [112, -34], [146, 22], [154, 52], [158, 64], [161, 74], [163, 83], [165, 92]], w: [16, 14, 11, 10, 7, 6, 5.5, 5, 4.5], hair: 1 },
+ { pts: [[44, 8], [106, 62], [144, 168], [154, 214], [157, 227], [159, 238], [161, 248], [163, 258]], w: [17, 16, 12, 30, 22, 6.5, 6, 5.5, 5], hind: true, hair: 1 },
+ ];
+ const legsSh = [], pollenSh = [];
+ let corb = null;
+ for (const sg of [1, -1]) for (const [li, lg] of LEGS.entries()) {
+ const Q = lg.pts.map(([px, py]) => P([px * sg, py]));
+ for (let k = 0; k < Q.length - 1; k++) {
+ let w0 = S(lg.w[k] * (k === 0 ? 1 : 0.95)), w1 = S(lg.w[k + 1]);
+ if (lg.hind && k === 1) { w0 = S(13); w1 = S(34); } // the broad, flattened hind tibia
+ if (lg.hind && k === 2) { w0 = S(24); w1 = S(19); } // the broad basitarsus
+ const c = capsule(Q[k], Q[k + 1], w0, w1);
+ const segX = k > 0 ? [...bodyX, legsSh[legsSh.length - 1].polys[0]] : bodyX;
+ tube(ink, c, { seed: seed + li * 10 + k + (sg > 0 ? 0 : 100), dark: k === 0 ? 0.08 : 0, hairs: k < 3 ? Math.round(c.len / (lg.hind && k === 1 ? 1.6 : 3.2)) : 0, hairLen: lg.hind && k === 1 ? 19 : 11, hairSide: sg * (li === 2 ? 1 : -1), w: k >= 3 ? 1 : 1.35, spacing: k >= 3 ? 2.6 : 3.2, excl: segX });
+ legsSh.push(c);
+ if (lg.hind && k === 1) {
+ // the pollen load packed into the corbicula: a lumpy ball on the outer face of the tibia
+ const cm = mid(Q[1], Q[2], 0.56), ang = c.ang, rx = S(31), ry = S(23), R = RNG(seed + (sg > 0 ? 3 : 4)), pts = [];
+ for (let i = 0; i < 40; i++) { const th = i / 40 * Math.PI * 2, k2 = 1 + 0.08 * Math.sin(th * 5 + R() * 6) + 0.05 * (R() - 0.5); const lx = Math.cos(th) * rx * k2, ly = Math.sin(th) * ry * k2; pts.push([cm[0] + lx * Math.cos(ang) - ly * Math.sin(ang) + Math.cos(ang + Math.PI / 2) * S(3) * sg, cm[1] + lx * Math.sin(ang) + ly * Math.cos(ang) + Math.sin(ang + Math.PI / 2) * S(3) * sg]); }
+ const pl = ring(pts); pollenSh.push(pl);
+ ink.group('ol'); outline(ink, pl.polys[0], { w: 1.2, light: LV, vary: 0.9, seed: seed + 60 });
+ ink.group('h3'); stipple(ink, pl.polys, { density: 0.09, tone: addT(sphereTone(cm[0], cm[1], rx, ry, { L, rot: ang }), 0.1), r: 0.62, seed: seed + 61, thr: 0.05 });
+ if (sg > 0) corb = { x: cm[0], y: cm[1], ang };
+ }
+ }
+ legSeg.push(Q);
+ }
+ for (const l of legsSh) add('legs', l);
+ for (const p of pollenSh) add('pollen', p);
+
+ // ================= abdomen: six tergites, each with a pale felt band in front and a dark shining rim behind =================
+ add('abdomen', abd);
+ const abdTone = sphereTone(P([0, 140])[0], P([0, 140])[1], S(96), S(165), { L, base: 0.0 });
+ const cuts = CUTS, bowOf = i => 12 + i * 3.2;
+ ink.group('ol0'); outline(ink, abd.polys[0], { w: 2.3, light: LV, vary: 0.9, seed: seed + 1, run: 170 }); // the first line the burin cuts
+ const inAbd = (xx, yy) => inPoly(abd.polys, xx, yy);
+ for (let i = 0; i < cuts.length + 1; i++) {
+ const y0 = i ? cuts[i - 1] : -14, y1 = i < cuts.length ? cuts[i] : 300, b0 = i ? bowOf(i - 1) : 10, b1 = i < cuts.length ? bowOf(i) : 10;
+ const edge = (yy, bw) => { const E = []; for (let k = 0; k <= 30; k++) { const xx = -100 + 200 * k / 30, q = 1 - (xx / 100) ** 2; E.push(P([xx, yy + bw * q])); } return E; };
+ const band = ring([...edge(y0, b0), ...edge(y1, b1).reverse()]);
+ // within one tergite: dark shadow under the rim of the one in front, a pale felt band, then the bare shining plate, lighter again at its own rim
+ const segT = (xx, yy) => {
+ if (!inAbd(xx, yy)) return 0;
+ const lx = (xx - x) / s, ly = (yy - y) / s, q = 1 - (lx / 100) ** 2, top = y0 + b0 * q, bot = y1 + b1 * q, v = clamp((ly - top) / (bot - top));
+ let t = abdTone(xx, yy) * 0.85 + 0.08;
+ if (i > 0) t += 0.5 * (1 - B.sstep(0.0, 0.16, v)); // cast shadow under the overlapping rim
+ if (i > 0 && i < 5) t -= 0.32 * B.sstep(0.1, 0.18, v) * (1 - B.sstep(0.38, 0.5, v)); // felt band
+ t += 0.22 * B.sstep(0.5, 0.85, v) - 0.18 * B.sstep(0.88, 1, v); // bare plate, then the lit rim
+ return clamp(t);
+ };
+ const inter = clipPolys(band, abd);
+ ink.group('h1'); hatch(ink, inter, { angle: 0, bend: -((b0 + b1) / 2) / (100 * 100 * s), a0: 0, origin: P([0, (y0 + y1) / 2]), spacing: 3.1, tone: segT, thr: 0.14, wMax: 1.9, seed: seed + 70 + i, taper: 8 });
+ ink.group('h2'); hatch(ink, inter, { angle: 0.9, spacing: 3.6, tone: segT, thr: 0.48, wMax: 1.4, seed: seed + 80 + i, taper: 5 });
+ ink.group('h3'); hatch(ink, inter, { angle: -0.9, spacing: 4.2, tone: segT, thr: 0.74, wMax: 1.05, seed: seed + 90 + i, taper: 4 });
+ // the rim of this tergite, cut as one swelling stroke lying over the next
+ if (i < cuts.length) { ink.group('ol'); const rim = edge(y1, b1).filter(p => inAbd(p[0], p[1])); stroke(ink, rim, 2.2, { taper: 30 }); }
+ // the felt band: short hairs combed back
+ if (i > 0 && i < 5) {
+ ink.group('h3');
+ const felt = clipPolys(ring([...edge(y0 + (y1 - y0) * 0.1, b0), ...edge(y0 + (y1 - y0) * 0.45, (b0 + b1) / 2).reverse()]), abd);
+ fur(ink, felt, { density: 0.07, len: 6.5, w: 0.75, seed: seed + 100 + i, dir: (xx, yy) => { const lx = (xx - x) / s; return norm([lx * 0.005, 1]); }, tone: () => 0.45, curl: 0.35 });
+ }
+ }
+ // fringe of hairs along the flanks
+ { const R = RNG(seed + 44); ink.group('h3'); for (const [px, py] of B.resample(abd.polys[0], 3.5)) { const ly = (py - y) / s; if (ly < 20 || ly > 250 || R() < 0.4) continue; const d = norm([px - x, (py - (y + 140 * s)) * 0.3]); const ln = (4 + R() * 5) * s; stroke(ink, [[px - d[0] * 2, py - d[1] * 2], [px + d[0] * ln, py + d[1] * ln + ln * 0.4]], 0.6, { taper: 3 }); } }
+
+ // ================= thorax: a hairy dome =================
+ add('thorax', th);
+ const thC = P([0, -92]), thTone = sphereTone(thC[0], thC[1], S(82), S(86), { L, base: 0.08 });
+ ink.group('ol'); outline(ink, th.polys[0], { w: 2.0, light: LV, vary: 0.9, seed: seed + 2, excl: headX });
+ ink.group('h1'); hatch(ink, th.polys, { angle: -0.5, bend: 0.0042 / s, spacing: 3.3, tone: thTone, thr: 0.14, wMax: 2.0, wMin: 0.18, seed: seed + 3, excl: headX });
+ ink.group('h2'); hatch(ink, th.polys, { angle: 0.6, bend: -0.003 / s, spacing: 3.7, tone: thTone, thr: 0.46, wMax: 1.55, wMin: 0.18, seed: seed + 4, excl: headX });
+ ink.group('h3'); hatch(ink, th.polys, { angle: 1.4, spacing: 4.4, tone: thTone, thr: 0.74, wMax: 0.9, wMin: 0.18, seed: seed + 5, excl: headX });
+ // scutellum: a lip at the back of the thorax, with the suture line in front of it
+ const sc = shape('M-44 -30 C-30 -14 30 -14 44 -30 C40 -8 22 2 0 2 C-22 2 -40 -8 -44 -30 Z', W, 1.2);
+ ink.group('ol'); stroke(ink, sc.polys[0].slice(0, Math.floor(sc.polys[0].length * 0.45)), 1.6, { taper: 12 });
+ // the pile: dense hairs combed out from the centre, longest at the rim, some standing out past the outline
+ ink.group('h3');
+ fur(ink, th.polys, { density: 0.045, len: 11 * s, w: 0.85, seed: seed + 6, dir: (xx, yy) => norm([xx - thC[0], yy - thC[1] + 10 * s]), tone: thTone, curl: 0.5, excl: headX });
+ { const rimR = RNG(seed + 7), P0 = B.resample(th.polys[0], 2.4 * s);
+ for (const [px, py] of P0) { if (rimR() < 0.35) continue; const d = norm([px - thC[0], py - thC[1]]), ln = (7 + rimR() * 9) * s, c = (rimR() - 0.5) * 0.6; if (B.inAny(headX, px + d[0] * ln, py + d[1] * ln) || B.inAny(headX, px, py)) continue; stroke(ink, [[px - d[0] * 4 * s, py - d[1] * 4 * s], [px + d[0] * ln * 0.5 + d[1] * c * ln * 0.3, py + d[1] * ln * 0.5 - d[0] * c * ln * 0.3], [px + d[0] * ln + d[1] * c * ln, py + d[1] * ln - d[0] * c * ln]], 0.7, { taper: 4 }); } }
+ // petiole (the waist) — a small dark knot between thorax and abdomen
+ ink.group('ol'); outline(ink, pet.polys[0], { w: 1.4, light: LV });
+ ink.group('h2'); hatch(ink, pet.polys, { angle: 0, spacing: 2.2, tone: () => 0.8, wMax: 1.1, seed: 5, taper: 2 });
+
+ // ================= head, eyes, ocelli, antennae =================
+ add('head', hd);
+ const hC = P([0, -194]), hTone = sphereTone(hC[0], hC[1], S(70), S(48), { L, base: 0.1 });
+ ink.group('ol'); outline(ink, hd.polys[0], { w: 1.9, light: LV, vary: 0.9, seed: seed + 8, excl: eyePolys });
+ ink.group('h1'); hatch(ink, hd.polys, { angle: -0.35, bend: 0.005 / s, spacing: 3.1, tone: hTone, thr: 0.14, wMax: 1.8, wMin: 0.18, seed: seed + 9, excl: eyePolys });
+ ink.group('h2'); hatch(ink, hd.polys, { angle: 0.75, spacing: 3.6, tone: hTone, thr: 0.5, wMax: 1.4, wMin: 0.18, seed: seed + 10, excl: eyePolys });
+ ink.group('h3'); fur(ink, hd.polys, { density: 0.03, len: 7 * s, w: 0.75, seed: seed + 11, dir: (xx, yy) => norm([(xx - hC[0]) * 0.6, -1]), tone: hTone, curl: 0.4 });
+ for (const [k, e] of eyes.entries()) {
+ add('eyes', e);
+ const ec = [(e.bbox[0] + e.bbox[2]) / 2, (e.bbox[1] + e.bbox[3]) / 2], et = sphereTone(ec[0], ec[1], (e.bbox[2] - e.bbox[0]) / 2, (e.bbox[3] - e.bbox[1]) / 2, { L, base: 0.28 });
+ ink.group('ol'); outline(ink, e.polys[0], { w: 1.6, light: LV, vary: 0.8, seed: seed + 12 + k });
+ // the faceted surface: tone hatching, then a lattice of tiny hexagonal facets wrapped onto the eye's curve
+ const hl = B.ellipse(ec[0] - S(6), ec[1] - S(16), S(7), S(10), -0.4).polys;
+ ink.group('h1'); hatch(ink, e.polys, { angle: 0.5, spacing: 2.6, tone: et, thr: 0.3, wMax: 0.95, wMin: 0.18, seed: seed + 13 + k, excl: hl, taper: 3 });
+ ink.group('h3'); hatch(ink, e.polys, { angle: -0.55, spacing: 2.8, tone: et, thr: 0.62, wMax: 0.8, wMin: 0.18, seed: seed + 15 + k, excl: hl, taper: 3 });
+ { const erx = (e.bbox[2] - e.bbox[0]) / 2, ery = (e.bbox[3] - e.bbox[1]) / 2, a = 0.075, TH = Math.PI / 2 * 0.9;
+ const toS = (qx, qy) => { const r = Math.hypot(qx, qy); if (r < 1e-9) return [ec[0], ec[1]]; const kk = Math.sin(r * TH) / r; return [ec[0] + qx * kk * erx, ec[1] + qy * kk * ery]; };
+ ink.group('h2');
+ for (let j = -16; j <= 16; j++) for (let i = -16; i <= 16; i++) {
+ const qx = (i + (j & 1) * 0.5) * a * Math.sqrt(3) * (ery / erx), qy = j * a * 1.5; if (Math.hypot(qx, qy) > 1) continue;
+ const pts = []; let ok = true;
+ for (let m = 0; m <= 6; m++) { const an = Math.PI / 6 + m * Math.PI / 3, p = toS(qx + Math.cos(an) * a * (ery / erx), qy + Math.sin(an) * a); if (!inPoly(e.polys, p[0], p[1])) { ok = false; break; } pts.push(p); }
+ if (!ok) continue;
+ const c = toS(qx, qy), tv = et(c[0], c[1]);
+ ink.add(pts, 0.28 + 0.3 * tv);
+ } }
+ }
+ // ocelli: three simple eyes on the crown
+ ink.group('ol');
+ for (const [ox, oy, r] of [[0, -224, 4.6], [-12, -214, 4.2], [12, -214, 4.2]]) { const c = P([ox, oy]); const e = B.ellipse(c[0], c[1], S(r), S(r)); outline(ink, e.polys[0], { w: 1.1, light: LV, vary: 1 }); ink.group('h2'); hatch(ink, e.polys, { angle: 0.7, spacing: 1.6, tone: sphereTone(c[0], c[1], S(r), S(r), { L, base: 0.2 }), thr: 0.4, wMax: 0.8, taper: 1 }); ink.group('ol'); }
+ // antennae: elbowed — a long scape, then the flagellum in short beads
+ const antSh = [];
+ for (const sg of [1, -1]) {
+ const pts = [[14, -234], [30, -284], [44, -296], [55, -304], [65, -312], [74, -319], [82, -327], [89, -335], [95, -344], [100, -353], [104, -362], [107, -371]].map(([px, py]) => P([px * sg, py]));
+ const ws = [7, 6.5, 6, 6, 5.8, 5.8, 5.6, 5.5, 5.4, 5.3, 5.2, 5];
+ for (let k = 0; k < pts.length - 1; k++) { const c = capsule(pts[k], pts[k + 1], S(ws[k]), S(ws[k + 1]) * (k ? 0.92 : 1), 6); tube(ink, c, { seed: seed + 200 + k, w: 1.05, spacing: 2.2, hairs: k === 0 ? 5 : 0, hairLen: 5, excl: headX }); antSh.push(c); }
+ }
+ for (const a of antSh) add('legs', a);
+
+ // ---------- regions → one Path2D each, for the colourist ----------
+ const reg = {};
+ for (const [k, list] of Object.entries(regions)) { if (k.startsWith('_')) continue; const p = new Path2D(); for (const sh of list) p.addPath(sh.path); reg[k] = { path: p, polys: list.flatMap(sh => sh.polys), bbox: B.bboxOf(list.flatMap(sh => sh.polys)) }; }
+ // focus points for the magnified details
+ const fh = regions._hamuliF;
+ const focus = {
+ eye: { x: P([-62, -194])[0], y: P([-62, -194])[1], r: S(34) },
+ hamuli: { x: fh([123, -14])[0], y: fh([123, -14])[1], r: S(36) },
+ corbicula: { x: corb.x, y: corb.y, r: S(38) },
+ };
+ return { ink, regions: reg, focus, center: [x, y], s };
+}
+
+// ---------- small helpers ----------
+function compose2(outer, inner) { const f = p => outer(inner(p)); f.scale = (outer.scale || 1) * (inner.scale || 1); return f; }
+function norm([a, b]) { const l = Math.hypot(a, b) || 1; return [a / l, b / l]; }
+// intersection of a band ring with a shape: hatch() clips even-odd, so we return the band only and let tone() mask
+// outside points to 0 — here we simply sample the band ring and pull points outside the shape onto its boundary.
+function clipPolys(band, sh) {
+ const out = band.polys[0].map(p => inPoly(sh.polys, p[0], p[1]) ? p : nearestOn(sh.polys[0], p));
+ return [out];
+}
+function nearestOn(P, [x, y]) {
+ let best = null, bd = Infinity;
+ for (let i = 0; i < P.length; i++) { const a = P[i], b = P[(i + 1) % P.length], dx = b[0] - a[0], dy = b[1] - a[1], t = clamp(((x - a[0]) * dx + (y - a[1]) * dy) / (dx * dx + dy * dy || 1)), px = a[0] + dx * t, py = a[1] + dy * t, d = (px - x) ** 2 + (py - y) ** 2; if (d < bd) { bd = d; best = [px, py]; } }
+ return best;
+}
diff --git a/styles/engraving/demo/subjects/details.js b/styles/engraving/demo/subjects/details.js
new file mode 100644
index 0000000..64f6404
--- /dev/null
+++ b/styles/engraving/demo/subjects/details.js
@@ -0,0 +1,172 @@
+// Magnified details of the honeybee, each drawn for a roundel of radius 500 local units (centre 0,0).
+// buildDetail(name) → { ink, regions: { name: {path, polys} }, specimen: polys (for the ruled ground to avoid) }
+// ink groups: 'ol' outlines, 'h1', 'h2', 'h3' as on the main figure, plus 'rule' (the ruled ground of the roundel).
+import * as B from '../engine/burin.js';
+const { ring, shape, clamp, hatch, outline, stroke, stipple, RNG, noise2, sphereTone, inPoly, ellipsePts } = B;
+const L = { x: -0.55, y: -0.62, z: 0.56 }, LV = [L.x, L.y];
+
+export const DETAILS = { eye: buildEye, hamuli: buildHamuli, corbicula: buildCorbicula };
+export function buildDetail(name, o = {}) { return (DETAILS[name] || buildEye)(o); }
+
+// the ruled ground: fine horizontal lines laid by a ruling machine, stopped at the specimen
+function ruled(ink, excl, { spacing = 11, w = 1.5 } = {}) {
+ ink.group('rule');
+ const circ = ring(ellipsePts(0, 0, 486, 486, 0, 96));
+ hatch(ink, circ.polys, { angle: 0, spacing, tone: () => 0.6, thr: 0, wMin: w, wMax: w, jitter: 0, wobble: 0.08, taper: 3, excl });
+}
+
+// ---------------- Fig. 1 · the compound eye: a lattice of hexagonal facets on a curved surface ----------------
+function buildEye({ seed = 3 } = {}) {
+ const ink = new B.Ink(), cx = -70, cy = 10, rx = 360, ry = 430, rot = -0.12;
+ const eyeRing = ring(ellipsePts(cx, cy, rx, ry, rot, 120));
+ // the head capsule on the right: a band of hairy cuticle curving round the eye
+ const head = ring(ellipsePts(0, 0, 492, 492, 0, 120));
+ const hTone = (x, y) => clamp(0.25 + 0.4 * clamp((x - 200) / 300) + 0.15 * noise2(x / 60, y / 60, 4));
+ ink.group('h1'); hatch(ink, head.polys, { angle: 1.1, spacing: 10, tone: hTone, thr: 0.2, wMax: 3.4, wMin: 0.8, excl: eyeRing.polys, seed, step: 3, taper: 14 });
+ ink.group('h2'); hatch(ink, head.polys, { angle: -0.4, spacing: 12, tone: hTone, thr: 0.5, wMax: 2.6, wMin: 0.8, excl: eyeRing.polys, seed: seed + 1, step: 3, taper: 10 });
+ ink.group('h3'); B.fur(ink, head.polys, { density: 0.0014, len: 70, w: 2.4, seed: seed + 2, dir: (x, y) => { const d = Math.hypot(x - cx, y - cy) || 1; return [(x - cx) / d, (y - cy) / d - 0.3]; }, tone: () => 0.6, curl: 0.5, excl: eyeRing.polys });
+ // the eye's rim
+ ink.group('ol'); outline(ink, eyeRing.polys[0], { w: 4.2, light: LV, vary: 0.9 });
+ // facets: a flat hex lattice wrapped onto a sphere (orthographic), so facets foreshorten toward the rim
+ const a = 0.105, TH = Math.PI / 2 * 0.93, c = Math.cos(rot), s = Math.sin(rot);
+ const toScreen = (qx, qy) => { const r = Math.hypot(qx, qy); if (r < 1e-9) return [cx, cy, 1, 0, 0]; const th = r * TH, k = Math.sin(th) / r; const X = qx * k, Y = qy * k, nz = Math.cos(th); return [cx + (X * rx) * c - (Y * ry) * s, cy + (X * rx) * s + (Y * ry) * c, nz, X, Y]; };
+ const facets = [];
+ for (let j = -14; j <= 14; j++) for (let i = -14; i <= 14; i++) {
+ const qx = (i + (j & 1) * 0.5) * a * Math.sqrt(3), qy = j * a * 1.5;
+ if (Math.hypot(qx, qy) > 0.98) continue;
+ const pts = []; let ok = true;
+ for (let k = 0; k < 6; k++) { const an = Math.PI / 6 + k * Math.PI / 3, vx = qx + Math.cos(an) * a * 0.99, vy = qy + Math.sin(an) * a * 0.99; if (Math.hypot(vx, vy) > 1.0) { ok = false; break; } const p = toScreen(vx, vy); pts.push([p[0], p[1]]); }
+ if (!ok) continue;
+ const C = toScreen(qx, qy); facets.push({ pts, c: C });
+ }
+ facets.sort((p, q) => p.c[1] - q.c[1] || p.c[0] - q.c[0]);
+ const Ln = Math.hypot(L.x, L.y, L.z);
+ for (const [n, f] of facets.entries()) {
+ const nz = f.c[2], nx = f.c[3], ny = f.c[4], lam = clamp((nx * L.x + ny * L.y + nz * L.z) / Ln), tone = clamp(0.95 - lam * 1.05 + 0.08 * (noise2(f.c[0] / 90, f.c[1] / 90, 7) - 0.5));
+ const hx = ring(f.pts);
+ ink.group('ol'); outline(ink, f.pts, { w: 2.2 + 1.2 * (1 - nz), light: LV, vary: 0.9, seed: n, grain: 0.1 });
+ ink.group('h1'); hatch(ink, hx.polys, { angle: 0.75, spacing: 7.2, tone: () => tone, thr: 0.22, wMax: 2.6, wMin: 0.7, seed: n + 3, taper: 4, jitter: 0.05, wobble: 0.1, step: 2 });
+ ink.group('h2'); hatch(ink, hx.polys, { angle: -0.6, spacing: 7.8, tone: () => tone, thr: 0.58, wMax: 2.0, wMin: 0.7, seed: n + 5, taper: 3, jitter: 0.05, wobble: 0.1, step: 2 });
+ // a small curl of highlight, the lens catching the window
+ if (tone < 0.72) { ink.group('h3'); const r0 = Math.hypot(f.pts[0][0] - f.c[0], f.pts[0][1] - f.c[1]) * 0.45; stroke(ink, ellipsePts(f.c[0], f.c[1], r0, r0, 0, 8, Math.PI * 0.95, Math.PI * 1.55), 1.3, { taper: 4 }); }
+ }
+ // hairs standing between the facets (a honeybee's eyes are hairy)
+ ink.group('h3');
+ const R = RNG(seed + 9);
+ for (let k = 0; k < 34; k++) { const f = facets[Math.floor(R() * facets.length)], p = f.pts[Math.floor(R() * 6)], d = [p[0] - cx, p[1] - cy], dl = Math.hypot(...d) || 1, ln = 40 + R() * 60, bend = (R() - 0.5) * 0.8;
+ stroke(ink, [p, [p[0] + d[0] / dl * ln * 0.5 + d[1] / dl * bend * 12, p[1] + d[1] / dl * ln * 0.5 - d[0] / dl * bend * 12], [p[0] + d[0] / dl * ln + d[1] / dl * bend * 30, p[1] + d[1] / dl * ln - d[0] / dl * bend * 30]], 2.0, { taper: 10 }); }
+ const holed = B.toPath([{ pts: head.polys[0], closed: true }, { pts: eyeRing.polys[0].slice().reverse(), closed: true }]);
+ return { ink, regions: { eyes: { path: eyeRing.path, polys: eyeRing.polys }, head: { path: holed, polys: head.polys } }, specimen: head.polys, noRule: true };
+}
+
+// ---------------- Fig. 2 · the wing hooks: hamuli on the hindwing's leading edge, caught in the forewing's fold ----------------
+function buildHamuli({ seed = 5 } = {}) {
+ const ink = new B.Ink();
+ const yF = x => -95 + x * 0.1, yH = x => 62 + x * 0.1, FT = 62, VT = 46; // centre lines: forewing fold, hindwing costa
+ const xs = []; for (let x = -560; x <= 560; x += 8) xs.push(x);
+ const band = (f, a, b) => ring([...xs.map(x => [x, f(x) + a]), ...xs.slice().reverse().map(x => [x, f(x) + b])]);
+ const foreM = ring([...xs.map(x => [x, yF(x) - FT]), [560, -600], [-560, -600]]);
+ const fold = band(yF, -FT, FT), gap = band(x => 0, 0, 0);
+ const hindM = ring([...xs.map(x => [x, yH(x) + VT]), [560, 600], [-560, 600]]);
+ const vein = band(yH, -VT, VT), slit = ring([...xs.map(x => [x, yF(x) + FT]), ...xs.slice().reverse().map(x => [x, yH(x) - VT])]);
+ const memT = (x, y) => clamp(0.28 + 0.25 * noise2(x / 160, y / 160, seed));
+ for (const [m, ang] of [[foreM, 0.32], [hindM, -0.22]]) {
+ ink.group('h1'); hatch(ink, m.polys, { angle: ang, spacing: 12, tone: memT, thr: 0.15, wMax: 1.6, wMin: 0.8, seed: seed + 1, step: 3, taper: 20 });
+ ink.group('h3'); stipple(ink, m.polys, { density: 0.0011, tone: () => 0.6, r: 1.9, seed: seed + 2, thr: 0 });
+ }
+ // the dark slit between the two wings
+ ink.group('h2'); hatch(ink, slit.polys, { angle: 0.1, spacing: 5.5, tone: () => 0.85, thr: 0.1, wMax: 2.8, wMin: 0.8, seed: seed + 9, taper: 30, step: 3 });
+ // a cross-vein in each membrane
+ ink.group('ol');
+ stroke(ink, [[250, yF(250) - FT], [285, -330], [320, -600]], 5.5, { taper: 30 });
+ stroke(ink, [[-280, yH(-280) + VT], [-310, 330], [-345, 600]], 5.5, { taper: 30 });
+ // the forewing's rolled trailing edge: a tube, lit above, dark beneath
+ const foldT = (x, y) => { const v = clamp((y - (yF(x) - FT)) / (2 * FT)); return clamp(0.1 + 0.9 * v * v); };
+ ink.group('ol'); stroke(ink, xs.map(x => [x, yF(x) - FT]), 3.4, { taper: 40 }); stroke(ink, xs.map(x => [x, yF(x) + FT]), 5, { taper: 40 });
+ ink.group('h1'); hatch(ink, fold.polys, { angle: Math.atan(0.1), spacing: 6.5, tone: foldT, thr: 0.18, wMax: 3.2, wMin: 0.8, seed: seed + 3, taper: 20, step: 3 });
+ ink.group('h2'); hatch(ink, fold.polys, { angle: 1.35, spacing: 7.5, tone: foldT, thr: 0.55, wMax: 2.4, wMin: 0.8, seed: seed + 4, taper: 8, step: 3 });
+ // the hindwing's costal vein: a stout tube
+ const veinT = (x, y) => { const v = (y - yH(x)) / VT; return clamp(0.18 + 0.72 * (v * 0.5 + 0.5) ** 1.4); };
+ ink.group('ol'); stroke(ink, xs.map(x => [x, yH(x) - VT]), 3.6, { taper: 40 }); stroke(ink, xs.map(x => [x, yH(x) + VT]), 5, { taper: 40 });
+ ink.group('h1'); hatch(ink, vein.polys, { angle: Math.atan(0.1), spacing: 6, tone: veinT, thr: 0.22, wMax: 3, wMin: 0.8, seed: seed + 5, taper: 20, step: 3 });
+ ink.group('h2'); hatch(ink, vein.polys, { angle: 1.45, spacing: 8.5, tone: veinT, thr: 0.6, wMax: 2.2, wMin: 0.8, seed: seed + 6, taper: 6, step: 3 });
+ // the hooks: short stems rise from the vein, arch over the fold and hook down behind it
+ const hooks = [];
+ for (let k = 0; k < 10; k++) {
+ const x0 = -380 + k * 78, yb = yH(x0) - VT + 4, yt = yF(x0) - FT - 10;
+ const P = [], n = 30;
+ for (let i = 0; i <= n; i++) { const u = i / n; let x, y;
+ if (u < 0.55) { const v = u / 0.55; x = x0 + 6 * Math.sin(v * 1.6); y = yb + (yt + 14 - yb) * v; }
+ else { const v = (u - 0.55) / 0.45, an = Math.PI * (1.0 + v * 1.15), R0 = 30; x = x0 + 6 * Math.sin(1.6) + R0 + Math.cos(an) * R0; y = yt + 14 + Math.sin(an) * R0 * 1.25; }
+ P.push([x, y]); }
+ const N = B.normals(P, false), wd = i => (17 - 9 * (i / n)) / 2;
+ const poly = ring([...P.map((p, i) => [p[0] + N[i][0] * wd(i), p[1] + N[i][1] * wd(i)]), ...P.slice().reverse().map((p, j) => { const i = n - j; return [p[0] - N[i][0] * wd(i), p[1] - N[i][1] * wd(i)]; })]);
+ hooks.push(poly);
+ ink.group('ol'); outline(ink, poly.polys[0], { w: 2.5, light: LV, vary: 1, seed: k });
+ ink.group('h2'); hatch(ink, poly.polys, { angle: 0.1, spacing: 5, tone: (x) => clamp((x - x0) / 20 + 0.45), thr: 0.45, wMax: 2.2, wMin: 0.6, seed: k + 20, taper: 2, step: 1.5 });
+ }
+ const whole = ring(ellipsePts(0, 0, 490, 490, 0, 96));
+ const hp = new Path2D(); for (const h of hooks) hp.addPath(h.path);
+ return { ink, regions: { wings: { path: whole.path, polys: whole.polys }, hooks: { path: hp, polys: hooks.flatMap(h => h.polys) } }, specimen: whole.polys, noRule: true };
+}
+
+// ---------------- Fig. 3 · the pollen basket: outer face of the hind tibia, its fringe of long hairs, the packed load ----------------
+// Drawn the way the old plates show it: the leg upright and a little tilted, the broad tibia widening toward the foot,
+// its smooth hollow face walled in on both sides by long hairs that curve in over the load, the basitarsus below.
+function buildCorbicula({ seed = 11 } = {}) {
+ const ink = new B.Ink(), tilt = -0.32, ct = Math.cos(tilt), st = Math.sin(tilt);
+ const T = ([x, y]) => [x * ct - y * st + 10, x * st + y * ct + 10];
+ const inv = ([x, y]) => { const X = x - 10, Y = y - 10; return [X * ct + Y * st, -X * st + Y * ct]; };
+ const hw = y => 95 + (y + 560) / 760 * 105; // half width of the tibia, widening downward (y −560 … 200)
+ const side = sg => { const P = []; for (let y = -600; y <= 200; y += 10) P.push([sg * hw(y) * (1 + 0.03 * Math.sin(y / 60)), y]); return P; };
+ const bottom = []; for (let i = 1; i < 12; i++) { const x = hw(200) - 2 * hw(200) * i / 12; bottom.push([x, 200 + 18 * Math.sin(Math.PI * i / 12)]); }
+ const tibL = [...side(1), ...bottom, ...side(-1).reverse()];
+ const tib = ring(tibL.map(T));
+ const basL = [[-hw(200) * 0.86, 186], [hw(200) * 0.9, 190], [hw(200) * 0.82, 420], [hw(200) * 0.7, 560], [-hw(200) * 0.62, 560], [-hw(200) * 0.78, 420]]; const basS = B.parseD(`M${basL[0][0]} ${basL[0][1]} L${basL[1][0]} ${basL[1][1]} C${basL[1][0] + 10} 300 ${basL[2][0] + 6} 380 ${basL[2][0]} ${basL[2][1]} C${basL[2][0] - 4} 500 ${basL[3][0] + 10} 560 ${basL[3][0]} 560 L${basL[4][0]} 560 C${basL[4][0] - 12} 540 ${basL[5][0] - 6} 480 ${basL[5][0]} ${basL[5][1]} C${basL[5][0] - 6} 330 ${basL[0][0] - 8} 250 ${basL[0][0]} ${basL[0][1]} Z`, 3)[0].pts; basL.length = 0; basL.push(...basS);
+ const bas = ring(basL.map(T));
+ const fem = ring([[-80, -700], [80, -700], [70, -560], [-75, -560]].map(T));
+ const loadL = ellipsePts(-6, -170, 150, 235, 0.04, 90).map(([x, y], i) => { const k = 1 + 0.03 * Math.sin(i / 90 * Math.PI * 12 + 1) + 0.02 * Math.sin(i / 90 * Math.PI * 22); return [-6 + (x + 6) * k, -170 + (y + 170) * k]; });
+ const load = ring(loadL.map(T));
+ // tone of the tibia's face: concave — dark at both walls, bright down the middle, the load's shadow falling below-right of it
+ const tibT = (x, y) => { const [lx, ly] = inv([x, y]), w = lx / hw(ly); let t = 0.2 + 0.6 * Math.pow(Math.abs(w), 2.2) + 0.2 * (w > 0 ? w : 0);
+ const dx = (lx + 6 - 30) / 150, dy = (ly + 150 - 70) / 230; t += 0.4 * Math.max(0, 1 - Math.hypot(dx, dy)); return clamp(t); };
+ const femT = () => 0.55;
+ ink.group('ol'); outline(ink, fem.polys[0], { w: 4.4, light: LV, vary: 0.8, seed: seed + 20, excl: tib.polys });
+ ink.group('h1'); hatch(ink, fem.polys, { angle: tilt + Math.PI / 2, spacing: 8, tone: femT, thr: 0.2, wMax: 2.6, seed: seed + 21, excl: tib.polys, step: 3, taper: 16 });
+ ink.group('ol'); outline(ink, tib.polys[0], { w: 5.6, light: LV, vary: 0.9, seed });
+ for (const sg of [-1, 1]) { const P = []; for (let y = -560; y <= 190; y += 10) P.push(T([sg * (hw(y) - 26), y])); stroke(ink, P, 2.4, { taper: 80 }); }
+ // contour lines running down the face, following its hollow
+ ink.group('h1'); hatch(ink, tib.polys, { angle: tilt + Math.PI / 2, spacing: 8.5, tone: tibT, thr: 0.2, wMax: 3.4, seed: seed + 1, excl: load.polys, step: 3, taper: 24 });
+ ink.group('h2'); hatch(ink, tib.polys, { angle: tilt + Math.PI / 2 - 0.9, spacing: 10, tone: tibT, thr: 0.5, wMax: 2.6, seed: seed + 2, excl: load.polys, step: 3, taper: 14 });
+ // basitarsus with its rows of stiff comb bristles
+ const bT = (x, y) => { const [lx, ly] = inv([x, y]); return clamp(0.25 + 0.5 * B.sstep(-40, 150, lx) + 0.2 * B.sstep(420, 560, ly)); };
+ ink.group('ol'); outline(ink, bas.polys[0], { w: 4.8, light: LV, vary: 0.9, seed: seed + 3, excl: tib.polys });
+ ink.group('h1'); hatch(ink, bas.polys, { angle: tilt + Math.PI / 2, spacing: 8, tone: bT, thr: 0.2, wMax: 3, seed: seed + 4, step: 3, taper: 16, excl: tib.polys });
+ ink.group('h3');
+ for (let r = 0; r < 7; r++) for (let k = 0; k < 9; k++) { const lx = -110 + k * 26, ly = 270 + r * 36; const p0 = T([lx, ly]); if (!inPoly(bas.polys, ...p0) || inPoly(tib.polys, ...p0)) continue; stroke(ink, [p0, T([lx + 4, ly + 26])], 2.3, { taper: 8 }); }
+ // the pollen press at the joint: a small notch and its spur
+ ink.group('ol'); stroke(ink, [T([hw(200) - 20, 196]), T([hw(200) + 12, 222]), T([hw(200) - 8, 240])], 3.4, { taper: 10 });
+ // the load, modelled as a ball, granular, with the pale dust of the pollen on its lit side
+ const lc = T([-6, -170]), lT = sphereTone(lc[0], lc[1], 150, 235, { L, base: 0.02, rot: tilt });
+ ink.group('ol'); outline(ink, load.polys[0], { w: 5.2, light: LV, vary: 1, seed: seed + 5 });
+ ink.group('h1'); hatch(ink, load.polys, { angle: tilt + 0.25, bend: 0.0016, spacing: 8, tone: lT, thr: 0.25, wMax: 3, seed: seed + 6, step: 3, taper: 16 });
+ ink.group('h2'); hatch(ink, load.polys, { angle: tilt - 0.8, spacing: 9, tone: lT, thr: 0.58, wMax: 2.3, seed: seed + 16, step: 3, taper: 10 });
+ ink.group('h3'); stipple(ink, load.polys, { density: 0.004, tone: lT, r: 2.3, seed: seed + 7, thr: 0.08 });
+ { const R = RNG(seed + 8); for (let k = 0; k < 90; k++) { const p0 = T([-140 + R() * 270, -360 + R() * 420]); if (!inPoly(load.polys, ...p0) || lT(...p0) > 0.6) continue; const r = 4 + R() * 6; outline(ink, ellipsePts(p0[0], p0[1], r, r * 0.85, R() * 3, 12), { w: 1.5, light: LV, vary: 1, run: 0 }); } }
+ // the fringe: long hairs rooted along both edges, curving up and in over the rim of the load
+ ink.group('h3');
+ const R = RNG(seed + 9);
+ for (const sg of [-1, 1]) for (let y = -520; y <= 170; y += 20 + R() * 6) {
+ // rooted on the edge, the hair leans out, then its tip curls back in over the basket
+ const x0 = sg * hw(y) * 0.985, ln = 100 + R() * 50 + 50 * Math.sin(Math.PI * clamp((y + 545) / 725)), out = 0.35 + R() * 0.2;
+ const q1 = [x0 + sg * ln * 0.62, y - ln * 0.12], q2 = [x0 + sg * ln * (0.45 - 0.25 * out), y - ln * 0.72];
+ stroke(ink, B.parseD(`M${x0 - sg * 4} ${y + 3} Q${q1[0]} ${q1[1]} ${q2[0]} ${q2[1]}`, 4)[0].pts.map(T), 1.8 + R() * 0.5, { taper: 30 });
+ // every third hair bends the other way, in over the basket, holding the load
+ if (R() < 0.4) { const L2 = 70 + R() * 50; stroke(ink, B.parseD(`M${x0 - sg * 6} ${y} Q${x0 - sg * L2 * 0.5} ${y - L2 * 0.45} ${x0 - sg * L2 * 0.95} ${y - L2 * 0.5}`, 4)[0].pts.map(T), 1.5, { taper: 22 }); }
+ }
+ const spec = [...tib.polys, ...bas.polys, ...fem.polys];
+ const halo = ring([...side(1).map(([x, y]) => [x + 110 * Math.sign(x || 1), y]), ...side(-1).reverse().map(([x, y]) => [x - 110, y])].map(T));
+ ruled(ink, [...spec, ...halo.polys]);
+ const lp = new Path2D(); lp.addPath(tib.path); lp.addPath(bas.path); lp.addPath(fem.path);
+ return { ink, regions: { legs: { path: lp, polys: spec }, pollen: { path: load.path, polys: load.polys } }, specimen: spec };
+}
diff --git a/styles/engraving/demo/subjects/scallop.js b/styles/engraving/demo/subjects/scallop.js
new file mode 100644
index 0000000..ea8d3ba
--- /dev/null
+++ b/styles/engraving/demo/subjects/scallop.js
@@ -0,0 +1,55 @@
+// A second built-in specimen: the great scallop (Pecten maximus), left valve seen from above, as on a conchology plate.
+// Same contract as bee.js: buildScallop({ x, y, s }) → { ink, regions, focus }.
+// ink groups: 'ol0' (the shell's margin — the first line the burin cuts), 'ol', 'h1', 'h2', 'h3'.
+// regions: shell, bands, ears. focus: umbo, growth, ribs, ear (world points; no custom drawing → magnified views).
+import * as B from '../engine/burin.js';
+const { ring, clamp, hatch, outline, stroke, RNG, noise1, noise2, inPoly } = B;
+const L = { x: -0.55, y: -0.62, z: 0.56 }, LV = [L.x, L.y];
+
+export function buildScallop({ x = 960, y = 606, s = 1, seed = 12 } = {}) {
+ const ink = new B.Ink(), P = ([u, v]) => [x + u * s, y + v * s];
+ const H = [0, -250]; // the umbo (hinge point), ribs fan out from it
+ const NR = 17, A0 = Math.PI * 0.2, A1 = Math.PI * 0.8, R = th => 470 * (0.9 + 0.1 * Math.sin((th - A0) / (A1 - A0) * Math.PI));
+ // margin: scalloped by the ribs
+ const margin = [];
+ for (let i = 0; i <= NR * 12; i++) { const u = i / (NR * 12), th = A0 + (A1 - A0) * u, r = R(th) * (1 + 0.022 * Math.cos(u * NR * Math.PI * 2)); margin.push([H[0] + Math.cos(th) * r, H[1] + Math.sin(th) * r]); }
+ const earD = sg => `M${sg * 6} -252 C${sg * 60} -262 ${sg * 130} -266 ${sg * 156} -258 C${sg * 166} -236 ${sg * 160} -200 ${sg * 142} -176 C${sg * 110} -168 ${sg * 70} -180 ${sg * 30} -206 C${sg * 16} -220 ${sg * 8} -236 ${sg * 6} -252 Z`;
+ const shellPts = [...margin.reverse(), [0, -250]].map(P);
+ const shell = ring(shellPts);
+ const earSh = [-1, 1].map(sg => B.shape(earD(sg), B.xf(x, y, s), 1.5));
+ ink.group('ol0'); outline(ink, shell.polys[0], { w: 2.4, light: LV, vary: 0.9, seed, run: 170 });
+ ink.group('ol'); for (const e of earSh) outline(ink, e.polys[0], { w: 1.8, light: LV, seed: seed + 1 });
+ // ribs: rounded ridges; each gets its own crossing lines (lit on its upper-left flank), furrows between stay dark
+ const toneAt = (px, py) => {
+ const u = (px - x) / s - H[0], v = (py - y) / s - H[1], th = Math.atan2(v, u), r = Math.hypot(u, v), q = (th - A0) / (A1 - A0) * NR;
+ const f = q - Math.floor(q), rib = Math.cos((f - 0.5) * Math.PI * 2) * 0.5 + 0.5; // 1 on the rib crest, 0 in the furrow
+ const side = Math.sin((f - 0.5) * Math.PI * 2); // which flank faces the light
+ const bulk = clamp(0.1 + 0.35 * (r / 470) + 0.25 * ((th - A0) / (A1 - A0) - 0.3)); // the valve is domed toward the hinge
+ return clamp(bulk + 0.45 * (1 - rib) + 0.18 * side + 0.08 * (noise2(px / 40, py / 40, seed) - 0.5));
+ };
+ for (let k = 0; k < NR; k++) { // rib crest lines
+ const th = A0 + (A1 - A0) * (k + 0.5) / NR, pts = [];
+ for (let r = 60; r <= R(th) * 0.99; r += 6) pts.push(P([H[0] + Math.cos(th) * r, H[1] + Math.sin(th) * r]));
+ ink.group('ol'); stroke(ink, pts, 1.1, { taper: 60 });
+ const th2 = A0 + (A1 - A0) * k / NR, fp = []; for (let r = 40; r <= R(th2) * 0.97; r += 6) fp.push(P([H[0] + Math.cos(th2) * r, H[1] + Math.sin(th2) * r]));
+ if (k) { ink.group('h1'); stroke(ink, fp, 1.7, { taper: 80 }); }
+ }
+ // concentric growth lines: they ride up over each rib and dip into each furrow; every few a stronger check-line
+ ink.group('h1');
+ const Rg = RNG(seed + 3); let rr = 70;
+ for (let g = 0; rr < 460; g++) { rr += 8 + 14 * Math.pow(1 - rr / 470, 1.5) * (0.6 + Rg() * 0.8); const strong = Rg() < 0.18, pts = [];
+ for (let i = 0; i <= 240; i++) { const th = A0 + (A1 - A0) * i / 240, q = (th - A0) / (A1 - A0) * NR, wav = 4 * Math.cos((q - Math.floor(q) - 0.5) * Math.PI * 2); const r = Math.min(rr + wav, R(th) * 0.985); pts.push(P([H[0] + Math.cos(th) * r, H[1] + Math.sin(th) * r])); }
+ const ws = pts.map(([px, py]) => { const t = toneAt(px, py); return (strong ? 0.5 : 0.18) + (strong ? 1.1 : 0.55) * t; }); ink.add(pts, ws); }
+ // the ears carry their own fine ribbing
+ for (const [k, e] of earSh.entries()) { const sg = k ? 1 : -1; for (let j = 0; j < 9; j++) { const pts = []; for (let i = 0; i <= 30; i++) { const u = i / 30, px = sg * (14 + u * 140), py = -250 + 8 * j * (1 - u * 0.2) + 6 * Math.sin(u * 3); if (inPoly(e.polys, ...P([px, py]))) pts.push(P([px, py])); } if (pts.length > 2) stroke(ink, pts, 0.8, { taper: 12 }); } }
+ ink.group('h2'); hatch(ink, shell.polys, { angle: 0.35, spacing: 3.6, tone: toneAt, thr: 0.42, wMax: 1.5, seed: seed + 4, excl: earSh.flatMap(e => e.polys) });
+ ink.group('h3'); hatch(ink, shell.polys, { angle: -0.85, spacing: 4.2, tone: toneAt, thr: 0.7, wMax: 1.1, seed: seed + 5, excl: earSh.flatMap(e => e.polys) });
+ for (const [k, e] of earSh.entries()) { const et = (px, py) => clamp(0.3 + 0.3 * (k ? 1 : 0) + 0.2 * noise2(px / 30, py / 30, 3)); ink.group('h2'); hatch(ink, e.polys, { angle: k ? 0.2 : -0.2, spacing: 3.2, tone: et, thr: 0.2, wMax: 1.3, seed: seed + 8 + k }); }
+ // colour bands for the colourist: three concentric zones of rose-brown
+ const band = (r0, r1) => { const pts = []; for (let i = 0; i <= 80; i++) { const th = A0 + (A1 - A0) * i / 80; pts.push(P([H[0] + Math.cos(th) * Math.min(r0, R(th) * 0.99), H[1] + Math.sin(th) * Math.min(r0, R(th) * 0.99)])); } for (let i = 80; i >= 0; i--) { const th = A0 + (A1 - A0) * i / 80; pts.push(P([H[0] + Math.cos(th) * Math.min(r1, R(th) * 0.99), H[1] + Math.sin(th) * Math.min(r1, R(th) * 0.99)])); } return ring(pts); };
+ const bands = [band(150, 205), band(290, 330), band(400, 440)];
+ const mk = list => { const p = new Path2D(); for (const sh of list) p.addPath(sh.path); return { path: p, polys: list.flatMap(sh => sh.polys), bbox: B.bboxOf(list.flatMap(sh => sh.polys)) }; };
+ const regions = { shell: mk([shell]), bands: mk(bands), ears: mk(earSh) };
+ const focus = { umbo: { x: P([0, -212])[0], y: P([0, -212])[1], r: 40 * s }, growth: { x: P([150, 150])[0], y: P([150, 150])[1], r: 44 * s }, ribs: { x: P([-60, 60])[0], y: P([-60, 60])[1], r: 44 * s }, ear: { x: P([-120, -210])[0], y: P([-120, -210])[1], r: 40 * s } };
+ return { ink, regions, focus, center: [x, y], s };
+}
diff --git a/styles/engraving/demo/tools/build_alt.sh b/styles/engraving/demo/tools/build_alt.sh
new file mode 100644
index 0000000..2183d42
--- /dev/null
+++ b/styles/engraving/demo/tools/build_alt.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+# Full film from another content file, without touching the main film's files:
+# sh styles/engraving/demo/tools/build_alt.sh content_alt.json → demo/out/alt/engraving_alt.mp4
+set -e
+cd "$(dirname "$0")/../../../.."
+PY=.venv/bin/python; D=styles/engraving/demo; C=${1:-content_alt.json}; W=$D/out/alt; export ENG_WORK=$W
+mkdir -p $W
+$PY -c "import json; c=json.load(open('$D/$C')); v=c['voice']; json.dump([dict(id=l['id'],text=l['text'],voice=v['voice'],speed=v.get('speed',.92),lang='en-gb',**({'asr':l['asr']} if 'asr' in l else {})) for l in v['lines']], open('$W/lines.json','w'), indent=1)"
+$PY core/tts/tts.py $W/lines.json $W/voices
+$PY core/tts/asr_check.py $W/lines.json $W/voices
+node $D/tools/events.mjs $D "$C&voices=out/alt/voices/dur.json" $W
+$PY $D/music/score.py | tail -3
+$PY $D/mix.py
+$PY $D/tools/cuecheck.py
+$PY $D/tools/subs.py $C && $PY core/render/srt.py $W/subs.json $W/engraving_alt.srt
+G="" # 整机渲染限流已在 core/render/video.mjs 里
+$G node core/render/video.mjs $D --fps 24 --workers 2 --q "content=$C&voices=out/alt/voices/dur.json" --out $W/video.mp4
+sh core/render/mux.sh $W/video.mp4 $W/mix.wav $W/engraving_alt.mp4 24 4
diff --git a/styles/engraving/demo/tools/cuecheck.py b/styles/engraving/demo/tools/cuecheck.py
new file mode 100644
index 0000000..764c6f5
--- /dev/null
+++ b/styles/engraving/demo/tools/cuecheck.py
@@ -0,0 +1,29 @@
+# cue check: every scored accent (music/cues.json) against the picture event it is written for (events.json). Tolerance: 1 frame @24.
+import json, os
+D = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..')
+W = os.environ.get('ENG_WORK') or D
+E = json.load(open(os.path.join(W, 'events.json'))); ev = E['ev']; M = json.load(open(os.path.join(W, 'music', 'cues.json')))
+def f(typ, i=None, key='t'):
+ for e in ev:
+ if e['type'] == typ and (i is None or e.get('i') == i): return e[key]
+# pairs are built from the picture events, so the check works for any number of details
+pairs = [(f('peel'), 'peel', f('peel')), (f('title'), 'title engraved', f('title'))]
+for e in [x for x in ev if x['type'] == 'push']:
+ i, role = e['i'], e.get('role', 'A' if e['i'] == 0 else 'C')
+ pairs += [(e['t'], f'detail {i + 1} ({role}) starts', e['t']), (f('ring', i), f'ring {i + 1}', f('ring', i))]
+ if role in 'AB': pairs.append((f('travel', i), f'roundel {i + 1} lifts', f('travel', i)))
+ pairs.append((f('land', i), f'roundel {i + 1} lands', f('land', i)))
+pairs += [(f('natsize'), 'natural-size figure', f('natsize')), (f('silence'), 'silence begins', f('silence')),
+ (f('silence', key='until'), 'silence ends', f('silence', key='until')), (f('landing'), 'plate lands (cadence)', f('landing'))]
+# every picture beat must have a scored accent within one frame
+pairs = [(min(M, key=lambda c: abs(c['t'] - p))['t'] if not w.startswith('silence') else p, w, p) for m, w, p in pairs]
+mt = {round(c['t'], 4) for c in M}; bad = 0
+for m, what, p in pairs:
+ ok = abs(m - p) <= 1 / 24 + 1e-6 and (what.startswith('silence') or any(abs(m - x) < 1e-3 for x in mt)); bad += not ok
+ print(f"{'OK ' if ok else 'BAD'} {what:24s} music {m:7.3f} picture {p:7.3f} Δ {1000 * (p - m):+6.1f} ms")
+print('mismatches:', bad)
+# the silence must really be silent in the final mix
+import soundfile as sf, numpy as np
+y, sr = sf.read(os.path.join(W, 'mix.wav')); a, b = f('silence'), f('silence', key='until')
+seg = y[int((a + 0.05) * sr):int((b - 0.05) * sr)]
+print(f"silence {a:.2f}-{b:.2f}: peak {20 * np.log10(np.abs(seg).max() + 1e-12):.1f} dBFS")
diff --git a/styles/engraving/demo/tools/events.mjs b/styles/engraving/demo/tools/events.mjs
new file mode 100644
index 0000000..c184f6f
--- /dev/null
+++ b/styles/engraving/demo/tools/events.mjs
@@ -0,0 +1,10 @@
+// events.json with a content file: node styles/engraving/demo/tools/events.mjs styles/engraving/demo [content.json]
+// (core/render/events.mjs takes no query string; this is the same thing with ?content=)
+import fs from 'fs'; import path from 'path';
+import { openDemo, closeServer } from '../../../../core/render/page.mjs';
+const dir = process.argv[2], content = process.argv[3] || 'content.json', work = process.argv[4] || dir; // optional work folder
+const { browser, page } = await openDemo(dir, { q: 'content=' + content });
+const ev = await page.evaluate(() => ({ dur: window.DUR, ev: window.EV || [] }));
+fs.mkdirSync(work, { recursive: true }); fs.writeFileSync(path.join(work, 'events.json'), JSON.stringify(ev, null, 0));
+console.log('events', ev.ev.length, 'dur', ev.dur);
+await browser.close(); closeServer();
diff --git a/styles/engraving/demo/tools/readcheck/index.html b/styles/engraving/demo/tools/readcheck/index.html
new file mode 100644
index 0000000..947e63e
--- /dev/null
+++ b/styles/engraving/demo/tools/readcheck/index.html
@@ -0,0 +1,20 @@
+<!doctype html><html><head><meta charset="utf-8"><link rel="stylesheet" href="../../fonts/fonts.css"></head><body><canvas id="c" width="1920" height="1080"></canvas>
+<script type="module">
+// reading-time check: from the moment each text starts, how long does it stay fully inside the frame? need ≥ chars/12 + 1 s
+import { makeFilm } from '../../film.js';
+const q = new URLSearchParams(location.search), C = await (await fetch('../../' + (q.get('content') || 'content.json'))).json();
+let dur = {}; try { const r = await fetch('../../voices/dur.json'); if (r.ok) dur = await r.json(); } catch {}
+await document.fonts.load('400 40px "Pinyon Script"');
+const f = makeFilm(C, dur), W = 1920, H = 1080;
+const inView = (cam, x0, y0, x1, y1) => { const s = (x, y) => [(x - cam.cx) * cam.z + W / 2, (y - cam.cy) * cam.z + H / 2]; const a = s(x0, y0), b = s(x1, y1); return a[0] >= 0 && a[1] >= 0 && b[0] <= W && b[1] <= H; };
+const items = [];
+items.push({ what: 'title', t: f.T.title, n: C.title.length + 1, box: [700, 80, 1220, 140] }, { what: 'latin', t: f.T.title + 0.45, n: C.latin.length, box: [760, 148, 1160, 178] });
+for (const d of f.dets) { const lx = d.slot[0], ly = d.slot[1] + 120;
+ items.push({ what: 'fig ' + (d.i + 1) + ' name', t: d.a.name, n: d.lab.name.length, box: [lx - 180, ly + 18, lx + 180, ly + 42] });
+ items.push({ what: 'fig ' + (d.i + 1) + ' latin', t: d.a.latin, n: d.lab.latin.length, box: [lx - 120, ly + 46, lx + 120, ly + 70] });
+ items.push({ what: 'fig ' + (d.i + 1) + ' note', t: d.a.note, n: d.lab.note.length, box: [lx - 200, ly + 76, lx + 200, ly + 142] }); }
+items.push({ what: 'caption', t: f.T.landing[0] + 0.05, n: C.caption.length, box: [640, 966, 1280, 996] });
+const out = items.map(it => { let t = it.t; while (t < f.DUR && (t >= f.T.end[0] ? false : inView(f.cam(t), ...it.box))) t += 0.02; const need = it.n / 12 + 1, got = t - it.t; return `${got >= need ? 'OK ' : 'BAD'} ${it.what.padEnd(16)} ${it.n} chars need ${need.toFixed(2)} s got ${got.toFixed(2)} s`; });
+out.forEach(l => console.warn(l));
+window.render = () => {}; window.DUR = 1; window.READY = true;
+</script></body></html>
diff --git a/styles/engraving/demo/tools/subs.py b/styles/engraving/demo/tools/subs.py
new file mode 100644
index 0000000..616fc36
--- /dev/null
+++ b/styles/engraving/demo/tools/subs.py
@@ -0,0 +1,12 @@
+# subtitles from the film's voice events (same rule as film.js drawSubs): on 0.1 s before the line, off 0.6 s after it
+import json, os, sys
+D = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..')
+content = sys.argv[1] if len(sys.argv) > 1 else 'content.json'
+W = os.environ.get('ENG_WORK') or D
+E = json.load(open(os.path.join(W, 'events.json')))['ev']; C = json.load(open(os.path.join(D, content)))
+text = {l['id']: l['text'] for l in C['voice']['lines']}
+vo = [e for e in E if e['type'] == 'vo']
+cues = [dict(t0=round(v['t'] - 0.1, 3), t1=round(min(v['t'] + v['dur'] + 0.6, vo[i + 1]['t'] - 0.2 if i + 1 < len(vo) else 1e9), 3), text=text[v['id']]) for i, v in enumerate(vo)]
+os.makedirs(os.path.join(D, 'out'), exist_ok=True)
+json.dump(cues, open(os.path.join(W if W != D else os.path.join(D, 'out'), 'subs.json'), 'w'), indent=1)
+for c in cues: print(c)
diff --git a/styles/engraving/demo/voices/dur.json b/styles/engraving/demo/voices/dur.json
new file mode 100644
index 0000000..5786685
--- /dev/null
+++ b/styles/engraving/demo/voices/dur.json
@@ -0,0 +1,7 @@
+{
+ "title": 3.164,
+ "d1": 4.625,
+ "d2": 3.581,
+ "d3": 3.176,
+ "close": 3.779
+}
\ No newline at end of file
diff --git a/styles/engraving/demo/voices/words.json b/styles/engraving/demo/voices/words.json
new file mode 100644
index 0000000..350f55d
--- /dev/null
+++ b/styles/engraving/demo/voices/words.json
@@ -0,0 +1,317 @@
+{
+"title": [
+[
+"Plate",
+-0.6,
+0.14
+],
+[
+"seven,",
+0.14,
+0.56
+],
+[
+"the",
+0.86,
+0.9
+],
+[
+"honeybee,",
+0.9,
+1.32
+],
+[
+"a",
+1.64,
+1.66
+],
+[
+"piece",
+1.66,
+1.84
+],
+[
+"mellafura.",
+1.84,
+2.38
+]
+],
+"d1": [
+[
+"Each",
+-0.6,
+0.14
+],
+[
+"eye",
+0.14,
+0.36
+],
+[
+"is",
+0.36,
+0.56
+],
+[
+"built",
+0.56,
+0.78
+],
+[
+"from",
+0.78,
+1.02
+],
+[
+"some",
+1.02,
+1.24
+],
+[
+"6",
+1.24,
+1.58
+],
+[
+",000",
+1.58,
+2.0
+],
+[
+"facets",
+2.0,
+2.24
+],
+[
+"and",
+2.24,
+3.0
+],
+[
+"every",
+3.0,
+3.24
+],
+[
+"one",
+3.24,
+3.46
+],
+[
+"of",
+3.46,
+3.56
+],
+[
+"them",
+3.56,
+3.72
+],
+[
+"is",
+3.72,
+3.9
+],
+[
+"a",
+3.9,
+3.96
+],
+[
+"lens.",
+3.96,
+4.18
+]
+],
+"d2": [
+[
+"In",
+-0.6,
+0.1
+],
+[
+"flight,",
+0.1,
+0.4
+],
+[
+"a",
+0.76,
+0.8
+],
+[
+"row",
+0.8,
+1.0
+],
+[
+"of",
+1.0,
+1.14
+],
+[
+"tiny",
+1.14,
+1.42
+],
+[
+"hooks",
+1.42,
+1.76
+],
+[
+"locks",
+1.76,
+2.12
+],
+[
+"the",
+2.12,
+2.38
+],
+[
+"two",
+2.38,
+2.56
+],
+[
+"wings",
+2.56,
+2.8
+],
+[
+"into",
+2.8,
+3.08
+],
+[
+"one.",
+3.08,
+3.34
+]
+],
+"d3": [
+[
+"and",
+-0.6,
+0.08
+],
+[
+"on",
+0.08,
+0.18
+],
+[
+"the",
+0.18,
+0.28
+],
+[
+"hind",
+0.28,
+0.52
+],
+[
+"leg",
+0.52,
+0.84
+],
+[
+"a",
+0.84,
+1.08
+],
+[
+"basket",
+1.08,
+1.5
+],
+[
+"for",
+1.5,
+1.94
+],
+[
+"carrying",
+1.94,
+2.24
+],
+[
+"pollen",
+2.24,
+2.54
+],
+[
+"home.",
+2.54,
+2.86
+]
+],
+"close": [
+[
+"A",
+-0.6,
+0.06
+],
+[
+"lifetime",
+0.06,
+0.36
+],
+[
+"of",
+0.36,
+0.74
+],
+[
+"such",
+0.74,
+0.92
+],
+[
+"work",
+0.92,
+1.24
+],
+[
+"makes",
+1.24,
+1.54
+],
+[
+"a",
+1.54,
+1.72
+],
+[
+"twelfth",
+1.72,
+2.14
+],
+[
+"of",
+2.14,
+2.52
+],
+[
+"a",
+2.52,
+2.58
+],
+[
+"teaspoon",
+2.58,
+2.94
+],
+[
+"of",
+2.94,
+3.28
+],
+[
+"honey.",
+3.28,
+3.5
+]
+]
+}
\ No newline at end of file
diff --git a/styles/engraving/engraving.srt b/styles/engraving/engraving.srt
new file mode 100644
index 0000000..6954a8e
--- /dev/null
+++ b/styles/engraving/engraving.srt
@@ -0,0 +1,19 @@
+1
+00:00:06,300 --> 00:00:09,625
+Plate seven. The honeybee: Apis mellifera.
+
+2
+00:00:09,725 --> 00:00:15,050
+Each eye is built from some six thousand facets, and every one of them is a lens.
+
+3
+00:00:15,200 --> 00:00:19,475
+In flight, a row of tiny hooks locks the two wings into one.
+
+4
+00:00:19,575 --> 00:00:23,451
+And on the hind leg, a basket, for carrying pollen home.
+
+5
+00:00:26,650 --> 00:00:31,129
+A lifetime of such work makes a twelfth of a teaspoon of honey.
diff --git a/styles/engraving/poster.jpg b/styles/engraving/poster.jpg
new file mode 100644
index 0000000..157f797
Binary files /dev/null and b/styles/engraving/poster.jpg differ
diff --git a/styles/hologram-hud/STYLE.md b/styles/hologram-hud/STYLE.md
new file mode 100644
index 0000000..d9901e2
--- /dev/null
+++ b/styles/hologram-hud/STYLE.md
@@ -0,0 +1,230 @@
+# Sci-fi Hologram HUD — Style Prompt
+
+> A hardware product is scanned into a glowing wireframe. Target boxes lock onto parts one at a time; each part splits into a local exploded view, a leader line pulls out, and its number rolls from garbage glyphs into the real value. At the end, the wireframe lights up into a solid hologram and settles into a spec sheet you could use as a poster.
+> Demo: *Volt · Spec Scan* (39 s: a 34 s scene plus a 5 s end card) · `hologram-hud.mp4` · source in `demo/`. It is the spec walkthrough of a fictional city e-bike.
+> References (grammar only): the HUD and holo-table language of the *Iron Man* / *Avengers* films (Territory Studio, Perception): target boxes, leader-line callouts, rolling numbers, layered depth. The *Oblivion* interfaces: one restrained colour, hairlines, lots of empty space. Industrial CAD wireframes and exploded views. Never copy their layouts, icons, fonts, colours or props.
+
+You are directing a 30–40 second **scene film** in the **Sci-fi Hologram HUD** style. The user gives you a product, a device or any object with parts, plus the facts to show. You decide the model, the order, the timing, the sound and the look, and you deliver a finished film. Follow this guide.
+
+---
+
+## 1. What this style is
+
+The subject is always a **line wireframe made of light**, projected in perspective above a round projector pad on a near-black stage. It is never a rendered object. Everything reads as *scanned data*. A scan plane rises and the model grows under it. Parts can be pulled apart along their assembly axes. Numbers are *computed* on screen and roll into place.
+
+Three depth layers are always present: a **background dot grid** (slow parallax), the **subject** (with its perspective pad and floor), and the **foreground HUD** (corner brackets, rulers that parallax faster, status text).
+
+The palette is **one cold hue plus one warm accent**. The hue carries the lines, the HUD and the fills. The accent (amber in the demo) is spent on **locked values only**. A number turns amber at the frame it becomes true. Nothing else is amber.
+
+It is *not* a font-driven keynote (dark-keynote), a paper drafting sheet (blueprint) or a realistic product render (glass-product). Keep the subject a wireframe the whole time. Only at the high point does it gain translucent faces, and even then the lines stay on top.
+
+## 2. Use cases: what this style is for
+
+| Use case | Shot structure | Information layers (in order) | Hold per layer | Length |
+|---|---|---|---|---|
+| **Product spec walkthrough** (the demo: product page hero, spec section of a crowdfunding video) | Scan-in → title → N × (lock → camera move → local explode → leader → value) → regroup → solid-hologram turn → spec-sheet lockup → end card | Name + category + tagline → key spec per part (label + value + unit + one detail line) → weight / price → call to action | Title ≥ 5 s. Each part: value visible ≥ 2.5 s on the big card, then it **stays** as a chip in the left rail until the end (so every spec is on screen for 10–25 s). Lockup ≥ 3 s with everything present | 30–40 s, 2–5 parts |
+| **Trade-show loop screen** | The same engine with no VO. Callouts cycle, and the last frame matches the first scan frame so the film loops | Name → 3–5 specs → CTA | 3 s per spec, lockup 5 s | 20–30 s loop |
+| **"What's inside" teardown** (repair guide, component story) | One part per shot. Deeper explode (internals flagged `internal` so they appear only when opened). The loupe mode is used for small parts | Part name → what it does → one number | 4–6 s per part | 40–60 s |
+| **Before / after upgrade (v1 → v2)** | Two models in the same pad position. Scan v1, lock a part, scan-erase it top-down, scan-in the v2 part in the same place, then roll the old number to the new one | Part → old value (dim) → new value (amber) | 3 s per upgrade | 20–30 s |
+| **Assembly / unboxing order** | Parts start fully exploded and snap home one by one on the bar. The target box leads each one in | Step number → part name | 1 bar (2 s) per part | 20–40 s |
+
+The demo shows the first row. Every other row uses the same `Holo.draw` options (`scan`, `scanDown`, `explode`, `focus`, `solid`, `keep`) plus the HUD functions. Only the timeline in `film.js` changes.
+
+**How the native moves serve information (not story):**
+- **Scan growth = "this is real data."** The object is built in front of you, so it is believable before a word is said. It is also the hook: frame 1 already shows the plane at wheel height.
+- **Target box lock = "look here now."** One box at a time, landing on a bar downbeat. The eye is taken to exactly one place, and the box *is* the camera: the camera follows it from part to part (the whip transition).
+- **Local explode = "why the number is true."** Show the thing that makes the spec possible (the cells in the tube, the stator in the hub, the caliper halves) before the number rolls in.
+- **Rolling digits = the payoff beat.** Each value is a small reveal. It locks right-to-left and turns amber on a downbeat.
+- **Chip accumulation = reading time.** A spec never disappears. It docks into the left rail, name + value + detail, and stays there until the poster frame.
+- **Solid hologram + beam = "the whole is ready."** It happens once only, after a true silence.
+- **Controlled glitch = the power surge.** Three frames at ignition and never again.
+
+## 3. Visual language
+
+- **Stage**: background `hsl(hue+12, 70%, 2.4%)` with a radial lift `hsl(hue+6, 65%, 7%)` behind the subject. A 48 px dot grid fades with distance from the centre (parallax 0.2). Vignette 0.5.
+- **Projector pad** (on the floor, in true perspective): rings at r = 0.7 / 1.05 (bright) / 1.12 (dashed) / 1.45 / 2.1, 120 ticks (every 10th long), 24 faint radial rays. It rotates slowly (0.12 rad/s) and spins with the turntable.
+- **Wireframe**: additive (`lighter`) strokes, 1.3 px, in 7 alpha levels driven by **depth fog** (near = bright, far = 25 %). Two glow passes: ¼-res blur 3 px ×0.85 and ⅛-res blur 4 px ×0.7. Colour `hsla(hue, 100%, 50–80%, a)`.
+- **Hot edges** (near-white `hsla(hue, 70%, 92%)`): the 7 cm under the scan front, pieces flagged `hot` when opened (battery cells, motor cores), the travelling light wave, and a part at the moment its hotspot pings.
+- **Tubes are real CAD wireframes**: rings every few cm plus 3–6 longitudinal lines, never a single line. Wheels have a tyre (3 rings plus cross ribs), rim, spokes and hub. **Every part must be physically connected**: brackets, clamps, stays. A floating light or saddle reads as a modelling error.
+- **Solid hologram**: every quad of the mesh is filled with a **screen-space Fresnel** (`0.3 + 0.7·(1 − facing)^1.6`, where facing = projected area / edge product), multiplied by an **interlace pattern** (2 px full, 2 px at 38 %) that scrolls 1 px per frame. Line width goes up ×1.5 at ignition and eases back to ×1.12. A **light wave** (±7 cm band) climbs the model at ignition and again on the chord change.
+- **Beam**: the union of the pad ellipse, the top ellipse and the side trapezoid, filled once with nonzero winding (so there are no double-bright seams). Gradient 10 % → 0, 26 faint vertical rays, 70 rising dust motes.
+- **Colour**: `hue` 188 (cyan) and `accent` 38 (amber) in the demo, both set in content.json. The alternate content uses 204 / 18 (blue / orange), and the whole film re-themes.
+- **Type**: Rajdhani (300 for big numbers and the product name with 26 px tracking; 500/600 for labels with 2–3 px tracking; all caps) and Share Tech Mono 20–22 px for micro data (coordinates, frame counter, zoom). Numbers are laid out **monospaced digit by digit** so rolling never jitters. The decimal point is drawn as a small square, because a light-weight "." glowing reads as a comma.
+- **Text never sits on the wireframe**: every text block (rail chips, the big spec card, the price column, hotspot numbers, subtitles) has its own **dark plate**: `rgba(1,8,12,.72)`, a 1 px border at 28 % and 10 px corner ticks (`plate()` in hud.js). Also move the camera so the subject clears the rail where you can. In the demo's wide loupe shot, the target sits at x 0.49 → 0.475 of the frame.
+- **HUD furniture**: 46 px corner brackets 44 px from the frame edge. Side rulers tick every 24 px (every 5th long) and parallax with the camera yaw. Top-left: product // SPEC SCAN. Top-right: live status (SCANNING 042% → SCAN COMPLETE · 3 SYSTEMS → TARGET 2/3 · MOTOR → HOLO SOLID · 360° → SPEC SHEET · READY). Bottom: frame counter, scan height, camera yaw / pitch / distance.
+
+## 4. Motion language
+
+- **Everything runs on ones at 24 fps.** The only stepped element is glyph scrambling, which changes every frame.
+- **Target box lock**: it starts 1.9× the part's rest-pose bounding box, rotated 45°, at 30 % alpha, and snaps to fit in 0.22 s (cubic ease-out). It flashes white for 3 frames on the downbeat, then the tag `TGT 0N · LOCK` appears. The box is sized from the **rest pose** (no explode offsets, no internal pieces), so it doesn't balloon when the part opens.
+- **Explode**: every piece has its own vector along its assembly axis. The e-bike battery cover slides *along the down tube*, out of the way, while the cells stay in place and turn hot, so the relationship reads at a glance. The motor splits axially (cap / rotor / stator / cap) while the rotor and stator counter-rotate. The brake caliper halves part on either side of the rotor. It opens over 1 beat (long part: 2 beats) and closes over 0.5 s at the end of the segment.
+- **Leader**: an anchor ring, then a diagonal to the elbow, then a horizontal to the card, drawn out over 0.5 s. The anchor pulses once when the value locks.
+- **Rolling value**: characters lock right-to-left over 0.5 s (long part: 1 s) and turn amber on the downbeat, with a one-frame white flash and a full progress bar under the number. The detail line rolls in **on the same beat**.
+- **Chip dock**: at the end of each segment the big card fades (0.35 s) while its chip slides into the left rail (x 140 → 110). The rail step is `min(112, 410 / (n − 1))` px, so 5 chips still fit.
+- **Camera follows the box (the transition grammar)**: going from part N to part N+1, the camera interpolates over 0.5 s with a cubic ease in-out. The move starts 0.45 s *before* the next lock, still inside the previous segment. It gets **real motion blur**: 5 sub-frames averaged over a 180° shutter (1/48 s), only inside the whip window, plus faint horizontal speed streaks. Static HUD stays sharp because it doesn't move between sub-frames. There are no cuts or fades anywhere in the scene. The only other transitions are the scan plane itself (in at the start, erase top-down at the end) and the loupe iris.
+
+## 5. Camera language
+
+The camera orbits a target point: yaw, pitch, distance, fov 0.6, and a screen position for the target (so the subject can sit left or right of the text).
+
+| Beat | Camera | Why |
+|---|---|---|
+| Hook (0–2.6 s) | 3/4 front, pitch 14°, slow **orbit** yaw 57° → 24° while it **cranes down** | From above, the scan plane reads as an ellipse, a plane that is rising. Then it drops to near eye level and leaves room for the title on the left |
+| Part 1 (slow) | **Push-in** 2.85 → 1.6 (1.5 s ease-out), then drift | The first spec gets the most time. 3/4 so internals come out towards the lens |
+| Part 2 | **Whip** (following the box) + **orbit** around the hub axis, yaw −11° → 46° | An axial explode only reads when you orbit around the axis |
+| Part 3 (fast) | **Pull back** to full + **loupe** (frame in frame, ×4.3, its own counter-orbit) | Small parts: the wide shot shows *where*, the loupe shows *what*. Both scales are on screen at once |
+| Regroup | **Pull back + crane down** to pitch 0 | A low angle makes the object stand up before the light-up |
+| High point | **Turntable 360°** + **crane up** 0 → 13° + slight push | The only moment the viewer sees every side |
+| Lockup | Nearly static, a slow **dolly** 3.5 → 3.4 | The viewer reads, and the frame doesn't die |
+| End | **Scan-erase** top-down, then the end card | Mirrors the hook |
+
+Framing rules: the subject is ≥ ⅓ of frame height in every key moment. Big cards live at x ≥ 1240. The rail lives at x 110–470. Subtitles are fixed at the bottom centre (baseline y 962), and the loupe stays above y 580 so the three never collide. Keep exploded pieces out of the rail (reduce explode vectors rather than let a cap fly into the text).
+
+**Signature shot**: part 1 as one move. Lock, push, the cover slides, the cells glow, the leader pulls out, and "80 km" rolls amber.
+
+## 6. Sound
+
+- **Music first, 120 BPM** (1 bar = 2 s). Locks and value locks land on bar downbeats. `tools/cuecheck.py` checks every key event against `music/score.json` (all on the 1/16 grid, 0 ms offset in the demo).
+- **Score** (original, numpy synthesis, D minor with Dorian colour; chords Dm9 → B♭maj7 → Fmaj9 → G6): a 16-step saw/square arpeggio with a ping-pong delay, 1–4 kHz scooped for the voice. A D1 square pulse on quarters, an 8th-note bass, synthesised hats and claps, detuned saw pads. **Density follows the info arc**: no drums on part 1, + hats on part 2, + claps and the arpeggio up an octave on part 3. Regroup **decelerates** (16ths → 8ths → one quarter gliding down). Then a **true digital silence** for one beat. **Drop** at ignition (808-style sine glide + 7-voice wide saw chord). Half-time breathing under the lockup. The arpeggio is removed note by note under the end card.
+- **Silences**: (1) the half beat before the first lock, where only the room hum remains and the lock hit is the first sound after it. (2) One full beat before ignition, which is true zero, so the ignition is the loudest moment in the film.
+- **Foley follows the material**: light = clean sines and FM blips *in the key* (detect blips D–F–A, amber confirm = D6 + A6 + E7). Machines = servo slides (filtered saw), pneumatic "pff", hydraulic hiss, metal tinks, a low thump + clack + two-tone beep for every lock. Number rolls tick at 24 fps.
+- **Ambience**: projector hum (40/80/120 Hz), a low room tone, and after ignition a band-passed "light" noise with a slow tremolo.
+- **J/L-cuts**: the motor whine starts 0.4 s before the whip lands on the motor. The hydraulic hiss starts 0.4 s before the brake lock. The hum and the chord tail carry over the scan-erase into the end card.
+- **Voice**: Kokoro `af_heart`, speed 1.0: calm and confident. (`af_nicole` was tested and was too breathy and slow: 7.0 s against 4.4 s for the same line.) The music ducks −16.5 dB and the foley −15 dB under the voice, using a **held** envelope (0.5 s max-filter) so the bed doesn't pump between words. Only the first 0.2 s of lock / confirm hits escape the duck.
+
+## 7. Subtitles & titles
+
+- Subtitles are part of the HUD: a dark translucent plate (`rgba(1,8,12,.62)`), two diagonal cyan corner brackets and four "voiceprint" bars that move with the speech. Rajdhani Medium 38 px in near-white. Fixed at the bottom centre, with a wrap width of 1180 px.
+- Timing: they appear 0.1 s before the voice, hold ≥ max(1.8 s, speech + 0.6 s) and end 0.12 s before the next line starts.
+- The product title is part of the first scene (no separate title card): the name rolls in on the downbeat after the scan, then the model code and category, then the tagline. It returns in the same position in the lockup, which is also the poster.
+- End card (after the lockup): film title, SCI-FI HOLOGRAM HUD, Lemo-Opuscar, LemoLab × Claude Opus 5.5, and credits, each line rolling in.
+
+## 8. Pitfalls we hit
+
+- **A light-weight period under glow reads as a comma** ("17,4"). Draw the decimal point as a square.
+- **Scrolling a pattern with `setTransform(…, offset)` and then `destination-in`** clears everything outside the shifted rect. Use `offset % patternHeight`, or the fills vanish after the first second.
+- **Target boxes sized from the live bounding box** balloon when the part explodes, or when a long piece (the brake hose) is included. Use the rest pose, skip `internal` pieces, and flag long attachments `box:false`.
+- **Hotspot labels read as pointing to the wrong part** when they sit on a long diagonal leader. Put the ring on the part body and the number chip right next to the ring. Flash the part white on the ping.
+- **Floating components** (the light with no bracket, the saddle with no clamp) are the first thing a viewer notices in a wireframe. Model every connector.
+- **Two parallel boxes** (cover and cells both moved) don't read as an explode. Move the shell along its own axis and leave the contents in place, glowing.
+- **Voice masked by foley, not music**: in-band (300–4 kHz), rolls, servos and the confirm chord were only 3 dB under the voice. Duck the foley too, and hold the duck through word gaps.
+- **Detect blips inside a silence** break the silence. Run cuecheck with the silence windows.
+- **The beam polygon** drawn from separate shapes gave dark wedges or double-bright seams. Fill one path with three subpaths using nonzero winding.
+- **Text over wireframe** fights with the lines, even when the lines are dim. Put every text block on a plate, and still move the camera so the subject clears the rail.
+- **A caliper built from two boxes doesn't read as a caliper.** You need an arc-shaped body that hugs the rotor edge, round piston faces, pads that follow the rotor curve, and vent holes on the rotor. On the explode, the pistons separate *less* than the body, so they appear to extend towards the rotor.
+- **Whip written inside the next segment** only starts at that segment's first frame, so it plays as a hard cut. Start the interpolation in the previous segment. Check with a 0.1 s frame strip.
+- **Floating parts in a swap model** (the drone's landing legs started outside the hull) break the same rule as the demo. Every connector gets modelled: belly mounts, fold hinges at the arm roots.
+- **Scan-erase** has to clip faces as well as edges. Otherwise translucent faces linger after the lines are gone.
+
+## 9. Production recipe (this repo)
+
+```
+styles/hologram-hud/demo/
+ content.json all text, numbers, colours, model path, voice lines content_alt.json the swap test (drone)
+ engine/holo.js wireframe engine (projection, scan, explode, Fresnel faces, glow, pad, scan plane, normalise, modelFromPath)
+ engine/hud.js HUD layer (target box, leader, rolling text, spec card, chip, marker, beam, subtitle, chrome, glitch)
+ models/mkmodel.mjs primitive builder (tube, ring, disc, box, saddle, fender, wheel, cells, stator, rotor, caliper…)
+ models/gen_volt.mjs the e-bike models/gen_kite.mjs the drone
+ film.js timeline + cameras + states (only calls the engine) frames.js engine demo scene (?scene=star)
+ music/score.py original score from timeline.json mix.py UI + mechanical foley + ambience + voice + ducking
+ tools/ make_lines.mjs export.mjs cuecheck.py final_asr.py
+```
+1. Write the model generator (parts → pieces with explode vectors; `internal`, `hot`, `box:false`, `anchor`, `center`, `tagDir`), then `content.json`.
+2. `tools/export.mjs` dumps `events.json` / `timeline.json` / subtitles. Hand `timeline.json` and the cue map to a music sub-agent while you animate.
+3. Review stills (`node core/render/still.mjs <demo> t… [--q content=…]`) and 1 s contact sheets, twice, plus strips around every lock, whip, silence and ignition.
+4. `sh demo/build.sh` rebuilds everything: model → TTS → whisper → export → score → cuecheck → mix → srt → render (~45 s for 936 frames with 2 workers; whip frames cost 5×) → mux (−14 LUFS, grain 0) → final whisper check.
+
+## 10. Engine usage
+
+The engine draws **any shape** in this style. Give it a wireframe (vertices, edges, optional quads), or build one from a 2D path with `modelFromPath`.
+
+**`engine/holo.js`**
+| Function | Purpose |
+|---|---|
+| `loadModel(url, {normalize=true, diag=2.3117})` | Load a model JSON, prepare typed arrays, and **normalise** it to the demo's stage size (bounding-box diagonal) so cameras work for any product |
+| `prepModel(json)` / `normalizeModel(m, diag)` | The same for in-memory models |
+| `modelFromPath(pts2d, {depth, id, slices, explode})` | Extrude any closed 2D path into a wireframe body with side faces |
+| `makeCamera(cam, W, H)` | `{project(x,y,z,out)}` for cam `{target, yaw, pitch, dist, fov, cx, cy, roll}` |
+| `new Holo(W,H).draw(ctx, model, cam, opts)` | Draw with glow. opts: `hue`, `spin` (turntable), `scan:{y,band}` (grow up to y), `scanDown:{y}` (erase down to y), `explode:{partOrPiece:0–1}`, `angle:{piece:rad}` (spin about piece.axis), `solid:0–1`, `wave:{y,w}`, `focus`+`dim`, `flash:{part:0–1}`, `keep:{piece:'#hex'}` (**the single-colour exception**: that piece keeps its own colour), `lineWidth`, `gain`, `glow`, `only`. Returns `{bbox:{part:[x0,y0,x1,y1]}, anchor:{part:[sx,sy,z]}}` |
+| `drawPad(ctx, cam, W, H, {hue, rot, alpha})` / `drawScanPlane(ctx, cam, W, H, y, {hue, r, rot, alpha})` | The projector pad and the scan plane |
+
+Model JSON: `{parts:[{id, anchor, center?, tagDir?, pieces:[{id, v:[x,y,z…], e:[a,b…], q:[a,b,c,d…], explode:[dx,dy,dz], axis?:{c,d}, internal?, hot?, box?}]}]}`.
+
+**`engine/hud.js`**: `theme(hue, accent)`, `background`, `vignette`, `chrome`, `plate(ctx,T,x,y,w,h,a)` (dark text plate), `targetBox(ctx,T,bbox,k,{flash,tag,lockK})`, `leader(ctx,T,from,elbow,to,prog,{pulse})`, `rollText(str,k,frame)`, `monoText`, `specCard(ctx,T,x,y,{label,value,unit,detail},{reveal,roll,detail,frame,flash})`, `chip`, `marker(ctx,T,p,label,a,pulse,dir)`, `beam(ctx,T,project,a,t,{y1})`, `subtitle`, `glitch`, `fitFont`, `wrap`.
+
+Minimal example: a warm-orange `#D97757` four-point star with a cursor tail, scanned in and then locked (`demo/frames.js`, `?scene=star`):
+```js
+import { Holo, modelFromPath, normalizeModel } from './engine/holo.js';
+import * as U from './engine/hud.js';
+const P = []; for (let i = 0; i < 8; i++) { const a = Math.PI/2 + i*Math.PI/4, r = i % 2 ? .16 : .5; P.push([Math.cos(a)*r, Math.sin(a)*r + .6]); }
+const star = modelFromPath(P, { depth: .12, id: 'star' });
+const tail = modelFromPath([[.62,.1],[.7,.1],[.7,.55],[.62,.55]], { depth: .06, id: 'caret' });
+const m = { parts: [...star.parts, ...tail.parts] }; m.byId = Object.fromEntries(m.parts.map(p => [p.id, p])); normalizeModel(m, 1.6);
+const T = U.theme(188, 38), cam = { target:[0,.55,0], yaw:.6, pitch:.18, dist:2.6, fov:.6, cx:960, cy:540 };
+const info = new Holo(1920,1080).draw(ctx, m, cam, { hue: T.hue, scan: { y: .8 }, keep: { star: '#D97757' } });
+U.targetBox(ctx, T, info.bbox.star, 1, { tag: 'TGT 01 · LOCK' });
+```
+
+## 11. Swap in your content
+
+Every word, number, colour and the model come from `demo/content.json`. The code holds no copy text.
+
+| Field | Type | Allowed | If out of range |
+|---|---|---|---|
+| `product` | string | 1–10 chars | Longer names still roll, but 176 px type will overflow the 410 px column: keep it short or lower the size in `titleBlock` |
+| `model_code`, `category` | string | ≤ 30 chars together | Shown in mono 22 px on one line |
+| `tagline` | string | ≤ 60 chars | Auto-wraps at 420 px and shrinks to 20 px |
+| `model` | path | a model JSON (see §10) | Any size: it is normalised. Parts named in `callouts[].part` must exist |
+| `hue`, `accent` | 0–360 | any | The whole film re-themes |
+| `voice` | `{id, speed}` | a Kokoro voice | Check with whisper |
+| `intro_vo`, `outro_vo`, `callouts[].vo` | string | intro ≤ 5 s spoken; part 1 ≤ 4.8 s; other parts ≤ 3.5 s | Subtitles are clamped to the next line; longer lines overlap the next lock: shorten them or raise speed |
+| `*_vo_asr` / `callouts[].vo_asr` | string | optional | What whisper should hear (digits etc.) |
+| `callouts[]` | array | **2–5** items: `part`, `label` (≤ 24 chars), `value` (≤ 6 chars), `unit` (≤ 4), `detail` (≤ 40, optional), `vo` | Part 1 gets 3 bars, the others 2 bars each. The timeline, music, cues and rail spacing all re-flow. More than 5 won't fit the rail |
+| `footer.weight`, `footer.price` | `{label, value, unit}` | value ≤ 7 chars | Auto-fits down to 40 px |
+| `footer.cta` | string | ≤ 34 chars | Auto-fits down to 14 px |
+| `film_title`, `credits[]` | strings | | End card |
+
+Parts in the model can set `tagDir: -1` so the lockup hotspot chip sits to the left of its ring.
+
+**One command** (from the repo root; it redoes voice, whisper check, score, cue check, mix, subtitles, render and mux for the new content):
+```
+CONTENT=content_alt.json NAME=kite sh styles/hologram-hud/demo/build.sh
+```
+The outputs go to `demo/out/kite/`: `kite.mp4`, `kite.srt`, `poster.jpg`. The swap test in this repo was built exactly this way: 43 s, 4 parts, −14.0 LUFS, cue check 0 mismatches. Preview any content without building with `node core/render/still.mjs styles/hologram-hud/demo 12 --q content=<file>.json`.
+
+**Steps for your own product**: 1) Write `models/gen_<yours>.mjs` with the primitives in `models/mkmodel.mjs` (or convert a CAD export into the format below) and run `node … > models/<yours>.json`. 2) Copy `content.json`, point `"model"` at your JSON and name your parts in `callouts[].part`. 3) Run the one command above.
+
+**Model data format** (one JSON file, metres, **y up**, x = the product's front, z = towards the viewer's side. Any scale works, because it is normalised on load):
+```json
+{ "name": "VOLT CE-01",
+ "parts": [ // part = one thing a callout can target (battery, motor, brakes…)
+ { "id": "brakes", // referenced by content.json callouts[].part
+ "anchor": [0.527, 0.416, 0.09], // hotspot: where leader lines and the lockup ring land (ON the part's surface)
+ "center": [0.524, 0.428, 0.08], // optional: what the close-up / loupe camera looks at (defaults to anchor)
+ "tagDir": -1, // optional: lockup number chip left (-1) or right (1) of the ring
+ "pieces": [ // piece = a rigid sub-assembly that moves on its own in the explode
+ { "id": "brake-caliperA",
+ "v": [x0,y0,z0, x1,y1,z1, …], // vertices, flat
+ "e": [0,1, 1,2, …], // edges: index pairs into v (the wireframe lines)
+ "q": [0,1,5,4, …], // optional quads: 4 indices each (the translucent solid-hologram faces + Fresnel)
+ "explode": [0, 0, 0.10], // offset at explode = 1, along the assembly axis
+ "axis": { "c": [x,y,z], "d": [0,0,1] }, // optional spin axis (rotors, fans)
+ "internal": true, // optional: hidden until the part opens (cells, stator)
+ "hot": true, // optional: glows near-white while open (the thing that makes the number true)
+ "box": false } // optional: excluded from the target-box bounds (long hoses, cables)
+ ] } ] }
+```
+Rules: every piece must physically touch its neighbour (no floating parts). Tubes are rings plus longitudinal lines, not single lines. Keep the total around 5k vertices / 6k edges for fast renders. Give the part that carries the key number a `hot` inner piece and a shell that slides *along its own axis*.
+
+Minimal example (two parts):
+```json
+{ "product": "ORBIT", "model_code": "S1", "category": "Smart speaker", "tagline": "Room-filling sound.",
+ "model": "models/orbit.json", "hue": 170, "accent": 40,
+ "voice": { "id": "af_heart", "speed": 1.0 }, "intro_vo": "This is Orbit.",
+ "callouts": [
+ { "part": "driver", "label": "Woofer", "value": "4", "unit": "in", "vo": "A four inch woofer." },
+ { "part": "mics", "label": "Far-field mics", "value": "6", "unit": "", "vo": "Six microphones hear you across the room." } ],
+ "footer": { "weight": { "label": "Weight", "value": "1.2", "unit": "kg" }, "price": { "label": "From", "value": "199", "unit": "USD" }, "cta": "Available now" },
+ "outro_vo": "Orbit. Available now.", "film_title": "Orbit · Spec Scan", "credits": ["…"] }
+```
+The swap test in this repo is `content_alt.json`: a four-part folding drone in blue / orange. Its stills are `demo/stills/alt_title.jpg`, `alt_signature.jpg` and `alt_lockup.jpg`.
diff --git a/styles/hologram-hud/TREATMENT.md b/styles/hologram-hud/TREATMENT.md
new file mode 100644
index 0000000..52f1532
--- /dev/null
+++ b/styles/hologram-hud/TREATMENT.md
@@ -0,0 +1,254 @@
+# Sci-fi Hologram HUD · 导演方案(Treatment)
+
+**片名** *Volt · Spec Scan*(片内第一个画面就是产品名 VOLT,不单独做片名卡)
+**场景** 硬件产品的卖点与参数讲解:产品页首屏视频 / 众筹视频的参数段 / 展会屏循环片
+**产品** 虚构城市电助力车 **VOLT CE-01**(品牌、造型、参数全部原创)
+**时长** 39 s(120 BPM,4/4,1 小节 = 2 s;场景 34 s + 片尾卡 5 s)| **画幅** 1920×1080 | **帧率** 24 fps,全部逐帧平滑(全息界面是精确的机器运动,不做步进;只有乱码滚动按 24 fps 每帧换字形)
+**旁白** 要。平静、自信的产品讲解,Kokoro 候选 af_nicole / af_heart(制作时两条都试,挑更"冷静而不冷漠"的那条)。字幕做成界面里的"语音转写条"。
+**一句话** 一道扫描光带从投影台升起,把一辆自行车"扫"成发光的线框;目标框逐个锁定电池、电机、刹车,每次锁定都推近、局部拆开、拉出引线、数字从乱码滚到真值;三个部件归位后全场静音一拍,线框亮成实心的全息体转一圈,最后停成一张能直接当产品页首屏的参数海报。
+
+---
+
+## 一、对标:学什么 / 刻意不学什么
+
+| 对标 | 学什么(语法) | 刻意不学 |
+|---|---|---|
+| **《钢铁侠》《复仇者联盟》的 HUD 与全息工作台**(Territory Studio、Perception 的界面设计) | 目标框"先大后小、斜着转正"的锁定动作;引线标注从锚点圈出发、先斜后平;数字滚动;前景界面 / 主体 / 背景网格三层视差;全息物体被手势"拆开"后悬浮;界面元素每一个出现都有声音 | 不做满屏堆叠的信息瀑布(那是"炫"不是"讲");不用红金配色、不出现任何角色、盔甲、logo、片中界面的具体布局与字体 |
+| **《遗落战境》的全息界面**(GMUNK 等) | 克制的单色:几乎只有一种冷色 + 一个暖色;大量留白;细线(1–2 px);界面文字小而疏;动效慢而稳 | 不用它的白色塑料质感和具体图标;不做无人机、地图等片中物件 |
+| **工业 CAD 线框与爆炸图** | 管件是"环 + 纵线"组成的网格;零件沿装配轴线拆开并保持对齐;拆开的距离说明结构层级;爆炸时镜头给 3/4 角度让层与层分开 | 不做纸面工程图的线型、图框、标题栏(那是 blueprint 的事);不做写实材质 |
+| **产品页首屏 / 众筹参数段**(功能用途的对标) | 一屏一个卖点、大数字 + 单位 + 一行解释;最后一屏"所有参数 + 价格 + 行动号召"可以直接截图 | 不做滚动网页的排版;不出现任何真实品牌与价格体系 |
+
+### 和库内已有风格的区别
+
+| 容易撞的风格 | 它是什么 | 本风格怎么区分 |
+|---|---|---|
+| **dark-keynote 暗色科技发布** | 软件 app 发布,主角是界面、窗口、字体排版;青柠色光标 | 本片主角始终是**发光的三维线框实物**,文字只做标注;主色是青色全息 + 琥珀色数值,没有窗口、没有排版秀 |
+| **blueprint 蓝图 / 工程制图** | 晒图纸上的白线正交制图,纸、图框、手写标注 | 本片没有纸:黑场里的**加法发光线**,**透视**投影、会转、会被扫描出来;标注是 HUD 引线不是尺寸线 |
+| **glass-product 玻璃质感产品** | three.js 写实玻璃耳机开箱,灯光、折射、色散 | 本片**不做写实渲染**,纯 2D Canvas 线框投影;产品"是扫描出来的数据",不是被灯照亮的物体 |
+| **iso-infographic / dataviz / living-screencast** | 等距沙盘旅程 / 数据折线 / 软件录屏教程 | 场景不同:本片是**硬件参数讲解**,信息单位是"部件 → 一个数值" |
+
+媒介(发光线框 + 界面层)、配色(冷青单色 + 唯一暖色琥珀)、镜头语法(目标框带镜头)、配乐(120 BPM 精准电子脉冲 + 界面音)、场景用途(硬件参数页)都与现有风格不重合。
+
+---
+
+## 二、信息弧(替代情绪弧)
+
+| 层 | 时间 | 信息 | 这一层的动作 | 这一层的声音 | 节拍 |
+|---|---|---|---|---|---|
+| **钩子** | 0–2.6 | (无字)一辆东西正在被扫出来 | 扫描光带从投影台往上升,线框随光带长出,交点闪白点 | 扫描上升音(滤波噪声 + 上行正弦)、投影台低频嗡鸣 | 第一帧光带已在车轮高度,不从空白开始 |
+| **主标题** | 2.0–8.0 | VOLT / CE-01 · City e-bike / Stripped to what matters. | 产品名乱码滚到真值;副标题、标语按拍依次出现;镜头缓慢环绕 | 琶音进入(低通);每行字一个"确认"细音 | 2.0 / 3.0 / 3.5 |
+| **关键数据 ×3** | 8–22 | 电池 80 km → 电机 250 W → 刹车 160 mm | 每个部件:目标框锁定 → 镜头动作 → 局部爆炸 → 引线 → 数字滚动 → 细节行 → 收成左栏芯片 | 锁定 = 小节头的重击;数字锁定 = 琥珀色和弦音 | 第一个 3 小节慢讲,后两个各 2 小节(加速) |
+| **细节** | 同上 | 540 Wh · hidden in the down tube 等 | 数值锁定后半拍出现,停到段末 | 细碎打字 tick | |
+| **高点** | 24–28 | (无新字)整车归位成立 | 静音一拍 → 线框亮成实心全息体 + 投影光柱 + 故障闪 3 帧 → 转 360° | 全片唯一的低频 drop + 宽和弦 | 小节头 24.0 |
+| **行动号召 / 落版** | 28–34 | 左:VOLT + 三项参数;车上 01/02/03 热点;右:重量 17.4 kg、价格 1,990 EUR、Reserve now · ships spring 2027 | 标题回到左栏;热点按八分音符依次打点;重量、价格滚动;CTA 框画出 | 三声 ping + 两次数字滚动 + 一次确认 | 30.85 起全部在场,停到 34.0(≥3.1 s) |
+| **片尾卡** | 34–39 | 片名、风格名、Lemo-Opuscar、LemoLab × Claude Opus 5.5、素材署名 | 扫描光带反向从上往下把车擦成光点,字卡滚出 | 全息嗡鸣和最后的和弦拖尾(L-cut)| |
+
+### 阅读时间核对(≥ 字数 ÷ 12 + 1 s,最短 1.5 s)
+
+| 文字 | 字数 | 需要 | 实际在场 |
+|---|---|---|---|
+| VOLT + CE-01 · CITY E-BIKE + 标语 | 44 | 4.7 s | 2.5–7.9 = 5.4 s(落版再出现) |
+| 电池:BATTERY RANGE / 80 km | 18 | 2.5 s | 11.0–13.6 = 2.6 s,之后常驻左栏到 34.0 |
+| 电池细节 540 Wh · hidden in the down tube | 32 | 3.7 s | 11.5–13.6 = 2.1 s ✗ → **制作时把细节提前到 10.75,与数值同一拍滚动**,并在 13.6 后随芯片保留一行缩略 |
+| 电机:REAR HUB MOTOR / 250 W | 19 | 2.6 s | 15.0–17.6 = 2.6 s,之后常驻 |
+| 电机细节 45 Nm · sealed, silent | 22 | 2.8 s | 16.5–17.6 ✗ → 同上处理:细节与数值同拍,段末不急着收,收进芯片后保留 1.0 s |
+| 刹车:HYDRAULIC DISC / 160 mm | 19 | 2.6 s | 19.0–21.6 = 2.6 s,之后常驻 |
+| 落版全部信息 | — | ≥ 3 s | 30.85–34.0 = 3.15 s(HUD 34.0–34.5 才淡出) |
+
+> 细节行是三条里最容易被"闪过去"的,已列为最没把握的点之一;如果加提前量仍不够,就把后两个部件的细节行删掉(宁可少放一条)。
+
+---
+
+## 三、原生招式(只有"全息线框 + 界面"能做到的)
+
+| 招式 | 放在哪里 | 怎么做 |
+|---|---|---|
+| **扫描生长** | 开场钩子;片尾反向擦除 | 世界高度 y 的扫描面:只画 y 以下的边,跨过扫描面的边在交点截断并画白点;扫描前沿 7 cm 内的边发白("刚被扫到");扫描面本身是投影出来的椭圆 + 刻度 + 横向光幕 |
+| **局部爆炸图** | 三个部件各一次 | 每个零件由若干 piece 组成,piece 自带爆炸向量;内部件(电芯、定子、转子)平时隐藏,爆炸时才出现;转子 / 定子反向自转、碟片慢转 |
+| **目标框带镜头** | 贯穿全片的转场语法 | 目标框从 1.9 倍、45° 斜角缩到贴合零件;下一个部件时目标框飞过去,镜头跟着目标框甩过去(带速度线),所以每次转场都是"眼睛追框" |
+| **滚动数字** | 每个数值、产品名、价格 | 每个字符先乱码(数字位用 0–9,字母位用 A–Z#%/),从右往左按拍锁定;锁定瞬间变琥珀色并闪白一帧 |
+| **多层视差** | 全程 | 背景点阵(视差 0.2)、投影台(跟相机透视)、主体、前景刻度尺(视差 1.4)、界面文字(不动) |
+| **放大镜画中画** | 刹车段 | 第二个相机在圆形取景框里以 3.9 倍放大卡钳和碟片,里面单独做爆炸;两条切线把放大镜和车上的小圈连起来 |
+| **实心全息体 + 投影光柱** | 高点 | 四边面按屏幕空间菲涅尔(侧面越亮)填色,再乘隔行扫描纹理;投影台升起光锥和上升光尘 |
+| **克制的故障闪烁** | 只在 24.0 点亮那 3 帧 | 横向切片错位 + 轻微色偏,不做第二次 |
+
+---
+
+## 四、镜头表
+
+| # | 时间 | 景别 | 角度 | 运动 | 为什么这样拍 |
+|---|---|---|---|---|---|
+| 1 | 0–8 | 全景(车占画高 ~55%) | 3/4 前侧,俯角 14° → 7° | **环绕**(yaw 57° → 24°)+ **降**(俯角变小)+ 轻微拉远 | 开场从高处看扫描面(椭圆读得出是"一个面在升"),扫完后降到接近平视,让车立起来、给左边标题留位置 |
+| 2 | 8–14 | 中近景(电池占画高 ~40%) | 3/4 前侧、俯 11° | **推**(2.85 m → 1.6 m,1.5 s 缓出)+ 之后极慢漂移 | 第一个卖点讲得最慢:推近 = "看这里";3/4 让电芯从管里往镜头方向拆出来,层次分开 |
+| 3 | 13.55–14.05 | — | — | **甩**(目标框带镜头,0.5 s) | 转场在媒介里:眼睛追着目标框飞向后轮 |
+| 4 | 14–18 | 近景(后轮毂) | 从车后侧 → 车侧前方 | **环绕**(yaw −14° → 49°) | 轮毂电机沿轴向拆开(左盖 / 转子 / 定子 / 右盖),只有绕着轴转才看得出层层分开 |
+| 5 | 17.55–18.05 | — | — | **甩** + **拉**回全景 | 第三个卖点加速:不再推近,而是拉远 |
+| 6 | 18–22 | 全景 + 画中画特写 | 侧前方 | **横移**(极慢)+ 放大镜内**反向环绕** | 画框内的画框:全景交代刹车在哪,放大镜交代它是什么,两个景别同时在场 |
+| 7 | 22–24 | 全景 | 降到平视 | **拉** + **降** | 重组:部件归位,参数收进左栏;低机位让车显得更"立",为点亮蓄力 |
+| 8 | 24–28 | 全景 → 中全景 | 平视 → 俯 13° | **转台 360°**(主体转)+ **升** + 轻**推** | 高点:尺度与体量的展示,唯一一次让观众看全车每一面 |
+| 9 | 28–34 | 全景(海报构图) | 3/4、俯 10° | 极慢**推**(3.5 → 3.4 m) | 落版:几乎不动,让观众读;轻推防止画面"死" |
+| 10 | 34–39 | — | — | 扫描面**从上往下擦除** → 片尾卡 | 首尾呼应:开场扫出来,结尾扫回去 |
+
+镜头运动种类:环绕、推、拉、甩、横移、升 / 降、转台、画中画,共 8 种。景别:全 / 中近 / 近 / 特写(放大镜)。
+
+**签名镜头**:镜头 2(8–14 s)——目标框锁定 → 推近 → 下管外壳滑开、两排电芯拆出来 → 引线拉出 → "80 km" 从乱码滚到琥珀色真值,一镜完成,所有 HUD 语法都在这一个镜头里。
+**高点**:镜头 8 的 24.0 点亮。
+
+---
+
+## 五、分镜节拍表(按秒;所有剪辑点和重要动作在拍点上)
+
+| 时间 | 画面 | 旁白 / 字幕 | 声音 |
+|---|---|---|---|
+| 0.0 | 扫描面已在车轮高度,车轮下半圈和踏板在发光;投影台刻度在转 | — | 投影台嗡鸣(40 Hz + 80 Hz)、扫描上升音起 |
+| 0.0–2.6 | 光带升过车架、车把;前沿发白、交点白点闪烁;右上 SCANNING 000→100% | — | 上升音随光带升高;每过一个部件(轮、架、把)一个细 tick |
+| 2.0 | **VOLT** 乱码滚到真值 | — | 琶音进(低通 400 Hz)+ 标题"确认"音 |
+| 2.5 | 扫描完成,扫描面消散 | — | 上升音收在一个短"叮" |
+| 3.0 | CE-01 · CITY E-BIKE | **VO1** "This is Volt. A city e-bike, stripped to what matters." | 音乐让路 −6 dB |
+| 3.5 | 标语 | | |
+| 4.0–7.5 | 镜头环绕下降;右上 SCAN COMPLETE · 3 SYSTEMS | | 低频脉冲四分音符进 |
+| 6.5 / 7.0 / 7.5 | 三个预备目标框在电池、电机、刹车上各闪一下 | | 三声短"探测"音(上行三度) |
+| 7.5–8.0 | 标题收起,画面停住 | | **静音 ①**(只剩房间嗡鸣) |
+| **8.0** | **锁定 01**:目标框从大斜框砸到电池上,闪白 | | 锁定重击(低频 thump + 金属 clack + 高频 lock 音) |
+| 8.0–9.5 | 推近到电池 | | 琶音打开、低音八分 |
+| 9.0 | | **VO2** "The battery hides inside the down tube. Eighty kilometres on one charge." | |
+| 9.0–10.0 | 下管外壳滑开,电芯、管理板拆出 | | 滑轨 + 伺服音、每排电芯落位一个 click |
+| 10.0 | 引线从锚点拉出,卡片标题出现 | | 引线 zip |
+| 10.0–11.0 | 80 滚动 | | 滚动 tick(十六分音符) |
+| **11.0** | **80 km 锁定**(琥珀色) | | 确认和弦音(琥珀色 = 这个音色,全片数值统一) |
+| 11.5 | 细节行 | | |
+| 13.4–13.9 | 电池归位 | | 归位 click |
+| 13.55–14.05 | 目标框飞向后轮,镜头甩过去 + 速度线 | | **J-cut ①**:电机的高频电磁啸叫从 13.6 先进 → whoosh |
+| **14.0** | **锁定 02** 后轮毂 | | 锁定重击;hi-hat 十六分加入(密度 +1) |
+| 14.5 | 左右盖沿轴拆开,转子 / 定子反向转 | **VO3** "A two hundred and fifty watt hub motor. Silent, and sealed." | 电机嗡鸣随转速升 |
+| 15.0 | 卡片 | | |
+| 15.5–16.0 | 250 滚动 → **16.0 锁定** | | 确认和弦 |
+| 16.5 | 细节行 | | |
+| 17.55–18.05 | 甩回全景 | | **J-cut ②**:油压"嘶"声 17.6 先进 |
+| **18.0** | **锁定 03**:放大镜打开 | | 锁定重击;拍手 / 军鼓 2、4 拍加入(密度最高)|
+| 18.25 | 放大镜里的目标框锁定卡钳 | | 高频 lock |
+| 18.5 | 碟片前移、卡钳两半分开 | **VO4** "Hydraulic disc brakes. Sure stops, even in the rain." | 油压嘶声 + 金属片 tink |
+| 19.5–20.0 | 160 滚动 → **20.0 锁定** | | 确认和弦 |
+| 22.0 | 放大镜收拢(光圈式),部件归位 | | 琶音减速:十六分 → 八分 → 四分(**明显减速**) |
+| 22.0–23.0 | 镜头拉远降到平视;第三张芯片停进左栏 | | 三声归位 click |
+| 23.0–23.5 | 线框电量下降,亮度降到 30% | | 下行"断电"音 |
+| 23.5–24.0 | 全场停住 | | **静音 ②(真静音,一拍)** |
+| **24.0** | **点亮**:线框变实心全息体,投影光柱升起,故障闪 3 帧 | | **全片最重要的声音**:低频 drop + 宽和弦 + 故障 burst |
+| 24.0–28.0 | 转台 360°,镜头升起 | (无旁白,给音乐) | 满编:琶音、低音、鼓、和弦;转台 whoosh(多普勒) |
+| 28.0 | 转回 3/4,停 | | 音乐退到"呼吸":只剩脉冲 + 琶音(半速感) |
+| 28.25 | 标题回到左栏 | | |
+| 28.5 / 28.75 / 29.0 | 车上 01、02、03 热点依次打点 | | 三声 ping(八分音符) |
+| 29.0 | | **VO5** "Seventeen point four kilos. Ready when you are." | |
+| 29.5 / 30.0 | 重量、价格滚动锁定 | | 两次滚动 + 确认 |
+| 30.5 | CTA 框画出 | | 最后一个确认音 |
+| 30.85–34.0 | **落版停住**(可截图) | | 和弦长音 |
+| 34.0–35.25 | 扫描面从上往下把车擦成光点,HUD 淡出 | | **L-cut ①**:全息嗡鸣和和弦拖尾延续到片尾卡;反向扫描下行音 |
+| 35.0–39.0 | 片尾卡字逐行滚出 | | 每行一个细 tick,嗡鸣淡出到零 |
+
+---
+
+## 六、Cue map(音乐先行,画面卡这张表)
+
+**120 BPM,4/4,1 拍 = 0.5 s,1 小节 = 2 s,共 19.5 小节。调性 D 小调(Dorian 色彩),琶音用 D–F–A–C–E 五音循环。**
+
+| 小节 | 时间 | 段落 | 配器 | 密度 / 情绪 | 卡点 |
+|---|---|---|---|---|---|
+| 1–2 | 0–4 | 扫描 | 投影台嗡鸣(D1 正弦 + 八度)、扫描上升(噪声带通 + 上行正弦 0→2.6 s);2.0 起琶音(十六分,低通 400 Hz) | 神秘、克制 | 2.0 标题 / 2.5 扫描完成"叮" |
+| 3–4 | 4–8 | 定场 | + 低频脉冲(四分,D1 方波低通);琶音滤波缓开 | 稳 | 6.5/7.0/7.5 探测音;**7.5–8.0 静音 ①** |
+| 5–7 | 8–14 | 电池(慢讲) | + 低音八分(D2–A1);琶音全开;无鼓 | 专注 | **8.0 锁定**(小节头)、11.0 数值确认(小节头)、13.6 J-cut |
+| 8–9 | 14–18 | 电机 | + hi-hat 十六分 | 加速 | **14.0 锁定**、16.0 确认 |
+| 10–11 | 18–22 | 刹车 | + 拍手 2、4 拍,琶音升八度 | 最密 | **18.0 锁定**、20.0 确认 |
+| 12 | 22–24 | 重组 | 鼓撤掉;琶音减速十六分 → 八分 → 四分;23.0 下行断电音 | **减速、呼吸** | 22.0 / 22.5 / 23.0 归位 click;**23.5–24.0 真静音 ②** |
+| 13–14 | 24–28 | 点亮 360° | **24.0 drop**:808 式低频 + 宽锯齿和弦(Dm9)+ 全部回来 | 全片最高 | 24.0;26.0 和弦换到 B♭maj7 |
+| 15–17 | 28–34 | 落版 | 只留脉冲 + 琶音 + 和弦垫(半速感) | 呼吸、确定 | 28.5/28.75/29.0 ping、29.5/30.0/30.5 确认 |
+| 18–19.5 | 34–39 | 片尾 | 和弦拖尾 + 嗡鸣(L-cut),琶音一个音一个音拿掉 | 余韵 | 34.0 反向扫描、39.0 归零 |
+
+- **每个锁定落在小节头**(8.0 / 14.0 / 18.0),**每个数值确认也在小节头**(11.0 / 16.0 / 20.0);整车点亮前静音一拍(23.5–24.0)。
+- 条目数变化时(2–5 个),第一个部件 3 小节,其余各 2 小节,时间线和卡点自动顺延(`film.js` 的 `buildTimeline`),配乐脚本读同一份时间线生成。
+- 配乐 fork 一个子 agent 按本表和导出的 `timeline.json` 写(numpy 合成为主:方波 / 锯齿 / FM 琶音、808 式低频;界面音单独做成音效库)。画面并行。
+- 卡点自检:仿 microgame 的 `cuecheck.py`,比对配乐音符表与画面事件(EV),偏差 ≤ 1 帧。
+
+---
+
+## 七、声音设计表
+
+| 段落 | 环境底 | 主要拟音(跟"光与机器"的材质走:发光线 = 高频电子,机械部件 = 低沉的伺服和金属) | 音乐状态 |
+|---|---|---|---|
+| 扫描 0–2.6 | 投影台嗡鸣(40/80 Hz + 轻微 60 Hz 交流声)、机房空调底噪 | 扫描上升音;扫描面刻度转动的细 tick;过部件的 tick | 2.0 起琶音(低通) |
+| 标题 2–8 | 同上 | 字符滚动 tick(24 fps 颗粒);每行确认音;三声探测 | 琶音 + 脉冲,VO 时让路 −6 dB |
+| 静音 ① 7.5–8.0 | 只留房间嗡鸣 | — | 全停 |
+| 电池 8–14 | 嗡鸣 | 锁定重击;外壳滑轨 + 伺服;电芯落位 click;引线 zip;数字滚动;琥珀确认 | 低音 + 琶音,VO 让路 |
+| 电机 14–18 | 嗡鸣 + 电机电磁啸叫(J-cut 进) | 甩镜 whoosh;锁定;左右盖分开的气压"噗";转子转动的调制嗡声 | + hi-hat |
+| 刹车 18–22 | 嗡鸣 + 油压嘶声(J-cut 进) | 放大镜光圈开合;卡钳分开的金属 tink;碟片转动的细铃音 | + 拍手 |
+| 重组 22–24 | 嗡鸣渐弱 | 归位 click × 3;断电下行 | 减速 → **真静音** |
+| 点亮 24–28 | 投影光柱的高频"光"噪(带通白噪 + 慢颤音) | 故障 burst(3 帧数码爆裂);转台 whoosh(多普勒) | 满编 drop |
+| 落版 28–34 | 光柱噪声压低 | 三声 ping;两次滚动;CTA 确认 | 呼吸 |
+| 片尾 34–39 | 嗡鸣(L-cut)淡出 | 反向扫描下行;字卡 tick | 和弦拖尾 |
+
+混音:旁白最高优先级,音乐和环境底在旁白期间侧链压 6 dB;锁定重击和确认音不让路(它们是信息的"落点")。响度 −14 LUFS,不加颗粒(grain 0)。
+
+---
+
+## 八、字幕设计(界面的一部分)
+
+- 位置固定:画面底部居中(基线 y = 962),不随镜头移动。
+- 样式:深色半透明底板(rgba(1,8,12,.62))+ 对角两个青色括角 + 左侧 4 根跳动的"声纹"竖条,字体 Rajdhani Medium 38 px、近白青色。像 HUD 里的实时语音转写。
+- 每条在语音开始前 0.1 s 出现,停留 ≥ max(1.8 s, 语音 + 0.6 s),不和参数卡、放大镜重叠(参数卡右侧 x ≥ 1240、y ≤ 870;放大镜 y ≤ 580)。
+- 另交 `.srt`。
+
+---
+
+## 九、可替换内容(`demo/content.json`)
+
+所有文字、数值、配色、模型路径、旁白都从 content.json 读,代码里不写死文案。
+
+| 字段 | 类型 | 说明 |
+|---|---|---|
+| `product` / `model_code` / `category` / `tagline` | 字符串 | 左栏标题块;标语超宽自动换行、缩字号 |
+| `model` | 路径 | 线框模型 JSON(顶点 / 边 / 面 + 零件 / piece / 爆炸向量),由 `models/gen_*.mjs` 生成 |
+| `hue` / `accent` | 0–360 | 全息主色相 / 唯一暖色(数值锁定色) |
+| `voice` | {id, speed} | Kokoro 声线 |
+| `intro_vo` / `outro_vo` | 字符串 | 开场与落版旁白 |
+| `callouts[]` | 2–5 项 | `part`(模型里的零件 id)、`label`、`value`、`unit`、`detail`(可选)、`vo` |
+| `footer` | 对象 | `weight` / `price`(label + value + unit)、`cta` |
+| `film_title` / `credits[]` | | 片尾卡 |
+
+时间线规则:第一个部件 3 小节,其余各 2 小节;镜头模式按 推 → 环绕 → 放大镜 循环;左栏芯片按条目数排(最多 5 条,间距 92 px)。关卡 2 交 `content_alt.json`(换一台完全不同的硬件,暂定折叠无人机)和 3 张静帧。
+
+---
+
+## 十、技术方案
+
+- `demo/engine/holo.js`:线框引擎(透视投影、转台、扫描生长 / 擦除、局部爆炸、piece 自转、菲涅尔实心面 + 隔行纹理、景深雾化、两级辉光、扫描面、投影台)。纯 Canvas 2D。
+- `demo/engine/hud.js`:界面层(目标框、引线、滚动数字、参数卡、芯片、热点、投影光柱、字幕条、取景框、故障闪)。
+- `demo/models/mkmodel.mjs` + `gen_volt.mjs`:用基本体(管、环、盘、盒、座垫、辐条轮、电芯、定子、碟片)拼线框模型,输出 JSON。换产品 = 写一个新的 gen 脚本。
+- `demo/film.js`:只做编排(时间线、相机、状态),调用引擎。
+- 字体:Rajdhani(界面、数字)、Share Tech Mono(小字数据),均为 OFL,已放进 `demo/fonts/`。
+
+---
+
+## 十一、制作阶段修订(关卡 1 意见落实后,以成片为准)
+
+| 项 | 方案原稿 | 成片 | 理由 |
+|---|---|---|---|
+| 阅读时间 | 细节行段末收起,后两条可能删掉 | **芯片累积**:每个部件结束时,参数卡收成左栏芯片(名称 + 数值 + 细节),一直留到落版;细节行与数值同拍滚出 | 关卡 1 意见 1:每条参数实际在场 13–25 s |
+| 实心全息 | 面填充偏淡 | 管件的截面环之间填半透明四边形(菲涅尔 0.3 + 0.7·(1−正对)^1.6)× 隔行纹理;点亮瞬间线宽 ×1.5 再回落到 ×1.12;24.0 和 26.0 各有一道沿车身上行的光波;投影光柱改成"底椭圆 + 顶椭圆 + 侧面"一次填充 | 关卡 1 意见 2:t=25 自检帧见 `demo/stills/styleframe.jpg`(25.5) |
+| 落版热点 | 引线斜出,编号牌离得远 | 圈钉在部件本体(01 = 下管中段、02 = 后轮毂中心、03 = 卡钳),编号牌紧贴圈的一侧;打点时整个部件闪白一帧 | 关卡 1 意见 3 |
+| 模型连接 | 车灯、车把、座垫看起来悬空 | 加车灯支架(从头管伸出)、车把夹、座杆夹 + 座垫导轨、前后挡泥板撑杆 | 关卡 1 意见 4 |
+| 放大镜 | 卡钳偏小、偏上 | 放大镜相机对准两半卡钳的中点,×4.3;卡钳两半沿 z 轴向两侧分开(+10 cm / −5 cm),占放大框约 75% 宽 | 关卡 1 意见 5 |
+| 电池爆炸 | 外壳下盖和电芯各自平移,像两根平行体 | 下盖沿下管方向滑出(朝五通方向),电芯留在原位并变白发亮 | 关卡 1 意见 6 |
+| 旁白起点 | 后两个部件锁定后 0.5 s | 锁定后 0.25 s | "sealed""rain" 原先压在下一次锁定和归位声上,被 whisper 听错 |
+| 预备目标框 | 6.5 / 7.0 / 7.5 | 6.0 / 6.5 / 7.0 | 7.5 是静音 ①,不能有声音 |
+| 芯片停靠 | 段末 −0.3 s | 段末 −0.25 s(1/16 网格) | 卡点自检 |
+| 旁白声线 | af_nicole / af_heart 待选 | **af_heart** | af_nicole 气声太重、太慢(同一句 7.0 s 对 4.4 s),放不进 2 小节 |
+| 模型尺度 | 相机参数按自行车写死 | 引擎加 `normalizeModel`:任意模型按包围盒对角线缩放到同一舞台尺寸;扫描高度、镜头目标高度按模型高度缩放 | 换内容(无人机)时镜头仍然成立 |
+
+## 十二、关卡 2 返修(v2,旧版备份为 hologram-hud_v1.mp4 / demo_v1/)
+
+| 项 | v1 | v2 |
+|---|---|---|
+| 刹车段左栏芯片压在车上 | 芯片直接叠在后挡泥板和后轮线框上 | 两种都做了:①所有文字块(左栏芯片、参数卡、落版价格栏、热点编号、字幕)加深色半透明底板(72%、1 px 细边框、四角短刻);②刹车段全景机位右移(目标屏幕位置 x 0.43 → 0.49,距离 3.35 → 3.5),后轮离开左栏 |
+| 放大镜卡钳 | 两个方盒子 | 贴着碟片边缘的弧形钳体两半,每半两个活塞(端面同心圆 + 短圆柱,拆开时发白),弧形刹车片(背板 + 摩擦块)贴在碟片两侧,碟片两圈交错通风孔;拆开时钳体分开 16 cm,活塞比钳体少分开 2 cm,读成"活塞伸出夹住碟片";目标框只框卡钳(碟片不计入),放大镜对准卡钳中点,×5.0 |
+| 无人机起落架悬空 | 从机身外侧空中伸出 | 从机身腹部安装座伸出,落地处有脚垫;四个机臂根部加竖直销轴的折叠铰链 + 铰链座,对上"Folds into a jacket pocket" |
+| 甩镜 | 插值 + 速度线 | 另加真运动模糊:甩的 0.5 s 里按 180° 快门(1/48 s)取 5 个子帧平均;静止的界面不受影响 |
+| 换内容 | 只能出静帧 | 一条命令整片重做:`CONTENT=content_alt.json NAME=kite sh styles/hologram-hud/demo/build.sh`(已实跑:43 s、−14.0 LUFS、卡点 0 偏差) |
diff --git a/styles/hologram-hud/demo/CREDITS b/styles/hologram-hud/demo/CREDITS
new file mode 100644
index 0000000..9423662
--- /dev/null
+++ b/styles/hologram-hud/demo/CREDITS
@@ -0,0 +1,18 @@
+Volt · Spec Scan — Sci-fi Hologram HUD · Lemo-Opuscar · LemoLab × Claude Opus 5.5
+
+Picture
+- Every wireframe, HUD element, grid and light effect is drawn in code (demo/engine/holo.js, demo/engine/hud.js). No generated or stock images.
+- "VOLT CE-01" (city e-bike) and "KITE M2" (drone, content-swap test) are fictional products; models are built from code primitives (demo/models/gen_*.mjs). No real product, brand or logo appears.
+
+Fonts (SIL Open Font License 1.1, licence files in demo/fonts/)
+- Rajdhani — Indian Type Foundry
+- Share Tech Mono — Carrois Apostrophe
+
+Voice
+- Kokoro TTS v1.0 (hexgrad/Kokoro-82M, Apache-2.0), voice af_heart, via kokoro-onnx
+
+Music
+- Original composition, synthesised in numpy (demo/music/score.py). No samples.
+
+Sound design
+- All UI sounds, mechanical foley and ambience synthesised in numpy (demo/mix.py, core/audio/sfx.py)
diff --git a/styles/hologram-hud/demo/build.sh b/styles/hologram-hud/demo/build.sh
new file mode 100755
index 0000000..36666ab
--- /dev/null
+++ b/styles/hologram-hud/demo/build.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+# 从零重现《Volt · Spec Scan》:sh styles/hologram-hud/demo/build.sh(任意目录运行)
+# 换内容(一条命令):CONTENT=content_alt.json NAME=kite sh styles/hologram-hud/demo/build.sh
+# → 配音、配乐、混音、字幕、成片全部重做,产物在 demo/out/kite/(kite.mp4 / kite.srt / poster.jpg)
+# 模型:content.json 的 "model" 指向的 JSON;自己的产品先写 models/gen_<名字>.mjs 生成它(格式见 STYLE.md §11)
+set -e
+cd "$(dirname "$0")/../../.."
+PY=.venv/bin/python; D=styles/hologram-hud/demo; O=styles/hologram-hud
+CONTENT=${CONTENT:-content.json}; NAME=${NAME:-hologram-hud}
+if [ "$CONTENT" = "content.json" ]; then W=$D; OUT=$O; else W=$D/out/$NAME; OUT=$W; fi
+mkdir -p $W/out
+export HH_WORK=$W
+VREL=$(node -e "console.log(require('path').relative('$D','$W/voices')||'voices')")
+RS="" # 整机渲染限流已在 core/render/video.mjs 里
+node $D/models/gen_volt.mjs > $D/models/volt.json # 1. 线框模型(顶点 / 边 / 面 → JSON)
+node $D/models/gen_kite.mjs > $D/models/kite.json # 换内容测试用的无人机
+node $D/tools/make_lines.mjs $CONTENT $W/lines.json # 2. content → lines.json
+$PY core/tts/tts.py $W/lines.json $W/voices # 3. Kokoro 配音(af_heart)
+$PY core/tts/asr_check.py $W/lines.json $W/voices # 4. whisper 逐句校对
+node $D/tools/export.mjs $CONTENT $W # 5. 画面事件 → events.json,时间网格 → timeline.json,字幕 → out/srt.json
+$PY $D/music/score.py # 6. 原创配乐(120 BPM,numpy 合成)→ music/score.wav + score.json
+$PY $D/tools/cuecheck.py # 7. 配乐 ↔ 画面卡点自检
+$PY $D/mix.py # 8. 界面音 + 机械拟音 + 环境底 + 人声 + 闪避 → mix.wav
+$PY core/render/srt.py $W/out/srt.json $OUT/$NAME.srt # 9. 字幕
+Q="content=$CONTENT&voices=$VREL"
+$RS node core/render/video.mjs $D --fps 24 --workers 2 --q "$Q" --out $W/out/video24.mp4 # 10. 逐帧渲染(甩镜段 5 子帧运动模糊)
+sh core/render/mux.sh $W/out/video24.mp4 $W/mix.wav $OUT/$NAME.mp4 24 0 # 11. 合成:−14 LUFS,无颗粒
+$PY $D/tools/final_asr.py $OUT/$NAME.mp4 || true # 12. 成片 whisper 抽查 + 人声频段 SNR
+if [ "$CONTENT" = "content.json" ]; then
+ node core/render/still.mjs $D 25.5 --q nosub=1 --out $D/out/still --prefix sf_ && cp $D/out/still/sf_25.5.jpg $D/stills/styleframe.jpg
+ node core/render/still.mjs $D 33 --q nosub=1 --out $D/out/still --prefix po_ && cp $D/out/still/po_33.jpg $O/poster.jpg
+ # 换内容静帧(证明 content_alt.json 可用;不重做它的声音)
+ node core/render/still.mjs $D 5 12 37 --q content=content_alt.json --out $D/out/alt --prefix alt_
+ cp $D/out/alt/alt_5.jpg $D/stills/alt_title.jpg; cp $D/out/alt/alt_12.jpg $D/stills/alt_signature.jpg; cp $D/out/alt/alt_37.jpg $D/stills/alt_lockup.jpg
+else
+ T=$(node -e "const t=require('./$W/timeline.json');console.log(t.lock[1]-1)")
+ node core/render/still.mjs $D $T --q "$Q&nosub=1" --out $W/out --prefix po_ && cp $W/out/po_$T.jpg $OUT/poster.jpg
+fi
diff --git a/styles/hologram-hud/demo/content.json b/styles/hologram-hud/demo/content.json
new file mode 100644
index 0000000..6593fa3
--- /dev/null
+++ b/styles/hologram-hud/demo/content.json
@@ -0,0 +1,63 @@
+{
+ "product": "VOLT",
+ "model_code": "CE-01",
+ "category": "City e-bike",
+ "tagline": "Stripped to what matters.",
+ "model": "models/volt.json",
+ "hue": 188,
+ "accent": 38,
+ "voice": {
+ "id": "af_heart",
+ "speed": 1.0
+ },
+ "intro_vo": "This is Volt. A city e-bike, stripped to what matters.",
+ "callouts": [
+ {
+ "part": "battery",
+ "label": "Battery range",
+ "value": "80",
+ "unit": "km",
+ "detail": "540 Wh · hidden in the down tube",
+ "vo": "The battery hides inside the down tube. Eighty kilometres on one charge.",
+ "vo_asr": "The battery hides inside the down tube, 80 kilometers on one charge."
+ },
+ {
+ "part": "motor",
+ "label": "Rear hub motor",
+ "value": "250",
+ "unit": "W",
+ "detail": "45 Nm · sealed, silent",
+ "vo": "A two hundred and fifty watt hub motor. Silent, and sealed.",
+ "vo_asr": "A 250-watt hub motor, silent and sealed."
+ },
+ {
+ "part": "brakes",
+ "label": "Hydraulic disc",
+ "value": "160",
+ "unit": "mm",
+ "detail": "Two-piston · all-weather",
+ "vo": "Hydraulic disc brakes. Sure stops, even in the rain."
+ }
+ ],
+ "footer": {
+ "weight": {
+ "label": "Weight",
+ "value": "17.4",
+ "unit": "kg"
+ },
+ "price": {
+ "label": "From",
+ "value": "1,990",
+ "unit": "EUR"
+ },
+ "cta": "Reserve now · ships spring 2027"
+ },
+ "outro_vo": "Seventeen point four kilos. Ready when you are.",
+ "film_title": "Volt · Spec Scan",
+ "credits": [
+ "Voice: Kokoro-82M (Apache-2.0)",
+ "Fonts: Rajdhani, Share Tech Mono (SIL OFL 1.1)",
+ "Product, model and score: original, made in code"
+ ],
+ "outro_vo_asr": "17.4 kilos, ready when you are."
+}
\ No newline at end of file
diff --git a/styles/hologram-hud/demo/content_alt.json b/styles/hologram-hud/demo/content_alt.json
new file mode 100644
index 0000000..bf30a33
--- /dev/null
+++ b/styles/hologram-hud/demo/content_alt.json
@@ -0,0 +1,71 @@
+{
+ "product": "KITE",
+ "model_code": "M2",
+ "category": "Folding camera drone",
+ "tagline": "Folds into a jacket pocket.",
+ "model": "models/kite.json",
+ "hue": 204,
+ "accent": 18,
+ "voice": {
+ "id": "af_heart",
+ "speed": 1.0
+ },
+ "intro_vo": "This is Kite. A camera drone that folds into your pocket.",
+ "callouts": [
+ {
+ "part": "battery",
+ "label": "Flight time",
+ "value": "34",
+ "unit": "min",
+ "detail": "Swappable pack · slides out the back",
+ "vo": "The battery slides out the back. Thirty four minutes in the air.",
+ "vo_asr": "The battery slides out the back, 34 minutes in the air."
+ },
+ {
+ "part": "camera",
+ "label": "Gimbal camera",
+ "value": "48",
+ "unit": "MP",
+ "detail": "3-axis · 4K at 60 fps",
+ "vo": "A three axis gimbal, with a forty eight megapixel camera.",
+ "vo_asr": "A three-axis gimbal with a 48-megapixel camera."
+ },
+ {
+ "part": "arms",
+ "label": "Wind resistance",
+ "value": "12",
+ "unit": "m/s",
+ "detail": "Four brushless motors · folding arms",
+ "vo": "Four brushless motors hold steady in strong wind."
+ },
+ {
+ "part": "sensors",
+ "label": "Obstacle sensing",
+ "value": "360",
+ "unit": "°",
+ "detail": "Six vision sensors",
+ "vo": "And it sees in every direction."
+ }
+ ],
+ "footer": {
+ "weight": {
+ "label": "Weight",
+ "value": "249",
+ "unit": "g"
+ },
+ "price": {
+ "label": "From",
+ "value": "799",
+ "unit": "USD"
+ },
+ "cta": "Order now · ships in 48 h"
+ },
+ "outro_vo": "Two hundred and forty nine grams. Go fly.",
+ "film_title": "Kite · Spec Scan",
+ "credits": [
+ "Voice: Kokoro-82M (Apache-2.0)",
+ "Fonts: Rajdhani, Share Tech Mono (SIL OFL 1.1)",
+ "Product, model and score: original, made in code"
+ ],
+ "outro_vo_asr": "249 grams, go fly."
+}
\ No newline at end of file
diff --git a/styles/hologram-hud/demo/engine/holo.js b/styles/hologram-hud/demo/engine/holo.js
new file mode 100644
index 0000000..f39c0e7
--- /dev/null
+++ b/styles/hologram-hud/demo/engine/holo.js
@@ -0,0 +1,327 @@
+// hologram-hud · 全息线框引擎
+// 读 JSON 线框模型(顶点 / 边 / 四边面),负责:透视投影、转台旋转、扫描生长、局部爆炸、
+// 零件自转、实心全息面(菲涅尔)、景深衰减、两级辉光。纯 Canvas 2D,确定性(只依赖参数)。
+//
+// const model = await loadModel('models/volt.json');
+// const H = new Holo(1920, 1080);
+// const info = H.draw(ctx, model, cam, { hue: 190, scan: { y: 0.6 }, explode: { battery: 1 } });
+// info.bbox.battery -> [x0, y0, x1, y1] info.anchor.battery -> [sx, sy]
+//
+// cam = { target:[x,y,z], yaw, pitch, dist, fov(弧度), cx, cy(屏幕上 target 的位置), roll }
+
+const TAU = Math.PI * 2;
+const clamp = (x, a = 0, b = 1) => Math.max(a, Math.min(b, x));
+
+export async function loadModel(url, o = {}) {
+ const j = await (await fetch(url)).json();
+ const m = prepModel(j);
+ return o.normalize === false ? m : normalizeModel(m, o.diag);
+}
+export function prepModel(j) {
+ let ymin = 1e9, ymax = -1e9;
+ for (const P of j.parts) for (const C of P.pieces) {
+ C.v = Float32Array.from(C.v); C.e = Uint32Array.from(C.e); C.q = Uint32Array.from(C.q || []);
+ C.part = P.id; C.n = C.v.length / 3;
+ for (let i = 1; i < C.v.length; i += 3) { ymin = Math.min(ymin, C.v[i]); ymax = Math.max(ymax, C.v[i]); }
+ }
+ j.ymin = ymin; j.ymax = ymax;
+ j.byId = Object.fromEntries(j.parts.map(P => [P.id, P]));
+ return j;
+}
+
+// 归一化:把任意尺寸的模型缩放到统一的"舞台尺寸"(包围盒对角线 = diag,默认 2.3117 = demo 里的自行车),
+// x/z 居中、落地 y = 0。锚点、中心、爆炸向量、自转轴一起缩放。镜头参数因此可以跨产品复用。
+export function normalizeModel(m, diag = 2.3117) {
+ let mn = [1e9, 1e9, 1e9], mx = [-1e9, -1e9, -1e9];
+ for (const P of m.parts) for (const C of P.pieces) for (let i = 0; i < C.v.length; i += 3) for (let k = 0; k < 3; k++) { mn[k] = Math.min(mn[k], C.v[i + k]); mx[k] = Math.max(mx[k], C.v[i + k]); }
+ const s = diag / Math.hypot(mx[0] - mn[0], mx[1] - mn[1], mx[2] - mn[2]);
+ const o = [(mn[0] + mx[0]) / 2, mn[1], (mn[2] + mx[2]) / 2];
+ const T = p => [(p[0] - o[0]) * s, (p[1] - o[1]) * s, (p[2] - o[2]) * s];
+ for (const P of m.parts) {
+ P.anchor = T(P.anchor); if (P.center) P.center = T(P.center);
+ for (const C of P.pieces) {
+ for (let i = 0; i < C.v.length; i += 3) { C.v[i] = (C.v[i] - o[0]) * s; C.v[i + 1] = (C.v[i + 1] - o[1]) * s; C.v[i + 2] = (C.v[i + 2] - o[2]) * s; }
+ C.explode = C.explode.map(x => x * s);
+ if (C.axis) C.axis = { c: T(C.axis.c), d: C.axis.d };
+ }
+ }
+ m.ymin = 0; m.ymax = (mx[1] - mn[1]) * s; m.scale = s;
+ return m;
+}
+
+// 相机:返回 project(p) -> [sx, sy, z]
+export function makeCamera(cam, W, H) {
+ const { target: T, yaw, pitch, dist } = cam;
+ const cp = Math.cos(pitch), sp = Math.sin(pitch), cy = Math.cos(yaw), sy = Math.sin(yaw);
+ const eye = [T[0] + dist * sy * cp, T[1] + dist * sp, T[2] + dist * cy * cp];
+ // 前向 f = T - eye;右 r = f × up;上 u = r × f
+ let f = [T[0] - eye[0], T[1] - eye[1], T[2] - eye[2]]; const fl = Math.hypot(...f); f = f.map(x => x / fl);
+ let r = [f[1] * 0 - f[2] * 1, f[2] * 0 - f[0] * 0, f[0] * 1 - f[1] * 0]; const rl = Math.hypot(...r); r = r.map(x => x / rl);
+ const u = [r[1] * f[2] - r[2] * f[1], r[2] * f[0] - r[0] * f[2], r[0] * f[1] - r[1] * f[0]];
+ const foc = (H / 2) / Math.tan((cam.fov || 0.6) / 2);
+ const cx = cam.cx ?? W / 2, cyy = cam.cy ?? H / 2, roll = cam.roll || 0, cr = Math.cos(roll), sr = Math.sin(roll);
+ const project = (x, y, z, out) => {
+ const dx = x - eye[0], dy = y - eye[1], dz = z - eye[2];
+ const zc = dx * f[0] + dy * f[1] + dz * f[2];
+ const xc = dx * r[0] + dy * r[1] + dz * r[2], yc = dx * u[0] + dy * u[1] + dz * u[2];
+ const k = foc / Math.max(zc, 0.02);
+ const X = xc * k, Y = -yc * k;
+ out[0] = cx + X * cr - Y * sr; out[1] = cyy + X * sr + Y * cr; out[2] = zc;
+ return out;
+ };
+ return { project, eye, f, dist, foc };
+}
+
+// 主体绘制器(持有离屏层,复用)
+export class Holo {
+ constructor(W = 1920, H = 1080) {
+ this.W = W; this.H = H;
+ this.L = mk(W, H); // 线框层
+ this.G1 = mk(W / 4, H / 4); this.G2 = mk(W / 8, H / 8); // 辉光
+ this.F = mk(W, H); // 实心面层(隔行扫描纹理)
+ const pc = mk(1, 4), pg = pc.getContext('2d');
+ pg.fillStyle = 'rgba(0,0,0,1)'; pg.fillRect(0, 0, 1, 2); pg.fillStyle = 'rgba(0,0,0,0.38)'; pg.fillRect(0, 2, 1, 2);
+ this.scanPat = this.F.getContext('2d').createPattern(pc, 'repeat');
+ this.tmp = new Float32Array(3);
+ }
+ // opts:
+ // hue 主色相(0–360)
+ // spin 转台角(弧度,绕 y 轴,中心 spinC)
+ // scan { y, band=0.06, hot=1 }:只画 y 以下(世界高度),扫描前沿发白;null=全部
+ // scanDown { y }:反向——只画 y 以下(从上往下擦掉),用于收尾
+ // explode { partId | pieceId : 0–1 }
+ // angle { pieceId : 弧度 } 沿 piece.axis 自转
+ // solid 0–1 实心全息面
+ // focus partId:其余零件压暗到 dim
+ // dim 0–1(focus 之外的亮度)
+ // gain 整体亮度
+ // only [partId] 只画这些
+ // keep { pieceId: color } 唯一彩色:这些零件保持自己的颜色(hex)
+ // glow 辉光强度(默认 1)
+ // wave { y, w }:世界高度 y 附近 ±w 的边和面加亮(沿车身上行的光波)
+ // piece.hot 模型里标 hot 的 piece 爆炸时整体发白(例如电芯)
+ // flash { partId: 0–1 }:>0.5 时整个零件发白(热点打点时闪一下)
+ draw(ctx, model, cam, o = {}) {
+ const { W, H } = this, L = this.L, g = L.getContext('2d');
+ g.setTransform(1, 0, 0, 1, 0, 0); g.clearRect(0, 0, W, H);
+ const C = makeCamera(cam, W, H), P = C.project, t3 = this.tmp;
+ const hue = o.hue ?? 190, gain = o.gain ?? 1, solid = o.solid || 0;
+ const spin = o.spin || 0, cs = Math.cos(spin), sn = Math.sin(spin), sc = o.spinC || [0, 0, 0];
+ const scan = o.scan, sy = scan ? scan.y : Infinity, band = scan?.band ?? 0.06;
+ const down = o.scanDown, wave = o.wave;
+ const info = { bbox: {}, anchor: {}, project: P, cam: C, dots: 0 };
+ // 深度范围(用于雾化)
+ const dN = C.dist - 1.1, dF = C.dist + 1.1;
+ const LV = 7; // 透明度量化级数
+ const paths = [], hot = [], fills = [];
+ for (let i = 0; i < LV; i++) { paths.push(new Path2D()); hot.push(new Path2D()); fills.push(new Path2D()); }
+ const keepPaths = {};
+ const dots = new Path2D();
+ const tr = (x, y, z, out) => { // 转台
+ const dx = x - sc[0], dz = z - sc[2];
+ out[0] = sc[0] + dx * cs + dz * sn; out[1] = y; out[2] = sc[2] - dx * sn + dz * cs;
+ return out;
+ };
+ for (const Pt of model.parts) {
+ if (o.only && !o.only.includes(Pt.id)) continue;
+ const focusMul = o.focus && o.focus !== Pt.id ? (o.dim ?? 0.25) : 1;
+ let bx0 = 1e9, by0 = 1e9, bx1 = -1e9, by1 = -1e9;
+ for (const Pc of Pt.pieces) {
+ const k = o.explode ? (o.explode[Pc.id] ?? o.explode[Pt.id] ?? 0) : 0;
+ const vis = Pc.internal ? clamp(k * 3) : 1;
+ if (vis <= 0.001) continue;
+ const ang = o.angle ? (o.angle[Pc.id] || 0) : 0;
+ const ex = Pc.explode[0] * k, ey = Pc.explode[1] * k, ez = Pc.explode[2] * k;
+ const n = Pc.n, V = Pc.v;
+ const S = new Float32Array(n * 3), Y = new Float32Array(n); // 屏幕坐标 + 世界高度
+ let ca = 1, sa = 0, ax = null;
+ if (ang && Pc.axis) { ca = Math.cos(ang); sa = Math.sin(ang); ax = Pc.axis; }
+ for (let i = 0; i < n; i++) {
+ let x = V[i * 3], y = V[i * 3 + 1], z = V[i * 3 + 2];
+ if (ax) { const dx = x - ax.c[0], dy = y - ax.c[1]; x = ax.c[0] + dx * ca - dy * sa; y = ax.c[1] + dx * sa + dy * ca; } // 只支持 z 轴自转
+ x += ex; y += ey; z += ez;
+ Y[i] = y;
+ tr(x, y, z, t3); P(t3[0], t3[1], t3[2], t3);
+ S[i * 3] = t3[0]; S[i * 3 + 1] = t3[1]; S[i * 3 + 2] = t3[2];
+ if (y <= sy && !Pc.internal && Pc.box !== false) { // 目标框用静止姿态(不含爆炸位移、内部件)
+ let bx = t3[0], by = t3[1];
+ if (k) { tr(x - ex, y - ey, z - ez, t3); P(t3[0], t3[1], t3[2], t3); bx = t3[0]; by = t3[1]; }
+ if (bx < bx0) bx0 = bx; if (bx > bx1) bx1 = bx; if (by < by0) by0 = by; if (by > by1) by1 = by;
+ }
+ }
+ const keep = o.keep && o.keep[Pc.id];
+ let kp = null; if (keep) kp = keepPaths[keep] || (keepPaths[keep] = { p: new Path2D(), f: new Path2D() });
+ const E = Pc.e, mulA = focusMul * vis * gain;
+ for (let j = 0; j < E.length; j += 2) {
+ const a = E[j], b = E[j + 1];
+ let ya = Y[a], yb = Y[b];
+ let x0 = S[a * 3], y0 = S[a * 3 + 1], x1 = S[b * 3], y1 = S[b * 3 + 1];
+ const zm = (S[a * 3 + 2] + S[b * 3 + 2]) / 2;
+ if (scan) {
+ if (ya > sy && yb > sy) continue;
+ if (ya > sy || yb > sy) { // 剪到扫描面
+ const tcut = (sy - ya) / (yb - ya);
+ const xi = x0 + (x1 - x0) * tcut, yi = y0 + (y1 - y0) * tcut;
+ if (ya > sy) { x0 = xi; y0 = yi; ya = sy; } else { x1 = xi; y1 = yi; yb = sy; }
+ dots.rect(xi - 1.5, yi - 1.5, 3, 3); info.dots++;
+ }
+ }
+ if (down) { // 反向擦除:只留 y 以下,截断处打点
+ if (ya > down.y && yb > down.y) continue;
+ if (ya > down.y || yb > down.y) {
+ const tcut = (down.y - ya) / (yb - ya);
+ const xi = x0 + (x1 - x0) * tcut, yi = y0 + (y1 - y0) * tcut;
+ if (ya > down.y) { x0 = xi; y0 = yi; ya = down.y; } else { x1 = xi; y1 = yi; yb = down.y; }
+ dots.rect(xi - 1.5, yi - 1.5, 3, 3);
+ }
+ }
+ const fog = clamp(1 - (zm - dN) / (dF - dN) * 0.75, 0.22, 1);
+ const lv = Math.min(LV - 1, Math.floor(fog * mulA * LV));
+ if (lv < 0 || fog * mulA < 0.03) continue;
+ const ymid = (ya + yb) / 2;
+ const isHot = (scan && Math.max(ya, yb) > sy - band) || (down && Math.max(ya, yb) > down.y - 0.05) || (Pc.hot && k > 0.02) || (wave && Math.abs(ymid - wave.y) < wave.w) || (o.flash && o.flash[Pt.id] > 0.5);
+ const target = kp ? kp.p : (isHot ? hot[lv] : paths[lv]);
+ target.moveTo(x0, y0); target.lineTo(x1, y1);
+ }
+ if (solid > 0) {
+ const Q = Pc.q;
+ for (let j = 0; j < Q.length; j += 4) {
+ const a = Q[j], b = Q[j + 1], c = Q[j + 2], d = Q[j + 3];
+ if (scan && Math.max(Y[a], Y[b], Y[c], Y[d]) > sy) continue;
+ if (down && Math.max(Y[a], Y[b], Y[c], Y[d]) > down.y) continue;
+ // 屏幕空间面积法线近似菲涅尔:面越侧(投影越窄)越亮
+ const ax_ = S[a * 3], ay_ = S[a * 3 + 1], bx_ = S[b * 3], by_ = S[b * 3 + 1], cx_ = S[c * 3], cy_ = S[c * 3 + 1], dx_ = S[d * 3], dy_ = S[d * 3 + 1];
+ const area = Math.abs((cx_ - ax_) * (dy_ - by_) - (dx_ - bx_) * (cy_ - ay_)) / 2;
+ const e1 = Math.hypot(bx_ - ax_, by_ - ay_), e2 = Math.hypot(dx_ - ax_, dy_ - ay_);
+ const facing = clamp(area / Math.max(1e-3, e1 * e2)); // 1 = 正对,0 = 侧面
+ let fr = 0.3 + 0.7 * Math.pow(1 - facing, 1.6); // 菲涅尔:侧面(轮廓)更亮
+ if (wave) { const ym = (Y[a] + Y[c]) / 2, dw = Math.abs(ym - wave.y); if (dw < wave.w * 2) fr += (1 - dw / (wave.w * 2)) * 0.9; }
+ const lv = Math.min(LV - 1, Math.floor(fr * solid * focusMul * vis * gain * LV));
+ if (lv < 1) continue;
+ const T = kp ? kp.f : fills[lv];
+ T.moveTo(ax_, ay_); T.lineTo(bx_, by_); T.lineTo(cx_, cy_); T.lineTo(dx_, dy_); T.closePath();
+ }
+ }
+ }
+ if (bx1 > bx0) info.bbox[Pt.id] = [bx0, by0, bx1, by1];
+ const an = Pt.anchor; tr(an[0], an[1], an[2], t3); P(t3[0], t3[1], t3[2], t3); info.anchor[Pt.id] = [t3[0], t3[1], t3[2]];
+ }
+ // 画:面 → 线 → 热线 → 交点
+ g.globalCompositeOperation = 'lighter';
+ g.lineCap = 'round';
+ if (solid > 0) {
+ const F = this.F, f = F.getContext('2d');
+ f.globalCompositeOperation = 'source-over'; f.clearRect(0, 0, W, H);
+ f.globalCompositeOperation = 'lighter';
+ for (let i = 1; i < LV; i++) { f.fillStyle = `hsla(${hue},90%,${55 + i * 5}%,${0.1 + (i / LV) * 0.6})`; f.fill(fills[i]); }
+ f.globalCompositeOperation = 'destination-in'; f.setTransform(1, 0, 0, 1, 0, (o.scanOffset || 0) % 4); f.fillStyle = this.scanPat; f.fillRect(0, -8, W, H + 16); f.setTransform(1, 0, 0, 1, 0, 0);
+ f.globalCompositeOperation = 'source-over';
+ g.drawImage(F, 0, 0);
+ }
+ const lw = o.lineWidth || 1.35;
+ for (let i = 0; i < LV; i++) {
+ const a = (i + 1) / LV;
+ g.strokeStyle = `hsla(${hue},100%,${50 + a * 30}%,${0.06 + a * 0.84})`; g.lineWidth = lw * (0.7 + a * 0.5);
+ g.stroke(paths[i]);
+ }
+ for (let i = 0; i < LV; i++) { const a = (i + 1) / LV; g.strokeStyle = `hsla(${hue},70%,92%,${0.35 + a * 0.65})`; g.lineWidth = lw * 1.3; g.stroke(hot[i]); }
+ for (const col in keepPaths) { g.fillStyle = col + '30'; g.fill(keepPaths[col].f); g.strokeStyle = col; g.lineWidth = lw * 1.2; g.stroke(keepPaths[col].p); }
+ if ((scan && sy < 1e8) || down) { g.fillStyle = `hsla(${hue},60%,96%,1)`; g.fill(dots); }
+ g.globalCompositeOperation = 'source-over';
+ this.composite(ctx, o.glow ?? 1, o.alpha ?? 1);
+ return info;
+ }
+ // 把线框层 + 两级辉光叠到目标画布
+ composite(ctx, glow = 1, alpha = 1) {
+ const { L, G1, G2, W, H } = this;
+ const g1 = G1.getContext('2d'), g2 = G2.getContext('2d');
+ g1.clearRect(0, 0, G1.width, G1.height); g1.filter = 'blur(3px)'; g1.drawImage(L, 0, 0, G1.width, G1.height); g1.filter = 'none';
+ g2.clearRect(0, 0, G2.width, G2.height); g2.filter = 'blur(4px)'; g2.drawImage(L, 0, 0, G2.width, G2.height); g2.filter = 'none';
+ ctx.save(); ctx.globalCompositeOperation = 'lighter';
+ ctx.globalAlpha = 0.85 * glow * alpha; ctx.drawImage(G1, 0, 0, W, H);
+ ctx.globalAlpha = 0.7 * glow * alpha; ctx.drawImage(G2, 0, 0, W, H);
+ ctx.globalAlpha = alpha; ctx.drawImage(L, 0, 0);
+ ctx.restore();
+ }
+}
+
+// 扫描面:在世界高度 y 处画一圈投影环 + 径向刻度 + 屏幕上的光幕
+export function drawScanPlane(ctx, cam, W, H, y, o = {}) {
+ const C = makeCamera(cam, W, H), P = C.project, t = new Float32Array(3);
+ const hue = o.hue ?? 190, R = o.r ?? 0.95, c = o.c || [0, 0, 0], a = o.alpha ?? 1;
+ const pts = [];
+ for (let i = 0; i <= 96; i++) { const th = i / 96 * TAU; P(c[0] + Math.cos(th) * R, y, c[2] + Math.sin(th) * R, t); pts.push([t[0], t[1]]); }
+ ctx.save(); ctx.globalCompositeOperation = 'lighter';
+ // 光幕:椭圆内填充
+ ctx.beginPath(); pts.forEach((p, i) => i ? ctx.lineTo(p[0], p[1]) : ctx.moveTo(p[0], p[1])); ctx.closePath();
+ ctx.fillStyle = `hsla(${hue},90%,60%,${0.07 * a})`; ctx.fill();
+ ctx.strokeStyle = `hsla(${hue},80%,85%,${0.75 * a})`; ctx.lineWidth = 1.6; ctx.stroke();
+ // 刻度
+ ctx.beginPath();
+ for (let i = 0; i < 72; i++) {
+ const th = i / 72 * TAU + (o.rot || 0), r2 = R * (i % 6 ? 1.03 : 1.07);
+ P(c[0] + Math.cos(th) * R, y, c[2] + Math.sin(th) * R, t); ctx.moveTo(t[0], t[1]);
+ P(c[0] + Math.cos(th) * r2, y, c[2] + Math.sin(th) * r2, t); ctx.lineTo(t[0], t[1]);
+ }
+ ctx.strokeStyle = `hsla(${hue},80%,80%,${0.5 * a})`; ctx.lineWidth = 1; ctx.stroke();
+ // 屏幕空间光幕(横向渐隐)
+ P(c[0], y, c[2], t); const yy = t[1];
+ const gr = ctx.createLinearGradient(0, yy - 60, 0, yy + 60);
+ gr.addColorStop(0, `hsla(${hue},90%,60%,0)`); gr.addColorStop(0.5, `hsla(${hue},90%,70%,${0.10 * a})`); gr.addColorStop(1, `hsla(${hue},90%,60%,0)`);
+ ctx.fillStyle = gr; ctx.fillRect(0, yy - 60, W, 120);
+ const gl = ctx.createLinearGradient(0, 0, W, 0);
+ gl.addColorStop(0, `hsla(${hue},90%,80%,0)`); gl.addColorStop(0.5, `hsla(${hue},90%,85%,${0.55 * a})`); gl.addColorStop(1, `hsla(${hue},90%,80%,0)`);
+ ctx.fillStyle = gl; ctx.fillRect(0, yy - 0.75, W, 1.5);
+ ctx.restore();
+}
+
+// 投影台:地面上的同心环 + 刻度 + 放射网格(跟着相机透视)
+export function drawPad(ctx, cam, W, H, o = {}) {
+ const C = makeCamera(cam, W, H), P = C.project, t = new Float32Array(3);
+ const hue = o.hue ?? 190, a = o.alpha ?? 1, rot = o.rot || 0, y = o.y ?? 0, c = o.c || [0, 0, 0];
+ ctx.save(); ctx.globalCompositeOperation = 'lighter';
+ const ring = (R, al, w = 1, dash = 0) => {
+ ctx.beginPath();
+ for (let i = 0; i <= 128; i++) { const th = i / 128 * TAU; P(c[0] + Math.cos(th) * R, y, c[2] + Math.sin(th) * R, t); i ? ctx.lineTo(t[0], t[1]) : ctx.moveTo(t[0], t[1]); }
+ ctx.setLineDash(dash ? [dash, dash * 1.6] : []);
+ ctx.strokeStyle = `hsla(${hue},80%,70%,${al * a})`; ctx.lineWidth = w; ctx.stroke();
+ };
+ ring(1.05, 0.55, 1.4); ring(1.12, 0.3, 1, 6); ring(0.7, 0.18, 1); ring(1.45, 0.14, 1); ring(2.1, 0.07, 1);
+ ctx.setLineDash([]);
+ ctx.beginPath();
+ for (let i = 0; i < 120; i++) {
+ const th = i / 120 * TAU + rot, big = i % 10 === 0, r0 = 1.05, r1 = big ? 1.2 : 1.1;
+ P(c[0] + Math.cos(th) * r0, y, c[2] + Math.sin(th) * r0, t); ctx.moveTo(t[0], t[1]);
+ P(c[0] + Math.cos(th) * r1, y, c[2] + Math.sin(th) * r1, t); ctx.lineTo(t[0], t[1]);
+ }
+ ctx.strokeStyle = `hsla(${hue},80%,78%,${0.5 * a})`; ctx.lineWidth = 1; ctx.stroke();
+ // 放射线 + 地面网格(距离渐隐)
+ for (let i = 0; i < 24; i++) {
+ const th = i / 24 * TAU + rot * 0.25;
+ ctx.beginPath();
+ P(c[0] + Math.cos(th) * 1.2, y, c[2] + Math.sin(th) * 1.2, t); ctx.moveTo(t[0], t[1]);
+ P(c[0] + Math.cos(th) * 2.4, y, c[2] + Math.sin(th) * 2.4, t); ctx.lineTo(t[0], t[1]);
+ ctx.strokeStyle = `hsla(${hue},70%,60%,${0.08 * a})`; ctx.stroke();
+ }
+ ctx.restore();
+}
+
+function mk(w, h) { const c = document.createElement('canvas'); c.width = Math.round(w); c.height = Math.round(h); return c; }
+
+// 任意形状 → 线框模型:给一条 2D 闭合路径(米),挤出成有厚度的线框体(前后轮廓 + 侧棱 + 侧面四边面 + 若干中间截面)。
+// 例:modelFromPath(starPts, { depth: 0.12, id: 'star', slices: 3 }) → 可直接交给 Holo.draw(可扫描、可爆炸、可实心)
+export function modelFromPath(pts, o = {}) {
+ const d = o.depth ?? 0.1, id = o.id || 'shape', sl = Math.max(2, o.slices ?? 3), n = pts.length;
+ const v = [], e = [], q = [];
+ for (let k = 0; k < sl; k++) {
+ const z = -d / 2 + d * k / (sl - 1);
+ for (const [x, y] of pts) v.push(x, y, z);
+ for (let i = 0; i < n; i++) e.push(k * n + i, k * n + (i + 1) % n);
+ }
+ for (let k = 0; k < sl - 1; k++) for (let i = 0; i < n; i++) {
+ if (k === 0 || i % (o.ribEvery || 1) === 0) e.push(k * n + i, (k + 1) * n + i);
+ q.push(k * n + i, k * n + (i + 1) % n, (k + 1) * n + (i + 1) % n, (k + 1) * n + i);
+ }
+ const cx = pts.reduce((s, p) => s + p[0], 0) / n, cy = pts.reduce((s, p) => s + p[1], 0) / n;
+ return prepModel({ name: id, parts: [{ id, anchor: [cx, cy, d / 2], pieces: [{ id, explode: o.explode || [0, 0, 0], v, e, q }] }] });
+}
diff --git a/styles/hologram-hud/demo/engine/hud.js b/styles/hologram-hud/demo/engine/hud.js
new file mode 100644
index 0000000..75db7c2
--- /dev/null
+++ b/styles/hologram-hud/demo/engine/hud.js
@@ -0,0 +1,406 @@
+// hologram-hud · 界面层:目标框、引线标注、滚动数字、面板、画框、字幕、背景网格、故障闪烁
+// 全部是 Canvas 2D 函数,参数化,确定性。颜色从 theme(hue, accent) 取。
+const TAU = Math.PI * 2;
+export const clamp = (x, a = 0, b = 1) => Math.max(a, Math.min(b, x));
+const lerp = (a, b, t) => a + (b - a) * t;
+const eo = t => 1 - Math.pow(1 - clamp(t), 3);
+const hash = n => { n = Math.sin(n * 127.1 + 311.7) * 43758.5453; return n - Math.floor(n); };
+
+export const FONT = { ui: 'Rajdhani', mono: 'ShareTechMono' };
+
+export function theme(hue = 190, accent = 38) {
+ return {
+ hue, accentHue: accent,
+ line: a => `hsla(${hue},100%,72%,${a})`,
+ hi: a => `hsla(${hue},60%,93%,${a})`,
+ dim: a => `hsla(${hue},70%,52%,${a})`,
+ acc: a => `hsla(${accent},100%,64%,${a})`,
+ bg0: `hsl(${hue + 12},70%,2.4%)`, bg1: `hsl(${hue + 6},65%,7%)`,
+ };
+}
+
+// ---------- 背景:暗场 + 中心微光 + 远景点阵(视差) ----------
+export function background(ctx, W, H, T, o = {}) {
+ ctx.fillStyle = T.bg0; ctx.fillRect(0, 0, W, H);
+ const cx = o.cx ?? W * 0.5, cy = o.cy ?? H * 0.55;
+ const g = ctx.createRadialGradient(cx, cy, 0, cx, cy, W * 0.62);
+ g.addColorStop(0, T.bg1); g.addColorStop(1, 'rgba(0,0,0,0)');
+ ctx.fillStyle = g; ctx.fillRect(0, 0, W, H);
+ // 点阵
+ const px = o.px || 0, py = o.py || 0, step = 48, a = o.alpha ?? 1;
+ ctx.fillStyle = T.dim(0.16 * a);
+ const ox = ((px % step) + step) % step, oy = ((py % step) + step) % step;
+ for (let y = -step + oy; y < H + step; y += step) for (let x = -step + ox; x < W + step; x += step) {
+ const d = Math.hypot(x - cx, y - cy) / (W * 0.6);
+ if (d > 1) continue;
+ const s = (1 - d) * 1.6 + 0.4;
+ ctx.fillRect(x - s / 2, y - s / 2, s, s);
+ }
+}
+
+// 暗角
+export function vignette(ctx, W, H, k = 0.6) {
+ const g = ctx.createRadialGradient(W / 2, H / 2, H * 0.35, W / 2, H / 2, W * 0.72);
+ g.addColorStop(0, 'rgba(0,0,0,0)'); g.addColorStop(1, `rgba(0,0,0,${k})`);
+ ctx.fillStyle = g; ctx.fillRect(0, 0, W, H);
+}
+
+// ---------- 底板:深色半透明(~70%)+ 细边框 + 四角短刻,让文字永远不和线框互相干扰 ----------
+export function plate(ctx, T, x, y, w, h, a = 1, o = {}) {
+ if (a <= 0 || w <= 0 || h <= 0) return;
+ ctx.save(); ctx.globalCompositeOperation = 'source-over';
+ ctx.fillStyle = `rgba(1,8,12,${(o.op ?? 0.72) * a})`; ctx.fillRect(x, y, w, h);
+ ctx.globalCompositeOperation = 'lighter';
+ ctx.strokeStyle = T.line(0.28 * a); ctx.lineWidth = 1; ctx.strokeRect(x + .5, y + .5, w - 1, h - 1);
+ ctx.strokeStyle = T.line(0.7 * a); ctx.lineWidth = 1.4; corners(ctx, x, y, x + w, y + h, 10);
+ ctx.restore();
+}
+
+// ---------- 取景框:四角 + 边缘刻度 + 顶部状态 ----------
+export function chrome(ctx, W, H, T, o = {}) {
+ const a = o.alpha ?? 1, m = 44, L = 46, px = o.px || 0;
+ ctx.save(); ctx.globalCompositeOperation = 'lighter';
+ ctx.strokeStyle = T.line(0.55 * a); ctx.lineWidth = 1.5;
+ corners(ctx, m, m, W - m, H - m, L);
+ // 左右刻度尺(前景视差)
+ ctx.strokeStyle = T.dim(0.45 * a); ctx.lineWidth = 1;
+ ctx.beginPath();
+ const off = ((px * 1.4) % 24 + 24) % 24;
+ for (let y = 160 + off; y < H - 160; y += 24) {
+ const big = Math.round((y - off) / 24) % 5 === 0;
+ ctx.moveTo(m + 8, y); ctx.lineTo(m + 8 + (big ? 14 : 7), y);
+ ctx.moveTo(W - m - 8, y); ctx.lineTo(W - m - 8 - (big ? 14 : 7), y);
+ }
+ ctx.stroke();
+ // 顶部状态
+ ctx.font = `20px ${FONT.mono}`; ctx.textBaseline = 'middle';
+ ctx.fillStyle = T.line(0.75 * a);
+ if (o.tl) { ctx.textAlign = 'left'; ctx.fillText(o.tl, m + 22, m + 26); }
+ if (o.tr) { ctx.textAlign = 'right'; ctx.fillText(o.tr, W - m - 22, m + 26); }
+ if (o.bl) { ctx.textAlign = 'left'; ctx.fillStyle = T.dim(0.7 * a); ctx.fillText(o.bl, m + 22, H - m - 22); }
+ if (o.br) { ctx.textAlign = 'right'; ctx.fillStyle = T.dim(0.7 * a); ctx.fillText(o.br, W - m - 22, H - m - 22); }
+ ctx.restore();
+}
+
+export function corners(ctx, x0, y0, x1, y1, L) {
+ ctx.beginPath();
+ ctx.moveTo(x0, y0 + L); ctx.lineTo(x0, y0); ctx.lineTo(x0 + L, y0);
+ ctx.moveTo(x1 - L, y0); ctx.lineTo(x1, y0); ctx.lineTo(x1, y0 + L);
+ ctx.moveTo(x1, y1 - L); ctx.lineTo(x1, y1); ctx.lineTo(x1 - L, y1);
+ ctx.moveTo(x0 + L, y1); ctx.lineTo(x0, y1); ctx.lineTo(x0, y1 - L);
+ ctx.stroke();
+}
+
+// ---------- 目标框:k=0 大而斜、k=1 锁定贴合;flash 为锁定瞬间闪白 ----------
+export function targetBox(ctx, T, bb, k, o = {}) {
+ if (!bb || k <= 0) return;
+ const pad = o.pad ?? 26;
+ let [x0, y0, x1, y1] = bb; x0 -= pad; y0 -= pad; x1 += pad; y1 += pad;
+ const cx = (x0 + x1) / 2, cy = (y0 + y1) / 2;
+ const e = o.lockK ?? eo(k);
+ const s = lerp(1.9, 1, e), rot = lerp(Math.PI / 4, 0, e);
+ const hw = (x1 - x0) / 2 * s, hh = (y1 - y0) / 2 * s;
+ const a = (o.alpha ?? 1) * clamp(k * 4);
+ ctx.save(); ctx.translate(cx, cy); ctx.rotate(rot); ctx.globalCompositeOperation = 'lighter';
+ const L = Math.min(hw, hh) * 0.38 + 8;
+ ctx.strokeStyle = o.flash ? T.hi(a) : T.line(0.9 * a); ctx.lineWidth = o.flash ? 3 : 2;
+ corners(ctx, -hw, -hh, hw, hh, L);
+ // 中心十字 + 边中点刻度
+ ctx.lineWidth = 1; ctx.strokeStyle = T.line(0.5 * a);
+ ctx.beginPath();
+ ctx.moveTo(-10, 0); ctx.lineTo(10, 0); ctx.moveTo(0, -10); ctx.lineTo(0, 10);
+ ctx.moveTo(-hw, 0); ctx.lineTo(-hw + 10, 0); ctx.moveTo(hw, 0); ctx.lineTo(hw - 10, 0);
+ ctx.moveTo(0, -hh); ctx.lineTo(0, -hh + 10); ctx.moveTo(0, hh); ctx.lineTo(0, hh - 10);
+ ctx.stroke();
+ ctx.restore();
+ // 标签(锁定后出现)
+ if (o.tag && e > 0.8) {
+ const ta = a * clamp((e - 0.8) * 5);
+ ctx.save(); ctx.globalCompositeOperation = 'lighter';
+ ctx.font = `600 19px ${FONT.ui}`; ctx.textBaseline = 'bottom'; ctx.textAlign = 'left';
+ const tx = cx - hw, ty = cy - hh - 8;
+ const w = ctx.measureText(o.tag).width + 20;
+ ctx.fillStyle = o.flash ? T.hi(0.95 * ta) : T.line(0.9 * ta);
+ ctx.fillRect(tx, ty - 26, w, 26);
+ ctx.globalCompositeOperation = 'source-over';
+ ctx.fillStyle = T.bg0; ctx.fillText(o.tag, tx + 10, ty - 3);
+ ctx.restore();
+ }
+}
+
+// ---------- 引线:锚点圆 → 斜线 → 水平线;prog 0–1 逐段画出 ----------
+export function leader(ctx, T, from, elbow, to, prog, o = {}) {
+ if (prog <= 0) return;
+ const a = o.alpha ?? 1;
+ const d1 = Math.hypot(elbow[0] - from[0], elbow[1] - from[1]), d2 = Math.hypot(to[0] - elbow[0], to[1] - elbow[1]);
+ let L = (d1 + d2) * clamp(prog);
+ ctx.save(); ctx.globalCompositeOperation = 'lighter';
+ ctx.strokeStyle = T.line(0.85 * a); ctx.lineWidth = 1.6;
+ ctx.beginPath(); ctx.moveTo(from[0], from[1]);
+ if (L <= d1) ctx.lineTo(lerp(from[0], elbow[0], L / d1), lerp(from[1], elbow[1], L / d1));
+ else { ctx.lineTo(elbow[0], elbow[1]); L -= d1; ctx.lineTo(lerp(elbow[0], to[0], L / d2), lerp(elbow[1], to[1], L / d2)); }
+ ctx.stroke();
+ // 锚点
+ const ra = clamp(prog * 5);
+ ctx.beginPath(); ctx.arc(from[0], from[1], 9 * ra, 0, TAU); ctx.stroke();
+ ctx.fillStyle = T.hi(a); ctx.beginPath(); ctx.arc(from[0], from[1], 3, 0, TAU); ctx.fill();
+ if (o.pulse) { ctx.strokeStyle = T.line(a * (1 - o.pulse)); ctx.beginPath(); ctx.arc(from[0], from[1], 9 + 26 * o.pulse, 0, TAU); ctx.stroke(); }
+ ctx.restore();
+}
+
+// ---------- 滚动数字:从乱码滚到真值 ----------
+// k 0–1:各字符从右往左依次锁定;frame 决定乱码帧(24fps 每帧换一次)
+const GLY_D = '0123456789', GLY_A = 'ABCDEFGHJKLMNPRSTUVWXYZ#%/<>=';
+export function rollText(str, k, frame, seed = 0) {
+ if (k >= 1) return str;
+ const n = str.length; let out = '';
+ for (let i = 0; i < n; i++) {
+ const ch = str[i];
+ const order = (n - 1 - i) / Math.max(1, n); // 右边先锁
+ const lockAt = 0.25 + order * 0.7;
+ if (k >= lockAt || ch === ' ' || ch === '.' || ch === ',' || ch === '·') { out += ch; continue; }
+ if (k <= 0) { out += ' '; continue; }
+ const set = /\d/.test(ch) ? GLY_D : GLY_A;
+ out += set[Math.floor(hash(frame * 13.7 + i * 7.1 + seed) * set.length)];
+ }
+ return out;
+}
+
+// 等宽排版(按最宽数字定字距,滚动时不抖)
+export function monoText(ctx, s, x, y, adv) {
+ let cx = x;
+ for (let i = 0; i < s.length; i++) {
+ const ch = s[i], w = ctx.measureText(ch).width;
+ const narrow = ch === '.' || ch === ',' || ch === ' ' || ch === ':';
+ const a = narrow ? w * 1.1 : adv;
+ if (ch === '.') { // 小数点画成方点(细字重的句点在辉光下像逗号)
+ const m = ctx.measureText('0'), d = Math.max(3, m.width * 0.13);
+ ctx.fillRect(cx + (a - d) / 2, y - d, d, d);
+ } else ctx.fillText(ch, cx + (a - w) / 2, y);
+ cx += a;
+ }
+ return cx - x;
+}
+
+// 文字适配:超宽时缩字号
+export function fitFont(ctx, text, weight, size, family, maxW, minSize = 12) { // 注意:先设好 letterSpacing 再调用
+ let s = size; ctx.font = `${weight} ${s}px ${family}`;
+ while (ctx.measureText(text).width > maxW && s > minSize) { s -= 1; ctx.font = `${weight} ${s}px ${family}`; }
+ return s;
+}
+
+// 自动换行
+export function wrap(ctx, text, maxW) {
+ const words = text.split(' '), lines = []; let cur = '';
+ for (const w of words) { const t = cur ? cur + ' ' + w : w; if (ctx.measureText(t).width > maxW && cur) { lines.push(cur); cur = w; } else cur = t; }
+ if (cur) lines.push(cur);
+ return lines;
+}
+
+// ---------- 参数卡:序号 / 名称 / 大数值 + 单位 / 细节 ----------
+// st: { reveal 0–1(框体), roll 0–1(数值), detail 0–1, frame, flash }
+export function specCard(ctx, T, x, y, c, st, o = {}) {
+ const w = o.w ?? 460, a = o.alpha ?? 1, big = o.big ?? 132;
+ if (st.reveal <= 0) return { w, h: 0 };
+ const r = eo(st.reveal);
+ { // 底板:按最终高度一次画好(跟随展开)
+ ctx.save(); ctx.font = `500 25px ${FONT.ui}`;
+ const dl = c.detail ? wrap(ctx, c.detail, w).length : 0; ctx.restore();
+ const hh = 48 + big * 0.9 + 12 + (dl ? 36 + dl * 30 : 0) + 20;
+ plate(ctx, T, x - 22, y - 20, (w + 44) * r, hh + 20, a * clamp(st.reveal * 2));
+ }
+ ctx.save(); ctx.globalCompositeOperation = 'lighter';
+ // 顶线从左往右展开
+ ctx.strokeStyle = T.line(0.9 * a); ctx.lineWidth = 1.6;
+ ctx.beginPath(); ctx.moveTo(x, y); ctx.lineTo(x + w * r, y); ctx.stroke();
+ ctx.fillStyle = T.line(0.9 * a); ctx.fillRect(x, y - 3, 34 * r, 6);
+ // 序号 + 名称
+ ctx.textBaseline = 'alphabetic'; ctx.textAlign = 'left';
+ ctx.font = `20px ${FONT.mono}`; ctx.fillStyle = T.dim(0.95 * a * r);
+ ctx.fillText(o.index || '', x, y + 34);
+ const lab = (c.label || '').toUpperCase();
+ fitFont(ctx, lab, 600, 30, FONT.ui, w - 60, 18);
+ ctx.fillStyle = T.hi(0.95 * a * clamp(r * 2 - 0.6));
+ ctx.letterSpacing = '3px';
+ ctx.fillText(rollText(lab, clamp(st.reveal * 1.6 - 0.2), st.frame, 3), x + 52, y + 36);
+ ctx.letterSpacing = '0px';
+ // 大数值
+ let h = 48;
+ if (st.roll > 0) {
+ const val = String(c.value), unit = c.unit || '';
+ const bs = fitFont(ctx, val, 300, big, FONT.ui, w - 110, 60);
+ const adv = ctx.measureText('0').width * 1.02;
+ const locked = st.roll >= 1;
+ const col = locked ? (st.flash ? T.hi(a) : T.acc(a)) : T.line(0.85 * a);
+ ctx.fillStyle = col;
+ const s = rollText(val, st.roll, st.frame, 11);
+ const vw = monoText(ctx, s, x - 4, y + 48 + bs * 0.78, adv);
+ ctx.font = `500 ${Math.round(bs * 0.3)}px ${FONT.ui}`; ctx.fillStyle = locked ? T.acc(0.9 * a) : T.line(0.6 * a);
+ ctx.fillText(unit, x + vw + 10, y + 48 + bs * 0.78);
+ h = 48 + bs * 0.9;
+ // 进度条(数值滚动时满格)
+ ctx.fillStyle = T.dim(0.35 * a); ctx.fillRect(x, y + h + 8, w, 2);
+ ctx.fillStyle = locked ? T.acc(0.9 * a) : T.line(0.9 * a); ctx.fillRect(x, y + h + 8, w * clamp(st.roll), 2);
+ h += 12;
+ }
+ if (c.detail && st.detail > 0) {
+ ctx.font = `500 25px ${FONT.ui}`; ctx.fillStyle = T.line(0.8 * a * clamp(st.detail * 2));
+ const lines = wrap(ctx, c.detail, w);
+ lines.forEach((ln, i) => ctx.fillText(rollText(ln, clamp(st.detail * 1.5 - i * 0.2), st.frame, 21 + i), x, y + h + 36 + i * 30));
+ h += 36 + lines.length * 30;
+ }
+ ctx.restore();
+ return { w, h };
+}
+
+// ---------- 参数芯片:停靠在侧栏、一直留到落版(名称 + 数值 + 细节) ----------
+export function chip(ctx, T, x, y, c, a = 1, o = {}) {
+ if (a <= 0) return 0;
+ const w = o.w ?? 360;
+ plate(ctx, T, x - 16, y - 16, w + 32, (c.detail ? 72 : 44) + 28, a);
+ ctx.save(); ctx.globalCompositeOperation = 'lighter';
+ ctx.strokeStyle = T.line(0.5 * a); ctx.lineWidth = 1;
+ ctx.beginPath(); ctx.moveTo(x, y); ctx.lineTo(x + w, y); ctx.stroke();
+ ctx.fillStyle = T.line(0.9 * a); ctx.fillRect(x, y - 2, 14, 4);
+ ctx.textBaseline = 'alphabetic'; ctx.textAlign = 'left';
+ ctx.font = `18px ${FONT.mono}`; ctx.fillStyle = T.dim(0.9 * a); ctx.fillText(o.index || '', x, y + 30);
+ const lab = (c.label || '').toUpperCase();
+ ctx.letterSpacing = '2px'; fitFont(ctx, lab, 600, 21, FONT.ui, w - 170, 13);
+ ctx.fillStyle = T.line(0.95 * a); ctx.fillText(lab, x + 40, y + 30); ctx.letterSpacing = '0px';
+ ctx.textAlign = 'right';
+ const u = c.unit || '';
+ ctx.font = `500 18px ${FONT.ui}`; const uw = ctx.measureText(u).width;
+ ctx.fillStyle = T.acc(0.95 * a); ctx.fillText(u, x + w, y + 32);
+ ctx.font = `400 42px ${FONT.ui}`; ctx.textAlign = 'left';
+ const vw = ctx.measureText(String(c.value)).width;
+ monoTextFit(ctx, String(c.value), x + w - uw - 6 - vw, y + 34);
+ let h = 44;
+ if (c.detail) {
+ ctx.textAlign = 'left';
+ fitFont(ctx, c.detail, 500, 20, FONT.ui, w - 40, 13);
+ ctx.fillStyle = T.line(0.72 * a); ctx.fillText(c.detail, x + 40, y + 62); h = 72;
+ }
+ ctx.restore();
+ return h;
+}
+function monoTextFit(ctx, s, x, y) { // 普通排版,但小数点画成方点
+ let cx = x;
+ for (const ch of s) {
+ const w = ctx.measureText(ch).width;
+ if (ch === '.') { const d = Math.max(3, ctx.measureText('0').width * 0.13); ctx.fillRect(cx + (w - d) / 2, y - d, d, d); }
+ else ctx.fillText(ch, cx, y);
+ cx += w;
+ }
+}
+
+// ---------- 字幕:界面里的"语音转写"条 ----------
+export function subtitle(ctx, W, H, T, text, a, o = {}) {
+ if (!text || a <= 0) return;
+ ctx.save();
+ const y = o.y ?? H - 118, maxW = o.maxW ?? 1180;
+ ctx.font = `500 38px ${FONT.ui}`;
+ const lines = wrap(ctx, text, maxW);
+ const tw = Math.max(...lines.map(l => ctx.measureText(l).width));
+ const x = (o.x ?? W / 2) - tw / 2, lh = 46, h = lines.length * lh;
+ // 底板
+ ctx.fillStyle = `rgba(1,8,12,${0.62 * a})`;
+ ctx.fillRect(x - 58, y - h - 18, tw + 86, h + 30);
+ ctx.globalCompositeOperation = 'lighter';
+ ctx.strokeStyle = T.line(0.55 * a); ctx.lineWidth = 1.2;
+ ctx.beginPath();
+ ctx.moveTo(x - 58, y - h - 18 + 12); ctx.lineTo(x - 58, y - h - 18); ctx.lineTo(x - 46, y - h - 18);
+ ctx.moveTo(x + tw + 28 - 12, y + 12); ctx.lineTo(x + tw + 28, y + 12); ctx.lineTo(x + tw + 28, y);
+ ctx.stroke();
+ // 声纹指示
+ ctx.fillStyle = T.line(0.9 * a);
+ for (let i = 0; i < 4; i++) { const hh = 6 + 14 * Math.abs(Math.sin((o.t || 0) * 9 + i * 1.7)); ctx.fillRect(x - 42 + i * 7, y - h / 2 - 3 - hh / 2, 3, hh); }
+ ctx.fillStyle = T.hi(0.96 * a); ctx.textAlign = 'left'; ctx.textBaseline = 'alphabetic';
+ lines.forEach((l, i) => ctx.fillText(l, x, y - h + (i + 1) * lh - 10));
+ ctx.restore();
+}
+
+// ---------- 故障闪烁:横向切片错位 + 色偏(克制,只在一两帧) ----------
+export function glitch(ctx, W, H, amt, seed) {
+ if (amt <= 0) return;
+ const src = ctx.canvas;
+ const tmp = glitch.tmp || (glitch.tmp = Object.assign(document.createElement('canvas'), { width: W, height: H }));
+ const g = tmp.getContext('2d'); g.clearRect(0, 0, W, H); g.drawImage(src, 0, 0);
+ const n = 9;
+ for (let i = 0; i < n; i++) {
+ const y = Math.floor(hash(seed + i * 3.1) * H), h = 6 + Math.floor(hash(seed + i * 5.7) * 60), dx = (hash(seed + i * 9.3) - 0.5) * 120 * amt;
+ ctx.drawImage(tmp, 0, y, W, h, dx, y, W, h);
+ }
+ ctx.save(); ctx.globalCompositeOperation = 'lighter'; ctx.globalAlpha = 0.35 * amt;
+ ctx.drawImage(tmp, 8 * amt, 0); ctx.restore();
+}
+
+// ---------- 热点标记:钉在零件本体上的编号圈,编号牌紧贴圈的一侧(落版用) ----------
+export function marker(ctx, T, p, label, a = 1, pulse = 0, dir = 1) {
+ if (!p || a <= 0) return;
+ ctx.save(); ctx.globalCompositeOperation = 'lighter';
+ const r = 17;
+ ctx.strokeStyle = T.hi(0.95 * a); ctx.lineWidth = 2;
+ ctx.beginPath(); ctx.arc(p[0], p[1], r, 0, TAU); ctx.stroke();
+ ctx.lineWidth = 1.4; ctx.beginPath();
+ for (const [dx, dy] of [[1, 0], [-1, 0], [0, 1], [0, -1]]) { ctx.moveTo(p[0] + dx * (r - 6), p[1] + dy * (r - 6)); ctx.lineTo(p[0] + dx * (r + 6), p[1] + dy * (r + 6)); }
+ ctx.stroke();
+ ctx.fillStyle = T.hi(a); ctx.beginPath(); ctx.arc(p[0], p[1], 4, 0, TAU); ctx.fill();
+ if (pulse > 0) { ctx.strokeStyle = T.line(0.8 * a * (1 - pulse)); ctx.beginPath(); ctx.arc(p[0], p[1], r + 36 * pulse, 0, TAU); ctx.stroke(); }
+ ctx.font = `600 22px ${FONT.ui}`; ctx.textBaseline = 'middle';
+ const tw = ctx.measureText(label).width + 18, gap = r + 12, bx = dir > 0 ? p[0] + gap : p[0] - gap - tw;
+ ctx.strokeStyle = T.hi(0.9 * a); ctx.beginPath(); ctx.moveTo(p[0] + dir * (r + 6), p[1]); ctx.lineTo(dir > 0 ? bx : bx + tw, p[1]); ctx.stroke();
+ ctx.globalCompositeOperation = 'source-over';
+ ctx.fillStyle = `rgba(1,8,12,${0.88 * a})`; ctx.fillRect(bx, p[1] - 15, tw, 30);
+ ctx.globalCompositeOperation = 'lighter';
+ ctx.strokeStyle = T.line(0.9 * a); ctx.lineWidth = 1.2; ctx.strokeRect(bx, p[1] - 15, tw, 30);
+ ctx.fillStyle = T.hi(a); ctx.textAlign = 'left'; ctx.fillText(label, bx + 9, p[1] + 1);
+ ctx.restore();
+}
+
+// ---------- 投影光柱:从投影台升起的光锥 + 上升光尘 ----------
+export function beam(ctx, T, project, a, t, o = {}) {
+ if (a <= 0) return;
+ const r0 = o.r0 ?? 1.05, r1 = o.r1 ?? 0.9, y1 = o.y1 ?? 1.25, c = o.c || [0, 0, 0];
+ const p = new Float32Array(3);
+ const bot = [], top = [];
+ for (let i = 0; i < 96; i++) {
+ const th = i / 96 * TAU;
+ project(c[0] + Math.cos(th) * r0, 0, c[2] + Math.sin(th) * r0, p); bot.push([p[0], p[1]]);
+ project(c[0] + Math.cos(th) * r1, y1, c[2] + Math.sin(th) * r1, p); top.push([p[0], p[1]]);
+ }
+ const ext = arr => { let l = 0, r = 0; arr.forEach((q, i) => { if (q[0] < arr[l][0]) l = i; if (q[0] > arr[r][0]) r = i; }); return [l, r]; };
+ const [bl, br] = ext(bot), [tl, tr] = ext(top);
+ const L0 = bot[bl][0], R0 = bot[br][0], L1 = top[tl][0], R1 = top[tr][0];
+ const yb = Math.max(...bot.map(q => q[1])), yt = Math.min(...top.map(q => q[1]));
+ project(c[0], 0, c[2], p); const ym = p[1]; project(c[0], y1, c[2], p); const ytc = p[1];
+ // 下弧(屏幕上靠下的一半)与上弧(靠上的一半)
+ const arc = (arr, from, to, lower) => { const out = []; const n = arr.length; const cy = arr.reduce((s, q) => s + q[1], 0) / n; for (let k = 0; k <= n; k++) { const q = arr[(from + k) % n]; if ((lower ? q[1] >= cy - 1 : q[1] <= cy + 1)) out.push(q); if ((from + k) % n === to && k > 0) break; } return out; };
+ ctx.save(); ctx.globalCompositeOperation = 'lighter';
+ const g = ctx.createLinearGradient(0, yb, 0, yt);
+ g.addColorStop(0, T.line(0.10 * a)); g.addColorStop(0.45, T.line(0.04 * a)); g.addColorStop(1, T.line(0));
+ ctx.fillStyle = g;
+ // 一条路径三个子路径(底椭圆 + 侧面梯形 + 顶椭圆),一次 nonzero 填充 = 并集,不会重叠加亮
+ ctx.beginPath();
+ const poly = arr => { arr.forEach((q, i) => i ? ctx.lineTo(q[0], q[1]) : ctx.moveTo(q[0], q[1])); ctx.closePath(); };
+ const cw = arr => { let a = 0; for (let i = 0; i < arr.length; i++) { const p0 = arr[i], p1 = arr[(i + 1) % arr.length]; a += p0[0] * p1[1] - p1[0] * p0[1]; } return a > 0 ? arr : arr.slice().reverse(); };
+ poly(cw(bot)); poly(cw(top)); poly(cw([[L0, bot[bl][1]], [L1, top[tl][1]], [R1, top[tr][1]], [R0, bot[br][1]]]));
+ ctx.fill('nonzero');
+ const yT = ytc;
+ // 竖向光纹
+ ctx.lineWidth = 1;
+ for (let i = 0; i < 26; i++) {
+ const u = (i + 0.5) / 26, w = 0.5 + 0.5 * Math.sin(i * 12.9898 + t * 1.3);
+ ctx.strokeStyle = T.line(0.05 * a * w);
+ ctx.beginPath(); ctx.moveTo(L0 + (R0 - L0) * u, ym + (yb - ym) * Math.sin(u * Math.PI)); ctx.lineTo(L1 + (R1 - L1) * u, yT); ctx.stroke();
+ }
+ // 光尘
+ for (let i = 0; i < 70; i++) {
+ const h1 = hash(i * 3.7), h2 = hash(i * 9.1), h3 = hash(i * 1.3);
+ const life = (t * (0.12 + 0.1 * h3) + h1) % 1;
+ const th = h2 * TAU, rr = r0 * (0.3 + 0.7 * hash(i * 5.3)) * (1 - life * 0.15);
+ project(c[0] + Math.cos(th) * rr, life * y1, c[2] + Math.sin(th) * rr, p);
+ const al = Math.sin(life * Math.PI) * a * 0.8;
+ ctx.fillStyle = T.hi(al); ctx.fillRect(p[0] - 1, p[1] - 1, 2, 2);
+ }
+ ctx.restore();
+}
diff --git a/styles/hologram-hud/demo/events.json b/styles/hologram-hud/demo/events.json
new file mode 100644
index 0000000..f204640
--- /dev/null
+++ b/styles/hologram-hud/demo/events.json
@@ -0,0 +1 @@
+{"dur":39,"ev":[{"t":0,"type":"scan","d":2.6},{"t":0.2672,"type":"scan_tick","y":0.3},{"t":0.8675,"type":"scan_tick","y":0.55},{"t":1.3623,"type":"scan_tick","y":0.8},{"t":1.8102,"type":"scan_tick","y":1},{"t":2,"type":"roll","d":0.5,"n":4},{"t":2.5,"type":"confirm_small"},{"t":2.5,"type":"scan_done"},{"t":3,"type":"type_line"},{"t":3,"type":"vo","id":"intro","d":3.032},{"t":3.5,"type":"type_line"},{"t":6,"type":"detect","i":0},{"t":6.5,"type":"detect","i":1},{"t":7,"type":"detect","i":2},{"t":7.5,"type":"silence","d":0.5,"kind":"near"},{"t":8,"type":"lock","i":0,"part":"battery","bar":true},{"t":8,"type":"push","d":1.5},{"t":9,"type":"explode","part":"battery","d":1},{"t":9,"type":"vo","id":"c0","d":4.373},{"t":9.75,"type":"leader"},{"t":10,"type":"roll","d":1,"n":2},{"t":11,"type":"confirm","i":0,"bar":true},{"t":13.45,"type":"reassemble","part":"battery"},{"t":13.55,"type":"whip","d":0.5},{"t":13.6,"type":"jcut","part":"motor","d":0.4},{"t":13.75,"type":"dock","i":0},{"t":14,"type":"lock","i":1,"part":"motor","bar":true},{"t":14,"type":"orbit","d":4},{"t":14.25,"type":"vo","id":"c1","d":3.566},{"t":14.5,"type":"explode","part":"motor","d":0.75},{"t":14.75,"type":"leader"},{"t":15.5,"type":"roll","d":0.5,"n":3},{"t":16,"type":"confirm","i":1,"bar":true},{"t":17.45,"type":"reassemble","part":"motor"},{"t":17.55,"type":"whip","d":0.5},{"t":17.6,"type":"jcut","part":"brakes","d":0.4},{"t":17.75,"type":"dock","i":1},{"t":18,"type":"lock","i":2,"part":"brakes","bar":true},{"t":18.05,"type":"loupe_open"},{"t":18.25,"type":"lock_small"},{"t":18.25,"type":"vo","id":"c2","d":3.29},{"t":18.5,"type":"explode","part":"brakes","d":0.75},{"t":18.75,"type":"leader"},{"t":19.5,"type":"roll","d":0.5,"n":3},{"t":20,"type":"confirm","i":2,"bar":true},{"t":21.45,"type":"reassemble","part":"brakes"},{"t":21.6,"type":"loupe_close"},{"t":21.75,"type":"dock","i":2},{"t":22,"type":"regroup"},{"t":23,"type":"powerdown","d":0.5},{"t":23.5,"type":"silence","d":0.5,"kind":"true"},{"t":24,"type":"ignite","bar":true},{"t":24,"type":"glitch","d":0.13},{"t":24,"type":"wave","d":1.3},{"t":24,"type":"spin","d":4},{"t":26,"type":"wave","d":1.1},{"t":28.25,"type":"roll","d":0.5,"n":4},{"t":28.5,"type":"ping","i":0},{"t":28.75,"type":"ping","i":1},{"t":29,"type":"ping","i":2},{"t":29,"type":"vo","id":"outro","d":2.816},{"t":29.5,"type":"roll","d":0.5,"n":4},{"t":30,"type":"confirm_small"},{"t":30,"type":"roll","d":0.5,"n":5},{"t":30.5,"type":"confirm_small"},{"t":30.5,"type":"cta"},{"t":34,"type":"erase","d":1.25},{"t":35,"type":"card_tick"},{"t":35.4,"type":"card_tick"},{"t":35.8,"type":"card_tick"},{"t":36.2,"type":"card_tick"}]}
\ No newline at end of file
diff --git a/styles/hologram-hud/demo/film.js b/styles/hologram-hud/demo/film.js
new file mode 100644
index 0000000..1015107
--- /dev/null
+++ b/styles/hologram-hud/demo/film.js
@@ -0,0 +1,439 @@
+// 《Volt · Spec Scan》场景编排:所有文案来自 content.json,时间线按条目数自动重排(120 BPM,1 小节 = 2 s)
+import { Holo, drawScanPlane, drawPad } from './engine/holo.js';
+import * as U from './engine/hud.js';
+const { clamp } = U;
+const W = 1920, H = 1080, BEAT = 0.5, BAR = 2;
+const lerp = (a, b, t) => a + (b - a) * t;
+const seg = (t, a, b) => clamp((t - a) / (b - a));
+const ss = t => { t = clamp(t); return t * t * (3 - 2 * t); };
+const eo = t => 1 - Math.pow(1 - clamp(t), 3);
+const eio = t => { t = clamp(t); return t < .5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2; };
+const sine = t => 0.5 - 0.5 * Math.cos(Math.PI * clamp(t));
+let YK = 1; // 模型高度 / demo 自行车高度(1.02):扫描高度、镜头目标高度按它缩放
+
+// ---------- 时间线 ----------
+export function buildTimeline(C, dur = {}) {
+ const n = C.callouts.length;
+ const TL = { intro: [0, 4 * BAR], calls: [] };
+ let t = TL.intro[1];
+ const modes = ['push', 'orbit', 'loupe'];
+ C.callouts.forEach((c, i) => {
+ const bars = i === 0 ? 3 : 2; // 第一个慢讲,之后加速
+ TL.calls.push({ i, c, mode: modes[i % 3], t0: t, t1: t + bars * BAR, long: bars === 3 });
+ t += bars * BAR;
+ });
+ TL.regroup = [t, t + BAR]; t += BAR;
+ TL.high = [t, t + 2 * BAR]; t += 2 * BAR;
+ TL.lock = [t, t + 3 * BAR]; t += 3 * BAR;
+ TL.end = [t, t + 5]; t += 5;
+ TL.DUR = t;
+ // 旁白起点(拍点上)
+ TL.vo = [{ id: 'intro', t: 3.0, text: C.intro_vo }];
+ TL.calls.forEach(s => TL.vo.push({ id: 'c' + s.i, t: s.t0 + (s.long ? 1.0 : 0.25), text: s.c.vo }));
+ TL.vo.push({ id: 'outro', t: TL.lock[0] + 1.0, text: C.outro_vo });
+ for (const v of TL.vo) v.d = dur[v.id] ?? v.text.split(' ').length / 2.6;
+ return TL;
+}
+
+// 每个参数卡的内部节拍(相对锁定时刻)
+function callBeats(s) {
+ const k = s.long ? 1 : 0.5;
+ return {
+ push: 1.5 * k + (s.long ? 0 : 0.25),
+ ex0: 1.0 * k, ex1: 2.0 * k + (s.long ? 0 : 0.25),
+ lab: s.long ? 2.0 : 1.0, roll0: 2.0 * k + (s.long ? 0 : 0.5), roll1: 3.0 * k + (s.long ? 0 : 0.5),
+ det: 2.0 * k + (s.long ? 0 : 0.5),
+ };
+}
+
+// ---------- 相机 ----------
+const CAM = {
+ hook: { target: [0.05, 0.50, 0], yaw: 1.00, pitch: 0.24, dist: 2.7, cx: 0.56, cy: 0.54, roll: 0 },
+ introEnd: { target: [0.0, 0.52, 0], yaw: 0.42, pitch: 0.12, dist: 2.85, cx: 0.60, cy: 0.49, roll: 0 },
+ loupe: { target: [0.02, 0.52, 0], yaw: 0.30, pitch: 0.10, dist: 3.5, cx: 0.42, cy: 0.47, roll: 0 },
+ regroup: { target: [0.0, 0.52, 0], yaw: 0.62, pitch: 0.00, dist: 3.05, cx: 0.60, cy: 0.49, roll: 0 },
+ lock: { target: [0.0, 0.52, 0], yaw: 0.62, pitch: 0.17, dist: 3.5, cx: 0.51, cy: 0.47, roll: 0 },
+};
+function partCam(model, s, u) {
+ const P = model.byId[s.c.part], a = P?.center || P?.anchor || [0, 0.5, 0];
+ if (s.mode === 'push') return { target: a, yaw: lerp(0.66, 0.78, u), pitch: 0.2, dist: lerp(1.62, 1.5, u), cx: 0.37, cy: 0.5, roll: 0 };
+ if (s.mode === 'orbit') return { target: a, yaw: lerp(-0.2, 0.8, sine(u)), pitch: 0.14, dist: 1.35, cx: 0.48, cy: 0.5, roll: 0 };
+ return { ...CAM.loupe, cx: lerp(0.49, 0.475, u) }; // 右移,给左栏芯片留出干净的空间
+}
+const mixCam = (A, B, w) => ({
+ target: A.target.map((x, i) => lerp(x, B.target[i], w)),
+ yaw: lerp(A.yaw, B.yaw, w), pitch: lerp(A.pitch, B.pitch, w), dist: Math.exp(lerp(Math.log(A.dist), Math.log(B.dist), w)),
+ cx: lerp(A.cx, B.cx, w), cy: lerp(A.cy, B.cy, w), roll: lerp(A.roll || 0, B.roll || 0, w),
+});
+function segCam(model, TL, t) {
+ const [i0, i1] = TL.intro;
+ if (t < i1) {
+ const u = seg(t, 0, i1);
+ return mixCam(CAM.hook, CAM.introEnd, eo(u * 1.1));
+ }
+ for (const s of TL.calls) if (t < s.t1) {
+ const u = seg(t, s.t0, s.t1), b = callBeats(s);
+ const prev = s.i === 0 ? CAM.introEnd : partCam(model, TL.calls[s.i - 1], 1);
+ let here = partCam(model, s, u);
+ // 进入:第一个用推(慢),之后用甩(快,跟着目标框;甩镜跨段:下一段锁定前 0.45 s 开始)
+ if (s.i === 0) here = mixCam(prev, here, eio(seg(t, s.t0, s.t0 + b.push)));
+ else here = mixCam(prev, here, eio(seg(t, s.t0 - 0.45, s.t0 + 0.05)));
+ const nx = TL.calls[s.i + 1];
+ if (nx && t > nx.t0 - 0.45) here = mixCam(partCam(model, s, 1), partCam(model, nx, 0), eio(seg(t, nx.t0 - 0.45, nx.t0 + 0.05)));
+ return here;
+ }
+ const last = TL.calls[TL.calls.length - 1];
+ if (t < TL.regroup[1]) return mixCam(partCam(model, last, 1), CAM.regroup, eio(seg(t, TL.regroup[0], TL.regroup[0] + 1.4)));
+ if (t < TL.high[1]) {
+ const u = seg(t, TL.high[0], TL.high[1]);
+ return { ...CAM.regroup, pitch: lerp(0, 0.22, sine(u)), dist: lerp(3.05, 2.8, sine(u)), cx: lerp(0.60, 0.585, u) };
+ }
+ const u = seg(t, TL.lock[0], TL.lock[1]);
+ const hi = { ...CAM.regroup, pitch: 0.22, dist: 2.8, cx: 0.585 };
+ if (t < TL.lock[1]) return mixCam(hi, { ...CAM.lock, dist: lerp(3.5, 3.4, u) }, eio(seg(t, TL.lock[0], TL.lock[0] + 1.5)));
+ return { ...CAM.lock, dist: 3.4 };
+}
+import { makeCamera } from './engine/holo.js';
+const projOf = cam => makeCamera(cam, W, H).project;
+const spinPt = (x, z, a) => [x * Math.cos(a) + z * Math.sin(a), -x * Math.sin(a) + z * Math.cos(a)];
+// 把 cx/cy 比例换成像素
+const px = c => ({ ...c, cx: c.cx * W, cy: c.cy * H, fov: 0.6 });
+
+// ---------- 主渲染 ----------
+export function makeFilm(C, model, dur) {
+ YK = (model.ymax || 1.02) / 1.02;
+ for (const k in CAM) { CAM[k].target0 = CAM[k].target0 || CAM[k].target; CAM[k].target = [CAM[k].target0[0], CAM[k].target0[1] * YK, CAM[k].target0[2]]; }
+ const T = U.theme(C.hue, C.accent);
+ const TL = buildTimeline(C, dur);
+ const holo = new Holo(W, H), loupeHolo = new Holo(W, H);
+ const n = C.callouts.length;
+ const railStep = Math.min(112, 410 / Math.max(1, n - 1)), railY = i => 470 + i * railStep;
+
+ // 甩镜运动模糊:只在甩的 0.5 s 里,按 180° 快门(1/48 s)取 5 个子帧做累积平均
+ const accC = document.createElement('canvas'); accC.width = W; accC.height = H;
+ const subC = document.createElement('canvas'); subC.width = W; subC.height = H;
+ function whipK(t) { for (const s of TL.calls) if (s.i > 0 && t > s.t0 - 0.45 && t < s.t0 + 0.05) return Math.sin(Math.PI * seg(t, s.t0 - 0.45, s.t0 + 0.05)); return 0; }
+ function render(ctx, t, opt = {}) {
+ if (opt.noblur || whipK(t) < 0.05) return renderFrame(ctx, t, opt);
+ const N = 5, shutter = 1 / 48, a = accC.getContext('2d'), sg = subC.getContext('2d');
+ a.globalAlpha = 1; a.globalCompositeOperation = 'source-over';
+ for (let k = 0; k < N; k++) {
+ const tk = t + (k / (N - 1) - 0.5) * shutter;
+ sg.setTransform(1, 0, 0, 1, 0, 0); renderFrame(sg, tk, { ...opt, frameT: t });
+ a.globalAlpha = 1 / (k + 1); a.drawImage(subC, 0, 0);
+ }
+ ctx.save(); ctx.globalAlpha = 1; ctx.globalCompositeOperation = 'source-over'; ctx.drawImage(accC, 0, 0); ctx.restore();
+ }
+ function renderFrame(ctx, t, opt = {}) {
+ const frame = Math.round((opt.frameT ?? t) * 24);
+ const cam = px(segCam(model, TL, t));
+ // ---- 状态 ----
+ let scan = null, scanDown = null, solid = 0, spin = 0, gain = 1, glitchAmt = 0, focus = null, dim = 0.22;
+ const explode = {}, angle = {};
+ const [i0, i1] = TL.intro;
+ if (t < 2.7) scan = { y: lerp(0.2, 1.16, sine(seg(t, -0.35, 2.6))) * YK, band: 0.07 * YK };
+ let active = null;
+ for (const s of TL.calls) {
+ const b = callBeats(s), L = s.t0;
+ const out = 1 - eio(seg(t, s.t1 - 0.55, s.t1 - 0.05));
+ const k = eo(seg(t, L + b.ex0, L + b.ex1)) * out;
+ for (const P of model.byId[s.c.part]?.pieces || []) explode[P.id] = k;
+ if (t >= s.t0 - (s.mode === 'loupe' ? 0 : 0.45) && t < s.t1 - 0.05) active = s; // 甩向放大镜时先别把全车点亮
+ if (s.c.part === 'motor' || s.mode === 'orbit') { angle['motor-rotor'] = (t - L) * 1.6 * k; angle['motor-stator'] = -(t - L) * 0.9 * k; }
+ angle['brake-rotor'] = (t - L) * 0.8 * k * (s.c.part === 'brakes' ? 1 : 0) + (angle['brake-rotor'] || 0);
+ }
+ if (active && active.mode !== 'loupe') { focus = active.c.part; dim = 0.13; }
+ // 重组:变暗 → 静音一拍 → 点亮
+ const [r0, r1] = TL.regroup, [h0, h1] = TL.high;
+ if (t >= r0 && t < h0) gain = lerp(1, 0.32, eio(seg(t, r1 - 0.6, r1 - 0.45)));
+ if (t >= h0) {
+ solid = eo(seg(t, h0, h0 + 0.35));
+ gain = 1 + 0.5 * Math.exp(-(t - h0) * 3);
+ spin = t < h1 ? eio(seg(t, h0, h1)) * Math.PI * 2 : 0;
+ glitchAmt = t < h0 + 0.13 ? 1 - (t - h0) / 0.13 : 0;
+ }
+ // 点亮后沿车身上行的光波(24.0 一次,和弦换时 26.0 再一次)
+ let wave = null;
+ if (t >= h0 && t < h0 + 1.4) wave = { y: lerp(-0.1, 1.35, eio(seg(t, h0, h0 + 1.3))), w: 0.07 };
+ else if (t >= h0 + 2 && t < h0 + 3.2) wave = { y: lerp(-0.1, 1.35, eio(seg(t, h0 + 2, h0 + 3.1))), w: 0.05 };
+ const [e0, e1] = TL.end;
+ if (t >= e0) scanDown = { y: lerp(1.2, -0.05, eio(seg(t, e0, e0 + 1.25))) * YK };
+
+ // ---- 背景 ----
+ U.background(ctx, W, H, T, { px: -cam.yaw * 260 - cam.cx * 0.2, py: cam.pitch * 300, cx: cam.cx, cy: cam.cy + 40 });
+ const padA = t >= e0 ? 1 - seg(t, e0 + 1.0, e0 + 2.0) * 0.6 : clamp(0.25 + t * 0.5);
+ drawPad(ctx, cam, W, H, { hue: T.hue, rot: t * 0.12 + spin, alpha: padA * (t >= r0 && t < h0 ? gain : 1) });
+
+ // ---- 投影光柱(点亮之后) ----
+ if (solid > 0) U.beam(ctx, T, (x, y, z, o) => { const q = spinPt(x, z, spin); return projOf(cam)(q[0], y, q[1], o); }, solid * (t >= e0 ? 1 - seg(t, e0, e0 + 1.0) : 1), t, { y1: 1.25 * YK });
+ // ---- 主体 ----
+ const flash = {};
+ if (t >= TL.lock[0]) TL.calls.forEach((s, j) => { const tt = TL.lock[0] + 0.5 + j * BEAT / 2; flash[s.c.part] = t >= tt && t < tt + 0.16 ? 1 : 0; });
+ const info = holo.draw(ctx, model, cam, { flash,
+ hue: T.hue, scan, scanDown, explode, angle, solid, spin, gain, focus, dim, scanOffset: t * 24, wave,
+ lineWidth: 1.3 * (1 + (t >= h0 ? 0.5 * Math.exp(-(t - h0) * 1.2) + 0.12 * solid : 0)),
+ });
+ if (scan && scan.y < 1.15) drawScanPlane(ctx, cam, W, H, scan.y, { hue: T.hue, r: 1.0, rot: t * 0.3, alpha: 1 - seg(t, 2.35, 2.7) });
+ if (scanDown && t < e0 + 1.4) drawScanPlane(ctx, cam, W, H, scanDown.y, { hue: T.hue, r: 1.0, rot: -t * 0.3, alpha: 1 - seg(t, e0 + 1.1, e0 + 1.4) });
+
+ // ---- 界面 ----
+ const hudA = t >= e0 ? 1 - seg(t, e0, e0 + 0.5) : 1;
+ // 片头标题(开场与落版共用左栏)
+ const titleIn = clamp(seg(t, 2.0, 2.5) * 1.0), titleOut = 1 - seg(t, i1 - 0.5, i1 - 0.1);
+ const titleBack = seg(t, TL.lock[0] + 0.25, TL.lock[0] + 0.9);
+ const tA = t < TL.lock[0] ? titleIn * titleOut : titleBack * hudA;
+ if (tA > 0) titleBlock(ctx, T, t, frame, tA, t < TL.lock[0] ? { roll: seg(t, 2.0, 2.5), sub: seg(t, 3.0, 3.4), tag: seg(t, 3.5, 3.9) } : { roll: seg(t, TL.lock[0] + 0.25, TL.lock[0] + 0.75), sub: 1, tag: 1 });
+ // 开场"探测到系统":三个预备目标框闪一下
+ if (t > 5.9 && t < i1) { // 6.0 / 6.5 / 7.0,7.5 是静音
+ TL.calls.forEach((s, j) => {
+ const tt = 6.0 + j * 0.5 * (3 / Math.max(3, n));
+ const k = seg(t, tt, tt + 0.12) * (1 - seg(t, i1 - 0.35, i1 - 0.05));
+ U.targetBox(ctx, T, info.bbox[s.c.part], 0.35 * k, { alpha: 0.55 * k, lockK: 0.2 + 0.1 * Math.sin(t * 20 + j), pad: 10 });
+ });
+ }
+ // 参数卡
+ for (const s of TL.calls) {
+ const b = callBeats(s), L = s.t0;
+ const vis = t >= L - 0.05 && t < s.t1;
+ if (!vis) continue;
+ const out = 1 - seg(t, s.t1 - 0.4, s.t1 - 0.05);
+ const lk = seg(t, L, L + 0.22);
+ const flash = t >= L && t < L + 0.12;
+ const idx = String(s.i + 1).padStart(2, '0');
+ if (s.mode !== 'loupe') U.targetBox(ctx, T, info.bbox[s.c.part], lk, { alpha: out, flash, tag: `TGT ${idx} · LOCK`, pad: 22 });
+ let anchor = info.anchor[s.c.part];
+ const card = { x: 1240, y: 318 };
+ if (s.mode === 'loupe') {
+ const lp = loupe(ctx, T, t, s, b, model, cam, info, explode, angle, out);
+ anchor = lp.anchor; card.x = 1290; card.y = 640;
+ }
+ const lp = seg(t, L + b.lab - 0.25, L + b.lab + 0.25);
+ if (s.mode !== 'loupe') {
+ const elbow = [lerp(anchor[0], card.x - 30, 0.55), card.y];
+ U.leader(ctx, T, anchor, elbow, [card.x - 12, card.y], lp, { alpha: out, pulse: t > L + b.roll1 ? seg(t, L + b.roll1, L + b.roll1 + 0.5) : 0 });
+ }
+ const rl = seg(t, L + b.roll0, L + b.roll1);
+ U.specCard(ctx, T, card.x, card.y, s.c, {
+ reveal: seg(t, L + b.lab, L + b.lab + 0.4), roll: rl, detail: seg(t, L + b.det, L + b.det + 0.6), frame,
+ flash: t >= L + b.roll1 && t < L + b.roll1 + 0.1,
+ }, { index: idx, alpha: out, w: s.mode === 'loupe' ? 440 : 470, big: s.mode === 'loupe' ? 116 : 136 });
+ }
+ // 左侧停靠栏:读过的参数
+ const lockLead = t >= TL.lock[0] && t < TL.end[0];
+ TL.calls.forEach((s, j) => {
+ const inA = seg(t, s.t1 - 0.25, s.t1 + 0.1);
+ if (inA <= 0) return;
+ const x = lerp(140, 110, eo(inA));
+ U.chip(ctx, T, x, railY(j), s.c, inA * hudA * (t >= r0 && t < h0 ? Math.max(0.5, gain) : 1), { index: String(j + 1).padStart(2, '0'), w: 360 });
+ // 落版:芯片引线接到零件
+ if (lockLead) {
+ const tt = TL.lock[0] + 0.5 + j * BEAT / 2, lp = seg(t, tt, tt + 0.2);
+ U.marker(ctx, T, info.anchor[s.c.part], String(j + 1).padStart(2, '0'), lp * hudA, t > tt ? seg(t, tt, tt + 0.6) : 0, (model.byId[s.c.part].tagDir ?? 1));
+ }
+ });
+ // 落版:右栏重量 / 价格 / 行动
+ if (t >= TL.lock[0]) footer(ctx, T, t, frame, TL, C, hudA);
+ // 取景框
+ U.chrome(ctx, W, H, T, {
+ alpha: hudA * (t >= r0 && t < h0 ? Math.max(0.35, gain) : 1),
+ tl: `${C.product} ${C.model_code} // SPEC SCAN`,
+ tr: statusText(t, TL, n, info),
+ bl: `HOLO.${String(frame).padStart(4, '0')} · Y ${(scan ? scan.y : 1.16 * YK).toFixed(2)} M`,
+ br: `${(cam.yaw * 57.3).toFixed(1)}° · ${(cam.pitch * 57.3).toFixed(1)}° · ${cam.dist.toFixed(2)} M`,
+ px: -cam.yaw * 200,
+ });
+ // 甩镜速度线
+ for (const s of TL.calls) if (s.i > 0) {
+ const w = seg(t, s.t0 - 0.45, s.t0 + 0.05); if (w > 0 && w < 1) streaks(ctx, T, Math.sin(w * Math.PI), s.i);
+ }
+ // 字幕
+ if (!opt.nosub) {
+ const v = subAt(TL, t);
+ if (v) U.subtitle(ctx, W, H, T, v.text, v.a * hudA, { t });
+ }
+ // 片尾卡
+ if (t >= e0 + 1.0) endCard(ctx, T, t - (e0 + 1.0), frame, C);
+ U.vignette(ctx, W, H, 0.5);
+ if (glitchAmt > 0) U.glitch(ctx, W, H, glitchAmt, frame * 7.3);
+ }
+
+ function subAt(TL, t) {
+ for (const v of TL.vo) {
+ const nx = TL.vo[TL.vo.indexOf(v) + 1];
+ const end = Math.min(v.t + Math.max(1.8, v.d + 0.6), nx ? nx.t - 0.12 : 1e9);
+ if (t >= v.t - 0.1 && t < end) return { text: v.text, a: seg(t, v.t - 0.1, v.t + 0.1) * (1 - seg(t, end - 0.15, end)) };
+ }
+ return null;
+ }
+
+ function statusText(t, TL, n, info) {
+ if (t < 2.6) return `SCANNING ${String(Math.round(clamp(t / 2.6) * 100)).padStart(3, '0')}%`;
+ if (t < TL.intro[1]) return `SCAN COMPLETE · ${n} SYSTEMS`;
+ for (const s of TL.calls) if (t < s.t1) return `TARGET ${s.i + 1}/${n} · ${s.c.part.toUpperCase()}`;
+ if (t < TL.high[0]) return `RECOMPILING`;
+ if (t < TL.high[1]) return `HOLO SOLID · 360°`;
+ return `SPEC SHEET · READY`;
+ }
+
+ // 放大镜:画中画,用第二个相机放大零件
+ function loupe(ctx, T, t, s, b, model, cam, info, explode, angle, out) {
+ const L = s.t0, open = eo(seg(t, L + 0.05, L + 0.5)) * out;
+ const R = 225 * open, cxL = 1530, cyL = 355;
+ const a = info.anchor[s.c.part] || [W / 2, H / 2];
+ if (open <= 0.01) return { anchor: [cxL, cyL] };
+ // 连接线:零件小圈 → 放大镜
+ ctx.save(); ctx.globalCompositeOperation = 'lighter';
+ ctx.strokeStyle = T.line(0.6 * open); ctx.lineWidth = 1.2;
+ ctx.beginPath(); ctx.arc(a[0], a[1], 46, 0, Math.PI * 2); ctx.stroke();
+ const ang = Math.atan2(cyL - a[1], cxL - a[0]), perp = ang + Math.PI / 2;
+ for (const sg of [-1, 1]) { ctx.beginPath(); ctx.moveTo(a[0] + Math.cos(perp) * 46 * sg, a[1] + Math.sin(perp) * 46 * sg); ctx.lineTo(cxL + Math.cos(perp) * R * sg, cyL + Math.sin(perp) * R * sg); ctx.stroke(); }
+ ctx.restore();
+ // 内容
+ const pa = model.byId[s.c.part].center || model.byId[s.c.part].anchor;
+ const lc = { target: pa, yaw: lerp(0.75, 0.45, seg(t, L, s.t1)), pitch: 0.16, dist: 0.7, fov: 0.6, cx: cxL, cy: cyL, roll: 0 };
+ ctx.save();
+ ctx.beginPath(); ctx.arc(cxL, cyL, R, 0, Math.PI * 2); ctx.clip();
+ ctx.fillStyle = 'rgba(2,10,14,0.92)'; ctx.fillRect(cxL - R, cyL - R, R * 2, R * 2);
+ U.background(ctx, W, H, T, { px: t * 20, py: 0, cx: cxL, cy: cyL, alpha: 1.4 });
+ const li = loupeHolo.draw(ctx, model, lc, { hue: T.hue, explode, angle, focus: s.c.part, dim: 0.12, lineWidth: 1.5 });
+ ctx.restore();
+ ctx.save(); ctx.globalCompositeOperation = 'lighter';
+ ctx.strokeStyle = T.line(0.9 * open); ctx.lineWidth = 2;
+ ctx.beginPath(); ctx.arc(cxL, cyL, R, 0, Math.PI * 2); ctx.stroke();
+ ctx.strokeStyle = T.dim(0.6 * open); ctx.lineWidth = 1;
+ ctx.beginPath();
+ for (let i = 0; i < 90; i++) { const th = i / 90 * Math.PI * 2 + t * 0.2, r2 = R + (i % 15 ? 7 : 16); ctx.moveTo(cxL + Math.cos(th) * (R + 3), cyL + Math.sin(th) * (R + 3)); ctx.lineTo(cxL + Math.cos(th) * r2, cyL + Math.sin(th) * r2); }
+ ctx.stroke();
+ ctx.font = `20px ${U.FONT.mono}`; ctx.fillStyle = T.line(0.85 * open); ctx.textAlign = 'left';
+ ctx.fillText(`ZOOM ×${(CAM.loupe.dist / 0.7).toFixed(1)}`, cxL - R + 10, cyL - R - 12);
+ ctx.restore();
+ // 目标框在放大镜里锁定
+ const lk = seg(t, L + 0.25, L + 0.5);
+ U.targetBox(ctx, T, li.bbox[s.c.part], lk, { flash: t >= L + 0.25 && t < L + 0.37, pad: 14, tag: `TGT ${String(s.i + 1).padStart(2, '0')} · LOCK`, alpha: out });
+ return { anchor: [cxL, cyL + R] };
+ }
+
+ function titleBlock(ctx, T, t, frame, a, st) {
+ ctx.save(); ctx.globalCompositeOperation = 'lighter';
+ ctx.textAlign = 'left'; ctx.textBaseline = 'alphabetic';
+ const x = 110, y = 262;
+ ctx.font = `300 176px ${U.FONT.ui}`; ctx.letterSpacing = '26px';
+ ctx.fillStyle = T.hi(a);
+ ctx.fillText(U.rollText(C.product, st.roll, frame, 5), x - 6, y);
+ ctx.letterSpacing = '0px';
+ ctx.fillStyle = T.line(0.9 * a); ctx.fillRect(x, y + 26, 360 * eo(st.sub), 2);
+ ctx.font = `22px ${U.FONT.mono}`; ctx.fillStyle = T.line(0.9 * a * st.sub);
+ ctx.fillText(U.rollText(`${C.model_code} · ${C.category.toUpperCase()}`, st.sub * 1.3, frame, 9), x, y + 62);
+ U.fitFont(ctx, C.tagline, 500, 36, U.FONT.ui, 420, 20);
+ ctx.fillStyle = T.hi(0.85 * a * st.tag);
+ const lines = U.wrap(ctx, C.tagline, 420);
+ lines.forEach((l, i) => ctx.fillText(l, x, y + 114 + i * 40));
+ ctx.restore();
+ }
+
+ function footer(ctx, T, t, frame, TL, C, a) {
+ const L0 = TL.lock[0], F = C.footer, x = 1510, w = 330;
+ const items = [F.weight, F.price].filter(Boolean);
+ U.plate(ctx, T, x - 20, 540, w + 40, (F.cta ? 360 : 300), a * seg(t, L0 + 1.3, L0 + 1.6));
+ ctx.save(); ctx.globalCompositeOperation = 'lighter'; ctx.textAlign = 'left';
+ items.forEach((it, j) => {
+ const tt = L0 + 1.5 + j * BEAT, r = seg(t, tt, tt + 0.3), roll = seg(t, tt, tt + 0.5);
+ if (r <= 0) return;
+ const y = 560 + j * 150;
+ ctx.strokeStyle = T.line(0.8 * a * r); ctx.lineWidth = 1.4; ctx.beginPath(); ctx.moveTo(x, y); ctx.lineTo(x + w * eo(r), y); ctx.stroke();
+ ctx.font = `20px ${U.FONT.mono}`; ctx.fillStyle = T.dim(a * r); ctx.fillText(it.label.toUpperCase(), x, y + 30);
+ const bs = U.fitFont(ctx, it.value, 300, 92, U.FONT.ui, w - 90, 40);
+ const adv = ctx.measureText('0').width * 1.02;
+ ctx.fillStyle = roll >= 1 ? T.acc(a) : T.line(0.8 * a);
+ const vw = U.monoText(ctx, U.rollText(it.value, roll, frame, 31 + j), x - 3, y + 30 + bs * 0.86, adv);
+ ctx.font = `500 ${Math.round(bs * 0.3)}px ${U.FONT.ui}`; ctx.fillStyle = roll >= 1 ? T.acc(0.9 * a) : T.line(0.6 * a);
+ ctx.fillText(it.unit || '', x + vw + 8, y + 30 + bs * 0.86);
+ });
+ if (F.cta) {
+ const tt = L0 + 2.5, r = seg(t, tt, tt + 0.35);
+ if (r > 0) {
+ const y = 860;
+ ctx.letterSpacing = '2px';
+ U.fitFont(ctx, F.cta.toUpperCase(), 600, 21, U.FONT.ui, w - 30, 14);
+ const tw = Math.min(w, ctx.measureText(F.cta.toUpperCase()).width + 30);
+ ctx.strokeStyle = T.acc(0.9 * a * r); ctx.lineWidth = 1.5; ctx.strokeRect(x, y - 30, tw * eo(r), 44);
+ ctx.fillStyle = T.acc(a * clamp(r * 2 - 1)); ctx.fillText(F.cta.toUpperCase(), x + 15, y);
+ ctx.letterSpacing = '0px';
+ }
+ }
+ ctx.restore();
+ }
+
+ function endCard(ctx, T, u, frame, C) {
+ const a = seg(u, 0, 0.4);
+ ctx.save(); ctx.globalCompositeOperation = 'lighter'; ctx.textAlign = 'center';
+ ctx.font = `300 96px ${U.FONT.ui}`; ctx.letterSpacing = '10px'; ctx.fillStyle = T.hi(a);
+ ctx.fillText(U.rollText(C.film_title, seg(u, 0, 0.6), frame, 41), W / 2, 420); ctx.letterSpacing = '0px';
+ ctx.font = `600 30px ${U.FONT.ui}`; ctx.letterSpacing = '6px'; ctx.fillStyle = T.line(0.9 * seg(u, 0.4, 0.8));
+ ctx.fillText('SCI-FI HOLOGRAM HUD', W / 2, 490); ctx.letterSpacing = '0px';
+ ctx.fillStyle = T.line(0.6 * seg(u, 0.4, 0.8)); ctx.fillRect(W / 2 - 180, 525, 360, 1.5);
+ ctx.font = `500 34px ${U.FONT.ui}`; ctx.fillStyle = T.hi(0.95 * seg(u, 0.8, 1.2));
+ ctx.fillText('Lemo-Opuscar', W / 2, 590);
+ ctx.font = `22px ${U.FONT.mono}`; ctx.fillStyle = T.line(0.85 * seg(u, 1.0, 1.4));
+ ctx.fillText('LemoLab × Claude Opus 5.5', W / 2, 636);
+ ctx.font = `20px ${U.FONT.mono}`; ctx.fillStyle = T.dim(0.9 * seg(u, 1.3, 1.7));
+ (C.credits || []).forEach((l, i) => ctx.fillText(l, W / 2, 720 + i * 32));
+ ctx.restore();
+ }
+
+ function streaks(ctx, T, k, seed) {
+ ctx.save(); ctx.globalCompositeOperation = 'lighter';
+ for (let i = 0; i < 28; i++) {
+ const y = ((Math.sin(i * 91.7 + seed) * 0.5 + 0.5) * H), len = 200 + 600 * Math.abs(Math.sin(i * 13.1)), x = (Math.sin(i * 7.9 + seed * 3) * 0.5 + 0.5) * W;
+ ctx.fillStyle = T.line(0.22 * k); ctx.fillRect(x - len / 2, y, len, 1.4);
+ }
+ ctx.restore();
+ }
+
+ // ---------- 声音事件(给混音 / 配乐 / 卡点自检) ----------
+ function events() {
+ const E = [], ev = (t, type, o = {}) => E.push({ t: +t.toFixed(4), type, ...o });
+ ev(0, 'scan', { d: 2.6 });
+ for (const y of [0.3, 0.55, 0.8, 1.0]) { // 扫描面经过的高度 → 时间
+ let lo = 0, hi = 2.6; for (let k = 0; k < 30; k++) { const m = (lo + hi) / 2; (lerp(0.2, 1.16, sine(seg(m, -0.35, 2.6))) * YK < y * YK ? lo = m : hi = m); } ev(lo, 'scan_tick', { y });
+ }
+ ev(2.0, 'roll', { d: 0.5, n: C.product.length }); ev(2.5, 'confirm_small'); ev(2.5, 'scan_done');
+ ev(3.0, 'type_line'); ev(3.5, 'type_line');
+ TL.calls.forEach((s, j) => ev(6.0 + j * 0.5 * (3 / Math.max(3, n)), 'detect', { i: j }));
+ ev(7.5, 'silence', { d: 0.5, kind: 'near' });
+ for (const s of TL.calls) {
+ const b = callBeats(s), L = s.t0, part = s.c.part;
+ if (s.i > 0) ev(L - 0.45, 'whip', { d: 0.5 });
+ if (s.i > 0) ev(L - 0.4, 'jcut', { part, d: 0.4 });
+ ev(L, 'lock', { i: s.i, part, bar: true });
+ if (s.i === 0) ev(L, 'push', { d: b.push });
+ if (s.mode === 'loupe') { ev(L + 0.05, 'loupe_open'); ev(L + 0.25, 'lock_small'); ev(s.t1 - 0.4, 'loupe_close'); }
+ if (s.mode === 'orbit') ev(L, 'orbit', { d: s.t1 - L });
+ ev(L + b.ex0, 'explode', { part, d: b.ex1 - b.ex0 });
+ ev(L + b.lab - 0.25, 'leader');
+ ev(L + b.roll0, 'roll', { d: b.roll1 - b.roll0, n: String(s.c.value).length });
+ ev(L + b.roll1, 'confirm', { i: s.i, bar: true });
+ ev(s.t1 - 0.55, 'reassemble', { part });
+ ev(s.t1 - 0.25, 'dock', { i: s.i });
+ }
+ const [r0, r1] = TL.regroup, [h0, h1] = TL.high, L0 = TL.lock[0];
+ ev(r0, 'regroup');
+ ev(r1 - 1.0, 'powerdown', { d: 0.5 });
+ ev(r1 - 0.5, 'silence', { d: 0.5, kind: 'true' });
+ ev(h0, 'ignite', { bar: true }); ev(h0, 'glitch', { d: 0.13 }); ev(h0, 'wave', { d: 1.3 }); ev(h0 + 2, 'wave', { d: 1.1 });
+ ev(h0, 'spin', { d: h1 - h0 });
+ ev(L0 + 0.25, 'roll', { d: 0.5, n: C.product.length });
+ TL.calls.forEach((s, j) => ev(L0 + 0.5 + j * BEAT / 2, 'ping', { i: j }));
+ ['weight', 'price'].forEach((k, j) => { if (C.footer?.[k]) { ev(L0 + 1.5 + j * BEAT, 'roll', { d: 0.5, n: String(C.footer[k].value).length }); ev(L0 + 2.0 + j * BEAT, 'confirm_small'); } });
+ if (C.footer?.cta) ev(L0 + 2.5, 'cta');
+ ev(TL.end[0], 'erase', { d: 1.25 });
+ ev(TL.end[0] + 1.0, 'card_tick'); ev(TL.end[0] + 1.4, 'card_tick'); ev(TL.end[0] + 1.8, 'card_tick'); ev(TL.end[0] + 2.2, 'card_tick');
+ for (const v of TL.vo) ev(v.t, 'vo', { id: v.id, d: v.d });
+ return E.sort((a, b) => a.t - b.t);
+ }
+ function subs() {
+ return TL.vo.map((v, i) => { const nx = TL.vo[i + 1]; return { t0: v.t - 0.1, t1: Math.min(v.t + Math.max(1.8, v.d + 0.6), nx ? nx.t - 0.12 : 1e9), text: v.text }; });
+ }
+ const timeline = () => ({ bpm: 120, bar: BAR, dur: TL.DUR, intro: TL.intro, calls: TL.calls.map(s => ({ i: s.i, part: s.c.part, mode: s.mode, t0: s.t0, t1: s.t1 })), regroup: TL.regroup, high: TL.high, lock: TL.lock, end: TL.end, vo: TL.vo });
+ return { render, TL, events, subs, timeline };
+}
diff --git a/styles/hologram-hud/demo/fonts/OFL-rajdhani.txt b/styles/hologram-hud/demo/fonts/OFL-rajdhani.txt
new file mode 100644
index 0000000..6dd8096
--- /dev/null
+++ b/styles/hologram-hud/demo/fonts/OFL-rajdhani.txt
@@ -0,0 +1,93 @@
+Copyright (c) 2014, Indian Type Foundry ([email protected]).
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+http://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/styles/hologram-hud/demo/fonts/OFL-sharetechmono.txt b/styles/hologram-hud/demo/fonts/OFL-sharetechmono.txt
new file mode 100644
index 0000000..2ff09c1
--- /dev/null
+++ b/styles/hologram-hud/demo/fonts/OFL-sharetechmono.txt
@@ -0,0 +1,93 @@
+Copyright (c) 2012, Carrois Type Design, Ralph du Carrois ([email protected] www.carrois.com), with Reserved Font Name 'Share'
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+http://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/styles/hologram-hud/demo/fonts/fonts.css b/styles/hologram-hud/demo/fonts/fonts.css
new file mode 100644
index 0000000..07df859
--- /dev/null
+++ b/styles/hologram-hud/demo/fonts/fonts.css
@@ -0,0 +1,5 @@
+@font-face{font-family:'Rajdhani';src:url(Rajdhani-Light.ttf);font-weight:300}
+@font-face{font-family:'Rajdhani';src:url(Rajdhani-Regular.ttf);font-weight:400}
+@font-face{font-family:'Rajdhani';src:url(Rajdhani-Medium.ttf);font-weight:500}
+@font-face{font-family:'Rajdhani';src:url(Rajdhani-SemiBold.ttf);font-weight:600}
+@font-face{font-family:'ShareTechMono';src:url(ShareTechMono-Regular.ttf);font-weight:400}
diff --git a/styles/hologram-hud/demo/frames.js b/styles/hologram-hud/demo/frames.js
new file mode 100644
index 0000000..3b890ba
--- /dev/null
+++ b/styles/hologram-hud/demo/frames.js
@@ -0,0 +1,22 @@
+// 单独的引擎演示帧(STYLE.md §10 用):?scene=star&t=…
+import { Holo, modelFromPath, normalizeModel, drawPad, drawScanPlane } from './engine/holo.js';
+import * as U from './engine/hud.js';
+const W = 1920, H = 1080;
+// 暖橙色四角光点 + 一截光标尾巴:用"唯一彩色"keep 保持它自己的颜色,其余按全息主色
+export function star(g, t) {
+ const T = U.theme(188, 38), holo = new Holo(W, H);
+ const P = []; for (let i = 0; i < 8; i++) { const a = Math.PI / 2 + i * Math.PI / 4, r = i % 2 ? 0.16 : 0.5; P.push([Math.cos(a) * r, Math.sin(a) * r + 0.6]); }
+ const star = modelFromPath(P, { depth: 0.12, id: 'star', slices: 3 });
+ const tail = modelFromPath([[0.62, 0.1], [0.7, 0.1], [0.7, 0.55], [0.62, 0.55]], { depth: 0.06, id: 'caret' });
+ const m = { name: 'demo', parts: [...star.parts, ...tail.parts] };
+ m.byId = Object.fromEntries(m.parts.map(p => [p.id, p]));
+ normalizeModel(m, 1.6);
+ const cam = { target: [0, 0.55, 0], yaw: 0.5 + t * 0.2, pitch: 0.18, dist: 2.6, fov: 0.6, cx: W / 2, cy: H * 0.5 };
+ U.background(g, W, H, T, { cx: W / 2, cy: H / 2 });
+ drawPad(g, cam, W, H, { hue: T.hue, rot: t * 0.2 });
+ const sy = Math.min(1.4, t * 0.6);
+ const info = holo.draw(g, m, cam, { hue: T.hue, scan: t < 2.4 ? { y: sy } : null, solid: t > 2.6 ? 1 : 0, keep: { star: '#D97757' } });
+ if (t < 2.4) drawScanPlane(g, cam, W, H, sy, { hue: T.hue, r: 0.9 });
+ U.targetBox(g, T, info.bbox.star, t > 2.4 ? 1 : 0, { tag: 'TGT 01 · LOCK', lockK: Math.min(1, (t - 2.4) * 4) });
+ U.vignette(g, W, H, 0.5);
+}
diff --git a/styles/hologram-hud/demo/index.html b/styles/hologram-hud/demo/index.html
new file mode 100644
index 0000000..089f6dd
--- /dev/null
+++ b/styles/hologram-hud/demo/index.html
@@ -0,0 +1,6 @@
+<!doctype html>
+<html><head><meta charset="utf-8"><title>Volt · Spec Scan</title>
+<link rel="stylesheet" href="fonts/fonts.css">
+<style>html,body{margin:0;background:#000;overflow:hidden}canvas{position:absolute;left:0;top:0;display:block}</style>
+</head><body><canvas id="c" width="1920" height="1080"></canvas>
+<script type="module" src="main.js"></script></body></html>
diff --git a/styles/hologram-hud/demo/lines.json b/styles/hologram-hud/demo/lines.json
new file mode 100644
index 0000000..15f7902
--- /dev/null
+++ b/styles/hologram-hud/demo/lines.json
@@ -0,0 +1,35 @@
+[
+ {
+ "id": "intro",
+ "text": "This is Volt. A city e-bike, stripped to what matters.",
+ "voice": "af_heart",
+ "speed": 1
+ },
+ {
+ "id": "c0",
+ "text": "The battery hides inside the down tube. Eighty kilometres on one charge.",
+ "asr": "The battery hides inside the down tube, 80 kilometers on one charge.",
+ "voice": "af_heart",
+ "speed": 1
+ },
+ {
+ "id": "c1",
+ "text": "A two hundred and fifty watt hub motor. Silent, and sealed.",
+ "asr": "A 250-watt hub motor, silent and sealed.",
+ "voice": "af_heart",
+ "speed": 1
+ },
+ {
+ "id": "c2",
+ "text": "Hydraulic disc brakes. Sure stops, even in the rain.",
+ "voice": "af_heart",
+ "speed": 1
+ },
+ {
+ "id": "outro",
+ "text": "Seventeen point four kilos. Ready when you are.",
+ "asr": "17.4 kilos, ready when you are.",
+ "voice": "af_heart",
+ "speed": 1
+ }
+]
\ No newline at end of file
diff --git a/styles/hologram-hud/demo/main.js b/styles/hologram-hud/demo/main.js
new file mode 100644
index 0000000..771a9a8
--- /dev/null
+++ b/styles/hologram-hud/demo/main.js
@@ -0,0 +1,20 @@
+// 页面入口:读 content.json(可用 ?content=content_alt.json 换内容)→ 模型 → 片子
+import { loadModel } from './engine/holo.js';
+import { makeFilm } from './film.js';
+const cv = document.getElementById('c'), g = cv.getContext('2d');
+const Q = new URLSearchParams(location.search);
+await Promise.all(['300', '400', '500', '600'].map(w => document.fonts.load(`${w} 40px Rajdhani`)).concat([document.fonts.load('20px ShareTechMono')]));
+const get = async (u, d) => { try { const r = await fetch(u); return r.ok ? await r.json() : d; } catch { return d; } };
+const C = await get(Q.get('content') || 'content.json');
+const model = await loadModel(C.model);
+const dur = await get(`${Q.get('voices') || 'voices'}/dur.json`, {});
+const film = makeFilm(C, model, dur);
+window.DUR = film.TL.DUR;
+window.TL = film.TL;
+window.EV = film.events();
+window.SUBS = film.subs();
+window.TIMELINE = film.timeline();
+const scene = Q.get('scene');
+if (scene) { const F = await import('./frames.js'); window.render = t => F[scene](g, t); }
+else window.render = t => film.render(g, t, { nosub: Q.has('nosub') });
+window.READY = true;
diff --git a/styles/hologram-hud/demo/mix.py b/styles/hologram-hud/demo/mix.py
new file mode 100644
index 0000000..0d7f883
--- /dev/null
+++ b/styles/hologram-hud/demo/mix.py
@@ -0,0 +1,240 @@
+"""mix.py — 《Volt · Spec Scan》界面音 + 机械拟音 + 环境底 + 人声 + 配乐闪避 → mix.wav
+材质:发光的线 = 干净的电子音(正弦 / FM,短、准、在 D 小调里);机械部件 = 伺服、气压、油压、金属。
+两处静音:near(只剩房间嗡鸣)与 true(全部归零)。旁白期间音乐和环境底侧链压 6 dB。
+用法(仓库根):.venv/bin/python styles/hologram-hud/demo/mix.py
+"""
+import os, sys, json, numpy as np, soundfile as sf
+from scipy.signal import resample_poly
+from scipy.ndimage import uniform_filter1d
+D = os.path.dirname(os.path.abspath(__file__)); ROOT = os.path.abspath(os.path.join(D, '../../..'))
+sys.path.insert(0, ROOT)
+from core.audio.sfx import SR, t_, env_exp, bp, lp, hp, noise, norm, brown, add, limit
+
+W = os.environ.get('HH_WORK') or D # 工作目录:默认 demo/,换内容时是 out/<name>/
+os.makedirs(os.path.join(W, 'out'), exist_ok=True)
+E = json.load(open(os.path.join(W, 'events.json'))); EV = E['ev']; DUR = E['dur']
+N = int(round(DUR * SR))
+rng = np.random.default_rng(52)
+fol = np.zeros((N, 2)); amb = np.zeros((N, 2)); vox = np.zeros((N, 2))
+hz = lambda m: 440 * 2 ** ((m - 69) / 12)
+D5, F5, A5, C6, D6, E6 = 74, 77, 81, 84, 86, 88
+
+# ─────────── 音色 ───────────
+def sine(f, d, tau=None, ph=0):
+ x = np.sin(2 * np.pi * f * t_(d) + ph)
+ return x * env_exp(d, tau) if tau else x
+
+def att(x, a=.004): # 起音去咔嗒
+ n = min(len(x), int(a * SR)); x = x.copy(); x[:n] *= np.linspace(0, 1, n); return x
+
+def blip(m, d=.09, v=1.0, fm=0.0):
+ tt = t_(d); f = hz(m)
+ x = np.sin(2 * np.pi * f * tt + fm * np.sin(2 * np.pi * f * 2 * tt) * env_exp(d, .02)) * env_exp(d, d * .3)
+ return att(x) * v
+
+def tick(v=1.0, f=3200):
+ d = .018; return att(norm(bp(noise(d), f * .7, f * 1.5) * env_exp(d, .002) + sine(f, d, .003) * .5)) * v
+
+def lock_hit(v=1.0): # 锁定:低频撞 + 金属 clack + 两声高频锁定音
+ d = .6; tt = t_(d)
+ f = 95 * np.exp(-tt * 9) + 42
+ body = np.sin(2 * np.pi * np.cumsum(f) / SR) * env_exp(d, .16)
+ clk = bp(noise(.05), 1800, 7000) * env_exp(.05, .006)
+ metal = sum(sine(fr, .25, .05) * a for fr, a in [(1210, .5), (2717, .3), (4430, .18)])
+ x = np.zeros(int(d * SR)); x += body * 1.0
+ x[:len(clk)] += clk * .7; x[:len(metal)] += metal * .45
+ b1 = blip(D6 + 12, .06, .35); b2 = blip(A5 + 12, .08, .3)
+ s = int(.07 * SR); x[s:s + len(b1)] += b1; s = int(.13 * SR); x[s:s + len(b2)] += b2
+ return att(norm(x)) * v
+
+def confirm(v=1.0): # 琥珀确认:D 小调三音叠置(D6 A6 E7 的柔和正弦 + 微颤)
+ d = 1.1; tt = t_(d); x = np.zeros(len(tt))
+ for m, a, dl in [(D6, 1, 0), (D6 + 7, .7, .03), (E6 + 12, .45, .06)]:
+ s = int(dl * SR); seg = np.sin(2 * np.pi * hz(m) * tt[:len(tt) - s] * (1 + .002 * np.sin(2 * np.pi * 5 * tt[:len(tt) - s]))) * env_exp(d - dl, .28)
+ x[s:] += seg * a
+ return att(norm(x), .01) * v
+
+def roll(d, v=1.0): # 数字滚动:24 fps 计数器咔哒,音高交替
+ n = max(1, int(d * 24)); x = np.zeros(int((d + .05) * SR))
+ for i in range(n):
+ s = int(i / 24 * SR); tk = tick(1.0, 2600 + 900 * (i % 3)); x[s:s + len(tk)] += tk * (0.6 + 0.4 * (i / n))
+ return x * v
+
+def zip_(up=True, d=.14, v=1.0):
+ tt = t_(d); f0, f1 = (700, 2600) if up else (2600, 700)
+ f = f0 * (f1 / f0) ** (tt / d); x = np.sin(2 * np.pi * np.cumsum(f) / SR) * np.sin(np.pi * tt / d)
+ return att(x) * v
+
+def whoosh(d=.5, lo=300, hi=3500, v=1.0, updown=False):
+ n = noise(d); out = np.zeros_like(n); L = len(n); step = 480
+ for i in range(0, L, step):
+ u = i / L; u = (1 - abs(2 * u - 1)) if updown else u; fc = lo * (hi / lo) ** u
+ w = min(step, L - i); seg = bp(n[max(0, i - 1500):i + w], fc * .7, min(fc * 1.4, SR / 2 - 100))[-w:]; out[i:i + w] = seg
+ return norm(out * np.sin(np.pi * t_(d) / d) ** 1.5) * v
+
+def servo(d, f0=180, f1=420, v=1.0): # 伺服滑轨
+ tt = t_(d); f = f0 + (f1 - f0) * tt / d
+ saw = 2 * ((np.cumsum(f) / SR) % 1) - 1
+ x = lp(saw, 1400) * .6 + bp(noise(d), 900, 2400) * .25
+ return att(x * np.sin(np.pi * tt / d) ** .5) * v
+
+def hiss(d=.7, v=1.0): # 油压嘶
+ x = bp(noise(d), 2200, 7500) * (1 - np.exp(-t_(d) / .02)) * env_exp(d, d * .35)
+ return att(norm(x)) * v
+
+def pneu(v=1.0): # 气压"噗"
+ d = .25; return att(norm(lp(noise(d), 900) * env_exp(d, .05) + sine(110, d, .04) * .4)) * v
+
+def tink(v=1.0):
+ d = .5; return att(norm(sum(sine(f, d, d * .2) * a for f, a in [(2380, 1), (3910, .6), (6120, .35)]))) * v
+
+def whine(d, f0=1800, f1=3400, v=1.0): # 电机电磁啸叫(J-cut 先进)
+ tt = t_(d); f = f0 + (f1 - f0) * np.clip(tt / (d * .6), 0, 1)
+ x = np.sin(2 * np.pi * np.cumsum(f) / SR) * (0.6 + 0.4 * np.sin(2 * np.pi * 31 * tt)) + np.sin(2 * np.pi * np.cumsum(f / 6) / SR) * .5
+ e = np.clip(tt / .4, 0, 1) * np.clip((d - tt) / .6, 0, 1)
+ return x * e * v
+
+def powerdown(d=.5, v=1.0):
+ tt = t_(d); f = 900 * (80 / 900) ** (tt / d)
+ return att(np.sin(2 * np.pi * np.cumsum(f) / SR) * (1 - tt / d) ** 1.5 + lp(noise(d), 600) * (1 - tt / d) * .2) * v
+
+def ignite(v=1.0): # 点亮:低频"嗡"起 + 亮噪声膨胀
+ d = 2.5; tt = t_(d)
+ sub = np.sin(2 * np.pi * np.cumsum(55 * np.exp(-tt * 1.5) + 36) / SR) * env_exp(d, .7)
+ air = hp(noise(d), 4000) * env_exp(d, .5) * .35
+ pad = sum(np.sin(2 * np.pi * hz(m) * tt) for m in [D5 - 12, A5 - 12, D5]) * env_exp(d, .9) * .15
+ return att(norm(sub + air + pad), .002) * v
+
+def glitch(d=.13, v=1.0): # 数码爆裂:降采样噪声块
+ x = np.zeros(int(d * SR)); pos = 0
+ while pos < len(x):
+ L = int(rng.uniform(.008, .03) * SR); hold = int(rng.integers(8, 60))
+ blk = np.repeat(rng.uniform(-1, 1, L // hold + 1), hold)[:L] * rng.uniform(.3, 1)
+ x[pos:pos + L] = blk[:len(x) - pos]; pos += L + int(rng.uniform(0, .006) * SR)
+ return hp(x, 200) * v
+
+def shimmer(d=1.2, v=1.0, up=True):
+ tt = t_(d); x = np.zeros(len(tt))
+ for k, m in enumerate([D6, F5 + 12, A5 + 12, C6 + 12, E6 + 12]):
+ c = (k + 1) / 6; e = np.exp(-((tt / d - (c if up else 1 - c)) ** 2) / .01)
+ x += np.sin(2 * np.pi * hz(m) * tt) * e
+ return x * v
+
+def ping(v=1.0, m=A5 + 12):
+ d = .6; return att(sine(hz(m), d, .15) + sine(hz(m) * 2.01, d, .05) * .2) * v
+
+def iris(opening=True, v=1.0):
+ d = .3; x = bp(noise(d), 3000, 9000) * env_exp(d, .05) * .5
+ z = zip_(opening, .25) * .5; x[:len(z)] += z
+ return att(x) * v
+
+# ─────────── 环境底 ───────────
+tt = np.arange(N) / SR
+hum = (np.sin(2 * np.pi * 40 * tt) * .5 + np.sin(2 * np.pi * 80 * tt) * .3 + np.sin(2 * np.pi * 120 * tt) * .06) * (1 + .05 * np.sin(2 * np.pi * .3 * tt))
+_b = brown(DUR + .1); room = lp(np.pad(_b, (0, max(0, N - len(_b))))[:N], 700)
+room = room / (np.abs(room).max() + 1e-9)
+bed = hum * .09 + room * .05
+beam = hp(bp(noise(DUR)[:N], 3000, 9000), 3000) * (0.6 + 0.4 * np.sin(2 * np.pi * 3.1 * tt)) * .018
+# 分段包络
+def envseg(a, b, fa=.05, fb=.05):
+ e = np.zeros(N); i0, i1 = int(a * SR), int(b * SR); e[i0:i1] = 1
+ return uniform_filter1d(e, int(max(fa, fb) * SR) + 1)
+ev_by = lambda ty: [e for e in EV if e['type'] == ty]
+ign = ev_by('ignite')[0]['t'] if ev_by('ignite') else DUR
+lock0 = ev_by('erase')[0]['t'] if ev_by('erase') else DUR
+beam_env = envseg(ign, DUR, .3) * np.where(tt < ign + 4, 1, .55)
+fade_end = np.clip((DUR - .3 - tt) / 3.0, 0, 1) # 片尾嗡鸣 L-cut 后淡出
+fade_in = np.clip(tt / .25, 0, 1)
+amb[:, 0] += (bed + beam * beam_env) * fade_end * fade_in; amb[:, 1] += (bed * .97 + beam * beam_env * 1.1) * fade_end * fade_in
+
+# ─────────── 事件 → 声音 ───────────
+tot = 0
+for e in EV:
+ t, ty = e['t'], e['type']; tot += 1
+ if ty == 'scan':
+ d = e['d']; tt2 = t_(d); f = 220 * (1300 / 220) ** (tt2 / d)
+ x = whoosh(d, 250, 5000, .5) + np.sin(2 * np.pi * np.cumsum(f) / SR) * (tt2 / d) ** 1.5 * .35
+ add(fol, x, t, .55)
+ elif ty == 'scan_tick': add(fol, tick(1, 2400 + 1200 * e['y']), t, .35, rng.uniform(-.3, .3))
+ elif ty == 'scan_done': add(fol, blip(D6 + 12, .5, 1, fm=.6), t, .3)
+ elif ty == 'roll': add(fol, roll(e['d']), t, .15)
+ elif ty == 'confirm_small': add(fol, blip(A5 + 12, .06, 1), t, .32); add(fol, blip(D6 + 12, .09, .8), t + .06, .32)
+ elif ty == 'type_line':
+ for k in range(3): add(fol, tick(1, 3600), t + k * .045, .25)
+ elif ty == 'detect': add(fol, blip([D5, F5, A5][e['i'] % 3] + 12, .18, 1, fm=1.2), t, .3, [-.4, 0, .4][e['i'] % 3])
+ elif ty == 'lock': add(fol, lock_hit(), t, .85)
+ elif ty == 'lock_small': add(fol, blip(D6 + 12, .07, 1) , t, .35, .5)
+ elif ty == 'push': add(fol, servo(e['d'], 90, 160, 1) * .6, t, .18)
+ elif ty == 'orbit': add(fol, whoosh(e['d'], 200, 900, 1, True), t, .08)
+ elif ty == 'explode':
+ p, d = e['part'], e['d']
+ if p == 'battery':
+ add(fol, servo(d, 160, 360), t, .2, -.2); add(fol, tick(1, 2000), t + d, .5)
+ add(fol, shimmer(.9, 1), t + d * .5, .12) # 电芯亮起
+ elif p == 'motor':
+ add(fol, pneu(), t, .45, -.3); add(fol, tick(1, 1500), t + d * .35, .5, -.2); add(fol, tick(1, 1700), t + d * .7, .5, .2); add(fol, tick(1, 1900), t + d, .5, .35)
+ else:
+ add(fol, hiss(.8), t, .22, .4); add(fol, tink(), t + d * .8, .35, .45)
+ elif ty == 'leader': add(fol, zip_(True, .14), t, .28)
+ elif ty == 'confirm': add(fol, confirm(), t, .3)
+ elif ty == 'reassemble': add(fol, zip_(False, .2) * .6, t, .25); add(fol, tick(1, 1700), t + .45, .45)
+ elif ty == 'dock': add(fol, blip(A5, .08, 1), t, .25, -.5)
+ elif ty == 'whip': add(fol, whoosh(e['d'], 300, 4500), t, .45)
+ elif ty == 'jcut':
+ if e["part"] == "motor": add(fol, whine(2.6, 1400, 3000), t, .03, -.2)
+ elif e['part'] == 'brakes': add(fol, hiss(.55), t, .18, .3)
+ elif ty == 'loupe_open': add(fol, iris(True), t, .35, .5)
+ elif ty == 'loupe_close': add(fol, iris(False), t, .3, .5)
+ elif ty == 'powerdown': add(fol, powerdown(e['d']), t, .35)
+ elif ty == 'ignite': add(fol, ignite(), t, .8)
+ elif ty == 'glitch': add(fol, glitch(e['d']), t, .35)
+ elif ty == 'wave': add(fol, shimmer(e['d'], 1, True), t, .09)
+ elif ty == 'spin': add(fol, whoosh(e['d'], 150, 1600, 1, True), t, .12)
+ elif ty == 'ping': add(fol, ping(1, [A5 + 12, C6 + 12, E6 + 12][e['i'] % 3]), t, .32, [-.3, 0, .3][e['i'] % 3])
+ elif ty == 'cta': add(fol, confirm(), t, .42)
+ elif ty == 'erase':
+ d = e['d']; tt2 = t_(d); f = 1300 * (200 / 1300) ** (tt2 / d)
+ add(fol, whoosh(d, 5000, 250, .5) + np.sin(2 * np.pi * np.cumsum(f) / SR) * (1 - tt2 / d) * .3, t, .45)
+ elif ty == 'card_tick': add(fol, blip(A5 + 12, .06, 1), t, .18)
+ elif ty == 'vo':
+ a, sr = sf.read(os.path.join(W, 'voices', e['id'] + '.wav'))
+ if a.ndim > 1: a = a.mean(1)
+ a = resample_poly(a, SR, sr); add(vox, a, t, 1.5)
+
+# ─────────── 配乐 + 闪避 ───────────
+mp = os.path.join(W, 'music', 'score.wav')
+mus = np.zeros((N, 2))
+if os.path.exists(mp):
+ m, sr = sf.read(mp)
+ if m.ndim == 1: m = np.stack([m, m], 1)
+ if sr != SR: m = resample_poly(m, SR, sr, axis=0)
+ L = min(N, len(m)); mus[:L] = m[:L]
+from scipy.ndimage import maximum_filter1d
+vo_env = np.abs(vox).max(1); vo_env = maximum_filter1d((vo_env > .01).astype(float), int(.5 * SR)) # 保持:字与字之间不回弹
+vo_env = uniform_filter1d(vo_env, int(.2 * SR))
+duck = 1 - .85 * np.clip(vo_env * 1.6, 0, 1) # 旁白期间音乐 −16.5 dB
+hi = [e for e in EV if e['type'] == 'ignite']
+if hi: mus *= (1 - .3 * envseg(hi[0]['t'] - .01, hi[0]['t'] + 4, .02, .5))[:, None] # 点亮段别把人声段压得太远
+mus *= duck[:, None] * .8; amb *= .8 * (1 - .3 * np.clip(vo_env, 0, 1))[:, None]
+
+# ─────────── 静音 ───────────
+for e in ev_by('silence'):
+ a, b = e['t'], e['t'] + e['d']
+ g = 1 - envseg(a + .02, b - .005, .03, .005) if e['kind'] == 'true' else 1 - envseg(a + .03, b - .01, .05, .01)
+ mus *= g[:, None]; fol *= g[:, None]
+ if e['kind'] == 'true': amb *= g[:, None]; vox *= g[:, None]
+ else: amb *= (0.55 + 0.45 * g)[:, None]
+ for i in range(2): # 真静音:严格归零
+ if e['kind'] == 'true': mus[int((a + .03) * SR):int((b - .01) * SR), i] = 0; fol[int((a + .03) * SR):int((b - .01) * SR), i] = 0; amb[int((a + .03) * SR):int((b - .01) * SR), i] = 0
+
+# 旁白期间拟音也让路 −15 dB(锁定、确认这两个信息落点不让)
+keep = np.zeros(N)
+for e in EV:
+ if e['type'] in ('lock', 'confirm', 'ignite'): keep[int(e['t'] * SR):int((e['t'] + .2) * SR)] = 1 # 只保起音,尾巴照样让路
+keep = uniform_filter1d(keep, int(.02 * SR))
+fol *= (1 - .82 * np.clip(vo_env * 1.6, 0, 1) * (1 - keep))[:, None]
+mix = mus + fol + amb + vox
+for i in range(2): mix[:, i] = limit(mix[:, i], .95)
+sf.write(os.path.join(W, 'mix.wav'), mix.astype(np.float32), SR)
+for nm, b in [('music', mus), ('foley', fol), ('amb', amb), ('vox', vox)]: sf.write(os.path.join(W, 'out', f'stem_{nm}.wav'), b.astype(np.float32), SR)
+print('mix.wav', DUR, 's', tot, 'events; peak', float(np.abs(mix).max()))
diff --git a/styles/hologram-hud/demo/models/gen_kite.mjs b/styles/hologram-hud/demo/models/gen_kite.mjs
new file mode 100644
index 0000000..8a714f1
--- /dev/null
+++ b/styles/hologram-hud/demo/models/gen_kite.mjs
@@ -0,0 +1,79 @@
+// 换内容测试用:虚构折叠航拍无人机 KITE M2 的线框模型 → kite.json
+// 用法:node gen_kite.mjs > kite.json 坐标:米;x 向前(机头),y 向上,z 向左。
+import { Model } from './mkmodel.mjs';
+const M = new Model('KITE M2');
+const BY = 0.085; // 机身中心高度
+
+// ---------- 机身 ----------
+M.part('body', { anchor: [0, BY + 0.03, 0] });
+M.piece('hull');
+M.tube([-0.11, BY, 0], [0.1, BY, 0], 0.042, { rings: 9, seg: 14, longs: 7 });
+M.disc([0.1, BY, 0], [1, 0, 0], 0.042, { rings: [0.042, 0.03, 0.015], seg: 14 });
+M.disc([-0.11, BY, 0], [-1, 0, 0], 0.042, { rings: [0.042, 0.028], seg: 14 });
+M.box([-0.005, BY + 0.045, 0], [0.15, 0.012, 0.06]); // 顶盖
+M.tube([-0.02, BY + 0.052, 0], [0.04, BY + 0.052, 0], 0.006, { rings: 2, seg: 8, longs: 3 }); // 顶部指示灯条
+// 脚架(在机臂下)
+// 起落架:从机身腹部(在机身管壁上)伸出,落地处有脚垫
+for (const [x, z] of [[0.07, 0.024], [0.07, -0.024], [-0.08, 0.024], [-0.08, -0.024]]) {
+ M.box([x, BY - 0.036, z], [0.016, 0.01, 0.012]); // 腹部安装座(贴在机身管壁上)
+ M.tube([x, BY - 0.036, z], [x * 1.25, 0.004, z * 2.9], 0.005, { rings: 3, seg: 6, longs: 2 });
+ M.box([x * 1.25, 0.004, z * 2.9], [0.03, 0.008, 0.012]); // 脚垫
+}
+
+// ---------- 机臂 + 电机 + 桨 ----------
+M.part('arms', { anchor: [-0.15, BY + 0.03, 0.155], center: [-0.15, BY + 0.05, 0.155], tagDir: -1 });
+M.piece('arm-beams');
+const ends = [[0.15, 0.155], [0.15, -0.155], [-0.15, 0.155], [-0.15, -0.155]];
+for (const [x, z] of ends) {
+ const hx = Math.sign(x) * 0.05, hz = Math.sign(z) * 0.035;
+ M.tube([hx, BY - 0.006, hz], [hx, BY + 0.028, hz], 0.012, { rings: 4, seg: 12, longs: 6 }); // 折叠铰链:竖直销轴筒(机臂绕它收回贴住机身)
+ M.box([hx - Math.sign(x) * 0.012, BY + 0.01, hz - Math.sign(z) * 0.004], [0.022, 0.03, 0.014]); // 铰链座(连到机身)
+ M.circle([hx, BY + 0.03, hz], [0, 1, 0], 0.005, 8); // 销轴帽
+ M.tube([hx, BY + 0.01, hz], [x, BY + 0.02, z], 0.011, { rings: 6, seg: 8, longs: 4 });
+ M.tube([x, BY + 0.005, z], [x, BY + 0.03, z], 0.019, { rings: 3, seg: 12, longs: 6 }); // 电机壳
+}
+M.piece('props', { explode: [0, 0.07, 0] });
+for (const [x, z] of ends) {
+ const c = [x, BY + 0.04, z];
+ M.circle(c, [0, 1, 0], 0.075, 40); // 桨盘
+ M.tube([x, BY + 0.032, z], [x, BY + 0.042, z], 0.008, { rings: 2, seg: 8, longs: 4 });
+ for (const a of [0.3, 0.3 + Math.PI]) { // 两片桨叶
+ const p = [x + Math.cos(a) * 0.07, BY + 0.04, z + Math.sin(a) * 0.07];
+ M.polyTube([[x, BY + 0.04, z], [x + Math.cos(a + 0.12) * 0.035, BY + 0.043, z + Math.sin(a + 0.12) * 0.035], p], 0.005, { seg: 6, longs: 2, ringsPer: 2 });
+ }
+}
+M.piece('motor-core', { explode: [0, 0.035, 0], internal: true, hot: true });
+for (const [x, z] of ends) M.stator([x, BY + 0.018, z], 0.016, 0.006, 0.01, 9);
+
+// ---------- 电池(机身尾部插入式):外壳沿机身轴向后滑出,电芯留在原位发亮 ----------
+M.part('battery', { anchor: [-0.075, BY + 0.01, 0.045], center: [-0.12, BY, 0.0], tagDir: -1 });
+M.piece('battery-pack', { explode: [-0.14, 0, 0] });
+M.box([-0.07, BY + 0.005, 0], [0.09, 0.05, 0.07]);
+M.box([-0.118, BY + 0.005, 0], [0.006, 0.03, 0.05]); // 拉手
+M.piece('battery-cells', { internal: true, hot: true });
+for (const z of [-0.018, 0.018]) M.tube([-0.105, BY + 0.005, z], [-0.035, BY + 0.005, z], 0.014, { rings: 3, seg: 10, longs: 4 });
+
+// ---------- 云台相机 ----------
+M.part('camera', { anchor: [0.155, BY - 0.035, 0.03], center: [0.16, BY - 0.035, 0.0], tagDir: 1 });
+M.piece('gimbal-yoke');
+M.tube([0.1, BY - 0.03, 0], [0.13, BY - 0.035, 0], 0.008, { rings: 3, seg: 8, longs: 3 });
+M.polyTube([[0.13, BY - 0.035, -0.028], [0.13, BY - 0.035, 0.028]], 0.005, { seg: 6, longs: 2, ringsPer: 3 });
+for (const z of [-0.028, 0.028]) M.tube([0.13, BY - 0.035, z], [0.15, BY - 0.045, z], 0.004, { rings: 2, seg: 6, longs: 2 });
+M.piece('camera-head', { explode: [0.07, -0.02, 0] });
+M.box([0.158, BY - 0.045, 0], [0.036, 0.034, 0.044]);
+M.tube([0.176, BY - 0.045, 0], [0.19, BY - 0.045, 0], 0.013, { rings: 3, seg: 14, longs: 6 });
+M.disc([0.19, BY - 0.045, 0], [1, 0, 0], 0.013, { rings: [0.013, 0.008, 0.004], seg: 14 });
+M.piece('camera-sensor', { explode: [0.035, -0.01, 0], internal: true, hot: true });
+M.box([0.158, BY - 0.045, 0], [0.004, 0.02, 0.026]);
+
+// ---------- 避障传感器:前后双目 + 底部 ----------
+M.part('sensors', { anchor: [0.1, BY + 0.01, 0.02], center: [0.06, BY, 0], tagDir: -1 });
+M.piece('sensor-front', { explode: [0.06, 0.015, 0] });
+for (const z of [-0.022, 0.022]) M.disc([0.104, BY + 0.012, z], [1, 0, 0], 0.009, { rings: [0.009, 0.005], seg: 12 });
+M.box([0.101, BY + 0.012, 0], [0.004, 0.02, 0.07]);
+M.piece('sensor-rear', { explode: [-0.06, 0.015, 0] });
+for (const z of [-0.022, 0.022]) M.disc([-0.114, BY + 0.018, z], [-1, 0, 0], 0.008, { rings: [0.008, 0.004], seg: 12 });
+M.piece('sensor-bottom', { explode: [0, -0.04, 0] });
+for (const x of [-0.02, 0.02]) M.disc([x, BY - 0.043, 0], [0, -1, 0], 0.008, { rings: [0.008, 0.004], seg: 12 });
+
+process.stdout.write(JSON.stringify(M.toJSON()));
diff --git a/styles/hologram-hud/demo/models/gen_volt.mjs b/styles/hologram-hud/demo/models/gen_volt.mjs
new file mode 100644
index 0000000..42de69b
--- /dev/null
+++ b/styles/hologram-hud/demo/models/gen_volt.mjs
@@ -0,0 +1,112 @@
+// 生成 VOLT CE-01 城市电助力车的线框模型(顶点 + 边 + 四边面),输出 volt.json
+// 用法:node gen_volt.mjs > volt.json
+// 坐标:米;x 向前(车头),y 向上,z 向车身左侧。地面 y = 0。
+import { Model } from './mkmodel.mjs';
+
+const M = new Model('VOLT CE-01');
+const R = 0.35; // 车轮半径(含胎)
+const RA = [-0.56, R, 0], FA = [0.56, R, 0]; // 后轴 / 前轴
+const BB = [-0.04, 0.29, 0]; // 五通
+const ST = [-0.24, 0.84, 0]; // 座管顶
+const HB = [0.40, 0.66, 0], HT = [0.35, 0.86, 0]; // 头管下 / 上
+const SC = [-0.21, 0.76, 0]; // 后上叉交汇
+
+// ---------- 车架 ----------
+M.part('frame', { anchor: [0.1, 0.7, 0] });
+M.piece('frame-main');
+M.tube(BB, ST, 0.019, { rings: 9, seg: 10, longs: 4 }); // 座管
+M.tube([-0.22, 0.79, 0], [0.37, 0.80, 0], 0.017, { rings: 10, seg: 10, longs: 4 }); // 上管
+M.tube(HB, HT, 0.024, { rings: 4, seg: 12, longs: 6 }); // 头管
+for (const s of [-1, 1]) {
+ M.tube(BB, [RA[0] + 0.02, RA[1], 0.065 * s], 0.012, { rings: 8, seg: 8, longs: 3, zA: 0.03 * s }); // 后下叉
+ M.tube(SC, [RA[0] + 0.02, RA[1] + 0.02, 0.065 * s], 0.010, { rings: 8, seg: 8, longs: 3, zA: 0.012 * s }); // 后上叉
+}
+// 前叉
+for (const s of [-1, 1]) M.tube([0.40, 0.64, 0.045 * s], [FA[0], FA[1], 0.05 * s], 0.013, { rings: 7, seg: 8, longs: 3 });
+M.tube([0.40, 0.64, -0.05], [0.40, 0.64, 0.05], 0.018, { rings: 3, seg: 8, longs: 4 }); // 叉肩
+// 把立 + 车把
+M.tube(HT, [0.36, 0.97, 0], 0.013, { rings: 4, seg: 8, longs: 4 });
+M.tube([0.36, 0.97, 0], [0.43, 0.99, 0], 0.013, { rings: 3, seg: 8, longs: 4 });
+M.box([0.43, 0.99, 0], [0.04, 0.04, 0.07]); // 车把夹
+M.polyTube([[0.33, 1.00, -0.32], [0.40, 1.00, -0.18], [0.43, 0.99, 0], [0.40, 1.00, 0.18], [0.33, 1.00, 0.32]], 0.011, { seg: 8, longs: 3, ringsPer: 3 });
+for (const s of [-1, 1]) M.tube([0.335, 1.0, 0.30 * s], [0.32, 1.0, 0.40 * s], 0.017, { rings: 4, seg: 8, longs: 4 }); // 握把
+// 座杆 + 座垫
+M.tube(ST, [-0.27, 0.95, 0], 0.014, { rings: 4, seg: 8, longs: 4 });
+M.saddle([-0.29, 0.975, 0]);
+M.box([-0.27, 0.955, 0], [0.05, 0.024, 0.04]); // 座杆夹
+for (const s of [-1, 1]) M.tube([-0.36, 0.966, 0.02 * s], [-0.19, 0.966, 0.02 * s], 0.004, { rings: 2, seg: 6, longs: 2 }); // 座垫导轨
+// 挡泥板
+M.fender(RA, R + 0.035, 0.05, 1.75, 3.35);
+M.fender(FA, R + 0.035, 0.05, 0.10, 1.65, true);
+for (const s of [-1, 1]) { // 挡泥板撑杆:接到轴上
+ M.tube([RA[0], RA[1], 0.03 * s], [RA[0] + Math.cos(2.6) * (R + 0.035), RA[1] + Math.sin(2.6) * (R + 0.035), 0.024 * s], 0.004, { rings: 2, seg: 6, longs: 2 });
+ M.tube([FA[0], FA[1], 0.05 * s], [FA[0] + Math.cos(0.35) * (R + 0.035), FA[1] + Math.sin(0.35) * (R + 0.035), 0.024 * s], 0.004, { rings: 2, seg: 6, longs: 2 });
+}
+M.tube([0.40, 0.64, 0], [0.43, 0.72 - 0.0, 0], 0.006, { rings: 2, seg: 6, longs: 2 }); // 前挡泥板接叉肩
+M.tube([SC[0], SC[1], 0], [-0.3, 0.74, 0], 0.006, { rings: 2, seg: 6, longs: 2 }); // 后挡泥板接后上叉
+// 前灯
+M.tube([0.355, 0.87, 0], [0.44, 0.88, 0], 0.007, { rings: 3, seg: 6, longs: 3 }); // 车灯支架(从头管伸出)
+M.tube([0.44, 0.88, 0], [0.49, 0.88, 0], 0.028, { rings: 3, seg: 12, longs: 6 });
+M.disc([0.495, 0.88, 0], [1, 0, 0], 0.028, { rings: [0.028, 0.018, 0.008], seg: 16 });
+
+// ---------- 传动(皮带 + 曲柄) ----------
+M.piece('drive');
+M.ring(BB, [0, 0, 1], 0.095, 32, 0.04); // 前皮带盘
+M.ring(BB, [0, 0, 1], 0.080, 32, 0.04);
+M.ring([RA[0], RA[1], 0.04], [0, 0, 1], 0.05, 24);
+M.beltLines([BB[0], BB[1], 0.04], 0.095, [RA[0], RA[1], 0.04], 0.05);
+for (const s of [-1, 1]) {
+ const ang = s > 0 ? -1.15 : 1.99;
+ const tip = [BB[0] + Math.cos(ang) * 0.17, BB[1] + Math.sin(ang) * 0.17, 0.08 * s];
+ M.tube([BB[0], BB[1], 0.06 * s], tip, 0.011, { rings: 4, seg: 6, longs: 3 });
+ M.box([tip[0], tip[1], tip[2] + 0.05 * s], [0.10, 0.018, 0.09]); // 脚踏
+}
+M.tube([BB[0], BB[1], -0.07], [BB[0], BB[1], 0.07], 0.024, { rings: 3, seg: 12, longs: 6 });
+
+// ---------- 车轮 ----------
+for (const [id, c] of [['wheel-r', RA], ['wheel-f', FA]]) {
+ M.part(id, { anchor: c });
+ M.piece(id);
+ M.wheel(c, R, { hub: id === 'wheel-f' ? 0.03 : 0.0, spokes: id === 'wheel-f' ? 24 : 18, spokeFrom: id === 'wheel-f' ? 0.03 : 0.095 });
+}
+
+// ---------- 电池(藏在下管里):外壳下盖 + 电芯阵列 + 管理板 ----------
+M.part('battery', { anchor: [0.19, 0.485, 0.05], tagDir: -1 });
+const dA = [BB[0] + 0.03, BB[1] + 0.03, 0], dB = [HB[0] - 0.01, HB[1] - 0.01, 0];
+M.piece('battery-shell', { explode: [0.0, 0.0, 0.0] });
+M.tube(dA, dB, 0.045, { rings: 14, seg: 14, longs: 6, arc: [0.58, 0.92] }); // 下管上半(固定)
+M.piece('battery-cover', { explode: [-0.2, -0.165, 0.07] });
+M.tube(dA, dB, 0.047, { rings: 14, seg: 10, longs: 5, arc: [-0.08, 0.58] }); // 下管下盖(滑出)
+M.piece('battery-cells', { explode: [0, 0, 0], internal: true, hot: true });
+M.cells(dA, dB, 0.03, 10, 2);
+M.piece('battery-bms', { explode: [0, 0, 0], internal: true });
+M.board(dA, dB, 0.30, 0.62);
+
+// ---------- 后轮毂电机:左盖 / 定子 / 转子磁环 / 右盖 ----------
+M.part('motor', { anchor: [RA[0], RA[1], 0.045], center: [RA[0], RA[1], 0.06] });
+M.piece('motor-capL', { explode: [0, 0, -0.11] });
+M.hubCap([RA[0], RA[1], -0.035], -1);
+M.piece('motor-rotor', { explode: [0, 0, 0.1], axis: { c: RA, d: [0, 0, 1] }, internal: true });
+M.magnetRing(RA, 0.088, 0.075, 0.05, 28);
+M.piece('motor-stator', { explode: [0, 0, 0.2], axis: { c: RA, d: [0, 0, 1] }, internal: true });
+M.stator(RA, 0.066, 0.03, 0.036, 24);
+M.piece('motor-capR', { explode: [0, 0, 0.31] });
+M.hubCap([RA[0], RA[1], 0.035], 1);
+
+// ---------- 前油压碟刹:碟片 / 卡钳两半 / 油管 ----------
+M.part('brakes', { anchor: [FA[0] - 0.033, FA[1] + 0.066, 0.09], center: [FA[0] - 0.036, FA[1] + 0.078, 0.08] });
+M.piece('brake-rotor', { box: false, explode: [0, 0, 0.01], axis: { c: [FA[0], FA[1], 0.06], d: [0, 0, 1] } });
+M.rotor([FA[0], FA[1], 0.06], 0.08);
+// 卡钳在碟片后上方(角度 AC、半径 RC),两半夹住碟片;拆开时钳体两侧分开,活塞比钳体少分开一点 = 活塞伸出,刹车片停在碟片两侧
+const RC = 0.074, AC = 2.03, ZR = 0.06;
+M.piece('brake-caliperA', { explode: [0, 0, 0.1] }); M.caliperHalf(FA, RC, AC, ZR, 1);
+M.piece('brake-pistonsA', { explode: [0, 0, 0.078], hot: true }); M.pistons(FA, RC, AC, ZR, 1);
+M.piece('brake-padA', { explode: [0, 0, 0.045] }); M.pad(FA, RC, AC, ZR, 1);
+M.piece('brake-caliperB', { explode: [0, 0, -0.06] }); M.caliperHalf(FA, RC, AC, ZR, -1);
+M.piece('brake-pistonsB', { explode: [0, 0, -0.043], hot: true }); M.pistons(FA, RC, AC, ZR, -1);
+M.piece('brake-padB', { explode: [0, 0, -0.025] }); M.pad(FA, RC, AC, ZR, -1);
+M.piece('brake-line', { explode: [0.0, 0.0, 0.10], box: false });
+M.polyTube([[FA[0] - 0.04, FA[1] + 0.085, 0.08], [0.47, 0.60, 0.07], [0.43, 0.75, 0.07], [0.40, 0.92, 0.08], [0.36, 0.99, 0.20], [0.34, 1.00, 0.27]], 0.006, { seg: 6, longs: 2, ringsPer: 3 });
+M.lever([0.34, 1.00, 0.27]);
+
+process.stdout.write(JSON.stringify(M.toJSON()));
diff --git a/styles/hologram-hud/demo/models/kite.json b/styles/hologram-hud/demo/models/kite.json
new file mode 100644
index 0000000..e350a69
--- /dev/null
+++ b/styles/hologram-hud/demo/models/kite.json
@@ -0,0 +1 @@
+{"name":"KITE M2","units":"m","up":"y","parts":[{"id":"body","anchor":[0,0.115,0],"pieces":[{"id":"hull","explode":[0,0,0],"v":[-0.11,0.085,0.042,-0.11,0.0668,0.0378,-0.11,0.0522,0.0262,-0.11,0.0441,0.0093,-0.11,0.0441,-0.0093,-0.11,0.0522,-0.0262,-0.11,0.0668,-0.0378,-0.11,0.085,-0.042,-0.11,0.1032,-0.0378,-0.11,0.1178,-0.0262,-0.11,0.1259,-0.0093,-0.11,0.1259,0.0093,-0.11,0.1178,0.0262,-0.11,0.1032,0.0378,-0.0837,0.085,0.042,-0.0837,0.0668,0.0378,-0.0837,0.0522,0.0262,-0.0837,0.0441,0.0093,-0.0837,0.0441,-0.0093,-0.0837,0.0522,-0.0262,-0.0837,0.0668,-0.0378,-0.0837,0.085,-0.042,-0.0837,0.1032,-0.0378,-0.0837,0.1178,-0.0262,-0.0837,0.1259,-0.0093,-0.0837,0.1259,0.0093,-0.0837,0.1178,0.0262,-0.0837,0.1032,0.0378,-0.0575,0.085,0.042,-0.0575,0.0668,0.0378,-0.0575,0.0522,0.0262,-0.0575,0.0441,0.0093,-0.0575,0.0441,-0.0093,-0.0575,0.0522,-0.0262,-0.0575,0.0668,-0.0378,-0.0575,0.085,-0.042,-0.0575,0.1032,-0.0378,-0.0575,0.1178,-0.0262,-0.0575,0.1259,-0.0093,-0.0575,0.1259,0.0093,-0.0575,0.1178,0.0262,-0.0575,0.1032,0.0378,-0.0312,0.085,0.042,-0.0312,0.0668,0.0378,-0.0312,0.0522,0.0262,-0.0312,0.0441,0.0093,-0.0312,0.0441,-0.0093,-0.0312,0.0522,-0.0262,-0.0312,0.0668,-0.0378,-0.0312,0.085,-0.042,-0.0312,0.1032,-0.0378,-0.0312,0.1178,-0.0262,-0.0312,0.1259,-0.0093,-0.0312,0.1259,0.0093,-0.0312,0.1178,0.0262,-0.0312,0.1032,0.0378,-0.005,0.085,0.042,-0.005,0.0668,0.0378,-0.005,0.0522,0.0262,-0.005,0.0441,0.0093,-0.005,0.0441,-0.0093,-0.005,0.0522,-0.0262,-0.005,0.0668,-0.0378,-0.005,0.085,-0.042,-0.005,0.1032,-0.0378,-0.005,0.1178,-0.0262,-0.005,0.1259,-0.0093,-0.005,0.1259,0.0093,-0.005,0.1178,0.0262,-0.005,0.1032,0.0378,0.0213,0.085,0.042,0.0213,0.0668,0.0378,0.0213,0.0522,0.0262,0.0213,0.0441,0.0093,0.0213,0.0441,-0.0093,0.0213,0.0522,-0.0262,0.0213,0.0668,-0.0378,0.0213,0.085,-0.042,0.0213,0.1032,-0.0378,0.0213,0.1178,-0.0262,0.0213,0.1259,-0.0093,0.0213,0.1259,0.0093,0.0213,0.1178,0.0262,0.0213,0.1032,0.0378,0.0475,0.085,0.042,0.0475,0.0668,0.0378,0.0475,0.0522,0.0262,0.0475,0.0441,0.0093,0.0475,0.0441,-0.0093,0.0475,0.0522,-0.0262,0.0475,0.0668,-0.0378,0.0475,0.085,-0.042,0.0475,0.1032,-0.0378,0.0475,0.1178,-0.0262,0.0475,0.1259,-0.0093,0.0475,0.1259,0.0093,0.0475,0.1178,0.0262,0.0475,0.1032,0.0378,0.0738,0.085,0.042,0.0738,0.0668,0.0378,0.0738,0.0522,0.0262,0.0738,0.0441,0.0093,0.0738,0.0441,-0.0093,0.0738,0.0522,-0.0262,0.0738,0.0668,-0.0378,0.0738,0.085,-0.042,0.0738,0.1032,-0.0378,0.0738,0.1178,-0.0262,0.0738,0.1259,-0.0093,0.0738,0.1259,0.0093,0.0738,0.1178,0.0262,0.0738,0.1032,0.0378,0.1,0.085,0.042,0.1,0.0668,0.0378,0.1,0.0522,0.0262,0.1,0.0441,0.0093,0.1,0.0441,-0.0093,0.1,0.0522,-0.0262,0.1,0.0668,-0.0378,0.1,0.085,-0.042,0.1,0.1032,-0.0378,0.1,0.1178,-0.0262,0.1,0.1259,-0.0093,0.1,0.1259,0.0093,0.1,0.1178,0.0262,0.1,0.1032,0.0378,0.1,0.085,0.042,0.1,0.0668,0.0378,0.1,0.0522,0.0262,0.1,0.0441,0.0093,0.1,0.0441,-0.0093,0.1,0.0522,-0.0262,0.1,0.0668,-0.0378,0.1,0.085,-0.042,0.1,0.1032,-0.0378,0.1,0.1178,-0.0262,0.1,0.1259,-0.0093,0.1,0.1259,0.0093,0.1,0.1178,0.0262,0.1,0.1032,0.0378,0.1,0.085,0.03,0.1,0.072,0.027,0.1,0.0615,0.0187,0.1,0.0558,0.0067,0.1,0.0558,-0.0067,0.1,0.0615,-0.0187,0.1,0.072,-0.027,0.1,0.085,-0.03,0.1,0.098,-0.027,0.1,0.1085,-0.0187,0.1,0.1142,-0.0067,0.1,0.1142,0.0067,0.1,0.1085,0.0187,0.1,0.098,0.027,0.1,0.085,0.015,0.1,0.0785,0.0135,0.1,0.0733,0.0094,0.1,0.0704,0.0033,0.1,0.0704,-0.0033,0.1,0.0733,-0.0094,0.1,0.0785,-0.0135,0.1,0.085,-0.015,0.1,0.0915,-0.0135,0.1,0.0967,-0.0094,0.1,0.0996,-0.0033,0.1,0.0996,0.0033,0.1,0.0967,0.0094,0.1,0.0915,0.0135,-0.11,0.085,-0.042,-0.11,0.0668,-0.0378,-0.11,0.0522,-0.0262,-0.11,0.0441,-0.0093,-0.11,0.0441,0.0093,-0.11,0.0522,0.0262,-0.11,0.0668,0.0378,-0.11,0.085,0.042,-0.11,0.1032,0.0378,-0.11,0.1178,0.0262,-0.11,0.1259,0.0093,-0.11,0.1259,-0.0093,-0.11,0.1178,-0.0262,-0.11,0.1032,-0.0378,-0.11,0.085,-0.028,-0.11,0.0729,-0.0252,-0.11,0.0631,-0.0175,-0.11,0.0577,-0.0062,-0.11,0.0577,0.0062,-0.11,0.0631,0.0175,-0.11,0.0729,0.0252,-0.11,0.085,0.028,-0.11,0.0971,0.0252,-0.11,0.1069,0.0175,-0.11,0.1123,0.0062,-0.11,0.1123,-0.0062,-0.11,0.1069,-0.0175,-0.11,0.0971,-0.0252,-0.08,0.124,-0.03,0.07,0.124,-0.03,-0.08,0.136,-0.03,0.07,0.136,-0.03,-0.08,0.124,0.03,0.07,0.124,0.03,-0.08,0.136,0.03,0.07,0.136,0.03,-0.02,0.137,0.006,-0.02,0.1328,0.0042,-0.02,0.131,0,-0.02,0.1328,-0.0042,-0.02,0.137,-0.006,-0.02,0.1412,-0.0042,-0.02,0.143,0,-0.02,0.1412,0.0042,0.04,0.137,0.006,0.04,0.1328,0.0042,0.04,0.131,0,0.04,0.1328,-0.0042,0.04,0.137,-0.006,0.04,0.1412,-0.0042,0.04,0.143,0,0.04,0.1412,0.0042,0.062,0.044,0.018,0.078,0.044,0.018,0.062,0.054,0.018,0.078,0.054,0.018,0.062,0.044,0.03,0.078,0.044,0.03,0.062,0.054,0.03,0.078,0.054,0.03,0.0653,0.049,0.0258,0.0666,0.0458,0.0222,0.0713,0.0458,0.0204,0.0747,0.049,0.0222,0.0734,0.0522,0.0258,0.0687,0.0522,0.0276,0.0741,0.0265,0.0486,0.0754,0.0233,0.045,0.08,0.0233,0.0432,0.0834,0.0265,0.045,0.0821,0.0297,0.0486,0.0775,0.0297,0.0504,0.0828,0.004,0.0714,0.0841,0.0008,0.0678,0.0888,0.0008,0.066,0.0922,0.004,0.0678,0.0909,0.0072,0.0714,0.0862,0.0072,0.0732,0.0725,0,0.0636,0.1025,0,0.0636,0.0725,0.008,0.0636,0.1025,0.008,0.0636,0.0725,0,0.0756,0.1025,0,0.0756,0.0725,0.008,0.0756,0.1025,0.008,0.0756,0.062,0.044,-0.03,0.078,0.044,-0.03,0.062,0.054,-0.03,0.078,0.054,-0.03,0.062,0.044,-0.018,0.078,0.044,-0.018,0.062,0.054,-0.018,0.078,0.054,-0.018,0.0747,0.049,-0.0222,0.0713,0.0458,-0.0204,0.0666,0.0458,-0.0222,0.0653,0.049,-0.0258,0.0687,0.0522,-0.0276,0.0734,0.0522,-0.0258,0.0834,0.0265,-0.045,0.08,0.0233,-0.0432,0.0754,0.0233,-0.045,0.0741,0.0265,-0.0486,0.0775,0.0297,-0.0504,0.0821,0.0297,-0.0486,0.0922,0.004,-0.0678,0.0888,0.0008,-0.066,0.0841,0.0008,-0.0678,0.0828,0.004,-0.0714,0.0862,0.0072,-0.0732,0.0909,0.0072,-0.0714,0.0725,0,-0.0756,0.1025,0,-0.0756,0.0725,0.008,-0.0756,0.1025,0.008,-0.0756,0.0725,0,-0.0636,0.1025,0,-0.0636,0.0725,0.008,-0.0636,0.1025,0.008,-0.0636,-0.088,0.044,0.018,-0.072,0.044,0.018,-0.088,0.054,0.018,-0.072,0.054,0.018,-0.088,0.044,0.03,-0.072,0.044,0.03,-0.088,0.054,0.03,-0.072,0.054,0.03,-0.0846,0.049,0.022,-0.0811,0.0458,0.0203,-0.0765,0.0458,0.0223,-0.0754,0.049,0.026,-0.0789,0.0522,0.0277,-0.0835,0.0522,0.0257,-0.0946,0.0265,0.0448,-0.0911,0.0233,0.0431,-0.0865,0.0233,0.0451,-0.0854,0.0265,0.0488,-0.0889,0.0297,0.0505,-0.0935,0.0297,0.0485,-0.1046,0.004,0.0676,-0.1011,0.0008,0.0659,-0.0965,0.0008,0.0679,-0.0954,0.004,0.0716,-0.0989,0.0072,0.0733,-0.1035,0.0072,0.0713,-0.115,0,0.0636,-0.085,0,0.0636,-0.115,0.008,0.0636,-0.085,0.008,0.0636,-0.115,0,0.0756,-0.085,0,0.0756,-0.115,0.008,0.0756,-0.085,0.008,0.0756,-0.088,0.044,-0.03,-0.072,0.044,-0.03,-0.088,0.054,-0.03,-0.072,0.054,-0.03,-0.088,0.044,-0.018,-0.072,0.044,-0.018,-0.088,0.054,-0.018,-0.072,0.054,-0.018,-0.0754,0.049,-0.026,-0.0765,0.0458,-0.0223,-0.0811,0.0458,-0.0203,-0.0846,0.049,-0.022,-0.0835,0.0522,-0.0257,-0.0789,0.0522,-0.0277,-0.0854,0.0265,-0.0488,-0.0865,0.0233,-0.0451,-0.0911,0.0233,-0.0431,-0.0946,0.0265,-0.0448,-0.0935,0.0297,-0.0485,-0.0889,0.0297,-0.0505,-0.0954,0.004,-0.0716,-0.0965,0.0008,-0.0679,-0.1011,0.0008,-0.0659,-0.1046,0.004,-0.0676,-0.1035,0.0072,-0.0713,-0.0989,0.0072,-0.0733,-0.115,0,-0.0756,-0.085,0,-0.0756,-0.115,0.008,-0.0756,-0.085,0.008,-0.0756,-0.115,0,-0.0636,-0.085,0,-0.0636,-0.115,0.008,-0.0636,-0.085,0.008,-0.0636],"e":[0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,14,28,29,29,30,30,31,31,32,32,33,33,34,34,35,35,36,36,37,37,38,38,39,39,40,40,41,41,28,42,43,43,44,44,45,45,46,46,47,47,48,48,49,49,50,50,51,51,52,52,53,53,54,54,55,55,42,56,57,57,58,58,59,59,60,60,61,61,62,62,63,63,64,64,65,65,66,66,67,67,68,68,69,69,56,70,71,71,72,72,73,73,74,74,75,75,76,76,77,77,78,78,79,79,80,80,81,81,82,82,83,83,70,84,85,85,86,86,87,87,88,88,89,89,90,90,91,91,92,92,93,93,94,94,95,95,96,96,97,97,84,98,99,99,100,100,101,101,102,102,103,103,104,104,105,105,106,106,107,107,108,108,109,109,110,110,111,111,98,112,113,113,114,114,115,115,116,116,117,117,118,118,119,119,120,120,121,121,122,122,123,123,124,124,125,125,112,0,14,14,28,28,42,42,56,56,70,70,84,84,98,98,112,2,16,16,30,30,44,44,58,58,72,72,86,86,100,100,114,4,18,18,32,32,46,46,60,60,74,74,88,88,102,102,116,6,20,20,34,34,48,48,62,62,76,76,90,90,104,104,118,8,22,22,36,36,50,50,64,64,78,78,92,92,106,106,120,10,24,24,38,38,52,52,66,66,80,80,94,94,108,108,122,12,26,26,40,40,54,54,68,68,82,82,96,96,110,110,124,126,127,127,128,128,129,129,130,130,131,131,132,132,133,133,134,134,135,135,136,136,137,137,138,138,139,139,126,140,141,141,142,142,143,143,144,144,145,145,146,146,147,147,148,148,149,149,150,150,151,151,152,152,153,153,140,154,155,155,156,156,157,157,158,158,159,159,160,160,161,161,162,162,163,163,164,164,165,165,166,166,167,167,154,126,140,130,144,134,148,138,152,140,154,144,158,148,162,152,166,168,169,169,170,170,171,171,172,172,173,173,174,174,175,175,176,176,177,177,178,178,179,179,180,180,181,181,168,182,183,183,184,184,185,185,186,186,187,187,188,188,189,189,190,190,191,191,192,192,193,193,194,194,195,195,182,168,182,172,186,176,190,180,194,196,197,198,199,200,201,202,203,196,198,197,199,200,202,201,203,196,200,197,201,198,202,199,203,204,205,205,206,206,207,207,208,208,209,209,210,210,211,211,204,212,213,213,214,214,215,215,216,216,217,217,218,218,219,219,212,204,212,206,214,208,216,210,218,220,221,222,223,224,225,226,227,220,222,221,223,224,226,225,227,220,224,221,225,222,226,223,227,228,229,229,230,230,231,231,232,232,233,233,228,234,235,235,236,236,237,237,238,238,239,239,234,240,241,241,242,242,243,243,244,244,245,245,240,228,234,234,240,231,237,237,243,246,247,248,249,250,251,252,253,246,248,247,249,250,252,251,253,246,250,247,251,248,252,249,253,254,255,256,257,258,259,260,261,254,256,255,257,258,260,259,261,254,258,255,259,256,260,257,261,262,263,263,264,264,265,265,266,266,267,267,262,268,269,269,270,270,271,271,272,272,273,273,268,274,275,275,276,276,277,277,278,278,279,279,274,262,268,268,274,265,271,271,277,280,281,282,283,284,285,286,287,280,282,281,283,284,286,285,287,280,284,281,285,282,286,283,287,288,289,290,291,292,293,294,295,288,290,289,291,292,294,293,295,288,292,289,293,290,294,291,295,296,297,297,298,298,299,299,300,300,301,301,296,302,303,303,304,304,305,305,306,306,307,307,302,308,309,309,310,310,311,311,312,312,313,313,308,296,302,302,308,299,305,305,311,314,315,316,317,318,319,320,321,314,316,315,317,318,320,319,321,314,318,315,319,316,320,317,321,322,323,324,325,326,327,328,329,322,324,323,325,326,328,327,329,322,326,323,327,324,328,325,329,330,331,331,332,332,333,333,334,334,335,335,330,336,337,337,338,338,339,339,340,340,341,341,336,342,343,343,344,344,345,345,346,346,347,347,342,330,336,336,342,333,339,339,345,348,349,350,351,352,353,354,355,348,350,349,351,352,354,353,355,348,352,349,353,350,354,351,355],"q":[0,1,15,14,1,2,16,15,2,3,17,16,3,4,18,17,4,5,19,18,5,6,20,19,6,7,21,20,7,8,22,21,8,9,23,22,9,10,24,23,10,11,25,24,11,12,26,25,12,13,27,26,13,0,14,27,14,15,29,28,15,16,30,29,16,17,31,30,17,18,32,31,18,19,33,32,19,20,34,33,20,21,35,34,21,22,36,35,22,23,37,36,23,24,38,37,24,25,39,38,25,26,40,39,26,27,41,40,27,14,28,41,28,29,43,42,29,30,44,43,30,31,45,44,31,32,46,45,32,33,47,46,33,34,48,47,34,35,49,48,35,36,50,49,36,37,51,50,37,38,52,51,38,39,53,52,39,40,54,53,40,41,55,54,41,28,42,55,42,43,57,56,43,44,58,57,44,45,59,58,45,46,60,59,46,47,61,60,47,48,62,61,48,49,63,62,49,50,64,63,50,51,65,64,51,52,66,65,52,53,67,66,53,54,68,67,54,55,69,68,55,42,56,69,56,57,71,70,57,58,72,71,58,59,73,72,59,60,74,73,60,61,75,74,61,62,76,75,62,63,77,76,63,64,78,77,64,65,79,78,65,66,80,79,66,67,81,80,67,68,82,81,68,69,83,82,69,56,70,83,70,71,85,84,71,72,86,85,72,73,87,86,73,74,88,87,74,75,89,88,75,76,90,89,76,77,91,90,77,78,92,91,78,79,93,92,79,80,94,93,80,81,95,94,81,82,96,95,82,83,97,96,83,70,84,97,84,85,99,98,85,86,100,99,86,87,101,100,87,88,102,101,88,89,103,102,89,90,104,103,90,91,105,104,91,92,106,105,92,93,107,106,93,94,108,107,94,95,109,108,95,96,110,109,96,97,111,110,97,84,98,111,98,99,113,112,99,100,114,113,100,101,115,114,101,102,116,115,102,103,117,116,103,104,118,117,104,105,119,118,105,106,120,119,106,107,121,120,107,108,122,121,108,109,123,122,109,110,124,123,110,111,125,124,111,98,112,125,126,127,141,140,127,128,142,141,128,129,143,142,129,130,144,143,130,131,145,144,131,132,146,145,132,133,147,146,133,134,148,147,134,135,149,148,135,136,150,149,136,137,151,150,137,138,152,151,138,139,153,152,139,126,140,153,140,141,155,154,141,142,156,155,142,143,157,156,143,144,158,157,144,145,159,158,145,146,160,159,146,147,161,160,147,148,162,161,148,149,163,162,149,150,164,163,150,151,165,164,151,152,166,165,152,153,167,166,153,140,154,167,168,169,183,182,169,170,184,183,170,171,185,184,171,172,186,185,172,173,187,186,173,174,188,187,174,175,189,188,175,176,190,189,176,177,191,190,177,178,192,191,178,179,193,192,179,180,194,193,180,181,195,194,181,168,182,195,196,197,199,198,200,201,203,202,196,197,201,200,198,199,203,202,196,198,202,200,197,199,203,201,204,205,213,212,205,206,214,213,206,207,215,214,207,208,216,215,208,209,217,216,209,210,218,217,210,211,219,218,211,204,212,219,220,221,223,222,224,225,227,226,220,221,225,224,222,223,227,226,220,222,226,224,221,223,227,225,228,229,235,234,229,230,236,235,230,231,237,236,231,232,238,237,232,233,239,238,233,228,234,239,234,235,241,240,235,236,242,241,236,237,243,242,237,238,244,243,238,239,245,244,239,234,240,245,246,247,249,248,250,251,253,252,246,247,251,250,248,249,253,252,246,248,252,250,247,249,253,251,254,255,257,256,258,259,261,260,254,255,259,258,256,257,261,260,254,256,260,258,255,257,261,259,262,263,269,268,263,264,270,269,264,265,271,270,265,266,272,271,266,267,273,272,267,262,268,273,268,269,275,274,269,270,276,275,270,271,277,276,271,272,278,277,272,273,279,278,273,268,274,279,280,281,283,282,284,285,287,286,280,281,285,284,282,283,287,286,280,282,286,284,281,283,287,285,288,289,291,290,292,293,295,294,288,289,293,292,290,291,295,294,288,290,294,292,289,291,295,293,296,297,303,302,297,298,304,303,298,299,305,304,299,300,306,305,300,301,307,306,301,296,302,307,302,303,309,308,303,304,310,309,304,305,311,310,305,306,312,311,306,307,313,312,307,302,308,313,314,315,317,316,318,319,321,320,314,315,319,318,316,317,321,320,314,316,320,318,315,317,321,319,322,323,325,324,326,327,329,328,322,323,327,326,324,325,329,328,322,324,328,326,323,325,329,327,330,331,337,336,331,332,338,337,332,333,339,338,333,334,340,339,334,335,341,340,335,330,336,341,336,337,343,342,337,338,344,343,338,339,345,344,339,340,346,345,340,341,347,346,341,336,342,347,348,349,351,350,352,353,355,354,348,349,353,352,350,351,355,354,348,350,354,352,349,351,355,353]}]},{"id":"arms","anchor":[-0.15,0.115,0.155],"center":[-0.15,0.135,0.155],"tagDir":-1,"pieces":[{"id":"arm-beams","explode":[0,0,0],"v":[0.05,0.079,0.023,0.044,0.079,0.0246,0.0396,0.079,0.029,0.038,0.079,0.035,0.0396,0.079,0.041,0.044,0.079,0.0454,0.05,0.079,0.047,0.056,0.079,0.0454,0.0604,0.079,0.041,0.062,0.079,0.035,0.0604,0.079,0.029,0.056,0.079,0.0246,0.05,0.0903,0.023,0.044,0.0903,0.0246,0.0396,0.0903,0.029,0.038,0.0903,0.035,0.0396,0.0903,0.041,0.044,0.0903,0.0454,0.05,0.0903,0.047,0.056,0.0903,0.0454,0.0604,0.0903,0.041,0.062,0.0903,0.035,0.0604,0.0903,0.029,0.056,0.0903,0.0246,0.05,0.1017,0.023,0.044,0.1017,0.0246,0.0396,0.1017,0.029,0.038,0.1017,0.035,0.0396,0.1017,0.041,0.044,0.1017,0.0454,0.05,0.1017,0.047,0.056,0.1017,0.0454,0.0604,0.1017,0.041,0.062,0.1017,0.035,0.0604,0.1017,0.029,0.056,0.1017,0.0246,0.05,0.113,0.023,0.044,0.113,0.0246,0.0396,0.113,0.029,0.038,0.113,0.035,0.0396,0.113,0.041,0.044,0.113,0.0454,0.05,0.113,0.047,0.056,0.113,0.0454,0.0604,0.113,0.041,0.062,0.113,0.035,0.0604,0.113,0.029,0.056,0.113,0.0246,0.027,0.08,0.024,0.049,0.08,0.024,0.027,0.11,0.024,0.049,0.11,0.024,0.027,0.08,0.038,0.049,0.08,0.038,0.027,0.11,0.038,0.049,0.11,0.038,0.05,0.115,0.03,0.0465,0.115,0.0315,0.045,0.115,0.035,0.0465,0.115,0.0385,0.05,0.115,0.04,0.0535,0.115,0.0385,0.055,0.115,0.035,0.0535,0.115,0.0315,0.0415,0.095,0.042,0.0443,0.0872,0.0404,0.0504,0.084,0.0355,0.0563,0.0872,0.0304,0.0585,0.095,0.028,0.0557,0.1028,0.0296,0.0496,0.106,0.0345,0.0437,0.1028,0.0396,0.0615,0.097,0.066,0.0643,0.0892,0.0644,0.0704,0.086,0.0595,0.0763,0.0892,0.0544,0.0785,0.097,0.052,0.0757,0.1048,0.0536,0.0696,0.108,0.0585,0.0637,0.1048,0.0636,0.0815,0.099,0.09,0.0843,0.0912,0.0884,0.0904,0.088,0.0835,0.0963,0.0912,0.0784,0.0985,0.099,0.076,0.0957,0.1068,0.0776,0.0896,0.11,0.0825,0.0837,0.1068,0.0876,0.1015,0.101,0.114,0.1043,0.0932,0.1124,0.1104,0.09,0.1075,0.1163,0.0932,0.1024,0.1185,0.101,0.1,0.1157,0.1088,0.1016,0.1096,0.112,0.1065,0.1037,0.1088,0.1116,0.1215,0.103,0.138,0.1243,0.0952,0.1364,0.1304,0.092,0.1315,0.1363,0.0952,0.1264,0.1385,0.103,0.124,0.1357,0.1108,0.1256,0.1296,0.114,0.1305,0.1237,0.1108,0.1356,0.1415,0.105,0.162,0.1443,0.0972,0.1604,0.1504,0.094,0.1555,0.1563,0.0972,0.1504,0.1585,0.105,0.148,0.1557,0.1128,0.1496,0.1496,0.116,0.1545,0.1437,0.1128,0.1596,0.15,0.09,0.136,0.1405,0.09,0.1385,0.1335,0.09,0.1455,0.131,0.09,0.155,0.1335,0.09,0.1645,0.1405,0.09,0.1715,0.15,0.09,0.174,0.1595,0.09,0.1715,0.1665,0.09,0.1645,0.169,0.09,0.155,0.1665,0.09,0.1455,0.1595,0.09,0.1385,0.15,0.1025,0.136,0.1405,0.1025,0.1385,0.1335,0.1025,0.1455,0.131,0.1025,0.155,0.1335,0.1025,0.1645,0.1405,0.1025,0.1715,0.15,0.1025,0.174,0.1595,0.1025,0.1715,0.1665,0.1025,0.1645,0.169,0.1025,0.155,0.1665,0.1025,0.1455,0.1595,0.1025,0.1385,0.15,0.115,0.136,0.1405,0.115,0.1385,0.1335,0.115,0.1455,0.131,0.115,0.155,0.1335,0.115,0.1645,0.1405,0.115,0.1715,0.15,0.115,0.174,0.1595,0.115,0.1715,0.1665,0.115,0.1645,0.169,0.115,0.155,0.1665,0.115,0.1455,0.1595,0.115,0.1385,0.05,0.079,-0.047,0.044,0.079,-0.0454,0.0396,0.079,-0.041,0.038,0.079,-0.035,0.0396,0.079,-0.029,0.044,0.079,-0.0246,0.05,0.079,-0.023,0.056,0.079,-0.0246,0.0604,0.079,-0.029,0.062,0.079,-0.035,0.0604,0.079,-0.041,0.056,0.079,-0.0454,0.05,0.0903,-0.047,0.044,0.0903,-0.0454,0.0396,0.0903,-0.041,0.038,0.0903,-0.035,0.0396,0.0903,-0.029,0.044,0.0903,-0.0246,0.05,0.0903,-0.023,0.056,0.0903,-0.0246,0.0604,0.0903,-0.029,0.062,0.0903,-0.035,0.0604,0.0903,-0.041,0.056,0.0903,-0.0454,0.05,0.1017,-0.047,0.044,0.1017,-0.0454,0.0396,0.1017,-0.041,0.038,0.1017,-0.035,0.0396,0.1017,-0.029,0.044,0.1017,-0.0246,0.05,0.1017,-0.023,0.056,0.1017,-0.0246,0.0604,0.1017,-0.029,0.062,0.1017,-0.035,0.0604,0.1017,-0.041,0.056,0.1017,-0.0454,0.05,0.113,-0.047,0.044,0.113,-0.0454,0.0396,0.113,-0.041,0.038,0.113,-0.035,0.0396,0.113,-0.029,0.044,0.113,-0.0246,0.05,0.113,-0.023,0.056,0.113,-0.0246,0.0604,0.113,-0.029,0.062,0.113,-0.035,0.0604,0.113,-0.041,0.056,0.113,-0.0454,0.027,0.08,-0.038,0.049,0.08,-0.038,0.027,0.11,-0.038,0.049,0.11,-0.038,0.027,0.08,-0.024,0.049,0.08,-0.024,0.027,0.11,-0.024,0.049,0.11,-0.024,0.05,0.115,-0.04,0.0465,0.115,-0.0385,0.045,0.115,-0.035,0.0465,0.115,-0.0315,0.05,0.115,-0.03,0.0535,0.115,-0.0315,0.055,0.115,-0.035,0.0535,0.115,-0.0385,0.0585,0.095,-0.028,0.0563,0.0872,-0.0304,0.0504,0.084,-0.0355,0.0443,0.0872,-0.0404,0.0415,0.095,-0.042,0.0437,0.1028,-0.0396,0.0496,0.106,-0.0345,0.0557,0.1028,-0.0296,0.0785,0.097,-0.052,0.0763,0.0892,-0.0544,0.0704,0.086,-0.0595,0.0643,0.0892,-0.0644,0.0615,0.097,-0.066,0.0637,0.1048,-0.0636,0.0696,0.108,-0.0585,0.0757,0.1048,-0.0536,0.0985,0.099,-0.076,0.0963,0.0912,-0.0784,0.0904,0.088,-0.0835,0.0843,0.0912,-0.0884,0.0815,0.099,-0.09,0.0837,0.1068,-0.0876,0.0896,0.11,-0.0825,0.0957,0.1068,-0.0776,0.1185,0.101,-0.1,0.1163,0.0932,-0.1024,0.1104,0.09,-0.1075,0.1043,0.0932,-0.1124,0.1015,0.101,-0.114,0.1037,0.1088,-0.1116,0.1096,0.112,-0.1065,0.1157,0.1088,-0.1016,0.1385,0.103,-0.124,0.1363,0.0952,-0.1264,0.1304,0.092,-0.1315,0.1243,0.0952,-0.1364,0.1215,0.103,-0.138,0.1237,0.1108,-0.1356,0.1296,0.114,-0.1305,0.1357,0.1108,-0.1256,0.1585,0.105,-0.148,0.1563,0.0972,-0.1504,0.1504,0.094,-0.1555,0.1443,0.0972,-0.1604,0.1415,0.105,-0.162,0.1437,0.1128,-0.1596,0.1496,0.116,-0.1545,0.1557,0.1128,-0.1496,0.15,0.09,-0.174,0.1405,0.09,-0.1715,0.1335,0.09,-0.1645,0.131,0.09,-0.155,0.1335,0.09,-0.1455,0.1405,0.09,-0.1385,0.15,0.09,-0.136,0.1595,0.09,-0.1385,0.1665,0.09,-0.1455,0.169,0.09,-0.155,0.1665,0.09,-0.1645,0.1595,0.09,-0.1715,0.15,0.1025,-0.174,0.1405,0.1025,-0.1715,0.1335,0.1025,-0.1645,0.131,0.1025,-0.155,0.1335,0.1025,-0.1455,0.1405,0.1025,-0.1385,0.15,0.1025,-0.136,0.1595,0.1025,-0.1385,0.1665,0.1025,-0.1455,0.169,0.1025,-0.155,0.1665,0.1025,-0.1645,0.1595,0.1025,-0.1715,0.15,0.115,-0.174,0.1405,0.115,-0.1715,0.1335,0.115,-0.1645,0.131,0.115,-0.155,0.1335,0.115,-0.1455,0.1405,0.115,-0.1385,0.15,0.115,-0.136,0.1595,0.115,-0.1385,0.1665,0.115,-0.1455,0.169,0.115,-0.155,0.1665,0.115,-0.1645,0.1595,0.115,-0.1715,-0.05,0.079,0.023,-0.056,0.079,0.0246,-0.0604,0.079,0.029,-0.062,0.079,0.035,-0.0604,0.079,0.041,-0.056,0.079,0.0454,-0.05,0.079,0.047,-0.044,0.079,0.0454,-0.0396,0.079,0.041,-0.038,0.079,0.035,-0.0396,0.079,0.029,-0.044,0.079,0.0246,-0.05,0.0903,0.023,-0.056,0.0903,0.0246,-0.0604,0.0903,0.029,-0.062,0.0903,0.035,-0.0604,0.0903,0.041,-0.056,0.0903,0.0454,-0.05,0.0903,0.047,-0.044,0.0903,0.0454,-0.0396,0.0903,0.041,-0.038,0.0903,0.035,-0.0396,0.0903,0.029,-0.044,0.0903,0.0246,-0.05,0.1017,0.023,-0.056,0.1017,0.0246,-0.0604,0.1017,0.029,-0.062,0.1017,0.035,-0.0604,0.1017,0.041,-0.056,0.1017,0.0454,-0.05,0.1017,0.047,-0.044,0.1017,0.0454,-0.0396,0.1017,0.041,-0.038,0.1017,0.035,-0.0396,0.1017,0.029,-0.044,0.1017,0.0246,-0.05,0.113,0.023,-0.056,0.113,0.0246,-0.0604,0.113,0.029,-0.062,0.113,0.035,-0.0604,0.113,0.041,-0.056,0.113,0.0454,-0.05,0.113,0.047,-0.044,0.113,0.0454,-0.0396,0.113,0.041,-0.038,0.113,0.035,-0.0396,0.113,0.029,-0.044,0.113,0.0246,-0.049,0.08,0.024,-0.027,0.08,0.024,-0.049,0.11,0.024,-0.027,0.11,0.024,-0.049,0.08,0.038,-0.027,0.08,0.038,-0.049,0.11,0.038,-0.027,0.11,0.038,-0.05,0.115,0.03,-0.0535,0.115,0.0315,-0.055,0.115,0.035,-0.0535,0.115,0.0385,-0.05,0.115,0.04,-0.0465,0.115,0.0385,-0.045,0.115,0.035,-0.0465,0.115,0.0315,-0.0585,0.095,0.028,-0.0563,0.0872,0.0304,-0.0504,0.084,0.0355,-0.0443,0.0872,0.0404,-0.0415,0.095,0.042,-0.0437,0.1028,0.0396,-0.0496,0.106,0.0345,-0.0557,0.1028,0.0296,-0.0785,0.097,0.052,-0.0763,0.0892,0.0544,-0.0704,0.086,0.0595,-0.0643,0.0892,0.0644,-0.0615,0.097,0.066,-0.0637,0.1048,0.0636,-0.0696,0.108,0.0585,-0.0757,0.1048,0.0536,-0.0985,0.099,0.076,-0.0963,0.0912,0.0784,-0.0904,0.088,0.0835,-0.0843,0.0912,0.0884,-0.0815,0.099,0.09,-0.0837,0.1068,0.0876,-0.0896,0.11,0.0825,-0.0957,0.1068,0.0776,-0.1185,0.101,0.1,-0.1163,0.0932,0.1024,-0.1104,0.09,0.1075,-0.1043,0.0932,0.1124,-0.1015,0.101,0.114,-0.1037,0.1088,0.1116,-0.1096,0.112,0.1065,-0.1157,0.1088,0.1016,-0.1385,0.103,0.124,-0.1363,0.0952,0.1264,-0.1304,0.092,0.1315,-0.1243,0.0952,0.1364,-0.1215,0.103,0.138,-0.1237,0.1108,0.1356,-0.1296,0.114,0.1305,-0.1357,0.1108,0.1256,-0.1585,0.105,0.148,-0.1563,0.0972,0.1504,-0.1504,0.094,0.1555,-0.1443,0.0972,0.1604,-0.1415,0.105,0.162,-0.1437,0.1128,0.1596,-0.1496,0.116,0.1545,-0.1557,0.1128,0.1496,-0.15,0.09,0.136,-0.1595,0.09,0.1385,-0.1665,0.09,0.1455,-0.169,0.09,0.155,-0.1665,0.09,0.1645,-0.1595,0.09,0.1715,-0.15,0.09,0.174,-0.1405,0.09,0.1715,-0.1335,0.09,0.1645,-0.131,0.09,0.155,-0.1335,0.09,0.1455,-0.1405,0.09,0.1385,-0.15,0.1025,0.136,-0.1595,0.1025,0.1385,-0.1665,0.1025,0.1455,-0.169,0.1025,0.155,-0.1665,0.1025,0.1645,-0.1595,0.1025,0.1715,-0.15,0.1025,0.174,-0.1405,0.1025,0.1715,-0.1335,0.1025,0.1645,-0.131,0.1025,0.155,-0.1335,0.1025,0.1455,-0.1405,0.1025,0.1385,-0.15,0.115,0.136,-0.1595,0.115,0.1385,-0.1665,0.115,0.1455,-0.169,0.115,0.155,-0.1665,0.115,0.1645,-0.1595,0.115,0.1715,-0.15,0.115,0.174,-0.1405,0.115,0.1715,-0.1335,0.115,0.1645,-0.131,0.115,0.155,-0.1335,0.115,0.1455,-0.1405,0.115,0.1385,-0.05,0.079,-0.047,-0.056,0.079,-0.0454,-0.0604,0.079,-0.041,-0.062,0.079,-0.035,-0.0604,0.079,-0.029,-0.056,0.079,-0.0246,-0.05,0.079,-0.023,-0.044,0.079,-0.0246,-0.0396,0.079,-0.029,-0.038,0.079,-0.035,-0.0396,0.079,-0.041,-0.044,0.079,-0.0454,-0.05,0.0903,-0.047,-0.056,0.0903,-0.0454,-0.0604,0.0903,-0.041,-0.062,0.0903,-0.035,-0.0604,0.0903,-0.029,-0.056,0.0903,-0.0246,-0.05,0.0903,-0.023,-0.044,0.0903,-0.0246,-0.0396,0.0903,-0.029,-0.038,0.0903,-0.035,-0.0396,0.0903,-0.041,-0.044,0.0903,-0.0454,-0.05,0.1017,-0.047,-0.056,0.1017,-0.0454,-0.0604,0.1017,-0.041,-0.062,0.1017,-0.035,-0.0604,0.1017,-0.029,-0.056,0.1017,-0.0246,-0.05,0.1017,-0.023,-0.044,0.1017,-0.0246,-0.0396,0.1017,-0.029,-0.038,0.1017,-0.035,-0.0396,0.1017,-0.041,-0.044,0.1017,-0.0454,-0.05,0.113,-0.047,-0.056,0.113,-0.0454,-0.0604,0.113,-0.041,-0.062,0.113,-0.035,-0.0604,0.113,-0.029,-0.056,0.113,-0.0246,-0.05,0.113,-0.023,-0.044,0.113,-0.0246,-0.0396,0.113,-0.029,-0.038,0.113,-0.035,-0.0396,0.113,-0.041,-0.044,0.113,-0.0454,-0.049,0.08,-0.038,-0.027,0.08,-0.038,-0.049,0.11,-0.038,-0.027,0.11,-0.038,-0.049,0.08,-0.024,-0.027,0.08,-0.024,-0.049,0.11,-0.024,-0.027,0.11,-0.024,-0.05,0.115,-0.04,-0.0535,0.115,-0.0385,-0.055,0.115,-0.035,-0.0535,0.115,-0.0315,-0.05,0.115,-0.03,-0.0465,0.115,-0.0315,-0.045,0.115,-0.035,-0.0465,0.115,-0.0385,-0.0415,0.095,-0.042,-0.0443,0.0872,-0.0404,-0.0504,0.084,-0.0355,-0.0563,0.0872,-0.0304,-0.0585,0.095,-0.028,-0.0557,0.1028,-0.0296,-0.0496,0.106,-0.0345,-0.0437,0.1028,-0.0396,-0.0615,0.097,-0.066,-0.0643,0.0892,-0.0644,-0.0704,0.086,-0.0595,-0.0763,0.0892,-0.0544,-0.0785,0.097,-0.052,-0.0757,0.1048,-0.0536,-0.0696,0.108,-0.0585,-0.0637,0.1048,-0.0636,-0.0815,0.099,-0.09,-0.0843,0.0912,-0.0884,-0.0904,0.088,-0.0835,-0.0963,0.0912,-0.0784,-0.0985,0.099,-0.076,-0.0957,0.1068,-0.0776,-0.0896,0.11,-0.0825,-0.0837,0.1068,-0.0876,-0.1015,0.101,-0.114,-0.1043,0.0932,-0.1124,-0.1104,0.09,-0.1075,-0.1163,0.0932,-0.1024,-0.1185,0.101,-0.1,-0.1157,0.1088,-0.1016,-0.1096,0.112,-0.1065,-0.1037,0.1088,-0.1116,-0.1215,0.103,-0.138,-0.1243,0.0952,-0.1364,-0.1304,0.092,-0.1315,-0.1363,0.0952,-0.1264,-0.1385,0.103,-0.124,-0.1357,0.1108,-0.1256,-0.1296,0.114,-0.1305,-0.1237,0.1108,-0.1356,-0.1415,0.105,-0.162,-0.1443,0.0972,-0.1604,-0.1504,0.094,-0.1555,-0.1563,0.0972,-0.1504,-0.1585,0.105,-0.148,-0.1557,0.1128,-0.1496,-0.1496,0.116,-0.1545,-0.1437,0.1128,-0.1596,-0.15,0.09,-0.174,-0.1595,0.09,-0.1715,-0.1665,0.09,-0.1645,-0.169,0.09,-0.155,-0.1665,0.09,-0.1455,-0.1595,0.09,-0.1385,-0.15,0.09,-0.136,-0.1405,0.09,-0.1385,-0.1335,0.09,-0.1455,-0.131,0.09,-0.155,-0.1335,0.09,-0.1645,-0.1405,0.09,-0.1715,-0.15,0.1025,-0.174,-0.1595,0.1025,-0.1715,-0.1665,0.1025,-0.1645,-0.169,0.1025,-0.155,-0.1665,0.1025,-0.1455,-0.1595,0.1025,-0.1385,-0.15,0.1025,-0.136,-0.1405,0.1025,-0.1385,-0.1335,0.1025,-0.1455,-0.131,0.1025,-0.155,-0.1335,0.1025,-0.1645,-0.1405,0.1025,-0.1715,-0.15,0.115,-0.174,-0.1595,0.115,-0.1715,-0.1665,0.115,-0.1645,-0.169,0.115,-0.155,-0.1665,0.115,-0.1455,-0.1595,0.115,-0.1385,-0.15,0.115,-0.136,-0.1405,0.115,-0.1385,-0.1335,0.115,-0.1455,-0.131,0.115,-0.155,-0.1335,0.115,-0.1645,-0.1405,0.115,-0.1715],"e":[0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,0,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,12,24,25,25,26,26,27,27,28,28,29,29,30,30,31,31,32,32,33,33,34,34,35,35,24,36,37,37,38,38,39,39,40,40,41,41,42,42,43,43,44,44,45,45,46,46,47,47,36,0,12,12,24,24,36,2,14,14,26,26,38,4,16,16,28,28,40,6,18,18,30,30,42,8,20,20,32,32,44,10,22,22,34,34,46,48,49,50,51,52,53,54,55,48,50,49,51,52,54,53,55,48,52,49,53,50,54,51,55,56,57,57,58,58,59,59,60,60,61,61,62,62,63,63,56,64,65,65,66,66,67,67,68,68,69,69,70,70,71,71,64,72,73,73,74,74,75,75,76,76,77,77,78,78,79,79,72,80,81,81,82,82,83,83,84,84,85,85,86,86,87,87,80,88,89,89,90,90,91,91,92,92,93,93,94,94,95,95,88,96,97,97,98,98,99,99,100,100,101,101,102,102,103,103,96,104,105,105,106,106,107,107,108,108,109,109,110,110,111,111,104,64,72,72,80,80,88,88,96,96,104,66,74,74,82,82,90,90,98,98,106,68,76,76,84,84,92,92,100,100,108,70,78,78,86,86,94,94,102,102,110,112,113,113,114,114,115,115,116,116,117,117,118,118,119,119,120,120,121,121,122,122,123,123,112,124,125,125,126,126,127,127,128,128,129,129,130,130,131,131,132,132,133,133,134,134,135,135,124,136,137,137,138,138,139,139,140,140,141,141,142,142,143,143,144,144,145,145,146,146,147,147,136,112,124,124,136,114,126,126,138,116,128,128,140,118,130,130,142,120,132,132,144,122,134,134,146,148,149,149,150,150,151,151,152,152,153,153,154,154,155,155,156,156,157,157,158,158,159,159,148,160,161,161,162,162,163,163,164,164,165,165,166,166,167,167,168,168,169,169,170,170,171,171,160,172,173,173,174,174,175,175,176,176,177,177,178,178,179,179,180,180,181,181,182,182,183,183,172,184,185,185,186,186,187,187,188,188,189,189,190,190,191,191,192,192,193,193,194,194,195,195,184,148,160,160,172,172,184,150,162,162,174,174,186,152,164,164,176,176,188,154,166,166,178,178,190,156,168,168,180,180,192,158,170,170,182,182,194,196,197,198,199,200,201,202,203,196,198,197,199,200,202,201,203,196,200,197,201,198,202,199,203,204,205,205,206,206,207,207,208,208,209,209,210,210,211,211,204,212,213,213,214,214,215,215,216,216,217,217,218,218,219,219,212,220,221,221,222,222,223,223,224,224,225,225,226,226,227,227,220,228,229,229,230,230,231,231,232,232,233,233,234,234,235,235,228,236,237,237,238,238,239,239,240,240,241,241,242,242,243,243,236,244,245,245,246,246,247,247,248,248,249,249,250,250,251,251,244,252,253,253,254,254,255,255,256,256,257,257,258,258,259,259,252,212,220,220,228,228,236,236,244,244,252,214,222,222,230,230,238,238,246,246,254,216,224,224,232,232,240,240,248,248,256,218,226,226,234,234,242,242,250,250,258,260,261,261,262,262,263,263,264,264,265,265,266,266,267,267,268,268,269,269,270,270,271,271,260,272,273,273,274,274,275,275,276,276,277,277,278,278,279,279,280,280,281,281,282,282,283,283,272,284,285,285,286,286,287,287,288,288,289,289,290,290,291,291,292,292,293,293,294,294,295,295,284,260,272,272,284,262,274,274,286,264,276,276,288,266,278,278,290,268,280,280,292,270,282,282,294,296,297,297,298,298,299,299,300,300,301,301,302,302,303,303,304,304,305,305,306,306,307,307,296,308,309,309,310,310,311,311,312,312,313,313,314,314,315,315,316,316,317,317,318,318,319,319,308,320,321,321,322,322,323,323,324,324,325,325,326,326,327,327,328,328,329,329,330,330,331,331,320,332,333,333,334,334,335,335,336,336,337,337,338,338,339,339,340,340,341,341,342,342,343,343,332,296,308,308,320,320,332,298,310,310,322,322,334,300,312,312,324,324,336,302,314,314,326,326,338,304,316,316,328,328,340,306,318,318,330,330,342,344,345,346,347,348,349,350,351,344,346,345,347,348,350,349,351,344,348,345,349,346,350,347,351,352,353,353,354,354,355,355,356,356,357,357,358,358,359,359,352,360,361,361,362,362,363,363,364,364,365,365,366,366,367,367,360,368,369,369,370,370,371,371,372,372,373,373,374,374,375,375,368,376,377,377,378,378,379,379,380,380,381,381,382,382,383,383,376,384,385,385,386,386,387,387,388,388,389,389,390,390,391,391,384,392,393,393,394,394,395,395,396,396,397,397,398,398,399,399,392,400,401,401,402,402,403,403,404,404,405,405,406,406,407,407,400,360,368,368,376,376,384,384,392,392,400,362,370,370,378,378,386,386,394,394,402,364,372,372,380,380,388,388,396,396,404,366,374,374,382,382,390,390,398,398,406,408,409,409,410,410,411,411,412,412,413,413,414,414,415,415,416,416,417,417,418,418,419,419,408,420,421,421,422,422,423,423,424,424,425,425,426,426,427,427,428,428,429,429,430,430,431,431,420,432,433,433,434,434,435,435,436,436,437,437,438,438,439,439,440,440,441,441,442,442,443,443,432,408,420,420,432,410,422,422,434,412,424,424,436,414,426,426,438,416,428,428,440,418,430,430,442,444,445,445,446,446,447,447,448,448,449,449,450,450,451,451,452,452,453,453,454,454,455,455,444,456,457,457,458,458,459,459,460,460,461,461,462,462,463,463,464,464,465,465,466,466,467,467,456,468,469,469,470,470,471,471,472,472,473,473,474,474,475,475,476,476,477,477,478,478,479,479,468,480,481,481,482,482,483,483,484,484,485,485,486,486,487,487,488,488,489,489,490,490,491,491,480,444,456,456,468,468,480,446,458,458,470,470,482,448,460,460,472,472,484,450,462,462,474,474,486,452,464,464,476,476,488,454,466,466,478,478,490,492,493,494,495,496,497,498,499,492,494,493,495,496,498,497,499,492,496,493,497,494,498,495,499,500,501,501,502,502,503,503,504,504,505,505,506,506,507,507,500,508,509,509,510,510,511,511,512,512,513,513,514,514,515,515,508,516,517,517,518,518,519,519,520,520,521,521,522,522,523,523,516,524,525,525,526,526,527,527,528,528,529,529,530,530,531,531,524,532,533,533,534,534,535,535,536,536,537,537,538,538,539,539,532,540,541,541,542,542,543,543,544,544,545,545,546,546,547,547,540,548,549,549,550,550,551,551,552,552,553,553,554,554,555,555,548,508,516,516,524,524,532,532,540,540,548,510,518,518,526,526,534,534,542,542,550,512,520,520,528,528,536,536,544,544,552,514,522,522,530,530,538,538,546,546,554,556,557,557,558,558,559,559,560,560,561,561,562,562,563,563,564,564,565,565,566,566,567,567,556,568,569,569,570,570,571,571,572,572,573,573,574,574,575,575,576,576,577,577,578,578,579,579,568,580,581,581,582,582,583,583,584,584,585,585,586,586,587,587,588,588,589,589,590,590,591,591,580,556,568,568,580,558,570,570,582,560,572,572,584,562,574,574,586,564,576,576,588,566,578,578,590],"q":[0,1,13,12,1,2,14,13,2,3,15,14,3,4,16,15,4,5,17,16,5,6,18,17,6,7,19,18,7,8,20,19,8,9,21,20,9,10,22,21,10,11,23,22,11,0,12,23,12,13,25,24,13,14,26,25,14,15,27,26,15,16,28,27,16,17,29,28,17,18,30,29,18,19,31,30,19,20,32,31,20,21,33,32,21,22,34,33,22,23,35,34,23,12,24,35,24,25,37,36,25,26,38,37,26,27,39,38,27,28,40,39,28,29,41,40,29,30,42,41,30,31,43,42,31,32,44,43,32,33,45,44,33,34,46,45,34,35,47,46,35,24,36,47,48,49,51,50,52,53,55,54,48,49,53,52,50,51,55,54,48,50,54,52,49,51,55,53,64,65,73,72,65,66,74,73,66,67,75,74,67,68,76,75,68,69,77,76,69,70,78,77,70,71,79,78,71,64,72,79,72,73,81,80,73,74,82,81,74,75,83,82,75,76,84,83,76,77,85,84,77,78,86,85,78,79,87,86,79,72,80,87,80,81,89,88,81,82,90,89,82,83,91,90,83,84,92,91,84,85,93,92,85,86,94,93,86,87,95,94,87,80,88,95,88,89,97,96,89,90,98,97,90,91,99,98,91,92,100,99,92,93,101,100,93,94,102,101,94,95,103,102,95,88,96,103,96,97,105,104,97,98,106,105,98,99,107,106,99,100,108,107,100,101,109,108,101,102,110,109,102,103,111,110,103,96,104,111,112,113,125,124,113,114,126,125,114,115,127,126,115,116,128,127,116,117,129,128,117,118,130,129,118,119,131,130,119,120,132,131,120,121,133,132,121,122,134,133,122,123,135,134,123,112,124,135,124,125,137,136,125,126,138,137,126,127,139,138,127,128,140,139,128,129,141,140,129,130,142,141,130,131,143,142,131,132,144,143,132,133,145,144,133,134,146,145,134,135,147,146,135,124,136,147,148,149,161,160,149,150,162,161,150,151,163,162,151,152,164,163,152,153,165,164,153,154,166,165,154,155,167,166,155,156,168,167,156,157,169,168,157,158,170,169,158,159,171,170,159,148,160,171,160,161,173,172,161,162,174,173,162,163,175,174,163,164,176,175,164,165,177,176,165,166,178,177,166,167,179,178,167,168,180,179,168,169,181,180,169,170,182,181,170,171,183,182,171,160,172,183,172,173,185,184,173,174,186,185,174,175,187,186,175,176,188,187,176,177,189,188,177,178,190,189,178,179,191,190,179,180,192,191,180,181,193,192,181,182,194,193,182,183,195,194,183,172,184,195,196,197,199,198,200,201,203,202,196,197,201,200,198,199,203,202,196,198,202,200,197,199,203,201,212,213,221,220,213,214,222,221,214,215,223,222,215,216,224,223,216,217,225,224,217,218,226,225,218,219,227,226,219,212,220,227,220,221,229,228,221,222,230,229,222,223,231,230,223,224,232,231,224,225,233,232,225,226,234,233,226,227,235,234,227,220,228,235,228,229,237,236,229,230,238,237,230,231,239,238,231,232,240,239,232,233,241,240,233,234,242,241,234,235,243,242,235,228,236,243,236,237,245,244,237,238,246,245,238,239,247,246,239,240,248,247,240,241,249,248,241,242,250,249,242,243,251,250,243,236,244,251,244,245,253,252,245,246,254,253,246,247,255,254,247,248,256,255,248,249,257,256,249,250,258,257,250,251,259,258,251,244,252,259,260,261,273,272,261,262,274,273,262,263,275,274,263,264,276,275,264,265,277,276,265,266,278,277,266,267,279,278,267,268,280,279,268,269,281,280,269,270,282,281,270,271,283,282,271,260,272,283,272,273,285,284,273,274,286,285,274,275,287,286,275,276,288,287,276,277,289,288,277,278,290,289,278,279,291,290,279,280,292,291,280,281,293,292,281,282,294,293,282,283,295,294,283,272,284,295,296,297,309,308,297,298,310,309,298,299,311,310,299,300,312,311,300,301,313,312,301,302,314,313,302,303,315,314,303,304,316,315,304,305,317,316,305,306,318,317,306,307,319,318,307,296,308,319,308,309,321,320,309,310,322,321,310,311,323,322,311,312,324,323,312,313,325,324,313,314,326,325,314,315,327,326,315,316,328,327,316,317,329,328,317,318,330,329,318,319,331,330,319,308,320,331,320,321,333,332,321,322,334,333,322,323,335,334,323,324,336,335,324,325,337,336,325,326,338,337,326,327,339,338,327,328,340,339,328,329,341,340,329,330,342,341,330,331,343,342,331,320,332,343,344,345,347,346,348,349,351,350,344,345,349,348,346,347,351,350,344,346,350,348,345,347,351,349,360,361,369,368,361,362,370,369,362,363,371,370,363,364,372,371,364,365,373,372,365,366,374,373,366,367,375,374,367,360,368,375,368,369,377,376,369,370,378,377,370,371,379,378,371,372,380,379,372,373,381,380,373,374,382,381,374,375,383,382,375,368,376,383,376,377,385,384,377,378,386,385,378,379,387,386,379,380,388,387,380,381,389,388,381,382,390,389,382,383,391,390,383,376,384,391,384,385,393,392,385,386,394,393,386,387,395,394,387,388,396,395,388,389,397,396,389,390,398,397,390,391,399,398,391,384,392,399,392,393,401,400,393,394,402,401,394,395,403,402,395,396,404,403,396,397,405,404,397,398,406,405,398,399,407,406,399,392,400,407,408,409,421,420,409,410,422,421,410,411,423,422,411,412,424,423,412,413,425,424,413,414,426,425,414,415,427,426,415,416,428,427,416,417,429,428,417,418,430,429,418,419,431,430,419,408,420,431,420,421,433,432,421,422,434,433,422,423,435,434,423,424,436,435,424,425,437,436,425,426,438,437,426,427,439,438,427,428,440,439,428,429,441,440,429,430,442,441,430,431,443,442,431,420,432,443,444,445,457,456,445,446,458,457,446,447,459,458,447,448,460,459,448,449,461,460,449,450,462,461,450,451,463,462,451,452,464,463,452,453,465,464,453,454,466,465,454,455,467,466,455,444,456,467,456,457,469,468,457,458,470,469,458,459,471,470,459,460,472,471,460,461,473,472,461,462,474,473,462,463,475,474,463,464,476,475,464,465,477,476,465,466,478,477,466,467,479,478,467,456,468,479,468,469,481,480,469,470,482,481,470,471,483,482,471,472,484,483,472,473,485,484,473,474,486,485,474,475,487,486,475,476,488,487,476,477,489,488,477,478,490,489,478,479,491,490,479,468,480,491,492,493,495,494,496,497,499,498,492,493,497,496,494,495,499,498,492,494,498,496,493,495,499,497,508,509,517,516,509,510,518,517,510,511,519,518,511,512,520,519,512,513,521,520,513,514,522,521,514,515,523,522,515,508,516,523,516,517,525,524,517,518,526,525,518,519,527,526,519,520,528,527,520,521,529,528,521,522,530,529,522,523,531,530,523,516,524,531,524,525,533,532,525,526,534,533,526,527,535,534,527,528,536,535,528,529,537,536,529,530,538,537,530,531,539,538,531,524,532,539,532,533,541,540,533,534,542,541,534,535,543,542,535,536,544,543,536,537,545,544,537,538,546,545,538,539,547,546,539,532,540,547,540,541,549,548,541,542,550,549,542,543,551,550,543,544,552,551,544,545,553,552,545,546,554,553,546,547,555,554,547,540,548,555,556,557,569,568,557,558,570,569,558,559,571,570,559,560,572,571,560,561,573,572,561,562,574,573,562,563,575,574,563,564,576,575,564,565,577,576,565,566,578,577,566,567,579,578,567,556,568,579,568,569,581,580,569,570,582,581,570,571,583,582,571,572,584,583,572,573,585,584,573,574,586,585,574,575,587,586,575,576,588,587,576,577,589,588,577,578,590,589,578,579,591,590,579,568,580,591]},{"id":"props","explode":[0,0.07,0],"v":[0.15,0.125,0.08,0.1383,0.125,0.0809,0.1268,0.125,0.0837,0.116,0.125,0.0882,0.1059,0.125,0.0943,0.097,0.125,0.102,0.0893,0.125,0.1109,0.0832,0.125,0.121,0.0787,0.125,0.1318,0.0759,0.125,0.1433,0.075,0.125,0.155,0.0759,0.125,0.1667,0.0787,0.125,0.1782,0.0832,0.125,0.189,0.0893,0.125,0.1991,0.097,0.125,0.208,0.1059,0.125,0.2157,0.116,0.125,0.2218,0.1268,0.125,0.2263,0.1383,0.125,0.2291,0.15,0.125,0.23,0.1617,0.125,0.2291,0.1732,0.125,0.2263,0.184,0.125,0.2218,0.1941,0.125,0.2157,0.203,0.125,0.208,0.2107,0.125,0.1991,0.2168,0.125,0.189,0.2213,0.125,0.1782,0.2241,0.125,0.1667,0.225,0.125,0.155,0.2241,0.125,0.1433,0.2213,0.125,0.1318,0.2168,0.125,0.121,0.2107,0.125,0.1109,0.203,0.125,0.102,0.1941,0.125,0.0943,0.184,0.125,0.0882,0.1732,0.125,0.0837,0.1617,0.125,0.0809,0.15,0.117,0.147,0.1443,0.117,0.1493,0.142,0.117,0.155,0.1443,0.117,0.1607,0.15,0.117,0.163,0.1557,0.117,0.1607,0.158,0.117,0.155,0.1557,0.117,0.1493,0.15,0.127,0.147,0.1443,0.127,0.1493,0.142,0.127,0.155,0.1443,0.127,0.1607,0.15,0.127,0.163,0.1557,0.127,0.1607,0.158,0.127,0.155,0.1557,0.127,0.1493,0.148,0.125,0.1596,0.1493,0.1207,0.1574,0.1514,0.1207,0.1529,0.152,0.125,0.1504,0.1507,0.1293,0.1526,0.1486,0.1293,0.1571,0.1799,0.128,0.1738,0.1813,0.1237,0.1717,0.1833,0.1237,0.1671,0.184,0.128,0.1647,0.1826,0.1323,0.1668,0.1806,0.1323,0.1714,0.1811,0.128,0.1742,0.1811,0.1237,0.1717,0.1821,0.1237,0.1667,0.1829,0.128,0.1644,0.1828,0.1323,0.1669,0.1819,0.1323,0.1718,0.216,0.125,0.1806,0.2161,0.1207,0.1781,0.217,0.1207,0.1732,0.2178,0.125,0.1708,0.2177,0.1293,0.1733,0.2168,0.1293,0.1782,0.152,0.125,0.1504,0.1507,0.1207,0.1526,0.1486,0.1207,0.1571,0.148,0.125,0.1596,0.1493,0.1293,0.1574,0.1514,0.1293,0.1529,0.1201,0.128,0.1362,0.1187,0.1237,0.1383,0.1167,0.1237,0.1429,0.116,0.128,0.1453,0.1174,0.1323,0.1432,0.1194,0.1323,0.1386,0.1189,0.128,0.1358,0.1189,0.1237,0.1383,0.1179,0.1237,0.1433,0.1171,0.128,0.1456,0.1172,0.1323,0.1431,0.1181,0.1323,0.1382,0.084,0.125,0.1294,0.0839,0.1207,0.1319,0.083,0.1207,0.1368,0.0822,0.125,0.1392,0.0823,0.1293,0.1367,0.0832,0.1293,0.1318,0.15,0.125,-0.23,0.1383,0.125,-0.2291,0.1268,0.125,-0.2263,0.116,0.125,-0.2218,0.1059,0.125,-0.2157,0.097,0.125,-0.208,0.0893,0.125,-0.1991,0.0832,0.125,-0.189,0.0787,0.125,-0.1782,0.0759,0.125,-0.1667,0.075,0.125,-0.155,0.0759,0.125,-0.1433,0.0787,0.125,-0.1318,0.0832,0.125,-0.121,0.0893,0.125,-0.1109,0.097,0.125,-0.102,0.1059,0.125,-0.0943,0.116,0.125,-0.0882,0.1268,0.125,-0.0837,0.1383,0.125,-0.0809,0.15,0.125,-0.08,0.1617,0.125,-0.0809,0.1732,0.125,-0.0837,0.184,0.125,-0.0882,0.1941,0.125,-0.0943,0.203,0.125,-0.102,0.2107,0.125,-0.1109,0.2168,0.125,-0.121,0.2213,0.125,-0.1318,0.2241,0.125,-0.1433,0.225,0.125,-0.155,0.2241,0.125,-0.1667,0.2213,0.125,-0.1782,0.2168,0.125,-0.189,0.2107,0.125,-0.1991,0.203,0.125,-0.208,0.1941,0.125,-0.2157,0.184,0.125,-0.2218,0.1732,0.125,-0.2263,0.1617,0.125,-0.2291,0.15,0.117,-0.163,0.1443,0.117,-0.1607,0.142,0.117,-0.155,0.1443,0.117,-0.1493,0.15,0.117,-0.147,0.1557,0.117,-0.1493,0.158,0.117,-0.155,0.1557,0.117,-0.1607,0.15,0.127,-0.163,0.1443,0.127,-0.1607,0.142,0.127,-0.155,0.1443,0.127,-0.1493,0.15,0.127,-0.147,0.1557,0.127,-0.1493,0.158,0.127,-0.155,0.1557,0.127,-0.1607,0.148,0.125,-0.1504,0.1493,0.1207,-0.1526,0.1514,0.1207,-0.1571,0.152,0.125,-0.1596,0.1507,0.1293,-0.1574,0.1486,0.1293,-0.1529,0.1799,0.128,-0.1362,0.1813,0.1237,-0.1383,0.1833,0.1237,-0.1429,0.184,0.128,-0.1453,0.1826,0.1323,-0.1432,0.1806,0.1323,-0.1386,0.1811,0.128,-0.1358,0.1811,0.1237,-0.1383,0.1821,0.1237,-0.1433,0.1829,0.128,-0.1456,0.1828,0.1323,-0.1431,0.1819,0.1323,-0.1382,0.216,0.125,-0.1294,0.2161,0.1207,-0.1319,0.217,0.1207,-0.1368,0.2178,0.125,-0.1392,0.2177,0.1293,-0.1367,0.2168,0.1293,-0.1318,0.152,0.125,-0.1596,0.1507,0.1207,-0.1574,0.1486,0.1207,-0.1529,0.148,0.125,-0.1504,0.1493,0.1293,-0.1526,0.1514,0.1293,-0.1571,0.1201,0.128,-0.1738,0.1187,0.1237,-0.1717,0.1167,0.1237,-0.1671,0.116,0.128,-0.1647,0.1174,0.1323,-0.1668,0.1194,0.1323,-0.1714,0.1189,0.128,-0.1742,0.1189,0.1237,-0.1717,0.1179,0.1237,-0.1667,0.1171,0.128,-0.1644,0.1172,0.1323,-0.1669,0.1181,0.1323,-0.1718,0.084,0.125,-0.1806,0.0839,0.1207,-0.1781,0.083,0.1207,-0.1732,0.0822,0.125,-0.1708,0.0823,0.1293,-0.1733,0.0832,0.1293,-0.1782,-0.15,0.125,0.08,-0.1617,0.125,0.0809,-0.1732,0.125,0.0837,-0.184,0.125,0.0882,-0.1941,0.125,0.0943,-0.203,0.125,0.102,-0.2107,0.125,0.1109,-0.2168,0.125,0.121,-0.2213,0.125,0.1318,-0.2241,0.125,0.1433,-0.225,0.125,0.155,-0.2241,0.125,0.1667,-0.2213,0.125,0.1782,-0.2168,0.125,0.189,-0.2107,0.125,0.1991,-0.203,0.125,0.208,-0.1941,0.125,0.2157,-0.184,0.125,0.2218,-0.1732,0.125,0.2263,-0.1617,0.125,0.2291,-0.15,0.125,0.23,-0.1383,0.125,0.2291,-0.1268,0.125,0.2263,-0.116,0.125,0.2218,-0.1059,0.125,0.2157,-0.097,0.125,0.208,-0.0893,0.125,0.1991,-0.0832,0.125,0.189,-0.0787,0.125,0.1782,-0.0759,0.125,0.1667,-0.075,0.125,0.155,-0.0759,0.125,0.1433,-0.0787,0.125,0.1318,-0.0832,0.125,0.121,-0.0893,0.125,0.1109,-0.097,0.125,0.102,-0.1059,0.125,0.0943,-0.116,0.125,0.0882,-0.1268,0.125,0.0837,-0.1383,0.125,0.0809,-0.15,0.117,0.147,-0.1557,0.117,0.1493,-0.158,0.117,0.155,-0.1557,0.117,0.1607,-0.15,0.117,0.163,-0.1443,0.117,0.1607,-0.142,0.117,0.155,-0.1443,0.117,0.1493,-0.15,0.127,0.147,-0.1557,0.127,0.1493,-0.158,0.127,0.155,-0.1557,0.127,0.1607,-0.15,0.127,0.163,-0.1443,0.127,0.1607,-0.142,0.127,0.155,-0.1443,0.127,0.1493,-0.152,0.125,0.1596,-0.1507,0.1207,0.1574,-0.1486,0.1207,0.1529,-0.148,0.125,0.1504,-0.1493,0.1293,0.1526,-0.1514,0.1293,0.1571,-0.1201,0.128,0.1738,-0.1187,0.1237,0.1717,-0.1167,0.1237,0.1671,-0.116,0.128,0.1647,-0.1174,0.1323,0.1668,-0.1194,0.1323,0.1714,-0.1189,0.128,0.1742,-0.1189,0.1237,0.1717,-0.1179,0.1237,0.1667,-0.1171,0.128,0.1644,-0.1172,0.1323,0.1669,-0.1181,0.1323,0.1718,-0.084,0.125,0.1806,-0.0839,0.1207,0.1781,-0.083,0.1207,0.1732,-0.0822,0.125,0.1708,-0.0823,0.1293,0.1733,-0.0832,0.1293,0.1782,-0.148,0.125,0.1504,-0.1493,0.1207,0.1526,-0.1514,0.1207,0.1571,-0.152,0.125,0.1596,-0.1507,0.1293,0.1574,-0.1486,0.1293,0.1529,-0.1799,0.128,0.1362,-0.1813,0.1237,0.1383,-0.1833,0.1237,0.1429,-0.184,0.128,0.1453,-0.1826,0.1323,0.1432,-0.1806,0.1323,0.1386,-0.1811,0.128,0.1358,-0.1811,0.1237,0.1383,-0.1821,0.1237,0.1433,-0.1829,0.128,0.1456,-0.1828,0.1323,0.1431,-0.1819,0.1323,0.1382,-0.216,0.125,0.1294,-0.2161,0.1207,0.1319,-0.217,0.1207,0.1368,-0.2178,0.125,0.1392,-0.2177,0.1293,0.1367,-0.2168,0.1293,0.1318,-0.15,0.125,-0.23,-0.1617,0.125,-0.2291,-0.1732,0.125,-0.2263,-0.184,0.125,-0.2218,-0.1941,0.125,-0.2157,-0.203,0.125,-0.208,-0.2107,0.125,-0.1991,-0.2168,0.125,-0.189,-0.2213,0.125,-0.1782,-0.2241,0.125,-0.1667,-0.225,0.125,-0.155,-0.2241,0.125,-0.1433,-0.2213,0.125,-0.1318,-0.2168,0.125,-0.121,-0.2107,0.125,-0.1109,-0.203,0.125,-0.102,-0.1941,0.125,-0.0943,-0.184,0.125,-0.0882,-0.1732,0.125,-0.0837,-0.1617,0.125,-0.0809,-0.15,0.125,-0.08,-0.1383,0.125,-0.0809,-0.1268,0.125,-0.0837,-0.116,0.125,-0.0882,-0.1059,0.125,-0.0943,-0.097,0.125,-0.102,-0.0893,0.125,-0.1109,-0.0832,0.125,-0.121,-0.0787,0.125,-0.1318,-0.0759,0.125,-0.1433,-0.075,0.125,-0.155,-0.0759,0.125,-0.1667,-0.0787,0.125,-0.1782,-0.0832,0.125,-0.189,-0.0893,0.125,-0.1991,-0.097,0.125,-0.208,-0.1059,0.125,-0.2157,-0.116,0.125,-0.2218,-0.1268,0.125,-0.2263,-0.1383,0.125,-0.2291,-0.15,0.117,-0.163,-0.1557,0.117,-0.1607,-0.158,0.117,-0.155,-0.1557,0.117,-0.1493,-0.15,0.117,-0.147,-0.1443,0.117,-0.1493,-0.142,0.117,-0.155,-0.1443,0.117,-0.1607,-0.15,0.127,-0.163,-0.1557,0.127,-0.1607,-0.158,0.127,-0.155,-0.1557,0.127,-0.1493,-0.15,0.127,-0.147,-0.1443,0.127,-0.1493,-0.142,0.127,-0.155,-0.1443,0.127,-0.1607,-0.152,0.125,-0.1504,-0.1507,0.1207,-0.1526,-0.1486,0.1207,-0.1571,-0.148,0.125,-0.1596,-0.1493,0.1293,-0.1574,-0.1514,0.1293,-0.1529,-0.1201,0.128,-0.1362,-0.1187,0.1237,-0.1383,-0.1167,0.1237,-0.1429,-0.116,0.128,-0.1453,-0.1174,0.1323,-0.1432,-0.1194,0.1323,-0.1386,-0.1189,0.128,-0.1358,-0.1189,0.1237,-0.1383,-0.1179,0.1237,-0.1433,-0.1171,0.128,-0.1456,-0.1172,0.1323,-0.1431,-0.1181,0.1323,-0.1382,-0.084,0.125,-0.1294,-0.0839,0.1207,-0.1319,-0.083,0.1207,-0.1368,-0.0822,0.125,-0.1392,-0.0823,0.1293,-0.1367,-0.0832,0.1293,-0.1318,-0.148,0.125,-0.1596,-0.1493,0.1207,-0.1574,-0.1514,0.1207,-0.1529,-0.152,0.125,-0.1504,-0.1507,0.1293,-0.1526,-0.1486,0.1293,-0.1571,-0.1799,0.128,-0.1738,-0.1813,0.1237,-0.1717,-0.1833,0.1237,-0.1671,-0.184,0.128,-0.1647,-0.1826,0.1323,-0.1668,-0.1806,0.1323,-0.1714,-0.1811,0.128,-0.1742,-0.1811,0.1237,-0.1717,-0.1821,0.1237,-0.1667,-0.1829,0.128,-0.1644,-0.1828,0.1323,-0.1669,-0.1819,0.1323,-0.1718,-0.216,0.125,-0.1806,-0.2161,0.1207,-0.1781,-0.217,0.1207,-0.1732,-0.2178,0.125,-0.1708,-0.2177,0.1293,-0.1733,-0.2168,0.1293,-0.1782],"e":[0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,30,30,31,31,32,32,33,33,34,34,35,35,36,36,37,37,38,38,39,39,0,40,41,41,42,42,43,43,44,44,45,45,46,46,47,47,40,48,49,49,50,50,51,51,52,52,53,53,54,54,55,55,48,40,48,42,50,44,52,46,54,56,57,57,58,58,59,59,60,60,61,61,56,62,63,63,64,64,65,65,66,66,67,67,62,56,62,59,65,68,69,69,70,70,71,71,72,72,73,73,68,74,75,75,76,76,77,77,78,78,79,79,74,68,74,71,77,80,81,81,82,82,83,83,84,84,85,85,80,86,87,87,88,88,89,89,90,90,91,91,86,80,86,83,89,92,93,93,94,94,95,95,96,96,97,97,92,98,99,99,100,100,101,101,102,102,103,103,98,92,98,95,101,104,105,105,106,106,107,107,108,108,109,109,110,110,111,111,112,112,113,113,114,114,115,115,116,116,117,117,118,118,119,119,120,120,121,121,122,122,123,123,124,124,125,125,126,126,127,127,128,128,129,129,130,130,131,131,132,132,133,133,134,134,135,135,136,136,137,137,138,138,139,139,140,140,141,141,142,142,143,143,104,144,145,145,146,146,147,147,148,148,149,149,150,150,151,151,144,152,153,153,154,154,155,155,156,156,157,157,158,158,159,159,152,144,152,146,154,148,156,150,158,160,161,161,162,162,163,163,164,164,165,165,160,166,167,167,168,168,169,169,170,170,171,171,166,160,166,163,169,172,173,173,174,174,175,175,176,176,177,177,172,178,179,179,180,180,181,181,182,182,183,183,178,172,178,175,181,184,185,185,186,186,187,187,188,188,189,189,184,190,191,191,192,192,193,193,194,194,195,195,190,184,190,187,193,196,197,197,198,198,199,199,200,200,201,201,196,202,203,203,204,204,205,205,206,206,207,207,202,196,202,199,205,208,209,209,210,210,211,211,212,212,213,213,214,214,215,215,216,216,217,217,218,218,219,219,220,220,221,221,222,222,223,223,224,224,225,225,226,226,227,227,228,228,229,229,230,230,231,231,232,232,233,233,234,234,235,235,236,236,237,237,238,238,239,239,240,240,241,241,242,242,243,243,244,244,245,245,246,246,247,247,208,248,249,249,250,250,251,251,252,252,253,253,254,254,255,255,248,256,257,257,258,258,259,259,260,260,261,261,262,262,263,263,256,248,256,250,258,252,260,254,262,264,265,265,266,266,267,267,268,268,269,269,264,270,271,271,272,272,273,273,274,274,275,275,270,264,270,267,273,276,277,277,278,278,279,279,280,280,281,281,276,282,283,283,284,284,285,285,286,286,287,287,282,276,282,279,285,288,289,289,290,290,291,291,292,292,293,293,288,294,295,295,296,296,297,297,298,298,299,299,294,288,294,291,297,300,301,301,302,302,303,303,304,304,305,305,300,306,307,307,308,308,309,309,310,310,311,311,306,300,306,303,309,312,313,313,314,314,315,315,316,316,317,317,318,318,319,319,320,320,321,321,322,322,323,323,324,324,325,325,326,326,327,327,328,328,329,329,330,330,331,331,332,332,333,333,334,334,335,335,336,336,337,337,338,338,339,339,340,340,341,341,342,342,343,343,344,344,345,345,346,346,347,347,348,348,349,349,350,350,351,351,312,352,353,353,354,354,355,355,356,356,357,357,358,358,359,359,352,360,361,361,362,362,363,363,364,364,365,365,366,366,367,367,360,352,360,354,362,356,364,358,366,368,369,369,370,370,371,371,372,372,373,373,368,374,375,375,376,376,377,377,378,378,379,379,374,368,374,371,377,380,381,381,382,382,383,383,384,384,385,385,380,386,387,387,388,388,389,389,390,390,391,391,386,380,386,383,389,392,393,393,394,394,395,395,396,396,397,397,392,398,399,399,400,400,401,401,402,402,403,403,398,392,398,395,401,404,405,405,406,406,407,407,408,408,409,409,404,410,411,411,412,412,413,413,414,414,415,415,410,404,410,407,413],"q":[40,41,49,48,41,42,50,49,42,43,51,50,43,44,52,51,44,45,53,52,45,46,54,53,46,47,55,54,47,40,48,55,56,57,63,62,57,58,64,63,58,59,65,64,59,60,66,65,60,61,67,66,61,56,62,67,68,69,75,74,69,70,76,75,70,71,77,76,71,72,78,77,72,73,79,78,73,68,74,79,80,81,87,86,81,82,88,87,82,83,89,88,83,84,90,89,84,85,91,90,85,80,86,91,92,93,99,98,93,94,100,99,94,95,101,100,95,96,102,101,96,97,103,102,97,92,98,103,144,145,153,152,145,146,154,153,146,147,155,154,147,148,156,155,148,149,157,156,149,150,158,157,150,151,159,158,151,144,152,159,160,161,167,166,161,162,168,167,162,163,169,168,163,164,170,169,164,165,171,170,165,160,166,171,172,173,179,178,173,174,180,179,174,175,181,180,175,176,182,181,176,177,183,182,177,172,178,183,184,185,191,190,185,186,192,191,186,187,193,192,187,188,194,193,188,189,195,194,189,184,190,195,196,197,203,202,197,198,204,203,198,199,205,204,199,200,206,205,200,201,207,206,201,196,202,207,248,249,257,256,249,250,258,257,250,251,259,258,251,252,260,259,252,253,261,260,253,254,262,261,254,255,263,262,255,248,256,263,264,265,271,270,265,266,272,271,266,267,273,272,267,268,274,273,268,269,275,274,269,264,270,275,276,277,283,282,277,278,284,283,278,279,285,284,279,280,286,285,280,281,287,286,281,276,282,287,288,289,295,294,289,290,296,295,290,291,297,296,291,292,298,297,292,293,299,298,293,288,294,299,300,301,307,306,301,302,308,307,302,303,309,308,303,304,310,309,304,305,311,310,305,300,306,311,352,353,361,360,353,354,362,361,354,355,363,362,355,356,364,363,356,357,365,364,357,358,366,365,358,359,367,366,359,352,360,367,368,369,375,374,369,370,376,375,370,371,377,376,371,372,378,377,372,373,379,378,373,368,374,379,380,381,387,386,381,382,388,387,382,383,389,388,383,384,390,389,384,385,391,390,385,380,386,391,392,393,399,398,393,394,400,399,394,395,401,400,395,396,402,401,396,397,403,402,397,392,398,403,404,405,411,410,405,406,412,411,406,407,413,412,407,408,414,413,408,409,415,414,409,404,410,415]},{"id":"motor-core","explode":[0,0.035,0],"internal":true,"hot":true,"v":[0.144,0.103,0.15,0.1441,0.102,0.15,0.1444,0.1009,0.15,0.1448,0.1,0.15,0.1454,0.0991,0.15,0.1461,0.0984,0.15,0.147,0.0978,0.15,0.1479,0.0974,0.15,0.149,0.0971,0.15,0.15,0.097,0.15,0.151,0.0971,0.15,0.1521,0.0974,0.15,0.153,0.0978,0.15,0.1539,0.0984,0.15,0.1546,0.0991,0.15,0.1552,0.1,0.15,0.1556,0.1009,0.15,0.1559,0.102,0.15,0.156,0.103,0.15,0.1559,0.104,0.15,0.1556,0.1051,0.15,0.1552,0.106,0.15,0.1546,0.1069,0.15,0.1539,0.1076,0.15,0.153,0.1082,0.15,0.1521,0.1086,0.15,0.151,0.1089,0.15,0.15,0.109,0.15,0.149,0.1089,0.15,0.1479,0.1086,0.15,0.147,0.1082,0.15,0.1461,0.1076,0.15,0.1454,0.1069,0.15,0.1448,0.106,0.15,0.1444,0.1051,0.15,0.1441,0.104,0.15,0.144,0.103,0.16,0.1441,0.102,0.16,0.1444,0.1009,0.16,0.1448,0.1,0.16,0.1454,0.0991,0.16,0.1461,0.0984,0.16,0.147,0.0978,0.16,0.1479,0.0974,0.16,0.149,0.0971,0.16,0.15,0.097,0.16,0.151,0.0971,0.16,0.1521,0.0974,0.16,0.153,0.0978,0.16,0.1539,0.0984,0.16,0.1546,0.0991,0.16,0.1552,0.1,0.16,0.1556,0.1009,0.16,0.1559,0.102,0.16,0.156,0.103,0.16,0.1559,0.104,0.16,0.1556,0.1051,0.16,0.1552,0.106,0.16,0.1546,0.1069,0.16,0.1539,0.1076,0.16,0.153,0.1082,0.16,0.1521,0.1086,0.16,0.151,0.1089,0.16,0.15,0.109,0.16,0.149,0.1089,0.16,0.1479,0.1086,0.16,0.147,0.1082,0.16,0.1461,0.1076,0.16,0.1454,0.1069,0.16,0.1448,0.106,0.16,0.1444,0.1051,0.16,0.1441,0.104,0.16,0.156,0.1023,0.15,0.1637,0.1014,0.15,0.1655,0.099,0.15,0.1655,0.107,0.15,0.1637,0.1046,0.15,0.156,0.1037,0.15,0.156,0.1023,0.16,0.1637,0.1014,0.16,0.1655,0.099,0.16,0.1655,0.107,0.16,0.1637,0.1046,0.16,0.156,0.1037,0.16,0.1599,0.103,0.167,0.1599,0.0945,0.1635,0.1599,0.091,0.155,0.1599,0.0945,0.1465,0.1599,0.103,0.143,0.1599,0.1115,0.1465,0.1599,0.115,0.155,0.1599,0.1115,0.1635,0.155,0.1063,0.15,0.1615,0.1106,0.15,0.1644,0.1099,0.15,0.1593,0.116,0.15,0.1594,0.113,0.15,0.1541,0.1074,0.15,0.155,0.1063,0.16,0.1615,0.1106,0.16,0.1644,0.1099,0.16,0.1593,0.116,0.16,0.1594,0.113,0.16,0.1541,0.1074,0.16,0.1576,0.1094,0.167,0.163,0.1029,0.1635,0.1653,0.1002,0.155,0.163,0.1029,0.1465,0.1576,0.1094,0.143,0.1521,0.1159,0.1465,0.1499,0.1185,0.155,0.1521,0.1159,0.1635,0.1517,0.1087,0.15,0.154,0.1162,0.15,0.1567,0.1176,0.15,0.1487,0.1189,0.15,0.1508,0.1167,0.15,0.1503,0.109,0.15,0.1517,0.1087,0.16,0.154,0.1162,0.16,0.1567,0.1176,0.16,0.1487,0.1189,0.16,0.1508,0.1167,0.16,0.1503,0.109,0.16,0.1517,0.1127,0.143,0.1434,0.1142,0.1465,0.1399,0.1148,0.155,0.1434,0.1142,0.1635,0.1517,0.1127,0.167,0.1601,0.1113,0.1635,0.1635,0.1106,0.155,0.1601,0.1113,0.1465,0.1476,0.1085,0.15,0.1446,0.1156,0.15,0.1457,0.1184,0.15,0.1388,0.1144,0.15,0.1418,0.114,0.15,0.1464,0.1078,0.15,0.1476,0.1085,0.16,0.1446,0.1156,0.16,0.1457,0.1184,0.16,0.1388,0.1144,0.16,0.1418,0.114,0.16,0.1464,0.1078,0.16,0.1451,0.1116,0.143,0.1377,0.1073,0.1465,0.1347,0.1056,0.155,0.1377,0.1073,0.1635,0.1451,0.1116,0.167,0.1524,0.1158,0.1635,0.1555,0.1176,0.155,0.1524,0.1158,0.1465,0.1446,0.1057,0.15,0.1377,0.1092,0.15,0.1368,0.1121,0.15,0.1341,0.1045,0.15,0.1366,0.1062,0.15,0.1442,0.1044,0.15,0.1446,0.1057,0.16,0.1377,0.1092,0.16,0.1368,0.1121,0.16,0.1341,0.1045,0.16,0.1366,0.1062,0.16,0.1442,0.1044,0.16,0.1407,0.1064,0.143,0.1378,0.0984,0.1465,0.1366,0.0951,0.155,0.1378,0.0984,0.1635,0.1407,0.1064,0.167,0.1436,0.1144,0.1635,0.1448,0.1177,0.155,0.1436,0.1144,0.1465,0.1442,0.1016,0.15,0.1366,0.0998,0.15,0.1341,0.1015,0.15,0.1368,0.0939,0.15,0.1377,0.0968,0.15,0.1446,0.1003,0.15,0.1442,0.1016,0.16,0.1366,0.0998,0.16,0.1341,0.1015,0.16,0.1368,0.0939,0.16,0.1377,0.0968,0.16,0.1446,0.1003,0.16,0.1407,0.0996,0.143,0.1436,0.0916,0.1465,0.1448,0.0883,0.155,0.1436,0.0916,0.1635,0.1407,0.0996,0.167,0.1378,0.1076,0.1635,0.1366,0.1109,0.155,0.1378,0.1076,0.1465,0.1464,0.0982,0.15,0.1418,0.092,0.15,0.1388,0.0916,0.15,0.1457,0.0876,0.15,0.1446,0.0904,0.15,0.1476,0.0975,0.15,0.1464,0.0982,0.16,0.1418,0.092,0.16,0.1388,0.0916,0.16,0.1457,0.0876,0.16,0.1446,0.0904,0.16,0.1476,0.0975,0.16,0.1451,0.0944,0.143,0.1524,0.0902,0.1465,0.1555,0.0884,0.155,0.1524,0.0902,0.1635,0.1451,0.0944,0.167,0.1377,0.0987,0.1635,0.1347,0.1004,0.155,0.1377,0.0987,0.1465,0.1503,0.097,0.15,0.1508,0.0893,0.15,0.1487,0.0871,0.15,0.1567,0.0884,0.15,0.154,0.0898,0.15,0.1517,0.0973,0.15,0.1503,0.097,0.16,0.1508,0.0893,0.16,0.1487,0.0871,0.16,0.1567,0.0884,0.16,0.154,0.0898,0.16,0.1517,0.0973,0.16,0.1517,0.0933,0.167,0.1434,0.0918,0.1635,0.1399,0.0912,0.155,0.1434,0.0918,0.1465,0.1517,0.0933,0.143,0.1601,0.0947,0.1465,0.1635,0.0954,0.155,0.1601,0.0947,0.1635,0.1541,0.0986,0.15,0.1594,0.093,0.15,0.1593,0.09,0.15,0.1644,0.0961,0.15,0.1615,0.0954,0.15,0.155,0.0997,0.15,0.1541,0.0986,0.16,0.1594,0.093,0.16,0.1593,0.09,0.16,0.1644,0.0961,0.16,0.1615,0.0954,0.16,0.155,0.0997,0.16,0.1576,0.0966,0.167,0.1521,0.0901,0.1635,0.1499,0.0875,0.155,0.1521,0.0901,0.1465,0.1576,0.0966,0.143,0.163,0.1031,0.1465,0.1653,0.1058,0.155,0.163,0.1031,0.1635,0.142,0.103,-0.09,0.1443,0.0973,-0.09,0.15,0.095,-0.09,0.1557,0.0973,-0.09,0.158,0.103,-0.09,0.1557,0.1087,-0.09,0.15,0.111,-0.09,0.1443,0.1087,-0.09,0.142,0.103,0,0.1443,0.0973,0,0.15,0.095,0,0.1557,0.0973,0,0.158,0.103,0,0.1557,0.1087,0,0.15,0.111,0,0.1443,0.1087,0,0.142,0.103,0.09,0.1443,0.0973,0.09,0.15,0.095,0.09,0.1557,0.0973,0.09,0.158,0.103,0.09,0.1557,0.1087,0.09,0.15,0.111,0.09,0.1443,0.1087,0.09,0.144,0.103,-0.16,0.1441,0.102,-0.16,0.1444,0.1009,-0.16,0.1448,0.1,-0.16,0.1454,0.0991,-0.16,0.1461,0.0984,-0.16,0.147,0.0978,-0.16,0.1479,0.0974,-0.16,0.149,0.0971,-0.16,0.15,0.097,-0.16,0.151,0.0971,-0.16,0.1521,0.0974,-0.16,0.153,0.0978,-0.16,0.1539,0.0984,-0.16,0.1546,0.0991,-0.16,0.1552,0.1,-0.16,0.1556,0.1009,-0.16,0.1559,0.102,-0.16,0.156,0.103,-0.16,0.1559,0.104,-0.16,0.1556,0.1051,-0.16,0.1552,0.106,-0.16,0.1546,0.1069,-0.16,0.1539,0.1076,-0.16,0.153,0.1082,-0.16,0.1521,0.1086,-0.16,0.151,0.1089,-0.16,0.15,0.109,-0.16,0.149,0.1089,-0.16,0.1479,0.1086,-0.16,0.147,0.1082,-0.16,0.1461,0.1076,-0.16,0.1454,0.1069,-0.16,0.1448,0.106,-0.16,0.1444,0.1051,-0.16,0.1441,0.104,-0.16,0.144,0.103,-0.15,0.1441,0.102,-0.15,0.1444,0.1009,-0.15,0.1448,0.1,-0.15,0.1454,0.0991,-0.15,0.1461,0.0984,-0.15,0.147,0.0978,-0.15,0.1479,0.0974,-0.15,0.149,0.0971,-0.15,0.15,0.097,-0.15,0.151,0.0971,-0.15,0.1521,0.0974,-0.15,0.153,0.0978,-0.15,0.1539,0.0984,-0.15,0.1546,0.0991,-0.15,0.1552,0.1,-0.15,0.1556,0.1009,-0.15,0.1559,0.102,-0.15,0.156,0.103,-0.15,0.1559,0.104,-0.15,0.1556,0.1051,-0.15,0.1552,0.106,-0.15,0.1546,0.1069,-0.15,0.1539,0.1076,-0.15,0.153,0.1082,-0.15,0.1521,0.1086,-0.15,0.151,0.1089,-0.15,0.15,0.109,-0.15,0.149,0.1089,-0.15,0.1479,0.1086,-0.15,0.147,0.1082,-0.15,0.1461,0.1076,-0.15,0.1454,0.1069,-0.15,0.1448,0.106,-0.15,0.1444,0.1051,-0.15,0.1441,0.104,-0.15,0.156,0.1023,-0.16,0.1637,0.1014,-0.16,0.1655,0.099,-0.16,0.1655,0.107,-0.16,0.1637,0.1046,-0.16,0.156,0.1037,-0.16,0.156,0.1023,-0.15,0.1637,0.1014,-0.15,0.1655,0.099,-0.15,0.1655,0.107,-0.15,0.1637,0.1046,-0.15,0.156,0.1037,-0.15,0.1599,0.103,-0.143,0.1599,0.0945,-0.1465,0.1599,0.091,-0.155,0.1599,0.0945,-0.1635,0.1599,0.103,-0.167,0.1599,0.1115,-0.1635,0.1599,0.115,-0.155,0.1599,0.1115,-0.1465,0.155,0.1063,-0.16,0.1615,0.1106,-0.16,0.1644,0.1099,-0.16,0.1593,0.116,-0.16,0.1594,0.113,-0.16,0.1541,0.1074,-0.16,0.155,0.1063,-0.15,0.1615,0.1106,-0.15,0.1644,0.1099,-0.15,0.1593,0.116,-0.15,0.1594,0.113,-0.15,0.1541,0.1074,-0.15,0.1576,0.1094,-0.143,0.163,0.1029,-0.1465,0.1653,0.1002,-0.155,0.163,0.1029,-0.1635,0.1576,0.1094,-0.167,0.1521,0.1159,-0.1635,0.1499,0.1185,-0.155,0.1521,0.1159,-0.1465,0.1517,0.1087,-0.16,0.154,0.1162,-0.16,0.1567,0.1176,-0.16,0.1487,0.1189,-0.16,0.1508,0.1167,-0.16,0.1503,0.109,-0.16,0.1517,0.1087,-0.15,0.154,0.1162,-0.15,0.1567,0.1176,-0.15,0.1487,0.1189,-0.15,0.1508,0.1167,-0.15,0.1503,0.109,-0.15,0.1517,0.1127,-0.167,0.1434,0.1142,-0.1635,0.1399,0.1148,-0.155,0.1434,0.1142,-0.1465,0.1517,0.1127,-0.143,0.1601,0.1113,-0.1465,0.1635,0.1106,-0.155,0.1601,0.1113,-0.1635,0.1476,0.1085,-0.16,0.1446,0.1156,-0.16,0.1457,0.1184,-0.16,0.1388,0.1144,-0.16,0.1418,0.114,-0.16,0.1464,0.1078,-0.16,0.1476,0.1085,-0.15,0.1446,0.1156,-0.15,0.1457,0.1184,-0.15,0.1388,0.1144,-0.15,0.1418,0.114,-0.15,0.1464,0.1078,-0.15,0.1451,0.1116,-0.167,0.1377,0.1073,-0.1635,0.1347,0.1056,-0.155,0.1377,0.1073,-0.1465,0.1451,0.1116,-0.143,0.1524,0.1158,-0.1465,0.1555,0.1176,-0.155,0.1524,0.1158,-0.1635,0.1446,0.1057,-0.16,0.1377,0.1092,-0.16,0.1368,0.1121,-0.16,0.1341,0.1045,-0.16,0.1366,0.1062,-0.16,0.1442,0.1044,-0.16,0.1446,0.1057,-0.15,0.1377,0.1092,-0.15,0.1368,0.1121,-0.15,0.1341,0.1045,-0.15,0.1366,0.1062,-0.15,0.1442,0.1044,-0.15,0.1407,0.1064,-0.167,0.1378,0.0984,-0.1635,0.1366,0.0951,-0.155,0.1378,0.0984,-0.1465,0.1407,0.1064,-0.143,0.1436,0.1144,-0.1465,0.1448,0.1177,-0.155,0.1436,0.1144,-0.1635,0.1442,0.1016,-0.16,0.1366,0.0998,-0.16,0.1341,0.1015,-0.16,0.1368,0.0939,-0.16,0.1377,0.0968,-0.16,0.1446,0.1003,-0.16,0.1442,0.1016,-0.15,0.1366,0.0998,-0.15,0.1341,0.1015,-0.15,0.1368,0.0939,-0.15,0.1377,0.0968,-0.15,0.1446,0.1003,-0.15,0.1407,0.0996,-0.167,0.1436,0.0916,-0.1635,0.1448,0.0883,-0.155,0.1436,0.0916,-0.1465,0.1407,0.0996,-0.143,0.1378,0.1076,-0.1465,0.1366,0.1109,-0.155,0.1378,0.1076,-0.1635,0.1464,0.0982,-0.16,0.1418,0.092,-0.16,0.1388,0.0916,-0.16,0.1457,0.0876,-0.16,0.1446,0.0904,-0.16,0.1476,0.0975,-0.16,0.1464,0.0982,-0.15,0.1418,0.092,-0.15,0.1388,0.0916,-0.15,0.1457,0.0876,-0.15,0.1446,0.0904,-0.15,0.1476,0.0975,-0.15,0.1451,0.0944,-0.167,0.1524,0.0902,-0.1635,0.1555,0.0884,-0.155,0.1524,0.0902,-0.1465,0.1451,0.0944,-0.143,0.1377,0.0987,-0.1465,0.1347,0.1004,-0.155,0.1377,0.0987,-0.1635,0.1503,0.097,-0.16,0.1508,0.0893,-0.16,0.1487,0.0871,-0.16,0.1567,0.0884,-0.16,0.154,0.0898,-0.16,0.1517,0.0973,-0.16,0.1503,0.097,-0.15,0.1508,0.0893,-0.15,0.1487,0.0871,-0.15,0.1567,0.0884,-0.15,0.154,0.0898,-0.15,0.1517,0.0973,-0.15,0.1517,0.0933,-0.143,0.1434,0.0918,-0.1465,0.1399,0.0912,-0.155,0.1434,0.0918,-0.1635,0.1517,0.0933,-0.167,0.1601,0.0947,-0.1635,0.1635,0.0954,-0.155,0.1601,0.0947,-0.1465,0.1541,0.0986,-0.16,0.1594,0.093,-0.16,0.1593,0.09,-0.16,0.1644,0.0961,-0.16,0.1615,0.0954,-0.16,0.155,0.0997,-0.16,0.1541,0.0986,-0.15,0.1594,0.093,-0.15,0.1593,0.09,-0.15,0.1644,0.0961,-0.15,0.1615,0.0954,-0.15,0.155,0.0997,-0.15,0.1576,0.0966,-0.143,0.1521,0.0901,-0.1465,0.1499,0.0875,-0.155,0.1521,0.0901,-0.1635,0.1576,0.0966,-0.167,0.163,0.1031,-0.1635,0.1653,0.1058,-0.155,0.163,0.1031,-0.1465,0.142,0.103,-0.09,0.1443,0.0973,-0.09,0.15,0.095,-0.09,0.1557,0.0973,-0.09,0.158,0.103,-0.09,0.1557,0.1087,-0.09,0.15,0.111,-0.09,0.1443,0.1087,-0.09,0.142,0.103,0,0.1443,0.0973,0,0.15,0.095,0,0.1557,0.0973,0,0.158,0.103,0,0.1557,0.1087,0,0.15,0.111,0,0.1443,0.1087,0,0.142,0.103,0.09,0.1443,0.0973,0.09,0.15,0.095,0.09,0.1557,0.0973,0.09,0.158,0.103,0.09,0.1557,0.1087,0.09,0.15,0.111,0.09,0.1443,0.1087,0.09,-0.156,0.103,0.15,-0.1559,0.102,0.15,-0.1556,0.1009,0.15,-0.1552,0.1,0.15,-0.1546,0.0991,0.15,-0.1539,0.0984,0.15,-0.153,0.0978,0.15,-0.1521,0.0974,0.15,-0.151,0.0971,0.15,-0.15,0.097,0.15,-0.149,0.0971,0.15,-0.1479,0.0974,0.15,-0.147,0.0978,0.15,-0.1461,0.0984,0.15,-0.1454,0.0991,0.15,-0.1448,0.1,0.15,-0.1444,0.1009,0.15,-0.1441,0.102,0.15,-0.144,0.103,0.15,-0.1441,0.104,0.15,-0.1444,0.1051,0.15,-0.1448,0.106,0.15,-0.1454,0.1069,0.15,-0.1461,0.1076,0.15,-0.147,0.1082,0.15,-0.1479,0.1086,0.15,-0.149,0.1089,0.15,-0.15,0.109,0.15,-0.151,0.1089,0.15,-0.1521,0.1086,0.15,-0.153,0.1082,0.15,-0.1539,0.1076,0.15,-0.1546,0.1069,0.15,-0.1552,0.106,0.15,-0.1556,0.1051,0.15,-0.1559,0.104,0.15,-0.156,0.103,0.16,-0.1559,0.102,0.16,-0.1556,0.1009,0.16,-0.1552,0.1,0.16,-0.1546,0.0991,0.16,-0.1539,0.0984,0.16,-0.153,0.0978,0.16,-0.1521,0.0974,0.16,-0.151,0.0971,0.16,-0.15,0.097,0.16,-0.149,0.0971,0.16,-0.1479,0.0974,0.16,-0.147,0.0978,0.16,-0.1461,0.0984,0.16,-0.1454,0.0991,0.16,-0.1448,0.1,0.16,-0.1444,0.1009,0.16,-0.1441,0.102,0.16,-0.144,0.103,0.16,-0.1441,0.104,0.16,-0.1444,0.1051,0.16,-0.1448,0.106,0.16,-0.1454,0.1069,0.16,-0.1461,0.1076,0.16,-0.147,0.1082,0.16,-0.1479,0.1086,0.16,-0.149,0.1089,0.16,-0.15,0.109,0.16,-0.151,0.1089,0.16,-0.1521,0.1086,0.16,-0.153,0.1082,0.16,-0.1539,0.1076,0.16,-0.1546,0.1069,0.16,-0.1552,0.106,0.16,-0.1556,0.1051,0.16,-0.1559,0.104,0.16,-0.144,0.1023,0.15,-0.1363,0.1014,0.15,-0.1345,0.099,0.15,-0.1345,0.107,0.15,-0.1363,0.1046,0.15,-0.144,0.1037,0.15,-0.144,0.1023,0.16,-0.1363,0.1014,0.16,-0.1345,0.099,0.16,-0.1345,0.107,0.16,-0.1363,0.1046,0.16,-0.144,0.1037,0.16,-0.1401,0.103,0.167,-0.1401,0.0945,0.1635,-0.1401,0.091,0.155,-0.1401,0.0945,0.1465,-0.1401,0.103,0.143,-0.1401,0.1115,0.1465,-0.1401,0.115,0.155,-0.1401,0.1115,0.1635,-0.145,0.1063,0.15,-0.1385,0.1106,0.15,-0.1356,0.1099,0.15,-0.1407,0.116,0.15,-0.1406,0.113,0.15,-0.1459,0.1074,0.15,-0.145,0.1063,0.16,-0.1385,0.1106,0.16,-0.1356,0.1099,0.16,-0.1407,0.116,0.16,-0.1406,0.113,0.16,-0.1459,0.1074,0.16,-0.1424,0.1094,0.167,-0.137,0.1029,0.1635,-0.1347,0.1002,0.155,-0.137,0.1029,0.1465,-0.1424,0.1094,0.143,-0.1479,0.1159,0.1465,-0.1501,0.1185,0.155,-0.1479,0.1159,0.1635,-0.1483,0.1087,0.15,-0.146,0.1162,0.15,-0.1433,0.1176,0.15,-0.1513,0.1189,0.15,-0.1492,0.1167,0.15,-0.1497,0.109,0.15,-0.1483,0.1087,0.16,-0.146,0.1162,0.16,-0.1433,0.1176,0.16,-0.1513,0.1189,0.16,-0.1492,0.1167,0.16,-0.1497,0.109,0.16,-0.1483,0.1127,0.143,-0.1566,0.1142,0.1465,-0.1601,0.1148,0.155,-0.1566,0.1142,0.1635,-0.1483,0.1127,0.167,-0.1399,0.1113,0.1635,-0.1365,0.1106,0.155,-0.1399,0.1113,0.1465,-0.1524,0.1085,0.15,-0.1554,0.1156,0.15,-0.1543,0.1184,0.15,-0.1612,0.1144,0.15,-0.1582,0.114,0.15,-0.1536,0.1078,0.15,-0.1524,0.1085,0.16,-0.1554,0.1156,0.16,-0.1543,0.1184,0.16,-0.1612,0.1144,0.16,-0.1582,0.114,0.16,-0.1536,0.1078,0.16,-0.1549,0.1116,0.143,-0.1623,0.1073,0.1465,-0.1653,0.1056,0.155,-0.1623,0.1073,0.1635,-0.1549,0.1116,0.167,-0.1476,0.1158,0.1635,-0.1445,0.1176,0.155,-0.1476,0.1158,0.1465,-0.1554,0.1057,0.15,-0.1623,0.1092,0.15,-0.1632,0.1121,0.15,-0.1659,0.1045,0.15,-0.1634,0.1062,0.15,-0.1558,0.1044,0.15,-0.1554,0.1057,0.16,-0.1623,0.1092,0.16,-0.1632,0.1121,0.16,-0.1659,0.1045,0.16,-0.1634,0.1062,0.16,-0.1558,0.1044,0.16,-0.1593,0.1064,0.143,-0.1622,0.0984,0.1465,-0.1634,0.0951,0.155,-0.1622,0.0984,0.1635,-0.1593,0.1064,0.167,-0.1564,0.1144,0.1635,-0.1552,0.1177,0.155,-0.1564,0.1144,0.1465,-0.1558,0.1016,0.15,-0.1634,0.0998,0.15,-0.1659,0.1015,0.15,-0.1632,0.0939,0.15,-0.1623,0.0968,0.15,-0.1554,0.1003,0.15,-0.1558,0.1016,0.16,-0.1634,0.0998,0.16,-0.1659,0.1015,0.16,-0.1632,0.0939,0.16,-0.1623,0.0968,0.16,-0.1554,0.1003,0.16,-0.1593,0.0996,0.143,-0.1564,0.0916,0.1465,-0.1552,0.0883,0.155,-0.1564,0.0916,0.1635,-0.1593,0.0996,0.167,-0.1622,0.1076,0.1635,-0.1634,0.1109,0.155,-0.1622,0.1076,0.1465,-0.1536,0.0982,0.15,-0.1582,0.092,0.15,-0.1612,0.0916,0.15,-0.1543,0.0876,0.15,-0.1554,0.0904,0.15,-0.1524,0.0975,0.15,-0.1536,0.0982,0.16,-0.1582,0.092,0.16,-0.1612,0.0916,0.16,-0.1543,0.0876,0.16,-0.1554,0.0904,0.16,-0.1524,0.0975,0.16,-0.1549,0.0944,0.143,-0.1476,0.0902,0.1465,-0.1445,0.0884,0.155,-0.1476,0.0902,0.1635,-0.1549,0.0944,0.167,-0.1623,0.0987,0.1635,-0.1653,0.1004,0.155,-0.1623,0.0987,0.1465,-0.1497,0.097,0.15,-0.1492,0.0893,0.15,-0.1513,0.0871,0.15,-0.1433,0.0884,0.15,-0.146,0.0898,0.15,-0.1483,0.0973,0.15,-0.1497,0.097,0.16,-0.1492,0.0893,0.16,-0.1513,0.0871,0.16,-0.1433,0.0884,0.16,-0.146,0.0898,0.16,-0.1483,0.0973,0.16,-0.1483,0.0933,0.167,-0.1566,0.0918,0.1635,-0.1601,0.0912,0.155,-0.1566,0.0918,0.1465,-0.1483,0.0933,0.143,-0.1399,0.0947,0.1465,-0.1365,0.0954,0.155,-0.1399,0.0947,0.1635,-0.1459,0.0986,0.15,-0.1406,0.093,0.15,-0.1407,0.09,0.15,-0.1356,0.0961,0.15,-0.1385,0.0954,0.15,-0.145,0.0997,0.15,-0.1459,0.0986,0.16,-0.1406,0.093,0.16,-0.1407,0.09,0.16,-0.1356,0.0961,0.16,-0.1385,0.0954,0.16,-0.145,0.0997,0.16,-0.1424,0.0966,0.167,-0.1479,0.0901,0.1635,-0.1501,0.0875,0.155,-0.1479,0.0901,0.1465,-0.1424,0.0966,0.143,-0.137,0.1031,0.1465,-0.1347,0.1058,0.155,-0.137,0.1031,0.1635,-0.158,0.103,-0.09,-0.1557,0.0973,-0.09,-0.15,0.095,-0.09,-0.1443,0.0973,-0.09,-0.142,0.103,-0.09,-0.1443,0.1087,-0.09,-0.15,0.111,-0.09,-0.1557,0.1087,-0.09,-0.158,0.103,0,-0.1557,0.0973,0,-0.15,0.095,0,-0.1443,0.0973,0,-0.142,0.103,0,-0.1443,0.1087,0,-0.15,0.111,0,-0.1557,0.1087,0,-0.158,0.103,0.09,-0.1557,0.0973,0.09,-0.15,0.095,0.09,-0.1443,0.0973,0.09,-0.142,0.103,0.09,-0.1443,0.1087,0.09,-0.15,0.111,0.09,-0.1557,0.1087,0.09,-0.156,0.103,-0.16,-0.1559,0.102,-0.16,-0.1556,0.1009,-0.16,-0.1552,0.1,-0.16,-0.1546,0.0991,-0.16,-0.1539,0.0984,-0.16,-0.153,0.0978,-0.16,-0.1521,0.0974,-0.16,-0.151,0.0971,-0.16,-0.15,0.097,-0.16,-0.149,0.0971,-0.16,-0.1479,0.0974,-0.16,-0.147,0.0978,-0.16,-0.1461,0.0984,-0.16,-0.1454,0.0991,-0.16,-0.1448,0.1,-0.16,-0.1444,0.1009,-0.16,-0.1441,0.102,-0.16,-0.144,0.103,-0.16,-0.1441,0.104,-0.16,-0.1444,0.1051,-0.16,-0.1448,0.106,-0.16,-0.1454,0.1069,-0.16,-0.1461,0.1076,-0.16,-0.147,0.1082,-0.16,-0.1479,0.1086,-0.16,-0.149,0.1089,-0.16,-0.15,0.109,-0.16,-0.151,0.1089,-0.16,-0.1521,0.1086,-0.16,-0.153,0.1082,-0.16,-0.1539,0.1076,-0.16,-0.1546,0.1069,-0.16,-0.1552,0.106,-0.16,-0.1556,0.1051,-0.16,-0.1559,0.104,-0.16,-0.156,0.103,-0.15,-0.1559,0.102,-0.15,-0.1556,0.1009,-0.15,-0.1552,0.1,-0.15,-0.1546,0.0991,-0.15,-0.1539,0.0984,-0.15,-0.153,0.0978,-0.15,-0.1521,0.0974,-0.15,-0.151,0.0971,-0.15,-0.15,0.097,-0.15,-0.149,0.0971,-0.15,-0.1479,0.0974,-0.15,-0.147,0.0978,-0.15,-0.1461,0.0984,-0.15,-0.1454,0.0991,-0.15,-0.1448,0.1,-0.15,-0.1444,0.1009,-0.15,-0.1441,0.102,-0.15,-0.144,0.103,-0.15,-0.1441,0.104,-0.15,-0.1444,0.1051,-0.15,-0.1448,0.106,-0.15,-0.1454,0.1069,-0.15,-0.1461,0.1076,-0.15,-0.147,0.1082,-0.15,-0.1479,0.1086,-0.15,-0.149,0.1089,-0.15,-0.15,0.109,-0.15,-0.151,0.1089,-0.15,-0.1521,0.1086,-0.15,-0.153,0.1082,-0.15,-0.1539,0.1076,-0.15,-0.1546,0.1069,-0.15,-0.1552,0.106,-0.15,-0.1556,0.1051,-0.15,-0.1559,0.104,-0.15,-0.144,0.1023,-0.16,-0.1363,0.1014,-0.16,-0.1345,0.099,-0.16,-0.1345,0.107,-0.16,-0.1363,0.1046,-0.16,-0.144,0.1037,-0.16,-0.144,0.1023,-0.15,-0.1363,0.1014,-0.15,-0.1345,0.099,-0.15,-0.1345,0.107,-0.15,-0.1363,0.1046,-0.15,-0.144,0.1037,-0.15,-0.1401,0.103,-0.143,-0.1401,0.0945,-0.1465,-0.1401,0.091,-0.155,-0.1401,0.0945,-0.1635,-0.1401,0.103,-0.167,-0.1401,0.1115,-0.1635,-0.1401,0.115,-0.155,-0.1401,0.1115,-0.1465,-0.145,0.1063,-0.16,-0.1385,0.1106,-0.16,-0.1356,0.1099,-0.16,-0.1407,0.116,-0.16,-0.1406,0.113,-0.16,-0.1459,0.1074,-0.16,-0.145,0.1063,-0.15,-0.1385,0.1106,-0.15,-0.1356,0.1099,-0.15,-0.1407,0.116,-0.15,-0.1406,0.113,-0.15,-0.1459,0.1074,-0.15,-0.1424,0.1094,-0.143,-0.137,0.1029,-0.1465,-0.1347,0.1002,-0.155,-0.137,0.1029,-0.1635,-0.1424,0.1094,-0.167,-0.1479,0.1159,-0.1635,-0.1501,0.1185,-0.155,-0.1479,0.1159,-0.1465,-0.1483,0.1087,-0.16,-0.146,0.1162,-0.16,-0.1433,0.1176,-0.16,-0.1513,0.1189,-0.16,-0.1492,0.1167,-0.16,-0.1497,0.109,-0.16,-0.1483,0.1087,-0.15,-0.146,0.1162,-0.15,-0.1433,0.1176,-0.15,-0.1513,0.1189,-0.15,-0.1492,0.1167,-0.15,-0.1497,0.109,-0.15,-0.1483,0.1127,-0.167,-0.1566,0.1142,-0.1635,-0.1601,0.1148,-0.155,-0.1566,0.1142,-0.1465,-0.1483,0.1127,-0.143,-0.1399,0.1113,-0.1465,-0.1365,0.1106,-0.155,-0.1399,0.1113,-0.1635,-0.1524,0.1085,-0.16,-0.1554,0.1156,-0.16,-0.1543,0.1184,-0.16,-0.1612,0.1144,-0.16,-0.1582,0.114,-0.16,-0.1536,0.1078,-0.16,-0.1524,0.1085,-0.15,-0.1554,0.1156,-0.15,-0.1543,0.1184,-0.15,-0.1612,0.1144,-0.15,-0.1582,0.114,-0.15,-0.1536,0.1078,-0.15,-0.1549,0.1116,-0.167,-0.1623,0.1073,-0.1635,-0.1653,0.1056,-0.155,-0.1623,0.1073,-0.1465,-0.1549,0.1116,-0.143,-0.1476,0.1158,-0.1465,-0.1445,0.1176,-0.155,-0.1476,0.1158,-0.1635,-0.1554,0.1057,-0.16,-0.1623,0.1092,-0.16,-0.1632,0.1121,-0.16,-0.1659,0.1045,-0.16,-0.1634,0.1062,-0.16,-0.1558,0.1044,-0.16,-0.1554,0.1057,-0.15,-0.1623,0.1092,-0.15,-0.1632,0.1121,-0.15,-0.1659,0.1045,-0.15,-0.1634,0.1062,-0.15,-0.1558,0.1044,-0.15,-0.1593,0.1064,-0.167,-0.1622,0.0984,-0.1635,-0.1634,0.0951,-0.155,-0.1622,0.0984,-0.1465,-0.1593,0.1064,-0.143,-0.1564,0.1144,-0.1465,-0.1552,0.1177,-0.155,-0.1564,0.1144,-0.1635,-0.1558,0.1016,-0.16,-0.1634,0.0998,-0.16,-0.1659,0.1015,-0.16,-0.1632,0.0939,-0.16,-0.1623,0.0968,-0.16,-0.1554,0.1003,-0.16,-0.1558,0.1016,-0.15,-0.1634,0.0998,-0.15,-0.1659,0.1015,-0.15,-0.1632,0.0939,-0.15,-0.1623,0.0968,-0.15,-0.1554,0.1003,-0.15,-0.1593,0.0996,-0.167,-0.1564,0.0916,-0.1635,-0.1552,0.0883,-0.155,-0.1564,0.0916,-0.1465,-0.1593,0.0996,-0.143,-0.1622,0.1076,-0.1465,-0.1634,0.1109,-0.155,-0.1622,0.1076,-0.1635,-0.1536,0.0982,-0.16,-0.1582,0.092,-0.16,-0.1612,0.0916,-0.16,-0.1543,0.0876,-0.16,-0.1554,0.0904,-0.16,-0.1524,0.0975,-0.16,-0.1536,0.0982,-0.15,-0.1582,0.092,-0.15,-0.1612,0.0916,-0.15,-0.1543,0.0876,-0.15,-0.1554,0.0904,-0.15,-0.1524,0.0975,-0.15,-0.1549,0.0944,-0.167,-0.1476,0.0902,-0.1635,-0.1445,0.0884,-0.155,-0.1476,0.0902,-0.1465,-0.1549,0.0944,-0.143,-0.1623,0.0987,-0.1465,-0.1653,0.1004,-0.155,-0.1623,0.0987,-0.1635,-0.1497,0.097,-0.16,-0.1492,0.0893,-0.16,-0.1513,0.0871,-0.16,-0.1433,0.0884,-0.16,-0.146,0.0898,-0.16,-0.1483,0.0973,-0.16,-0.1497,0.097,-0.15,-0.1492,0.0893,-0.15,-0.1513,0.0871,-0.15,-0.1433,0.0884,-0.15,-0.146,0.0898,-0.15,-0.1483,0.0973,-0.15,-0.1483,0.0933,-0.143,-0.1566,0.0918,-0.1465,-0.1601,0.0912,-0.155,-0.1566,0.0918,-0.1635,-0.1483,0.0933,-0.167,-0.1399,0.0947,-0.1635,-0.1365,0.0954,-0.155,-0.1399,0.0947,-0.1465,-0.1459,0.0986,-0.16,-0.1406,0.093,-0.16,-0.1407,0.09,-0.16,-0.1356,0.0961,-0.16,-0.1385,0.0954,-0.16,-0.145,0.0997,-0.16,-0.1459,0.0986,-0.15,-0.1406,0.093,-0.15,-0.1407,0.09,-0.15,-0.1356,0.0961,-0.15,-0.1385,0.0954,-0.15,-0.145,0.0997,-0.15,-0.1424,0.0966,-0.143,-0.1479,0.0901,-0.1465,-0.1501,0.0875,-0.155,-0.1479,0.0901,-0.1635,-0.1424,0.0966,-0.167,-0.137,0.1031,-0.1635,-0.1347,0.1058,-0.155,-0.137,0.1031,-0.1465,-0.158,0.103,-0.09,-0.1557,0.0973,-0.09,-0.15,0.095,-0.09,-0.1443,0.0973,-0.09,-0.142,0.103,-0.09,-0.1443,0.1087,-0.09,-0.15,0.111,-0.09,-0.1557,0.1087,-0.09,-0.158,0.103,0,-0.1557,0.0973,0,-0.15,0.095,0,-0.1443,0.0973,0,-0.142,0.103,0,-0.1443,0.1087,0,-0.15,0.111,0,-0.1557,0.1087,0,-0.158,0.103,0.09,-0.1557,0.0973,0.09,-0.15,0.095,0.09,-0.1443,0.0973,0.09,-0.142,0.103,0.09,-0.1443,0.1087,0.09,-0.15,0.111,0.09,-0.1557,0.1087,0.09],"e":[0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,30,30,31,31,32,32,33,33,34,34,35,35,0,36,37,37,38,38,39,39,40,40,41,41,42,42,43,43,44,44,45,45,46,46,47,47,48,48,49,49,50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57,58,58,59,59,60,60,61,61,62,62,63,63,64,64,65,65,66,66,67,67,68,68,69,69,70,70,71,71,36,0,36,4,40,8,44,12,48,16,52,20,56,24,60,28,64,32,68,72,73,73,74,74,75,75,76,76,77,78,79,79,80,80,81,81,82,82,83,84,85,85,86,86,87,87,88,88,89,89,90,90,91,91,84,92,93,93,94,94,95,95,96,96,97,98,99,99,100,100,101,101,102,102,103,104,105,105,106,106,107,107,108,108,109,109,110,110,111,111,104,112,113,113,114,114,115,115,116,116,117,118,119,119,120,120,121,121,122,122,123,124,125,125,126,126,127,127,128,128,129,129,130,130,131,131,124,132,133,133,134,134,135,135,136,136,137,138,139,139,140,140,141,141,142,142,143,144,145,145,146,146,147,147,148,148,149,149,150,150,151,151,144,152,153,153,154,154,155,155,156,156,157,158,159,159,160,160,161,161,162,162,163,164,165,165,166,166,167,167,168,168,169,169,170,170,171,171,164,172,173,173,174,174,175,175,176,176,177,178,179,179,180,180,181,181,182,182,183,184,185,185,186,186,187,187,188,188,189,189,190,190,191,191,184,192,193,193,194,194,195,195,196,196,197,198,199,199,200,200,201,201,202,202,203,204,205,205,206,206,207,207,208,208,209,209,210,210,211,211,204,212,213,213,214,214,215,215,216,216,217,218,219,219,220,220,221,221,222,222,223,224,225,225,226,226,227,227,228,228,229,229,230,230,231,231,224,232,233,233,234,234,235,235,236,236,237,238,239,239,240,240,241,241,242,242,243,244,245,245,246,246,247,247,248,248,249,249,250,250,251,251,244,252,253,253,254,254,255,255,256,256,257,257,258,258,259,259,252,260,261,261,262,262,263,263,264,264,265,265,266,266,267,267,260,268,269,269,270,270,271,271,272,272,273,273,274,274,275,275,268,252,260,260,268,254,262,262,270,256,264,264,272,258,266,266,274,276,277,277,278,278,279,279,280,280,281,281,282,282,283,283,284,284,285,285,286,286,287,287,288,288,289,289,290,290,291,291,292,292,293,293,294,294,295,295,296,296,297,297,298,298,299,299,300,300,301,301,302,302,303,303,304,304,305,305,306,306,307,307,308,308,309,309,310,310,311,311,276,312,313,313,314,314,315,315,316,316,317,317,318,318,319,319,320,320,321,321,322,322,323,323,324,324,325,325,326,326,327,327,328,328,329,329,330,330,331,331,332,332,333,333,334,334,335,335,336,336,337,337,338,338,339,339,340,340,341,341,342,342,343,343,344,344,345,345,346,346,347,347,312,276,312,280,316,284,320,288,324,292,328,296,332,300,336,304,340,308,344,348,349,349,350,350,351,351,352,352,353,354,355,355,356,356,357,357,358,358,359,360,361,361,362,362,363,363,364,364,365,365,366,366,367,367,360,368,369,369,370,370,371,371,372,372,373,374,375,375,376,376,377,377,378,378,379,380,381,381,382,382,383,383,384,384,385,385,386,386,387,387,380,388,389,389,390,390,391,391,392,392,393,394,395,395,396,396,397,397,398,398,399,400,401,401,402,402,403,403,404,404,405,405,406,406,407,407,400,408,409,409,410,410,411,411,412,412,413,414,415,415,416,416,417,417,418,418,419,420,421,421,422,422,423,423,424,424,425,425,426,426,427,427,420,428,429,429,430,430,431,431,432,432,433,434,435,435,436,436,437,437,438,438,439,440,441,441,442,442,443,443,444,444,445,445,446,446,447,447,440,448,449,449,450,450,451,451,452,452,453,454,455,455,456,456,457,457,458,458,459,460,461,461,462,462,463,463,464,464,465,465,466,466,467,467,460,468,469,469,470,470,471,471,472,472,473,474,475,475,476,476,477,477,478,478,479,480,481,481,482,482,483,483,484,484,485,485,486,486,487,487,480,488,489,489,490,490,491,491,492,492,493,494,495,495,496,496,497,497,498,498,499,500,501,501,502,502,503,503,504,504,505,505,506,506,507,507,500,508,509,509,510,510,511,511,512,512,513,514,515,515,516,516,517,517,518,518,519,520,521,521,522,522,523,523,524,524,525,525,526,526,527,527,520,528,529,529,530,530,531,531,532,532,533,533,534,534,535,535,528,536,537,537,538,538,539,539,540,540,541,541,542,542,543,543,536,544,545,545,546,546,547,547,548,548,549,549,550,550,551,551,544,528,536,536,544,530,538,538,546,532,540,540,548,534,542,542,550,552,553,553,554,554,555,555,556,556,557,557,558,558,559,559,560,560,561,561,562,562,563,563,564,564,565,565,566,566,567,567,568,568,569,569,570,570,571,571,572,572,573,573,574,574,575,575,576,576,577,577,578,578,579,579,580,580,581,581,582,582,583,583,584,584,585,585,586,586,587,587,552,588,589,589,590,590,591,591,592,592,593,593,594,594,595,595,596,596,597,597,598,598,599,599,600,600,601,601,602,602,603,603,604,604,605,605,606,606,607,607,608,608,609,609,610,610,611,611,612,612,613,613,614,614,615,615,616,616,617,617,618,618,619,619,620,620,621,621,622,622,623,623,588,552,588,556,592,560,596,564,600,568,604,572,608,576,612,580,616,584,620,624,625,625,626,626,627,627,628,628,629,630,631,631,632,632,633,633,634,634,635,636,637,637,638,638,639,639,640,640,641,641,642,642,643,643,636,644,645,645,646,646,647,647,648,648,649,650,651,651,652,652,653,653,654,654,655,656,657,657,658,658,659,659,660,660,661,661,662,662,663,663,656,664,665,665,666,666,667,667,668,668,669,670,671,671,672,672,673,673,674,674,675,676,677,677,678,678,679,679,680,680,681,681,682,682,683,683,676,684,685,685,686,686,687,687,688,688,689,690,691,691,692,692,693,693,694,694,695,696,697,697,698,698,699,699,700,700,701,701,702,702,703,703,696,704,705,705,706,706,707,707,708,708,709,710,711,711,712,712,713,713,714,714,715,716,717,717,718,718,719,719,720,720,721,721,722,722,723,723,716,724,725,725,726,726,727,727,728,728,729,730,731,731,732,732,733,733,734,734,735,736,737,737,738,738,739,739,740,740,741,741,742,742,743,743,736,744,745,745,746,746,747,747,748,748,749,750,751,751,752,752,753,753,754,754,755,756,757,757,758,758,759,759,760,760,761,761,762,762,763,763,756,764,765,765,766,766,767,767,768,768,769,770,771,771,772,772,773,773,774,774,775,776,777,777,778,778,779,779,780,780,781,781,782,782,783,783,776,784,785,785,786,786,787,787,788,788,789,790,791,791,792,792,793,793,794,794,795,796,797,797,798,798,799,799,800,800,801,801,802,802,803,803,796,804,805,805,806,806,807,807,808,808,809,809,810,810,811,811,804,812,813,813,814,814,815,815,816,816,817,817,818,818,819,819,812,820,821,821,822,822,823,823,824,824,825,825,826,826,827,827,820,804,812,812,820,806,814,814,822,808,816,816,824,810,818,818,826,828,829,829,830,830,831,831,832,832,833,833,834,834,835,835,836,836,837,837,838,838,839,839,840,840,841,841,842,842,843,843,844,844,845,845,846,846,847,847,848,848,849,849,850,850,851,851,852,852,853,853,854,854,855,855,856,856,857,857,858,858,859,859,860,860,861,861,862,862,863,863,828,864,865,865,866,866,867,867,868,868,869,869,870,870,871,871,872,872,873,873,874,874,875,875,876,876,877,877,878,878,879,879,880,880,881,881,882,882,883,883,884,884,885,885,886,886,887,887,888,888,889,889,890,890,891,891,892,892,893,893,894,894,895,895,896,896,897,897,898,898,899,899,864,828,864,832,868,836,872,840,876,844,880,848,884,852,888,856,892,860,896,900,901,901,902,902,903,903,904,904,905,906,907,907,908,908,909,909,910,910,911,912,913,913,914,914,915,915,916,916,917,917,918,918,919,919,912,920,921,921,922,922,923,923,924,924,925,926,927,927,928,928,929,929,930,930,931,932,933,933,934,934,935,935,936,936,937,937,938,938,939,939,932,940,941,941,942,942,943,943,944,944,945,946,947,947,948,948,949,949,950,950,951,952,953,953,954,954,955,955,956,956,957,957,958,958,959,959,952,960,961,961,962,962,963,963,964,964,965,966,967,967,968,968,969,969,970,970,971,972,973,973,974,974,975,975,976,976,977,977,978,978,979,979,972,980,981,981,982,982,983,983,984,984,985,986,987,987,988,988,989,989,990,990,991,992,993,993,994,994,995,995,996,996,997,997,998,998,999,999,992,1000,1001,1001,1002,1002,1003,1003,1004,1004,1005,1006,1007,1007,1008,1008,1009,1009,1010,1010,1011,1012,1013,1013,1014,1014,1015,1015,1016,1016,1017,1017,1018,1018,1019,1019,1012,1020,1021,1021,1022,1022,1023,1023,1024,1024,1025,1026,1027,1027,1028,1028,1029,1029,1030,1030,1031,1032,1033,1033,1034,1034,1035,1035,1036,1036,1037,1037,1038,1038,1039,1039,1032,1040,1041,1041,1042,1042,1043,1043,1044,1044,1045,1046,1047,1047,1048,1048,1049,1049,1050,1050,1051,1052,1053,1053,1054,1054,1055,1055,1056,1056,1057,1057,1058,1058,1059,1059,1052,1060,1061,1061,1062,1062,1063,1063,1064,1064,1065,1066,1067,1067,1068,1068,1069,1069,1070,1070,1071,1072,1073,1073,1074,1074,1075,1075,1076,1076,1077,1077,1078,1078,1079,1079,1072,1080,1081,1081,1082,1082,1083,1083,1084,1084,1085,1085,1086,1086,1087,1087,1080,1088,1089,1089,1090,1090,1091,1091,1092,1092,1093,1093,1094,1094,1095,1095,1088,1096,1097,1097,1098,1098,1099,1099,1100,1100,1101,1101,1102,1102,1103,1103,1096,1080,1088,1088,1096,1082,1090,1090,1098,1084,1092,1092,1100,1086,1094,1094,1102],"q":[0,1,37,36,1,2,38,37,2,3,39,38,3,4,40,39,4,5,41,40,5,6,42,41,6,7,43,42,7,8,44,43,8,9,45,44,9,10,46,45,10,11,47,46,11,12,48,47,12,13,49,48,13,14,50,49,14,15,51,50,15,16,52,51,16,17,53,52,17,18,54,53,18,19,55,54,19,20,56,55,20,21,57,56,21,22,58,57,22,23,59,58,23,24,60,59,24,25,61,60,25,26,62,61,26,27,63,62,27,28,64,63,28,29,65,64,29,30,66,65,30,31,67,66,31,32,68,67,32,33,69,68,33,34,70,69,34,35,71,70,35,0,36,71,78,79,82,83,79,80,81,82,98,99,102,103,99,100,101,102,118,119,122,123,119,120,121,122,138,139,142,143,139,140,141,142,158,159,162,163,159,160,161,162,178,179,182,183,179,180,181,182,198,199,202,203,199,200,201,202,218,219,222,223,219,220,221,222,238,239,242,243,239,240,241,242,252,253,261,260,253,254,262,261,254,255,263,262,255,256,264,263,256,257,265,264,257,258,266,265,258,259,267,266,259,252,260,267,260,261,269,268,261,262,270,269,262,263,271,270,263,264,272,271,264,265,273,272,265,266,274,273,266,267,275,274,267,260,268,275,276,277,313,312,277,278,314,313,278,279,315,314,279,280,316,315,280,281,317,316,281,282,318,317,282,283,319,318,283,284,320,319,284,285,321,320,285,286,322,321,286,287,323,322,287,288,324,323,288,289,325,324,289,290,326,325,290,291,327,326,291,292,328,327,292,293,329,328,293,294,330,329,294,295,331,330,295,296,332,331,296,297,333,332,297,298,334,333,298,299,335,334,299,300,336,335,300,301,337,336,301,302,338,337,302,303,339,338,303,304,340,339,304,305,341,340,305,306,342,341,306,307,343,342,307,308,344,343,308,309,345,344,309,310,346,345,310,311,347,346,311,276,312,347,354,355,358,359,355,356,357,358,374,375,378,379,375,376,377,378,394,395,398,399,395,396,397,398,414,415,418,419,415,416,417,418,434,435,438,439,435,436,437,438,454,455,458,459,455,456,457,458,474,475,478,479,475,476,477,478,494,495,498,499,495,496,497,498,514,515,518,519,515,516,517,518,528,529,537,536,529,530,538,537,530,531,539,538,531,532,540,539,532,533,541,540,533,534,542,541,534,535,543,542,535,528,536,543,536,537,545,544,537,538,546,545,538,539,547,546,539,540,548,547,540,541,549,548,541,542,550,549,542,543,551,550,543,536,544,551,552,553,589,588,553,554,590,589,554,555,591,590,555,556,592,591,556,557,593,592,557,558,594,593,558,559,595,594,559,560,596,595,560,561,597,596,561,562,598,597,562,563,599,598,563,564,600,599,564,565,601,600,565,566,602,601,566,567,603,602,567,568,604,603,568,569,605,604,569,570,606,605,570,571,607,606,571,572,608,607,572,573,609,608,573,574,610,609,574,575,611,610,575,576,612,611,576,577,613,612,577,578,614,613,578,579,615,614,579,580,616,615,580,581,617,616,581,582,618,617,582,583,619,618,583,584,620,619,584,585,621,620,585,586,622,621,586,587,623,622,587,552,588,623,630,631,634,635,631,632,633,634,650,651,654,655,651,652,653,654,670,671,674,675,671,672,673,674,690,691,694,695,691,692,693,694,710,711,714,715,711,712,713,714,730,731,734,735,731,732,733,734,750,751,754,755,751,752,753,754,770,771,774,775,771,772,773,774,790,791,794,795,791,792,793,794,804,805,813,812,805,806,814,813,806,807,815,814,807,808,816,815,808,809,817,816,809,810,818,817,810,811,819,818,811,804,812,819,812,813,821,820,813,814,822,821,814,815,823,822,815,816,824,823,816,817,825,824,817,818,826,825,818,819,827,826,819,812,820,827,828,829,865,864,829,830,866,865,830,831,867,866,831,832,868,867,832,833,869,868,833,834,870,869,834,835,871,870,835,836,872,871,836,837,873,872,837,838,874,873,838,839,875,874,839,840,876,875,840,841,877,876,841,842,878,877,842,843,879,878,843,844,880,879,844,845,881,880,845,846,882,881,846,847,883,882,847,848,884,883,848,849,885,884,849,850,886,885,850,851,887,886,851,852,888,887,852,853,889,888,853,854,890,889,854,855,891,890,855,856,892,891,856,857,893,892,857,858,894,893,858,859,895,894,859,860,896,895,860,861,897,896,861,862,898,897,862,863,899,898,863,828,864,899,906,907,910,911,907,908,909,910,926,927,930,931,927,928,929,930,946,947,950,951,947,948,949,950,966,967,970,971,967,968,969,970,986,987,990,991,987,988,989,990,1006,1007,1010,1011,1007,1008,1009,1010,1026,1027,1030,1031,1027,1028,1029,1030,1046,1047,1050,1051,1047,1048,1049,1050,1066,1067,1070,1071,1067,1068,1069,1070,1080,1081,1089,1088,1081,1082,1090,1089,1082,1083,1091,1090,1083,1084,1092,1091,1084,1085,1093,1092,1085,1086,1094,1093,1086,1087,1095,1094,1087,1080,1088,1095,1088,1089,1097,1096,1089,1090,1098,1097,1090,1091,1099,1098,1091,1092,1100,1099,1092,1093,1101,1100,1093,1094,1102,1101,1094,1095,1103,1102,1095,1088,1096,1103]}]},{"id":"battery","anchor":[-0.075,0.095,0.045],"center":[-0.12,0.085,0],"tagDir":-1,"pieces":[{"id":"battery-pack","explode":[-0.14,0,0],"v":[-0.115,0.065,-0.035,-0.025,0.065,-0.035,-0.115,0.115,-0.035,-0.025,0.115,-0.035,-0.115,0.065,0.035,-0.025,0.065,0.035,-0.115,0.115,0.035,-0.025,0.115,0.035,-0.121,0.075,-0.025,-0.115,0.075,-0.025,-0.121,0.105,-0.025,-0.115,0.105,-0.025,-0.121,0.075,0.025,-0.115,0.075,0.025,-0.121,0.105,0.025,-0.115,0.105,0.025],"e":[0,1,2,3,4,5,6,7,0,2,1,3,4,6,5,7,0,4,1,5,2,6,3,7,8,9,10,11,12,13,14,15,8,10,9,11,12,14,13,15,8,12,9,13,10,14,11,15],"q":[0,1,3,2,4,5,7,6,0,1,5,4,2,3,7,6,0,2,6,4,1,3,7,5,8,9,11,10,12,13,15,14,8,9,13,12,10,11,15,14,8,10,14,12,9,11,15,13]},{"id":"battery-cells","explode":[0,0,0],"internal":true,"hot":true,"v":[-0.105,0.09,-0.004,-0.105,0.0818,-0.0067,-0.105,0.0767,-0.0137,-0.105,0.0767,-0.0223,-0.105,0.0818,-0.0293,-0.105,0.09,-0.032,-0.105,0.0982,-0.0293,-0.105,0.1033,-0.0223,-0.105,0.1033,-0.0137,-0.105,0.0982,-0.0067,-0.07,0.09,-0.004,-0.07,0.0818,-0.0067,-0.07,0.0767,-0.0137,-0.07,0.0767,-0.0223,-0.07,0.0818,-0.0293,-0.07,0.09,-0.032,-0.07,0.0982,-0.0293,-0.07,0.1033,-0.0223,-0.07,0.1033,-0.0137,-0.07,0.0982,-0.0067,-0.035,0.09,-0.004,-0.035,0.0818,-0.0067,-0.035,0.0767,-0.0137,-0.035,0.0767,-0.0223,-0.035,0.0818,-0.0293,-0.035,0.09,-0.032,-0.035,0.0982,-0.0293,-0.035,0.1033,-0.0223,-0.035,0.1033,-0.0137,-0.035,0.0982,-0.0067,-0.105,0.09,0.032,-0.105,0.0818,0.0293,-0.105,0.0767,0.0223,-0.105,0.0767,0.0137,-0.105,0.0818,0.0067,-0.105,0.09,0.004,-0.105,0.0982,0.0067,-0.105,0.1033,0.0137,-0.105,0.1033,0.0223,-0.105,0.0982,0.0293,-0.07,0.09,0.032,-0.07,0.0818,0.0293,-0.07,0.0767,0.0223,-0.07,0.0767,0.0137,-0.07,0.0818,0.0067,-0.07,0.09,0.004,-0.07,0.0982,0.0067,-0.07,0.1033,0.0137,-0.07,0.1033,0.0223,-0.07,0.0982,0.0293,-0.035,0.09,0.032,-0.035,0.0818,0.0293,-0.035,0.0767,0.0223,-0.035,0.0767,0.0137,-0.035,0.0818,0.0067,-0.035,0.09,0.004,-0.035,0.0982,0.0067,-0.035,0.1033,0.0137,-0.035,0.1033,0.0223,-0.035,0.0982,0.0293],"e":[0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,0,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,10,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,20,0,10,10,20,2,12,12,22,4,14,14,24,6,16,16,26,8,18,18,28,30,31,31,32,32,33,33,34,34,35,35,36,36,37,37,38,38,39,39,30,40,41,41,42,42,43,43,44,44,45,45,46,46,47,47,48,48,49,49,40,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57,58,58,59,59,50,30,40,40,50,32,42,42,52,34,44,44,54,36,46,46,56,38,48,48,58],"q":[0,1,11,10,1,2,12,11,2,3,13,12,3,4,14,13,4,5,15,14,5,6,16,15,6,7,17,16,7,8,18,17,8,9,19,18,9,0,10,19,10,11,21,20,11,12,22,21,12,13,23,22,13,14,24,23,14,15,25,24,15,16,26,25,16,17,27,26,17,18,28,27,18,19,29,28,19,10,20,29,30,31,41,40,31,32,42,41,32,33,43,42,33,34,44,43,34,35,45,44,35,36,46,45,36,37,47,46,37,38,48,47,38,39,49,48,39,30,40,49,40,41,51,50,41,42,52,51,42,43,53,52,43,44,54,53,44,45,55,54,45,46,56,55,46,47,57,56,47,48,58,57,48,49,59,58,49,40,50,59]}]},{"id":"camera","anchor":[0.155,0.05,0.03],"center":[0.16,0.05,0],"tagDir":1,"pieces":[{"id":"gimbal-yoke","explode":[0,0,0],"v":[0.1,0.055,0.008,0.0991,0.0494,0.0057,0.0987,0.0471,0,0.0991,0.0494,-0.0057,0.1,0.055,-0.008,0.1009,0.0606,-0.0057,0.1013,0.0629,0,0.1009,0.0606,0.0057,0.115,0.0525,0.008,0.1141,0.0469,0.0057,0.1137,0.0446,0,0.1141,0.0469,-0.0057,0.115,0.0525,-0.008,0.1159,0.0581,-0.0057,0.1163,0.0604,0,0.1159,0.0581,0.0057,0.13,0.05,0.008,0.1291,0.0444,0.0057,0.1287,0.0421,0,0.1291,0.0444,-0.0057,0.13,0.05,-0.008,0.1309,0.0556,-0.0057,0.1313,0.0579,0,0.1309,0.0556,0.0057,0.125,0.05,-0.028,0.1275,0.0457,-0.028,0.1325,0.0457,-0.028,0.135,0.05,-0.028,0.1325,0.0543,-0.028,0.1275,0.0543,-0.028,0.125,0.05,0,0.1275,0.0457,0,0.1325,0.0457,0,0.135,0.05,0,0.1325,0.0543,0,0.1275,0.0543,0,0.125,0.05,0.028,0.1275,0.0457,0.028,0.1325,0.0457,0.028,0.135,0.05,0.028,0.1325,0.0543,0.028,0.1275,0.0543,0.028,0.13,0.05,-0.024,0.1285,0.0469,-0.026,0.1285,0.0469,-0.03,0.13,0.05,-0.032,0.1315,0.0531,-0.03,0.1315,0.0531,-0.026,0.15,0.04,-0.024,0.1485,0.0369,-0.026,0.1485,0.0369,-0.03,0.15,0.04,-0.032,0.1515,0.0431,-0.03,0.1515,0.0431,-0.026,0.13,0.05,0.032,0.1285,0.0469,0.03,0.1285,0.0469,0.026,0.13,0.05,0.024,0.1315,0.0531,0.026,0.1315,0.0531,0.03,0.15,0.04,0.032,0.1485,0.0369,0.03,0.1485,0.0369,0.026,0.15,0.04,0.024,0.1515,0.0431,0.026,0.1515,0.0431,0.03],"e":[0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,0,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,8,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,16,0,8,8,16,2,10,10,18,4,12,12,20,6,14,14,22,24,25,25,26,26,27,27,28,28,29,29,24,30,31,31,32,32,33,33,34,34,35,35,30,36,37,37,38,38,39,39,40,40,41,41,36,24,30,30,36,27,33,33,39,42,43,43,44,44,45,45,46,46,47,47,42,48,49,49,50,50,51,51,52,52,53,53,48,42,48,45,51,54,55,55,56,56,57,57,58,58,59,59,54,60,61,61,62,62,63,63,64,64,65,65,60,54,60,57,63],"q":[0,1,9,8,1,2,10,9,2,3,11,10,3,4,12,11,4,5,13,12,5,6,14,13,6,7,15,14,7,0,8,15,8,9,17,16,9,10,18,17,10,11,19,18,11,12,20,19,12,13,21,20,13,14,22,21,14,15,23,22,15,8,16,23,24,25,31,30,25,26,32,31,26,27,33,32,27,28,34,33,28,29,35,34,29,24,30,35,30,31,37,36,31,32,38,37,32,33,39,38,33,34,40,39,34,35,41,40,35,30,36,41,42,43,49,48,43,44,50,49,44,45,51,50,45,46,52,51,46,47,53,52,47,42,48,53,54,55,61,60,55,56,62,61,56,57,63,62,57,58,64,63,58,59,65,64,59,54,60,65]},{"id":"camera-head","explode":[0.07,-0.02,0],"v":[0.14,0.023,-0.022,0.176,0.023,-0.022,0.14,0.057,-0.022,0.176,0.057,-0.022,0.14,0.023,0.022,0.176,0.023,0.022,0.14,0.057,0.022,0.176,0.057,0.022,0.176,0.04,0.013,0.176,0.0344,0.0117,0.176,0.0298,0.0081,0.176,0.0273,0.0029,0.176,0.0273,-0.0029,0.176,0.0298,-0.0081,0.176,0.0344,-0.0117,0.176,0.04,-0.013,0.176,0.0456,-0.0117,0.176,0.0502,-0.0081,0.176,0.0527,-0.0029,0.176,0.0527,0.0029,0.176,0.0502,0.0081,0.176,0.0456,0.0117,0.183,0.04,0.013,0.183,0.0344,0.0117,0.183,0.0298,0.0081,0.183,0.0273,0.0029,0.183,0.0273,-0.0029,0.183,0.0298,-0.0081,0.183,0.0344,-0.0117,0.183,0.04,-0.013,0.183,0.0456,-0.0117,0.183,0.0502,-0.0081,0.183,0.0527,-0.0029,0.183,0.0527,0.0029,0.183,0.0502,0.0081,0.183,0.0456,0.0117,0.19,0.04,0.013,0.19,0.0344,0.0117,0.19,0.0298,0.0081,0.19,0.0273,0.0029,0.19,0.0273,-0.0029,0.19,0.0298,-0.0081,0.19,0.0344,-0.0117,0.19,0.04,-0.013,0.19,0.0456,-0.0117,0.19,0.0502,-0.0081,0.19,0.0527,-0.0029,0.19,0.0527,0.0029,0.19,0.0502,0.0081,0.19,0.0456,0.0117,0.19,0.04,0.013,0.19,0.0344,0.0117,0.19,0.0298,0.0081,0.19,0.0273,0.0029,0.19,0.0273,-0.0029,0.19,0.0298,-0.0081,0.19,0.0344,-0.0117,0.19,0.04,-0.013,0.19,0.0456,-0.0117,0.19,0.0502,-0.0081,0.19,0.0527,-0.0029,0.19,0.0527,0.0029,0.19,0.0502,0.0081,0.19,0.0456,0.0117,0.19,0.04,0.008,0.19,0.0365,0.0072,0.19,0.0337,0.005,0.19,0.0322,0.0018,0.19,0.0322,-0.0018,0.19,0.0337,-0.005,0.19,0.0365,-0.0072,0.19,0.04,-0.008,0.19,0.0435,-0.0072,0.19,0.0463,-0.005,0.19,0.0478,-0.0018,0.19,0.0478,0.0018,0.19,0.0463,0.005,0.19,0.0435,0.0072,0.19,0.04,0.004,0.19,0.0383,0.0036,0.19,0.0369,0.0025,0.19,0.0361,0.0009,0.19,0.0361,-0.0009,0.19,0.0369,-0.0025,0.19,0.0383,-0.0036,0.19,0.04,-0.004,0.19,0.0417,-0.0036,0.19,0.0431,-0.0025,0.19,0.0439,-0.0009,0.19,0.0439,0.0009,0.19,0.0431,0.0025,0.19,0.0417,0.0036],"e":[0,1,2,3,4,5,6,7,0,2,1,3,4,6,5,7,0,4,1,5,2,6,3,7,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,8,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,30,30,31,31,32,32,33,33,34,34,35,35,22,36,37,37,38,38,39,39,40,40,41,41,42,42,43,43,44,44,45,45,46,46,47,47,48,48,49,49,36,8,22,22,36,10,24,24,38,12,26,26,40,14,28,28,42,16,30,30,44,18,32,32,46,20,34,34,48,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57,58,58,59,59,60,60,61,61,62,62,63,63,50,64,65,65,66,66,67,67,68,68,69,69,70,70,71,71,72,72,73,73,74,74,75,75,76,76,77,77,64,78,79,79,80,80,81,81,82,82,83,83,84,84,85,85,86,86,87,87,88,88,89,89,90,90,91,91,78,50,64,54,68,58,72,62,76,64,78,68,82,72,86,76,90],"q":[0,1,3,2,4,5,7,6,0,1,5,4,2,3,7,6,0,2,6,4,1,3,7,5,8,9,23,22,9,10,24,23,10,11,25,24,11,12,26,25,12,13,27,26,13,14,28,27,14,15,29,28,15,16,30,29,16,17,31,30,17,18,32,31,18,19,33,32,19,20,34,33,20,21,35,34,21,8,22,35,22,23,37,36,23,24,38,37,24,25,39,38,25,26,40,39,26,27,41,40,27,28,42,41,28,29,43,42,29,30,44,43,30,31,45,44,31,32,46,45,32,33,47,46,33,34,48,47,34,35,49,48,35,22,36,49,50,51,65,64,51,52,66,65,52,53,67,66,53,54,68,67,54,55,69,68,55,56,70,69,56,57,71,70,57,58,72,71,58,59,73,72,59,60,74,73,60,61,75,74,61,62,76,75,62,63,77,76,63,50,64,77,64,65,79,78,65,66,80,79,66,67,81,80,67,68,82,81,68,69,83,82,69,70,84,83,70,71,85,84,71,72,86,85,72,73,87,86,73,74,88,87,74,75,89,88,75,76,90,89,76,77,91,90,77,64,78,91]},{"id":"camera-sensor","explode":[0.035,-0.01,0],"internal":true,"hot":true,"v":[0.156,0.03,-0.013,0.16,0.03,-0.013,0.156,0.05,-0.013,0.16,0.05,-0.013,0.156,0.03,0.013,0.16,0.03,0.013,0.156,0.05,0.013,0.16,0.05,0.013],"e":[0,1,2,3,4,5,6,7,0,2,1,3,4,6,5,7,0,4,1,5,2,6,3,7],"q":[0,1,3,2,4,5,7,6,0,1,5,4,2,3,7,6,0,2,6,4,1,3,7,5]}]},{"id":"sensors","anchor":[0.1,0.095,0.02],"center":[0.06,0.085,0],"tagDir":-1,"pieces":[{"id":"sensor-front","explode":[0.06,0.015,0],"v":[0.104,0.097,-0.013,0.104,0.0925,-0.0142,0.104,0.0892,-0.0175,0.104,0.088,-0.022,0.104,0.0892,-0.0265,0.104,0.0925,-0.0298,0.104,0.097,-0.031,0.104,0.1015,-0.0298,0.104,0.1048,-0.0265,0.104,0.106,-0.022,0.104,0.1048,-0.0175,0.104,0.1015,-0.0142,0.104,0.097,-0.017,0.104,0.0945,-0.0177,0.104,0.0927,-0.0195,0.104,0.092,-0.022,0.104,0.0927,-0.0245,0.104,0.0945,-0.0263,0.104,0.097,-0.027,0.104,0.0995,-0.0263,0.104,0.1013,-0.0245,0.104,0.102,-0.022,0.104,0.1013,-0.0195,0.104,0.0995,-0.0177,0.104,0.097,0.031,0.104,0.0925,0.0298,0.104,0.0892,0.0265,0.104,0.088,0.022,0.104,0.0892,0.0175,0.104,0.0925,0.0142,0.104,0.097,0.013,0.104,0.1015,0.0142,0.104,0.1048,0.0175,0.104,0.106,0.022,0.104,0.1048,0.0265,0.104,0.1015,0.0298,0.104,0.097,0.027,0.104,0.0945,0.0263,0.104,0.0927,0.0245,0.104,0.092,0.022,0.104,0.0927,0.0195,0.104,0.0945,0.0177,0.104,0.097,0.017,0.104,0.0995,0.0177,0.104,0.1013,0.0195,0.104,0.102,0.022,0.104,0.1013,0.0245,0.104,0.0995,0.0263,0.099,0.087,-0.035,0.103,0.087,-0.035,0.099,0.107,-0.035,0.103,0.107,-0.035,0.099,0.087,0.035,0.103,0.087,0.035,0.099,0.107,0.035,0.103,0.107,0.035],"e":[0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,0,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,12,0,12,4,16,8,20,24,25,25,26,26,27,27,28,28,29,29,30,30,31,31,32,32,33,33,34,34,35,35,24,36,37,37,38,38,39,39,40,40,41,41,42,42,43,43,44,44,45,45,46,46,47,47,36,24,36,28,40,32,44,48,49,50,51,52,53,54,55,48,50,49,51,52,54,53,55,48,52,49,53,50,54,51,55],"q":[0,1,13,12,1,2,14,13,2,3,15,14,3,4,16,15,4,5,17,16,5,6,18,17,6,7,19,18,7,8,20,19,8,9,21,20,9,10,22,21,10,11,23,22,11,0,12,23,24,25,37,36,25,26,38,37,26,27,39,38,27,28,40,39,28,29,41,40,29,30,42,41,30,31,43,42,31,32,44,43,32,33,45,44,33,34,46,45,34,35,47,46,35,24,36,47,48,49,51,50,52,53,55,54,48,49,53,52,50,51,55,54,48,50,54,52,49,51,55,53]},{"id":"sensor-rear","explode":[-0.06,0.015,0],"v":[-0.114,0.103,-0.03,-0.114,0.099,-0.0289,-0.114,0.0961,-0.026,-0.114,0.095,-0.022,-0.114,0.0961,-0.018,-0.114,0.099,-0.0151,-0.114,0.103,-0.014,-0.114,0.107,-0.0151,-0.114,0.1099,-0.018,-0.114,0.111,-0.022,-0.114,0.1099,-0.026,-0.114,0.107,-0.0289,-0.114,0.103,-0.026,-0.114,0.101,-0.0255,-0.114,0.0995,-0.024,-0.114,0.099,-0.022,-0.114,0.0995,-0.02,-0.114,0.101,-0.0185,-0.114,0.103,-0.018,-0.114,0.105,-0.0185,-0.114,0.1065,-0.02,-0.114,0.107,-0.022,-0.114,0.1065,-0.024,-0.114,0.105,-0.0255,-0.114,0.103,0.014,-0.114,0.099,0.0151,-0.114,0.0961,0.018,-0.114,0.095,0.022,-0.114,0.0961,0.026,-0.114,0.099,0.0289,-0.114,0.103,0.03,-0.114,0.107,0.0289,-0.114,0.1099,0.026,-0.114,0.111,0.022,-0.114,0.1099,0.018,-0.114,0.107,0.0151,-0.114,0.103,0.018,-0.114,0.101,0.0185,-0.114,0.0995,0.02,-0.114,0.099,0.022,-0.114,0.0995,0.024,-0.114,0.101,0.0255,-0.114,0.103,0.026,-0.114,0.105,0.0255,-0.114,0.1065,0.024,-0.114,0.107,0.022,-0.114,0.1065,0.02,-0.114,0.105,0.0185],"e":[0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,0,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,12,0,12,4,16,8,20,24,25,25,26,26,27,27,28,28,29,29,30,30,31,31,32,32,33,33,34,34,35,35,24,36,37,37,38,38,39,39,40,40,41,41,42,42,43,43,44,44,45,45,46,46,47,47,36,24,36,28,40,32,44],"q":[0,1,13,12,1,2,14,13,2,3,15,14,3,4,16,15,4,5,17,16,5,6,18,17,6,7,19,18,7,8,20,19,8,9,21,20,9,10,22,21,10,11,23,22,11,0,12,23,24,25,37,36,25,26,38,37,26,27,39,38,27,28,40,39,28,29,41,40,29,30,42,41,30,31,43,42,31,32,44,43,32,33,45,44,33,34,46,45,34,35,47,46,35,24,36,47]},{"id":"sensor-bottom","explode":[0,-0.04,0],"v":[-0.02,0.042,0.008,-0.024,0.042,0.0069,-0.0269,0.042,0.004,-0.028,0.042,0,-0.0269,0.042,-0.004,-0.024,0.042,-0.0069,-0.02,0.042,-0.008,-0.016,0.042,-0.0069,-0.0131,0.042,-0.004,-0.012,0.042,0,-0.0131,0.042,0.004,-0.016,0.042,0.0069,-0.02,0.042,0.004,-0.022,0.042,0.0035,-0.0235,0.042,0.002,-0.024,0.042,0,-0.0235,0.042,-0.002,-0.022,0.042,-0.0035,-0.02,0.042,-0.004,-0.018,0.042,-0.0035,-0.0165,0.042,-0.002,-0.016,0.042,0,-0.0165,0.042,0.002,-0.018,0.042,0.0035,0.02,0.042,0.008,0.016,0.042,0.0069,0.0131,0.042,0.004,0.012,0.042,0,0.0131,0.042,-0.004,0.016,0.042,-0.0069,0.02,0.042,-0.008,0.024,0.042,-0.0069,0.0269,0.042,-0.004,0.028,0.042,0,0.0269,0.042,0.004,0.024,0.042,0.0069,0.02,0.042,0.004,0.018,0.042,0.0035,0.0165,0.042,0.002,0.016,0.042,0,0.0165,0.042,-0.002,0.018,0.042,-0.0035,0.02,0.042,-0.004,0.022,0.042,-0.0035,0.0235,0.042,-0.002,0.024,0.042,0,0.0235,0.042,0.002,0.022,0.042,0.0035],"e":[0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,0,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,12,0,12,4,16,8,20,24,25,25,26,26,27,27,28,28,29,29,30,30,31,31,32,32,33,33,34,34,35,35,24,36,37,37,38,38,39,39,40,40,41,41,42,42,43,43,44,44,45,45,46,46,47,47,36,24,36,28,40,32,44],"q":[0,1,13,12,1,2,14,13,2,3,15,14,3,4,16,15,4,5,17,16,5,6,18,17,6,7,19,18,7,8,20,19,8,9,21,20,9,10,22,21,10,11,23,22,11,0,12,23,24,25,37,36,25,26,38,37,26,27,39,38,27,28,40,39,28,29,41,40,29,30,42,41,30,31,43,42,31,32,44,43,32,33,45,44,33,34,46,45,34,35,47,46,35,24,36,47]}]}]}
\ No newline at end of file
diff --git a/styles/hologram-hud/demo/models/mkmodel.mjs b/styles/hologram-hud/demo/models/mkmodel.mjs
new file mode 100644
index 0000000..bcf0e5b
--- /dev/null
+++ b/styles/hologram-hud/demo/models/mkmodel.mjs
@@ -0,0 +1,218 @@
+// 线框模型构建工具:几何基本体 → {v, e, q}(顶点 / 边 / 四边面)
+// 输出格式(engine/holo.js 读取):
+// { name, parts: [{ id, anchor:[x,y,z], pieces: [{ id, v:[x,y,z,...], e:[a,b,...], q:[a,b,c,d,...], explode:[dx,dy,dz], axis?:{c,d} }] }] }
+const TAU = Math.PI * 2;
+const sub = (a, b) => [a[0] - b[0], a[1] - b[1], a[2] - b[2]];
+const add = (a, b) => [a[0] + b[0], a[1] + b[1], a[2] + b[2]];
+const mul = (a, s) => [a[0] * s, a[1] * s, a[2] * s];
+const cross = (a, b) => [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]];
+const len = a => Math.hypot(a[0], a[1], a[2]);
+const norm = a => mul(a, 1 / (len(a) || 1));
+const lerp3 = (a, b, t) => add(a, mul(sub(b, a), t));
+function basis(d) {
+ d = norm(d);
+ const ref = Math.abs(d[1]) < 0.9 ? [0, 1, 0] : [1, 0, 0];
+ const u = norm(cross(d, ref)), w = cross(d, u);
+ return [d, u, w];
+}
+
+export class Model {
+ constructor(name) { this.name = name; this.parts = []; }
+ part(id, o = {}) { this.P = { id, anchor: o.anchor || [0, 0, 0], ...(o.center ? { center: o.center } : {}), ...(o.tagDir ? { tagDir: o.tagDir } : {}), pieces: [] }; this.parts.push(this.P); }
+ piece(id, o = {}) { this.C = { id, v: [], e: [], q: [], explode: o.explode || [0, 0, 0] }; if (o.axis) this.C.axis = o.axis; if (o.internal) this.C.internal = true; if (o.box === false) this.C.box = false; if (o.hot) this.C.hot = true; this.P.pieces.push(this.C); }
+ vtx(p) { this.C.v.push(p); return this.C.v.length - 1; }
+ edge(a, b) { this.C.e.push([a, b]); }
+ quad(a, b, c, d) { this.C.q.push([a, b, c, d]); }
+ // 圆环(可选厚度:两道圈 + 连线)
+ circle(c, n, r, seg, [u, w] = basis(n).slice(1), a0 = 0, a1 = TAU, closed = true) {
+ const ids = [];
+ const cnt = closed ? seg : seg + 1;
+ for (let i = 0; i < cnt; i++) { const a = a0 + (a1 - a0) * i / seg; ids.push(this.vtx(add(c, add(mul(u, Math.cos(a) * r), mul(w, Math.sin(a) * r))))); }
+ for (let i = 0; i < ids.length - (closed ? 0 : 1); i++) this.edge(ids[i], ids[(i + 1) % ids.length]);
+ return ids;
+ }
+ ring(c, n, r, seg, width = 0) {
+ if (!width) return this.circle(c, n, r, seg);
+ const d = norm(n);
+ const A = this.circle(add(c, mul(d, -width / 2)), n, r, seg), B = this.circle(add(c, mul(d, width / 2)), n, r, seg);
+ for (let i = 0; i < seg; i++) { if (i % 4 === 0) this.edge(A[i], B[i]); this.quad(A[i], A[(i + 1) % seg], B[(i + 1) % seg], B[i]); }
+ return [A, B];
+ }
+ // 管子:环 + 纵线 + 面;arc = [起, 止](以圈为单位,可只做半圈);zA 起点 z 偏移(叉子外张)
+ tube(a, b, r, o = {}) {
+ const rings = o.rings || 6, seg = o.seg || 10, longs = o.longs || 4;
+ if (o.zA) a = add(a, [0, 0, o.zA]);
+ const [d, u, w] = basis(sub(b, a));
+ const arc = o.arc || [0, 1], full = arc[1] - arc[0] >= 1 - 1e-6;
+ const segN = full ? seg : Math.max(2, Math.round(seg * (arc[1] - arc[0])));
+ const R = [];
+ for (let k = 0; k < rings; k++) {
+ const c = lerp3(a, b, k / (rings - 1));
+ R.push(this.circle(c, d, r, segN, [u, w], arc[0] * TAU, arc[1] * TAU, full));
+ }
+ const m = R[0].length;
+ for (let k = 0; k < rings - 1; k++) for (let i = 0; i < m - (full ? 0 : 1); i++) this.quad(R[k][i], R[k][(i + 1) % m], R[k + 1][(i + 1) % m], R[k + 1][i]);
+ const step = Math.max(1, Math.floor(m / longs));
+ for (let i = 0; i < m; i += step) for (let k = 0; k < rings - 1; k++) this.edge(R[k][i], R[k + 1][i]);
+ if (!full) for (const i of [0, m - 1]) for (let k = 0; k < rings - 1; k++) this.edge(R[k][i], R[k + 1][i]);
+ return R;
+ }
+ polyTube(pts, r, o = {}) {
+ for (let i = 0; i < pts.length - 1; i++) this.tube(pts[i], pts[i + 1], r, { rings: o.ringsPer || 3, seg: o.seg || 8, longs: o.longs || 3 });
+ }
+ box(c, s) {
+ const [hx, hy, hz] = s.map(x => x / 2), ids = [];
+ for (const z of [-hz, hz]) for (const y of [-hy, hy]) for (const x of [-hx, hx]) ids.push(this.vtx([c[0] + x, c[1] + y, c[2] + z]));
+ const E = [[0, 1], [2, 3], [4, 5], [6, 7], [0, 2], [1, 3], [4, 6], [5, 7], [0, 4], [1, 5], [2, 6], [3, 7]];
+ for (const [a, b] of E) this.edge(ids[a], ids[b]);
+ const F = [[0, 1, 3, 2], [4, 5, 7, 6], [0, 1, 5, 4], [2, 3, 7, 6], [0, 2, 6, 4], [1, 3, 7, 5]];
+ for (const f of F) this.quad(...f.map(i => ids[i]));
+ }
+ disc(c, n, r, o = {}) {
+ const rs = o.rings || [r], seg = o.seg || 16, R = rs.map(x => this.circle(c, n, x, seg));
+ for (let k = 0; k < R.length - 1; k++) for (let i = 0; i < seg; i++) { this.quad(R[k][i], R[k][(i + 1) % seg], R[k + 1][(i + 1) % seg], R[k + 1][i]); if (i % 4 === 0) this.edge(R[k][i], R[k + 1][i]); }
+ }
+ saddle(c) {
+ // 由 5 道截面环组成的座垫
+ const secs = [[-0.13, 0.075, 0.018], [-0.08, 0.08, 0.024], [-0.01, 0.06, 0.022], [0.06, 0.028, 0.016], [0.12, 0.018, 0.012]];
+ const seg = 12, R = [];
+ for (const [x, hw, hh] of secs) {
+ const ids = [];
+ for (let i = 0; i < seg; i++) { const a = i / seg * TAU; ids.push(this.vtx([c[0] + x, c[1] + Math.sin(a) * hh + hh * 0.3, c[2] + Math.cos(a) * hw])); }
+ for (let i = 0; i < seg; i++) this.edge(ids[i], ids[(i + 1) % seg]);
+ R.push(ids);
+ }
+ for (let k = 0; k < R.length - 1; k++) for (let i = 0; i < seg; i++) { this.quad(R[k][i], R[k][(i + 1) % seg], R[k + 1][(i + 1) % seg], R[k + 1][i]); if (i % 3 === 0) this.edge(R[k][i], R[k + 1][i]); }
+ }
+ fender(c, r, w, a0, a1, front) {
+ const seg = 30, A = [], B = [], M = [];
+ for (let i = 0; i <= seg; i++) {
+ const a = a0 + (a1 - a0) * i / seg, x = c[0] + Math.cos(a) * r, y = c[1] + Math.sin(a) * r;
+ const rr = r + 0.012;
+ A.push(this.vtx([x, y, -w / 2])); B.push(this.vtx([x, y, w / 2])); M.push(this.vtx([c[0] + Math.cos(a) * rr, c[1] + Math.sin(a) * rr, 0]));
+ }
+ for (let i = 0; i < seg; i++) { this.edge(A[i], A[i + 1]); this.edge(B[i], B[i + 1]); this.edge(M[i], M[i + 1]); this.quad(A[i], A[i + 1], M[i + 1], M[i]); this.quad(M[i], M[i + 1], B[i + 1], B[i]); if (i % 5 === 0) { this.edge(A[i], M[i]); this.edge(M[i], B[i]); } }
+ this.edge(A[0], M[0]); this.edge(M[0], B[0]); this.edge(A[seg], M[seg]); this.edge(M[seg], B[seg]);
+ }
+ wheel(c, R, o) {
+ const n = [0, 0, 1];
+ // 胎:3 道环(外径 + 两侧胎壁)+ 横纹
+ const tw = 0.022, seg = 72;
+ const T0 = this.circle([c[0], c[1], -tw], n, R - 0.02, seg), T1 = this.circle(c, n, R, seg), T2 = this.circle([c[0], c[1], tw], n, R - 0.02, seg);
+ for (let i = 0; i < seg; i++) { this.quad(T0[i], T0[(i + 1) % seg], T1[(i + 1) % seg], T1[i]); this.quad(T1[i], T1[(i + 1) % seg], T2[(i + 1) % seg], T2[i]); if (i % 3 === 0) { this.edge(T0[i], T1[i]); this.edge(T1[i], T2[i]); } }
+ // 轮圈
+ const r1 = R - 0.045, r2 = R - 0.07;
+ const A = this.circle([c[0], c[1], -0.012], n, r1, 60), B = this.circle([c[0], c[1], 0.012], n, r1, 60), C = this.circle(c, n, r2, 60);
+ for (let i = 0; i < 60; i++) { this.quad(A[i], A[(i + 1) % 60], C[(i + 1) % 60], C[i]); this.quad(C[i], C[(i + 1) % 60], B[(i + 1) % 60], B[i]); }
+ // 辐条
+ const k = o.spokes, rf = o.spokeFrom;
+ for (let i = 0; i < k; i++) {
+ const s = i % 2 ? 1 : -1, a = i / k * TAU, a2 = a + (s > 0 ? 0.35 : -0.35);
+ const p = this.vtx([c[0] + Math.cos(a) * rf, c[1] + Math.sin(a) * rf, 0.03 * s]);
+ const q = this.vtx([c[0] + Math.cos(a2) * r2, c[1] + Math.sin(a2) * r2, 0]);
+ this.edge(p, q);
+ }
+ if (o.hub) { this.tube([c[0], c[1], -0.045], [c[0], c[1], 0.045], o.hub, { rings: 3, seg: 12, longs: 6 }); }
+ }
+ beltLines(a, ra, b, rb) {
+ for (const s of [1, -1]) { const p = this.vtx([a[0], a[1] + ra * s, a[2]]), q = this.vtx([b[0], b[1] + rb * s, b[2]]); this.edge(p, q); }
+ }
+ // 电池电芯:沿下管排两行圆柱
+ cells(a, b, r, n, rows) {
+ const [d, u, w] = basis(sub(b, a)), L = len(sub(b, a)), cl = L / n * 0.86;
+ for (let row = 0; row < rows; row++) for (let i = 0; i < n; i++) {
+ const c = add(lerp3(a, b, (i + 0.5) / n), mul(w, (row - (rows - 1) / 2) * r * 0.95));
+ const p0 = add(c, mul(d, -cl / 2)), p1 = add(c, mul(d, cl / 2));
+ this.tube(p0, p1, r * 0.46, { rings: 2, seg: 10, longs: 3 });
+ }
+ }
+ board(a, b, t0, t1) {
+ const [d, u, w] = basis(sub(b, a));
+ const p0 = lerp3(a, b, t0), p1 = lerp3(a, b, t1), wv = mul(w, 0.028), off = mul(u, 0.03);
+ const P = [add(add(p0, off), wv), add(add(p1, off), wv), add(add(p1, off), mul(wv, -1)), add(add(p0, off), mul(wv, -1))].map(p => this.vtx(p));
+ for (let i = 0; i < 4; i++) this.edge(P[i], P[(i + 1) % 4]);
+ this.quad(...P);
+ for (let i = 1; i < 6; i++) { const q = lerp3(p0, p1, i / 6); const A = this.vtx(add(add(q, off), mul(wv, 0.6))), B = this.vtx(add(add(add(q, off), mul(d, 0.02)), mul(wv, 0.6))), C = this.vtx(add(add(add(q, off), mul(d, 0.02)), mul(wv, 0.1))), D = this.vtx(add(add(q, off), mul(wv, 0.1))); this.edge(A, B); this.edge(B, C); this.edge(C, D); this.edge(D, A); }
+ }
+ hubCap(c, s) {
+ const n = [0, 0, 1];
+ this.disc(c, n, 0.095, { rings: [0.095, 0.08, 0.04, 0.015], seg: 32 });
+ const b = this.circle([c[0], c[1], c[2] + 0.012 * s], n, 0.092, 32), a = this.circle(c, n, 0.095, 32);
+ for (let i = 0; i < 32; i++) { this.quad(a[i], a[(i + 1) % 32], b[(i + 1) % 32], b[i]); if (i % 4 === 0) this.edge(a[i], b[i]); }
+ for (let i = 0; i < 6; i++) { const ang = i / 6 * TAU; this.box([c[0] + Math.cos(ang) * 0.06, c[1] + Math.sin(ang) * 0.06, c[2] + 0.004 * s], [0.008, 0.008, 0.006]); }
+ }
+ magnetRing(c, ro, ri, w, n) {
+ this.ring(c, [0, 0, 1], ro, 48, w); this.ring(c, [0, 0, 1], ri, 48, w);
+ for (let i = 0; i < n; i++) { const a = i / n * TAU, a2 = a + TAU / n * 0.7; const P = [[ri, a], [ro, a], [ro, a2], [ri, a2]].map(([r, t]) => this.vtx([c[0] + Math.cos(t) * r, c[1] + Math.sin(t) * r, c[2] + w / 2])); for (let k = 0; k < 4; k++) this.edge(P[k], P[(k + 1) % 4]); this.quad(...P); }
+ }
+ stator(c, ro, ri, w, n) {
+ this.ring(c, [0, 0, 1], ri, 36, w);
+ for (let i = 0; i < n; i++) {
+ const a = i / n * TAU, h = TAU / n * 0.28;
+ const P = [[ri, a - h * 0.6], [ro * 0.86, a - h * 0.6], [ro, a - h * 1.3], [ro, a + h * 1.3], [ro * 0.86, a + h * 0.6], [ri, a + h * 0.6]];
+ for (const z of [-w / 2, w / 2]) { const ids = P.map(([r, t]) => this.vtx([c[0] + Math.cos(t) * r, c[1] + Math.sin(t) * r, c[2] + z])); for (let k = 0; k < ids.length - 1; k++) this.edge(ids[k], ids[k + 1]); if (z > 0) { this.quad(ids[0], ids[1], ids[4], ids[5]); this.quad(ids[1], ids[2], ids[3], ids[4]); } }
+ // 线圈绕组:两道小环
+ const mid = (ri + ro * 0.86) / 2;
+ this.circle([c[0] + Math.cos(a) * mid, c[1] + Math.sin(a) * mid, c[2]], [Math.cos(a), Math.sin(a), 0], 0.012, 8);
+ }
+ this.tube([c[0], c[1], -0.09], [c[0], c[1], 0.09], 0.008, { rings: 3, seg: 8, longs: 4 }); // 轴
+ }
+ rotor(c, r) {
+ const n = [0, 0, 1];
+ this.disc(c, n, r, { rings: [r, r - 0.018], seg: 48 });
+ this.circle(c, n, 0.028, 16);
+ for (let i = 0; i < 6; i++) { const a = i / 6 * TAU; const p = this.vtx([c[0] + Math.cos(a) * 0.028, c[1] + Math.sin(a) * 0.028, c[2]]), q = this.vtx([c[0] + Math.cos(a + 0.5) * (r - 0.018), c[1] + Math.sin(a + 0.5) * (r - 0.018), c[2]]); this.edge(p, q); }
+ // 通风孔两圈(交错)
+ for (let i = 0; i < 24; i++) { const a = i / 24 * TAU + 0.1; this.circle([c[0] + Math.cos(a) * (r - 0.006), c[1] + Math.sin(a) * (r - 0.006), c[2]], n, 0.0034, 8); }
+ for (let i = 0; i < 24; i++) { const a = (i + 0.5) / 24 * TAU + 0.1; this.circle([c[0] + Math.cos(a) * (r - 0.0135), c[1] + Math.sin(a) * (r - 0.0135), c[2]], n, 0.003, 8); }
+ }
+ // 弧形块:以 c 为圆心、半径 r0–r1、角度 a0–a1、z0–z1 的扇环体(卡钳体、刹车片)
+ arcBlock(c, r0, r1, a0, a1, z0, z1, seg = 10) {
+ const L = [];
+ for (const z of [z0, z1]) for (const r of [r0, r1]) { const ids = []; for (let i = 0; i <= seg; i++) { const a = a0 + (a1 - a0) * i / seg; ids.push(this.vtx([c[0] + Math.cos(a) * r, c[1] + Math.sin(a) * r, z])); } for (let i = 0; i < seg; i++) this.edge(ids[i], ids[i + 1]); L.push(ids); }
+ const [A, B, C, D] = L; // z0r0 z0r1 z1r0 z1r1
+ for (const i of [0, seg]) { this.edge(A[i], B[i]); this.edge(C[i], D[i]); this.edge(A[i], C[i]); this.edge(B[i], D[i]); }
+ for (let i = 0; i < seg; i++) { this.quad(A[i], A[i + 1], B[i + 1], B[i]); this.quad(C[i], C[i + 1], D[i + 1], D[i]); this.quad(B[i], B[i + 1], D[i + 1], D[i]); this.quad(A[i], A[i + 1], C[i + 1], C[i]); }
+ for (let i = 2; i < seg; i += 3) { this.edge(B[i], D[i]); }
+ }
+ // 油压卡钳的一半(s = ±1 表示碟片哪一侧):弧形钳体 + 两个活塞孔
+ caliperHalf(c, rc, ac, zr, s) {
+ this.arcBlock(c, rc - 0.024, rc + 0.02, ac - 0.42, ac + 0.42, zr + s * 0.007, zr + s * 0.03, 12);
+ for (const da of [-0.19, 0.19]) { const p = [c[0] + Math.cos(ac + da) * rc, c[1] + Math.sin(ac + da) * rc, zr + s * 0.007]; this.circle(p, [0, 0, 1], 0.0125, 16); } // 活塞孔
+ const m = [c[0] + Math.cos(ac) * (rc + 0.03), c[1] + Math.sin(ac) * (rc + 0.03), zr + s * 0.02]; this.box(m, [0.02, 0.014, 0.016]); // 固定耳
+ }
+ // 活塞:端面看是圆(端面同心圆 + 短圆柱)
+ pistons(c, rc, ac, zr, s) {
+ for (const da of [-0.19, 0.19]) {
+ const x = c[0] + Math.cos(ac + da) * rc, y = c[1] + Math.sin(ac + da) * rc;
+ this.tube([x, y, zr + s * 0.006], [x, y, zr + s * 0.02], 0.011, { rings: 3, seg: 16, longs: 6 });
+ this.disc([x, y, zr + s * 0.006], [0, 0, 1], 0.011, { rings: [0.011, 0.007, 0.003], seg: 16 });
+ }
+ }
+ // 刹车片:贴着碟片的弧形片(背板 + 摩擦块)
+ pad(c, rc, ac, zr, s) {
+ this.arcBlock(c, rc - 0.016, rc + 0.014, ac - 0.36, ac + 0.36, zr + s * 0.0035, zr + s * 0.0065, 10);
+ this.arcBlock(c, rc - 0.013, rc + 0.011, ac - 0.32, ac + 0.32, zr + s * 0.0065, zr + s * 0.0085, 8);
+ }
+ caliper(c, s) {
+ const z = c[2] + 0.018 * s;
+ this.box([c[0], c[1], z], [0.07, 0.035, 0.022]);
+ this.tube([c[0] - 0.02, c[1], z], [c[0] - 0.02, c[1], z + 0.012 * s], 0.012, { rings: 2, seg: 10, longs: 4 }); // 活塞
+ this.tube([c[0] + 0.02, c[1], z], [c[0] + 0.02, c[1], z + 0.012 * s], 0.012, { rings: 2, seg: 10, longs: 4 });
+ this.box([c[0], c[1] - 0.012, c[2] + 0.004 * s], [0.05, 0.016, 0.004]); // 刹车片
+ }
+ lever(p) {
+ this.box([p[0] + 0.01, p[1] + 0.005, p[2]], [0.035, 0.03, 0.03]);
+ this.polyTube([[p[0] + 0.02, p[1], p[2]], [p[0] + 0.06, p[1] - 0.01, p[2] + 0.04], [p[0] + 0.07, p[1] - 0.015, p[2] + 0.12]], 0.005, { seg: 6, longs: 2, ringsPer: 2 });
+ }
+ toJSON() {
+ const r = x => Math.round(x * 10000) / 10000;
+ return {
+ name: this.name, units: 'm', up: 'y',
+ parts: this.parts.map(P => ({
+ id: P.id, anchor: P.anchor, ...(P.center ? { center: P.center } : {}), ...(P.tagDir ? { tagDir: P.tagDir } : {}),
+ pieces: P.pieces.map(C => ({ id: C.id, explode: C.explode, ...(C.axis ? { axis: C.axis } : {}), ...(C.internal ? { internal: true } : {}), ...(C.box === false ? { box: false } : {}), ...(C.hot ? { hot: true } : {}), v: C.v.flat().map(r), e: C.e.flat(), q: C.q.flat() }))
+ }))
+ };
+ }
+}
diff --git a/styles/hologram-hud/demo/models/volt.json b/styles/hologram-hud/demo/models/volt.json
new file mode 100644
index 0000000..0a821c8
--- /dev/null
+++ b/styles/hologram-hud/demo/models/volt.json
@@ -0,0 +1 @@
+{"name":"VOLT CE-01","units":"m","up":"y","parts":[{"id":"frame","anchor":[0.1,0.7,0],"pieces":[{"id":"frame-main","explode":[0,0,0],"v":[-0.04,0.29,-0.019,-0.0505,0.2862,-0.0154,-0.057,0.2838,-0.0059,-0.057,0.2838,0.0059,-0.0505,0.2862,0.0154,-0.04,0.29,0.019,-0.0295,0.2938,0.0154,-0.023,0.2962,0.0059,-0.023,0.2962,-0.0059,-0.0295,0.2938,-0.0154,-0.065,0.3588,-0.019,-0.0755,0.3549,-0.0154,-0.082,0.3526,-0.0059,-0.082,0.3526,0.0059,-0.0755,0.3549,0.0154,-0.065,0.3588,0.019,-0.0545,0.3626,0.0154,-0.048,0.3649,0.0059,-0.048,0.3649,-0.0059,-0.0545,0.3626,-0.0154,-0.09,0.4275,-0.019,-0.1005,0.4237,-0.0154,-0.107,0.4213,-0.0059,-0.107,0.4213,0.0059,-0.1005,0.4237,0.0154,-0.09,0.4275,0.019,-0.0795,0.4313,0.0154,-0.073,0.4337,0.0059,-0.073,0.4337,-0.0059,-0.0795,0.4313,-0.0154,-0.115,0.4963,-0.019,-0.1255,0.4924,-0.0154,-0.132,0.4901,-0.0059,-0.132,0.4901,0.0059,-0.1255,0.4924,0.0154,-0.115,0.4963,0.019,-0.1045,0.5001,0.0154,-0.098,0.5024,0.0059,-0.098,0.5024,-0.0059,-0.1045,0.5001,-0.0154,-0.14,0.565,-0.019,-0.1505,0.5612,-0.0154,-0.157,0.5588,-0.0059,-0.157,0.5588,0.0059,-0.1505,0.5612,0.0154,-0.14,0.565,0.019,-0.1295,0.5688,0.0154,-0.123,0.5712,0.0059,-0.123,0.5712,-0.0059,-0.1295,0.5688,-0.0154,-0.165,0.6338,-0.019,-0.1755,0.6299,-0.0154,-0.182,0.6276,-0.0059,-0.182,0.6276,0.0059,-0.1755,0.6299,0.0154,-0.165,0.6338,0.019,-0.1545,0.6376,0.0154,-0.148,0.6399,0.0059,-0.148,0.6399,-0.0059,-0.1545,0.6376,-0.0154,-0.19,0.7025,-0.019,-0.2005,0.6987,-0.0154,-0.207,0.6963,-0.0059,-0.207,0.6963,0.0059,-0.2005,0.6987,0.0154,-0.19,0.7025,0.019,-0.1795,0.7063,0.0154,-0.173,0.7087,0.0059,-0.173,0.7087,-0.0059,-0.1795,0.7063,-0.0154,-0.215,0.7713,-0.019,-0.2255,0.7674,-0.0154,-0.232,0.7651,-0.0059,-0.232,0.7651,0.0059,-0.2255,0.7674,0.0154,-0.215,0.7713,0.019,-0.2045,0.7751,0.0154,-0.198,0.7774,0.0059,-0.198,0.7774,-0.0059,-0.2045,0.7751,-0.0154,-0.24,0.84,-0.019,-0.2505,0.8362,-0.0154,-0.257,0.8338,-0.0059,-0.257,0.8338,0.0059,-0.2505,0.8362,0.0154,-0.24,0.84,0.019,-0.2295,0.8438,0.0154,-0.223,0.8462,0.0059,-0.223,0.8462,-0.0059,-0.2295,0.8438,-0.0154,-0.22,0.79,0.017,-0.2198,0.78,0.0138,-0.2197,0.7738,0.0053,-0.2197,0.7738,-0.0053,-0.2198,0.78,-0.0138,-0.22,0.79,-0.017,-0.2202,0.8,-0.0138,-0.2203,0.8062,-0.0053,-0.2203,0.8062,0.0053,-0.2202,0.8,0.0138,-0.1544,0.7911,0.017,-0.1543,0.7811,0.0138,-0.1542,0.7749,0.0053,-0.1542,0.7749,-0.0053,-0.1543,0.7811,-0.0138,-0.1544,0.7911,-0.017,-0.1546,0.8011,-0.0138,-0.1547,0.8073,-0.0053,-0.1547,0.8073,0.0053,-0.1546,0.8011,0.0138,-0.0889,0.7922,0.017,-0.0887,0.7822,0.0138,-0.0886,0.7761,0.0053,-0.0886,0.7761,-0.0053,-0.0887,0.7822,-0.0138,-0.0889,0.7922,-0.017,-0.0891,0.8022,-0.0138,-0.0892,0.8084,-0.0053,-0.0892,0.8084,0.0053,-0.0891,0.8022,0.0138,-0.0233,0.7933,0.017,-0.0232,0.7833,0.0138,-0.0231,0.7772,0.0053,-0.0231,0.7772,-0.0053,-0.0232,0.7833,-0.0138,-0.0233,0.7933,-0.017,-0.0235,0.8033,-0.0138,-0.0236,0.8095,-0.0053,-0.0236,0.8095,0.0053,-0.0235,0.8033,0.0138,0.0422,0.7944,0.017,0.0424,0.7845,0.0138,0.0425,0.7783,0.0053,0.0425,0.7783,-0.0053,0.0424,0.7845,-0.0138,0.0422,0.7944,-0.017,0.0421,0.8044,-0.0138,0.0419,0.8106,-0.0053,0.0419,0.8106,0.0053,0.0421,0.8044,0.0138,0.1078,0.7956,0.017,0.1079,0.7856,0.0138,0.1081,0.7794,0.0053,0.1081,0.7794,-0.0053,0.1079,0.7856,-0.0138,0.1078,0.7956,-0.017,0.1076,0.8055,-0.0138,0.1075,0.8117,-0.0053,0.1075,0.8117,0.0053,0.1076,0.8055,0.0138,0.1733,0.7967,0.017,0.1735,0.7867,0.0138,0.1736,0.7805,0.0053,0.1736,0.7805,-0.0053,0.1735,0.7867,-0.0138,0.1733,0.7967,-0.017,0.1732,0.8067,-0.0138,0.1731,0.8128,-0.0053,0.1731,0.8128,0.0053,0.1732,0.8067,0.0138,0.2389,0.7978,0.017,0.2391,0.7878,0.0138,0.2392,0.7816,0.0053,0.2392,0.7816,-0.0053,0.2391,0.7878,-0.0138,0.2389,0.7978,-0.017,0.2387,0.8078,-0.0138,0.2386,0.8139,-0.0053,0.2386,0.8139,0.0053,0.2387,0.8078,0.0138,0.3044,0.7989,0.017,0.3046,0.7889,0.0138,0.3047,0.7827,0.0053,0.3047,0.7827,-0.0053,0.3046,0.7889,-0.0138,0.3044,0.7989,-0.017,0.3043,0.8089,-0.0138,0.3042,0.8151,-0.0053,0.3042,0.8151,0.0053,0.3043,0.8089,0.0138,0.37,0.8,0.017,0.3702,0.79,0.0138,0.3703,0.7838,0.0053,0.3703,0.7838,-0.0053,0.3702,0.79,-0.0138,0.37,0.8,-0.017,0.3698,0.81,-0.0138,0.3697,0.8162,-0.0053,0.3697,0.8162,0.0053,0.3698,0.81,0.0138,0.4,0.66,-0.024,0.3884,0.6571,-0.0208,0.3798,0.655,-0.012,0.3767,0.6542,0,0.3798,0.655,0.012,0.3884,0.6571,0.0208,0.4,0.66,0.024,0.4116,0.6629,0.0208,0.4202,0.665,0.012,0.4233,0.6658,0,0.4202,0.665,-0.012,0.4116,0.6629,-0.0208,0.3833,0.7267,-0.024,0.3717,0.7238,-0.0208,0.3632,0.7216,-0.012,0.36,0.7208,0,0.3632,0.7216,0.012,0.3717,0.7238,0.0208,0.3833,0.7267,0.024,0.395,0.7296,0.0208,0.4035,0.7317,0.012,0.4066,0.7325,0,0.4035,0.7317,-0.012,0.395,0.7296,-0.0208,0.3667,0.7933,-0.024,0.355,0.7904,-0.0208,0.3465,0.7883,-0.012,0.3434,0.7875,0,0.3465,0.7883,0.012,0.355,0.7904,0.0208,0.3667,0.7933,0.024,0.3783,0.7962,0.0208,0.3868,0.7984,0.012,0.39,0.7992,0,0.3868,0.7984,-0.012,0.3783,0.7962,-0.0208,0.35,0.86,-0.024,0.3384,0.8571,-0.0208,0.3298,0.855,-0.012,0.3267,0.8542,0,0.3298,0.855,0.012,0.3384,0.8571,0.0208,0.35,0.86,0.024,0.3616,0.8629,0.0208,0.3702,0.865,0.012,0.3733,0.8658,0,0.3702,0.865,-0.012,0.3616,0.8629,-0.0208,-0.0392,0.29,-0.042,-0.0404,0.2816,-0.0385,-0.0414,0.2781,-0.0301,-0.0416,0.2816,-0.0216,-0.0408,0.29,-0.018,-0.0396,0.2984,-0.0215,-0.0386,0.3019,-0.0299,-0.0384,0.2984,-0.0384,-0.1106,0.2986,-0.047,-0.1118,0.2901,-0.0435,-0.1129,0.2867,-0.0351,-0.113,0.2901,-0.0266,-0.1123,0.2986,-0.023,-0.111,0.307,-0.0265,-0.11,0.3105,-0.0349,-0.1098,0.307,-0.0434,-0.182,0.3071,-0.052,-0.1833,0.2987,-0.0485,-0.1843,0.2952,-0.0401,-0.1845,0.2987,-0.0316,-0.1837,0.3071,-0.028,-0.1824,0.3156,-0.0315,-0.1814,0.3191,-0.0399,-0.1813,0.3156,-0.0484,-0.2534,0.3157,-0.057,-0.2547,0.3073,-0.0535,-0.2557,0.3038,-0.0451,-0.2559,0.3073,-0.0366,-0.2551,0.3157,-0.033,-0.2539,0.3241,-0.0365,-0.2529,0.3276,-0.0449,-0.2527,0.3241,-0.0534,-0.3249,0.3243,-0.062,-0.3261,0.3159,-0.0585,-0.3271,0.3124,-0.0501,-0.3273,0.3159,-0.0416,-0.3266,0.3243,-0.038,-0.3253,0.3327,-0.0415,-0.3243,0.3362,-0.0499,-0.3241,0.3327,-0.0584,-0.3963,0.3329,-0.067,-0.3976,0.3244,-0.0635,-0.3986,0.3209,-0.0551,-0.3987,0.3244,-0.0466,-0.398,0.3329,-0.043,-0.3967,0.3413,-0.0465,-0.3957,0.3448,-0.0549,-0.3955,0.3413,-0.0634,-0.4677,0.3414,-0.072,-0.469,0.333,-0.0685,-0.47,0.3295,-0.0601,-0.4702,0.333,-0.0516,-0.4694,0.3414,-0.048,-0.4682,0.3499,-0.0515,-0.4671,0.3533,-0.0599,-0.467,0.3499,-0.0684,-0.5392,0.35,-0.077,-0.5404,0.3416,-0.0735,-0.5414,0.3381,-0.0651,-0.5416,0.3416,-0.0566,-0.5408,0.35,-0.053,-0.5396,0.3584,-0.0565,-0.5386,0.3619,-0.0649,-0.5384,0.3584,-0.0734,-0.2084,0.76,-0.0219,-0.2036,0.7554,-0.0181,-0.2025,0.7535,-0.0108,-0.2058,0.7554,-0.0042,-0.2116,0.76,-0.0021,-0.2164,0.7646,-0.0059,-0.2175,0.7665,-0.0132,-0.2142,0.7646,-0.0198,-0.2556,0.7043,-0.0294,-0.2507,0.6997,-0.0257,-0.2496,0.6978,-0.0184,-0.253,0.6997,-0.0117,-0.2587,0.7043,-0.0097,-0.2636,0.7089,-0.0134,-0.2646,0.7108,-0.0208,-0.2613,0.7089,-0.0274,-0.3027,0.6486,-0.037,-0.2979,0.644,-0.0333,-0.2968,0.6421,-0.0259,-0.3001,0.644,-0.0193,-0.3059,0.6486,-0.0173,-0.3107,0.6532,-0.021,-0.3118,0.6551,-0.0283,-0.3085,0.6532,-0.035,-0.3498,0.5929,-0.0446,-0.345,0.5883,-0.0408,-0.3439,0.5863,-0.0335,-0.3472,0.5883,-0.0269,-0.353,0.5929,-0.0248,-0.3579,0.5975,-0.0286,-0.3589,0.5994,-0.0359,-0.3556,0.5975,-0.0425,-0.397,0.5371,-0.0522,-0.3921,0.5325,-0.0484,-0.3911,0.5306,-0.0411,-0.3944,0.5325,-0.0345,-0.4002,0.5371,-0.0324,-0.405,0.5417,-0.0362,-0.4061,0.5437,-0.0435,-0.4028,0.5417,-0.0501,-0.4441,0.4814,-0.0597,-0.4393,0.4768,-0.056,-0.4382,0.4749,-0.0487,-0.4415,0.4768,-0.042,-0.4473,0.4814,-0.04,-0.4521,0.486,-0.0437,-0.4532,0.4879,-0.0511,-0.4499,0.486,-0.0577,-0.4913,0.4257,-0.0673,-0.4864,0.4211,-0.0636,-0.4854,0.4192,-0.0562,-0.4887,0.4211,-0.0496,-0.4944,0.4257,-0.0476,-0.4993,0.4303,-0.0513,-0.5004,0.4322,-0.0586,-0.497,0.4303,-0.0653,-0.5384,0.37,-0.0749,-0.5336,0.3654,-0.0711,-0.5325,0.3635,-0.0638,-0.5358,0.3654,-0.0572,-0.5416,0.37,-0.0551,-0.5464,0.3746,-0.0589,-0.5475,0.3765,-0.0662,-0.5442,0.3746,-0.0728,-0.0408,0.29,0.018,-0.0416,0.2816,0.0216,-0.0414,0.2781,0.0301,-0.0404,0.2816,0.0385,-0.0392,0.29,0.042,-0.0384,0.2984,0.0384,-0.0386,0.3019,0.0299,-0.0396,0.2984,0.0215,-0.1123,0.2986,0.023,-0.113,0.2901,0.0266,-0.1129,0.2867,0.0351,-0.1118,0.2901,0.0435,-0.1106,0.2986,0.047,-0.1098,0.307,0.0434,-0.11,0.3105,0.0349,-0.111,0.307,0.0265,-0.1837,0.3071,0.028,-0.1845,0.2987,0.0316,-0.1843,0.2952,0.0401,-0.1833,0.2987,0.0485,-0.182,0.3071,0.052,-0.1813,0.3156,0.0484,-0.1814,0.3191,0.0399,-0.1824,0.3156,0.0315,-0.2551,0.3157,0.033,-0.2559,0.3073,0.0366,-0.2557,0.3038,0.0451,-0.2547,0.3073,0.0535,-0.2534,0.3157,0.057,-0.2527,0.3241,0.0534,-0.2529,0.3276,0.0449,-0.2539,0.3241,0.0365,-0.3266,0.3243,0.038,-0.3273,0.3159,0.0416,-0.3271,0.3124,0.0501,-0.3261,0.3159,0.0585,-0.3249,0.3243,0.062,-0.3241,0.3327,0.0584,-0.3243,0.3362,0.0499,-0.3253,0.3327,0.0415,-0.398,0.3329,0.043,-0.3987,0.3244,0.0466,-0.3986,0.3209,0.0551,-0.3976,0.3244,0.0635,-0.3963,0.3329,0.067,-0.3955,0.3413,0.0634,-0.3957,0.3448,0.0549,-0.3967,0.3413,0.0465,-0.4694,0.3414,0.048,-0.4702,0.333,0.0516,-0.47,0.3295,0.0601,-0.469,0.333,0.0685,-0.4677,0.3414,0.072,-0.467,0.3499,0.0684,-0.4671,0.3533,0.0599,-0.4682,0.3499,0.0515,-0.5408,0.35,0.053,-0.5416,0.3416,0.0566,-0.5414,0.3381,0.0651,-0.5404,0.3416,0.0735,-0.5392,0.35,0.077,-0.5384,0.3584,0.0734,-0.5386,0.3619,0.0649,-0.5396,0.3584,0.0565,-0.2116,0.76,0.0021,-0.2058,0.7554,0.0042,-0.2025,0.7535,0.0108,-0.2036,0.7554,0.0181,-0.2084,0.76,0.0219,-0.2142,0.7646,0.0198,-0.2175,0.7665,0.0132,-0.2164,0.7646,0.0059,-0.2587,0.7043,0.0097,-0.253,0.6997,0.0117,-0.2496,0.6978,0.0184,-0.2507,0.6997,0.0257,-0.2556,0.7043,0.0294,-0.2613,0.7089,0.0274,-0.2646,0.7108,0.0208,-0.2636,0.7089,0.0134,-0.3059,0.6486,0.0173,-0.3001,0.644,0.0193,-0.2968,0.6421,0.0259,-0.2979,0.644,0.0333,-0.3027,0.6486,0.037,-0.3085,0.6532,0.035,-0.3118,0.6551,0.0283,-0.3107,0.6532,0.021,-0.353,0.5929,0.0248,-0.3472,0.5883,0.0269,-0.3439,0.5863,0.0335,-0.345,0.5883,0.0408,-0.3498,0.5929,0.0446,-0.3556,0.5975,0.0425,-0.3589,0.5994,0.0359,-0.3579,0.5975,0.0286,-0.4002,0.5371,0.0324,-0.3944,0.5325,0.0345,-0.3911,0.5306,0.0411,-0.3921,0.5325,0.0484,-0.397,0.5371,0.0522,-0.4028,0.5417,0.0501,-0.4061,0.5437,0.0435,-0.405,0.5417,0.0362,-0.4473,0.4814,0.04,-0.4415,0.4768,0.042,-0.4382,0.4749,0.0487,-0.4393,0.4768,0.056,-0.4441,0.4814,0.0597,-0.4499,0.486,0.0577,-0.4532,0.4879,0.0511,-0.4521,0.486,0.0437,-0.4944,0.4257,0.0476,-0.4887,0.4211,0.0496,-0.4854,0.4192,0.0562,-0.4864,0.4211,0.0636,-0.4913,0.4257,0.0673,-0.497,0.4303,0.0653,-0.5004,0.4322,0.0586,-0.4993,0.4303,0.0513,-0.5416,0.37,0.0551,-0.5358,0.3654,0.0572,-0.5325,0.3635,0.0638,-0.5336,0.3654,0.0711,-0.5384,0.37,0.0749,-0.5442,0.3746,0.0728,-0.5475,0.3765,0.0662,-0.5464,0.3746,0.0589,0.4004,0.64,-0.032,0.3922,0.6356,-0.0356,0.3886,0.6337,-0.0446,0.3917,0.6356,-0.0539,0.3996,0.64,-0.058,0.4078,0.6444,-0.0544,0.4114,0.6463,-0.0454,0.4083,0.6444,-0.0361,0.4271,0.5917,-0.0328,0.4189,0.5872,-0.0364,0.4153,0.5854,-0.0455,0.4183,0.5872,-0.0548,0.4263,0.5917,-0.0588,0.4344,0.5961,-0.0553,0.438,0.5979,-0.0462,0.435,0.5961,-0.0369,0.4537,0.5433,-0.0337,0.4456,0.5389,-0.0372,0.442,0.5371,-0.0463,0.445,0.5389,-0.0556,0.4529,0.5433,-0.0597,0.4611,0.5478,-0.0561,0.4647,0.5496,-0.047,0.4617,0.5478,-0.0377,0.4804,0.495,-0.0345,0.4722,0.4906,-0.0381,0.4686,0.4887,-0.0471,0.4717,0.4906,-0.0564,0.4796,0.495,-0.0605,0.4878,0.4994,-0.0569,0.4914,0.5013,-0.0479,0.4883,0.4994,-0.0386,0.5071,0.4467,-0.0353,0.4989,0.4422,-0.0389,0.4953,0.4404,-0.048,0.4983,0.4422,-0.0573,0.5063,0.4467,-0.0613,0.5144,0.4511,-0.0578,0.518,0.4529,-0.0487,0.515,0.4511,-0.0394,0.5337,0.3983,-0.0362,0.5256,0.3939,-0.0397,0.522,0.3921,-0.0488,0.525,0.3939,-0.0581,0.5329,0.3983,-0.0622,0.5411,0.4028,-0.0586,0.5447,0.4046,-0.0495,0.5417,0.4028,-0.0402,0.5604,0.35,-0.037,0.5522,0.3456,-0.0406,0.5486,0.3437,-0.0496,0.5517,0.3456,-0.0589,0.5596,0.35,-0.063,0.5678,0.3544,-0.0594,0.5714,0.3563,-0.0504,0.5683,0.3544,-0.0411,0.3996,0.64,0.058,0.3917,0.6356,0.0539,0.3886,0.6337,0.0446,0.3922,0.6356,0.0356,0.4004,0.64,0.032,0.4083,0.6444,0.0361,0.4114,0.6463,0.0454,0.4078,0.6444,0.0544,0.4263,0.5917,0.0588,0.4183,0.5872,0.0548,0.4153,0.5854,0.0455,0.4189,0.5872,0.0364,0.4271,0.5917,0.0328,0.435,0.5961,0.0369,0.438,0.5979,0.0462,0.4344,0.5961,0.0553,0.4529,0.5433,0.0597,0.445,0.5389,0.0556,0.442,0.5371,0.0463,0.4456,0.5389,0.0372,0.4537,0.5433,0.0337,0.4617,0.5478,0.0377,0.4647,0.5496,0.047,0.4611,0.5478,0.0561,0.4796,0.495,0.0605,0.4717,0.4906,0.0564,0.4686,0.4887,0.0471,0.4722,0.4906,0.0381,0.4804,0.495,0.0345,0.4883,0.4994,0.0386,0.4914,0.5013,0.0479,0.4878,0.4994,0.0569,0.5063,0.4467,0.0613,0.4983,0.4422,0.0573,0.4953,0.4404,0.048,0.4989,0.4422,0.0389,0.5071,0.4467,0.0353,0.515,0.4511,0.0394,0.518,0.4529,0.0487,0.5144,0.4511,0.0578,0.5329,0.3983,0.0622,0.525,0.3939,0.0581,0.522,0.3921,0.0488,0.5256,0.3939,0.0397,0.5337,0.3983,0.0362,0.5417,0.4028,0.0402,0.5447,0.4046,0.0495,0.5411,0.4028,0.0586,0.5596,0.35,0.063,0.5517,0.3456,0.0589,0.5486,0.3437,0.0496,0.5522,0.3456,0.0406,0.5604,0.35,0.037,0.5683,0.3544,0.0411,0.5714,0.3563,0.0504,0.5678,0.3544,0.0594,0.382,0.64,-0.05,0.3873,0.6273,-0.05,0.4,0.622,-0.05,0.4127,0.6273,-0.05,0.418,0.64,-0.05,0.4127,0.6527,-0.05,0.4,0.658,-0.05,0.3873,0.6527,-0.05,0.382,0.64,0,0.3873,0.6273,0,0.4,0.622,0,0.4127,0.6273,0,0.418,0.64,0,0.4127,0.6527,0,0.4,0.658,0,0.3873,0.6527,0,0.382,0.64,0.05,0.3873,0.6273,0.05,0.4,0.622,0.05,0.4127,0.6273,0.05,0.418,0.64,0.05,0.4127,0.6527,0.05,0.4,0.658,0.05,0.3873,0.6527,0.05,0.35,0.86,-0.013,0.3408,0.8608,-0.0092,0.3371,0.8612,0,0.3408,0.8608,0.0092,0.35,0.86,0.013,0.3592,0.8592,0.0092,0.3629,0.8588,0,0.3592,0.8592,-0.0092,0.3533,0.8967,-0.013,0.3442,0.8975,-0.0092,0.3404,0.8978,0,0.3442,0.8975,0.0092,0.3533,0.8967,0.013,0.3625,0.8958,0.0092,0.3663,0.8955,0,0.3625,0.8958,-0.0092,0.3567,0.9333,-0.013,0.3475,0.9342,-0.0092,0.3437,0.9345,0,0.3475,0.9342,0.0092,0.3567,0.9333,0.013,0.3658,0.9325,0.0092,0.3696,0.9322,0,0.3658,0.9325,-0.0092,0.36,0.97,-0.013,0.3508,0.9708,-0.0092,0.3471,0.9712,0,0.3508,0.9708,0.0092,0.36,0.97,0.013,0.3692,0.9692,0.0092,0.3729,0.9688,0,0.3692,0.9692,-0.0092,0.36,0.97,0.013,0.3625,0.9612,0.0092,0.3636,0.9575,0,0.3625,0.9612,-0.0092,0.36,0.97,-0.013,0.3575,0.9788,-0.0092,0.3564,0.9825,0,0.3575,0.9788,0.0092,0.395,0.98,0.013,0.3975,0.9712,0.0092,0.3986,0.9675,0,0.3975,0.9712,-0.0092,0.395,0.98,-0.013,0.3925,0.9888,-0.0092,0.3914,0.9925,0,0.3925,0.9888,0.0092,0.43,0.99,0.013,0.4325,0.9812,0.0092,0.4336,0.9775,0,0.4325,0.9812,-0.0092,0.43,0.99,-0.013,0.4275,0.9988,-0.0092,0.4264,1.0025,0,0.4275,0.9988,0.0092,0.41,0.97,-0.035,0.45,0.97,-0.035,0.41,1.01,-0.035,0.45,1.01,-0.035,0.41,0.97,0.035,0.45,0.97,0.035,0.41,1.01,0.035,0.45,1.01,0.035,0.3202,1,-0.3151,0.323,0.9922,-0.3165,0.33,0.989,-0.32,0.337,0.9922,-0.3235,0.3398,1,-0.3249,0.337,1.0078,-0.3235,0.33,1.011,-0.32,0.323,1.0078,-0.3165,0.3552,1,-0.2451,0.358,0.9922,-0.2465,0.365,0.989,-0.25,0.372,0.9922,-0.2535,0.3748,1,-0.2549,0.372,1.0078,-0.2535,0.365,1.011,-0.25,0.358,1.0078,-0.2465,0.3902,1,-0.1751,0.393,0.9922,-0.1765,0.4,0.989,-0.18,0.407,0.9922,-0.1835,0.4098,1,-0.1849,0.407,1.0078,-0.1835,0.4,1.011,-0.18,0.393,1.0078,-0.1765,0.3891,1,-0.1782,0.3923,0.9922,-0.1791,0.3999,0.989,-0.1806,0.4076,0.9922,-0.1817,0.4109,1,-0.1818,0.4077,1.0078,-0.1809,0.4001,1.011,-0.1794,0.3924,1.0078,-0.1783,0.4041,0.995,-0.0882,0.4073,0.9872,-0.0891,0.4149,0.984,-0.0906,0.4226,0.9872,-0.0917,0.4259,0.995,-0.0918,0.4227,1.0028,-0.0909,0.4151,1.006,-0.0894,0.4074,1.0028,-0.0883,0.4191,0.99,0.0018,0.4223,0.9822,0.0009,0.4299,0.979,-0.0006,0.4376,0.9822,-0.0017,0.4409,0.99,-0.0018,0.4377,0.9978,-0.0009,0.4301,1.001,0.0006,0.4224,0.9978,0.0017,0.4191,0.99,-0.0018,0.4223,0.9822,-0.0009,0.4299,0.979,0.0006,0.4376,0.9822,0.0017,0.4409,0.99,0.0018,0.4377,0.9978,0.0009,0.4301,1.001,-0.0006,0.4224,0.9978,-0.0017,0.4041,0.995,0.0882,0.4073,0.9872,0.0891,0.4149,0.984,0.0906,0.4226,0.9872,0.0917,0.4259,0.995,0.0918,0.4227,1.0028,0.0909,0.4151,1.006,0.0894,0.4074,1.0028,0.0883,0.3891,1,0.1782,0.3923,0.9922,0.1791,0.3999,0.989,0.1806,0.4076,0.9922,0.1817,0.4109,1,0.1818,0.4077,1.0078,0.1809,0.4001,1.011,0.1794,0.3924,1.0078,0.1783,0.3902,1,0.1751,0.393,0.9922,0.1765,0.4,0.989,0.18,0.407,0.9922,0.1835,0.4098,1,0.1849,0.407,1.0078,0.1835,0.4,1.011,0.18,0.393,1.0078,0.1765,0.3552,1,0.2451,0.358,0.9922,0.2465,0.365,0.989,0.25,0.372,0.9922,0.2535,0.3748,1,0.2549,0.372,1.0078,0.2535,0.365,1.011,0.25,0.358,1.0078,0.2465,0.3202,1,0.3151,0.323,0.9922,0.3165,0.33,0.989,0.32,0.337,0.9922,0.3235,0.3398,1,0.3249,0.337,1.0078,0.3235,0.33,1.011,0.32,0.323,1.0078,0.3165,0.3518,1,-0.3025,0.3469,0.988,-0.3018,0.335,0.983,-0.3,0.3231,0.988,-0.2982,0.3182,1,-0.2975,0.3231,1.012,-0.2982,0.335,1.017,-0.3,0.3469,1.012,-0.3018,0.3468,1,-0.3359,0.3419,0.988,-0.3351,0.33,0.983,-0.3333,0.3181,0.988,-0.3316,0.3132,1,-0.3308,0.3181,1.012,-0.3316,0.33,1.017,-0.3333,0.3419,1.012,-0.3351,0.3418,1,-0.3692,0.3369,0.988,-0.3684,0.325,0.983,-0.3667,0.3131,0.988,-0.3649,0.3082,1,-0.3641,0.3131,1.012,-0.3649,0.325,1.017,-0.3667,0.3369,1.012,-0.3684,0.3368,1,-0.4025,0.3319,0.988,-0.4018,0.32,0.983,-0.4,0.3081,0.988,-0.3982,0.3032,1,-0.3975,0.3081,1.012,-0.3982,0.32,1.017,-0.4,0.3319,1.012,-0.4018,0.3182,1,0.2975,0.3231,0.988,0.2982,0.335,0.983,0.3,0.3469,0.988,0.3018,0.3518,1,0.3025,0.3469,1.012,0.3018,0.335,1.017,0.3,0.3231,1.012,0.2982,0.3132,1,0.3308,0.3181,0.988,0.3316,0.33,0.983,0.3333,0.3419,0.988,0.3351,0.3468,1,0.3359,0.3419,1.012,0.3351,0.33,1.017,0.3333,0.3181,1.012,0.3316,0.3082,1,0.3641,0.3131,0.988,0.3649,0.325,0.983,0.3667,0.3369,0.988,0.3684,0.3418,1,0.3692,0.3369,1.012,0.3684,0.325,1.017,0.3667,0.3131,1.012,0.3649,0.3032,1,0.3975,0.3081,0.988,0.3982,0.32,0.983,0.4,0.3319,0.988,0.4018,0.3368,1,0.4025,0.3319,1.012,0.4018,0.32,1.017,0.4,0.3081,1.012,0.3982,-0.24,0.84,-0.014,-0.2496,0.8374,-0.0099,-0.2535,0.8363,0,-0.2496,0.8374,0.0099,-0.24,0.84,0.014,-0.2304,0.8426,0.0099,-0.2265,0.8437,0,-0.2304,0.8426,-0.0099,-0.25,0.8767,-0.014,-0.2596,0.8741,-0.0099,-0.2635,0.873,0,-0.2596,0.8741,0.0099,-0.25,0.8767,0.014,-0.2404,0.8793,0.0099,-0.2365,0.8804,0,-0.2404,0.8793,-0.0099,-0.26,0.9133,-0.014,-0.2696,0.9107,-0.0099,-0.2735,0.9096,0,-0.2696,0.9107,0.0099,-0.26,0.9133,0.014,-0.2504,0.9159,0.0099,-0.2465,0.917,0,-0.2504,0.9159,-0.0099,-0.27,0.95,-0.014,-0.2796,0.9474,-0.0099,-0.2835,0.9463,0,-0.2796,0.9474,0.0099,-0.27,0.95,0.014,-0.2604,0.9526,0.0099,-0.2565,0.9537,0,-0.2604,0.9526,-0.0099,-0.42,0.9804,0.075,-0.42,0.9894,0.065,-0.42,0.996,0.0375,-0.42,0.9984,0,-0.42,0.996,-0.0375,-0.42,0.9894,-0.065,-0.42,0.9804,-0.075,-0.42,0.9714,-0.065,-0.42,0.9648,-0.0375,-0.42,0.9624,0,-0.42,0.9648,0.0375,-0.42,0.9714,0.065,-0.37,0.9822,0.08,-0.37,0.9942,0.0693,-0.37,1.003,0.04,-0.37,1.0062,0,-0.37,1.003,-0.04,-0.37,0.9942,-0.0693,-0.37,0.9822,-0.08,-0.37,0.9702,-0.0693,-0.37,0.9614,-0.04,-0.37,0.9582,0,-0.37,0.9614,0.04,-0.37,0.9702,0.0693,-0.3,0.9816,0.06,-0.3,0.9926,0.052,-0.3,1.0007,0.03,-0.3,1.0036,0,-0.3,1.0007,-0.03,-0.3,0.9926,-0.052,-0.3,0.9816,-0.06,-0.3,0.9706,-0.052,-0.3,0.9625,-0.03,-0.3,0.9596,0,-0.3,0.9625,0.03,-0.3,0.9706,0.052,-0.23,0.9798,0.028,-0.23,0.9878,0.0242,-0.23,0.9937,0.014,-0.23,0.9958,0,-0.23,0.9937,-0.014,-0.23,0.9878,-0.0242,-0.23,0.9798,-0.028,-0.23,0.9718,-0.0242,-0.23,0.9659,-0.014,-0.23,0.9638,0,-0.23,0.9659,0.014,-0.23,0.9718,0.0242,-0.17,0.9786,0.018,-0.17,0.9846,0.0156,-0.17,0.989,0.009,-0.17,0.9906,0,-0.17,0.989,-0.009,-0.17,0.9846,-0.0156,-0.17,0.9786,-0.018,-0.17,0.9726,-0.0156,-0.17,0.9682,-0.009,-0.17,0.9666,0,-0.17,0.9682,0.009,-0.17,0.9726,0.0156,-0.295,0.943,-0.02,-0.245,0.943,-0.02,-0.295,0.967,-0.02,-0.245,0.967,-0.02,-0.295,0.943,0.02,-0.245,0.943,0.02,-0.295,0.967,0.02,-0.245,0.967,0.02,-0.36,0.966,-0.016,-0.36,0.9625,-0.018,-0.36,0.9625,-0.022,-0.36,0.966,-0.024,-0.36,0.9695,-0.022,-0.36,0.9695,-0.018,-0.19,0.966,-0.016,-0.19,0.9625,-0.018,-0.19,0.9625,-0.022,-0.19,0.966,-0.024,-0.19,0.9695,-0.022,-0.19,0.9695,-0.018,-0.36,0.966,0.024,-0.36,0.9625,0.022,-0.36,0.9625,0.018,-0.36,0.966,0.016,-0.36,0.9695,0.018,-0.36,0.9695,0.022,-0.19,0.966,0.024,-0.19,0.9625,0.022,-0.19,0.9625,0.018,-0.19,0.966,0.016,-0.19,0.9695,0.018,-0.19,0.9695,0.022,-0.6286,0.7288,-0.025,-0.6286,0.7288,0.025,-0.6308,0.7406,0,-0.6487,0.7246,-0.025,-0.6487,0.7246,0.025,-0.6515,0.7363,0,-0.6686,0.7194,-0.025,-0.6686,0.7194,0.025,-0.672,0.7309,0,-0.6881,0.7131,-0.025,-0.6881,0.7131,0.025,-0.6921,0.7244,0,-0.7073,0.7057,-0.025,-0.7073,0.7057,0.025,-0.7119,0.7168,0,-0.726,0.6974,-0.025,-0.726,0.6974,0.025,-0.7312,0.7082,0,-0.7443,0.688,-0.025,-0.7443,0.688,0.025,-0.7501,0.6986,0,-0.7621,0.6777,-0.025,-0.7621,0.6777,0.025,-0.7684,0.6879,0,-0.7792,0.6665,-0.025,-0.7792,0.6665,0.025,-0.7861,0.6763,0,-0.7958,0.6543,-0.025,-0.7958,0.6543,0.025,-0.8032,0.6638,0,-0.8117,0.6413,-0.025,-0.8117,0.6413,0.025,-0.8195,0.6504,0,-0.8269,0.6275,-0.025,-0.8269,0.6275,0.025,-0.8352,0.6361,0,-0.8413,0.6129,-0.025,-0.8413,0.6129,0.025,-0.85,0.6211,0,-0.8549,0.5975,-0.025,-0.8549,0.5975,0.025,-0.8641,0.6052,0,-0.8677,0.5814,-0.025,-0.8677,0.5814,0.025,-0.8773,0.5887,0,-0.8796,0.5647,-0.025,-0.8796,0.5647,0.025,-0.8895,0.5714,0,-0.8906,0.5474,-0.025,-0.8906,0.5474,0.025,-0.9009,0.5535,0,-0.9006,0.5295,-0.025,-0.9006,0.5295,0.025,-0.9112,0.5351,0,-0.9097,0.5111,-0.025,-0.9097,0.5111,0.025,-0.9206,0.5161,0,-0.9178,0.4922,-0.025,-0.9178,0.4922,0.025,-0.9289,0.4966,0,-0.9249,0.4729,-0.025,-0.9249,0.4729,0.025,-0.9362,0.4767,0,-0.9309,0.4533,-0.025,-0.9309,0.4533,0.025,-0.9424,0.4565,0,-0.9359,0.4334,-0.025,-0.9359,0.4334,0.025,-0.9476,0.436,0,-0.9398,0.4132,-0.025,-0.9398,0.4132,0.025,-0.9516,0.4152,0,-0.9426,0.3929,-0.025,-0.9426,0.3929,0.025,-0.9545,0.3942,0,-0.9443,0.3724,-0.025,-0.9443,0.3724,0.025,-0.9563,0.3731,0,-0.945,0.3519,-0.025,-0.945,0.3519,0.025,-0.957,0.352,0,-0.9445,0.3314,-0.025,-0.9445,0.3314,0.025,-0.9565,0.3308,0,-0.943,0.3109,-0.025,-0.943,0.3109,0.025,-0.9549,0.3097,0,-0.9404,0.2905,-0.025,-0.9404,0.2905,0.025,-0.9522,0.2887,0,-0.9367,0.2703,-0.025,-0.9367,0.2703,0.025,-0.9484,0.2679,0,0.9431,0.3884,-0.025,0.9431,0.3884,0.025,0.955,0.3896,0,0.9406,0.4082,-0.025,0.9406,0.4082,0.025,0.9524,0.41,0,0.9371,0.4277,-0.025,0.9371,0.4277,0.025,0.9488,0.4302,0,0.9326,0.4471,-0.025,0.9326,0.4471,0.025,0.9442,0.4501,0,0.927,0.4662,-0.025,0.927,0.4662,0.025,0.9385,0.4698,0,0.9205,0.485,-0.025,0.9205,0.485,0.025,0.9318,0.4892,0,0.9131,0.5035,-0.025,0.9131,0.5035,0.025,0.9241,0.5082,0,0.9047,0.5215,-0.025,0.9047,0.5215,0.025,0.9154,0.5268,0,0.8954,0.5391,-0.025,0.8954,0.5391,0.025,0.9058,0.545,0,0.8852,0.5561,-0.025,0.8852,0.5561,0.025,0.8953,0.5626,0,0.8741,0.5727,-0.025,0.8741,0.5727,0.025,0.8839,0.5796,0,0.8622,0.5886,-0.025,0.8622,0.5886,0.025,0.8716,0.596,0,0.8494,0.6039,-0.025,0.8494,0.6039,0.025,0.8585,0.6118,0,0.8359,0.6185,-0.025,0.8359,0.6185,0.025,0.8445,0.6268,0,0.8217,0.6324,-0.025,0.8217,0.6324,0.025,0.8299,0.6412,0,0.8068,0.6455,-0.025,0.8068,0.6455,0.025,0.8145,0.6547,0,0.7912,0.6579,-0.025,0.7912,0.6579,0.025,0.7984,0.6675,0,0.775,0.6694,-0.025,0.775,0.6694,0.025,0.7817,0.6793,0,0.7582,0.6801,-0.025,0.7582,0.6801,0.025,0.7644,0.6903,0,0.7409,0.6899,-0.025,0.7409,0.6899,0.025,0.7465,0.7004,0,0.7231,0.6987,-0.025,0.7231,0.6987,0.025,0.7282,0.7096,0,0.7049,0.7067,-0.025,0.7049,0.7067,0.025,0.7094,0.7178,0,0.6863,0.7137,-0.025,0.6863,0.7137,0.025,0.6902,0.725,0,0.6673,0.7197,-0.025,0.6673,0.7197,0.025,0.6707,0.7313,0,0.6481,0.7248,-0.025,0.6481,0.7248,0.025,0.6508,0.7365,0,0.6286,0.7288,-0.025,0.6286,0.7288,0.025,0.6307,0.7406,0,0.6089,0.7319,-0.025,0.6089,0.7319,0.025,0.6105,0.7438,0,0.5892,0.7339,-0.025,0.5892,0.7339,0.025,0.5901,0.7459,0,0.5693,0.7349,-0.025,0.5693,0.7349,0.025,0.5696,0.7469,0,0.5494,0.7349,-0.025,0.5494,0.7349,0.025,0.5491,0.7468,0,0.5295,0.7338,-0.025,0.5295,0.7338,0.025,0.5286,0.7458,0,-0.5601,0.35,-0.034,-0.5618,0.347,-0.032,-0.5617,0.347,-0.028,-0.5599,0.35,-0.026,-0.5582,0.353,-0.028,-0.5583,0.353,-0.032,-0.89,0.5485,-0.028,-0.8917,0.5455,-0.026,-0.8917,0.5455,-0.022,-0.8898,0.5485,-0.02,-0.8881,0.5514,-0.022,-0.8882,0.5514,-0.026,0.5597,0.35,-0.046,0.561,0.3467,-0.0479,0.5613,0.3467,-0.0519,0.5603,0.35,-0.054,0.559,0.3533,-0.0521,0.5587,0.3533,-0.0481,0.9214,0.482,-0.02,0.9227,0.4788,-0.0219,0.923,0.4788,-0.0259,0.9219,0.482,-0.028,0.9206,0.4853,-0.0261,0.9203,0.4853,-0.0221,-0.5599,0.35,0.026,-0.5617,0.347,0.028,-0.5618,0.347,0.032,-0.5601,0.35,0.034,-0.5583,0.353,0.032,-0.5582,0.353,0.028,-0.8898,0.5485,0.02,-0.8917,0.5455,0.022,-0.8917,0.5455,0.026,-0.89,0.5485,0.028,-0.8882,0.5514,0.026,-0.8881,0.5514,0.022,0.5603,0.35,0.054,0.5613,0.3467,0.0519,0.561,0.3467,0.0479,0.5597,0.35,0.046,0.5587,0.3533,0.0481,0.559,0.3533,0.0521,0.9219,0.482,0.028,0.923,0.4788,0.0259,0.9227,0.4788,0.0219,0.9214,0.482,0.02,0.9203,0.4853,0.0221,0.9206,0.4853,0.0261,0.4,0.64,-0.006,0.3951,0.6418,-0.003,0.3951,0.6418,0.003,0.4,0.64,0.006,0.4049,0.6382,0.003,0.4049,0.6382,-0.003,0.43,0.72,-0.006,0.4251,0.7218,-0.003,0.4251,0.7218,0.003,0.43,0.72,0.006,0.4349,0.7182,0.003,0.4349,0.7182,-0.003,-0.21,0.76,-0.006,-0.2089,0.7549,-0.003,-0.2089,0.7549,0.003,-0.21,0.76,0.006,-0.2111,0.7651,0.003,-0.2111,0.7651,-0.003,-0.3,0.74,-0.006,-0.2989,0.7349,-0.003,-0.2989,0.7349,0.003,-0.3,0.74,0.006,-0.3011,0.7451,0.003,-0.3011,0.7451,-0.003,0.355,0.87,0.007,0.3557,0.864,0.0035,0.3557,0.864,-0.0035,0.355,0.87,-0.007,0.3543,0.876,-0.0035,0.3543,0.876,0.0035,0.3975,0.875,0.007,0.3982,0.869,0.0035,0.3982,0.869,-0.0035,0.3975,0.875,-0.007,0.3968,0.881,-0.0035,0.3968,0.881,0.0035,0.44,0.88,0.007,0.4407,0.874,0.0035,0.4407,0.874,-0.0035,0.44,0.88,-0.007,0.4393,0.886,-0.0035,0.4393,0.886,0.0035,0.44,0.88,0.028,0.44,0.866,0.0242,0.44,0.8558,0.014,0.44,0.852,0,0.44,0.8558,-0.014,0.44,0.866,-0.0242,0.44,0.88,-0.028,0.44,0.894,-0.0242,0.44,0.9042,-0.014,0.44,0.908,0,0.44,0.9042,0.014,0.44,0.894,0.0242,0.465,0.88,0.028,0.465,0.866,0.0242,0.465,0.8558,0.014,0.465,0.852,0,0.465,0.8558,-0.014,0.465,0.866,-0.0242,0.465,0.88,-0.028,0.465,0.894,-0.0242,0.465,0.9042,-0.014,0.465,0.908,0,0.465,0.9042,0.014,0.465,0.894,0.0242,0.49,0.88,0.028,0.49,0.866,0.0242,0.49,0.8558,0.014,0.49,0.852,0,0.49,0.8558,-0.014,0.49,0.866,-0.0242,0.49,0.88,-0.028,0.49,0.894,-0.0242,0.49,0.9042,-0.014,0.49,0.908,0,0.49,0.9042,0.014,0.49,0.894,0.0242,0.495,0.88,0.028,0.495,0.8693,0.0259,0.495,0.8602,0.0198,0.495,0.8541,0.0107,0.495,0.852,0,0.495,0.8541,-0.0107,0.495,0.8602,-0.0198,0.495,0.8693,-0.0259,0.495,0.88,-0.028,0.495,0.8907,-0.0259,0.495,0.8998,-0.0198,0.495,0.9059,-0.0107,0.495,0.908,0,0.495,0.9059,0.0107,0.495,0.8998,0.0198,0.495,0.8907,0.0259,0.495,0.88,0.018,0.495,0.8731,0.0166,0.495,0.8673,0.0127,0.495,0.8634,0.0069,0.495,0.862,0,0.495,0.8634,-0.0069,0.495,0.8673,-0.0127,0.495,0.8731,-0.0166,0.495,0.88,-0.018,0.495,0.8869,-0.0166,0.495,0.8927,-0.0127,0.495,0.8966,-0.0069,0.495,0.898,0,0.495,0.8966,0.0069,0.495,0.8927,0.0127,0.495,0.8869,0.0166,0.495,0.88,0.008,0.495,0.8769,0.0074,0.495,0.8743,0.0057,0.495,0.8726,0.0031,0.495,0.872,0,0.495,0.8726,-0.0031,0.495,0.8743,-0.0057,0.495,0.8769,-0.0074,0.495,0.88,-0.008,0.495,0.8831,-0.0074,0.495,0.8857,-0.0057,0.495,0.8874,-0.0031,0.495,0.888,0,0.495,0.8874,0.0031,0.495,0.8857,0.0057,0.495,0.8831,0.0074],"e":[0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,0,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,10,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,20,30,31,31,32,32,33,33,34,34,35,35,36,36,37,37,38,38,39,39,30,40,41,41,42,42,43,43,44,44,45,45,46,46,47,47,48,48,49,49,40,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57,58,58,59,59,50,60,61,61,62,62,63,63,64,64,65,65,66,66,67,67,68,68,69,69,60,70,71,71,72,72,73,73,74,74,75,75,76,76,77,77,78,78,79,79,70,80,81,81,82,82,83,83,84,84,85,85,86,86,87,87,88,88,89,89,80,0,10,10,20,20,30,30,40,40,50,50,60,60,70,70,80,2,12,12,22,22,32,32,42,42,52,52,62,62,72,72,82,4,14,14,24,24,34,34,44,44,54,54,64,64,74,74,84,6,16,16,26,26,36,36,46,46,56,56,66,66,76,76,86,8,18,18,28,28,38,38,48,48,58,58,68,68,78,78,88,90,91,91,92,92,93,93,94,94,95,95,96,96,97,97,98,98,99,99,90,100,101,101,102,102,103,103,104,104,105,105,106,106,107,107,108,108,109,109,100,110,111,111,112,112,113,113,114,114,115,115,116,116,117,117,118,118,119,119,110,120,121,121,122,122,123,123,124,124,125,125,126,126,127,127,128,128,129,129,120,130,131,131,132,132,133,133,134,134,135,135,136,136,137,137,138,138,139,139,130,140,141,141,142,142,143,143,144,144,145,145,146,146,147,147,148,148,149,149,140,150,151,151,152,152,153,153,154,154,155,155,156,156,157,157,158,158,159,159,150,160,161,161,162,162,163,163,164,164,165,165,166,166,167,167,168,168,169,169,160,170,171,171,172,172,173,173,174,174,175,175,176,176,177,177,178,178,179,179,170,180,181,181,182,182,183,183,184,184,185,185,186,186,187,187,188,188,189,189,180,90,100,100,110,110,120,120,130,130,140,140,150,150,160,160,170,170,180,92,102,102,112,112,122,122,132,132,142,142,152,152,162,162,172,172,182,94,104,104,114,114,124,124,134,134,144,144,154,154,164,164,174,174,184,96,106,106,116,116,126,126,136,136,146,146,156,156,166,166,176,176,186,98,108,108,118,118,128,128,138,138,148,148,158,158,168,168,178,178,188,190,191,191,192,192,193,193,194,194,195,195,196,196,197,197,198,198,199,199,200,200,201,201,190,202,203,203,204,204,205,205,206,206,207,207,208,208,209,209,210,210,211,211,212,212,213,213,202,214,215,215,216,216,217,217,218,218,219,219,220,220,221,221,222,222,223,223,224,224,225,225,214,226,227,227,228,228,229,229,230,230,231,231,232,232,233,233,234,234,235,235,236,236,237,237,226,190,202,202,214,214,226,192,204,204,216,216,228,194,206,206,218,218,230,196,208,208,220,220,232,198,210,210,222,222,234,200,212,212,224,224,236,238,239,239,240,240,241,241,242,242,243,243,244,244,245,245,238,246,247,247,248,248,249,249,250,250,251,251,252,252,253,253,246,254,255,255,256,256,257,257,258,258,259,259,260,260,261,261,254,262,263,263,264,264,265,265,266,266,267,267,268,268,269,269,262,270,271,271,272,272,273,273,274,274,275,275,276,276,277,277,270,278,279,279,280,280,281,281,282,282,283,283,284,284,285,285,278,286,287,287,288,288,289,289,290,290,291,291,292,292,293,293,286,294,295,295,296,296,297,297,298,298,299,299,300,300,301,301,294,238,246,246,254,254,262,262,270,270,278,278,286,286,294,240,248,248,256,256,264,264,272,272,280,280,288,288,296,242,250,250,258,258,266,266,274,274,282,282,290,290,298,244,252,252,260,260,268,268,276,276,284,284,292,292,300,302,303,303,304,304,305,305,306,306,307,307,308,308,309,309,302,310,311,311,312,312,313,313,314,314,315,315,316,316,317,317,310,318,319,319,320,320,321,321,322,322,323,323,324,324,325,325,318,326,327,327,328,328,329,329,330,330,331,331,332,332,333,333,326,334,335,335,336,336,337,337,338,338,339,339,340,340,341,341,334,342,343,343,344,344,345,345,346,346,347,347,348,348,349,349,342,350,351,351,352,352,353,353,354,354,355,355,356,356,357,357,350,358,359,359,360,360,361,361,362,362,363,363,364,364,365,365,358,302,310,310,318,318,326,326,334,334,342,342,350,350,358,304,312,312,320,320,328,328,336,336,344,344,352,352,360,306,314,314,322,322,330,330,338,338,346,346,354,354,362,308,316,316,324,324,332,332,340,340,348,348,356,356,364,366,367,367,368,368,369,369,370,370,371,371,372,372,373,373,366,374,375,375,376,376,377,377,378,378,379,379,380,380,381,381,374,382,383,383,384,384,385,385,386,386,387,387,388,388,389,389,382,390,391,391,392,392,393,393,394,394,395,395,396,396,397,397,390,398,399,399,400,400,401,401,402,402,403,403,404,404,405,405,398,406,407,407,408,408,409,409,410,410,411,411,412,412,413,413,406,414,415,415,416,416,417,417,418,418,419,419,420,420,421,421,414,422,423,423,424,424,425,425,426,426,427,427,428,428,429,429,422,366,374,374,382,382,390,390,398,398,406,406,414,414,422,368,376,376,384,384,392,392,400,400,408,408,416,416,424,370,378,378,386,386,394,394,402,402,410,410,418,418,426,372,380,380,388,388,396,396,404,404,412,412,420,420,428,430,431,431,432,432,433,433,434,434,435,435,436,436,437,437,430,438,439,439,440,440,441,441,442,442,443,443,444,444,445,445,438,446,447,447,448,448,449,449,450,450,451,451,452,452,453,453,446,454,455,455,456,456,457,457,458,458,459,459,460,460,461,461,454,462,463,463,464,464,465,465,466,466,467,467,468,468,469,469,462,470,471,471,472,472,473,473,474,474,475,475,476,476,477,477,470,478,479,479,480,480,481,481,482,482,483,483,484,484,485,485,478,486,487,487,488,488,489,489,490,490,491,491,492,492,493,493,486,430,438,438,446,446,454,454,462,462,470,470,478,478,486,432,440,440,448,448,456,456,464,464,472,472,480,480,488,434,442,442,450,450,458,458,466,466,474,474,482,482,490,436,444,444,452,452,460,460,468,468,476,476,484,484,492,494,495,495,496,496,497,497,498,498,499,499,500,500,501,501,494,502,503,503,504,504,505,505,506,506,507,507,508,508,509,509,502,510,511,511,512,512,513,513,514,514,515,515,516,516,517,517,510,518,519,519,520,520,521,521,522,522,523,523,524,524,525,525,518,526,527,527,528,528,529,529,530,530,531,531,532,532,533,533,526,534,535,535,536,536,537,537,538,538,539,539,540,540,541,541,534,542,543,543,544,544,545,545,546,546,547,547,548,548,549,549,542,494,502,502,510,510,518,518,526,526,534,534,542,496,504,504,512,512,520,520,528,528,536,536,544,498,506,506,514,514,522,522,530,530,538,538,546,500,508,508,516,516,524,524,532,532,540,540,548,550,551,551,552,552,553,553,554,554,555,555,556,556,557,557,550,558,559,559,560,560,561,561,562,562,563,563,564,564,565,565,558,566,567,567,568,568,569,569,570,570,571,571,572,572,573,573,566,574,575,575,576,576,577,577,578,578,579,579,580,580,581,581,574,582,583,583,584,584,585,585,586,586,587,587,588,588,589,589,582,590,591,591,592,592,593,593,594,594,595,595,596,596,597,597,590,598,599,599,600,600,601,601,602,602,603,603,604,604,605,605,598,550,558,558,566,566,574,574,582,582,590,590,598,552,560,560,568,568,576,576,584,584,592,592,600,554,562,562,570,570,578,578,586,586,594,594,602,556,564,564,572,572,580,580,588,588,596,596,604,606,607,607,608,608,609,609,610,610,611,611,612,612,613,613,606,614,615,615,616,616,617,617,618,618,619,619,620,620,621,621,614,622,623,623,624,624,625,625,626,626,627,627,628,628,629,629,622,606,614,614,622,608,616,616,624,610,618,618,626,612,620,620,628,630,631,631,632,632,633,633,634,634,635,635,636,636,637,637,630,638,639,639,640,640,641,641,642,642,643,643,644,644,645,645,638,646,647,647,648,648,649,649,650,650,651,651,652,652,653,653,646,654,655,655,656,656,657,657,658,658,659,659,660,660,661,661,654,630,638,638,646,646,654,632,640,640,648,648,656,634,642,642,650,650,658,636,644,644,652,652,660,662,663,663,664,664,665,665,666,666,667,667,668,668,669,669,662,670,671,671,672,672,673,673,674,674,675,675,676,676,677,677,670,678,679,679,680,680,681,681,682,682,683,683,684,684,685,685,678,662,670,670,678,664,672,672,680,666,674,674,682,668,676,676,684,686,687,688,689,690,691,692,693,686,688,687,689,690,692,691,693,686,690,687,691,688,692,689,693,694,695,695,696,696,697,697,698,698,699,699,700,700,701,701,694,702,703,703,704,704,705,705,706,706,707,707,708,708,709,709,702,710,711,711,712,712,713,713,714,714,715,715,716,716,717,717,710,694,702,702,710,696,704,704,712,698,706,706,714,700,708,708,716,718,719,719,720,720,721,721,722,722,723,723,724,724,725,725,718,726,727,727,728,728,729,729,730,730,731,731,732,732,733,733,726,734,735,735,736,736,737,737,738,738,739,739,740,740,741,741,734,718,726,726,734,720,728,728,736,722,730,730,738,724,732,732,740,742,743,743,744,744,745,745,746,746,747,747,748,748,749,749,742,750,751,751,752,752,753,753,754,754,755,755,756,756,757,757,750,758,759,759,760,760,761,761,762,762,763,763,764,764,765,765,758,742,750,750,758,744,752,752,760,746,754,754,762,748,756,756,764,766,767,767,768,768,769,769,770,770,771,771,772,772,773,773,766,774,775,775,776,776,777,777,778,778,779,779,780,780,781,781,774,782,783,783,784,784,785,785,786,786,787,787,788,788,789,789,782,766,774,774,782,768,776,776,784,770,778,778,786,772,780,780,788,790,791,791,792,792,793,793,794,794,795,795,796,796,797,797,790,798,799,799,800,800,801,801,802,802,803,803,804,804,805,805,798,806,807,807,808,808,809,809,810,810,811,811,812,812,813,813,806,814,815,815,816,816,817,817,818,818,819,819,820,820,821,821,814,790,798,798,806,806,814,792,800,800,808,808,816,794,802,802,810,810,818,796,804,804,812,812,820,822,823,823,824,824,825,825,826,826,827,827,828,828,829,829,822,830,831,831,832,832,833,833,834,834,835,835,836,836,837,837,830,838,839,839,840,840,841,841,842,842,843,843,844,844,845,845,838,846,847,847,848,848,849,849,850,850,851,851,852,852,853,853,846,822,830,830,838,838,846,824,832,832,840,840,848,826,834,834,842,842,850,828,836,836,844,844,852,854,855,855,856,856,857,857,858,858,859,859,860,860,861,861,854,862,863,863,864,864,865,865,866,866,867,867,868,868,869,869,862,870,871,871,872,872,873,873,874,874,875,875,876,876,877,877,870,878,879,879,880,880,881,881,882,882,883,883,884,884,885,885,878,854,862,862,870,870,878,856,864,864,872,872,880,858,866,866,874,874,882,860,868,868,876,876,884,886,887,887,888,888,889,889,890,890,891,891,892,892,893,893,894,894,895,895,896,896,897,897,886,898,899,899,900,900,901,901,902,902,903,903,904,904,905,905,906,906,907,907,908,908,909,909,898,910,911,911,912,912,913,913,914,914,915,915,916,916,917,917,918,918,919,919,920,920,921,921,910,922,923,923,924,924,925,925,926,926,927,927,928,928,929,929,930,930,931,931,932,932,933,933,922,934,935,935,936,936,937,937,938,938,939,939,940,940,941,941,942,942,943,943,944,944,945,945,934,886,898,889,901,892,904,895,907,898,910,901,913,904,916,907,919,910,922,913,925,916,928,919,931,922,934,925,937,928,940,931,943,946,947,948,949,950,951,952,953,946,948,947,949,950,952,951,953,946,950,947,951,948,952,949,953,954,955,955,956,956,957,957,958,958,959,959,954,960,961,961,962,962,963,963,964,964,965,965,960,954,960,957,963,966,967,967,968,968,969,969,970,970,971,971,966,972,973,973,974,974,975,975,976,976,977,977,972,966,972,969,975,978,981,979,982,980,983,978,980,980,979,981,984,982,985,983,986,984,987,985,988,986,989,987,990,988,991,989,992,990,993,991,994,992,995,993,996,994,997,995,998,993,995,995,994,996,999,997,1000,998,1001,999,1002,1000,1003,1001,1004,1002,1005,1003,1006,1004,1007,1005,1008,1006,1009,1007,1010,1008,1011,1009,1012,1010,1013,1008,1010,1010,1009,1011,1014,1012,1015,1013,1016,1014,1017,1015,1018,1016,1019,1017,1020,1018,1021,1019,1022,1020,1023,1021,1024,1022,1025,1023,1026,1024,1027,1025,1028,1023,1025,1025,1024,1026,1029,1027,1030,1028,1031,1029,1032,1030,1033,1031,1034,1032,1035,1033,1036,1034,1037,1035,1038,1036,1039,1037,1040,1038,1041,1039,1042,1040,1043,1038,1040,1040,1039,1041,1044,1042,1045,1043,1046,1044,1047,1045,1048,1046,1049,1047,1050,1048,1051,1049,1052,1050,1053,1051,1054,1052,1055,1053,1056,1054,1057,1055,1058,1053,1055,1055,1054,1056,1059,1057,1060,1058,1061,1059,1062,1060,1063,1061,1064,1062,1065,1063,1066,1064,1067,1065,1068,1066,1069,1067,1070,978,980,980,979,1068,1070,1070,1069,1071,1074,1072,1075,1073,1076,1071,1073,1073,1072,1074,1077,1075,1078,1076,1079,1077,1080,1078,1081,1079,1082,1080,1083,1081,1084,1082,1085,1083,1086,1084,1087,1085,1088,1086,1089,1087,1090,1088,1091,1086,1088,1088,1087,1089,1092,1090,1093,1091,1094,1092,1095,1093,1096,1094,1097,1095,1098,1096,1099,1097,1100,1098,1101,1099,1102,1100,1103,1101,1104,1102,1105,1103,1106,1101,1103,1103,1102,1104,1107,1105,1108,1106,1109,1107,1110,1108,1111,1109,1112,1110,1113,1111,1114,1112,1115,1113,1116,1114,1117,1115,1118,1116,1119,1117,1120,1118,1121,1116,1118,1118,1117,1119,1122,1120,1123,1121,1124,1122,1125,1123,1126,1124,1127,1125,1128,1126,1129,1127,1130,1128,1131,1129,1132,1130,1133,1131,1134,1132,1135,1133,1136,1131,1133,1133,1132,1134,1137,1135,1138,1136,1139,1137,1140,1138,1141,1139,1142,1140,1143,1141,1144,1142,1145,1143,1146,1144,1147,1145,1148,1146,1149,1147,1150,1148,1151,1146,1148,1148,1147,1149,1152,1150,1153,1151,1154,1152,1155,1153,1156,1154,1157,1155,1158,1156,1159,1157,1160,1158,1161,1159,1162,1160,1163,1071,1073,1073,1072,1161,1163,1163,1162,1164,1165,1165,1166,1166,1167,1167,1168,1168,1169,1169,1164,1170,1171,1171,1172,1172,1173,1173,1174,1174,1175,1175,1170,1164,1170,1167,1173,1176,1177,1177,1178,1178,1179,1179,1180,1180,1181,1181,1176,1182,1183,1183,1184,1184,1185,1185,1186,1186,1187,1187,1182,1176,1182,1179,1185,1188,1189,1189,1190,1190,1191,1191,1192,1192,1193,1193,1188,1194,1195,1195,1196,1196,1197,1197,1198,1198,1199,1199,1194,1188,1194,1191,1197,1200,1201,1201,1202,1202,1203,1203,1204,1204,1205,1205,1200,1206,1207,1207,1208,1208,1209,1209,1210,1210,1211,1211,1206,1200,1206,1203,1209,1212,1213,1213,1214,1214,1215,1215,1216,1216,1217,1217,1212,1218,1219,1219,1220,1220,1221,1221,1222,1222,1223,1223,1218,1212,1218,1215,1221,1224,1225,1225,1226,1226,1227,1227,1228,1228,1229,1229,1224,1230,1231,1231,1232,1232,1233,1233,1234,1234,1235,1235,1230,1224,1230,1227,1233,1236,1237,1237,1238,1238,1239,1239,1240,1240,1241,1241,1236,1242,1243,1243,1244,1244,1245,1245,1246,1246,1247,1247,1242,1248,1249,1249,1250,1250,1251,1251,1252,1252,1253,1253,1248,1236,1242,1242,1248,1238,1244,1244,1250,1240,1246,1246,1252,1254,1255,1255,1256,1256,1257,1257,1258,1258,1259,1259,1260,1260,1261,1261,1262,1262,1263,1263,1264,1264,1265,1265,1254,1266,1267,1267,1268,1268,1269,1269,1270,1270,1271,1271,1272,1272,1273,1273,1274,1274,1275,1275,1276,1276,1277,1277,1266,1278,1279,1279,1280,1280,1281,1281,1282,1282,1283,1283,1284,1284,1285,1285,1286,1286,1287,1287,1288,1288,1289,1289,1278,1254,1266,1266,1278,1256,1268,1268,1280,1258,1270,1270,1282,1260,1272,1272,1284,1262,1274,1274,1286,1264,1276,1276,1288,1290,1291,1291,1292,1292,1293,1293,1294,1294,1295,1295,1296,1296,1297,1297,1298,1298,1299,1299,1300,1300,1301,1301,1302,1302,1303,1303,1304,1304,1305,1305,1290,1306,1307,1307,1308,1308,1309,1309,1310,1310,1311,1311,1312,1312,1313,1313,1314,1314,1315,1315,1316,1316,1317,1317,1318,1318,1319,1319,1320,1320,1321,1321,1306,1322,1323,1323,1324,1324,1325,1325,1326,1326,1327,1327,1328,1328,1329,1329,1330,1330,1331,1331,1332,1332,1333,1333,1334,1334,1335,1335,1336,1336,1337,1337,1322,1290,1306,1294,1310,1298,1314,1302,1318,1306,1322,1310,1326,1314,1330,1318,1334],"q":[0,1,11,10,1,2,12,11,2,3,13,12,3,4,14,13,4,5,15,14,5,6,16,15,6,7,17,16,7,8,18,17,8,9,19,18,9,0,10,19,10,11,21,20,11,12,22,21,12,13,23,22,13,14,24,23,14,15,25,24,15,16,26,25,16,17,27,26,17,18,28,27,18,19,29,28,19,10,20,29,20,21,31,30,21,22,32,31,22,23,33,32,23,24,34,33,24,25,35,34,25,26,36,35,26,27,37,36,27,28,38,37,28,29,39,38,29,20,30,39,30,31,41,40,31,32,42,41,32,33,43,42,33,34,44,43,34,35,45,44,35,36,46,45,36,37,47,46,37,38,48,47,38,39,49,48,39,30,40,49,40,41,51,50,41,42,52,51,42,43,53,52,43,44,54,53,44,45,55,54,45,46,56,55,46,47,57,56,47,48,58,57,48,49,59,58,49,40,50,59,50,51,61,60,51,52,62,61,52,53,63,62,53,54,64,63,54,55,65,64,55,56,66,65,56,57,67,66,57,58,68,67,58,59,69,68,59,50,60,69,60,61,71,70,61,62,72,71,62,63,73,72,63,64,74,73,64,65,75,74,65,66,76,75,66,67,77,76,67,68,78,77,68,69,79,78,69,60,70,79,70,71,81,80,71,72,82,81,72,73,83,82,73,74,84,83,74,75,85,84,75,76,86,85,76,77,87,86,77,78,88,87,78,79,89,88,79,70,80,89,90,91,101,100,91,92,102,101,92,93,103,102,93,94,104,103,94,95,105,104,95,96,106,105,96,97,107,106,97,98,108,107,98,99,109,108,99,90,100,109,100,101,111,110,101,102,112,111,102,103,113,112,103,104,114,113,104,105,115,114,105,106,116,115,106,107,117,116,107,108,118,117,108,109,119,118,109,100,110,119,110,111,121,120,111,112,122,121,112,113,123,122,113,114,124,123,114,115,125,124,115,116,126,125,116,117,127,126,117,118,128,127,118,119,129,128,119,110,120,129,120,121,131,130,121,122,132,131,122,123,133,132,123,124,134,133,124,125,135,134,125,126,136,135,126,127,137,136,127,128,138,137,128,129,139,138,129,120,130,139,130,131,141,140,131,132,142,141,132,133,143,142,133,134,144,143,134,135,145,144,135,136,146,145,136,137,147,146,137,138,148,147,138,139,149,148,139,130,140,149,140,141,151,150,141,142,152,151,142,143,153,152,143,144,154,153,144,145,155,154,145,146,156,155,146,147,157,156,147,148,158,157,148,149,159,158,149,140,150,159,150,151,161,160,151,152,162,161,152,153,163,162,153,154,164,163,154,155,165,164,155,156,166,165,156,157,167,166,157,158,168,167,158,159,169,168,159,150,160,169,160,161,171,170,161,162,172,171,162,163,173,172,163,164,174,173,164,165,175,174,165,166,176,175,166,167,177,176,167,168,178,177,168,169,179,178,169,160,170,179,170,171,181,180,171,172,182,181,172,173,183,182,173,174,184,183,174,175,185,184,175,176,186,185,176,177,187,186,177,178,188,187,178,179,189,188,179,170,180,189,190,191,203,202,191,192,204,203,192,193,205,204,193,194,206,205,194,195,207,206,195,196,208,207,196,197,209,208,197,198,210,209,198,199,211,210,199,200,212,211,200,201,213,212,201,190,202,213,202,203,215,214,203,204,216,215,204,205,217,216,205,206,218,217,206,207,219,218,207,208,220,219,208,209,221,220,209,210,222,221,210,211,223,222,211,212,224,223,212,213,225,224,213,202,214,225,214,215,227,226,215,216,228,227,216,217,229,228,217,218,230,229,218,219,231,230,219,220,232,231,220,221,233,232,221,222,234,233,222,223,235,234,223,224,236,235,224,225,237,236,225,214,226,237,238,239,247,246,239,240,248,247,240,241,249,248,241,242,250,249,242,243,251,250,243,244,252,251,244,245,253,252,245,238,246,253,246,247,255,254,247,248,256,255,248,249,257,256,249,250,258,257,250,251,259,258,251,252,260,259,252,253,261,260,253,246,254,261,254,255,263,262,255,256,264,263,256,257,265,264,257,258,266,265,258,259,267,266,259,260,268,267,260,261,269,268,261,254,262,269,262,263,271,270,263,264,272,271,264,265,273,272,265,266,274,273,266,267,275,274,267,268,276,275,268,269,277,276,269,262,270,277,270,271,279,278,271,272,280,279,272,273,281,280,273,274,282,281,274,275,283,282,275,276,284,283,276,277,285,284,277,270,278,285,278,279,287,286,279,280,288,287,280,281,289,288,281,282,290,289,282,283,291,290,283,284,292,291,284,285,293,292,285,278,286,293,286,287,295,294,287,288,296,295,288,289,297,296,289,290,298,297,290,291,299,298,291,292,300,299,292,293,301,300,293,286,294,301,302,303,311,310,303,304,312,311,304,305,313,312,305,306,314,313,306,307,315,314,307,308,316,315,308,309,317,316,309,302,310,317,310,311,319,318,311,312,320,319,312,313,321,320,313,314,322,321,314,315,323,322,315,316,324,323,316,317,325,324,317,310,318,325,318,319,327,326,319,320,328,327,320,321,329,328,321,322,330,329,322,323,331,330,323,324,332,331,324,325,333,332,325,318,326,333,326,327,335,334,327,328,336,335,328,329,337,336,329,330,338,337,330,331,339,338,331,332,340,339,332,333,341,340,333,326,334,341,334,335,343,342,335,336,344,343,336,337,345,344,337,338,346,345,338,339,347,346,339,340,348,347,340,341,349,348,341,334,342,349,342,343,351,350,343,344,352,351,344,345,353,352,345,346,354,353,346,347,355,354,347,348,356,355,348,349,357,356,349,342,350,357,350,351,359,358,351,352,360,359,352,353,361,360,353,354,362,361,354,355,363,362,355,356,364,363,356,357,365,364,357,350,358,365,366,367,375,374,367,368,376,375,368,369,377,376,369,370,378,377,370,371,379,378,371,372,380,379,372,373,381,380,373,366,374,381,374,375,383,382,375,376,384,383,376,377,385,384,377,378,386,385,378,379,387,386,379,380,388,387,380,381,389,388,381,374,382,389,382,383,391,390,383,384,392,391,384,385,393,392,385,386,394,393,386,387,395,394,387,388,396,395,388,389,397,396,389,382,390,397,390,391,399,398,391,392,400,399,392,393,401,400,393,394,402,401,394,395,403,402,395,396,404,403,396,397,405,404,397,390,398,405,398,399,407,406,399,400,408,407,400,401,409,408,401,402,410,409,402,403,411,410,403,404,412,411,404,405,413,412,405,398,406,413,406,407,415,414,407,408,416,415,408,409,417,416,409,410,418,417,410,411,419,418,411,412,420,419,412,413,421,420,413,406,414,421,414,415,423,422,415,416,424,423,416,417,425,424,417,418,426,425,418,419,427,426,419,420,428,427,420,421,429,428,421,414,422,429,430,431,439,438,431,432,440,439,432,433,441,440,433,434,442,441,434,435,443,442,435,436,444,443,436,437,445,444,437,430,438,445,438,439,447,446,439,440,448,447,440,441,449,448,441,442,450,449,442,443,451,450,443,444,452,451,444,445,453,452,445,438,446,453,446,447,455,454,447,448,456,455,448,449,457,456,449,450,458,457,450,451,459,458,451,452,460,459,452,453,461,460,453,446,454,461,454,455,463,462,455,456,464,463,456,457,465,464,457,458,466,465,458,459,467,466,459,460,468,467,460,461,469,468,461,454,462,469,462,463,471,470,463,464,472,471,464,465,473,472,465,466,474,473,466,467,475,474,467,468,476,475,468,469,477,476,469,462,470,477,470,471,479,478,471,472,480,479,472,473,481,480,473,474,482,481,474,475,483,482,475,476,484,483,476,477,485,484,477,470,478,485,478,479,487,486,479,480,488,487,480,481,489,488,481,482,490,489,482,483,491,490,483,484,492,491,484,485,493,492,485,478,486,493,494,495,503,502,495,496,504,503,496,497,505,504,497,498,506,505,498,499,507,506,499,500,508,507,500,501,509,508,501,494,502,509,502,503,511,510,503,504,512,511,504,505,513,512,505,506,514,513,506,507,515,514,507,508,516,515,508,509,517,516,509,502,510,517,510,511,519,518,511,512,520,519,512,513,521,520,513,514,522,521,514,515,523,522,515,516,524,523,516,517,525,524,517,510,518,525,518,519,527,526,519,520,528,527,520,521,529,528,521,522,530,529,522,523,531,530,523,524,532,531,524,525,533,532,525,518,526,533,526,527,535,534,527,528,536,535,528,529,537,536,529,530,538,537,530,531,539,538,531,532,540,539,532,533,541,540,533,526,534,541,534,535,543,542,535,536,544,543,536,537,545,544,537,538,546,545,538,539,547,546,539,540,548,547,540,541,549,548,541,534,542,549,550,551,559,558,551,552,560,559,552,553,561,560,553,554,562,561,554,555,563,562,555,556,564,563,556,557,565,564,557,550,558,565,558,559,567,566,559,560,568,567,560,561,569,568,561,562,570,569,562,563,571,570,563,564,572,571,564,565,573,572,565,558,566,573,566,567,575,574,567,568,576,575,568,569,577,576,569,570,578,577,570,571,579,578,571,572,580,579,572,573,581,580,573,566,574,581,574,575,583,582,575,576,584,583,576,577,585,584,577,578,586,585,578,579,587,586,579,580,588,587,580,581,589,588,581,574,582,589,582,583,591,590,583,584,592,591,584,585,593,592,585,586,594,593,586,587,595,594,587,588,596,595,588,589,597,596,589,582,590,597,590,591,599,598,591,592,600,599,592,593,601,600,593,594,602,601,594,595,603,602,595,596,604,603,596,597,605,604,597,590,598,605,606,607,615,614,607,608,616,615,608,609,617,616,609,610,618,617,610,611,619,618,611,612,620,619,612,613,621,620,613,606,614,621,614,615,623,622,615,616,624,623,616,617,625,624,617,618,626,625,618,619,627,626,619,620,628,627,620,621,629,628,621,614,622,629,630,631,639,638,631,632,640,639,632,633,641,640,633,634,642,641,634,635,643,642,635,636,644,643,636,637,645,644,637,630,638,645,638,639,647,646,639,640,648,647,640,641,649,648,641,642,650,649,642,643,651,650,643,644,652,651,644,645,653,652,645,638,646,653,646,647,655,654,647,648,656,655,648,649,657,656,649,650,658,657,650,651,659,658,651,652,660,659,652,653,661,660,653,646,654,661,662,663,671,670,663,664,672,671,664,665,673,672,665,666,674,673,666,667,675,674,667,668,676,675,668,669,677,676,669,662,670,677,670,671,679,678,671,672,680,679,672,673,681,680,673,674,682,681,674,675,683,682,675,676,684,683,676,677,685,684,677,670,678,685,686,687,689,688,690,691,693,692,686,687,691,690,688,689,693,692,686,688,692,690,687,689,693,691,694,695,703,702,695,696,704,703,696,697,705,704,697,698,706,705,698,699,707,706,699,700,708,707,700,701,709,708,701,694,702,709,702,703,711,710,703,704,712,711,704,705,713,712,705,706,714,713,706,707,715,714,707,708,716,715,708,709,717,716,709,702,710,717,718,719,727,726,719,720,728,727,720,721,729,728,721,722,730,729,722,723,731,730,723,724,732,731,724,725,733,732,725,718,726,733,726,727,735,734,727,728,736,735,728,729,737,736,729,730,738,737,730,731,739,738,731,732,740,739,732,733,741,740,733,726,734,741,742,743,751,750,743,744,752,751,744,745,753,752,745,746,754,753,746,747,755,754,747,748,756,755,748,749,757,756,749,742,750,757,750,751,759,758,751,752,760,759,752,753,761,760,753,754,762,761,754,755,763,762,755,756,764,763,756,757,765,764,757,750,758,765,766,767,775,774,767,768,776,775,768,769,777,776,769,770,778,777,770,771,779,778,771,772,780,779,772,773,781,780,773,766,774,781,774,775,783,782,775,776,784,783,776,777,785,784,777,778,786,785,778,779,787,786,779,780,788,787,780,781,789,788,781,774,782,789,790,791,799,798,791,792,800,799,792,793,801,800,793,794,802,801,794,795,803,802,795,796,804,803,796,797,805,804,797,790,798,805,798,799,807,806,799,800,808,807,800,801,809,808,801,802,810,809,802,803,811,810,803,804,812,811,804,805,813,812,805,798,806,813,806,807,815,814,807,808,816,815,808,809,817,816,809,810,818,817,810,811,819,818,811,812,820,819,812,813,821,820,813,806,814,821,822,823,831,830,823,824,832,831,824,825,833,832,825,826,834,833,826,827,835,834,827,828,836,835,828,829,837,836,829,822,830,837,830,831,839,838,831,832,840,839,832,833,841,840,833,834,842,841,834,835,843,842,835,836,844,843,836,837,845,844,837,830,838,845,838,839,847,846,839,840,848,847,840,841,849,848,841,842,850,849,842,843,851,850,843,844,852,851,844,845,853,852,845,838,846,853,854,855,863,862,855,856,864,863,856,857,865,864,857,858,866,865,858,859,867,866,859,860,868,867,860,861,869,868,861,854,862,869,862,863,871,870,863,864,872,871,864,865,873,872,865,866,874,873,866,867,875,874,867,868,876,875,868,869,877,876,869,862,870,877,870,871,879,878,871,872,880,879,872,873,881,880,873,874,882,881,874,875,883,882,875,876,884,883,876,877,885,884,877,870,878,885,886,887,899,898,887,888,900,899,888,889,901,900,889,890,902,901,890,891,903,902,891,892,904,903,892,893,905,904,893,894,906,905,894,895,907,906,895,896,908,907,896,897,909,908,897,886,898,909,898,899,911,910,899,900,912,911,900,901,913,912,901,902,914,913,902,903,915,914,903,904,916,915,904,905,917,916,905,906,918,917,906,907,919,918,907,908,920,919,908,909,921,920,909,898,910,921,910,911,923,922,911,912,924,923,912,913,925,924,913,914,926,925,914,915,927,926,915,916,928,927,916,917,929,928,917,918,930,929,918,919,931,930,919,920,932,931,920,921,933,932,921,910,922,933,922,923,935,934,923,924,936,935,924,925,937,936,925,926,938,937,926,927,939,938,927,928,940,939,928,929,941,940,929,930,942,941,930,931,943,942,931,932,944,943,932,933,945,944,933,922,934,945,946,947,949,948,950,951,953,952,946,947,951,950,948,949,953,952,946,948,952,950,947,949,953,951,954,955,961,960,955,956,962,961,956,957,963,962,957,958,964,963,958,959,965,964,959,954,960,965,966,967,973,972,967,968,974,973,968,969,975,974,969,970,976,975,970,971,977,976,971,966,972,977,978,981,983,980,980,983,982,979,981,984,986,983,983,986,985,982,984,987,989,986,986,989,988,985,987,990,992,989,989,992,991,988,990,993,995,992,992,995,994,991,993,996,998,995,995,998,997,994,996,999,1001,998,998,1001,1000,997,999,1002,1004,1001,1001,1004,1003,1000,1002,1005,1007,1004,1004,1007,1006,1003,1005,1008,1010,1007,1007,1010,1009,1006,1008,1011,1013,1010,1010,1013,1012,1009,1011,1014,1016,1013,1013,1016,1015,1012,1014,1017,1019,1016,1016,1019,1018,1015,1017,1020,1022,1019,1019,1022,1021,1018,1020,1023,1025,1022,1022,1025,1024,1021,1023,1026,1028,1025,1025,1028,1027,1024,1026,1029,1031,1028,1028,1031,1030,1027,1029,1032,1034,1031,1031,1034,1033,1030,1032,1035,1037,1034,1034,1037,1036,1033,1035,1038,1040,1037,1037,1040,1039,1036,1038,1041,1043,1040,1040,1043,1042,1039,1041,1044,1046,1043,1043,1046,1045,1042,1044,1047,1049,1046,1046,1049,1048,1045,1047,1050,1052,1049,1049,1052,1051,1048,1050,1053,1055,1052,1052,1055,1054,1051,1053,1056,1058,1055,1055,1058,1057,1054,1056,1059,1061,1058,1058,1061,1060,1057,1059,1062,1064,1061,1061,1064,1063,1060,1062,1065,1067,1064,1064,1067,1066,1063,1065,1068,1070,1067,1067,1070,1069,1066,1071,1074,1076,1073,1073,1076,1075,1072,1074,1077,1079,1076,1076,1079,1078,1075,1077,1080,1082,1079,1079,1082,1081,1078,1080,1083,1085,1082,1082,1085,1084,1081,1083,1086,1088,1085,1085,1088,1087,1084,1086,1089,1091,1088,1088,1091,1090,1087,1089,1092,1094,1091,1091,1094,1093,1090,1092,1095,1097,1094,1094,1097,1096,1093,1095,1098,1100,1097,1097,1100,1099,1096,1098,1101,1103,1100,1100,1103,1102,1099,1101,1104,1106,1103,1103,1106,1105,1102,1104,1107,1109,1106,1106,1109,1108,1105,1107,1110,1112,1109,1109,1112,1111,1108,1110,1113,1115,1112,1112,1115,1114,1111,1113,1116,1118,1115,1115,1118,1117,1114,1116,1119,1121,1118,1118,1121,1120,1117,1119,1122,1124,1121,1121,1124,1123,1120,1122,1125,1127,1124,1124,1127,1126,1123,1125,1128,1130,1127,1127,1130,1129,1126,1128,1131,1133,1130,1130,1133,1132,1129,1131,1134,1136,1133,1133,1136,1135,1132,1134,1137,1139,1136,1136,1139,1138,1135,1137,1140,1142,1139,1139,1142,1141,1138,1140,1143,1145,1142,1142,1145,1144,1141,1143,1146,1148,1145,1145,1148,1147,1144,1146,1149,1151,1148,1148,1151,1150,1147,1149,1152,1154,1151,1151,1154,1153,1150,1152,1155,1157,1154,1154,1157,1156,1153,1155,1158,1160,1157,1157,1160,1159,1156,1158,1161,1163,1160,1160,1163,1162,1159,1164,1165,1171,1170,1165,1166,1172,1171,1166,1167,1173,1172,1167,1168,1174,1173,1168,1169,1175,1174,1169,1164,1170,1175,1176,1177,1183,1182,1177,1178,1184,1183,1178,1179,1185,1184,1179,1180,1186,1185,1180,1181,1187,1186,1181,1176,1182,1187,1188,1189,1195,1194,1189,1190,1196,1195,1190,1191,1197,1196,1191,1192,1198,1197,1192,1193,1199,1198,1193,1188,1194,1199,1200,1201,1207,1206,1201,1202,1208,1207,1202,1203,1209,1208,1203,1204,1210,1209,1204,1205,1211,1210,1205,1200,1206,1211,1212,1213,1219,1218,1213,1214,1220,1219,1214,1215,1221,1220,1215,1216,1222,1221,1216,1217,1223,1222,1217,1212,1218,1223,1224,1225,1231,1230,1225,1226,1232,1231,1226,1227,1233,1232,1227,1228,1234,1233,1228,1229,1235,1234,1229,1224,1230,1235,1236,1237,1243,1242,1237,1238,1244,1243,1238,1239,1245,1244,1239,1240,1246,1245,1240,1241,1247,1246,1241,1236,1242,1247,1242,1243,1249,1248,1243,1244,1250,1249,1244,1245,1251,1250,1245,1246,1252,1251,1246,1247,1253,1252,1247,1242,1248,1253,1254,1255,1267,1266,1255,1256,1268,1267,1256,1257,1269,1268,1257,1258,1270,1269,1258,1259,1271,1270,1259,1260,1272,1271,1260,1261,1273,1272,1261,1262,1274,1273,1262,1263,1275,1274,1263,1264,1276,1275,1264,1265,1277,1276,1265,1254,1266,1277,1266,1267,1279,1278,1267,1268,1280,1279,1268,1269,1281,1280,1269,1270,1282,1281,1270,1271,1283,1282,1271,1272,1284,1283,1272,1273,1285,1284,1273,1274,1286,1285,1274,1275,1287,1286,1275,1276,1288,1287,1276,1277,1289,1288,1277,1266,1278,1289,1290,1291,1307,1306,1291,1292,1308,1307,1292,1293,1309,1308,1293,1294,1310,1309,1294,1295,1311,1310,1295,1296,1312,1311,1296,1297,1313,1312,1297,1298,1314,1313,1298,1299,1315,1314,1299,1300,1316,1315,1300,1301,1317,1316,1301,1302,1318,1317,1302,1303,1319,1318,1303,1304,1320,1319,1304,1305,1321,1320,1305,1290,1306,1321,1306,1307,1323,1322,1307,1308,1324,1323,1308,1309,1325,1324,1309,1310,1326,1325,1310,1311,1327,1326,1311,1312,1328,1327,1312,1313,1329,1328,1313,1314,1330,1329,1314,1315,1331,1330,1315,1316,1332,1331,1316,1317,1333,1332,1317,1318,1334,1333,1318,1319,1335,1334,1319,1320,1336,1335,1320,1321,1337,1336,1321,1306,1322,1337]},{"id":"drive","explode":[0,0,0],"v":[-0.135,0.29,-0.02,-0.1332,0.2715,-0.02,-0.1278,0.2536,-0.02,-0.119,0.2372,-0.02,-0.1072,0.2228,-0.02,-0.0928,0.211,-0.02,-0.0764,0.2022,-0.02,-0.0585,0.1968,-0.02,-0.04,0.195,-0.02,-0.0215,0.1968,-0.02,-0.0036,0.2022,-0.02,0.0128,0.211,-0.02,0.0272,0.2228,-0.02,0.039,0.2372,-0.02,0.0478,0.2536,-0.02,0.0532,0.2715,-0.02,0.055,0.29,-0.02,0.0532,0.3085,-0.02,0.0478,0.3264,-0.02,0.039,0.3428,-0.02,0.0272,0.3572,-0.02,0.0128,0.369,-0.02,-0.0036,0.3778,-0.02,-0.0215,0.3832,-0.02,-0.04,0.385,-0.02,-0.0585,0.3832,-0.02,-0.0764,0.3778,-0.02,-0.0928,0.369,-0.02,-0.1072,0.3572,-0.02,-0.119,0.3428,-0.02,-0.1278,0.3264,-0.02,-0.1332,0.3085,-0.02,-0.135,0.29,0.02,-0.1332,0.2715,0.02,-0.1278,0.2536,0.02,-0.119,0.2372,0.02,-0.1072,0.2228,0.02,-0.0928,0.211,0.02,-0.0764,0.2022,0.02,-0.0585,0.1968,0.02,-0.04,0.195,0.02,-0.0215,0.1968,0.02,-0.0036,0.2022,0.02,0.0128,0.211,0.02,0.0272,0.2228,0.02,0.039,0.2372,0.02,0.0478,0.2536,0.02,0.0532,0.2715,0.02,0.055,0.29,0.02,0.0532,0.3085,0.02,0.0478,0.3264,0.02,0.039,0.3428,0.02,0.0272,0.3572,0.02,0.0128,0.369,0.02,-0.0036,0.3778,0.02,-0.0215,0.3832,0.02,-0.04,0.385,0.02,-0.0585,0.3832,0.02,-0.0764,0.3778,0.02,-0.0928,0.369,0.02,-0.1072,0.3572,0.02,-0.119,0.3428,0.02,-0.1278,0.3264,0.02,-0.1332,0.3085,0.02,-0.12,0.29,-0.02,-0.1185,0.2744,-0.02,-0.1139,0.2594,-0.02,-0.1065,0.2456,-0.02,-0.0966,0.2334,-0.02,-0.0844,0.2235,-0.02,-0.0706,0.2161,-0.02,-0.0556,0.2115,-0.02,-0.04,0.21,-0.02,-0.0244,0.2115,-0.02,-0.0094,0.2161,-0.02,0.0044,0.2235,-0.02,0.0166,0.2334,-0.02,0.0265,0.2456,-0.02,0.0339,0.2594,-0.02,0.0385,0.2744,-0.02,0.04,0.29,-0.02,0.0385,0.3056,-0.02,0.0339,0.3206,-0.02,0.0265,0.3344,-0.02,0.0166,0.3466,-0.02,0.0044,0.3565,-0.02,-0.0094,0.3639,-0.02,-0.0244,0.3685,-0.02,-0.04,0.37,-0.02,-0.0556,0.3685,-0.02,-0.0706,0.3639,-0.02,-0.0844,0.3565,-0.02,-0.0966,0.3466,-0.02,-0.1065,0.3344,-0.02,-0.1139,0.3206,-0.02,-0.1185,0.3056,-0.02,-0.12,0.29,0.02,-0.1185,0.2744,0.02,-0.1139,0.2594,0.02,-0.1065,0.2456,0.02,-0.0966,0.2334,0.02,-0.0844,0.2235,0.02,-0.0706,0.2161,0.02,-0.0556,0.2115,0.02,-0.04,0.21,0.02,-0.0244,0.2115,0.02,-0.0094,0.2161,0.02,0.0044,0.2235,0.02,0.0166,0.2334,0.02,0.0265,0.2456,0.02,0.0339,0.2594,0.02,0.0385,0.2744,0.02,0.04,0.29,0.02,0.0385,0.3056,0.02,0.0339,0.3206,0.02,0.0265,0.3344,0.02,0.0166,0.3466,0.02,0.0044,0.3565,0.02,-0.0094,0.3639,0.02,-0.0244,0.3685,0.02,-0.04,0.37,0.02,-0.0556,0.3685,0.02,-0.0706,0.3639,0.02,-0.0844,0.3565,0.02,-0.0966,0.3466,0.02,-0.1065,0.3344,0.02,-0.1139,0.3206,0.02,-0.1185,0.3056,0.02,-0.61,0.35,0.04,-0.6083,0.3371,0.04,-0.6033,0.325,0.04,-0.5954,0.3146,0.04,-0.585,0.3067,0.04,-0.5729,0.3017,0.04,-0.56,0.3,0.04,-0.5471,0.3017,0.04,-0.535,0.3067,0.04,-0.5246,0.3146,0.04,-0.5167,0.325,0.04,-0.5117,0.3371,0.04,-0.51,0.35,0.04,-0.5117,0.3629,0.04,-0.5167,0.375,0.04,-0.5246,0.3854,0.04,-0.535,0.3933,0.04,-0.5471,0.3983,0.04,-0.56,0.4,0.04,-0.5729,0.3983,0.04,-0.585,0.3933,0.04,-0.5954,0.3854,0.04,-0.6033,0.375,0.04,-0.6083,0.3629,0.04,-0.04,0.385,0.04,-0.56,0.4,0.04,-0.04,0.195,0.04,-0.56,0.3,0.04,-0.04,0.2886,-0.0709,-0.0487,0.2855,-0.065,-0.0487,0.2869,-0.0541,-0.04,0.2914,-0.0491,-0.0313,0.2945,-0.055,-0.0313,0.2931,-0.0659,-0.0631,0.3404,-0.0776,-0.0718,0.3372,-0.0716,-0.0718,0.3386,-0.0607,-0.0631,0.3432,-0.0558,-0.0544,0.3463,-0.0617,-0.0544,0.3449,-0.0726,-0.0861,0.3921,-0.0842,-0.0948,0.389,-0.0783,-0.0948,0.3904,-0.0674,-0.0861,0.3949,-0.0624,-0.0774,0.398,-0.0684,-0.0774,0.3966,-0.0793,-0.1092,0.4439,-0.0909,-0.1179,0.4408,-0.085,-0.1179,0.4422,-0.0741,-0.1092,0.4467,-0.0691,-0.1005,0.4498,-0.075,-0.1005,0.4484,-0.0859,-0.1592,0.4363,-0.175,-0.0592,0.4363,-0.175,-0.1592,0.4543,-0.175,-0.0592,0.4543,-0.175,-0.1592,0.4363,-0.085,-0.0592,0.4363,-0.085,-0.1592,0.4543,-0.085,-0.0592,0.4543,-0.085,-0.04,0.2914,0.0709,-0.0487,0.2869,0.0659,-0.0487,0.2855,0.055,-0.04,0.2886,0.0491,-0.0313,0.2931,0.0541,-0.0313,0.2945,0.065,-0.0169,0.2397,0.0776,-0.0256,0.2351,0.0726,-0.0256,0.2337,0.0617,-0.0169,0.2369,0.0558,-0.0081,0.2414,0.0607,-0.0081,0.2428,0.0716,0.0063,0.188,0.0842,-0.0024,0.1834,0.0793,-0.0024,0.182,0.0684,0.0063,0.1851,0.0624,0.015,0.1897,0.0674,0.015,0.1911,0.0783,0.0294,0.1362,0.0909,0.0207,0.1317,0.0859,0.0207,0.1303,0.075,0.0294,0.1334,0.0691,0.0381,0.138,0.0741,0.0381,0.1394,0.085,-0.0206,0.1258,0.085,0.0794,0.1258,0.085,-0.0206,0.1438,0.085,0.0794,0.1438,0.085,-0.0206,0.1258,0.175,0.0794,0.1258,0.175,-0.0206,0.1438,0.175,0.0794,0.1438,0.175,-0.064,0.29,-0.07,-0.0608,0.278,-0.07,-0.052,0.2692,-0.07,-0.04,0.266,-0.07,-0.028,0.2692,-0.07,-0.0192,0.278,-0.07,-0.016,0.29,-0.07,-0.0192,0.302,-0.07,-0.028,0.3108,-0.07,-0.04,0.314,-0.07,-0.052,0.3108,-0.07,-0.0608,0.302,-0.07,-0.064,0.29,0,-0.0608,0.278,0,-0.052,0.2692,0,-0.04,0.266,0,-0.028,0.2692,0,-0.0192,0.278,0,-0.016,0.29,0,-0.0192,0.302,0,-0.028,0.3108,0,-0.04,0.314,0,-0.052,0.3108,0,-0.0608,0.302,0,-0.064,0.29,0.07,-0.0608,0.278,0.07,-0.052,0.2692,0.07,-0.04,0.266,0.07,-0.028,0.2692,0.07,-0.0192,0.278,0.07,-0.016,0.29,0.07,-0.0192,0.302,0.07,-0.028,0.3108,0.07,-0.04,0.314,0.07,-0.052,0.3108,0.07,-0.0608,0.302,0.07],"e":[0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,30,30,31,31,0,32,33,33,34,34,35,35,36,36,37,37,38,38,39,39,40,40,41,41,42,42,43,43,44,44,45,45,46,46,47,47,48,48,49,49,50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57,58,58,59,59,60,60,61,61,62,62,63,63,32,0,32,4,36,8,40,12,44,16,48,20,52,24,56,28,60,64,65,65,66,66,67,67,68,68,69,69,70,70,71,71,72,72,73,73,74,74,75,75,76,76,77,77,78,78,79,79,80,80,81,81,82,82,83,83,84,84,85,85,86,86,87,87,88,88,89,89,90,90,91,91,92,92,93,93,94,94,95,95,64,96,97,97,98,98,99,99,100,100,101,101,102,102,103,103,104,104,105,105,106,106,107,107,108,108,109,109,110,110,111,111,112,112,113,113,114,114,115,115,116,116,117,117,118,118,119,119,120,120,121,121,122,122,123,123,124,124,125,125,126,126,127,127,96,64,96,68,100,72,104,76,108,80,112,84,116,88,120,92,124,128,129,129,130,130,131,131,132,132,133,133,134,134,135,135,136,136,137,137,138,138,139,139,140,140,141,141,142,142,143,143,144,144,145,145,146,146,147,147,148,148,149,149,150,150,151,151,128,152,153,154,155,156,157,157,158,158,159,159,160,160,161,161,156,162,163,163,164,164,165,165,166,166,167,167,162,168,169,169,170,170,171,171,172,172,173,173,168,174,175,175,176,176,177,177,178,178,179,179,174,156,162,162,168,168,174,158,164,164,170,170,176,160,166,166,172,172,178,180,181,182,183,184,185,186,187,180,182,181,183,184,186,185,187,180,184,181,185,182,186,183,187,188,189,189,190,190,191,191,192,192,193,193,188,194,195,195,196,196,197,197,198,198,199,199,194,200,201,201,202,202,203,203,204,204,205,205,200,206,207,207,208,208,209,209,210,210,211,211,206,188,194,194,200,200,206,190,196,196,202,202,208,192,198,198,204,204,210,212,213,214,215,216,217,218,219,212,214,213,215,216,218,217,219,212,216,213,217,214,218,215,219,220,221,221,222,222,223,223,224,224,225,225,226,226,227,227,228,228,229,229,230,230,231,231,220,232,233,233,234,234,235,235,236,236,237,237,238,238,239,239,240,240,241,241,242,242,243,243,232,244,245,245,246,246,247,247,248,248,249,249,250,250,251,251,252,252,253,253,254,254,255,255,244,220,232,232,244,222,234,234,246,224,236,236,248,226,238,238,250,228,240,240,252,230,242,242,254],"q":[0,1,33,32,1,2,34,33,2,3,35,34,3,4,36,35,4,5,37,36,5,6,38,37,6,7,39,38,7,8,40,39,8,9,41,40,9,10,42,41,10,11,43,42,11,12,44,43,12,13,45,44,13,14,46,45,14,15,47,46,15,16,48,47,16,17,49,48,17,18,50,49,18,19,51,50,19,20,52,51,20,21,53,52,21,22,54,53,22,23,55,54,23,24,56,55,24,25,57,56,25,26,58,57,26,27,59,58,27,28,60,59,28,29,61,60,29,30,62,61,30,31,63,62,31,0,32,63,64,65,97,96,65,66,98,97,66,67,99,98,67,68,100,99,68,69,101,100,69,70,102,101,70,71,103,102,71,72,104,103,72,73,105,104,73,74,106,105,74,75,107,106,75,76,108,107,76,77,109,108,77,78,110,109,78,79,111,110,79,80,112,111,80,81,113,112,81,82,114,113,82,83,115,114,83,84,116,115,84,85,117,116,85,86,118,117,86,87,119,118,87,88,120,119,88,89,121,120,89,90,122,121,90,91,123,122,91,92,124,123,92,93,125,124,93,94,126,125,94,95,127,126,95,64,96,127,156,157,163,162,157,158,164,163,158,159,165,164,159,160,166,165,160,161,167,166,161,156,162,167,162,163,169,168,163,164,170,169,164,165,171,170,165,166,172,171,166,167,173,172,167,162,168,173,168,169,175,174,169,170,176,175,170,171,177,176,171,172,178,177,172,173,179,178,173,168,174,179,180,181,183,182,184,185,187,186,180,181,185,184,182,183,187,186,180,182,186,184,181,183,187,185,188,189,195,194,189,190,196,195,190,191,197,196,191,192,198,197,192,193,199,198,193,188,194,199,194,195,201,200,195,196,202,201,196,197,203,202,197,198,204,203,198,199,205,204,199,194,200,205,200,201,207,206,201,202,208,207,202,203,209,208,203,204,210,209,204,205,211,210,205,200,206,211,212,213,215,214,216,217,219,218,212,213,217,216,214,215,219,218,212,214,218,216,213,215,219,217,220,221,233,232,221,222,234,233,222,223,235,234,223,224,236,235,224,225,237,236,225,226,238,237,226,227,239,238,227,228,240,239,228,229,241,240,229,230,242,241,230,231,243,242,231,220,232,243,232,233,245,244,233,234,246,245,234,235,247,246,235,236,248,247,236,237,249,248,237,238,250,249,238,239,251,250,239,240,252,251,240,241,253,252,241,242,254,253,242,243,255,254,243,232,244,255]}]},{"id":"wheel-r","anchor":[-0.56,0.35,0],"pieces":[{"id":"wheel-r","explode":[0,0,0],"v":[-0.89,0.35,-0.022,-0.8887,0.3212,-0.022,-0.885,0.2927,-0.022,-0.8788,0.2646,-0.022,-0.8701,0.2371,-0.022,-0.8591,0.2105,-0.022,-0.8458,0.185,-0.022,-0.8303,0.1607,-0.022,-0.8128,0.1379,-0.022,-0.7933,0.1167,-0.022,-0.7721,0.0972,-0.022,-0.7493,0.0797,-0.022,-0.725,0.0642,-0.022,-0.6995,0.0509,-0.022,-0.6729,0.0399,-0.022,-0.6454,0.0312,-0.022,-0.6173,0.025,-0.022,-0.5888,0.0213,-0.022,-0.56,0.02,-0.022,-0.5312,0.0213,-0.022,-0.5027,0.025,-0.022,-0.4746,0.0312,-0.022,-0.4471,0.0399,-0.022,-0.4205,0.0509,-0.022,-0.395,0.0642,-0.022,-0.3707,0.0797,-0.022,-0.3479,0.0972,-0.022,-0.3267,0.1167,-0.022,-0.3072,0.1379,-0.022,-0.2897,0.1607,-0.022,-0.2742,0.185,-0.022,-0.2609,0.2105,-0.022,-0.2499,0.2371,-0.022,-0.2412,0.2646,-0.022,-0.235,0.2927,-0.022,-0.2313,0.3212,-0.022,-0.23,0.35,-0.022,-0.2313,0.3788,-0.022,-0.235,0.4073,-0.022,-0.2412,0.4354,-0.022,-0.2499,0.4629,-0.022,-0.2609,0.4895,-0.022,-0.2742,0.515,-0.022,-0.2897,0.5393,-0.022,-0.3072,0.5621,-0.022,-0.3267,0.5833,-0.022,-0.3479,0.6028,-0.022,-0.3707,0.6203,-0.022,-0.395,0.6358,-0.022,-0.4205,0.6491,-0.022,-0.4471,0.6601,-0.022,-0.4746,0.6688,-0.022,-0.5027,0.675,-0.022,-0.5312,0.6787,-0.022,-0.56,0.68,-0.022,-0.5888,0.6787,-0.022,-0.6173,0.675,-0.022,-0.6454,0.6688,-0.022,-0.6729,0.6601,-0.022,-0.6995,0.6491,-0.022,-0.725,0.6358,-0.022,-0.7493,0.6203,-0.022,-0.7721,0.6028,-0.022,-0.7933,0.5833,-0.022,-0.8128,0.5621,-0.022,-0.8303,0.5393,-0.022,-0.8458,0.515,-0.022,-0.8591,0.4895,-0.022,-0.8701,0.4629,-0.022,-0.8788,0.4354,-0.022,-0.885,0.4073,-0.022,-0.8887,0.3788,-0.022,-0.91,0.35,0,-0.9087,0.3195,0,-0.9047,0.2892,0,-0.8981,0.2594,0,-0.8889,0.2303,0,-0.8772,0.2021,0,-0.8631,0.175,0,-0.8467,0.1492,0,-0.8281,0.125,0,-0.8075,0.1025,0,-0.785,0.0819,0,-0.7608,0.0633,0,-0.735,0.0469,0,-0.7079,0.0328,0,-0.6797,0.0211,0,-0.6506,0.0119,0,-0.6208,0.0053,0,-0.5905,0.0013,0,-0.56,0,0,-0.5295,0.0013,0,-0.4992,0.0053,0,-0.4694,0.0119,0,-0.4403,0.0211,0,-0.4121,0.0328,0,-0.385,0.0469,0,-0.3592,0.0633,0,-0.335,0.0819,0,-0.3125,0.1025,0,-0.2919,0.125,0,-0.2733,0.1492,0,-0.2569,0.175,0,-0.2428,0.2021,0,-0.2311,0.2303,0,-0.2219,0.2594,0,-0.2153,0.2892,0,-0.2113,0.3195,0,-0.21,0.35,0,-0.2113,0.3805,0,-0.2153,0.4108,0,-0.2219,0.4406,0,-0.2311,0.4697,0,-0.2428,0.4979,0,-0.2569,0.525,0,-0.2733,0.5508,0,-0.2919,0.575,0,-0.3125,0.5975,0,-0.335,0.6181,0,-0.3592,0.6367,0,-0.385,0.6531,0,-0.4121,0.6672,0,-0.4403,0.6789,0,-0.4694,0.6881,0,-0.4992,0.6947,0,-0.5295,0.6987,0,-0.56,0.7,0,-0.5905,0.6987,0,-0.6208,0.6947,0,-0.6506,0.6881,0,-0.6797,0.6789,0,-0.7079,0.6672,0,-0.735,0.6531,0,-0.7608,0.6367,0,-0.785,0.6181,0,-0.8075,0.5975,0,-0.8281,0.575,0,-0.8467,0.5508,0,-0.8631,0.525,0,-0.8772,0.4979,0,-0.8889,0.4697,0,-0.8981,0.4406,0,-0.9047,0.4108,0,-0.9087,0.3805,0,-0.89,0.35,0.022,-0.8887,0.3212,0.022,-0.885,0.2927,0.022,-0.8788,0.2646,0.022,-0.8701,0.2371,0.022,-0.8591,0.2105,0.022,-0.8458,0.185,0.022,-0.8303,0.1607,0.022,-0.8128,0.1379,0.022,-0.7933,0.1167,0.022,-0.7721,0.0972,0.022,-0.7493,0.0797,0.022,-0.725,0.0642,0.022,-0.6995,0.0509,0.022,-0.6729,0.0399,0.022,-0.6454,0.0312,0.022,-0.6173,0.025,0.022,-0.5888,0.0213,0.022,-0.56,0.02,0.022,-0.5312,0.0213,0.022,-0.5027,0.025,0.022,-0.4746,0.0312,0.022,-0.4471,0.0399,0.022,-0.4205,0.0509,0.022,-0.395,0.0642,0.022,-0.3707,0.0797,0.022,-0.3479,0.0972,0.022,-0.3267,0.1167,0.022,-0.3072,0.1379,0.022,-0.2897,0.1607,0.022,-0.2742,0.185,0.022,-0.2609,0.2105,0.022,-0.2499,0.2371,0.022,-0.2412,0.2646,0.022,-0.235,0.2927,0.022,-0.2313,0.3212,0.022,-0.23,0.35,0.022,-0.2313,0.3788,0.022,-0.235,0.4073,0.022,-0.2412,0.4354,0.022,-0.2499,0.4629,0.022,-0.2609,0.4895,0.022,-0.2742,0.515,0.022,-0.2897,0.5393,0.022,-0.3072,0.5621,0.022,-0.3267,0.5833,0.022,-0.3479,0.6028,0.022,-0.3707,0.6203,0.022,-0.395,0.6358,0.022,-0.4205,0.6491,0.022,-0.4471,0.6601,0.022,-0.4746,0.6688,0.022,-0.5027,0.675,0.022,-0.5312,0.6787,0.022,-0.56,0.68,0.022,-0.5888,0.6787,0.022,-0.6173,0.675,0.022,-0.6454,0.6688,0.022,-0.6729,0.6601,0.022,-0.6995,0.6491,0.022,-0.725,0.6358,0.022,-0.7493,0.6203,0.022,-0.7721,0.6028,0.022,-0.7933,0.5833,0.022,-0.8128,0.5621,0.022,-0.8303,0.5393,0.022,-0.8458,0.515,0.022,-0.8591,0.4895,0.022,-0.8701,0.4629,0.022,-0.8788,0.4354,0.022,-0.885,0.4073,0.022,-0.8887,0.3788,0.022,-0.865,0.35,-0.012,-0.8633,0.3181,-0.012,-0.8583,0.2866,-0.012,-0.8501,0.2557,-0.012,-0.8386,0.2259,-0.012,-0.8241,0.1975,-0.012,-0.8068,0.1707,-0.012,-0.7867,0.1459,-0.012,-0.7641,0.1233,-0.012,-0.7393,0.1032,-0.012,-0.7125,0.0859,-0.012,-0.6841,0.0714,-0.012,-0.6543,0.0599,-0.012,-0.6234,0.0517,-0.012,-0.5919,0.0467,-0.012,-0.56,0.045,-0.012,-0.5281,0.0467,-0.012,-0.4966,0.0517,-0.012,-0.4657,0.0599,-0.012,-0.4359,0.0714,-0.012,-0.4075,0.0859,-0.012,-0.3807,0.1032,-0.012,-0.3559,0.1233,-0.012,-0.3333,0.1459,-0.012,-0.3132,0.1707,-0.012,-0.2959,0.1975,-0.012,-0.2814,0.2259,-0.012,-0.2699,0.2557,-0.012,-0.2617,0.2866,-0.012,-0.2567,0.3181,-0.012,-0.255,0.35,-0.012,-0.2567,0.3819,-0.012,-0.2617,0.4134,-0.012,-0.2699,0.4443,-0.012,-0.2814,0.4741,-0.012,-0.2959,0.5025,-0.012,-0.3132,0.5293,-0.012,-0.3333,0.5541,-0.012,-0.3559,0.5767,-0.012,-0.3807,0.5968,-0.012,-0.4075,0.6141,-0.012,-0.4359,0.6286,-0.012,-0.4657,0.6401,-0.012,-0.4966,0.6483,-0.012,-0.5281,0.6533,-0.012,-0.56,0.655,-0.012,-0.5919,0.6533,-0.012,-0.6234,0.6483,-0.012,-0.6543,0.6401,-0.012,-0.6841,0.6286,-0.012,-0.7125,0.6141,-0.012,-0.7393,0.5968,-0.012,-0.7641,0.5767,-0.012,-0.7867,0.5541,-0.012,-0.8068,0.5293,-0.012,-0.8241,0.5025,-0.012,-0.8386,0.4741,-0.012,-0.8501,0.4443,-0.012,-0.8583,0.4134,-0.012,-0.8633,0.3819,-0.012,-0.865,0.35,0.012,-0.8633,0.3181,0.012,-0.8583,0.2866,0.012,-0.8501,0.2557,0.012,-0.8386,0.2259,0.012,-0.8241,0.1975,0.012,-0.8068,0.1707,0.012,-0.7867,0.1459,0.012,-0.7641,0.1233,0.012,-0.7393,0.1032,0.012,-0.7125,0.0859,0.012,-0.6841,0.0714,0.012,-0.6543,0.0599,0.012,-0.6234,0.0517,0.012,-0.5919,0.0467,0.012,-0.56,0.045,0.012,-0.5281,0.0467,0.012,-0.4966,0.0517,0.012,-0.4657,0.0599,0.012,-0.4359,0.0714,0.012,-0.4075,0.0859,0.012,-0.3807,0.1032,0.012,-0.3559,0.1233,0.012,-0.3333,0.1459,0.012,-0.3132,0.1707,0.012,-0.2959,0.1975,0.012,-0.2814,0.2259,0.012,-0.2699,0.2557,0.012,-0.2617,0.2866,0.012,-0.2567,0.3181,0.012,-0.255,0.35,0.012,-0.2567,0.3819,0.012,-0.2617,0.4134,0.012,-0.2699,0.4443,0.012,-0.2814,0.4741,0.012,-0.2959,0.5025,0.012,-0.3132,0.5293,0.012,-0.3333,0.5541,0.012,-0.3559,0.5767,0.012,-0.3807,0.5968,0.012,-0.4075,0.6141,0.012,-0.4359,0.6286,0.012,-0.4657,0.6401,0.012,-0.4966,0.6483,0.012,-0.5281,0.6533,0.012,-0.56,0.655,0.012,-0.5919,0.6533,0.012,-0.6234,0.6483,0.012,-0.6543,0.6401,0.012,-0.6841,0.6286,0.012,-0.7125,0.6141,0.012,-0.7393,0.5968,0.012,-0.7641,0.5767,0.012,-0.7867,0.5541,0.012,-0.8068,0.5293,0.012,-0.8241,0.5025,0.012,-0.8386,0.4741,0.012,-0.8501,0.4443,0.012,-0.8583,0.4134,0.012,-0.8633,0.3819,0.012,-0.84,0.35,0,-0.8385,0.3207,0,-0.8339,0.2918,0,-0.8263,0.2635,0,-0.8158,0.2361,0,-0.8025,0.21,0,-0.7865,0.1854,0,-0.7681,0.1626,0,-0.7474,0.1419,0,-0.7246,0.1235,0,-0.7,0.1075,0,-0.6739,0.0942,0,-0.6465,0.0837,0,-0.6182,0.0761,0,-0.5893,0.0715,0,-0.56,0.07,0,-0.5307,0.0715,0,-0.5018,0.0761,0,-0.4735,0.0837,0,-0.4461,0.0942,0,-0.42,0.1075,0,-0.3954,0.1235,0,-0.3726,0.1419,0,-0.3519,0.1626,0,-0.3335,0.1854,0,-0.3175,0.21,0,-0.3042,0.2361,0,-0.2937,0.2635,0,-0.2861,0.2918,0,-0.2815,0.3207,0,-0.28,0.35,0,-0.2815,0.3793,0,-0.2861,0.4082,0,-0.2937,0.4365,0,-0.3042,0.4639,0,-0.3175,0.49,0,-0.3335,0.5146,0,-0.3519,0.5374,0,-0.3726,0.5581,0,-0.3954,0.5765,0,-0.42,0.5925,0,-0.4461,0.6058,0,-0.4735,0.6163,0,-0.5018,0.6239,0,-0.5307,0.6285,0,-0.56,0.63,0,-0.5893,0.6285,0,-0.6182,0.6239,0,-0.6465,0.6163,0,-0.6739,0.6058,0,-0.7,0.5925,0,-0.7246,0.5765,0,-0.7474,0.5581,0,-0.7681,0.5374,0,-0.7865,0.5146,0,-0.8025,0.49,0,-0.8158,0.4639,0,-0.8263,0.4365,0,-0.8339,0.4082,0,-0.8385,0.3793,0,-0.465,0.35,-0.03,-0.297,0.254,0,-0.4707,0.3825,0.03,-0.3457,0.5302,0,-0.4872,0.4111,-0.03,-0.2968,0.4455,0,-0.5125,0.4323,0.03,-0.5116,0.6258,0,-0.5435,0.4436,-0.03,-0.4198,0.5924,0,-0.5765,0.4436,0.03,-0.7002,0.5924,0,-0.6075,0.4323,-0.03,-0.6084,0.6258,0,-0.6328,0.4111,0.03,-0.8232,0.4455,0,-0.6493,0.3825,-0.03,-0.7743,0.5302,0,-0.655,0.35,0.03,-0.823,0.254,0,-0.6493,0.3175,-0.03,-0.84,0.3503,0,-0.6328,0.2889,0.03,-0.6998,0.1074,0,-0.6075,0.2677,-0.03,-0.7747,0.1702,0,-0.5765,0.2564,0.03,-0.5111,0.0743,0,-0.5435,0.2564,-0.03,-0.6089,0.0743,0,-0.5125,0.2677,0.03,-0.3453,0.1702,0,-0.4872,0.2889,-0.03,-0.4202,0.1074,0,-0.4707,0.3175,0.03,-0.28,0.3503,0],"e":[0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,30,30,31,31,32,32,33,33,34,34,35,35,36,36,37,37,38,38,39,39,40,40,41,41,42,42,43,43,44,44,45,45,46,46,47,47,48,48,49,49,50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57,58,58,59,59,60,60,61,61,62,62,63,63,64,64,65,65,66,66,67,67,68,68,69,69,70,70,71,71,0,72,73,73,74,74,75,75,76,76,77,77,78,78,79,79,80,80,81,81,82,82,83,83,84,84,85,85,86,86,87,87,88,88,89,89,90,90,91,91,92,92,93,93,94,94,95,95,96,96,97,97,98,98,99,99,100,100,101,101,102,102,103,103,104,104,105,105,106,106,107,107,108,108,109,109,110,110,111,111,112,112,113,113,114,114,115,115,116,116,117,117,118,118,119,119,120,120,121,121,122,122,123,123,124,124,125,125,126,126,127,127,128,128,129,129,130,130,131,131,132,132,133,133,134,134,135,135,136,136,137,137,138,138,139,139,140,140,141,141,142,142,143,143,72,144,145,145,146,146,147,147,148,148,149,149,150,150,151,151,152,152,153,153,154,154,155,155,156,156,157,157,158,158,159,159,160,160,161,161,162,162,163,163,164,164,165,165,166,166,167,167,168,168,169,169,170,170,171,171,172,172,173,173,174,174,175,175,176,176,177,177,178,178,179,179,180,180,181,181,182,182,183,183,184,184,185,185,186,186,187,187,188,188,189,189,190,190,191,191,192,192,193,193,194,194,195,195,196,196,197,197,198,198,199,199,200,200,201,201,202,202,203,203,204,204,205,205,206,206,207,207,208,208,209,209,210,210,211,211,212,212,213,213,214,214,215,215,144,0,72,72,144,3,75,75,147,6,78,78,150,9,81,81,153,12,84,84,156,15,87,87,159,18,90,90,162,21,93,93,165,24,96,96,168,27,99,99,171,30,102,102,174,33,105,105,177,36,108,108,180,39,111,111,183,42,114,114,186,45,117,117,189,48,120,120,192,51,123,123,195,54,126,126,198,57,129,129,201,60,132,132,204,63,135,135,207,66,138,138,210,69,141,141,213,216,217,217,218,218,219,219,220,220,221,221,222,222,223,223,224,224,225,225,226,226,227,227,228,228,229,229,230,230,231,231,232,232,233,233,234,234,235,235,236,236,237,237,238,238,239,239,240,240,241,241,242,242,243,243,244,244,245,245,246,246,247,247,248,248,249,249,250,250,251,251,252,252,253,253,254,254,255,255,256,256,257,257,258,258,259,259,260,260,261,261,262,262,263,263,264,264,265,265,266,266,267,267,268,268,269,269,270,270,271,271,272,272,273,273,274,274,275,275,216,276,277,277,278,278,279,279,280,280,281,281,282,282,283,283,284,284,285,285,286,286,287,287,288,288,289,289,290,290,291,291,292,292,293,293,294,294,295,295,296,296,297,297,298,298,299,299,300,300,301,301,302,302,303,303,304,304,305,305,306,306,307,307,308,308,309,309,310,310,311,311,312,312,313,313,314,314,315,315,316,316,317,317,318,318,319,319,320,320,321,321,322,322,323,323,324,324,325,325,326,326,327,327,328,328,329,329,330,330,331,331,332,332,333,333,334,334,335,335,276,336,337,337,338,338,339,339,340,340,341,341,342,342,343,343,344,344,345,345,346,346,347,347,348,348,349,349,350,350,351,351,352,352,353,353,354,354,355,355,356,356,357,357,358,358,359,359,360,360,361,361,362,362,363,363,364,364,365,365,366,366,367,367,368,368,369,369,370,370,371,371,372,372,373,373,374,374,375,375,376,376,377,377,378,378,379,379,380,380,381,381,382,382,383,383,384,384,385,385,386,386,387,387,388,388,389,389,390,390,391,391,392,392,393,393,394,394,395,395,336,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431],"q":[0,1,73,72,72,73,145,144,1,2,74,73,73,74,146,145,2,3,75,74,74,75,147,146,3,4,76,75,75,76,148,147,4,5,77,76,76,77,149,148,5,6,78,77,77,78,150,149,6,7,79,78,78,79,151,150,7,8,80,79,79,80,152,151,8,9,81,80,80,81,153,152,9,10,82,81,81,82,154,153,10,11,83,82,82,83,155,154,11,12,84,83,83,84,156,155,12,13,85,84,84,85,157,156,13,14,86,85,85,86,158,157,14,15,87,86,86,87,159,158,15,16,88,87,87,88,160,159,16,17,89,88,88,89,161,160,17,18,90,89,89,90,162,161,18,19,91,90,90,91,163,162,19,20,92,91,91,92,164,163,20,21,93,92,92,93,165,164,21,22,94,93,93,94,166,165,22,23,95,94,94,95,167,166,23,24,96,95,95,96,168,167,24,25,97,96,96,97,169,168,25,26,98,97,97,98,170,169,26,27,99,98,98,99,171,170,27,28,100,99,99,100,172,171,28,29,101,100,100,101,173,172,29,30,102,101,101,102,174,173,30,31,103,102,102,103,175,174,31,32,104,103,103,104,176,175,32,33,105,104,104,105,177,176,33,34,106,105,105,106,178,177,34,35,107,106,106,107,179,178,35,36,108,107,107,108,180,179,36,37,109,108,108,109,181,180,37,38,110,109,109,110,182,181,38,39,111,110,110,111,183,182,39,40,112,111,111,112,184,183,40,41,113,112,112,113,185,184,41,42,114,113,113,114,186,185,42,43,115,114,114,115,187,186,43,44,116,115,115,116,188,187,44,45,117,116,116,117,189,188,45,46,118,117,117,118,190,189,46,47,119,118,118,119,191,190,47,48,120,119,119,120,192,191,48,49,121,120,120,121,193,192,49,50,122,121,121,122,194,193,50,51,123,122,122,123,195,194,51,52,124,123,123,124,196,195,52,53,125,124,124,125,197,196,53,54,126,125,125,126,198,197,54,55,127,126,126,127,199,198,55,56,128,127,127,128,200,199,56,57,129,128,128,129,201,200,57,58,130,129,129,130,202,201,58,59,131,130,130,131,203,202,59,60,132,131,131,132,204,203,60,61,133,132,132,133,205,204,61,62,134,133,133,134,206,205,62,63,135,134,134,135,207,206,63,64,136,135,135,136,208,207,64,65,137,136,136,137,209,208,65,66,138,137,137,138,210,209,66,67,139,138,138,139,211,210,67,68,140,139,139,140,212,211,68,69,141,140,140,141,213,212,69,70,142,141,141,142,214,213,70,71,143,142,142,143,215,214,71,0,72,143,143,72,144,215,216,217,337,336,336,337,277,276,217,218,338,337,337,338,278,277,218,219,339,338,338,339,279,278,219,220,340,339,339,340,280,279,220,221,341,340,340,341,281,280,221,222,342,341,341,342,282,281,222,223,343,342,342,343,283,282,223,224,344,343,343,344,284,283,224,225,345,344,344,345,285,284,225,226,346,345,345,346,286,285,226,227,347,346,346,347,287,286,227,228,348,347,347,348,288,287,228,229,349,348,348,349,289,288,229,230,350,349,349,350,290,289,230,231,351,350,350,351,291,290,231,232,352,351,351,352,292,291,232,233,353,352,352,353,293,292,233,234,354,353,353,354,294,293,234,235,355,354,354,355,295,294,235,236,356,355,355,356,296,295,236,237,357,356,356,357,297,296,237,238,358,357,357,358,298,297,238,239,359,358,358,359,299,298,239,240,360,359,359,360,300,299,240,241,361,360,360,361,301,300,241,242,362,361,361,362,302,301,242,243,363,362,362,363,303,302,243,244,364,363,363,364,304,303,244,245,365,364,364,365,305,304,245,246,366,365,365,366,306,305,246,247,367,366,366,367,307,306,247,248,368,367,367,368,308,307,248,249,369,368,368,369,309,308,249,250,370,369,369,370,310,309,250,251,371,370,370,371,311,310,251,252,372,371,371,372,312,311,252,253,373,372,372,373,313,312,253,254,374,373,373,374,314,313,254,255,375,374,374,375,315,314,255,256,376,375,375,376,316,315,256,257,377,376,376,377,317,316,257,258,378,377,377,378,318,317,258,259,379,378,378,379,319,318,259,260,380,379,379,380,320,319,260,261,381,380,380,381,321,320,261,262,382,381,381,382,322,321,262,263,383,382,382,383,323,322,263,264,384,383,383,384,324,323,264,265,385,384,384,385,325,324,265,266,386,385,385,386,326,325,266,267,387,386,386,387,327,326,267,268,388,387,387,388,328,327,268,269,389,388,388,389,329,328,269,270,390,389,389,390,330,329,270,271,391,390,390,391,331,330,271,272,392,391,391,392,332,331,272,273,393,392,392,393,333,332,273,274,394,393,393,394,334,333,274,275,395,394,394,395,335,334,275,216,336,395,395,336,276,335]}]},{"id":"wheel-f","anchor":[0.56,0.35,0],"pieces":[{"id":"wheel-f","explode":[0,0,0],"v":[0.23,0.35,-0.022,0.2313,0.3212,-0.022,0.235,0.2927,-0.022,0.2412,0.2646,-0.022,0.2499,0.2371,-0.022,0.2609,0.2105,-0.022,0.2742,0.185,-0.022,0.2897,0.1607,-0.022,0.3072,0.1379,-0.022,0.3267,0.1167,-0.022,0.3479,0.0972,-0.022,0.3707,0.0797,-0.022,0.395,0.0642,-0.022,0.4205,0.0509,-0.022,0.4471,0.0399,-0.022,0.4746,0.0312,-0.022,0.5027,0.025,-0.022,0.5312,0.0213,-0.022,0.56,0.02,-0.022,0.5888,0.0213,-0.022,0.6173,0.025,-0.022,0.6454,0.0312,-0.022,0.6729,0.0399,-0.022,0.6995,0.0509,-0.022,0.725,0.0642,-0.022,0.7493,0.0797,-0.022,0.7721,0.0972,-0.022,0.7933,0.1167,-0.022,0.8128,0.1379,-0.022,0.8303,0.1607,-0.022,0.8458,0.185,-0.022,0.8591,0.2105,-0.022,0.8701,0.2371,-0.022,0.8788,0.2646,-0.022,0.885,0.2927,-0.022,0.8887,0.3212,-0.022,0.89,0.35,-0.022,0.8887,0.3788,-0.022,0.885,0.4073,-0.022,0.8788,0.4354,-0.022,0.8701,0.4629,-0.022,0.8591,0.4895,-0.022,0.8458,0.515,-0.022,0.8303,0.5393,-0.022,0.8128,0.5621,-0.022,0.7933,0.5833,-0.022,0.7721,0.6028,-0.022,0.7493,0.6203,-0.022,0.725,0.6358,-0.022,0.6995,0.6491,-0.022,0.6729,0.6601,-0.022,0.6454,0.6688,-0.022,0.6173,0.675,-0.022,0.5888,0.6787,-0.022,0.56,0.68,-0.022,0.5312,0.6787,-0.022,0.5027,0.675,-0.022,0.4746,0.6688,-0.022,0.4471,0.6601,-0.022,0.4205,0.6491,-0.022,0.395,0.6358,-0.022,0.3707,0.6203,-0.022,0.3479,0.6028,-0.022,0.3267,0.5833,-0.022,0.3072,0.5621,-0.022,0.2897,0.5393,-0.022,0.2742,0.515,-0.022,0.2609,0.4895,-0.022,0.2499,0.4629,-0.022,0.2412,0.4354,-0.022,0.235,0.4073,-0.022,0.2313,0.3788,-0.022,0.21,0.35,0,0.2113,0.3195,0,0.2153,0.2892,0,0.2219,0.2594,0,0.2311,0.2303,0,0.2428,0.2021,0,0.2569,0.175,0,0.2733,0.1492,0,0.2919,0.125,0,0.3125,0.1025,0,0.335,0.0819,0,0.3592,0.0633,0,0.385,0.0469,0,0.4121,0.0328,0,0.4403,0.0211,0,0.4694,0.0119,0,0.4992,0.0053,0,0.5295,0.0013,0,0.56,0,0,0.5905,0.0013,0,0.6208,0.0053,0,0.6506,0.0119,0,0.6797,0.0211,0,0.7079,0.0328,0,0.735,0.0469,0,0.7608,0.0633,0,0.785,0.0819,0,0.8075,0.1025,0,0.8281,0.125,0,0.8467,0.1492,0,0.8631,0.175,0,0.8772,0.2021,0,0.8889,0.2303,0,0.8981,0.2594,0,0.9047,0.2892,0,0.9087,0.3195,0,0.91,0.35,0,0.9087,0.3805,0,0.9047,0.4108,0,0.8981,0.4406,0,0.8889,0.4697,0,0.8772,0.4979,0,0.8631,0.525,0,0.8467,0.5508,0,0.8281,0.575,0,0.8075,0.5975,0,0.785,0.6181,0,0.7608,0.6367,0,0.735,0.6531,0,0.7079,0.6672,0,0.6797,0.6789,0,0.6506,0.6881,0,0.6208,0.6947,0,0.5905,0.6987,0,0.56,0.7,0,0.5295,0.6987,0,0.4992,0.6947,0,0.4694,0.6881,0,0.4403,0.6789,0,0.4121,0.6672,0,0.385,0.6531,0,0.3592,0.6367,0,0.335,0.6181,0,0.3125,0.5975,0,0.2919,0.575,0,0.2733,0.5508,0,0.2569,0.525,0,0.2428,0.4979,0,0.2311,0.4697,0,0.2219,0.4406,0,0.2153,0.4108,0,0.2113,0.3805,0,0.23,0.35,0.022,0.2313,0.3212,0.022,0.235,0.2927,0.022,0.2412,0.2646,0.022,0.2499,0.2371,0.022,0.2609,0.2105,0.022,0.2742,0.185,0.022,0.2897,0.1607,0.022,0.3072,0.1379,0.022,0.3267,0.1167,0.022,0.3479,0.0972,0.022,0.3707,0.0797,0.022,0.395,0.0642,0.022,0.4205,0.0509,0.022,0.4471,0.0399,0.022,0.4746,0.0312,0.022,0.5027,0.025,0.022,0.5312,0.0213,0.022,0.56,0.02,0.022,0.5888,0.0213,0.022,0.6173,0.025,0.022,0.6454,0.0312,0.022,0.6729,0.0399,0.022,0.6995,0.0509,0.022,0.725,0.0642,0.022,0.7493,0.0797,0.022,0.7721,0.0972,0.022,0.7933,0.1167,0.022,0.8128,0.1379,0.022,0.8303,0.1607,0.022,0.8458,0.185,0.022,0.8591,0.2105,0.022,0.8701,0.2371,0.022,0.8788,0.2646,0.022,0.885,0.2927,0.022,0.8887,0.3212,0.022,0.89,0.35,0.022,0.8887,0.3788,0.022,0.885,0.4073,0.022,0.8788,0.4354,0.022,0.8701,0.4629,0.022,0.8591,0.4895,0.022,0.8458,0.515,0.022,0.8303,0.5393,0.022,0.8128,0.5621,0.022,0.7933,0.5833,0.022,0.7721,0.6028,0.022,0.7493,0.6203,0.022,0.725,0.6358,0.022,0.6995,0.6491,0.022,0.6729,0.6601,0.022,0.6454,0.6688,0.022,0.6173,0.675,0.022,0.5888,0.6787,0.022,0.56,0.68,0.022,0.5312,0.6787,0.022,0.5027,0.675,0.022,0.4746,0.6688,0.022,0.4471,0.6601,0.022,0.4205,0.6491,0.022,0.395,0.6358,0.022,0.3707,0.6203,0.022,0.3479,0.6028,0.022,0.3267,0.5833,0.022,0.3072,0.5621,0.022,0.2897,0.5393,0.022,0.2742,0.515,0.022,0.2609,0.4895,0.022,0.2499,0.4629,0.022,0.2412,0.4354,0.022,0.235,0.4073,0.022,0.2313,0.3788,0.022,0.255,0.35,-0.012,0.2567,0.3181,-0.012,0.2617,0.2866,-0.012,0.2699,0.2557,-0.012,0.2814,0.2259,-0.012,0.2959,0.1975,-0.012,0.3132,0.1707,-0.012,0.3333,0.1459,-0.012,0.3559,0.1233,-0.012,0.3807,0.1032,-0.012,0.4075,0.0859,-0.012,0.4359,0.0714,-0.012,0.4657,0.0599,-0.012,0.4966,0.0517,-0.012,0.5281,0.0467,-0.012,0.56,0.045,-0.012,0.5919,0.0467,-0.012,0.6234,0.0517,-0.012,0.6543,0.0599,-0.012,0.6841,0.0714,-0.012,0.7125,0.0859,-0.012,0.7393,0.1032,-0.012,0.7641,0.1233,-0.012,0.7867,0.1459,-0.012,0.8068,0.1707,-0.012,0.8241,0.1975,-0.012,0.8386,0.2259,-0.012,0.8501,0.2557,-0.012,0.8583,0.2866,-0.012,0.8633,0.3181,-0.012,0.865,0.35,-0.012,0.8633,0.3819,-0.012,0.8583,0.4134,-0.012,0.8501,0.4443,-0.012,0.8386,0.4741,-0.012,0.8241,0.5025,-0.012,0.8068,0.5293,-0.012,0.7867,0.5541,-0.012,0.7641,0.5767,-0.012,0.7393,0.5968,-0.012,0.7125,0.6141,-0.012,0.6841,0.6286,-0.012,0.6543,0.6401,-0.012,0.6234,0.6483,-0.012,0.5919,0.6533,-0.012,0.56,0.655,-0.012,0.5281,0.6533,-0.012,0.4966,0.6483,-0.012,0.4657,0.6401,-0.012,0.4359,0.6286,-0.012,0.4075,0.6141,-0.012,0.3807,0.5968,-0.012,0.3559,0.5767,-0.012,0.3333,0.5541,-0.012,0.3132,0.5293,-0.012,0.2959,0.5025,-0.012,0.2814,0.4741,-0.012,0.2699,0.4443,-0.012,0.2617,0.4134,-0.012,0.2567,0.3819,-0.012,0.255,0.35,0.012,0.2567,0.3181,0.012,0.2617,0.2866,0.012,0.2699,0.2557,0.012,0.2814,0.2259,0.012,0.2959,0.1975,0.012,0.3132,0.1707,0.012,0.3333,0.1459,0.012,0.3559,0.1233,0.012,0.3807,0.1032,0.012,0.4075,0.0859,0.012,0.4359,0.0714,0.012,0.4657,0.0599,0.012,0.4966,0.0517,0.012,0.5281,0.0467,0.012,0.56,0.045,0.012,0.5919,0.0467,0.012,0.6234,0.0517,0.012,0.6543,0.0599,0.012,0.6841,0.0714,0.012,0.7125,0.0859,0.012,0.7393,0.1032,0.012,0.7641,0.1233,0.012,0.7867,0.1459,0.012,0.8068,0.1707,0.012,0.8241,0.1975,0.012,0.8386,0.2259,0.012,0.8501,0.2557,0.012,0.8583,0.2866,0.012,0.8633,0.3181,0.012,0.865,0.35,0.012,0.8633,0.3819,0.012,0.8583,0.4134,0.012,0.8501,0.4443,0.012,0.8386,0.4741,0.012,0.8241,0.5025,0.012,0.8068,0.5293,0.012,0.7867,0.5541,0.012,0.7641,0.5767,0.012,0.7393,0.5968,0.012,0.7125,0.6141,0.012,0.6841,0.6286,0.012,0.6543,0.6401,0.012,0.6234,0.6483,0.012,0.5919,0.6533,0.012,0.56,0.655,0.012,0.5281,0.6533,0.012,0.4966,0.6483,0.012,0.4657,0.6401,0.012,0.4359,0.6286,0.012,0.4075,0.6141,0.012,0.3807,0.5968,0.012,0.3559,0.5767,0.012,0.3333,0.5541,0.012,0.3132,0.5293,0.012,0.2959,0.5025,0.012,0.2814,0.4741,0.012,0.2699,0.4443,0.012,0.2617,0.4134,0.012,0.2567,0.3819,0.012,0.28,0.35,0,0.2815,0.3207,0,0.2861,0.2918,0,0.2937,0.2635,0,0.3042,0.2361,0,0.3175,0.21,0,0.3335,0.1854,0,0.3519,0.1626,0,0.3726,0.1419,0,0.3954,0.1235,0,0.42,0.1075,0,0.4461,0.0942,0,0.4735,0.0837,0,0.5018,0.0761,0,0.5307,0.0715,0,0.56,0.07,0,0.5893,0.0715,0,0.6182,0.0761,0,0.6465,0.0837,0,0.6739,0.0942,0,0.7,0.1075,0,0.7246,0.1235,0,0.7474,0.1419,0,0.7681,0.1626,0,0.7865,0.1854,0,0.8025,0.21,0,0.8158,0.2361,0,0.8263,0.2635,0,0.8339,0.2918,0,0.8385,0.3207,0,0.84,0.35,0,0.8385,0.3793,0,0.8339,0.4082,0,0.8263,0.4365,0,0.8158,0.4639,0,0.8025,0.49,0,0.7865,0.5146,0,0.7681,0.5374,0,0.7474,0.5581,0,0.7246,0.5765,0,0.7,0.5925,0,0.6739,0.6058,0,0.6465,0.6163,0,0.6182,0.6239,0,0.5893,0.6285,0,0.56,0.63,0,0.5307,0.6285,0,0.5018,0.6239,0,0.4735,0.6163,0,0.4461,0.6058,0,0.42,0.5925,0,0.3954,0.5765,0,0.3726,0.5581,0,0.3519,0.5374,0,0.3335,0.5146,0,0.3175,0.49,0,0.3042,0.4639,0,0.2937,0.4365,0,0.2861,0.4082,0,0.2815,0.3793,0,0.59,0.35,-0.03,0.823,0.254,0,0.589,0.3578,0.03,0.7892,0.5108,0,0.586,0.365,-0.03,0.8358,0.3984,0,0.5812,0.3712,0.03,0.6781,0.6039,0,0.575,0.376,-0.03,0.7747,0.5298,0,0.5678,0.379,0.03,0.5353,0.6289,0,0.56,0.38,-0.03,0.656,0.613,0,0.5522,0.379,0.03,0.3992,0.5792,0,0.545,0.376,-0.03,0.5116,0.6258,0,0.5388,0.3712,0.03,0.3061,0.4681,0,0.534,0.365,-0.03,0.3802,0.5647,0,0.531,0.3578,0.03,0.2811,0.3253,0,0.53,0.35,-0.03,0.297,0.446,0,0.531,0.3422,0.03,0.3308,0.1892,0,0.534,0.335,-0.03,0.2842,0.3016,0,0.5388,0.3288,0.03,0.4419,0.0961,0,0.545,0.324,-0.03,0.3453,0.1702,0,0.5522,0.321,0.03,0.5847,0.0711,0,0.56,0.32,-0.03,0.464,0.087,0,0.5678,0.321,0.03,0.7208,0.1208,0,0.575,0.324,-0.03,0.6084,0.0742,0,0.5812,0.3288,0.03,0.8139,0.2319,0,0.586,0.335,-0.03,0.7398,0.1353,0,0.589,0.3422,0.03,0.8389,0.3747,0,0.53,0.35,-0.045,0.534,0.335,-0.045,0.545,0.324,-0.045,0.56,0.32,-0.045,0.575,0.324,-0.045,0.586,0.335,-0.045,0.59,0.35,-0.045,0.586,0.365,-0.045,0.575,0.376,-0.045,0.56,0.38,-0.045,0.545,0.376,-0.045,0.534,0.365,-0.045,0.53,0.35,0,0.534,0.335,0,0.545,0.324,0,0.56,0.32,0,0.575,0.324,0,0.586,0.335,0,0.59,0.35,0,0.586,0.365,0,0.575,0.376,0,0.56,0.38,0,0.545,0.376,0,0.534,0.365,0,0.53,0.35,0.045,0.534,0.335,0.045,0.545,0.324,0.045,0.56,0.32,0.045,0.575,0.324,0.045,0.586,0.335,0.045,0.59,0.35,0.045,0.586,0.365,0.045,0.575,0.376,0.045,0.56,0.38,0.045,0.545,0.376,0.045,0.534,0.365,0.045],"e":[0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,30,30,31,31,32,32,33,33,34,34,35,35,36,36,37,37,38,38,39,39,40,40,41,41,42,42,43,43,44,44,45,45,46,46,47,47,48,48,49,49,50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57,58,58,59,59,60,60,61,61,62,62,63,63,64,64,65,65,66,66,67,67,68,68,69,69,70,70,71,71,0,72,73,73,74,74,75,75,76,76,77,77,78,78,79,79,80,80,81,81,82,82,83,83,84,84,85,85,86,86,87,87,88,88,89,89,90,90,91,91,92,92,93,93,94,94,95,95,96,96,97,97,98,98,99,99,100,100,101,101,102,102,103,103,104,104,105,105,106,106,107,107,108,108,109,109,110,110,111,111,112,112,113,113,114,114,115,115,116,116,117,117,118,118,119,119,120,120,121,121,122,122,123,123,124,124,125,125,126,126,127,127,128,128,129,129,130,130,131,131,132,132,133,133,134,134,135,135,136,136,137,137,138,138,139,139,140,140,141,141,142,142,143,143,72,144,145,145,146,146,147,147,148,148,149,149,150,150,151,151,152,152,153,153,154,154,155,155,156,156,157,157,158,158,159,159,160,160,161,161,162,162,163,163,164,164,165,165,166,166,167,167,168,168,169,169,170,170,171,171,172,172,173,173,174,174,175,175,176,176,177,177,178,178,179,179,180,180,181,181,182,182,183,183,184,184,185,185,186,186,187,187,188,188,189,189,190,190,191,191,192,192,193,193,194,194,195,195,196,196,197,197,198,198,199,199,200,200,201,201,202,202,203,203,204,204,205,205,206,206,207,207,208,208,209,209,210,210,211,211,212,212,213,213,214,214,215,215,144,0,72,72,144,3,75,75,147,6,78,78,150,9,81,81,153,12,84,84,156,15,87,87,159,18,90,90,162,21,93,93,165,24,96,96,168,27,99,99,171,30,102,102,174,33,105,105,177,36,108,108,180,39,111,111,183,42,114,114,186,45,117,117,189,48,120,120,192,51,123,123,195,54,126,126,198,57,129,129,201,60,132,132,204,63,135,135,207,66,138,138,210,69,141,141,213,216,217,217,218,218,219,219,220,220,221,221,222,222,223,223,224,224,225,225,226,226,227,227,228,228,229,229,230,230,231,231,232,232,233,233,234,234,235,235,236,236,237,237,238,238,239,239,240,240,241,241,242,242,243,243,244,244,245,245,246,246,247,247,248,248,249,249,250,250,251,251,252,252,253,253,254,254,255,255,256,256,257,257,258,258,259,259,260,260,261,261,262,262,263,263,264,264,265,265,266,266,267,267,268,268,269,269,270,270,271,271,272,272,273,273,274,274,275,275,216,276,277,277,278,278,279,279,280,280,281,281,282,282,283,283,284,284,285,285,286,286,287,287,288,288,289,289,290,290,291,291,292,292,293,293,294,294,295,295,296,296,297,297,298,298,299,299,300,300,301,301,302,302,303,303,304,304,305,305,306,306,307,307,308,308,309,309,310,310,311,311,312,312,313,313,314,314,315,315,316,316,317,317,318,318,319,319,320,320,321,321,322,322,323,323,324,324,325,325,326,326,327,327,328,328,329,329,330,330,331,331,332,332,333,333,334,334,335,335,276,336,337,337,338,338,339,339,340,340,341,341,342,342,343,343,344,344,345,345,346,346,347,347,348,348,349,349,350,350,351,351,352,352,353,353,354,354,355,355,356,356,357,357,358,358,359,359,360,360,361,361,362,362,363,363,364,364,365,365,366,366,367,367,368,368,369,369,370,370,371,371,372,372,373,373,374,374,375,375,376,376,377,377,378,378,379,379,380,380,381,381,382,382,383,383,384,384,385,385,386,386,387,387,388,388,389,389,390,390,391,391,392,392,393,393,394,394,395,395,336,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,445,446,446,447,447,448,448,449,449,450,450,451,451,452,452,453,453,454,454,455,455,444,456,457,457,458,458,459,459,460,460,461,461,462,462,463,463,464,464,465,465,466,466,467,467,456,468,469,469,470,470,471,471,472,472,473,473,474,474,475,475,476,476,477,477,478,478,479,479,468,444,456,456,468,446,458,458,470,448,460,460,472,450,462,462,474,452,464,464,476,454,466,466,478],"q":[0,1,73,72,72,73,145,144,1,2,74,73,73,74,146,145,2,3,75,74,74,75,147,146,3,4,76,75,75,76,148,147,4,5,77,76,76,77,149,148,5,6,78,77,77,78,150,149,6,7,79,78,78,79,151,150,7,8,80,79,79,80,152,151,8,9,81,80,80,81,153,152,9,10,82,81,81,82,154,153,10,11,83,82,82,83,155,154,11,12,84,83,83,84,156,155,12,13,85,84,84,85,157,156,13,14,86,85,85,86,158,157,14,15,87,86,86,87,159,158,15,16,88,87,87,88,160,159,16,17,89,88,88,89,161,160,17,18,90,89,89,90,162,161,18,19,91,90,90,91,163,162,19,20,92,91,91,92,164,163,20,21,93,92,92,93,165,164,21,22,94,93,93,94,166,165,22,23,95,94,94,95,167,166,23,24,96,95,95,96,168,167,24,25,97,96,96,97,169,168,25,26,98,97,97,98,170,169,26,27,99,98,98,99,171,170,27,28,100,99,99,100,172,171,28,29,101,100,100,101,173,172,29,30,102,101,101,102,174,173,30,31,103,102,102,103,175,174,31,32,104,103,103,104,176,175,32,33,105,104,104,105,177,176,33,34,106,105,105,106,178,177,34,35,107,106,106,107,179,178,35,36,108,107,107,108,180,179,36,37,109,108,108,109,181,180,37,38,110,109,109,110,182,181,38,39,111,110,110,111,183,182,39,40,112,111,111,112,184,183,40,41,113,112,112,113,185,184,41,42,114,113,113,114,186,185,42,43,115,114,114,115,187,186,43,44,116,115,115,116,188,187,44,45,117,116,116,117,189,188,45,46,118,117,117,118,190,189,46,47,119,118,118,119,191,190,47,48,120,119,119,120,192,191,48,49,121,120,120,121,193,192,49,50,122,121,121,122,194,193,50,51,123,122,122,123,195,194,51,52,124,123,123,124,196,195,52,53,125,124,124,125,197,196,53,54,126,125,125,126,198,197,54,55,127,126,126,127,199,198,55,56,128,127,127,128,200,199,56,57,129,128,128,129,201,200,57,58,130,129,129,130,202,201,58,59,131,130,130,131,203,202,59,60,132,131,131,132,204,203,60,61,133,132,132,133,205,204,61,62,134,133,133,134,206,205,62,63,135,134,134,135,207,206,63,64,136,135,135,136,208,207,64,65,137,136,136,137,209,208,65,66,138,137,137,138,210,209,66,67,139,138,138,139,211,210,67,68,140,139,139,140,212,211,68,69,141,140,140,141,213,212,69,70,142,141,141,142,214,213,70,71,143,142,142,143,215,214,71,0,72,143,143,72,144,215,216,217,337,336,336,337,277,276,217,218,338,337,337,338,278,277,218,219,339,338,338,339,279,278,219,220,340,339,339,340,280,279,220,221,341,340,340,341,281,280,221,222,342,341,341,342,282,281,222,223,343,342,342,343,283,282,223,224,344,343,343,344,284,283,224,225,345,344,344,345,285,284,225,226,346,345,345,346,286,285,226,227,347,346,346,347,287,286,227,228,348,347,347,348,288,287,228,229,349,348,348,349,289,288,229,230,350,349,349,350,290,289,230,231,351,350,350,351,291,290,231,232,352,351,351,352,292,291,232,233,353,352,352,353,293,292,233,234,354,353,353,354,294,293,234,235,355,354,354,355,295,294,235,236,356,355,355,356,296,295,236,237,357,356,356,357,297,296,237,238,358,357,357,358,298,297,238,239,359,358,358,359,299,298,239,240,360,359,359,360,300,299,240,241,361,360,360,361,301,300,241,242,362,361,361,362,302,301,242,243,363,362,362,363,303,302,243,244,364,363,363,364,304,303,244,245,365,364,364,365,305,304,245,246,366,365,365,366,306,305,246,247,367,366,366,367,307,306,247,248,368,367,367,368,308,307,248,249,369,368,368,369,309,308,249,250,370,369,369,370,310,309,250,251,371,370,370,371,311,310,251,252,372,371,371,372,312,311,252,253,373,372,372,373,313,312,253,254,374,373,373,374,314,313,254,255,375,374,374,375,315,314,255,256,376,375,375,376,316,315,256,257,377,376,376,377,317,316,257,258,378,377,377,378,318,317,258,259,379,378,378,379,319,318,259,260,380,379,379,380,320,319,260,261,381,380,380,381,321,320,261,262,382,381,381,382,322,321,262,263,383,382,382,383,323,322,263,264,384,383,383,384,324,323,264,265,385,384,384,385,325,324,265,266,386,385,385,386,326,325,266,267,387,386,386,387,327,326,267,268,388,387,387,388,328,327,268,269,389,388,388,389,329,328,269,270,390,389,389,390,330,329,270,271,391,390,390,391,331,330,271,272,392,391,391,392,332,331,272,273,393,392,392,393,333,332,273,274,394,393,393,394,334,333,274,275,395,394,394,395,335,334,275,216,336,395,395,336,276,335,444,445,457,456,445,446,458,457,446,447,459,458,447,448,460,459,448,449,461,460,449,450,462,461,450,451,463,462,451,452,464,463,452,453,465,464,453,454,466,465,454,455,467,466,455,444,456,467,456,457,469,468,457,458,470,469,458,459,471,470,459,460,472,471,460,461,473,472,461,462,474,473,462,463,475,474,463,464,476,475,464,465,477,476,465,466,478,477,466,467,479,478,467,456,468,479]}]},{"id":"battery","anchor":[0.19,0.485,0.05],"tagDir":-1,"pieces":[{"id":"battery-shell","explode":[0,0,0],"v":[-0.0238,0.3367,-0.0394,-0.033,0.3478,-0.0269,-0.038,0.3539,-0.0095,-0.038,0.3539,0.0095,-0.033,0.3478,0.0269,-0.0238,0.3367,0.0394,0.007,0.3621,-0.0394,-0.0022,0.3732,-0.0269,-0.0072,0.3793,-0.0095,-0.0072,0.3793,0.0095,-0.0022,0.3732,0.0269,0.007,0.3621,0.0394,0.0377,0.3875,-0.0394,0.0286,0.3986,-0.0269,0.0236,0.4047,-0.0095,0.0236,0.4047,0.0095,0.0286,0.3986,0.0269,0.0377,0.3875,0.0394,0.0685,0.4129,-0.0394,0.0594,0.424,-0.0269,0.0543,0.4301,-0.0095,0.0543,0.4301,0.0095,0.0594,0.424,0.0269,0.0685,0.4129,0.0394,0.0993,0.4383,-0.0394,0.0901,0.4494,-0.0269,0.0851,0.4555,-0.0095,0.0851,0.4555,0.0095,0.0901,0.4494,0.0269,0.0993,0.4383,0.0394,0.1301,0.4636,-0.0394,0.1209,0.4747,-0.0269,0.1159,0.4808,-0.0095,0.1159,0.4808,0.0095,0.1209,0.4747,0.0269,0.1301,0.4636,0.0394,0.1608,0.489,-0.0394,0.1517,0.5001,-0.0269,0.1466,0.5062,-0.0095,0.1466,0.5062,0.0095,0.1517,0.5001,0.0269,0.1608,0.489,0.0394,0.1916,0.5144,-0.0394,0.1824,0.5255,-0.0269,0.1774,0.5316,-0.0095,0.1774,0.5316,0.0095,0.1824,0.5255,0.0269,0.1916,0.5144,0.0394,0.2224,0.5398,-0.0394,0.2132,0.5509,-0.0269,0.2082,0.557,-0.0095,0.2082,0.557,0.0095,0.2132,0.5509,0.0269,0.2224,0.5398,0.0394,0.2531,0.5652,-0.0394,0.244,0.5763,-0.0269,0.2389,0.5824,-0.0095,0.2389,0.5824,0.0095,0.244,0.5763,0.0269,0.2531,0.5652,0.0394,0.2839,0.5906,-0.0394,0.2747,0.6017,-0.0269,0.2697,0.6078,-0.0095,0.2697,0.6078,0.0095,0.2747,0.6017,0.0269,0.2839,0.5906,0.0394,0.3147,0.616,-0.0394,0.3055,0.6271,-0.0269,0.3005,0.6332,-0.0095,0.3005,0.6332,0.0095,0.3055,0.6271,0.0269,0.3147,0.616,0.0394,0.3454,0.6413,-0.0394,0.3363,0.6524,-0.0269,0.3312,0.6585,-0.0095,0.3312,0.6585,0.0095,0.3363,0.6524,0.0269,0.3454,0.6413,0.0394,0.3762,0.6667,-0.0394,0.367,0.6778,-0.0269,0.362,0.6839,-0.0095,0.362,0.6839,0.0095,0.367,0.6778,0.0269,0.3762,0.6667,0.0394],"e":[0,1,1,2,2,3,3,4,4,5,6,7,7,8,8,9,9,10,10,11,12,13,13,14,14,15,15,16,16,17,18,19,19,20,20,21,21,22,22,23,24,25,25,26,26,27,27,28,28,29,30,31,31,32,32,33,33,34,34,35,36,37,37,38,38,39,39,40,40,41,42,43,43,44,44,45,45,46,46,47,48,49,49,50,50,51,51,52,52,53,54,55,55,56,56,57,57,58,58,59,60,61,61,62,62,63,63,64,64,65,66,67,67,68,68,69,69,70,70,71,72,73,73,74,74,75,75,76,76,77,78,79,79,80,80,81,81,82,82,83,0,6,6,12,12,18,18,24,24,30,30,36,36,42,42,48,48,54,54,60,60,66,66,72,72,78,1,7,7,13,13,19,19,25,25,31,31,37,37,43,43,49,49,55,55,61,61,67,67,73,73,79,2,8,8,14,14,20,20,26,26,32,32,38,38,44,44,50,50,56,56,62,62,68,68,74,74,80,3,9,9,15,15,21,21,27,27,33,33,39,39,45,45,51,51,57,57,63,63,69,69,75,75,81,4,10,10,16,16,22,22,28,28,34,34,40,40,46,46,52,52,58,58,64,64,70,70,76,76,82,5,11,11,17,17,23,23,29,29,35,35,41,41,47,47,53,53,59,59,65,65,71,71,77,77,83,0,6,6,12,12,18,18,24,24,30,30,36,36,42,42,48,48,54,54,60,60,66,66,72,72,78,5,11,11,17,17,23,23,29,29,35,35,41,41,47,47,53,53,59,59,65,65,71,71,77,77,83],"q":[0,1,7,6,1,2,8,7,2,3,9,8,3,4,10,9,4,5,11,10,6,7,13,12,7,8,14,13,8,9,15,14,9,10,16,15,10,11,17,16,12,13,19,18,13,14,20,19,14,15,21,20,15,16,22,21,16,17,23,22,18,19,25,24,19,20,26,25,20,21,27,26,21,22,28,27,22,23,29,28,24,25,31,30,25,26,32,31,26,27,33,32,27,28,34,33,28,29,35,34,30,31,37,36,31,32,38,37,32,33,39,38,33,34,40,39,34,35,41,40,36,37,43,42,37,38,44,43,38,39,45,44,39,40,46,45,40,41,47,46,42,43,49,48,43,44,50,49,44,45,51,50,45,46,52,51,46,47,53,52,48,49,55,54,49,50,56,55,50,51,57,56,51,52,58,57,52,53,59,58,54,55,61,60,55,56,62,61,56,57,63,62,57,58,64,63,58,59,65,64,60,61,67,66,61,62,68,67,62,63,69,68,63,64,70,69,64,65,71,70,66,67,73,72,67,68,74,73,68,69,75,74,69,70,76,75,70,71,77,76,72,73,79,78,73,74,80,79,74,75,81,80,75,76,82,81,76,77,83,82]},{"id":"battery-cover","explode":[-0.2,-0.165,0.07],"v":[-0.0244,0.3375,0.0412,-0.0073,0.3168,0.0468,0.0089,0.2971,0.0365,0.0186,0.2853,0.0137,0.0186,0.2853,-0.0137,0.0089,0.2971,-0.0365,-0.0073,0.3168,-0.0468,-0.0244,0.3375,-0.0412,0.0064,0.3629,0.0412,0.0235,0.3421,0.0468,0.0396,0.3225,0.0365,0.0494,0.3107,0.0137,0.0494,0.3107,-0.0137,0.0396,0.3225,-0.0365,0.0235,0.3421,-0.0468,0.0064,0.3629,-0.0412,0.0371,0.3882,0.0412,0.0542,0.3675,0.0468,0.0704,0.3479,0.0365,0.0801,0.3361,0.0137,0.0801,0.3361,-0.0137,0.0704,0.3479,-0.0365,0.0542,0.3675,-0.0468,0.0371,0.3882,-0.0412,0.0679,0.4136,0.0412,0.085,0.3929,0.0468,0.1012,0.3733,0.0365,0.1109,0.3615,0.0137,0.1109,0.3615,-0.0137,0.1012,0.3733,-0.0365,0.085,0.3929,-0.0468,0.0679,0.4136,-0.0412,0.0987,0.439,0.0412,0.1158,0.4183,0.0468,0.1319,0.3987,0.0365,0.1417,0.3869,0.0137,0.1417,0.3869,-0.0137,0.1319,0.3987,-0.0365,0.1158,0.4183,-0.0468,0.0987,0.439,-0.0412,0.1294,0.4644,0.0412,0.1465,0.4437,0.0468,0.1627,0.4241,0.0365,0.1725,0.4122,0.0137,0.1725,0.4122,-0.0137,0.1627,0.4241,-0.0365,0.1465,0.4437,-0.0468,0.1294,0.4644,-0.0412,0.1602,0.4898,0.0412,0.1773,0.4691,0.0468,0.1935,0.4494,0.0365,0.2032,0.4376,0.0137,0.2032,0.4376,-0.0137,0.1935,0.4494,-0.0365,0.1773,0.4691,-0.0468,0.1602,0.4898,-0.0412,0.191,0.5152,0.0412,0.2081,0.4944,0.0468,0.2242,0.4748,0.0365,0.234,0.463,0.0137,0.234,0.463,-0.0137,0.2242,0.4748,-0.0365,0.2081,0.4944,-0.0468,0.191,0.5152,-0.0412,0.2217,0.5405,0.0412,0.2388,0.5198,0.0468,0.255,0.5002,0.0365,0.2648,0.4884,0.0137,0.2648,0.4884,-0.0137,0.255,0.5002,-0.0365,0.2388,0.5198,-0.0468,0.2217,0.5405,-0.0412,0.2525,0.5659,0.0412,0.2696,0.5452,0.0468,0.2858,0.5256,0.0365,0.2955,0.5138,0.0137,0.2955,0.5138,-0.0137,0.2858,0.5256,-0.0365,0.2696,0.5452,-0.0468,0.2525,0.5659,-0.0412,0.2833,0.5913,0.0412,0.3004,0.5706,0.0468,0.3166,0.551,0.0365,0.3263,0.5392,0.0137,0.3263,0.5392,-0.0137,0.3166,0.551,-0.0365,0.3004,0.5706,-0.0468,0.2833,0.5913,-0.0412,0.3141,0.6167,0.0412,0.3311,0.596,0.0468,0.3473,0.5764,0.0365,0.3571,0.5646,0.0137,0.3571,0.5646,-0.0137,0.3473,0.5764,-0.0365,0.3311,0.596,-0.0468,0.3141,0.6167,-0.0412,0.3448,0.6421,0.0412,0.3619,0.6214,0.0468,0.3781,0.6018,0.0365,0.3878,0.5899,0.0137,0.3878,0.5899,-0.0137,0.3781,0.6018,-0.0365,0.3619,0.6214,-0.0468,0.3448,0.6421,-0.0412,0.3756,0.6675,0.0412,0.3927,0.6468,0.0468,0.4089,0.6271,0.0365,0.4186,0.6153,0.0137,0.4186,0.6153,-0.0137,0.4089,0.6271,-0.0365,0.3927,0.6468,-0.0468,0.3756,0.6675,-0.0412],"e":[0,1,1,2,2,3,3,4,4,5,5,6,6,7,8,9,9,10,10,11,11,12,12,13,13,14,14,15,16,17,17,18,18,19,19,20,20,21,21,22,22,23,24,25,25,26,26,27,27,28,28,29,29,30,30,31,32,33,33,34,34,35,35,36,36,37,37,38,38,39,40,41,41,42,42,43,43,44,44,45,45,46,46,47,48,49,49,50,50,51,51,52,52,53,53,54,54,55,56,57,57,58,58,59,59,60,60,61,61,62,62,63,64,65,65,66,66,67,67,68,68,69,69,70,70,71,72,73,73,74,74,75,75,76,76,77,77,78,78,79,80,81,81,82,82,83,83,84,84,85,85,86,86,87,88,89,89,90,90,91,91,92,92,93,93,94,94,95,96,97,97,98,98,99,99,100,100,101,101,102,102,103,104,105,105,106,106,107,107,108,108,109,109,110,110,111,0,8,8,16,16,24,24,32,32,40,40,48,48,56,56,64,64,72,72,80,80,88,88,96,96,104,1,9,9,17,17,25,25,33,33,41,41,49,49,57,57,65,65,73,73,81,81,89,89,97,97,105,2,10,10,18,18,26,26,34,34,42,42,50,50,58,58,66,66,74,74,82,82,90,90,98,98,106,3,11,11,19,19,27,27,35,35,43,43,51,51,59,59,67,67,75,75,83,83,91,91,99,99,107,4,12,12,20,20,28,28,36,36,44,44,52,52,60,60,68,68,76,76,84,84,92,92,100,100,108,5,13,13,21,21,29,29,37,37,45,45,53,53,61,61,69,69,77,77,85,85,93,93,101,101,109,6,14,14,22,22,30,30,38,38,46,46,54,54,62,62,70,70,78,78,86,86,94,94,102,102,110,7,15,15,23,23,31,31,39,39,47,47,55,55,63,63,71,71,79,79,87,87,95,95,103,103,111,0,8,8,16,16,24,24,32,32,40,40,48,48,56,56,64,64,72,72,80,80,88,88,96,96,104,7,15,15,23,23,31,31,39,39,47,47,55,55,63,63,71,71,79,79,87,87,95,95,103,103,111],"q":[0,1,9,8,1,2,10,9,2,3,11,10,3,4,12,11,4,5,13,12,5,6,14,13,6,7,15,14,8,9,17,16,9,10,18,17,10,11,19,18,11,12,20,19,12,13,21,20,13,14,22,21,14,15,23,22,16,17,25,24,17,18,26,25,18,19,27,26,19,20,28,27,20,21,29,28,21,22,30,29,22,23,31,30,24,25,33,32,25,26,34,33,26,27,35,34,27,28,36,35,28,29,37,36,29,30,38,37,30,31,39,38,32,33,41,40,33,34,42,41,34,35,43,42,35,36,44,43,36,37,45,44,37,38,46,45,38,39,47,46,40,41,49,48,41,42,50,49,42,43,51,50,43,44,52,51,44,45,53,52,45,46,54,53,46,47,55,54,48,49,57,56,49,50,58,57,50,51,59,58,51,52,60,59,52,53,61,60,53,54,62,61,54,55,63,62,56,57,65,64,57,58,66,65,58,59,67,66,59,60,68,67,60,61,69,68,61,62,70,69,62,63,71,70,64,65,73,72,65,66,74,73,66,67,75,74,67,68,76,75,68,69,77,76,69,70,78,77,70,71,79,78,72,73,81,80,73,74,82,81,74,75,83,82,75,76,84,83,76,77,85,84,77,78,86,85,78,79,87,86,80,81,89,88,81,82,90,89,82,83,91,90,83,84,92,91,84,85,93,92,85,86,94,93,86,87,95,94,88,89,97,96,89,90,98,97,90,91,99,98,91,92,100,99,92,93,101,100,93,94,102,101,94,95,103,102,96,97,105,104,97,98,106,105,98,99,107,106,99,100,108,107,100,101,109,108,101,102,110,109,102,103,111,110]},{"id":"battery-cells","explode":[0,0,0],"internal":true,"hot":true,"v":[-0.0163,0.3333,0.0138,-0.0111,0.327,0.0112,-0.0079,0.3232,0.0043,-0.0079,0.3232,-0.0043,-0.0111,0.327,-0.0112,-0.0163,0.3333,-0.0138,-0.0214,0.3396,-0.0112,-0.0246,0.3434,-0.0043,-0.0246,0.3434,0.0043,-0.0214,0.3396,0.0112,0.0181,0.3617,0.0138,0.0233,0.3554,0.0112,0.0265,0.3516,0.0043,0.0265,0.3516,-0.0043,0.0233,0.3554,-0.0112,0.0181,0.3617,-0.0138,0.013,0.3679,-0.0112,0.0098,0.3718,-0.0043,0.0098,0.3718,0.0043,0.013,0.3679,0.0112,0.0237,0.3663,0.0138,0.0289,0.36,0.0112,0.0321,0.3562,0.0043,0.0321,0.3562,-0.0043,0.0289,0.36,-0.0112,0.0237,0.3663,-0.0138,0.0186,0.3726,-0.0112,0.0154,0.3764,-0.0043,0.0154,0.3764,0.0043,0.0186,0.3726,0.0112,0.0581,0.3947,0.0138,0.0633,0.3884,0.0112,0.0665,0.3846,0.0043,0.0665,0.3846,-0.0043,0.0633,0.3884,-0.0112,0.0581,0.3947,-0.0138,0.053,0.4009,-0.0112,0.0498,0.4048,-0.0043,0.0498,0.4048,0.0043,0.053,0.4009,0.0112,0.0637,0.3993,0.0138,0.0689,0.393,0.0112,0.0721,0.3892,0.0043,0.0721,0.3892,-0.0043,0.0689,0.393,-0.0112,0.0637,0.3993,-0.0138,0.0586,0.4056,-0.0112,0.0554,0.4094,-0.0043,0.0554,0.4094,0.0043,0.0586,0.4056,0.0112,0.0981,0.4277,0.0138,0.1033,0.4214,0.0112,0.1065,0.4176,0.0043,0.1065,0.4176,-0.0043,0.1033,0.4214,-0.0112,0.0981,0.4277,-0.0138,0.093,0.4339,-0.0112,0.0898,0.4378,-0.0043,0.0898,0.4378,0.0043,0.093,0.4339,0.0112,0.1037,0.4323,0.0138,0.1089,0.426,0.0112,0.1121,0.4222,0.0043,0.1121,0.4222,-0.0043,0.1089,0.426,-0.0112,0.1037,0.4323,-0.0138,0.0986,0.4386,-0.0112,0.0954,0.4424,-0.0043,0.0954,0.4424,0.0043,0.0986,0.4386,0.0112,0.1381,0.4607,0.0138,0.1433,0.4544,0.0112,0.1465,0.4506,0.0043,0.1465,0.4506,-0.0043,0.1433,0.4544,-0.0112,0.1381,0.4607,-0.0138,0.133,0.4669,-0.0112,0.1298,0.4708,-0.0043,0.1298,0.4708,0.0043,0.133,0.4669,0.0112,0.1437,0.4653,0.0138,0.1489,0.459,0.0112,0.1521,0.4552,0.0043,0.1521,0.4552,-0.0043,0.1489,0.459,-0.0112,0.1437,0.4653,-0.0138,0.1386,0.4716,-0.0112,0.1354,0.4754,-0.0043,0.1354,0.4754,0.0043,0.1386,0.4716,0.0112,0.1781,0.4937,0.0138,0.1833,0.4874,0.0112,0.1865,0.4836,0.0043,0.1865,0.4836,-0.0043,0.1833,0.4874,-0.0112,0.1781,0.4937,-0.0138,0.173,0.4999,-0.0112,0.1698,0.5038,-0.0043,0.1698,0.5038,0.0043,0.173,0.4999,0.0112,0.1837,0.4983,0.0138,0.1889,0.492,0.0112,0.1921,0.4882,0.0043,0.1921,0.4882,-0.0043,0.1889,0.492,-0.0112,0.1837,0.4983,-0.0138,0.1786,0.5046,-0.0112,0.1754,0.5084,-0.0043,0.1754,0.5084,0.0043,0.1786,0.5046,0.0112,0.2181,0.5267,0.0138,0.2233,0.5204,0.0112,0.2265,0.5166,0.0043,0.2265,0.5166,-0.0043,0.2233,0.5204,-0.0112,0.2181,0.5267,-0.0138,0.213,0.5329,-0.0112,0.2098,0.5368,-0.0043,0.2098,0.5368,0.0043,0.213,0.5329,0.0112,0.2237,0.5313,0.0138,0.2289,0.525,0.0112,0.2321,0.5212,0.0043,0.2321,0.5212,-0.0043,0.2289,0.525,-0.0112,0.2237,0.5313,-0.0138,0.2186,0.5376,-0.0112,0.2154,0.5414,-0.0043,0.2154,0.5414,0.0043,0.2186,0.5376,0.0112,0.2581,0.5597,0.0138,0.2633,0.5534,0.0112,0.2665,0.5496,0.0043,0.2665,0.5496,-0.0043,0.2633,0.5534,-0.0112,0.2581,0.5597,-0.0138,0.253,0.5659,-0.0112,0.2498,0.5698,-0.0043,0.2498,0.5698,0.0043,0.253,0.5659,0.0112,0.2637,0.5643,0.0138,0.2689,0.558,0.0112,0.2721,0.5542,0.0043,0.2721,0.5542,-0.0043,0.2689,0.558,-0.0112,0.2637,0.5643,-0.0138,0.2586,0.5706,-0.0112,0.2554,0.5744,-0.0043,0.2554,0.5744,0.0043,0.2586,0.5706,0.0112,0.2981,0.5927,0.0138,0.3033,0.5864,0.0112,0.3065,0.5826,0.0043,0.3065,0.5826,-0.0043,0.3033,0.5864,-0.0112,0.2981,0.5927,-0.0138,0.293,0.5989,-0.0112,0.2898,0.6028,-0.0043,0.2898,0.6028,0.0043,0.293,0.5989,0.0112,0.3037,0.5973,0.0138,0.3089,0.591,0.0112,0.3121,0.5872,0.0043,0.3121,0.5872,-0.0043,0.3089,0.591,-0.0112,0.3037,0.5973,-0.0138,0.2986,0.6036,-0.0112,0.2954,0.6074,-0.0043,0.2954,0.6074,0.0043,0.2986,0.6036,0.0112,0.3381,0.6257,0.0138,0.3433,0.6194,0.0112,0.3465,0.6156,0.0043,0.3465,0.6156,-0.0043,0.3433,0.6194,-0.0112,0.3381,0.6257,-0.0138,0.333,0.6319,-0.0112,0.3298,0.6358,-0.0043,0.3298,0.6358,0.0043,0.333,0.6319,0.0112,0.3437,0.6303,0.0138,0.3489,0.624,0.0112,0.3521,0.6202,0.0043,0.3521,0.6202,-0.0043,0.3489,0.624,-0.0112,0.3437,0.6303,-0.0138,0.3386,0.6366,-0.0112,0.3354,0.6404,-0.0043,0.3354,0.6404,0.0043,0.3386,0.6366,0.0112,0.3781,0.6587,0.0138,0.3833,0.6524,0.0112,0.3865,0.6486,0.0043,0.3865,0.6486,-0.0043,0.3833,0.6524,-0.0112,0.3781,0.6587,-0.0138,0.373,0.6649,-0.0112,0.3698,0.6688,-0.0043,0.3698,0.6688,0.0043,0.373,0.6649,0.0112,0.0019,0.3113,0.0138,0.007,0.3051,0.0112,0.0102,0.3012,0.0043,0.0102,0.3012,-0.0043,0.007,0.3051,-0.0112,0.0019,0.3113,-0.0138,-0.0033,0.3176,-0.0112,-0.0065,0.3214,-0.0043,-0.0065,0.3214,0.0043,-0.0033,0.3176,0.0112,0.0363,0.3397,0.0138,0.0414,0.3334,0.0112,0.0446,0.3296,0.0043,0.0446,0.3296,-0.0043,0.0414,0.3334,-0.0112,0.0363,0.3397,-0.0138,0.0311,0.346,-0.0112,0.0279,0.3498,-0.0043,0.0279,0.3498,0.0043,0.0311,0.346,0.0112,0.0419,0.3443,0.0138,0.047,0.3381,0.0112,0.0502,0.3342,0.0043,0.0502,0.3342,-0.0043,0.047,0.3381,-0.0112,0.0419,0.3443,-0.0138,0.0367,0.3506,-0.0112,0.0335,0.3544,-0.0043,0.0335,0.3544,0.0043,0.0367,0.3506,0.0112,0.0763,0.3727,0.0138,0.0814,0.3664,0.0112,0.0846,0.3626,0.0043,0.0846,0.3626,-0.0043,0.0814,0.3664,-0.0112,0.0763,0.3727,-0.0138,0.0711,0.379,-0.0112,0.0679,0.3828,-0.0043,0.0679,0.3828,0.0043,0.0711,0.379,0.0112,0.0819,0.3773,0.0138,0.087,0.3711,0.0112,0.0902,0.3672,0.0043,0.0902,0.3672,-0.0043,0.087,0.3711,-0.0112,0.0819,0.3773,-0.0138,0.0767,0.3836,-0.0112,0.0735,0.3874,-0.0043,0.0735,0.3874,0.0043,0.0767,0.3836,0.0112,0.1163,0.4057,0.0138,0.1214,0.3994,0.0112,0.1246,0.3956,0.0043,0.1246,0.3956,-0.0043,0.1214,0.3994,-0.0112,0.1163,0.4057,-0.0138,0.1111,0.412,-0.0112,0.1079,0.4158,-0.0043,0.1079,0.4158,0.0043,0.1111,0.412,0.0112,0.1219,0.4103,0.0138,0.127,0.4041,0.0112,0.1302,0.4002,0.0043,0.1302,0.4002,-0.0043,0.127,0.4041,-0.0112,0.1219,0.4103,-0.0138,0.1167,0.4166,-0.0112,0.1135,0.4204,-0.0043,0.1135,0.4204,0.0043,0.1167,0.4166,0.0112,0.1563,0.4387,0.0138,0.1614,0.4324,0.0112,0.1646,0.4286,0.0043,0.1646,0.4286,-0.0043,0.1614,0.4324,-0.0112,0.1563,0.4387,-0.0138,0.1511,0.445,-0.0112,0.1479,0.4488,-0.0043,0.1479,0.4488,0.0043,0.1511,0.445,0.0112,0.1619,0.4433,0.0138,0.167,0.4371,0.0112,0.1702,0.4332,0.0043,0.1702,0.4332,-0.0043,0.167,0.4371,-0.0112,0.1619,0.4433,-0.0138,0.1567,0.4496,-0.0112,0.1535,0.4534,-0.0043,0.1535,0.4534,0.0043,0.1567,0.4496,0.0112,0.1963,0.4717,0.0138,0.2014,0.4654,0.0112,0.2046,0.4616,0.0043,0.2046,0.4616,-0.0043,0.2014,0.4654,-0.0112,0.1963,0.4717,-0.0138,0.1911,0.478,-0.0112,0.1879,0.4818,-0.0043,0.1879,0.4818,0.0043,0.1911,0.478,0.0112,0.2019,0.4763,0.0138,0.207,0.4701,0.0112,0.2102,0.4662,0.0043,0.2102,0.4662,-0.0043,0.207,0.4701,-0.0112,0.2019,0.4763,-0.0138,0.1967,0.4826,-0.0112,0.1935,0.4864,-0.0043,0.1935,0.4864,0.0043,0.1967,0.4826,0.0112,0.2363,0.5047,0.0138,0.2414,0.4984,0.0112,0.2446,0.4946,0.0043,0.2446,0.4946,-0.0043,0.2414,0.4984,-0.0112,0.2363,0.5047,-0.0138,0.2311,0.511,-0.0112,0.2279,0.5148,-0.0043,0.2279,0.5148,0.0043,0.2311,0.511,0.0112,0.2419,0.5093,0.0138,0.247,0.5031,0.0112,0.2502,0.4992,0.0043,0.2502,0.4992,-0.0043,0.247,0.5031,-0.0112,0.2419,0.5093,-0.0138,0.2367,0.5156,-0.0112,0.2335,0.5194,-0.0043,0.2335,0.5194,0.0043,0.2367,0.5156,0.0112,0.2763,0.5377,0.0138,0.2814,0.5314,0.0112,0.2846,0.5276,0.0043,0.2846,0.5276,-0.0043,0.2814,0.5314,-0.0112,0.2763,0.5377,-0.0138,0.2711,0.544,-0.0112,0.2679,0.5478,-0.0043,0.2679,0.5478,0.0043,0.2711,0.544,0.0112,0.2819,0.5423,0.0138,0.287,0.5361,0.0112,0.2902,0.5322,0.0043,0.2902,0.5322,-0.0043,0.287,0.5361,-0.0112,0.2819,0.5423,-0.0138,0.2767,0.5486,-0.0112,0.2735,0.5524,-0.0043,0.2735,0.5524,0.0043,0.2767,0.5486,0.0112,0.3163,0.5707,0.0138,0.3214,0.5644,0.0112,0.3246,0.5606,0.0043,0.3246,0.5606,-0.0043,0.3214,0.5644,-0.0112,0.3163,0.5707,-0.0138,0.3111,0.577,-0.0112,0.3079,0.5808,-0.0043,0.3079,0.5808,0.0043,0.3111,0.577,0.0112,0.3219,0.5753,0.0138,0.327,0.5691,0.0112,0.3302,0.5652,0.0043,0.3302,0.5652,-0.0043,0.327,0.5691,-0.0112,0.3219,0.5753,-0.0138,0.3167,0.5816,-0.0112,0.3135,0.5854,-0.0043,0.3135,0.5854,0.0043,0.3167,0.5816,0.0112,0.3563,0.6037,0.0138,0.3614,0.5974,0.0112,0.3646,0.5936,0.0043,0.3646,0.5936,-0.0043,0.3614,0.5974,-0.0112,0.3563,0.6037,-0.0138,0.3511,0.61,-0.0112,0.3479,0.6138,-0.0043,0.3479,0.6138,0.0043,0.3511,0.61,0.0112,0.3619,0.6083,0.0138,0.367,0.6021,0.0112,0.3702,0.5982,0.0043,0.3702,0.5982,-0.0043,0.367,0.6021,-0.0112,0.3619,0.6083,-0.0138,0.3567,0.6146,-0.0112,0.3535,0.6184,-0.0043,0.3535,0.6184,0.0043,0.3567,0.6146,0.0112,0.3963,0.6367,0.0138,0.4014,0.6304,0.0112,0.4046,0.6266,0.0043,0.4046,0.6266,-0.0043,0.4014,0.6304,-0.0112,0.3963,0.6367,-0.0138,0.3911,0.643,-0.0112,0.3879,0.6468,-0.0043,0.3879,0.6468,0.0043,0.3911,0.643,0.0112],"e":[0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,0,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,10,0,10,3,13,6,16,9,19,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,20,30,31,31,32,32,33,33,34,34,35,35,36,36,37,37,38,38,39,39,30,20,30,23,33,26,36,29,39,40,41,41,42,42,43,43,44,44,45,45,46,46,47,47,48,48,49,49,40,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57,58,58,59,59,50,40,50,43,53,46,56,49,59,60,61,61,62,62,63,63,64,64,65,65,66,66,67,67,68,68,69,69,60,70,71,71,72,72,73,73,74,74,75,75,76,76,77,77,78,78,79,79,70,60,70,63,73,66,76,69,79,80,81,81,82,82,83,83,84,84,85,85,86,86,87,87,88,88,89,89,80,90,91,91,92,92,93,93,94,94,95,95,96,96,97,97,98,98,99,99,90,80,90,83,93,86,96,89,99,100,101,101,102,102,103,103,104,104,105,105,106,106,107,107,108,108,109,109,100,110,111,111,112,112,113,113,114,114,115,115,116,116,117,117,118,118,119,119,110,100,110,103,113,106,116,109,119,120,121,121,122,122,123,123,124,124,125,125,126,126,127,127,128,128,129,129,120,130,131,131,132,132,133,133,134,134,135,135,136,136,137,137,138,138,139,139,130,120,130,123,133,126,136,129,139,140,141,141,142,142,143,143,144,144,145,145,146,146,147,147,148,148,149,149,140,150,151,151,152,152,153,153,154,154,155,155,156,156,157,157,158,158,159,159,150,140,150,143,153,146,156,149,159,160,161,161,162,162,163,163,164,164,165,165,166,166,167,167,168,168,169,169,160,170,171,171,172,172,173,173,174,174,175,175,176,176,177,177,178,178,179,179,170,160,170,163,173,166,176,169,179,180,181,181,182,182,183,183,184,184,185,185,186,186,187,187,188,188,189,189,180,190,191,191,192,192,193,193,194,194,195,195,196,196,197,197,198,198,199,199,190,180,190,183,193,186,196,189,199,200,201,201,202,202,203,203,204,204,205,205,206,206,207,207,208,208,209,209,200,210,211,211,212,212,213,213,214,214,215,215,216,216,217,217,218,218,219,219,210,200,210,203,213,206,216,209,219,220,221,221,222,222,223,223,224,224,225,225,226,226,227,227,228,228,229,229,220,230,231,231,232,232,233,233,234,234,235,235,236,236,237,237,238,238,239,239,230,220,230,223,233,226,236,229,239,240,241,241,242,242,243,243,244,244,245,245,246,246,247,247,248,248,249,249,240,250,251,251,252,252,253,253,254,254,255,255,256,256,257,257,258,258,259,259,250,240,250,243,253,246,256,249,259,260,261,261,262,262,263,263,264,264,265,265,266,266,267,267,268,268,269,269,260,270,271,271,272,272,273,273,274,274,275,275,276,276,277,277,278,278,279,279,270,260,270,263,273,266,276,269,279,280,281,281,282,282,283,283,284,284,285,285,286,286,287,287,288,288,289,289,280,290,291,291,292,292,293,293,294,294,295,295,296,296,297,297,298,298,299,299,290,280,290,283,293,286,296,289,299,300,301,301,302,302,303,303,304,304,305,305,306,306,307,307,308,308,309,309,300,310,311,311,312,312,313,313,314,314,315,315,316,316,317,317,318,318,319,319,310,300,310,303,313,306,316,309,319,320,321,321,322,322,323,323,324,324,325,325,326,326,327,327,328,328,329,329,320,330,331,331,332,332,333,333,334,334,335,335,336,336,337,337,338,338,339,339,330,320,330,323,333,326,336,329,339,340,341,341,342,342,343,343,344,344,345,345,346,346,347,347,348,348,349,349,340,350,351,351,352,352,353,353,354,354,355,355,356,356,357,357,358,358,359,359,350,340,350,343,353,346,356,349,359,360,361,361,362,362,363,363,364,364,365,365,366,366,367,367,368,368,369,369,360,370,371,371,372,372,373,373,374,374,375,375,376,376,377,377,378,378,379,379,370,360,370,363,373,366,376,369,379,380,381,381,382,382,383,383,384,384,385,385,386,386,387,387,388,388,389,389,380,390,391,391,392,392,393,393,394,394,395,395,396,396,397,397,398,398,399,399,390,380,390,383,393,386,396,389,399],"q":[0,1,11,10,1,2,12,11,2,3,13,12,3,4,14,13,4,5,15,14,5,6,16,15,6,7,17,16,7,8,18,17,8,9,19,18,9,0,10,19,20,21,31,30,21,22,32,31,22,23,33,32,23,24,34,33,24,25,35,34,25,26,36,35,26,27,37,36,27,28,38,37,28,29,39,38,29,20,30,39,40,41,51,50,41,42,52,51,42,43,53,52,43,44,54,53,44,45,55,54,45,46,56,55,46,47,57,56,47,48,58,57,48,49,59,58,49,40,50,59,60,61,71,70,61,62,72,71,62,63,73,72,63,64,74,73,64,65,75,74,65,66,76,75,66,67,77,76,67,68,78,77,68,69,79,78,69,60,70,79,80,81,91,90,81,82,92,91,82,83,93,92,83,84,94,93,84,85,95,94,85,86,96,95,86,87,97,96,87,88,98,97,88,89,99,98,89,80,90,99,100,101,111,110,101,102,112,111,102,103,113,112,103,104,114,113,104,105,115,114,105,106,116,115,106,107,117,116,107,108,118,117,108,109,119,118,109,100,110,119,120,121,131,130,121,122,132,131,122,123,133,132,123,124,134,133,124,125,135,134,125,126,136,135,126,127,137,136,127,128,138,137,128,129,139,138,129,120,130,139,140,141,151,150,141,142,152,151,142,143,153,152,143,144,154,153,144,145,155,154,145,146,156,155,146,147,157,156,147,148,158,157,148,149,159,158,149,140,150,159,160,161,171,170,161,162,172,171,162,163,173,172,163,164,174,173,164,165,175,174,165,166,176,175,166,167,177,176,167,168,178,177,168,169,179,178,169,160,170,179,180,181,191,190,181,182,192,191,182,183,193,192,183,184,194,193,184,185,195,194,185,186,196,195,186,187,197,196,187,188,198,197,188,189,199,198,189,180,190,199,200,201,211,210,201,202,212,211,202,203,213,212,203,204,214,213,204,205,215,214,205,206,216,215,206,207,217,216,207,208,218,217,208,209,219,218,209,200,210,219,220,221,231,230,221,222,232,231,222,223,233,232,223,224,234,233,224,225,235,234,225,226,236,235,226,227,237,236,227,228,238,237,228,229,239,238,229,220,230,239,240,241,251,250,241,242,252,251,242,243,253,252,243,244,254,253,244,245,255,254,245,246,256,255,246,247,257,256,247,248,258,257,248,249,259,258,249,240,250,259,260,261,271,270,261,262,272,271,262,263,273,272,263,264,274,273,264,265,275,274,265,266,276,275,266,267,277,276,267,268,278,277,268,269,279,278,269,260,270,279,280,281,291,290,281,282,292,291,282,283,293,292,283,284,294,293,284,285,295,294,285,286,296,295,286,287,297,296,287,288,298,297,288,289,299,298,289,280,290,299,300,301,311,310,301,302,312,311,302,303,313,312,303,304,314,313,304,305,315,314,305,306,316,315,306,307,317,316,307,308,318,317,308,309,319,318,309,300,310,319,320,321,331,330,321,322,332,331,322,323,333,332,323,324,334,333,324,325,335,334,325,326,336,335,326,327,337,336,327,328,338,337,328,329,339,338,329,320,330,339,340,341,351,350,341,342,352,351,342,343,353,352,343,344,354,353,344,345,355,354,345,346,356,355,346,347,357,356,347,348,358,357,348,349,359,358,349,340,350,359,360,361,371,370,361,362,372,371,362,363,373,372,363,364,374,373,364,365,375,374,365,366,376,375,366,367,377,376,367,368,378,377,368,369,379,378,369,360,370,379,380,381,391,390,381,382,392,391,382,383,393,392,383,384,394,393,384,385,395,394,385,386,396,395,386,387,397,396,387,388,398,397,388,389,399,398,389,380,390,399]},{"id":"battery-bms","explode":[0,0,0],"internal":true,"v":[0.1278,0.3974,0.03,0.2558,0.503,0.03,0.2202,0.5462,0.03,0.0922,0.4406,0.03,0.142,0.4236,0.03,0.1575,0.4364,0.03,0.1485,0.4472,0.03,0.1331,0.4344,0.03,0.1634,0.4412,0.03,0.1788,0.454,0.03,0.1699,0.4648,0.03,0.1544,0.452,0.03,0.1847,0.4588,0.03,0.2001,0.4716,0.03,0.1912,0.4824,0.03,0.1758,0.4696,0.03,0.206,0.4764,0.03,0.2215,0.4892,0.03,0.2125,0.5,0.03,0.1971,0.4872,0.03,0.2274,0.494,0.03,0.2428,0.5068,0.03,0.2339,0.5176,0.03,0.2184,0.5048,0.03],"e":[0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,8,9,9,10,10,11,11,8,12,13,13,14,14,15,15,12,16,17,17,18,18,19,19,16,20,21,21,22,22,23,23,20],"q":[0,1,2,3]}]},{"id":"motor","anchor":[-0.56,0.35,0.045],"center":[-0.56,0.35,0.06],"pieces":[{"id":"motor-capL","explode":[0,0,-0.11],"v":[-0.655,0.35,-0.035,-0.6532,0.3315,-0.035,-0.6478,0.3136,-0.035,-0.639,0.2972,-0.035,-0.6272,0.2828,-0.035,-0.6128,0.271,-0.035,-0.5964,0.2622,-0.035,-0.5785,0.2568,-0.035,-0.56,0.255,-0.035,-0.5415,0.2568,-0.035,-0.5236,0.2622,-0.035,-0.5072,0.271,-0.035,-0.4928,0.2828,-0.035,-0.481,0.2972,-0.035,-0.4722,0.3136,-0.035,-0.4668,0.3315,-0.035,-0.465,0.35,-0.035,-0.4668,0.3685,-0.035,-0.4722,0.3864,-0.035,-0.481,0.4028,-0.035,-0.4928,0.4172,-0.035,-0.5072,0.429,-0.035,-0.5236,0.4378,-0.035,-0.5415,0.4432,-0.035,-0.56,0.445,-0.035,-0.5785,0.4432,-0.035,-0.5964,0.4378,-0.035,-0.6128,0.429,-0.035,-0.6272,0.4172,-0.035,-0.639,0.4028,-0.035,-0.6478,0.3864,-0.035,-0.6532,0.3685,-0.035,-0.64,0.35,-0.035,-0.6385,0.3344,-0.035,-0.6339,0.3194,-0.035,-0.6265,0.3056,-0.035,-0.6166,0.2934,-0.035,-0.6044,0.2835,-0.035,-0.5906,0.2761,-0.035,-0.5756,0.2715,-0.035,-0.56,0.27,-0.035,-0.5444,0.2715,-0.035,-0.5294,0.2761,-0.035,-0.5156,0.2835,-0.035,-0.5034,0.2934,-0.035,-0.4935,0.3056,-0.035,-0.4861,0.3194,-0.035,-0.4815,0.3344,-0.035,-0.48,0.35,-0.035,-0.4815,0.3656,-0.035,-0.4861,0.3806,-0.035,-0.4935,0.3944,-0.035,-0.5034,0.4066,-0.035,-0.5156,0.4165,-0.035,-0.5294,0.4239,-0.035,-0.5444,0.4285,-0.035,-0.56,0.43,-0.035,-0.5756,0.4285,-0.035,-0.5906,0.4239,-0.035,-0.6044,0.4165,-0.035,-0.6166,0.4066,-0.035,-0.6265,0.3944,-0.035,-0.6339,0.3806,-0.035,-0.6385,0.3656,-0.035,-0.6,0.35,-0.035,-0.5992,0.3422,-0.035,-0.597,0.3347,-0.035,-0.5933,0.3278,-0.035,-0.5883,0.3217,-0.035,-0.5822,0.3167,-0.035,-0.5753,0.313,-0.035,-0.5678,0.3108,-0.035,-0.56,0.31,-0.035,-0.5522,0.3108,-0.035,-0.5447,0.313,-0.035,-0.5378,0.3167,-0.035,-0.5317,0.3217,-0.035,-0.5267,0.3278,-0.035,-0.523,0.3347,-0.035,-0.5208,0.3422,-0.035,-0.52,0.35,-0.035,-0.5208,0.3578,-0.035,-0.523,0.3653,-0.035,-0.5267,0.3722,-0.035,-0.5317,0.3783,-0.035,-0.5378,0.3833,-0.035,-0.5447,0.387,-0.035,-0.5522,0.3892,-0.035,-0.56,0.39,-0.035,-0.5678,0.3892,-0.035,-0.5753,0.387,-0.035,-0.5822,0.3833,-0.035,-0.5883,0.3783,-0.035,-0.5933,0.3722,-0.035,-0.597,0.3653,-0.035,-0.5992,0.3578,-0.035,-0.575,0.35,-0.035,-0.5747,0.3471,-0.035,-0.5739,0.3443,-0.035,-0.5725,0.3417,-0.035,-0.5706,0.3394,-0.035,-0.5683,0.3375,-0.035,-0.5657,0.3361,-0.035,-0.5629,0.3353,-0.035,-0.56,0.335,-0.035,-0.5571,0.3353,-0.035,-0.5543,0.3361,-0.035,-0.5517,0.3375,-0.035,-0.5494,0.3394,-0.035,-0.5475,0.3417,-0.035,-0.5461,0.3443,-0.035,-0.5453,0.3471,-0.035,-0.545,0.35,-0.035,-0.5453,0.3529,-0.035,-0.5461,0.3557,-0.035,-0.5475,0.3583,-0.035,-0.5494,0.3606,-0.035,-0.5517,0.3625,-0.035,-0.5543,0.3639,-0.035,-0.5571,0.3647,-0.035,-0.56,0.365,-0.035,-0.5629,0.3647,-0.035,-0.5657,0.3639,-0.035,-0.5683,0.3625,-0.035,-0.5706,0.3606,-0.035,-0.5725,0.3583,-0.035,-0.5739,0.3557,-0.035,-0.5747,0.3529,-0.035,-0.652,0.35,-0.047,-0.6502,0.3321,-0.047,-0.645,0.3148,-0.047,-0.6365,0.2989,-0.047,-0.6251,0.2849,-0.047,-0.6111,0.2735,-0.047,-0.5952,0.265,-0.047,-0.5779,0.2598,-0.047,-0.56,0.258,-0.047,-0.5421,0.2598,-0.047,-0.5248,0.265,-0.047,-0.5089,0.2735,-0.047,-0.4949,0.2849,-0.047,-0.4835,0.2989,-0.047,-0.475,0.3148,-0.047,-0.4698,0.3321,-0.047,-0.468,0.35,-0.047,-0.4698,0.3679,-0.047,-0.475,0.3852,-0.047,-0.4835,0.4011,-0.047,-0.4949,0.4151,-0.047,-0.5089,0.4265,-0.047,-0.5248,0.435,-0.047,-0.5421,0.4402,-0.047,-0.56,0.442,-0.047,-0.5779,0.4402,-0.047,-0.5952,0.435,-0.047,-0.6111,0.4265,-0.047,-0.6251,0.4151,-0.047,-0.6365,0.4011,-0.047,-0.645,0.3852,-0.047,-0.6502,0.3679,-0.047,-0.655,0.35,-0.035,-0.6532,0.3315,-0.035,-0.6478,0.3136,-0.035,-0.639,0.2972,-0.035,-0.6272,0.2828,-0.035,-0.6128,0.271,-0.035,-0.5964,0.2622,-0.035,-0.5785,0.2568,-0.035,-0.56,0.255,-0.035,-0.5415,0.2568,-0.035,-0.5236,0.2622,-0.035,-0.5072,0.271,-0.035,-0.4928,0.2828,-0.035,-0.481,0.2972,-0.035,-0.4722,0.3136,-0.035,-0.4668,0.3315,-0.035,-0.465,0.35,-0.035,-0.4668,0.3685,-0.035,-0.4722,0.3864,-0.035,-0.481,0.4028,-0.035,-0.4928,0.4172,-0.035,-0.5072,0.429,-0.035,-0.5236,0.4378,-0.035,-0.5415,0.4432,-0.035,-0.56,0.445,-0.035,-0.5785,0.4432,-0.035,-0.5964,0.4378,-0.035,-0.6128,0.429,-0.035,-0.6272,0.4172,-0.035,-0.639,0.4028,-0.035,-0.6478,0.3864,-0.035,-0.6532,0.3685,-0.035,-0.504,0.346,-0.042,-0.496,0.346,-0.042,-0.504,0.354,-0.042,-0.496,0.354,-0.042,-0.504,0.346,-0.036,-0.496,0.346,-0.036,-0.504,0.354,-0.036,-0.496,0.354,-0.036,-0.534,0.398,-0.042,-0.526,0.398,-0.042,-0.534,0.406,-0.042,-0.526,0.406,-0.042,-0.534,0.398,-0.036,-0.526,0.398,-0.036,-0.534,0.406,-0.036,-0.526,0.406,-0.036,-0.594,0.398,-0.042,-0.586,0.398,-0.042,-0.594,0.406,-0.042,-0.586,0.406,-0.042,-0.594,0.398,-0.036,-0.586,0.398,-0.036,-0.594,0.406,-0.036,-0.586,0.406,-0.036,-0.624,0.346,-0.042,-0.616,0.346,-0.042,-0.624,0.354,-0.042,-0.616,0.354,-0.042,-0.624,0.346,-0.036,-0.616,0.346,-0.036,-0.624,0.354,-0.036,-0.616,0.354,-0.036,-0.594,0.294,-0.042,-0.586,0.294,-0.042,-0.594,0.302,-0.042,-0.586,0.302,-0.042,-0.594,0.294,-0.036,-0.586,0.294,-0.036,-0.594,0.302,-0.036,-0.586,0.302,-0.036,-0.534,0.294,-0.042,-0.526,0.294,-0.042,-0.534,0.302,-0.042,-0.526,0.302,-0.042,-0.534,0.294,-0.036,-0.526,0.294,-0.036,-0.534,0.302,-0.036,-0.526,0.302,-0.036],"e":[0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,30,30,31,31,0,32,33,33,34,34,35,35,36,36,37,37,38,38,39,39,40,40,41,41,42,42,43,43,44,44,45,45,46,46,47,47,48,48,49,49,50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57,58,58,59,59,60,60,61,61,62,62,63,63,32,64,65,65,66,66,67,67,68,68,69,69,70,70,71,71,72,72,73,73,74,74,75,75,76,76,77,77,78,78,79,79,80,80,81,81,82,82,83,83,84,84,85,85,86,86,87,87,88,88,89,89,90,90,91,91,92,92,93,93,94,94,95,95,64,96,97,97,98,98,99,99,100,100,101,101,102,102,103,103,104,104,105,105,106,106,107,107,108,108,109,109,110,110,111,111,112,112,113,113,114,114,115,115,116,116,117,117,118,118,119,119,120,120,121,121,122,122,123,123,124,124,125,125,126,126,127,127,96,0,32,4,36,8,40,12,44,16,48,20,52,24,56,28,60,32,64,36,68,40,72,44,76,48,80,52,84,56,88,60,92,64,96,68,100,72,104,76,108,80,112,84,116,88,120,92,124,128,129,129,130,130,131,131,132,132,133,133,134,134,135,135,136,136,137,137,138,138,139,139,140,140,141,141,142,142,143,143,144,144,145,145,146,146,147,147,148,148,149,149,150,150,151,151,152,152,153,153,154,154,155,155,156,156,157,157,158,158,159,159,128,160,161,161,162,162,163,163,164,164,165,165,166,166,167,167,168,168,169,169,170,170,171,171,172,172,173,173,174,174,175,175,176,176,177,177,178,178,179,179,180,180,181,181,182,182,183,183,184,184,185,185,186,186,187,187,188,188,189,189,190,190,191,191,160,160,128,164,132,168,136,172,140,176,144,180,148,184,152,188,156,192,193,194,195,196,197,198,199,192,194,193,195,196,198,197,199,192,196,193,197,194,198,195,199,200,201,202,203,204,205,206,207,200,202,201,203,204,206,205,207,200,204,201,205,202,206,203,207,208,209,210,211,212,213,214,215,208,210,209,211,212,214,213,215,208,212,209,213,210,214,211,215,216,217,218,219,220,221,222,223,216,218,217,219,220,222,221,223,216,220,217,221,218,222,219,223,224,225,226,227,228,229,230,231,224,226,225,227,228,230,229,231,224,228,225,229,226,230,227,231,232,233,234,235,236,237,238,239,232,234,233,235,236,238,237,239,232,236,233,237,234,238,235,239],"q":[0,1,33,32,1,2,34,33,2,3,35,34,3,4,36,35,4,5,37,36,5,6,38,37,6,7,39,38,7,8,40,39,8,9,41,40,9,10,42,41,10,11,43,42,11,12,44,43,12,13,45,44,13,14,46,45,14,15,47,46,15,16,48,47,16,17,49,48,17,18,50,49,18,19,51,50,19,20,52,51,20,21,53,52,21,22,54,53,22,23,55,54,23,24,56,55,24,25,57,56,25,26,58,57,26,27,59,58,27,28,60,59,28,29,61,60,29,30,62,61,30,31,63,62,31,0,32,63,32,33,65,64,33,34,66,65,34,35,67,66,35,36,68,67,36,37,69,68,37,38,70,69,38,39,71,70,39,40,72,71,40,41,73,72,41,42,74,73,42,43,75,74,43,44,76,75,44,45,77,76,45,46,78,77,46,47,79,78,47,48,80,79,48,49,81,80,49,50,82,81,50,51,83,82,51,52,84,83,52,53,85,84,53,54,86,85,54,55,87,86,55,56,88,87,56,57,89,88,57,58,90,89,58,59,91,90,59,60,92,91,60,61,93,92,61,62,94,93,62,63,95,94,63,32,64,95,64,65,97,96,65,66,98,97,66,67,99,98,67,68,100,99,68,69,101,100,69,70,102,101,70,71,103,102,71,72,104,103,72,73,105,104,73,74,106,105,74,75,107,106,75,76,108,107,76,77,109,108,77,78,110,109,78,79,111,110,79,80,112,111,80,81,113,112,81,82,114,113,82,83,115,114,83,84,116,115,84,85,117,116,85,86,118,117,86,87,119,118,87,88,120,119,88,89,121,120,89,90,122,121,90,91,123,122,91,92,124,123,92,93,125,124,93,94,126,125,94,95,127,126,95,64,96,127,160,161,129,128,161,162,130,129,162,163,131,130,163,164,132,131,164,165,133,132,165,166,134,133,166,167,135,134,167,168,136,135,168,169,137,136,169,170,138,137,170,171,139,138,171,172,140,139,172,173,141,140,173,174,142,141,174,175,143,142,175,176,144,143,176,177,145,144,177,178,146,145,178,179,147,146,179,180,148,147,180,181,149,148,181,182,150,149,182,183,151,150,183,184,152,151,184,185,153,152,185,186,154,153,186,187,155,154,187,188,156,155,188,189,157,156,189,190,158,157,190,191,159,158,191,160,128,159,192,193,195,194,196,197,199,198,192,193,197,196,194,195,199,198,192,194,198,196,193,195,199,197,200,201,203,202,204,205,207,206,200,201,205,204,202,203,207,206,200,202,206,204,201,203,207,205,208,209,211,210,212,213,215,214,208,209,213,212,210,211,215,214,208,210,214,212,209,211,215,213,216,217,219,218,220,221,223,222,216,217,221,220,218,219,223,222,216,218,222,220,217,219,223,221,224,225,227,226,228,229,231,230,224,225,229,228,226,227,231,230,224,226,230,228,225,227,231,229,232,233,235,234,236,237,239,238,232,233,237,236,234,235,239,238,232,234,238,236,233,235,239,237]},{"id":"motor-rotor","explode":[0,0,0.1],"axis":{"c":[-0.56,0.35,0],"d":[0,0,1]},"internal":true,"v":[-0.648,0.35,-0.025,-0.6472,0.3385,-0.025,-0.645,0.3272,-0.025,-0.6413,0.3163,-0.025,-0.6362,0.306,-0.025,-0.6298,0.2964,-0.025,-0.6222,0.2878,-0.025,-0.6136,0.2802,-0.025,-0.604,0.2738,-0.025,-0.5937,0.2687,-0.025,-0.5828,0.265,-0.025,-0.5715,0.2628,-0.025,-0.56,0.262,-0.025,-0.5485,0.2628,-0.025,-0.5372,0.265,-0.025,-0.5263,0.2687,-0.025,-0.516,0.2738,-0.025,-0.5064,0.2802,-0.025,-0.4978,0.2878,-0.025,-0.4902,0.2964,-0.025,-0.4838,0.306,-0.025,-0.4787,0.3163,-0.025,-0.475,0.3272,-0.025,-0.4728,0.3385,-0.025,-0.472,0.35,-0.025,-0.4728,0.3615,-0.025,-0.475,0.3728,-0.025,-0.4787,0.3837,-0.025,-0.4838,0.394,-0.025,-0.4902,0.4036,-0.025,-0.4978,0.4122,-0.025,-0.5064,0.4198,-0.025,-0.516,0.4262,-0.025,-0.5263,0.4313,-0.025,-0.5372,0.435,-0.025,-0.5485,0.4372,-0.025,-0.56,0.438,-0.025,-0.5715,0.4372,-0.025,-0.5828,0.435,-0.025,-0.5937,0.4313,-0.025,-0.604,0.4262,-0.025,-0.6136,0.4198,-0.025,-0.6222,0.4122,-0.025,-0.6298,0.4036,-0.025,-0.6362,0.394,-0.025,-0.6413,0.3837,-0.025,-0.645,0.3728,-0.025,-0.6472,0.3615,-0.025,-0.648,0.35,0.025,-0.6472,0.3385,0.025,-0.645,0.3272,0.025,-0.6413,0.3163,0.025,-0.6362,0.306,0.025,-0.6298,0.2964,0.025,-0.6222,0.2878,0.025,-0.6136,0.2802,0.025,-0.604,0.2738,0.025,-0.5937,0.2687,0.025,-0.5828,0.265,0.025,-0.5715,0.2628,0.025,-0.56,0.262,0.025,-0.5485,0.2628,0.025,-0.5372,0.265,0.025,-0.5263,0.2687,0.025,-0.516,0.2738,0.025,-0.5064,0.2802,0.025,-0.4978,0.2878,0.025,-0.4902,0.2964,0.025,-0.4838,0.306,0.025,-0.4787,0.3163,0.025,-0.475,0.3272,0.025,-0.4728,0.3385,0.025,-0.472,0.35,0.025,-0.4728,0.3615,0.025,-0.475,0.3728,0.025,-0.4787,0.3837,0.025,-0.4838,0.394,0.025,-0.4902,0.4036,0.025,-0.4978,0.4122,0.025,-0.5064,0.4198,0.025,-0.516,0.4262,0.025,-0.5263,0.4313,0.025,-0.5372,0.435,0.025,-0.5485,0.4372,0.025,-0.56,0.438,0.025,-0.5715,0.4372,0.025,-0.5828,0.435,0.025,-0.5937,0.4313,0.025,-0.604,0.4262,0.025,-0.6136,0.4198,0.025,-0.6222,0.4122,0.025,-0.6298,0.4036,0.025,-0.6362,0.394,0.025,-0.6413,0.3837,0.025,-0.645,0.3728,0.025,-0.6472,0.3615,0.025,-0.635,0.35,-0.025,-0.6344,0.3402,-0.025,-0.6324,0.3306,-0.025,-0.6293,0.3213,-0.025,-0.625,0.3125,-0.025,-0.6195,0.3043,-0.025,-0.613,0.297,-0.025,-0.6057,0.2905,-0.025,-0.5975,0.285,-0.025,-0.5887,0.2807,-0.025,-0.5794,0.2776,-0.025,-0.5698,0.2756,-0.025,-0.56,0.275,-0.025,-0.5502,0.2756,-0.025,-0.5406,0.2776,-0.025,-0.5313,0.2807,-0.025,-0.5225,0.285,-0.025,-0.5143,0.2905,-0.025,-0.507,0.297,-0.025,-0.5005,0.3043,-0.025,-0.495,0.3125,-0.025,-0.4907,0.3213,-0.025,-0.4876,0.3306,-0.025,-0.4856,0.3402,-0.025,-0.485,0.35,-0.025,-0.4856,0.3598,-0.025,-0.4876,0.3694,-0.025,-0.4907,0.3787,-0.025,-0.495,0.3875,-0.025,-0.5005,0.3957,-0.025,-0.507,0.403,-0.025,-0.5143,0.4095,-0.025,-0.5225,0.415,-0.025,-0.5313,0.4193,-0.025,-0.5406,0.4224,-0.025,-0.5502,0.4244,-0.025,-0.56,0.425,-0.025,-0.5698,0.4244,-0.025,-0.5794,0.4224,-0.025,-0.5887,0.4193,-0.025,-0.5975,0.415,-0.025,-0.6057,0.4095,-0.025,-0.613,0.403,-0.025,-0.6195,0.3957,-0.025,-0.625,0.3875,-0.025,-0.6293,0.3787,-0.025,-0.6324,0.3694,-0.025,-0.6344,0.3598,-0.025,-0.635,0.35,0.025,-0.6344,0.3402,0.025,-0.6324,0.3306,0.025,-0.6293,0.3213,0.025,-0.625,0.3125,0.025,-0.6195,0.3043,0.025,-0.613,0.297,0.025,-0.6057,0.2905,0.025,-0.5975,0.285,0.025,-0.5887,0.2807,0.025,-0.5794,0.2776,0.025,-0.5698,0.2756,0.025,-0.56,0.275,0.025,-0.5502,0.2756,0.025,-0.5406,0.2776,0.025,-0.5313,0.2807,0.025,-0.5225,0.285,0.025,-0.5143,0.2905,0.025,-0.507,0.297,0.025,-0.5005,0.3043,0.025,-0.495,0.3125,0.025,-0.4907,0.3213,0.025,-0.4876,0.3306,0.025,-0.4856,0.3402,0.025,-0.485,0.35,0.025,-0.4856,0.3598,0.025,-0.4876,0.3694,0.025,-0.4907,0.3787,0.025,-0.495,0.3875,0.025,-0.5005,0.3957,0.025,-0.507,0.403,0.025,-0.5143,0.4095,0.025,-0.5225,0.415,0.025,-0.5313,0.4193,0.025,-0.5406,0.4224,0.025,-0.5502,0.4244,0.025,-0.56,0.425,0.025,-0.5698,0.4244,0.025,-0.5794,0.4224,0.025,-0.5887,0.4193,0.025,-0.5975,0.415,0.025,-0.6057,0.4095,0.025,-0.613,0.403,0.025,-0.6195,0.3957,0.025,-0.625,0.3875,0.025,-0.6293,0.3787,0.025,-0.6324,0.3694,0.025,-0.6344,0.3598,0.025,-0.485,0.35,0.025,-0.472,0.35,0.025,-0.4731,0.3638,0.025,-0.4859,0.3617,0.025,-0.4869,0.3667,0.025,-0.4742,0.3696,0.025,-0.4783,0.3828,0.025,-0.4904,0.3779,0.025,-0.4924,0.3825,0.025,-0.4807,0.3882,0.025,-0.4877,0.4001,0.025,-0.4983,0.3927,0.025,-0.5014,0.3968,0.025,-0.4912,0.4049,0.025,-0.5006,0.415,0.025,-0.5094,0.4054,0.025,-0.5132,0.4086,0.025,-0.5051,0.4188,0.025,-0.5166,0.4265,0.025,-0.523,0.4152,0.025,-0.5275,0.4176,0.025,-0.5218,0.4293,0.025,-0.5347,0.4343,0.025,-0.5384,0.4218,0.025,-0.5433,0.4231,0.025,-0.5404,0.4358,0.025,-0.5541,0.4378,0.025,-0.555,0.4248,0.025,-0.56,0.425,0.025,-0.56,0.438,0.025,-0.5738,0.4369,0.025,-0.5717,0.4241,0.025,-0.5767,0.4231,0.025,-0.5796,0.4358,0.025,-0.5928,0.4317,0.025,-0.5879,0.4196,0.025,-0.5925,0.4176,0.025,-0.5982,0.4293,0.025,-0.6101,0.4223,0.025,-0.6027,0.4117,0.025,-0.6068,0.4086,0.025,-0.6149,0.4188,0.025,-0.625,0.4094,0.025,-0.6154,0.4006,0.025,-0.6186,0.3968,0.025,-0.6288,0.4049,0.025,-0.6365,0.3934,0.025,-0.6252,0.387,0.025,-0.6276,0.3825,0.025,-0.6393,0.3882,0.025,-0.6443,0.3753,0.025,-0.6318,0.3716,0.025,-0.6331,0.3667,0.025,-0.6458,0.3696,0.025,-0.6478,0.3559,0.025,-0.6348,0.355,0.025,-0.635,0.35,0.025,-0.648,0.35,0.025,-0.6469,0.3362,0.025,-0.6341,0.3383,0.025,-0.6331,0.3333,0.025,-0.6458,0.3304,0.025,-0.6417,0.3172,0.025,-0.6296,0.3221,0.025,-0.6276,0.3175,0.025,-0.6393,0.3118,0.025,-0.6323,0.2999,0.025,-0.6217,0.3073,0.025,-0.6186,0.3032,0.025,-0.6288,0.2951,0.025,-0.6194,0.285,0.025,-0.6106,0.2946,0.025,-0.6068,0.2914,0.025,-0.6149,0.2812,0.025,-0.6034,0.2735,0.025,-0.597,0.2848,0.025,-0.5925,0.2824,0.025,-0.5982,0.2707,0.025,-0.5853,0.2657,0.025,-0.5816,0.2782,0.025,-0.5767,0.2769,0.025,-0.5796,0.2642,0.025,-0.5659,0.2622,0.025,-0.565,0.2752,0.025,-0.56,0.275,0.025,-0.56,0.262,0.025,-0.5462,0.2631,0.025,-0.5483,0.2759,0.025,-0.5433,0.2769,0.025,-0.5404,0.2642,0.025,-0.5272,0.2683,0.025,-0.5321,0.2804,0.025,-0.5275,0.2824,0.025,-0.5218,0.2707,0.025,-0.5099,0.2777,0.025,-0.5173,0.2883,0.025,-0.5132,0.2914,0.025,-0.5051,0.2812,0.025,-0.495,0.2906,0.025,-0.5046,0.2994,0.025,-0.5014,0.3032,0.025,-0.4912,0.2951,0.025,-0.4835,0.3066,0.025,-0.4948,0.313,0.025,-0.4924,0.3175,0.025,-0.4807,0.3118,0.025,-0.4757,0.3247,0.025,-0.4882,0.3284,0.025,-0.4869,0.3333,0.025,-0.4742,0.3304,0.025,-0.4722,0.3441,0.025,-0.4852,0.345,0.025],"e":[0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,30,30,31,31,32,32,33,33,34,34,35,35,36,36,37,37,38,38,39,39,40,40,41,41,42,42,43,43,44,44,45,45,46,46,47,47,0,48,49,49,50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57,58,58,59,59,60,60,61,61,62,62,63,63,64,64,65,65,66,66,67,67,68,68,69,69,70,70,71,71,72,72,73,73,74,74,75,75,76,76,77,77,78,78,79,79,80,80,81,81,82,82,83,83,84,84,85,85,86,86,87,87,88,88,89,89,90,90,91,91,92,92,93,93,94,94,95,95,48,0,48,4,52,8,56,12,60,16,64,20,68,24,72,28,76,32,80,36,84,40,88,44,92,96,97,97,98,98,99,99,100,100,101,101,102,102,103,103,104,104,105,105,106,106,107,107,108,108,109,109,110,110,111,111,112,112,113,113,114,114,115,115,116,116,117,117,118,118,119,119,120,120,121,121,122,122,123,123,124,124,125,125,126,126,127,127,128,128,129,129,130,130,131,131,132,132,133,133,134,134,135,135,136,136,137,137,138,138,139,139,140,140,141,141,142,142,143,143,96,144,145,145,146,146,147,147,148,148,149,149,150,150,151,151,152,152,153,153,154,154,155,155,156,156,157,157,158,158,159,159,160,160,161,161,162,162,163,163,164,164,165,165,166,166,167,167,168,168,169,169,170,170,171,171,172,172,173,173,174,174,175,175,176,176,177,177,178,178,179,179,180,180,181,181,182,182,183,183,184,184,185,185,186,186,187,187,188,188,189,189,190,190,191,191,144,96,144,100,148,104,152,108,156,112,160,116,164,120,168,124,172,128,176,132,180,136,184,140,188,192,193,193,194,194,195,195,192,196,197,197,198,198,199,199,196,200,201,201,202,202,203,203,200,204,205,205,206,206,207,207,204,208,209,209,210,210,211,211,208,212,213,213,214,214,215,215,212,216,217,217,218,218,219,219,216,220,221,221,222,222,223,223,220,224,225,225,226,226,227,227,224,228,229,229,230,230,231,231,228,232,233,233,234,234,235,235,232,236,237,237,238,238,239,239,236,240,241,241,242,242,243,243,240,244,245,245,246,246,247,247,244,248,249,249,250,250,251,251,248,252,253,253,254,254,255,255,252,256,257,257,258,258,259,259,256,260,261,261,262,262,263,263,260,264,265,265,266,266,267,267,264,268,269,269,270,270,271,271,268,272,273,273,274,274,275,275,272,276,277,277,278,278,279,279,276,280,281,281,282,282,283,283,280,284,285,285,286,286,287,287,284,288,289,289,290,290,291,291,288,292,293,293,294,294,295,295,292,296,297,297,298,298,299,299,296,300,301,301,302,302,303,303,300],"q":[0,1,49,48,1,2,50,49,2,3,51,50,3,4,52,51,4,5,53,52,5,6,54,53,6,7,55,54,7,8,56,55,8,9,57,56,9,10,58,57,10,11,59,58,11,12,60,59,12,13,61,60,13,14,62,61,14,15,63,62,15,16,64,63,16,17,65,64,17,18,66,65,18,19,67,66,19,20,68,67,20,21,69,68,21,22,70,69,22,23,71,70,23,24,72,71,24,25,73,72,25,26,74,73,26,27,75,74,27,28,76,75,28,29,77,76,29,30,78,77,30,31,79,78,31,32,80,79,32,33,81,80,33,34,82,81,34,35,83,82,35,36,84,83,36,37,85,84,37,38,86,85,38,39,87,86,39,40,88,87,40,41,89,88,41,42,90,89,42,43,91,90,43,44,92,91,44,45,93,92,45,46,94,93,46,47,95,94,47,0,48,95,96,97,145,144,97,98,146,145,98,99,147,146,99,100,148,147,100,101,149,148,101,102,150,149,102,103,151,150,103,104,152,151,104,105,153,152,105,106,154,153,106,107,155,154,107,108,156,155,108,109,157,156,109,110,158,157,110,111,159,158,111,112,160,159,112,113,161,160,113,114,162,161,114,115,163,162,115,116,164,163,116,117,165,164,117,118,166,165,118,119,167,166,119,120,168,167,120,121,169,168,121,122,170,169,122,123,171,170,123,124,172,171,124,125,173,172,125,126,174,173,126,127,175,174,127,128,176,175,128,129,177,176,129,130,178,177,130,131,179,178,131,132,180,179,132,133,181,180,133,134,182,181,134,135,183,182,135,136,184,183,136,137,185,184,137,138,186,185,138,139,187,186,139,140,188,187,140,141,189,188,141,142,190,189,142,143,191,190,143,96,144,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303]},{"id":"motor-stator","explode":[0,0,0.2],"axis":{"c":[-0.56,0.35,0],"d":[0,0,1]},"internal":true,"v":[-0.59,0.35,-0.018,-0.5895,0.3448,-0.018,-0.5882,0.3397,-0.018,-0.586,0.335,-0.018,-0.583,0.3307,-0.018,-0.5793,0.327,-0.018,-0.575,0.324,-0.018,-0.5703,0.3218,-0.018,-0.5652,0.3205,-0.018,-0.56,0.32,-0.018,-0.5548,0.3205,-0.018,-0.5497,0.3218,-0.018,-0.545,0.324,-0.018,-0.5407,0.327,-0.018,-0.537,0.3307,-0.018,-0.534,0.335,-0.018,-0.5318,0.3397,-0.018,-0.5305,0.3448,-0.018,-0.53,0.35,-0.018,-0.5305,0.3552,-0.018,-0.5318,0.3603,-0.018,-0.534,0.365,-0.018,-0.537,0.3693,-0.018,-0.5407,0.373,-0.018,-0.545,0.376,-0.018,-0.5497,0.3782,-0.018,-0.5548,0.3795,-0.018,-0.56,0.38,-0.018,-0.5652,0.3795,-0.018,-0.5703,0.3782,-0.018,-0.575,0.376,-0.018,-0.5793,0.373,-0.018,-0.583,0.3693,-0.018,-0.586,0.365,-0.018,-0.5882,0.3603,-0.018,-0.5895,0.3552,-0.018,-0.59,0.35,0.018,-0.5895,0.3448,0.018,-0.5882,0.3397,0.018,-0.586,0.335,0.018,-0.583,0.3307,0.018,-0.5793,0.327,0.018,-0.575,0.324,0.018,-0.5703,0.3218,0.018,-0.5652,0.3205,0.018,-0.56,0.32,0.018,-0.5548,0.3205,0.018,-0.5497,0.3218,0.018,-0.545,0.324,0.018,-0.5407,0.327,0.018,-0.537,0.3307,0.018,-0.534,0.335,0.018,-0.5318,0.3397,0.018,-0.5305,0.3448,0.018,-0.53,0.35,0.018,-0.5305,0.3552,0.018,-0.5318,0.3603,0.018,-0.534,0.365,0.018,-0.537,0.3693,0.018,-0.5407,0.373,0.018,-0.545,0.376,0.018,-0.5497,0.3782,0.018,-0.5548,0.3795,0.018,-0.56,0.38,0.018,-0.5652,0.3795,0.018,-0.5703,0.3782,0.018,-0.575,0.376,0.018,-0.5793,0.373,0.018,-0.583,0.3693,0.018,-0.586,0.365,0.018,-0.5882,0.3603,0.018,-0.5895,0.3552,0.018,-0.53,0.3487,-0.018,-0.5033,0.3475,-0.018,-0.4943,0.3437,-0.018,-0.4943,0.3563,-0.018,-0.5033,0.3525,-0.018,-0.53,0.3513,-0.018,-0.53,0.3487,0.018,-0.5033,0.3475,0.018,-0.4943,0.3437,0.018,-0.4943,0.3563,0.018,-0.5033,0.3525,0.018,-0.53,0.3513,0.018,-0.5166,0.35,0.012,-0.5166,0.3415,0.0085,-0.5166,0.338,0,-0.5166,0.3415,-0.0085,-0.5166,0.35,-0.012,-0.5166,0.3585,-0.0085,-0.5166,0.362,0,-0.5166,0.3585,0.0085,-0.5307,0.3565,-0.018,-0.5046,0.3623,-0.018,-0.4949,0.3609,-0.018,-0.4982,0.3731,-0.018,-0.5059,0.3671,-0.018,-0.5314,0.359,-0.018,-0.5307,0.3565,0.018,-0.5046,0.3623,0.018,-0.4949,0.3609,0.018,-0.4982,0.3731,0.018,-0.5059,0.3671,0.018,-0.5314,0.359,0.018,-0.5181,0.3612,0.012,-0.5159,0.353,0.0085,-0.515,0.3496,0,-0.5159,0.353,-0.0085,-0.5181,0.3612,-0.012,-0.5203,0.3694,-0.0085,-0.5212,0.3728,0,-0.5203,0.3694,0.0085,-0.5334,0.3638,-0.018,-0.5096,0.3762,-0.018,-0.5,0.3774,-0.018,-0.5062,0.3883,-0.018,-0.5121,0.3805,-0.018,-0.5347,0.3661,-0.018,-0.5334,0.3638,0.018,-0.5096,0.3762,0.018,-0.5,0.3774,0.018,-0.5062,0.3883,0.018,-0.5121,0.3805,0.018,-0.5347,0.3661,0.018,-0.5224,0.3717,0.012,-0.5182,0.3643,0.0085,-0.5164,0.3613,0,-0.5182,0.3643,-0.0085,-0.5224,0.3717,-0.012,-0.5267,0.379,-0.0085,-0.5284,0.3821,0,-0.5267,0.379,0.0085,-0.5379,0.3703,-0.018,-0.5181,0.3883,-0.018,-0.5091,0.392,-0.018,-0.518,0.4009,-0.018,-0.5217,0.3919,-0.018,-0.5397,0.3721,-0.018,-0.5379,0.3703,0.018,-0.5181,0.3883,0.018,-0.5091,0.392,0.018,-0.518,0.4009,0.018,-0.5217,0.3919,0.018,-0.5397,0.3721,0.018,-0.5293,0.3807,0.012,-0.5233,0.3747,0.0085,-0.5208,0.3722,0,-0.5233,0.3747,-0.0085,-0.5293,0.3807,-0.012,-0.5353,0.3867,-0.0085,-0.5378,0.3892,0,-0.5353,0.3867,0.0085,-0.5439,0.3753,-0.018,-0.5295,0.3979,-0.018,-0.5217,0.4038,-0.018,-0.5326,0.41,-0.018,-0.5338,0.4004,-0.018,-0.5462,0.3766,-0.018,-0.5439,0.3753,0.018,-0.5295,0.3979,0.018,-0.5217,0.4038,0.018,-0.5326,0.41,0.018,-0.5338,0.4004,0.018,-0.5462,0.3766,0.018,-0.5383,0.3876,0.012,-0.531,0.3833,0.0085,-0.5279,0.3816,0,-0.531,0.3833,-0.0085,-0.5383,0.3876,-0.012,-0.5457,0.3918,-0.0085,-0.5487,0.3936,0,-0.5457,0.3918,0.0085,-0.551,0.3786,-0.018,-0.5429,0.4041,-0.018,-0.5369,0.4118,-0.018,-0.5491,0.4151,-0.018,-0.5477,0.4054,-0.018,-0.5535,0.3793,-0.018,-0.551,0.3786,0.018,-0.5429,0.4041,0.018,-0.5369,0.4118,0.018,-0.5491,0.4151,0.018,-0.5477,0.4054,0.018,-0.5535,0.3793,0.018,-0.5488,0.3919,-0.012,-0.557,0.3941,-0.0085,-0.5604,0.395,0,-0.557,0.3941,0.0085,-0.5488,0.3919,0.012,-0.5406,0.3897,0.0085,-0.5372,0.3888,0,-0.5406,0.3897,-0.0085,-0.5587,0.38,-0.018,-0.5575,0.4067,-0.018,-0.5537,0.4157,-0.018,-0.5663,0.4157,-0.018,-0.5625,0.4067,-0.018,-0.5613,0.38,-0.018,-0.5587,0.38,0.018,-0.5575,0.4067,0.018,-0.5537,0.4157,0.018,-0.5663,0.4157,0.018,-0.5625,0.4067,0.018,-0.5613,0.38,0.018,-0.56,0.3934,-0.012,-0.5685,0.3934,-0.0085,-0.572,0.3934,0,-0.5685,0.3934,0.0085,-0.56,0.3934,0.012,-0.5515,0.3934,0.0085,-0.548,0.3934,0,-0.5515,0.3934,-0.0085,-0.5665,0.3793,-0.018,-0.5723,0.4054,-0.018,-0.5709,0.4151,-0.018,-0.5831,0.4118,-0.018,-0.5771,0.4041,-0.018,-0.569,0.3786,-0.018,-0.5665,0.3793,0.018,-0.5723,0.4054,0.018,-0.5709,0.4151,0.018,-0.5831,0.4118,0.018,-0.5771,0.4041,0.018,-0.569,0.3786,0.018,-0.5712,0.3919,-0.012,-0.5794,0.3897,-0.0085,-0.5828,0.3888,0,-0.5794,0.3897,0.0085,-0.5712,0.3919,0.012,-0.563,0.3941,0.0085,-0.5596,0.395,0,-0.563,0.3941,-0.0085,-0.5738,0.3766,-0.018,-0.5862,0.4004,-0.018,-0.5874,0.41,-0.018,-0.5983,0.4038,-0.018,-0.5905,0.3979,-0.018,-0.5761,0.3753,-0.018,-0.5738,0.3766,0.018,-0.5862,0.4004,0.018,-0.5874,0.41,0.018,-0.5983,0.4038,0.018,-0.5905,0.3979,0.018,-0.5761,0.3753,0.018,-0.5817,0.3876,-0.012,-0.589,0.3833,-0.0085,-0.5921,0.3816,0,-0.589,0.3833,0.0085,-0.5817,0.3876,0.012,-0.5743,0.3918,0.0085,-0.5713,0.3936,0,-0.5743,0.3918,-0.0085,-0.5803,0.3721,-0.018,-0.5983,0.3919,-0.018,-0.602,0.4009,-0.018,-0.6109,0.392,-0.018,-0.6019,0.3883,-0.018,-0.5821,0.3703,-0.018,-0.5803,0.3721,0.018,-0.5983,0.3919,0.018,-0.602,0.4009,0.018,-0.6109,0.392,0.018,-0.6019,0.3883,0.018,-0.5821,0.3703,0.018,-0.5907,0.3807,-0.012,-0.5967,0.3747,-0.0085,-0.5992,0.3722,0,-0.5967,0.3747,0.0085,-0.5907,0.3807,0.012,-0.5847,0.3867,0.0085,-0.5822,0.3892,0,-0.5847,0.3867,-0.0085,-0.5853,0.3661,-0.018,-0.6079,0.3805,-0.018,-0.6138,0.3883,-0.018,-0.62,0.3774,-0.018,-0.6104,0.3762,-0.018,-0.5866,0.3638,-0.018,-0.5853,0.3661,0.018,-0.6079,0.3805,0.018,-0.6138,0.3883,0.018,-0.62,0.3774,0.018,-0.6104,0.3762,0.018,-0.5866,0.3638,0.018,-0.5976,0.3717,-0.012,-0.6018,0.3643,-0.0085,-0.6036,0.3613,0,-0.6018,0.3643,0.0085,-0.5976,0.3717,0.012,-0.5933,0.379,0.0085,-0.5916,0.3821,0,-0.5933,0.379,-0.0085,-0.5886,0.359,-0.018,-0.6141,0.3671,-0.018,-0.6218,0.3731,-0.018,-0.6251,0.3609,-0.018,-0.6154,0.3623,-0.018,-0.5893,0.3565,-0.018,-0.5886,0.359,0.018,-0.6141,0.3671,0.018,-0.6218,0.3731,0.018,-0.6251,0.3609,0.018,-0.6154,0.3623,0.018,-0.5893,0.3565,0.018,-0.6019,0.3612,-0.012,-0.6041,0.353,-0.0085,-0.605,0.3496,0,-0.6041,0.353,0.0085,-0.6019,0.3612,0.012,-0.5997,0.3694,0.0085,-0.5988,0.3728,0,-0.5997,0.3694,-0.0085,-0.59,0.3513,-0.018,-0.6167,0.3525,-0.018,-0.6257,0.3563,-0.018,-0.6257,0.3437,-0.018,-0.6167,0.3475,-0.018,-0.59,0.3487,-0.018,-0.59,0.3513,0.018,-0.6167,0.3525,0.018,-0.6257,0.3563,0.018,-0.6257,0.3437,0.018,-0.6167,0.3475,0.018,-0.59,0.3487,0.018,-0.6034,0.35,-0.012,-0.6034,0.3415,-0.0085,-0.6034,0.338,0,-0.6034,0.3415,0.0085,-0.6034,0.35,0.012,-0.6034,0.3585,0.0085,-0.6034,0.362,0,-0.6034,0.3585,-0.0085,-0.5893,0.3435,-0.018,-0.6154,0.3377,-0.018,-0.6251,0.3391,-0.018,-0.6218,0.3269,-0.018,-0.6141,0.3329,-0.018,-0.5886,0.341,-0.018,-0.5893,0.3435,0.018,-0.6154,0.3377,0.018,-0.6251,0.3391,0.018,-0.6218,0.3269,0.018,-0.6141,0.3329,0.018,-0.5886,0.341,0.018,-0.6019,0.3388,-0.012,-0.5997,0.3306,-0.0085,-0.5988,0.3272,0,-0.5997,0.3306,0.0085,-0.6019,0.3388,0.012,-0.6041,0.347,0.0085,-0.605,0.3504,0,-0.6041,0.347,-0.0085,-0.5866,0.3362,-0.018,-0.6104,0.3238,-0.018,-0.62,0.3226,-0.018,-0.6138,0.3117,-0.018,-0.6079,0.3195,-0.018,-0.5853,0.3339,-0.018,-0.5866,0.3362,0.018,-0.6104,0.3238,0.018,-0.62,0.3226,0.018,-0.6138,0.3117,0.018,-0.6079,0.3195,0.018,-0.5853,0.3339,0.018,-0.5976,0.3283,-0.012,-0.5933,0.321,-0.0085,-0.5916,0.3179,0,-0.5933,0.321,0.0085,-0.5976,0.3283,0.012,-0.6018,0.3357,0.0085,-0.6036,0.3387,0,-0.6018,0.3357,-0.0085,-0.5821,0.3297,-0.018,-0.6019,0.3117,-0.018,-0.6109,0.308,-0.018,-0.602,0.2991,-0.018,-0.5983,0.3081,-0.018,-0.5803,0.3279,-0.018,-0.5821,0.3297,0.018,-0.6019,0.3117,0.018,-0.6109,0.308,0.018,-0.602,0.2991,0.018,-0.5983,0.3081,0.018,-0.5803,0.3279,0.018,-0.5907,0.3193,-0.012,-0.5847,0.3133,-0.0085,-0.5822,0.3108,0,-0.5847,0.3133,0.0085,-0.5907,0.3193,0.012,-0.5967,0.3253,0.0085,-0.5992,0.3278,0,-0.5967,0.3253,-0.0085,-0.5761,0.3247,-0.018,-0.5905,0.3021,-0.018,-0.5983,0.2962,-0.018,-0.5874,0.29,-0.018,-0.5862,0.2996,-0.018,-0.5738,0.3234,-0.018,-0.5761,0.3247,0.018,-0.5905,0.3021,0.018,-0.5983,0.2962,0.018,-0.5874,0.29,0.018,-0.5862,0.2996,0.018,-0.5738,0.3234,0.018,-0.5817,0.3124,-0.012,-0.5743,0.3082,-0.0085,-0.5713,0.3064,0,-0.5743,0.3082,0.0085,-0.5817,0.3124,0.012,-0.589,0.3167,0.0085,-0.5921,0.3184,0,-0.589,0.3167,-0.0085,-0.569,0.3214,-0.018,-0.5771,0.2959,-0.018,-0.5831,0.2882,-0.018,-0.5709,0.2849,-0.018,-0.5723,0.2946,-0.018,-0.5665,0.3207,-0.018,-0.569,0.3214,0.018,-0.5771,0.2959,0.018,-0.5831,0.2882,0.018,-0.5709,0.2849,0.018,-0.5723,0.2946,0.018,-0.5665,0.3207,0.018,-0.5712,0.3081,0.012,-0.5794,0.3103,0.0085,-0.5828,0.3112,0,-0.5794,0.3103,-0.0085,-0.5712,0.3081,-0.012,-0.563,0.3059,-0.0085,-0.5596,0.305,0,-0.563,0.3059,0.0085,-0.5613,0.32,-0.018,-0.5625,0.2933,-0.018,-0.5663,0.2843,-0.018,-0.5537,0.2843,-0.018,-0.5575,0.2933,-0.018,-0.5587,0.32,-0.018,-0.5613,0.32,0.018,-0.5625,0.2933,0.018,-0.5663,0.2843,0.018,-0.5537,0.2843,0.018,-0.5575,0.2933,0.018,-0.5587,0.32,0.018,-0.56,0.3066,0.012,-0.5685,0.3066,0.0085,-0.572,0.3066,0,-0.5685,0.3066,-0.0085,-0.56,0.3066,-0.012,-0.5515,0.3066,-0.0085,-0.548,0.3066,0,-0.5515,0.3066,0.0085,-0.5535,0.3207,-0.018,-0.5477,0.2946,-0.018,-0.5491,0.2849,-0.018,-0.5369,0.2882,-0.018,-0.5429,0.2959,-0.018,-0.551,0.3214,-0.018,-0.5535,0.3207,0.018,-0.5477,0.2946,0.018,-0.5491,0.2849,0.018,-0.5369,0.2882,0.018,-0.5429,0.2959,0.018,-0.551,0.3214,0.018,-0.5488,0.3081,0.012,-0.557,0.3059,0.0085,-0.5604,0.305,0,-0.557,0.3059,-0.0085,-0.5488,0.3081,-0.012,-0.5406,0.3103,-0.0085,-0.5372,0.3112,0,-0.5406,0.3103,0.0085,-0.5462,0.3234,-0.018,-0.5338,0.2996,-0.018,-0.5326,0.29,-0.018,-0.5217,0.2962,-0.018,-0.5295,0.3021,-0.018,-0.5439,0.3247,-0.018,-0.5462,0.3234,0.018,-0.5338,0.2996,0.018,-0.5326,0.29,0.018,-0.5217,0.2962,0.018,-0.5295,0.3021,0.018,-0.5439,0.3247,0.018,-0.5383,0.3124,0.012,-0.5457,0.3082,0.0085,-0.5487,0.3064,0,-0.5457,0.3082,-0.0085,-0.5383,0.3124,-0.012,-0.531,0.3167,-0.0085,-0.5279,0.3184,0,-0.531,0.3167,0.0085,-0.5397,0.3279,-0.018,-0.5217,0.3081,-0.018,-0.518,0.2991,-0.018,-0.5091,0.308,-0.018,-0.5181,0.3117,-0.018,-0.5379,0.3297,-0.018,-0.5397,0.3279,0.018,-0.5217,0.3081,0.018,-0.518,0.2991,0.018,-0.5091,0.308,0.018,-0.5181,0.3117,0.018,-0.5379,0.3297,0.018,-0.5293,0.3193,0.012,-0.5353,0.3133,0.0085,-0.5378,0.3108,0,-0.5353,0.3133,-0.0085,-0.5293,0.3193,-0.012,-0.5233,0.3253,-0.0085,-0.5208,0.3278,0,-0.5233,0.3253,0.0085,-0.5347,0.3339,-0.018,-0.5121,0.3195,-0.018,-0.5062,0.3117,-0.018,-0.5,0.3226,-0.018,-0.5096,0.3238,-0.018,-0.5334,0.3362,-0.018,-0.5347,0.3339,0.018,-0.5121,0.3195,0.018,-0.5062,0.3117,0.018,-0.5,0.3226,0.018,-0.5096,0.3238,0.018,-0.5334,0.3362,0.018,-0.5224,0.3283,0.012,-0.5267,0.321,0.0085,-0.5284,0.3179,0,-0.5267,0.321,-0.0085,-0.5224,0.3283,-0.012,-0.5182,0.3357,-0.0085,-0.5164,0.3387,0,-0.5182,0.3357,0.0085,-0.5314,0.341,-0.018,-0.5059,0.3329,-0.018,-0.4982,0.3269,-0.018,-0.4949,0.3391,-0.018,-0.5046,0.3377,-0.018,-0.5307,0.3435,-0.018,-0.5314,0.341,0.018,-0.5059,0.3329,0.018,-0.4982,0.3269,0.018,-0.4949,0.3391,0.018,-0.5046,0.3377,0.018,-0.5307,0.3435,0.018,-0.5181,0.3388,0.012,-0.5203,0.3306,0.0085,-0.5212,0.3272,0,-0.5203,0.3306,-0.0085,-0.5181,0.3388,-0.012,-0.5159,0.347,-0.0085,-0.515,0.3504,0,-0.5159,0.347,0.0085,-0.568,0.35,-0.09,-0.5657,0.3443,-0.09,-0.56,0.342,-0.09,-0.5543,0.3443,-0.09,-0.552,0.35,-0.09,-0.5543,0.3557,-0.09,-0.56,0.358,-0.09,-0.5657,0.3557,-0.09,-0.568,0.35,0,-0.5657,0.3443,0,-0.56,0.342,0,-0.5543,0.3443,0,-0.552,0.35,0,-0.5543,0.3557,0,-0.56,0.358,0,-0.5657,0.3557,0,-0.568,0.35,0.09,-0.5657,0.3443,0.09,-0.56,0.342,0.09,-0.5543,0.3443,0.09,-0.552,0.35,0.09,-0.5543,0.3557,0.09,-0.56,0.358,0.09,-0.5657,0.3557,0.09],"e":[0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,30,30,31,31,32,32,33,33,34,34,35,35,0,36,37,37,38,38,39,39,40,40,41,41,42,42,43,43,44,44,45,45,46,46,47,47,48,48,49,49,50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57,58,58,59,59,60,60,61,61,62,62,63,63,64,64,65,65,66,66,67,67,68,68,69,69,70,70,71,71,36,0,36,4,40,8,44,12,48,16,52,20,56,24,60,28,64,32,68,72,73,73,74,74,75,75,76,76,77,78,79,79,80,80,81,81,82,82,83,84,85,85,86,86,87,87,88,88,89,89,90,90,91,91,84,92,93,93,94,94,95,95,96,96,97,98,99,99,100,100,101,101,102,102,103,104,105,105,106,106,107,107,108,108,109,109,110,110,111,111,104,112,113,113,114,114,115,115,116,116,117,118,119,119,120,120,121,121,122,122,123,124,125,125,126,126,127,127,128,128,129,129,130,130,131,131,124,132,133,133,134,134,135,135,136,136,137,138,139,139,140,140,141,141,142,142,143,144,145,145,146,146,147,147,148,148,149,149,150,150,151,151,144,152,153,153,154,154,155,155,156,156,157,158,159,159,160,160,161,161,162,162,163,164,165,165,166,166,167,167,168,168,169,169,170,170,171,171,164,172,173,173,174,174,175,175,176,176,177,178,179,179,180,180,181,181,182,182,183,184,185,185,186,186,187,187,188,188,189,189,190,190,191,191,184,192,193,193,194,194,195,195,196,196,197,198,199,199,200,200,201,201,202,202,203,204,205,205,206,206,207,207,208,208,209,209,210,210,211,211,204,212,213,213,214,214,215,215,216,216,217,218,219,219,220,220,221,221,222,222,223,224,225,225,226,226,227,227,228,228,229,229,230,230,231,231,224,232,233,233,234,234,235,235,236,236,237,238,239,239,240,240,241,241,242,242,243,244,245,245,246,246,247,247,248,248,249,249,250,250,251,251,244,252,253,253,254,254,255,255,256,256,257,258,259,259,260,260,261,261,262,262,263,264,265,265,266,266,267,267,268,268,269,269,270,270,271,271,264,272,273,273,274,274,275,275,276,276,277,278,279,279,280,280,281,281,282,282,283,284,285,285,286,286,287,287,288,288,289,289,290,290,291,291,284,292,293,293,294,294,295,295,296,296,297,298,299,299,300,300,301,301,302,302,303,304,305,305,306,306,307,307,308,308,309,309,310,310,311,311,304,312,313,313,314,314,315,315,316,316,317,318,319,319,320,320,321,321,322,322,323,324,325,325,326,326,327,327,328,328,329,329,330,330,331,331,324,332,333,333,334,334,335,335,336,336,337,338,339,339,340,340,341,341,342,342,343,344,345,345,346,346,347,347,348,348,349,349,350,350,351,351,344,352,353,353,354,354,355,355,356,356,357,358,359,359,360,360,361,361,362,362,363,364,365,365,366,366,367,367,368,368,369,369,370,370,371,371,364,372,373,373,374,374,375,375,376,376,377,378,379,379,380,380,381,381,382,382,383,384,385,385,386,386,387,387,388,388,389,389,390,390,391,391,384,392,393,393,394,394,395,395,396,396,397,398,399,399,400,400,401,401,402,402,403,404,405,405,406,406,407,407,408,408,409,409,410,410,411,411,404,412,413,413,414,414,415,415,416,416,417,418,419,419,420,420,421,421,422,422,423,424,425,425,426,426,427,427,428,428,429,429,430,430,431,431,424,432,433,433,434,434,435,435,436,436,437,438,439,439,440,440,441,441,442,442,443,444,445,445,446,446,447,447,448,448,449,449,450,450,451,451,444,452,453,453,454,454,455,455,456,456,457,458,459,459,460,460,461,461,462,462,463,464,465,465,466,466,467,467,468,468,469,469,470,470,471,471,464,472,473,473,474,474,475,475,476,476,477,478,479,479,480,480,481,481,482,482,483,484,485,485,486,486,487,487,488,488,489,489,490,490,491,491,484,492,493,493,494,494,495,495,496,496,497,498,499,499,500,500,501,501,502,502,503,504,505,505,506,506,507,507,508,508,509,509,510,510,511,511,504,512,513,513,514,514,515,515,516,516,517,518,519,519,520,520,521,521,522,522,523,524,525,525,526,526,527,527,528,528,529,529,530,530,531,531,524,532,533,533,534,534,535,535,536,536,537,538,539,539,540,540,541,541,542,542,543,544,545,545,546,546,547,547,548,548,549,549,550,550,551,551,544,552,553,553,554,554,555,555,556,556,557,557,558,558,559,559,552,560,561,561,562,562,563,563,564,564,565,565,566,566,567,567,560,568,569,569,570,570,571,571,572,572,573,573,574,574,575,575,568,552,560,560,568,554,562,562,570,556,564,564,572,558,566,566,574],"q":[0,1,37,36,1,2,38,37,2,3,39,38,3,4,40,39,4,5,41,40,5,6,42,41,6,7,43,42,7,8,44,43,8,9,45,44,9,10,46,45,10,11,47,46,11,12,48,47,12,13,49,48,13,14,50,49,14,15,51,50,15,16,52,51,16,17,53,52,17,18,54,53,18,19,55,54,19,20,56,55,20,21,57,56,21,22,58,57,22,23,59,58,23,24,60,59,24,25,61,60,25,26,62,61,26,27,63,62,27,28,64,63,28,29,65,64,29,30,66,65,30,31,67,66,31,32,68,67,32,33,69,68,33,34,70,69,34,35,71,70,35,0,36,71,78,79,82,83,79,80,81,82,98,99,102,103,99,100,101,102,118,119,122,123,119,120,121,122,138,139,142,143,139,140,141,142,158,159,162,163,159,160,161,162,178,179,182,183,179,180,181,182,198,199,202,203,199,200,201,202,218,219,222,223,219,220,221,222,238,239,242,243,239,240,241,242,258,259,262,263,259,260,261,262,278,279,282,283,279,280,281,282,298,299,302,303,299,300,301,302,318,319,322,323,319,320,321,322,338,339,342,343,339,340,341,342,358,359,362,363,359,360,361,362,378,379,382,383,379,380,381,382,398,399,402,403,399,400,401,402,418,419,422,423,419,420,421,422,438,439,442,443,439,440,441,442,458,459,462,463,459,460,461,462,478,479,482,483,479,480,481,482,498,499,502,503,499,500,501,502,518,519,522,523,519,520,521,522,538,539,542,543,539,540,541,542,552,553,561,560,553,554,562,561,554,555,563,562,555,556,564,563,556,557,565,564,557,558,566,565,558,559,567,566,559,552,560,567,560,561,569,568,561,562,570,569,562,563,571,570,563,564,572,571,564,565,573,572,565,566,574,573,566,567,575,574,567,560,568,575]},{"id":"motor-capR","explode":[0,0,0.31],"v":[-0.655,0.35,0.035,-0.6532,0.3315,0.035,-0.6478,0.3136,0.035,-0.639,0.2972,0.035,-0.6272,0.2828,0.035,-0.6128,0.271,0.035,-0.5964,0.2622,0.035,-0.5785,0.2568,0.035,-0.56,0.255,0.035,-0.5415,0.2568,0.035,-0.5236,0.2622,0.035,-0.5072,0.271,0.035,-0.4928,0.2828,0.035,-0.481,0.2972,0.035,-0.4722,0.3136,0.035,-0.4668,0.3315,0.035,-0.465,0.35,0.035,-0.4668,0.3685,0.035,-0.4722,0.3864,0.035,-0.481,0.4028,0.035,-0.4928,0.4172,0.035,-0.5072,0.429,0.035,-0.5236,0.4378,0.035,-0.5415,0.4432,0.035,-0.56,0.445,0.035,-0.5785,0.4432,0.035,-0.5964,0.4378,0.035,-0.6128,0.429,0.035,-0.6272,0.4172,0.035,-0.639,0.4028,0.035,-0.6478,0.3864,0.035,-0.6532,0.3685,0.035,-0.64,0.35,0.035,-0.6385,0.3344,0.035,-0.6339,0.3194,0.035,-0.6265,0.3056,0.035,-0.6166,0.2934,0.035,-0.6044,0.2835,0.035,-0.5906,0.2761,0.035,-0.5756,0.2715,0.035,-0.56,0.27,0.035,-0.5444,0.2715,0.035,-0.5294,0.2761,0.035,-0.5156,0.2835,0.035,-0.5034,0.2934,0.035,-0.4935,0.3056,0.035,-0.4861,0.3194,0.035,-0.4815,0.3344,0.035,-0.48,0.35,0.035,-0.4815,0.3656,0.035,-0.4861,0.3806,0.035,-0.4935,0.3944,0.035,-0.5034,0.4066,0.035,-0.5156,0.4165,0.035,-0.5294,0.4239,0.035,-0.5444,0.4285,0.035,-0.56,0.43,0.035,-0.5756,0.4285,0.035,-0.5906,0.4239,0.035,-0.6044,0.4165,0.035,-0.6166,0.4066,0.035,-0.6265,0.3944,0.035,-0.6339,0.3806,0.035,-0.6385,0.3656,0.035,-0.6,0.35,0.035,-0.5992,0.3422,0.035,-0.597,0.3347,0.035,-0.5933,0.3278,0.035,-0.5883,0.3217,0.035,-0.5822,0.3167,0.035,-0.5753,0.313,0.035,-0.5678,0.3108,0.035,-0.56,0.31,0.035,-0.5522,0.3108,0.035,-0.5447,0.313,0.035,-0.5378,0.3167,0.035,-0.5317,0.3217,0.035,-0.5267,0.3278,0.035,-0.523,0.3347,0.035,-0.5208,0.3422,0.035,-0.52,0.35,0.035,-0.5208,0.3578,0.035,-0.523,0.3653,0.035,-0.5267,0.3722,0.035,-0.5317,0.3783,0.035,-0.5378,0.3833,0.035,-0.5447,0.387,0.035,-0.5522,0.3892,0.035,-0.56,0.39,0.035,-0.5678,0.3892,0.035,-0.5753,0.387,0.035,-0.5822,0.3833,0.035,-0.5883,0.3783,0.035,-0.5933,0.3722,0.035,-0.597,0.3653,0.035,-0.5992,0.3578,0.035,-0.575,0.35,0.035,-0.5747,0.3471,0.035,-0.5739,0.3443,0.035,-0.5725,0.3417,0.035,-0.5706,0.3394,0.035,-0.5683,0.3375,0.035,-0.5657,0.3361,0.035,-0.5629,0.3353,0.035,-0.56,0.335,0.035,-0.5571,0.3353,0.035,-0.5543,0.3361,0.035,-0.5517,0.3375,0.035,-0.5494,0.3394,0.035,-0.5475,0.3417,0.035,-0.5461,0.3443,0.035,-0.5453,0.3471,0.035,-0.545,0.35,0.035,-0.5453,0.3529,0.035,-0.5461,0.3557,0.035,-0.5475,0.3583,0.035,-0.5494,0.3606,0.035,-0.5517,0.3625,0.035,-0.5543,0.3639,0.035,-0.5571,0.3647,0.035,-0.56,0.365,0.035,-0.5629,0.3647,0.035,-0.5657,0.3639,0.035,-0.5683,0.3625,0.035,-0.5706,0.3606,0.035,-0.5725,0.3583,0.035,-0.5739,0.3557,0.035,-0.5747,0.3529,0.035,-0.652,0.35,0.047,-0.6502,0.3321,0.047,-0.645,0.3148,0.047,-0.6365,0.2989,0.047,-0.6251,0.2849,0.047,-0.6111,0.2735,0.047,-0.5952,0.265,0.047,-0.5779,0.2598,0.047,-0.56,0.258,0.047,-0.5421,0.2598,0.047,-0.5248,0.265,0.047,-0.5089,0.2735,0.047,-0.4949,0.2849,0.047,-0.4835,0.2989,0.047,-0.475,0.3148,0.047,-0.4698,0.3321,0.047,-0.468,0.35,0.047,-0.4698,0.3679,0.047,-0.475,0.3852,0.047,-0.4835,0.4011,0.047,-0.4949,0.4151,0.047,-0.5089,0.4265,0.047,-0.5248,0.435,0.047,-0.5421,0.4402,0.047,-0.56,0.442,0.047,-0.5779,0.4402,0.047,-0.5952,0.435,0.047,-0.6111,0.4265,0.047,-0.6251,0.4151,0.047,-0.6365,0.4011,0.047,-0.645,0.3852,0.047,-0.6502,0.3679,0.047,-0.655,0.35,0.035,-0.6532,0.3315,0.035,-0.6478,0.3136,0.035,-0.639,0.2972,0.035,-0.6272,0.2828,0.035,-0.6128,0.271,0.035,-0.5964,0.2622,0.035,-0.5785,0.2568,0.035,-0.56,0.255,0.035,-0.5415,0.2568,0.035,-0.5236,0.2622,0.035,-0.5072,0.271,0.035,-0.4928,0.2828,0.035,-0.481,0.2972,0.035,-0.4722,0.3136,0.035,-0.4668,0.3315,0.035,-0.465,0.35,0.035,-0.4668,0.3685,0.035,-0.4722,0.3864,0.035,-0.481,0.4028,0.035,-0.4928,0.4172,0.035,-0.5072,0.429,0.035,-0.5236,0.4378,0.035,-0.5415,0.4432,0.035,-0.56,0.445,0.035,-0.5785,0.4432,0.035,-0.5964,0.4378,0.035,-0.6128,0.429,0.035,-0.6272,0.4172,0.035,-0.639,0.4028,0.035,-0.6478,0.3864,0.035,-0.6532,0.3685,0.035,-0.504,0.346,0.036,-0.496,0.346,0.036,-0.504,0.354,0.036,-0.496,0.354,0.036,-0.504,0.346,0.042,-0.496,0.346,0.042,-0.504,0.354,0.042,-0.496,0.354,0.042,-0.534,0.398,0.036,-0.526,0.398,0.036,-0.534,0.406,0.036,-0.526,0.406,0.036,-0.534,0.398,0.042,-0.526,0.398,0.042,-0.534,0.406,0.042,-0.526,0.406,0.042,-0.594,0.398,0.036,-0.586,0.398,0.036,-0.594,0.406,0.036,-0.586,0.406,0.036,-0.594,0.398,0.042,-0.586,0.398,0.042,-0.594,0.406,0.042,-0.586,0.406,0.042,-0.624,0.346,0.036,-0.616,0.346,0.036,-0.624,0.354,0.036,-0.616,0.354,0.036,-0.624,0.346,0.042,-0.616,0.346,0.042,-0.624,0.354,0.042,-0.616,0.354,0.042,-0.594,0.294,0.036,-0.586,0.294,0.036,-0.594,0.302,0.036,-0.586,0.302,0.036,-0.594,0.294,0.042,-0.586,0.294,0.042,-0.594,0.302,0.042,-0.586,0.302,0.042,-0.534,0.294,0.036,-0.526,0.294,0.036,-0.534,0.302,0.036,-0.526,0.302,0.036,-0.534,0.294,0.042,-0.526,0.294,0.042,-0.534,0.302,0.042,-0.526,0.302,0.042],"e":[0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,30,30,31,31,0,32,33,33,34,34,35,35,36,36,37,37,38,38,39,39,40,40,41,41,42,42,43,43,44,44,45,45,46,46,47,47,48,48,49,49,50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57,58,58,59,59,60,60,61,61,62,62,63,63,32,64,65,65,66,66,67,67,68,68,69,69,70,70,71,71,72,72,73,73,74,74,75,75,76,76,77,77,78,78,79,79,80,80,81,81,82,82,83,83,84,84,85,85,86,86,87,87,88,88,89,89,90,90,91,91,92,92,93,93,94,94,95,95,64,96,97,97,98,98,99,99,100,100,101,101,102,102,103,103,104,104,105,105,106,106,107,107,108,108,109,109,110,110,111,111,112,112,113,113,114,114,115,115,116,116,117,117,118,118,119,119,120,120,121,121,122,122,123,123,124,124,125,125,126,126,127,127,96,0,32,4,36,8,40,12,44,16,48,20,52,24,56,28,60,32,64,36,68,40,72,44,76,48,80,52,84,56,88,60,92,64,96,68,100,72,104,76,108,80,112,84,116,88,120,92,124,128,129,129,130,130,131,131,132,132,133,133,134,134,135,135,136,136,137,137,138,138,139,139,140,140,141,141,142,142,143,143,144,144,145,145,146,146,147,147,148,148,149,149,150,150,151,151,152,152,153,153,154,154,155,155,156,156,157,157,158,158,159,159,128,160,161,161,162,162,163,163,164,164,165,165,166,166,167,167,168,168,169,169,170,170,171,171,172,172,173,173,174,174,175,175,176,176,177,177,178,178,179,179,180,180,181,181,182,182,183,183,184,184,185,185,186,186,187,187,188,188,189,189,190,190,191,191,160,160,128,164,132,168,136,172,140,176,144,180,148,184,152,188,156,192,193,194,195,196,197,198,199,192,194,193,195,196,198,197,199,192,196,193,197,194,198,195,199,200,201,202,203,204,205,206,207,200,202,201,203,204,206,205,207,200,204,201,205,202,206,203,207,208,209,210,211,212,213,214,215,208,210,209,211,212,214,213,215,208,212,209,213,210,214,211,215,216,217,218,219,220,221,222,223,216,218,217,219,220,222,221,223,216,220,217,221,218,222,219,223,224,225,226,227,228,229,230,231,224,226,225,227,228,230,229,231,224,228,225,229,226,230,227,231,232,233,234,235,236,237,238,239,232,234,233,235,236,238,237,239,232,236,233,237,234,238,235,239],"q":[0,1,33,32,1,2,34,33,2,3,35,34,3,4,36,35,4,5,37,36,5,6,38,37,6,7,39,38,7,8,40,39,8,9,41,40,9,10,42,41,10,11,43,42,11,12,44,43,12,13,45,44,13,14,46,45,14,15,47,46,15,16,48,47,16,17,49,48,17,18,50,49,18,19,51,50,19,20,52,51,20,21,53,52,21,22,54,53,22,23,55,54,23,24,56,55,24,25,57,56,25,26,58,57,26,27,59,58,27,28,60,59,28,29,61,60,29,30,62,61,30,31,63,62,31,0,32,63,32,33,65,64,33,34,66,65,34,35,67,66,35,36,68,67,36,37,69,68,37,38,70,69,38,39,71,70,39,40,72,71,40,41,73,72,41,42,74,73,42,43,75,74,43,44,76,75,44,45,77,76,45,46,78,77,46,47,79,78,47,48,80,79,48,49,81,80,49,50,82,81,50,51,83,82,51,52,84,83,52,53,85,84,53,54,86,85,54,55,87,86,55,56,88,87,56,57,89,88,57,58,90,89,58,59,91,90,59,60,92,91,60,61,93,92,61,62,94,93,62,63,95,94,63,32,64,95,64,65,97,96,65,66,98,97,66,67,99,98,67,68,100,99,68,69,101,100,69,70,102,101,70,71,103,102,71,72,104,103,72,73,105,104,73,74,106,105,74,75,107,106,75,76,108,107,76,77,109,108,77,78,110,109,78,79,111,110,79,80,112,111,80,81,113,112,81,82,114,113,82,83,115,114,83,84,116,115,84,85,117,116,85,86,118,117,86,87,119,118,87,88,120,119,88,89,121,120,89,90,122,121,90,91,123,122,91,92,124,123,92,93,125,124,93,94,126,125,94,95,127,126,95,64,96,127,160,161,129,128,161,162,130,129,162,163,131,130,163,164,132,131,164,165,133,132,165,166,134,133,166,167,135,134,167,168,136,135,168,169,137,136,169,170,138,137,170,171,139,138,171,172,140,139,172,173,141,140,173,174,142,141,174,175,143,142,175,176,144,143,176,177,145,144,177,178,146,145,178,179,147,146,179,180,148,147,180,181,149,148,181,182,150,149,182,183,151,150,183,184,152,151,184,185,153,152,185,186,154,153,186,187,155,154,187,188,156,155,188,189,157,156,189,190,158,157,190,191,159,158,191,160,128,159,192,193,195,194,196,197,199,198,192,193,197,196,194,195,199,198,192,194,198,196,193,195,199,197,200,201,203,202,204,205,207,206,200,201,205,204,202,203,207,206,200,202,206,204,201,203,207,205,208,209,211,210,212,213,215,214,208,209,213,212,210,211,215,214,208,210,214,212,209,211,215,213,216,217,219,218,220,221,223,222,216,217,221,220,218,219,223,222,216,218,222,220,217,219,223,221,224,225,227,226,228,229,231,230,224,225,229,228,226,227,231,230,224,226,230,228,225,227,231,229,232,233,235,234,236,237,239,238,232,233,237,236,234,235,239,238,232,234,238,236,233,235,239,237]}]},{"id":"brakes","anchor":[0.527,0.416,0.09],"center":[0.524,0.428,0.08],"pieces":[{"id":"brake-rotor","explode":[0,0,0.01],"axis":{"c":[0.56,0.35,0.06],"d":[0,0,1]},"box":false,"v":[0.48,0.35,0.06,0.4807,0.3396,0.06,0.4827,0.3293,0.06,0.4861,0.3194,0.06,0.4907,0.31,0.06,0.4965,0.3013,0.06,0.5034,0.2934,0.06,0.5113,0.2865,0.06,0.52,0.2807,0.06,0.5294,0.2761,0.06,0.5393,0.2727,0.06,0.5496,0.2707,0.06,0.56,0.27,0.06,0.5704,0.2707,0.06,0.5807,0.2727,0.06,0.5906,0.2761,0.06,0.6,0.2807,0.06,0.6087,0.2865,0.06,0.6166,0.2934,0.06,0.6235,0.3013,0.06,0.6293,0.31,0.06,0.6339,0.3194,0.06,0.6373,0.3293,0.06,0.6393,0.3396,0.06,0.64,0.35,0.06,0.6393,0.3604,0.06,0.6373,0.3707,0.06,0.6339,0.3806,0.06,0.6293,0.39,0.06,0.6235,0.3987,0.06,0.6166,0.4066,0.06,0.6087,0.4135,0.06,0.6,0.4193,0.06,0.5906,0.4239,0.06,0.5807,0.4273,0.06,0.5704,0.4293,0.06,0.56,0.43,0.06,0.5496,0.4293,0.06,0.5393,0.4273,0.06,0.5294,0.4239,0.06,0.52,0.4193,0.06,0.5113,0.4135,0.06,0.5034,0.4066,0.06,0.4965,0.3987,0.06,0.4907,0.39,0.06,0.4861,0.3806,0.06,0.4827,0.3707,0.06,0.4807,0.3604,0.06,0.498,0.35,0.06,0.4985,0.3419,0.06,0.5001,0.334,0.06,0.5027,0.3263,0.06,0.5063,0.319,0.06,0.5108,0.3123,0.06,0.5162,0.3062,0.06,0.5223,0.3008,0.06,0.529,0.2963,0.06,0.5363,0.2927,0.06,0.544,0.2901,0.06,0.5519,0.2885,0.06,0.56,0.288,0.06,0.5681,0.2885,0.06,0.576,0.2901,0.06,0.5837,0.2927,0.06,0.591,0.2963,0.06,0.5977,0.3008,0.06,0.6038,0.3062,0.06,0.6092,0.3123,0.06,0.6137,0.319,0.06,0.6173,0.3263,0.06,0.6199,0.334,0.06,0.6215,0.3419,0.06,0.622,0.35,0.06,0.6215,0.3581,0.06,0.6199,0.366,0.06,0.6173,0.3737,0.06,0.6137,0.381,0.06,0.6092,0.3877,0.06,0.6038,0.3938,0.06,0.5977,0.3992,0.06,0.591,0.4037,0.06,0.5837,0.4073,0.06,0.576,0.4099,0.06,0.5681,0.4115,0.06,0.56,0.412,0.06,0.5519,0.4115,0.06,0.544,0.4099,0.06,0.5363,0.4073,0.06,0.529,0.4037,0.06,0.5223,0.3992,0.06,0.5162,0.3938,0.06,0.5108,0.3877,0.06,0.5063,0.381,0.06,0.5027,0.3737,0.06,0.5001,0.366,0.06,0.4985,0.3581,0.06,0.532,0.35,0.06,0.5341,0.3393,0.06,0.5402,0.3302,0.06,0.5493,0.3241,0.06,0.56,0.322,0.06,0.5707,0.3241,0.06,0.5798,0.3302,0.06,0.5859,0.3393,0.06,0.588,0.35,0.06,0.5859,0.3607,0.06,0.5798,0.3698,0.06,0.5707,0.3759,0.06,0.56,0.378,0.06,0.5493,0.3759,0.06,0.5402,0.3698,0.06,0.5341,0.3607,0.06,0.588,0.35,0.06,0.6144,0.3797,0.06,0.574,0.3742,0.06,0.5615,0.412,0.06,0.546,0.3742,0.06,0.5071,0.3823,0.06,0.532,0.35,0.06,0.5056,0.3203,0.06,0.546,0.3258,0.06,0.5585,0.288,0.06,0.574,0.3258,0.06,0.6129,0.3177,0.06,0.6302,0.3574,0.06,0.6312,0.355,0.06,0.6336,0.354,0.06,0.636,0.355,0.06,0.637,0.3574,0.06,0.636,0.3598,0.06,0.6336,0.3608,0.06,0.6312,0.3598,0.06,0.6258,0.3762,0.06,0.6268,0.3738,0.06,0.6292,0.3728,0.06,0.6316,0.3738,0.06,0.6326,0.3762,0.06,0.6316,0.3786,0.06,0.6292,0.3796,0.06,0.6268,0.3786,0.06,0.6167,0.3932,0.06,0.6177,0.3908,0.06,0.6201,0.3898,0.06,0.6225,0.3908,0.06,0.6235,0.3932,0.06,0.6225,0.3956,0.06,0.6201,0.3966,0.06,0.6177,0.3956,0.06,0.6034,0.4073,0.06,0.6044,0.4049,0.06,0.6068,0.4039,0.06,0.6092,0.4049,0.06,0.6102,0.4073,0.06,0.6092,0.4097,0.06,0.6068,0.4107,0.06,0.6044,0.4097,0.06,0.587,0.4175,0.06,0.588,0.4151,0.06,0.5904,0.4141,0.06,0.5928,0.4151,0.06,0.5938,0.4175,0.06,0.5928,0.4199,0.06,0.5904,0.4209,0.06,0.588,0.4199,0.06,0.5685,0.423,0.06,0.5695,0.4206,0.06,0.5719,0.4196,0.06,0.5743,0.4206,0.06,0.5753,0.423,0.06,0.5743,0.4254,0.06,0.5719,0.4264,0.06,0.5695,0.4254,0.06,0.5492,0.4236,0.06,0.5502,0.4212,0.06,0.5526,0.4202,0.06,0.555,0.4212,0.06,0.556,0.4236,0.06,0.555,0.426,0.06,0.5526,0.427,0.06,0.5502,0.426,0.06,0.5304,0.4192,0.06,0.5314,0.4168,0.06,0.5338,0.4158,0.06,0.5362,0.4168,0.06,0.5372,0.4192,0.06,0.5362,0.4216,0.06,0.5338,0.4226,0.06,0.5314,0.4216,0.06,0.5134,0.4101,0.06,0.5144,0.4077,0.06,0.5168,0.4067,0.06,0.5192,0.4077,0.06,0.5202,0.4101,0.06,0.5192,0.4125,0.06,0.5168,0.4135,0.06,0.5144,0.4125,0.06,0.4993,0.3968,0.06,0.5003,0.3944,0.06,0.5027,0.3934,0.06,0.5051,0.3944,0.06,0.5061,0.3968,0.06,0.5051,0.3992,0.06,0.5027,0.4002,0.06,0.5003,0.3992,0.06,0.4891,0.3804,0.06,0.4901,0.378,0.06,0.4925,0.377,0.06,0.4949,0.378,0.06,0.4959,0.3804,0.06,0.4949,0.3828,0.06,0.4925,0.3838,0.06,0.4901,0.3828,0.06,0.4836,0.3619,0.06,0.4846,0.3595,0.06,0.487,0.3585,0.06,0.4894,0.3595,0.06,0.4904,0.3619,0.06,0.4894,0.3643,0.06,0.487,0.3653,0.06,0.4846,0.3643,0.06,0.483,0.3426,0.06,0.484,0.3402,0.06,0.4864,0.3392,0.06,0.4888,0.3402,0.06,0.4898,0.3426,0.06,0.4888,0.345,0.06,0.4864,0.346,0.06,0.484,0.345,0.06,0.4874,0.3238,0.06,0.4884,0.3214,0.06,0.4908,0.3204,0.06,0.4932,0.3214,0.06,0.4942,0.3238,0.06,0.4932,0.3262,0.06,0.4908,0.3272,0.06,0.4884,0.3262,0.06,0.4965,0.3068,0.06,0.4975,0.3044,0.06,0.4999,0.3034,0.06,0.5023,0.3044,0.06,0.5033,0.3068,0.06,0.5023,0.3092,0.06,0.4999,0.3102,0.06,0.4975,0.3092,0.06,0.5098,0.2927,0.06,0.5108,0.2903,0.06,0.5132,0.2893,0.06,0.5156,0.2903,0.06,0.5166,0.2927,0.06,0.5156,0.2951,0.06,0.5132,0.2961,0.06,0.5108,0.2951,0.06,0.5262,0.2825,0.06,0.5272,0.2801,0.06,0.5296,0.2791,0.06,0.532,0.2801,0.06,0.533,0.2825,0.06,0.532,0.2849,0.06,0.5296,0.2859,0.06,0.5272,0.2849,0.06,0.5447,0.277,0.06,0.5457,0.2746,0.06,0.5481,0.2736,0.06,0.5505,0.2746,0.06,0.5515,0.277,0.06,0.5505,0.2794,0.06,0.5481,0.2804,0.06,0.5457,0.2794,0.06,0.564,0.2764,0.06,0.565,0.274,0.06,0.5674,0.273,0.06,0.5698,0.274,0.06,0.5708,0.2764,0.06,0.5698,0.2788,0.06,0.5674,0.2798,0.06,0.565,0.2788,0.06,0.5828,0.2808,0.06,0.5838,0.2784,0.06,0.5862,0.2774,0.06,0.5886,0.2784,0.06,0.5896,0.2808,0.06,0.5886,0.2832,0.06,0.5862,0.2842,0.06,0.5838,0.2832,0.06,0.5998,0.2899,0.06,0.6008,0.2875,0.06,0.6032,0.2865,0.06,0.6056,0.2875,0.06,0.6066,0.2899,0.06,0.6056,0.2923,0.06,0.6032,0.2933,0.06,0.6008,0.2923,0.06,0.6139,0.3032,0.06,0.6149,0.3008,0.06,0.6173,0.2998,0.06,0.6197,0.3008,0.06,0.6207,0.3032,0.06,0.6197,0.3056,0.06,0.6173,0.3066,0.06,0.6149,0.3056,0.06,0.6241,0.3196,0.06,0.6251,0.3172,0.06,0.6275,0.3162,0.06,0.6299,0.3172,0.06,0.6309,0.3196,0.06,0.6299,0.322,0.06,0.6275,0.323,0.06,0.6251,0.322,0.06,0.6296,0.3381,0.06,0.6306,0.3357,0.06,0.633,0.3347,0.06,0.6354,0.3357,0.06,0.6364,0.3381,0.06,0.6354,0.3405,0.06,0.633,0.3415,0.06,0.6306,0.3405,0.06,0.6217,0.3652,0.06,0.6226,0.3631,0.06,0.6247,0.3622,0.06,0.6269,0.3631,0.06,0.6277,0.3652,0.06,0.6269,0.3673,0.06,0.6247,0.3682,0.06,0.6226,0.3673,0.06,0.6156,0.3815,0.06,0.6165,0.3793,0.06,0.6186,0.3785,0.06,0.6207,0.3793,0.06,0.6216,0.3815,0.06,0.6207,0.3836,0.06,0.6186,0.3845,0.06,0.6165,0.3836,0.06,0.6055,0.3955,0.06,0.6063,0.3934,0.06,0.6085,0.3925,0.06,0.6106,0.3934,0.06,0.6115,0.3955,0.06,0.6106,0.3977,0.06,0.6085,0.3985,0.06,0.6063,0.3977,0.06,0.592,0.4065,0.06,0.5929,0.4044,0.06,0.595,0.4035,0.06,0.5971,0.4044,0.06,0.598,0.4065,0.06,0.5971,0.4087,0.06,0.595,0.4095,0.06,0.5929,0.4087,0.06,0.5762,0.4137,0.06,0.5771,0.4116,0.06,0.5792,0.4107,0.06,0.5813,0.4116,0.06,0.5822,0.4137,0.06,0.5813,0.4158,0.06,0.5792,0.4167,0.06,0.5771,0.4158,0.06,0.5591,0.4165,0.06,0.5599,0.4143,0.06,0.5621,0.4135,0.06,0.5642,0.4143,0.06,0.5651,0.4165,0.06,0.5642,0.4186,0.06,0.5621,0.4195,0.06,0.5599,0.4186,0.06,0.5418,0.4147,0.06,0.5427,0.4126,0.06,0.5448,0.4117,0.06,0.5469,0.4126,0.06,0.5478,0.4147,0.06,0.5469,0.4169,0.06,0.5448,0.4177,0.06,0.5427,0.4169,0.06,0.5255,0.4086,0.06,0.5264,0.4065,0.06,0.5285,0.4056,0.06,0.5307,0.4065,0.06,0.5315,0.4086,0.06,0.5307,0.4107,0.06,0.5285,0.4116,0.06,0.5264,0.4107,0.06,0.5115,0.3985,0.06,0.5123,0.3963,0.06,0.5145,0.3955,0.06,0.5166,0.3963,0.06,0.5175,0.3985,0.06,0.5166,0.4006,0.06,0.5145,0.4015,0.06,0.5123,0.4006,0.06,0.5005,0.385,0.06,0.5013,0.3829,0.06,0.5035,0.382,0.06,0.5056,0.3829,0.06,0.5065,0.385,0.06,0.5056,0.3871,0.06,0.5035,0.388,0.06,0.5013,0.3871,0.06,0.4933,0.3692,0.06,0.4942,0.3671,0.06,0.4963,0.3662,0.06,0.4984,0.3671,0.06,0.4993,0.3692,0.06,0.4984,0.3713,0.06,0.4963,0.3722,0.06,0.4942,0.3713,0.06,0.4905,0.3521,0.06,0.4914,0.3499,0.06,0.4935,0.3491,0.06,0.4957,0.3499,0.06,0.4965,0.3521,0.06,0.4957,0.3542,0.06,0.4935,0.3551,0.06,0.4914,0.3542,0.06,0.4923,0.3348,0.06,0.4931,0.3327,0.06,0.4953,0.3318,0.06,0.4974,0.3327,0.06,0.4983,0.3348,0.06,0.4974,0.3369,0.06,0.4953,0.3378,0.06,0.4931,0.3369,0.06,0.4984,0.3185,0.06,0.4993,0.3164,0.06,0.5014,0.3155,0.06,0.5035,0.3164,0.06,0.5044,0.3185,0.06,0.5035,0.3207,0.06,0.5014,0.3215,0.06,0.4993,0.3207,0.06,0.5085,0.3045,0.06,0.5094,0.3023,0.06,0.5115,0.3015,0.06,0.5137,0.3023,0.06,0.5145,0.3045,0.06,0.5137,0.3066,0.06,0.5115,0.3075,0.06,0.5094,0.3066,0.06,0.522,0.2935,0.06,0.5229,0.2913,0.06,0.525,0.2905,0.06,0.5271,0.2913,0.06,0.528,0.2935,0.06,0.5271,0.2956,0.06,0.525,0.2965,0.06,0.5229,0.2956,0.06,0.5378,0.2863,0.06,0.5387,0.2842,0.06,0.5408,0.2833,0.06,0.5429,0.2842,0.06,0.5438,0.2863,0.06,0.5429,0.2884,0.06,0.5408,0.2893,0.06,0.5387,0.2884,0.06,0.5549,0.2835,0.06,0.5558,0.2814,0.06,0.5579,0.2805,0.06,0.5601,0.2814,0.06,0.5609,0.2835,0.06,0.5601,0.2857,0.06,0.5579,0.2865,0.06,0.5558,0.2857,0.06,0.5722,0.2853,0.06,0.5731,0.2831,0.06,0.5752,0.2823,0.06,0.5773,0.2831,0.06,0.5782,0.2853,0.06,0.5773,0.2874,0.06,0.5752,0.2883,0.06,0.5731,0.2874,0.06,0.5885,0.2914,0.06,0.5893,0.2893,0.06,0.5915,0.2884,0.06,0.5936,0.2893,0.06,0.5945,0.2914,0.06,0.5936,0.2935,0.06,0.5915,0.2944,0.06,0.5893,0.2935,0.06,0.6025,0.3015,0.06,0.6034,0.2994,0.06,0.6055,0.2985,0.06,0.6077,0.2994,0.06,0.6085,0.3015,0.06,0.6077,0.3037,0.06,0.6055,0.3045,0.06,0.6034,0.3037,0.06,0.6135,0.315,0.06,0.6144,0.3129,0.06,0.6165,0.312,0.06,0.6187,0.3129,0.06,0.6195,0.315,0.06,0.6187,0.3171,0.06,0.6165,0.318,0.06,0.6144,0.3171,0.06,0.6207,0.3308,0.06,0.6216,0.3287,0.06,0.6237,0.3278,0.06,0.6258,0.3287,0.06,0.6267,0.3308,0.06,0.6258,0.3329,0.06,0.6237,0.3338,0.06,0.6216,0.3329,0.06,0.6235,0.3479,0.06,0.6243,0.3458,0.06,0.6265,0.3449,0.06,0.6286,0.3458,0.06,0.6295,0.3479,0.06,0.6286,0.3501,0.06,0.6265,0.3509,0.06,0.6243,0.3501,0.06],"e":[0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,30,30,31,31,32,32,33,33,34,34,35,35,36,36,37,37,38,38,39,39,40,40,41,41,42,42,43,43,44,44,45,45,46,46,47,47,0,48,49,49,50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57,58,58,59,59,60,60,61,61,62,62,63,63,64,64,65,65,66,66,67,67,68,68,69,69,70,70,71,71,72,72,73,73,74,74,75,75,76,76,77,77,78,78,79,79,80,80,81,81,82,82,83,83,84,84,85,85,86,86,87,87,88,88,89,89,90,90,91,91,92,92,93,93,94,94,95,95,48,0,48,4,52,8,56,12,60,16,64,20,68,24,72,28,76,32,80,36,84,40,88,44,92,96,97,97,98,98,99,99,100,100,101,101,102,102,103,103,104,104,105,105,106,106,107,107,108,108,109,109,110,110,111,111,96,112,113,114,115,116,117,118,119,120,121,122,123,124,125,125,126,126,127,127,128,128,129,129,130,130,131,131,124,132,133,133,134,134,135,135,136,136,137,137,138,138,139,139,132,140,141,141,142,142,143,143,144,144,145,145,146,146,147,147,140,148,149,149,150,150,151,151,152,152,153,153,154,154,155,155,148,156,157,157,158,158,159,159,160,160,161,161,162,162,163,163,156,164,165,165,166,166,167,167,168,168,169,169,170,170,171,171,164,172,173,173,174,174,175,175,176,176,177,177,178,178,179,179,172,180,181,181,182,182,183,183,184,184,185,185,186,186,187,187,180,188,189,189,190,190,191,191,192,192,193,193,194,194,195,195,188,196,197,197,198,198,199,199,200,200,201,201,202,202,203,203,196,204,205,205,206,206,207,207,208,208,209,209,210,210,211,211,204,212,213,213,214,214,215,215,216,216,217,217,218,218,219,219,212,220,221,221,222,222,223,223,224,224,225,225,226,226,227,227,220,228,229,229,230,230,231,231,232,232,233,233,234,234,235,235,228,236,237,237,238,238,239,239,240,240,241,241,242,242,243,243,236,244,245,245,246,246,247,247,248,248,249,249,250,250,251,251,244,252,253,253,254,254,255,255,256,256,257,257,258,258,259,259,252,260,261,261,262,262,263,263,264,264,265,265,266,266,267,267,260,268,269,269,270,270,271,271,272,272,273,273,274,274,275,275,268,276,277,277,278,278,279,279,280,280,281,281,282,282,283,283,276,284,285,285,286,286,287,287,288,288,289,289,290,290,291,291,284,292,293,293,294,294,295,295,296,296,297,297,298,298,299,299,292,300,301,301,302,302,303,303,304,304,305,305,306,306,307,307,300,308,309,309,310,310,311,311,312,312,313,313,314,314,315,315,308,316,317,317,318,318,319,319,320,320,321,321,322,322,323,323,316,324,325,325,326,326,327,327,328,328,329,329,330,330,331,331,324,332,333,333,334,334,335,335,336,336,337,337,338,338,339,339,332,340,341,341,342,342,343,343,344,344,345,345,346,346,347,347,340,348,349,349,350,350,351,351,352,352,353,353,354,354,355,355,348,356,357,357,358,358,359,359,360,360,361,361,362,362,363,363,356,364,365,365,366,366,367,367,368,368,369,369,370,370,371,371,364,372,373,373,374,374,375,375,376,376,377,377,378,378,379,379,372,380,381,381,382,382,383,383,384,384,385,385,386,386,387,387,380,388,389,389,390,390,391,391,392,392,393,393,394,394,395,395,388,396,397,397,398,398,399,399,400,400,401,401,402,402,403,403,396,404,405,405,406,406,407,407,408,408,409,409,410,410,411,411,404,412,413,413,414,414,415,415,416,416,417,417,418,418,419,419,412,420,421,421,422,422,423,423,424,424,425,425,426,426,427,427,420,428,429,429,430,430,431,431,432,432,433,433,434,434,435,435,428,436,437,437,438,438,439,439,440,440,441,441,442,442,443,443,436,444,445,445,446,446,447,447,448,448,449,449,450,450,451,451,444,452,453,453,454,454,455,455,456,456,457,457,458,458,459,459,452,460,461,461,462,462,463,463,464,464,465,465,466,466,467,467,460,468,469,469,470,470,471,471,472,472,473,473,474,474,475,475,468,476,477,477,478,478,479,479,480,480,481,481,482,482,483,483,476,484,485,485,486,486,487,487,488,488,489,489,490,490,491,491,484,492,493,493,494,494,495,495,496,496,497,497,498,498,499,499,492,500,501,501,502,502,503,503,504,504,505,505,506,506,507,507,500],"q":[0,1,49,48,1,2,50,49,2,3,51,50,3,4,52,51,4,5,53,52,5,6,54,53,6,7,55,54,7,8,56,55,8,9,57,56,9,10,58,57,10,11,59,58,11,12,60,59,12,13,61,60,13,14,62,61,14,15,63,62,15,16,64,63,16,17,65,64,17,18,66,65,18,19,67,66,19,20,68,67,20,21,69,68,21,22,70,69,22,23,71,70,23,24,72,71,24,25,73,72,25,26,74,73,26,27,75,74,27,28,76,75,28,29,77,76,29,30,78,77,30,31,79,78,31,32,80,79,32,33,81,80,33,34,82,81,34,35,83,82,35,36,84,83,36,37,85,84,37,38,86,85,38,39,87,86,39,40,88,87,40,41,89,88,41,42,90,89,42,43,91,90,43,44,92,91,44,45,93,92,45,46,94,93,46,47,95,94,47,0,48,95]},{"id":"brake-caliperA","explode":[0,0,0.1],"v":[0.558,0.4,0.067,0.5546,0.3997,0.067,0.5511,0.3992,0.067,0.5477,0.3985,0.067,0.5443,0.3975,0.067,0.541,0.3963,0.067,0.5378,0.3948,0.067,0.5348,0.3932,0.067,0.5318,0.3913,0.067,0.529,0.3892,0.067,0.5263,0.387,0.067,0.5238,0.3845,0.067,0.5215,0.3819,0.067,0.5563,0.4439,0.067,0.5498,0.4434,0.067,0.5432,0.4425,0.067,0.5368,0.4411,0.067,0.5305,0.4393,0.067,0.5243,0.437,0.067,0.5183,0.4343,0.067,0.5125,0.4311,0.067,0.507,0.4276,0.067,0.5017,0.4237,0.067,0.4967,0.4195,0.067,0.492,0.4149,0.067,0.4876,0.4099,0.067,0.558,0.4,0.09,0.5546,0.3997,0.09,0.5511,0.3992,0.09,0.5477,0.3985,0.09,0.5443,0.3975,0.09,0.541,0.3963,0.09,0.5378,0.3948,0.09,0.5348,0.3932,0.09,0.5318,0.3913,0.09,0.529,0.3892,0.09,0.5263,0.387,0.09,0.5238,0.3845,0.09,0.5215,0.3819,0.09,0.5563,0.4439,0.09,0.5498,0.4434,0.09,0.5432,0.4425,0.09,0.5368,0.4411,0.09,0.5305,0.4393,0.09,0.5243,0.437,0.09,0.5183,0.4343,0.09,0.5125,0.4311,0.09,0.507,0.4276,0.09,0.5017,0.4237,0.09,0.4967,0.4195,0.09,0.492,0.4149,0.09,0.4876,0.4099,0.09,0.5278,0.4213,0.067,0.5288,0.4166,0.067,0.5315,0.4125,0.067,0.5355,0.4098,0.067,0.5403,0.4088,0.067,0.5451,0.4098,0.067,0.5492,0.4125,0.067,0.5519,0.4166,0.067,0.5528,0.4213,0.067,0.5519,0.4261,0.067,0.5492,0.4302,0.067,0.5451,0.4329,0.067,0.5403,0.4338,0.067,0.5355,0.4329,0.067,0.5315,0.4302,0.067,0.5288,0.4261,0.067,0.5028,0.4089,0.067,0.5037,0.4042,0.067,0.5064,0.4001,0.067,0.5105,0.3974,0.067,0.5153,0.3964,0.067,0.52,0.3974,0.067,0.5241,0.4001,0.067,0.5268,0.4042,0.067,0.5278,0.4089,0.067,0.5268,0.4137,0.067,0.5241,0.4178,0.067,0.52,0.4205,0.067,0.5153,0.4214,0.067,0.5105,0.4205,0.067,0.5064,0.4178,0.067,0.5037,0.4137,0.067,0.5039,0.4362,0.072,0.5239,0.4362,0.072,0.5039,0.4502,0.072,0.5239,0.4502,0.072,0.5039,0.4362,0.088,0.5239,0.4362,0.088,0.5039,0.4502,0.088,0.5239,0.4502,0.088],"e":[0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,26,27,27,28,28,29,29,30,30,31,31,32,32,33,33,34,34,35,35,36,36,37,37,38,39,40,40,41,41,42,42,43,43,44,44,45,45,46,46,47,47,48,48,49,49,50,50,51,0,13,26,39,0,26,13,39,12,25,38,51,12,38,25,51,15,41,18,44,21,47,24,50,52,53,53,54,54,55,55,56,56,57,57,58,58,59,59,60,60,61,61,62,62,63,63,64,64,65,65,66,66,67,67,52,68,69,69,70,70,71,71,72,72,73,73,74,74,75,75,76,76,77,77,78,78,79,79,80,80,81,81,82,82,83,83,68,84,85,86,87,88,89,90,91,84,86,85,87,88,90,89,91,84,88,85,89,86,90,87,91],"q":[0,1,14,13,26,27,40,39,13,14,40,39,0,1,27,26,1,2,15,14,27,28,41,40,14,15,41,40,1,2,28,27,2,3,16,15,28,29,42,41,15,16,42,41,2,3,29,28,3,4,17,16,29,30,43,42,16,17,43,42,3,4,30,29,4,5,18,17,30,31,44,43,17,18,44,43,4,5,31,30,5,6,19,18,31,32,45,44,18,19,45,44,5,6,32,31,6,7,20,19,32,33,46,45,19,20,46,45,6,7,33,32,7,8,21,20,33,34,47,46,20,21,47,46,7,8,34,33,8,9,22,21,34,35,48,47,21,22,48,47,8,9,35,34,9,10,23,22,35,36,49,48,22,23,49,48,9,10,36,35,10,11,24,23,36,37,50,49,23,24,50,49,10,11,37,36,11,12,25,24,37,38,51,50,24,25,51,50,11,12,38,37,84,85,87,86,88,89,91,90,84,85,89,88,86,87,91,90,84,86,90,88,85,87,91,89]},{"id":"brake-pistonsA","explode":[0,0,0.078],"hot":true,"v":[0.5293,0.4213,0.066,0.5302,0.4171,0.066,0.5325,0.4136,0.066,0.5361,0.4112,0.066,0.5403,0.4103,0.066,0.5445,0.4112,0.066,0.5481,0.4136,0.066,0.5505,0.4171,0.066,0.5513,0.4213,0.066,0.5505,0.4255,0.066,0.5481,0.4291,0.066,0.5445,0.4315,0.066,0.5403,0.4323,0.066,0.5361,0.4315,0.066,0.5325,0.4291,0.066,0.5302,0.4255,0.066,0.5293,0.4213,0.073,0.5302,0.4171,0.073,0.5325,0.4136,0.073,0.5361,0.4112,0.073,0.5403,0.4103,0.073,0.5445,0.4112,0.073,0.5481,0.4136,0.073,0.5505,0.4171,0.073,0.5513,0.4213,0.073,0.5505,0.4255,0.073,0.5481,0.4291,0.073,0.5445,0.4315,0.073,0.5403,0.4323,0.073,0.5361,0.4315,0.073,0.5325,0.4291,0.073,0.5302,0.4255,0.073,0.5293,0.4213,0.08,0.5302,0.4171,0.08,0.5325,0.4136,0.08,0.5361,0.4112,0.08,0.5403,0.4103,0.08,0.5445,0.4112,0.08,0.5481,0.4136,0.08,0.5505,0.4171,0.08,0.5513,0.4213,0.08,0.5505,0.4255,0.08,0.5481,0.4291,0.08,0.5445,0.4315,0.08,0.5403,0.4323,0.08,0.5361,0.4315,0.08,0.5325,0.4291,0.08,0.5302,0.4255,0.08,0.5293,0.4213,0.066,0.5302,0.4171,0.066,0.5325,0.4136,0.066,0.5361,0.4112,0.066,0.5403,0.4103,0.066,0.5445,0.4112,0.066,0.5481,0.4136,0.066,0.5505,0.4171,0.066,0.5513,0.4213,0.066,0.5505,0.4255,0.066,0.5481,0.4291,0.066,0.5445,0.4315,0.066,0.5403,0.4323,0.066,0.5361,0.4315,0.066,0.5325,0.4291,0.066,0.5302,0.4255,0.066,0.5333,0.4213,0.066,0.5339,0.4187,0.066,0.5354,0.4164,0.066,0.5376,0.4149,0.066,0.5403,0.4143,0.066,0.543,0.4149,0.066,0.5453,0.4164,0.066,0.5468,0.4187,0.066,0.5473,0.4213,0.066,0.5468,0.424,0.066,0.5453,0.4263,0.066,0.543,0.4278,0.066,0.5403,0.4283,0.066,0.5376,0.4278,0.066,0.5354,0.4263,0.066,0.5339,0.424,0.066,0.5373,0.4213,0.066,0.5375,0.4202,0.066,0.5382,0.4192,0.066,0.5392,0.4186,0.066,0.5403,0.4183,0.066,0.5415,0.4186,0.066,0.5424,0.4192,0.066,0.5431,0.4202,0.066,0.5433,0.4213,0.066,0.5431,0.4225,0.066,0.5424,0.4235,0.066,0.5415,0.4241,0.066,0.5403,0.4243,0.066,0.5392,0.4241,0.066,0.5382,0.4235,0.066,0.5375,0.4225,0.066,0.5043,0.4089,0.066,0.5051,0.4047,0.066,0.5075,0.4012,0.066,0.5111,0.3988,0.066,0.5153,0.3979,0.066,0.5195,0.3988,0.066,0.523,0.4012,0.066,0.5254,0.4047,0.066,0.5263,0.4089,0.066,0.5254,0.4132,0.066,0.523,0.4167,0.066,0.5195,0.4191,0.066,0.5153,0.4199,0.066,0.5111,0.4191,0.066,0.5075,0.4167,0.066,0.5051,0.4132,0.066,0.5043,0.4089,0.073,0.5051,0.4047,0.073,0.5075,0.4012,0.073,0.5111,0.3988,0.073,0.5153,0.3979,0.073,0.5195,0.3988,0.073,0.523,0.4012,0.073,0.5254,0.4047,0.073,0.5263,0.4089,0.073,0.5254,0.4132,0.073,0.523,0.4167,0.073,0.5195,0.4191,0.073,0.5153,0.4199,0.073,0.5111,0.4191,0.073,0.5075,0.4167,0.073,0.5051,0.4132,0.073,0.5043,0.4089,0.08,0.5051,0.4047,0.08,0.5075,0.4012,0.08,0.5111,0.3988,0.08,0.5153,0.3979,0.08,0.5195,0.3988,0.08,0.523,0.4012,0.08,0.5254,0.4047,0.08,0.5263,0.4089,0.08,0.5254,0.4132,0.08,0.523,0.4167,0.08,0.5195,0.4191,0.08,0.5153,0.4199,0.08,0.5111,0.4191,0.08,0.5075,0.4167,0.08,0.5051,0.4132,0.08,0.5043,0.4089,0.066,0.5051,0.4047,0.066,0.5075,0.4012,0.066,0.5111,0.3988,0.066,0.5153,0.3979,0.066,0.5195,0.3988,0.066,0.523,0.4012,0.066,0.5254,0.4047,0.066,0.5263,0.4089,0.066,0.5254,0.4132,0.066,0.523,0.4167,0.066,0.5195,0.4191,0.066,0.5153,0.4199,0.066,0.5111,0.4191,0.066,0.5075,0.4167,0.066,0.5051,0.4132,0.066,0.5083,0.4089,0.066,0.5088,0.4063,0.066,0.5103,0.404,0.066,0.5126,0.4025,0.066,0.5153,0.4019,0.066,0.5179,0.4025,0.066,0.5202,0.404,0.066,0.5217,0.4063,0.066,0.5223,0.4089,0.066,0.5217,0.4116,0.066,0.5202,0.4139,0.066,0.5179,0.4154,0.066,0.5153,0.4159,0.066,0.5126,0.4154,0.066,0.5103,0.4139,0.066,0.5088,0.4116,0.066,0.5123,0.4089,0.066,0.5125,0.4078,0.066,0.5131,0.4068,0.066,0.5141,0.4062,0.066,0.5153,0.4059,0.066,0.5164,0.4062,0.066,0.5174,0.4068,0.066,0.518,0.4078,0.066,0.5183,0.4089,0.066,0.518,0.4101,0.066,0.5174,0.4111,0.066,0.5164,0.4117,0.066,0.5153,0.4119,0.066,0.5141,0.4117,0.066,0.5131,0.4111,0.066,0.5125,0.4101,0.066],"e":[0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,0,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,30,30,31,31,16,32,33,33,34,34,35,35,36,36,37,37,38,38,39,39,40,40,41,41,42,42,43,43,44,44,45,45,46,46,47,47,32,0,16,16,32,2,18,18,34,4,20,20,36,6,22,22,38,8,24,24,40,10,26,26,42,12,28,28,44,14,30,30,46,48,49,49,50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57,58,58,59,59,60,60,61,61,62,62,63,63,48,64,65,65,66,66,67,67,68,68,69,69,70,70,71,71,72,72,73,73,74,74,75,75,76,76,77,77,78,78,79,79,64,80,81,81,82,82,83,83,84,84,85,85,86,86,87,87,88,88,89,89,90,90,91,91,92,92,93,93,94,94,95,95,80,48,64,52,68,56,72,60,76,64,80,68,84,72,88,76,92,96,97,97,98,98,99,99,100,100,101,101,102,102,103,103,104,104,105,105,106,106,107,107,108,108,109,109,110,110,111,111,96,112,113,113,114,114,115,115,116,116,117,117,118,118,119,119,120,120,121,121,122,122,123,123,124,124,125,125,126,126,127,127,112,128,129,129,130,130,131,131,132,132,133,133,134,134,135,135,136,136,137,137,138,138,139,139,140,140,141,141,142,142,143,143,128,96,112,112,128,98,114,114,130,100,116,116,132,102,118,118,134,104,120,120,136,106,122,122,138,108,124,124,140,110,126,126,142,144,145,145,146,146,147,147,148,148,149,149,150,150,151,151,152,152,153,153,154,154,155,155,156,156,157,157,158,158,159,159,144,160,161,161,162,162,163,163,164,164,165,165,166,166,167,167,168,168,169,169,170,170,171,171,172,172,173,173,174,174,175,175,160,176,177,177,178,178,179,179,180,180,181,181,182,182,183,183,184,184,185,185,186,186,187,187,188,188,189,189,190,190,191,191,176,144,160,148,164,152,168,156,172,160,176,164,180,168,184,172,188],"q":[0,1,17,16,1,2,18,17,2,3,19,18,3,4,20,19,4,5,21,20,5,6,22,21,6,7,23,22,7,8,24,23,8,9,25,24,9,10,26,25,10,11,27,26,11,12,28,27,12,13,29,28,13,14,30,29,14,15,31,30,15,0,16,31,16,17,33,32,17,18,34,33,18,19,35,34,19,20,36,35,20,21,37,36,21,22,38,37,22,23,39,38,23,24,40,39,24,25,41,40,25,26,42,41,26,27,43,42,27,28,44,43,28,29,45,44,29,30,46,45,30,31,47,46,31,16,32,47,48,49,65,64,49,50,66,65,50,51,67,66,51,52,68,67,52,53,69,68,53,54,70,69,54,55,71,70,55,56,72,71,56,57,73,72,57,58,74,73,58,59,75,74,59,60,76,75,60,61,77,76,61,62,78,77,62,63,79,78,63,48,64,79,64,65,81,80,65,66,82,81,66,67,83,82,67,68,84,83,68,69,85,84,69,70,86,85,70,71,87,86,71,72,88,87,72,73,89,88,73,74,90,89,74,75,91,90,75,76,92,91,76,77,93,92,77,78,94,93,78,79,95,94,79,64,80,95,96,97,113,112,97,98,114,113,98,99,115,114,99,100,116,115,100,101,117,116,101,102,118,117,102,103,119,118,103,104,120,119,104,105,121,120,105,106,122,121,106,107,123,122,107,108,124,123,108,109,125,124,109,110,126,125,110,111,127,126,111,96,112,127,112,113,129,128,113,114,130,129,114,115,131,130,115,116,132,131,116,117,133,132,117,118,134,133,118,119,135,134,119,120,136,135,120,121,137,136,121,122,138,137,122,123,139,138,123,124,140,139,124,125,141,140,125,126,142,141,126,127,143,142,127,112,128,143,144,145,161,160,145,146,162,161,146,147,163,162,147,148,164,163,148,149,165,164,149,150,166,165,150,151,167,166,151,152,168,167,152,153,169,168,153,154,170,169,154,155,171,170,155,156,172,171,156,157,173,172,157,158,174,173,158,159,175,174,159,144,160,175,160,161,177,176,161,162,178,177,162,163,179,178,163,164,180,179,164,165,181,180,165,166,182,181,166,167,183,182,167,168,184,183,168,169,185,184,169,170,186,185,170,171,187,186,171,172,188,187,172,173,189,188,173,174,190,189,174,175,191,190,175,160,176,191]},{"id":"brake-padA","explode":[0,0,0.045],"v":[0.5543,0.4077,0.0635,0.5501,0.4072,0.0635,0.546,0.4063,0.0635,0.542,0.4051,0.0635,0.5381,0.4037,0.0635,0.5343,0.402,0.0635,0.5306,0.4,0.0635,0.5271,0.3978,0.0635,0.5237,0.3953,0.0635,0.5206,0.3925,0.0635,0.5176,0.3896,0.0635,0.5513,0.4376,0.0635,0.545,0.4367,0.0635,0.5388,0.4354,0.0635,0.5327,0.4337,0.0635,0.5268,0.4315,0.0635,0.521,0.4289,0.0635,0.5154,0.4259,0.0635,0.5101,0.4225,0.0635,0.505,0.4187,0.0635,0.5002,0.4146,0.0635,0.4957,0.4101,0.0635,0.5543,0.4077,0.0665,0.5501,0.4072,0.0665,0.546,0.4063,0.0665,0.542,0.4051,0.0665,0.5381,0.4037,0.0665,0.5343,0.402,0.0665,0.5306,0.4,0.0665,0.5271,0.3978,0.0665,0.5237,0.3953,0.0665,0.5206,0.3925,0.0665,0.5176,0.3896,0.0665,0.5513,0.4376,0.0665,0.545,0.4367,0.0665,0.5388,0.4354,0.0665,0.5327,0.4337,0.0665,0.5268,0.4315,0.0665,0.521,0.4289,0.0665,0.5154,0.4259,0.0665,0.5101,0.4225,0.0665,0.505,0.4187,0.0665,0.5002,0.4146,0.0665,0.4957,0.4101,0.0665,0.5515,0.4104,0.0665,0.5467,0.4095,0.0665,0.542,0.4083,0.0665,0.5374,0.4067,0.0665,0.533,0.4047,0.0665,0.5287,0.4023,0.0665,0.5246,0.3997,0.0665,0.5207,0.3967,0.0665,0.5171,0.3934,0.0665,0.5482,0.4342,0.0665,0.5415,0.433,0.0665,0.5349,0.4312,0.0665,0.5285,0.429,0.0665,0.5223,0.4262,0.0665,0.5164,0.4229,0.0665,0.5107,0.4192,0.0665,0.5053,0.4151,0.0665,0.5003,0.4105,0.0665,0.5515,0.4104,0.0685,0.5467,0.4095,0.0685,0.542,0.4083,0.0685,0.5374,0.4067,0.0685,0.533,0.4047,0.0685,0.5287,0.4023,0.0685,0.5246,0.3997,0.0685,0.5207,0.3967,0.0685,0.5171,0.3934,0.0685,0.5482,0.4342,0.0685,0.5415,0.433,0.0685,0.5349,0.4312,0.0685,0.5285,0.429,0.0685,0.5223,0.4262,0.0685,0.5164,0.4229,0.0685,0.5107,0.4192,0.0685,0.5053,0.4151,0.0685,0.5003,0.4105,0.0685],"e":[0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,30,30,31,31,32,33,34,34,35,35,36,36,37,37,38,38,39,39,40,40,41,41,42,42,43,0,11,22,33,0,22,11,33,10,21,32,43,10,32,21,43,13,35,16,38,19,41,44,45,45,46,46,47,47,48,48,49,49,50,50,51,51,52,53,54,54,55,55,56,56,57,57,58,58,59,59,60,60,61,62,63,63,64,64,65,65,66,66,67,67,68,68,69,69,70,71,72,72,73,73,74,74,75,75,76,76,77,77,78,78,79,44,53,62,71,44,62,53,71,52,61,70,79,52,70,61,79,55,73,58,76],"q":[0,1,12,11,22,23,34,33,11,12,34,33,0,1,23,22,1,2,13,12,23,24,35,34,12,13,35,34,1,2,24,23,2,3,14,13,24,25,36,35,13,14,36,35,2,3,25,24,3,4,15,14,25,26,37,36,14,15,37,36,3,4,26,25,4,5,16,15,26,27,38,37,15,16,38,37,4,5,27,26,5,6,17,16,27,28,39,38,16,17,39,38,5,6,28,27,6,7,18,17,28,29,40,39,17,18,40,39,6,7,29,28,7,8,19,18,29,30,41,40,18,19,41,40,7,8,30,29,8,9,20,19,30,31,42,41,19,20,42,41,8,9,31,30,9,10,21,20,31,32,43,42,20,21,43,42,9,10,32,31,44,45,54,53,62,63,72,71,53,54,72,71,44,45,63,62,45,46,55,54,63,64,73,72,54,55,73,72,45,46,64,63,46,47,56,55,64,65,74,73,55,56,74,73,46,47,65,64,47,48,57,56,65,66,75,74,56,57,75,74,47,48,66,65,48,49,58,57,66,67,76,75,57,58,76,75,48,49,67,66,49,50,59,58,67,68,77,76,58,59,77,76,49,50,68,67,50,51,60,59,68,69,78,77,59,60,78,77,50,51,69,68,51,52,61,60,69,70,79,78,60,61,79,78,51,52,70,69]},{"id":"brake-caliperB","explode":[0,0,-0.06],"v":[0.558,0.4,0.053,0.5546,0.3997,0.053,0.5511,0.3992,0.053,0.5477,0.3985,0.053,0.5443,0.3975,0.053,0.541,0.3963,0.053,0.5378,0.3948,0.053,0.5348,0.3932,0.053,0.5318,0.3913,0.053,0.529,0.3892,0.053,0.5263,0.387,0.053,0.5238,0.3845,0.053,0.5215,0.3819,0.053,0.5563,0.4439,0.053,0.5498,0.4434,0.053,0.5432,0.4425,0.053,0.5368,0.4411,0.053,0.5305,0.4393,0.053,0.5243,0.437,0.053,0.5183,0.4343,0.053,0.5125,0.4311,0.053,0.507,0.4276,0.053,0.5017,0.4237,0.053,0.4967,0.4195,0.053,0.492,0.4149,0.053,0.4876,0.4099,0.053,0.558,0.4,0.03,0.5546,0.3997,0.03,0.5511,0.3992,0.03,0.5477,0.3985,0.03,0.5443,0.3975,0.03,0.541,0.3963,0.03,0.5378,0.3948,0.03,0.5348,0.3932,0.03,0.5318,0.3913,0.03,0.529,0.3892,0.03,0.5263,0.387,0.03,0.5238,0.3845,0.03,0.5215,0.3819,0.03,0.5563,0.4439,0.03,0.5498,0.4434,0.03,0.5432,0.4425,0.03,0.5368,0.4411,0.03,0.5305,0.4393,0.03,0.5243,0.437,0.03,0.5183,0.4343,0.03,0.5125,0.4311,0.03,0.507,0.4276,0.03,0.5017,0.4237,0.03,0.4967,0.4195,0.03,0.492,0.4149,0.03,0.4876,0.4099,0.03,0.5278,0.4213,0.053,0.5288,0.4166,0.053,0.5315,0.4125,0.053,0.5355,0.4098,0.053,0.5403,0.4088,0.053,0.5451,0.4098,0.053,0.5492,0.4125,0.053,0.5519,0.4166,0.053,0.5528,0.4213,0.053,0.5519,0.4261,0.053,0.5492,0.4302,0.053,0.5451,0.4329,0.053,0.5403,0.4338,0.053,0.5355,0.4329,0.053,0.5315,0.4302,0.053,0.5288,0.4261,0.053,0.5028,0.4089,0.053,0.5037,0.4042,0.053,0.5064,0.4001,0.053,0.5105,0.3974,0.053,0.5153,0.3964,0.053,0.52,0.3974,0.053,0.5241,0.4001,0.053,0.5268,0.4042,0.053,0.5278,0.4089,0.053,0.5268,0.4137,0.053,0.5241,0.4178,0.053,0.52,0.4205,0.053,0.5153,0.4214,0.053,0.5105,0.4205,0.053,0.5064,0.4178,0.053,0.5037,0.4137,0.053,0.5039,0.4362,0.032,0.5239,0.4362,0.032,0.5039,0.4502,0.032,0.5239,0.4502,0.032,0.5039,0.4362,0.048,0.5239,0.4362,0.048,0.5039,0.4502,0.048,0.5239,0.4502,0.048],"e":[0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,26,27,27,28,28,29,29,30,30,31,31,32,32,33,33,34,34,35,35,36,36,37,37,38,39,40,40,41,41,42,42,43,43,44,44,45,45,46,46,47,47,48,48,49,49,50,50,51,0,13,26,39,0,26,13,39,12,25,38,51,12,38,25,51,15,41,18,44,21,47,24,50,52,53,53,54,54,55,55,56,56,57,57,58,58,59,59,60,60,61,61,62,62,63,63,64,64,65,65,66,66,67,67,52,68,69,69,70,70,71,71,72,72,73,73,74,74,75,75,76,76,77,77,78,78,79,79,80,80,81,81,82,82,83,83,68,84,85,86,87,88,89,90,91,84,86,85,87,88,90,89,91,84,88,85,89,86,90,87,91],"q":[0,1,14,13,26,27,40,39,13,14,40,39,0,1,27,26,1,2,15,14,27,28,41,40,14,15,41,40,1,2,28,27,2,3,16,15,28,29,42,41,15,16,42,41,2,3,29,28,3,4,17,16,29,30,43,42,16,17,43,42,3,4,30,29,4,5,18,17,30,31,44,43,17,18,44,43,4,5,31,30,5,6,19,18,31,32,45,44,18,19,45,44,5,6,32,31,6,7,20,19,32,33,46,45,19,20,46,45,6,7,33,32,7,8,21,20,33,34,47,46,20,21,47,46,7,8,34,33,8,9,22,21,34,35,48,47,21,22,48,47,8,9,35,34,9,10,23,22,35,36,49,48,22,23,49,48,9,10,36,35,10,11,24,23,36,37,50,49,23,24,50,49,10,11,37,36,11,12,25,24,37,38,51,50,24,25,51,50,11,12,38,37,84,85,87,86,88,89,91,90,84,85,89,88,86,87,91,90,84,86,90,88,85,87,91,89]},{"id":"brake-pistonsB","explode":[0,0,-0.043],"hot":true,"v":[0.5513,0.4213,0.054,0.5505,0.4171,0.054,0.5481,0.4136,0.054,0.5445,0.4112,0.054,0.5403,0.4103,0.054,0.5361,0.4112,0.054,0.5325,0.4136,0.054,0.5302,0.4171,0.054,0.5293,0.4213,0.054,0.5302,0.4255,0.054,0.5325,0.4291,0.054,0.5361,0.4315,0.054,0.5403,0.4323,0.054,0.5445,0.4315,0.054,0.5481,0.4291,0.054,0.5505,0.4255,0.054,0.5513,0.4213,0.047,0.5505,0.4171,0.047,0.5481,0.4136,0.047,0.5445,0.4112,0.047,0.5403,0.4103,0.047,0.5361,0.4112,0.047,0.5325,0.4136,0.047,0.5302,0.4171,0.047,0.5293,0.4213,0.047,0.5302,0.4255,0.047,0.5325,0.4291,0.047,0.5361,0.4315,0.047,0.5403,0.4323,0.047,0.5445,0.4315,0.047,0.5481,0.4291,0.047,0.5505,0.4255,0.047,0.5513,0.4213,0.04,0.5505,0.4171,0.04,0.5481,0.4136,0.04,0.5445,0.4112,0.04,0.5403,0.4103,0.04,0.5361,0.4112,0.04,0.5325,0.4136,0.04,0.5302,0.4171,0.04,0.5293,0.4213,0.04,0.5302,0.4255,0.04,0.5325,0.4291,0.04,0.5361,0.4315,0.04,0.5403,0.4323,0.04,0.5445,0.4315,0.04,0.5481,0.4291,0.04,0.5505,0.4255,0.04,0.5293,0.4213,0.054,0.5302,0.4171,0.054,0.5325,0.4136,0.054,0.5361,0.4112,0.054,0.5403,0.4103,0.054,0.5445,0.4112,0.054,0.5481,0.4136,0.054,0.5505,0.4171,0.054,0.5513,0.4213,0.054,0.5505,0.4255,0.054,0.5481,0.4291,0.054,0.5445,0.4315,0.054,0.5403,0.4323,0.054,0.5361,0.4315,0.054,0.5325,0.4291,0.054,0.5302,0.4255,0.054,0.5333,0.4213,0.054,0.5339,0.4187,0.054,0.5354,0.4164,0.054,0.5376,0.4149,0.054,0.5403,0.4143,0.054,0.543,0.4149,0.054,0.5453,0.4164,0.054,0.5468,0.4187,0.054,0.5473,0.4213,0.054,0.5468,0.424,0.054,0.5453,0.4263,0.054,0.543,0.4278,0.054,0.5403,0.4283,0.054,0.5376,0.4278,0.054,0.5354,0.4263,0.054,0.5339,0.424,0.054,0.5373,0.4213,0.054,0.5375,0.4202,0.054,0.5382,0.4192,0.054,0.5392,0.4186,0.054,0.5403,0.4183,0.054,0.5415,0.4186,0.054,0.5424,0.4192,0.054,0.5431,0.4202,0.054,0.5433,0.4213,0.054,0.5431,0.4225,0.054,0.5424,0.4235,0.054,0.5415,0.4241,0.054,0.5403,0.4243,0.054,0.5392,0.4241,0.054,0.5382,0.4235,0.054,0.5375,0.4225,0.054,0.5263,0.4089,0.054,0.5254,0.4047,0.054,0.523,0.4012,0.054,0.5195,0.3988,0.054,0.5153,0.3979,0.054,0.5111,0.3988,0.054,0.5075,0.4012,0.054,0.5051,0.4047,0.054,0.5043,0.4089,0.054,0.5051,0.4132,0.054,0.5075,0.4167,0.054,0.5111,0.4191,0.054,0.5153,0.4199,0.054,0.5195,0.4191,0.054,0.523,0.4167,0.054,0.5254,0.4132,0.054,0.5263,0.4089,0.047,0.5254,0.4047,0.047,0.523,0.4012,0.047,0.5195,0.3988,0.047,0.5153,0.3979,0.047,0.5111,0.3988,0.047,0.5075,0.4012,0.047,0.5051,0.4047,0.047,0.5043,0.4089,0.047,0.5051,0.4132,0.047,0.5075,0.4167,0.047,0.5111,0.4191,0.047,0.5153,0.4199,0.047,0.5195,0.4191,0.047,0.523,0.4167,0.047,0.5254,0.4132,0.047,0.5263,0.4089,0.04,0.5254,0.4047,0.04,0.523,0.4012,0.04,0.5195,0.3988,0.04,0.5153,0.3979,0.04,0.5111,0.3988,0.04,0.5075,0.4012,0.04,0.5051,0.4047,0.04,0.5043,0.4089,0.04,0.5051,0.4132,0.04,0.5075,0.4167,0.04,0.5111,0.4191,0.04,0.5153,0.4199,0.04,0.5195,0.4191,0.04,0.523,0.4167,0.04,0.5254,0.4132,0.04,0.5043,0.4089,0.054,0.5051,0.4047,0.054,0.5075,0.4012,0.054,0.5111,0.3988,0.054,0.5153,0.3979,0.054,0.5195,0.3988,0.054,0.523,0.4012,0.054,0.5254,0.4047,0.054,0.5263,0.4089,0.054,0.5254,0.4132,0.054,0.523,0.4167,0.054,0.5195,0.4191,0.054,0.5153,0.4199,0.054,0.5111,0.4191,0.054,0.5075,0.4167,0.054,0.5051,0.4132,0.054,0.5083,0.4089,0.054,0.5088,0.4063,0.054,0.5103,0.404,0.054,0.5126,0.4025,0.054,0.5153,0.4019,0.054,0.5179,0.4025,0.054,0.5202,0.404,0.054,0.5217,0.4063,0.054,0.5223,0.4089,0.054,0.5217,0.4116,0.054,0.5202,0.4139,0.054,0.5179,0.4154,0.054,0.5153,0.4159,0.054,0.5126,0.4154,0.054,0.5103,0.4139,0.054,0.5088,0.4116,0.054,0.5123,0.4089,0.054,0.5125,0.4078,0.054,0.5131,0.4068,0.054,0.5141,0.4062,0.054,0.5153,0.4059,0.054,0.5164,0.4062,0.054,0.5174,0.4068,0.054,0.518,0.4078,0.054,0.5183,0.4089,0.054,0.518,0.4101,0.054,0.5174,0.4111,0.054,0.5164,0.4117,0.054,0.5153,0.4119,0.054,0.5141,0.4117,0.054,0.5131,0.4111,0.054,0.5125,0.4101,0.054],"e":[0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,0,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,30,30,31,31,16,32,33,33,34,34,35,35,36,36,37,37,38,38,39,39,40,40,41,41,42,42,43,43,44,44,45,45,46,46,47,47,32,0,16,16,32,2,18,18,34,4,20,20,36,6,22,22,38,8,24,24,40,10,26,26,42,12,28,28,44,14,30,30,46,48,49,49,50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57,58,58,59,59,60,60,61,61,62,62,63,63,48,64,65,65,66,66,67,67,68,68,69,69,70,70,71,71,72,72,73,73,74,74,75,75,76,76,77,77,78,78,79,79,64,80,81,81,82,82,83,83,84,84,85,85,86,86,87,87,88,88,89,89,90,90,91,91,92,92,93,93,94,94,95,95,80,48,64,52,68,56,72,60,76,64,80,68,84,72,88,76,92,96,97,97,98,98,99,99,100,100,101,101,102,102,103,103,104,104,105,105,106,106,107,107,108,108,109,109,110,110,111,111,96,112,113,113,114,114,115,115,116,116,117,117,118,118,119,119,120,120,121,121,122,122,123,123,124,124,125,125,126,126,127,127,112,128,129,129,130,130,131,131,132,132,133,133,134,134,135,135,136,136,137,137,138,138,139,139,140,140,141,141,142,142,143,143,128,96,112,112,128,98,114,114,130,100,116,116,132,102,118,118,134,104,120,120,136,106,122,122,138,108,124,124,140,110,126,126,142,144,145,145,146,146,147,147,148,148,149,149,150,150,151,151,152,152,153,153,154,154,155,155,156,156,157,157,158,158,159,159,144,160,161,161,162,162,163,163,164,164,165,165,166,166,167,167,168,168,169,169,170,170,171,171,172,172,173,173,174,174,175,175,160,176,177,177,178,178,179,179,180,180,181,181,182,182,183,183,184,184,185,185,186,186,187,187,188,188,189,189,190,190,191,191,176,144,160,148,164,152,168,156,172,160,176,164,180,168,184,172,188],"q":[0,1,17,16,1,2,18,17,2,3,19,18,3,4,20,19,4,5,21,20,5,6,22,21,6,7,23,22,7,8,24,23,8,9,25,24,9,10,26,25,10,11,27,26,11,12,28,27,12,13,29,28,13,14,30,29,14,15,31,30,15,0,16,31,16,17,33,32,17,18,34,33,18,19,35,34,19,20,36,35,20,21,37,36,21,22,38,37,22,23,39,38,23,24,40,39,24,25,41,40,25,26,42,41,26,27,43,42,27,28,44,43,28,29,45,44,29,30,46,45,30,31,47,46,31,16,32,47,48,49,65,64,49,50,66,65,50,51,67,66,51,52,68,67,52,53,69,68,53,54,70,69,54,55,71,70,55,56,72,71,56,57,73,72,57,58,74,73,58,59,75,74,59,60,76,75,60,61,77,76,61,62,78,77,62,63,79,78,63,48,64,79,64,65,81,80,65,66,82,81,66,67,83,82,67,68,84,83,68,69,85,84,69,70,86,85,70,71,87,86,71,72,88,87,72,73,89,88,73,74,90,89,74,75,91,90,75,76,92,91,76,77,93,92,77,78,94,93,78,79,95,94,79,64,80,95,96,97,113,112,97,98,114,113,98,99,115,114,99,100,116,115,100,101,117,116,101,102,118,117,102,103,119,118,103,104,120,119,104,105,121,120,105,106,122,121,106,107,123,122,107,108,124,123,108,109,125,124,109,110,126,125,110,111,127,126,111,96,112,127,112,113,129,128,113,114,130,129,114,115,131,130,115,116,132,131,116,117,133,132,117,118,134,133,118,119,135,134,119,120,136,135,120,121,137,136,121,122,138,137,122,123,139,138,123,124,140,139,124,125,141,140,125,126,142,141,126,127,143,142,127,112,128,143,144,145,161,160,145,146,162,161,146,147,163,162,147,148,164,163,148,149,165,164,149,150,166,165,150,151,167,166,151,152,168,167,152,153,169,168,153,154,170,169,154,155,171,170,155,156,172,171,156,157,173,172,157,158,174,173,158,159,175,174,159,144,160,175,160,161,177,176,161,162,178,177,162,163,179,178,163,164,180,179,164,165,181,180,165,166,182,181,166,167,183,182,167,168,184,183,168,169,185,184,169,170,186,185,170,171,187,186,171,172,188,187,172,173,189,188,173,174,190,189,174,175,191,190,175,160,176,191]},{"id":"brake-padB","explode":[0,0,-0.025],"v":[0.5543,0.4077,0.0565,0.5501,0.4072,0.0565,0.546,0.4063,0.0565,0.542,0.4051,0.0565,0.5381,0.4037,0.0565,0.5343,0.402,0.0565,0.5306,0.4,0.0565,0.5271,0.3978,0.0565,0.5237,0.3953,0.0565,0.5206,0.3925,0.0565,0.5176,0.3896,0.0565,0.5513,0.4376,0.0565,0.545,0.4367,0.0565,0.5388,0.4354,0.0565,0.5327,0.4337,0.0565,0.5268,0.4315,0.0565,0.521,0.4289,0.0565,0.5154,0.4259,0.0565,0.5101,0.4225,0.0565,0.505,0.4187,0.0565,0.5002,0.4146,0.0565,0.4957,0.4101,0.0565,0.5543,0.4077,0.0535,0.5501,0.4072,0.0535,0.546,0.4063,0.0535,0.542,0.4051,0.0535,0.5381,0.4037,0.0535,0.5343,0.402,0.0535,0.5306,0.4,0.0535,0.5271,0.3978,0.0535,0.5237,0.3953,0.0535,0.5206,0.3925,0.0535,0.5176,0.3896,0.0535,0.5513,0.4376,0.0535,0.545,0.4367,0.0535,0.5388,0.4354,0.0535,0.5327,0.4337,0.0535,0.5268,0.4315,0.0535,0.521,0.4289,0.0535,0.5154,0.4259,0.0535,0.5101,0.4225,0.0535,0.505,0.4187,0.0535,0.5002,0.4146,0.0535,0.4957,0.4101,0.0535,0.5515,0.4104,0.0535,0.5467,0.4095,0.0535,0.542,0.4083,0.0535,0.5374,0.4067,0.0535,0.533,0.4047,0.0535,0.5287,0.4023,0.0535,0.5246,0.3997,0.0535,0.5207,0.3967,0.0535,0.5171,0.3934,0.0535,0.5482,0.4342,0.0535,0.5415,0.433,0.0535,0.5349,0.4312,0.0535,0.5285,0.429,0.0535,0.5223,0.4262,0.0535,0.5164,0.4229,0.0535,0.5107,0.4192,0.0535,0.5053,0.4151,0.0535,0.5003,0.4105,0.0535,0.5515,0.4104,0.0515,0.5467,0.4095,0.0515,0.542,0.4083,0.0515,0.5374,0.4067,0.0515,0.533,0.4047,0.0515,0.5287,0.4023,0.0515,0.5246,0.3997,0.0515,0.5207,0.3967,0.0515,0.5171,0.3934,0.0515,0.5482,0.4342,0.0515,0.5415,0.433,0.0515,0.5349,0.4312,0.0515,0.5285,0.429,0.0515,0.5223,0.4262,0.0515,0.5164,0.4229,0.0515,0.5107,0.4192,0.0515,0.5053,0.4151,0.0515,0.5003,0.4105,0.0515],"e":[0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,30,30,31,31,32,33,34,34,35,35,36,36,37,37,38,38,39,39,40,40,41,41,42,42,43,0,11,22,33,0,22,11,33,10,21,32,43,10,32,21,43,13,35,16,38,19,41,44,45,45,46,46,47,47,48,48,49,49,50,50,51,51,52,53,54,54,55,55,56,56,57,57,58,58,59,59,60,60,61,62,63,63,64,64,65,65,66,66,67,67,68,68,69,69,70,71,72,72,73,73,74,74,75,75,76,76,77,77,78,78,79,44,53,62,71,44,62,53,71,52,61,70,79,52,70,61,79,55,73,58,76],"q":[0,1,12,11,22,23,34,33,11,12,34,33,0,1,23,22,1,2,13,12,23,24,35,34,12,13,35,34,1,2,24,23,2,3,14,13,24,25,36,35,13,14,36,35,2,3,25,24,3,4,15,14,25,26,37,36,14,15,37,36,3,4,26,25,4,5,16,15,26,27,38,37,15,16,38,37,4,5,27,26,5,6,17,16,27,28,39,38,16,17,39,38,5,6,28,27,6,7,18,17,28,29,40,39,17,18,40,39,6,7,29,28,7,8,19,18,29,30,41,40,18,19,41,40,7,8,30,29,8,9,20,19,30,31,42,41,19,20,42,41,8,9,31,30,9,10,21,20,31,32,43,42,20,21,43,42,9,10,32,31,44,45,54,53,62,63,72,71,53,54,72,71,44,45,63,62,45,46,55,54,63,64,73,72,54,55,73,72,45,46,64,63,46,47,56,55,64,65,74,73,55,56,74,73,46,47,65,64,47,48,57,56,65,66,75,74,56,57,75,74,47,48,66,65,48,49,58,57,66,67,76,75,57,58,76,75,48,49,67,66,49,50,59,58,67,68,77,76,58,59,77,76,49,50,68,67,50,51,60,59,68,69,78,77,59,60,78,77,50,51,69,68,51,52,61,60,69,70,79,78,60,61,79,78,51,52,70,69]},{"id":"brake-line","explode":[0,0,0.1],"box":false,"v":[0.52,0.4346,0.074,0.515,0.4333,0.0771,0.515,0.4337,0.0831,0.52,0.4354,0.086,0.525,0.4367,0.0829,0.525,0.4363,0.0769,0.495,0.5171,0.069,0.49,0.5158,0.0721,0.49,0.5162,0.0781,0.495,0.5179,0.081,0.5,0.5192,0.0779,0.5,0.5188,0.0719,0.47,0.5996,0.064,0.465,0.5983,0.0671,0.465,0.5987,0.0731,0.47,0.6004,0.076,0.475,0.6017,0.0729,0.475,0.6013,0.0669,0.47,0.6,0.064,0.465,0.5987,0.067,0.465,0.5987,0.073,0.47,0.6,0.076,0.475,0.6013,0.073,0.475,0.6013,0.067,0.45,0.675,0.064,0.445,0.6737,0.067,0.445,0.6737,0.073,0.45,0.675,0.076,0.455,0.6763,0.073,0.455,0.6763,0.067,0.43,0.75,0.064,0.425,0.7487,0.067,0.425,0.7487,0.073,0.43,0.75,0.076,0.435,0.7513,0.073,0.435,0.7513,0.067,0.43,0.7504,0.064,0.4249,0.7493,0.067,0.4249,0.7489,0.0729,0.43,0.7496,0.076,0.4351,0.7507,0.073,0.4351,0.7511,0.0671,0.415,0.8354,0.069,0.4099,0.8343,0.072,0.4099,0.8339,0.0779,0.415,0.8346,0.081,0.4201,0.8357,0.078,0.4201,0.8361,0.0721,0.4,0.9204,0.074,0.3949,0.9193,0.077,0.3949,0.9189,0.0829,0.4,0.9196,0.086,0.4051,0.9207,0.083,0.4051,0.9211,0.0771,0.3943,0.92,0.0781,0.3964,0.9155,0.0814,0.4021,0.9155,0.0833,0.4057,0.92,0.0819,0.4036,0.9245,0.0786,0.3979,0.9245,0.0767,0.3743,0.955,0.1381,0.3764,0.9505,0.1414,0.3821,0.9505,0.1433,0.3857,0.955,0.1419,0.3836,0.9595,0.1386,0.3779,0.9595,0.1367,0.3543,0.99,0.1981,0.3564,0.9855,0.2014,0.3621,0.9855,0.2033,0.3657,0.99,0.2019,0.3636,0.9945,0.1986,0.3579,0.9945,0.1967,0.3542,0.99,0.1984,0.3569,0.9849,0.1999,0.3627,0.9849,0.2015,0.3658,0.99,0.2016,0.3631,0.9951,0.2001,0.3573,0.9951,0.1985,0.3442,0.995,0.2334,0.3469,0.9899,0.2349,0.3527,0.9899,0.2365,0.3558,0.995,0.2366,0.3531,1.0001,0.2351,0.3473,1.0001,0.2335,0.3342,1,0.2684,0.3369,0.9949,0.2699,0.3427,0.9949,0.2715,0.3458,1,0.2716,0.3431,1.0051,0.2701,0.3373,1.0051,0.2685,0.3325,0.99,0.255,0.3675,0.99,0.255,0.3325,1.02,0.255,0.3675,1.02,0.255,0.3325,0.99,0.285,0.3675,0.99,0.285,0.3325,1.02,0.285,0.3675,1.02,0.285,0.3565,1,0.2735,0.3577,0.9957,0.2712,0.3612,0.9957,0.2677,0.3635,1,0.2665,0.3623,1.0043,0.2688,0.3588,1.0043,0.2723,0.3965,0.99,0.3135,0.3977,0.9857,0.3112,0.4012,0.9857,0.3077,0.4035,0.99,0.3065,0.4023,0.9943,0.3088,0.3988,0.9943,0.3123,0.395,0.99,0.3106,0.3975,0.9857,0.31,0.4024,0.9857,0.3094,0.405,0.99,0.3094,0.4025,0.9943,0.31,0.3976,0.9943,0.3106,0.405,0.985,0.3906,0.4075,0.9807,0.39,0.4124,0.9807,0.3894,0.415,0.985,0.3894,0.4125,0.9893,0.39,0.4076,0.9893,0.3906],"e":[0,1,1,2,2,3,3,4,4,5,5,0,6,7,7,8,8,9,9,10,10,11,11,6,12,13,13,14,14,15,15,16,16,17,17,12,0,6,6,12,3,9,9,15,18,19,19,20,20,21,21,22,22,23,23,18,24,25,25,26,26,27,27,28,28,29,29,24,30,31,31,32,32,33,33,34,34,35,35,30,18,24,24,30,21,27,27,33,36,37,37,38,38,39,39,40,40,41,41,36,42,43,43,44,44,45,45,46,46,47,47,42,48,49,49,50,50,51,51,52,52,53,53,48,36,42,42,48,39,45,45,51,54,55,55,56,56,57,57,58,58,59,59,54,60,61,61,62,62,63,63,64,64,65,65,60,66,67,67,68,68,69,69,70,70,71,71,66,54,60,60,66,57,63,63,69,72,73,73,74,74,75,75,76,76,77,77,72,78,79,79,80,80,81,81,82,82,83,83,78,84,85,85,86,86,87,87,88,88,89,89,84,72,78,78,84,75,81,81,87,90,91,92,93,94,95,96,97,90,92,91,93,94,96,95,97,90,94,91,95,92,96,93,97,98,99,99,100,100,101,101,102,102,103,103,98,104,105,105,106,106,107,107,108,108,109,109,104,98,104,101,107,110,111,111,112,112,113,113,114,114,115,115,110,116,117,117,118,118,119,119,120,120,121,121,116,110,116,113,119],"q":[0,1,7,6,1,2,8,7,2,3,9,8,3,4,10,9,4,5,11,10,5,0,6,11,6,7,13,12,7,8,14,13,8,9,15,14,9,10,16,15,10,11,17,16,11,6,12,17,18,19,25,24,19,20,26,25,20,21,27,26,21,22,28,27,22,23,29,28,23,18,24,29,24,25,31,30,25,26,32,31,26,27,33,32,27,28,34,33,28,29,35,34,29,24,30,35,36,37,43,42,37,38,44,43,38,39,45,44,39,40,46,45,40,41,47,46,41,36,42,47,42,43,49,48,43,44,50,49,44,45,51,50,45,46,52,51,46,47,53,52,47,42,48,53,54,55,61,60,55,56,62,61,56,57,63,62,57,58,64,63,58,59,65,64,59,54,60,65,60,61,67,66,61,62,68,67,62,63,69,68,63,64,70,69,64,65,71,70,65,60,66,71,72,73,79,78,73,74,80,79,74,75,81,80,75,76,82,81,76,77,83,82,77,72,78,83,78,79,85,84,79,80,86,85,80,81,87,86,81,82,88,87,82,83,89,88,83,78,84,89,90,91,93,92,94,95,97,96,90,91,95,94,92,93,97,96,90,92,96,94,91,93,97,95,98,99,105,104,99,100,106,105,100,101,107,106,101,102,108,107,102,103,109,108,103,98,104,109,110,111,117,116,111,112,118,117,112,113,119,118,113,114,120,119,114,115,121,120,115,110,116,121]}]}]}
\ No newline at end of file
diff --git a/styles/hologram-hud/demo/music/CREDITS_music.txt b/styles/hologram-hud/demo/music/CREDITS_music.txt
new file mode 100644
index 0000000..fa45097
--- /dev/null
+++ b/styles/hologram-hud/demo/music/CREDITS_music.txt
@@ -0,0 +1 @@
+原创配乐:旋律、琶音与低音音型全部原创,numpy 实时合成(polyBLEP 锯齿/方波、噪声鼓、808 式正弦下滑),未使用任何采样或第三方素材。
diff --git a/styles/hologram-hud/demo/music/check.py b/styles/hologram-hud/demo/music/check.py
new file mode 100644
index 0000000..2bade8d
--- /dev/null
+++ b/styles/hologram-hud/demo/music/check.py
@@ -0,0 +1,23 @@
+"""score.wav / score.json 自检"""
+import os, json, numpy as np, soundfile as sf
+H = os.path.dirname(os.path.abspath(__file__))
+x, sr = sf.read(os.path.join(H, 'score.wav')); S = json.load(open(os.path.join(H, 'score.json')))
+TL = json.load(open(os.path.join(H, '..', 'timeline.json')))
+db = lambda v: 20 * np.log10(max(v, 1e-12))
+rms = lambda a, b: np.sqrt(np.mean(x[int(a*sr):int(b*sr)] ** 2))
+ok = True
+print('len', len(x) / sr, 'ch', x.shape[1], 'sr', sr); ok &= abs(len(x)/sr - TL['dur']) < 1e-3
+print('NaN', np.isnan(x).any()); ok &= not np.isnan(x).any()
+pk = db(np.abs(x).max()); print(f'peak {pk:.2f} dBFS'); ok &= pk <= -1.0
+for a, b in S['silence']:
+ r = rms(a, b); print(f'silence {a}-{b}: rms {db(r):.1f} dBFS, max {np.abs(x[int(a*sr):int(b*sr)]).max():.2e}'); ok &= db(r) < -60
+off = [o for o in S['onsets'] if abs(o['t'] * 8 - round(o['t'] * 8)) > 1e-6]
+print('onsets', len(S['onsets']), 'off-grid', len(off)); ok &= not off
+h0 = TL['high'][0]
+pre, drop, post = rms(h0 - 2, h0 - 0.5), rms(h0, h0 + 1), rms(h0 + 4, h0 + 6)
+print(f'drop: pre {db(pre):.1f} drop {db(drop):.1f} lock {db(post):.1f}'); ok &= drop > pre * 1.4 and drop > post * 1.4
+segs = [('扫描', 0, 4), ('定场', 4, TL['intro'][1] - .5)] + [(f"部件{c['i']+1}", c['t0'], c['t1']) for c in TL['calls']] + \
+ [('重组', TL['regroup'][0], TL['regroup'][1] - .5), ('点亮', *TL['high']), ('落版', *TL['lock']), ('片尾', *TL['end'])]
+for n, a, b in segs: r = db(rms(a, b)); print(f'{n:4s} {a:5.1f}-{b:5.1f} {r:6.1f} dBFS ' + '#' * max(0, int((r + 45))))
+print(f'last 20ms max {np.abs(x[-int(.02*sr):]).max():.2e}')
+print('ALL OK' if ok else 'FAIL')
diff --git a/styles/hologram-hud/demo/music/score.json b/styles/hologram-hud/demo/music/score.json
new file mode 100644
index 0000000..4fc26e9
--- /dev/null
+++ b/styles/hologram-hud/demo/music/score.json
@@ -0,0 +1,1836 @@
+{
+ "bpm": 120,
+ "dur": 39.0,
+ "onsets": [
+ {
+ "t": 0.0,
+ "part": "chord"
+ },
+ {
+ "t": 2.0,
+ "part": "arp"
+ },
+ {
+ "t": 2.125,
+ "part": "arp"
+ },
+ {
+ "t": 2.25,
+ "part": "arp"
+ },
+ {
+ "t": 2.375,
+ "part": "arp"
+ },
+ {
+ "t": 2.5,
+ "part": "arp"
+ },
+ {
+ "t": 2.625,
+ "part": "arp"
+ },
+ {
+ "t": 2.75,
+ "part": "arp"
+ },
+ {
+ "t": 2.875,
+ "part": "arp"
+ },
+ {
+ "t": 3.0,
+ "part": "arp"
+ },
+ {
+ "t": 3.125,
+ "part": "arp"
+ },
+ {
+ "t": 3.25,
+ "part": "arp"
+ },
+ {
+ "t": 3.375,
+ "part": "arp"
+ },
+ {
+ "t": 3.5,
+ "part": "arp"
+ },
+ {
+ "t": 3.625,
+ "part": "arp"
+ },
+ {
+ "t": 3.75,
+ "part": "arp"
+ },
+ {
+ "t": 3.875,
+ "part": "arp"
+ },
+ {
+ "t": 4.0,
+ "part": "arp"
+ },
+ {
+ "t": 4.0,
+ "part": "pulse"
+ },
+ {
+ "t": 4.125,
+ "part": "arp"
+ },
+ {
+ "t": 4.25,
+ "part": "arp"
+ },
+ {
+ "t": 4.375,
+ "part": "arp"
+ },
+ {
+ "t": 4.5,
+ "part": "arp"
+ },
+ {
+ "t": 4.5,
+ "part": "pulse"
+ },
+ {
+ "t": 4.625,
+ "part": "arp"
+ },
+ {
+ "t": 4.75,
+ "part": "arp"
+ },
+ {
+ "t": 4.875,
+ "part": "arp"
+ },
+ {
+ "t": 5.0,
+ "part": "arp"
+ },
+ {
+ "t": 5.0,
+ "part": "pulse"
+ },
+ {
+ "t": 5.125,
+ "part": "arp"
+ },
+ {
+ "t": 5.25,
+ "part": "arp"
+ },
+ {
+ "t": 5.375,
+ "part": "arp"
+ },
+ {
+ "t": 5.5,
+ "part": "arp"
+ },
+ {
+ "t": 5.5,
+ "part": "pulse"
+ },
+ {
+ "t": 5.625,
+ "part": "arp"
+ },
+ {
+ "t": 5.75,
+ "part": "arp"
+ },
+ {
+ "t": 5.875,
+ "part": "arp"
+ },
+ {
+ "t": 6.0,
+ "part": "arp"
+ },
+ {
+ "t": 6.0,
+ "part": "pulse"
+ },
+ {
+ "t": 6.125,
+ "part": "arp"
+ },
+ {
+ "t": 6.25,
+ "part": "arp"
+ },
+ {
+ "t": 6.375,
+ "part": "arp"
+ },
+ {
+ "t": 6.5,
+ "part": "arp"
+ },
+ {
+ "t": 6.5,
+ "part": "pulse"
+ },
+ {
+ "t": 6.625,
+ "part": "arp"
+ },
+ {
+ "t": 6.75,
+ "part": "arp"
+ },
+ {
+ "t": 6.875,
+ "part": "arp"
+ },
+ {
+ "t": 7.0,
+ "part": "arp"
+ },
+ {
+ "t": 7.0,
+ "part": "pulse"
+ },
+ {
+ "t": 7.125,
+ "part": "arp"
+ },
+ {
+ "t": 7.25,
+ "part": "arp"
+ },
+ {
+ "t": 7.375,
+ "part": "arp"
+ },
+ {
+ "t": 8.0,
+ "part": "arp"
+ },
+ {
+ "t": 8.0,
+ "part": "bass"
+ },
+ {
+ "t": 8.0,
+ "part": "chord"
+ },
+ {
+ "t": 8.125,
+ "part": "arp"
+ },
+ {
+ "t": 8.25,
+ "part": "arp"
+ },
+ {
+ "t": 8.25,
+ "part": "bass"
+ },
+ {
+ "t": 8.375,
+ "part": "arp"
+ },
+ {
+ "t": 8.5,
+ "part": "arp"
+ },
+ {
+ "t": 8.5,
+ "part": "bass"
+ },
+ {
+ "t": 8.625,
+ "part": "arp"
+ },
+ {
+ "t": 8.75,
+ "part": "arp"
+ },
+ {
+ "t": 8.75,
+ "part": "bass"
+ },
+ {
+ "t": 8.875,
+ "part": "arp"
+ },
+ {
+ "t": 9.0,
+ "part": "arp"
+ },
+ {
+ "t": 9.0,
+ "part": "bass"
+ },
+ {
+ "t": 9.125,
+ "part": "arp"
+ },
+ {
+ "t": 9.25,
+ "part": "arp"
+ },
+ {
+ "t": 9.25,
+ "part": "bass"
+ },
+ {
+ "t": 9.375,
+ "part": "arp"
+ },
+ {
+ "t": 9.5,
+ "part": "arp"
+ },
+ {
+ "t": 9.5,
+ "part": "bass"
+ },
+ {
+ "t": 9.625,
+ "part": "arp"
+ },
+ {
+ "t": 9.75,
+ "part": "arp"
+ },
+ {
+ "t": 9.75,
+ "part": "bass"
+ },
+ {
+ "t": 9.875,
+ "part": "arp"
+ },
+ {
+ "t": 10.0,
+ "part": "arp"
+ },
+ {
+ "t": 10.0,
+ "part": "bass"
+ },
+ {
+ "t": 10.0,
+ "part": "chord"
+ },
+ {
+ "t": 10.125,
+ "part": "arp"
+ },
+ {
+ "t": 10.25,
+ "part": "arp"
+ },
+ {
+ "t": 10.25,
+ "part": "bass"
+ },
+ {
+ "t": 10.375,
+ "part": "arp"
+ },
+ {
+ "t": 10.5,
+ "part": "arp"
+ },
+ {
+ "t": 10.5,
+ "part": "bass"
+ },
+ {
+ "t": 10.625,
+ "part": "arp"
+ },
+ {
+ "t": 10.75,
+ "part": "arp"
+ },
+ {
+ "t": 10.75,
+ "part": "bass"
+ },
+ {
+ "t": 10.875,
+ "part": "arp"
+ },
+ {
+ "t": 11.0,
+ "part": "arp"
+ },
+ {
+ "t": 11.0,
+ "part": "bass"
+ },
+ {
+ "t": 11.125,
+ "part": "arp"
+ },
+ {
+ "t": 11.25,
+ "part": "arp"
+ },
+ {
+ "t": 11.25,
+ "part": "bass"
+ },
+ {
+ "t": 11.375,
+ "part": "arp"
+ },
+ {
+ "t": 11.5,
+ "part": "arp"
+ },
+ {
+ "t": 11.5,
+ "part": "bass"
+ },
+ {
+ "t": 11.625,
+ "part": "arp"
+ },
+ {
+ "t": 11.75,
+ "part": "arp"
+ },
+ {
+ "t": 11.75,
+ "part": "bass"
+ },
+ {
+ "t": 11.875,
+ "part": "arp"
+ },
+ {
+ "t": 12.0,
+ "part": "arp"
+ },
+ {
+ "t": 12.0,
+ "part": "bass"
+ },
+ {
+ "t": 12.0,
+ "part": "chord"
+ },
+ {
+ "t": 12.125,
+ "part": "arp"
+ },
+ {
+ "t": 12.25,
+ "part": "arp"
+ },
+ {
+ "t": 12.25,
+ "part": "bass"
+ },
+ {
+ "t": 12.375,
+ "part": "arp"
+ },
+ {
+ "t": 12.5,
+ "part": "arp"
+ },
+ {
+ "t": 12.5,
+ "part": "bass"
+ },
+ {
+ "t": 12.625,
+ "part": "arp"
+ },
+ {
+ "t": 12.75,
+ "part": "arp"
+ },
+ {
+ "t": 12.75,
+ "part": "bass"
+ },
+ {
+ "t": 12.875,
+ "part": "arp"
+ },
+ {
+ "t": 13.0,
+ "part": "arp"
+ },
+ {
+ "t": 13.0,
+ "part": "bass"
+ },
+ {
+ "t": 13.125,
+ "part": "arp"
+ },
+ {
+ "t": 13.25,
+ "part": "arp"
+ },
+ {
+ "t": 13.25,
+ "part": "bass"
+ },
+ {
+ "t": 13.375,
+ "part": "arp"
+ },
+ {
+ "t": 13.5,
+ "part": "arp"
+ },
+ {
+ "t": 13.5,
+ "part": "bass"
+ },
+ {
+ "t": 13.625,
+ "part": "arp"
+ },
+ {
+ "t": 13.75,
+ "part": "arp"
+ },
+ {
+ "t": 13.75,
+ "part": "bass"
+ },
+ {
+ "t": 13.875,
+ "part": "arp"
+ },
+ {
+ "t": 14.0,
+ "part": "arp"
+ },
+ {
+ "t": 14.0,
+ "part": "bass"
+ },
+ {
+ "t": 14.0,
+ "part": "chord"
+ },
+ {
+ "t": 14.0,
+ "part": "hat"
+ },
+ {
+ "t": 14.125,
+ "part": "arp"
+ },
+ {
+ "t": 14.125,
+ "part": "hat"
+ },
+ {
+ "t": 14.25,
+ "part": "arp"
+ },
+ {
+ "t": 14.25,
+ "part": "bass"
+ },
+ {
+ "t": 14.25,
+ "part": "hat"
+ },
+ {
+ "t": 14.375,
+ "part": "arp"
+ },
+ {
+ "t": 14.375,
+ "part": "hat"
+ },
+ {
+ "t": 14.5,
+ "part": "arp"
+ },
+ {
+ "t": 14.5,
+ "part": "bass"
+ },
+ {
+ "t": 14.5,
+ "part": "hat"
+ },
+ {
+ "t": 14.625,
+ "part": "arp"
+ },
+ {
+ "t": 14.625,
+ "part": "hat"
+ },
+ {
+ "t": 14.75,
+ "part": "arp"
+ },
+ {
+ "t": 14.75,
+ "part": "bass"
+ },
+ {
+ "t": 14.75,
+ "part": "hat"
+ },
+ {
+ "t": 14.875,
+ "part": "arp"
+ },
+ {
+ "t": 14.875,
+ "part": "hat"
+ },
+ {
+ "t": 15.0,
+ "part": "arp"
+ },
+ {
+ "t": 15.0,
+ "part": "bass"
+ },
+ {
+ "t": 15.0,
+ "part": "hat"
+ },
+ {
+ "t": 15.125,
+ "part": "arp"
+ },
+ {
+ "t": 15.125,
+ "part": "hat"
+ },
+ {
+ "t": 15.25,
+ "part": "arp"
+ },
+ {
+ "t": 15.25,
+ "part": "bass"
+ },
+ {
+ "t": 15.25,
+ "part": "hat"
+ },
+ {
+ "t": 15.375,
+ "part": "arp"
+ },
+ {
+ "t": 15.375,
+ "part": "hat"
+ },
+ {
+ "t": 15.5,
+ "part": "arp"
+ },
+ {
+ "t": 15.5,
+ "part": "bass"
+ },
+ {
+ "t": 15.5,
+ "part": "hat"
+ },
+ {
+ "t": 15.625,
+ "part": "arp"
+ },
+ {
+ "t": 15.625,
+ "part": "hat"
+ },
+ {
+ "t": 15.75,
+ "part": "arp"
+ },
+ {
+ "t": 15.75,
+ "part": "bass"
+ },
+ {
+ "t": 15.75,
+ "part": "hat"
+ },
+ {
+ "t": 15.875,
+ "part": "arp"
+ },
+ {
+ "t": 15.875,
+ "part": "hat"
+ },
+ {
+ "t": 16.0,
+ "part": "arp"
+ },
+ {
+ "t": 16.0,
+ "part": "bass"
+ },
+ {
+ "t": 16.0,
+ "part": "chord"
+ },
+ {
+ "t": 16.0,
+ "part": "hat"
+ },
+ {
+ "t": 16.125,
+ "part": "arp"
+ },
+ {
+ "t": 16.125,
+ "part": "hat"
+ },
+ {
+ "t": 16.25,
+ "part": "arp"
+ },
+ {
+ "t": 16.25,
+ "part": "bass"
+ },
+ {
+ "t": 16.25,
+ "part": "hat"
+ },
+ {
+ "t": 16.375,
+ "part": "arp"
+ },
+ {
+ "t": 16.375,
+ "part": "hat"
+ },
+ {
+ "t": 16.5,
+ "part": "arp"
+ },
+ {
+ "t": 16.5,
+ "part": "bass"
+ },
+ {
+ "t": 16.5,
+ "part": "hat"
+ },
+ {
+ "t": 16.625,
+ "part": "arp"
+ },
+ {
+ "t": 16.625,
+ "part": "hat"
+ },
+ {
+ "t": 16.75,
+ "part": "arp"
+ },
+ {
+ "t": 16.75,
+ "part": "bass"
+ },
+ {
+ "t": 16.75,
+ "part": "hat"
+ },
+ {
+ "t": 16.875,
+ "part": "arp"
+ },
+ {
+ "t": 16.875,
+ "part": "hat"
+ },
+ {
+ "t": 17.0,
+ "part": "arp"
+ },
+ {
+ "t": 17.0,
+ "part": "bass"
+ },
+ {
+ "t": 17.0,
+ "part": "hat"
+ },
+ {
+ "t": 17.125,
+ "part": "arp"
+ },
+ {
+ "t": 17.125,
+ "part": "hat"
+ },
+ {
+ "t": 17.25,
+ "part": "arp"
+ },
+ {
+ "t": 17.25,
+ "part": "bass"
+ },
+ {
+ "t": 17.25,
+ "part": "hat"
+ },
+ {
+ "t": 17.375,
+ "part": "arp"
+ },
+ {
+ "t": 17.375,
+ "part": "hat"
+ },
+ {
+ "t": 17.5,
+ "part": "arp"
+ },
+ {
+ "t": 17.5,
+ "part": "bass"
+ },
+ {
+ "t": 17.5,
+ "part": "hat"
+ },
+ {
+ "t": 17.625,
+ "part": "arp"
+ },
+ {
+ "t": 17.625,
+ "part": "hat"
+ },
+ {
+ "t": 17.75,
+ "part": "arp"
+ },
+ {
+ "t": 17.75,
+ "part": "bass"
+ },
+ {
+ "t": 17.75,
+ "part": "hat"
+ },
+ {
+ "t": 17.875,
+ "part": "arp"
+ },
+ {
+ "t": 17.875,
+ "part": "hat"
+ },
+ {
+ "t": 18.0,
+ "part": "arp"
+ },
+ {
+ "t": 18.0,
+ "part": "bass"
+ },
+ {
+ "t": 18.0,
+ "part": "chord"
+ },
+ {
+ "t": 18.0,
+ "part": "hat"
+ },
+ {
+ "t": 18.125,
+ "part": "arp"
+ },
+ {
+ "t": 18.125,
+ "part": "hat"
+ },
+ {
+ "t": 18.25,
+ "part": "arp"
+ },
+ {
+ "t": 18.25,
+ "part": "bass"
+ },
+ {
+ "t": 18.25,
+ "part": "hat"
+ },
+ {
+ "t": 18.375,
+ "part": "arp"
+ },
+ {
+ "t": 18.375,
+ "part": "hat"
+ },
+ {
+ "t": 18.5,
+ "part": "arp"
+ },
+ {
+ "t": 18.5,
+ "part": "bass"
+ },
+ {
+ "t": 18.5,
+ "part": "clap"
+ },
+ {
+ "t": 18.5,
+ "part": "hat"
+ },
+ {
+ "t": 18.625,
+ "part": "arp"
+ },
+ {
+ "t": 18.625,
+ "part": "hat"
+ },
+ {
+ "t": 18.75,
+ "part": "arp"
+ },
+ {
+ "t": 18.75,
+ "part": "bass"
+ },
+ {
+ "t": 18.75,
+ "part": "hat"
+ },
+ {
+ "t": 18.875,
+ "part": "arp"
+ },
+ {
+ "t": 18.875,
+ "part": "hat"
+ },
+ {
+ "t": 19.0,
+ "part": "arp"
+ },
+ {
+ "t": 19.0,
+ "part": "bass"
+ },
+ {
+ "t": 19.0,
+ "part": "hat"
+ },
+ {
+ "t": 19.125,
+ "part": "arp"
+ },
+ {
+ "t": 19.125,
+ "part": "hat"
+ },
+ {
+ "t": 19.25,
+ "part": "arp"
+ },
+ {
+ "t": 19.25,
+ "part": "bass"
+ },
+ {
+ "t": 19.25,
+ "part": "hat"
+ },
+ {
+ "t": 19.375,
+ "part": "arp"
+ },
+ {
+ "t": 19.375,
+ "part": "hat"
+ },
+ {
+ "t": 19.5,
+ "part": "arp"
+ },
+ {
+ "t": 19.5,
+ "part": "bass"
+ },
+ {
+ "t": 19.5,
+ "part": "clap"
+ },
+ {
+ "t": 19.5,
+ "part": "hat"
+ },
+ {
+ "t": 19.625,
+ "part": "arp"
+ },
+ {
+ "t": 19.625,
+ "part": "hat"
+ },
+ {
+ "t": 19.75,
+ "part": "arp"
+ },
+ {
+ "t": 19.75,
+ "part": "bass"
+ },
+ {
+ "t": 19.75,
+ "part": "hat"
+ },
+ {
+ "t": 19.875,
+ "part": "arp"
+ },
+ {
+ "t": 19.875,
+ "part": "hat"
+ },
+ {
+ "t": 20.0,
+ "part": "arp"
+ },
+ {
+ "t": 20.0,
+ "part": "bass"
+ },
+ {
+ "t": 20.0,
+ "part": "chord"
+ },
+ {
+ "t": 20.0,
+ "part": "hat"
+ },
+ {
+ "t": 20.125,
+ "part": "arp"
+ },
+ {
+ "t": 20.125,
+ "part": "hat"
+ },
+ {
+ "t": 20.25,
+ "part": "arp"
+ },
+ {
+ "t": 20.25,
+ "part": "bass"
+ },
+ {
+ "t": 20.25,
+ "part": "hat"
+ },
+ {
+ "t": 20.375,
+ "part": "arp"
+ },
+ {
+ "t": 20.375,
+ "part": "hat"
+ },
+ {
+ "t": 20.5,
+ "part": "arp"
+ },
+ {
+ "t": 20.5,
+ "part": "bass"
+ },
+ {
+ "t": 20.5,
+ "part": "clap"
+ },
+ {
+ "t": 20.5,
+ "part": "hat"
+ },
+ {
+ "t": 20.625,
+ "part": "arp"
+ },
+ {
+ "t": 20.625,
+ "part": "hat"
+ },
+ {
+ "t": 20.75,
+ "part": "arp"
+ },
+ {
+ "t": 20.75,
+ "part": "bass"
+ },
+ {
+ "t": 20.75,
+ "part": "hat"
+ },
+ {
+ "t": 20.875,
+ "part": "arp"
+ },
+ {
+ "t": 20.875,
+ "part": "hat"
+ },
+ {
+ "t": 21.0,
+ "part": "arp"
+ },
+ {
+ "t": 21.0,
+ "part": "bass"
+ },
+ {
+ "t": 21.0,
+ "part": "hat"
+ },
+ {
+ "t": 21.125,
+ "part": "arp"
+ },
+ {
+ "t": 21.125,
+ "part": "hat"
+ },
+ {
+ "t": 21.25,
+ "part": "arp"
+ },
+ {
+ "t": 21.25,
+ "part": "bass"
+ },
+ {
+ "t": 21.25,
+ "part": "hat"
+ },
+ {
+ "t": 21.375,
+ "part": "arp"
+ },
+ {
+ "t": 21.375,
+ "part": "hat"
+ },
+ {
+ "t": 21.5,
+ "part": "arp"
+ },
+ {
+ "t": 21.5,
+ "part": "bass"
+ },
+ {
+ "t": 21.5,
+ "part": "clap"
+ },
+ {
+ "t": 21.5,
+ "part": "hat"
+ },
+ {
+ "t": 21.625,
+ "part": "arp"
+ },
+ {
+ "t": 21.625,
+ "part": "hat"
+ },
+ {
+ "t": 21.75,
+ "part": "arp"
+ },
+ {
+ "t": 21.75,
+ "part": "bass"
+ },
+ {
+ "t": 21.75,
+ "part": "hat"
+ },
+ {
+ "t": 21.875,
+ "part": "arp"
+ },
+ {
+ "t": 21.875,
+ "part": "hat"
+ },
+ {
+ "t": 22.0,
+ "part": "arp"
+ },
+ {
+ "t": 22.0,
+ "part": "bass"
+ },
+ {
+ "t": 22.0,
+ "part": "chord"
+ },
+ {
+ "t": 22.125,
+ "part": "arp"
+ },
+ {
+ "t": 22.25,
+ "part": "arp"
+ },
+ {
+ "t": 22.375,
+ "part": "arp"
+ },
+ {
+ "t": 22.5,
+ "part": "arp"
+ },
+ {
+ "t": 22.75,
+ "part": "arp"
+ },
+ {
+ "t": 23.0,
+ "part": "arp"
+ },
+ {
+ "t": 24.0,
+ "part": "arp"
+ },
+ {
+ "t": 24.0,
+ "part": "bass"
+ },
+ {
+ "t": 24.0,
+ "part": "chord"
+ },
+ {
+ "t": 24.0,
+ "part": "drop"
+ },
+ {
+ "t": 24.0,
+ "part": "hat"
+ },
+ {
+ "t": 24.0,
+ "part": "pulse"
+ },
+ {
+ "t": 24.0,
+ "part": "sub"
+ },
+ {
+ "t": 24.125,
+ "part": "arp"
+ },
+ {
+ "t": 24.125,
+ "part": "hat"
+ },
+ {
+ "t": 24.25,
+ "part": "arp"
+ },
+ {
+ "t": 24.25,
+ "part": "bass"
+ },
+ {
+ "t": 24.25,
+ "part": "hat"
+ },
+ {
+ "t": 24.375,
+ "part": "arp"
+ },
+ {
+ "t": 24.375,
+ "part": "hat"
+ },
+ {
+ "t": 24.5,
+ "part": "arp"
+ },
+ {
+ "t": 24.5,
+ "part": "bass"
+ },
+ {
+ "t": 24.5,
+ "part": "clap"
+ },
+ {
+ "t": 24.5,
+ "part": "hat"
+ },
+ {
+ "t": 24.5,
+ "part": "pulse"
+ },
+ {
+ "t": 24.625,
+ "part": "arp"
+ },
+ {
+ "t": 24.625,
+ "part": "hat"
+ },
+ {
+ "t": 24.75,
+ "part": "arp"
+ },
+ {
+ "t": 24.75,
+ "part": "bass"
+ },
+ {
+ "t": 24.75,
+ "part": "hat"
+ },
+ {
+ "t": 24.875,
+ "part": "arp"
+ },
+ {
+ "t": 24.875,
+ "part": "hat"
+ },
+ {
+ "t": 25.0,
+ "part": "arp"
+ },
+ {
+ "t": 25.0,
+ "part": "bass"
+ },
+ {
+ "t": 25.0,
+ "part": "hat"
+ },
+ {
+ "t": 25.0,
+ "part": "pulse"
+ },
+ {
+ "t": 25.125,
+ "part": "arp"
+ },
+ {
+ "t": 25.125,
+ "part": "hat"
+ },
+ {
+ "t": 25.25,
+ "part": "arp"
+ },
+ {
+ "t": 25.25,
+ "part": "bass"
+ },
+ {
+ "t": 25.25,
+ "part": "hat"
+ },
+ {
+ "t": 25.375,
+ "part": "arp"
+ },
+ {
+ "t": 25.375,
+ "part": "hat"
+ },
+ {
+ "t": 25.5,
+ "part": "arp"
+ },
+ {
+ "t": 25.5,
+ "part": "bass"
+ },
+ {
+ "t": 25.5,
+ "part": "clap"
+ },
+ {
+ "t": 25.5,
+ "part": "hat"
+ },
+ {
+ "t": 25.5,
+ "part": "pulse"
+ },
+ {
+ "t": 25.625,
+ "part": "arp"
+ },
+ {
+ "t": 25.625,
+ "part": "hat"
+ },
+ {
+ "t": 25.75,
+ "part": "arp"
+ },
+ {
+ "t": 25.75,
+ "part": "bass"
+ },
+ {
+ "t": 25.75,
+ "part": "hat"
+ },
+ {
+ "t": 25.875,
+ "part": "arp"
+ },
+ {
+ "t": 25.875,
+ "part": "hat"
+ },
+ {
+ "t": 26.0,
+ "part": "arp"
+ },
+ {
+ "t": 26.0,
+ "part": "bass"
+ },
+ {
+ "t": 26.0,
+ "part": "chord"
+ },
+ {
+ "t": 26.0,
+ "part": "hat"
+ },
+ {
+ "t": 26.0,
+ "part": "pulse"
+ },
+ {
+ "t": 26.0,
+ "part": "sub"
+ },
+ {
+ "t": 26.125,
+ "part": "arp"
+ },
+ {
+ "t": 26.125,
+ "part": "hat"
+ },
+ {
+ "t": 26.25,
+ "part": "arp"
+ },
+ {
+ "t": 26.25,
+ "part": "bass"
+ },
+ {
+ "t": 26.25,
+ "part": "hat"
+ },
+ {
+ "t": 26.375,
+ "part": "arp"
+ },
+ {
+ "t": 26.375,
+ "part": "hat"
+ },
+ {
+ "t": 26.5,
+ "part": "arp"
+ },
+ {
+ "t": 26.5,
+ "part": "bass"
+ },
+ {
+ "t": 26.5,
+ "part": "clap"
+ },
+ {
+ "t": 26.5,
+ "part": "hat"
+ },
+ {
+ "t": 26.5,
+ "part": "pulse"
+ },
+ {
+ "t": 26.625,
+ "part": "arp"
+ },
+ {
+ "t": 26.625,
+ "part": "hat"
+ },
+ {
+ "t": 26.75,
+ "part": "arp"
+ },
+ {
+ "t": 26.75,
+ "part": "bass"
+ },
+ {
+ "t": 26.75,
+ "part": "hat"
+ },
+ {
+ "t": 26.875,
+ "part": "arp"
+ },
+ {
+ "t": 26.875,
+ "part": "hat"
+ },
+ {
+ "t": 27.0,
+ "part": "arp"
+ },
+ {
+ "t": 27.0,
+ "part": "bass"
+ },
+ {
+ "t": 27.0,
+ "part": "hat"
+ },
+ {
+ "t": 27.0,
+ "part": "pulse"
+ },
+ {
+ "t": 27.125,
+ "part": "arp"
+ },
+ {
+ "t": 27.125,
+ "part": "hat"
+ },
+ {
+ "t": 27.25,
+ "part": "arp"
+ },
+ {
+ "t": 27.25,
+ "part": "bass"
+ },
+ {
+ "t": 27.25,
+ "part": "hat"
+ },
+ {
+ "t": 27.375,
+ "part": "arp"
+ },
+ {
+ "t": 27.375,
+ "part": "hat"
+ },
+ {
+ "t": 27.5,
+ "part": "arp"
+ },
+ {
+ "t": 27.5,
+ "part": "bass"
+ },
+ {
+ "t": 27.5,
+ "part": "clap"
+ },
+ {
+ "t": 27.5,
+ "part": "hat"
+ },
+ {
+ "t": 27.5,
+ "part": "pulse"
+ },
+ {
+ "t": 27.625,
+ "part": "arp"
+ },
+ {
+ "t": 27.625,
+ "part": "hat"
+ },
+ {
+ "t": 27.75,
+ "part": "arp"
+ },
+ {
+ "t": 27.75,
+ "part": "bass"
+ },
+ {
+ "t": 27.75,
+ "part": "hat"
+ },
+ {
+ "t": 27.875,
+ "part": "arp"
+ },
+ {
+ "t": 27.875,
+ "part": "hat"
+ },
+ {
+ "t": 28.0,
+ "part": "arp"
+ },
+ {
+ "t": 28.0,
+ "part": "chord"
+ },
+ {
+ "t": 28.0,
+ "part": "pulse"
+ },
+ {
+ "t": 28.25,
+ "part": "arp"
+ },
+ {
+ "t": 28.25,
+ "part": "hat"
+ },
+ {
+ "t": 28.5,
+ "part": "arp"
+ },
+ {
+ "t": 28.75,
+ "part": "arp"
+ },
+ {
+ "t": 28.75,
+ "part": "hat"
+ },
+ {
+ "t": 29.0,
+ "part": "arp"
+ },
+ {
+ "t": 29.0,
+ "part": "pulse"
+ },
+ {
+ "t": 29.25,
+ "part": "arp"
+ },
+ {
+ "t": 29.25,
+ "part": "hat"
+ },
+ {
+ "t": 29.5,
+ "part": "arp"
+ },
+ {
+ "t": 29.75,
+ "part": "arp"
+ },
+ {
+ "t": 29.75,
+ "part": "hat"
+ },
+ {
+ "t": 30.0,
+ "part": "arp"
+ },
+ {
+ "t": 30.0,
+ "part": "chord"
+ },
+ {
+ "t": 30.0,
+ "part": "pulse"
+ },
+ {
+ "t": 30.25,
+ "part": "arp"
+ },
+ {
+ "t": 30.25,
+ "part": "hat"
+ },
+ {
+ "t": 30.5,
+ "part": "arp"
+ },
+ {
+ "t": 30.75,
+ "part": "arp"
+ },
+ {
+ "t": 30.75,
+ "part": "hat"
+ },
+ {
+ "t": 31.0,
+ "part": "arp"
+ },
+ {
+ "t": 31.0,
+ "part": "pulse"
+ },
+ {
+ "t": 31.25,
+ "part": "arp"
+ },
+ {
+ "t": 31.25,
+ "part": "hat"
+ },
+ {
+ "t": 31.5,
+ "part": "arp"
+ },
+ {
+ "t": 31.75,
+ "part": "arp"
+ },
+ {
+ "t": 31.75,
+ "part": "hat"
+ },
+ {
+ "t": 32.0,
+ "part": "arp"
+ },
+ {
+ "t": 32.0,
+ "part": "chord"
+ },
+ {
+ "t": 32.0,
+ "part": "pulse"
+ },
+ {
+ "t": 32.25,
+ "part": "arp"
+ },
+ {
+ "t": 32.5,
+ "part": "arp"
+ },
+ {
+ "t": 32.75,
+ "part": "arp"
+ },
+ {
+ "t": 33.0,
+ "part": "arp"
+ },
+ {
+ "t": 33.0,
+ "part": "pulse"
+ },
+ {
+ "t": 33.25,
+ "part": "arp"
+ },
+ {
+ "t": 33.5,
+ "part": "arp"
+ },
+ {
+ "t": 33.75,
+ "part": "arp"
+ },
+ {
+ "t": 34.0,
+ "part": "arp"
+ },
+ {
+ "t": 34.0,
+ "part": "chord"
+ },
+ {
+ "t": 34.0,
+ "part": "pulse"
+ },
+ {
+ "t": 34.25,
+ "part": "arp"
+ },
+ {
+ "t": 34.5,
+ "part": "arp"
+ },
+ {
+ "t": 34.75,
+ "part": "arp"
+ },
+ {
+ "t": 35.0,
+ "part": "arp"
+ },
+ {
+ "t": 35.0,
+ "part": "pulse"
+ },
+ {
+ "t": 35.75,
+ "part": "arp"
+ },
+ {
+ "t": 36.0,
+ "part": "arp"
+ },
+ {
+ "t": 36.0,
+ "part": "chord"
+ },
+ {
+ "t": 36.75,
+ "part": "arp"
+ },
+ {
+ "t": 37.25,
+ "part": "arp"
+ }
+ ],
+ "silence": [
+ [
+ 7.5,
+ 8
+ ],
+ [
+ 23.5,
+ 24
+ ]
+ ]
+}
\ No newline at end of file
diff --git a/styles/hologram-hud/demo/music/score.py b/styles/hologram-hud/demo/music/score.py
new file mode 100644
index 0000000..4a8554d
--- /dev/null
+++ b/styles/hologram-hud/demo/music/score.py
@@ -0,0 +1,366 @@
+"""Volt · Spec Scan —— 原创电子配乐(numpy 合成,无采样)。
+读 ../timeline.json 排段落,输出 score.wav / score.json / ../out/music_stems/*.wav(分轨是中间产物,不进仓库)。
+120 BPM,4/4,D 小调(Dorian 色彩)。所有音符起点落在 1/16 网格(0.125 s)。
+"""
+import os, sys, json
+import numpy as np
+import soundfile as sf
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+ROOT = os.path.abspath(os.path.join(HERE, '..', '..', '..', '..'))
+sys.path.insert(0, ROOT)
+from core.audio.sfx import SR, bp, lp, hp, limit # noqa: E402
+from scipy.signal import butter, sosfilt # noqa: E402
+
+WORK = os.environ.get('HH_WORK') or os.path.join(HERE, '..') # 换内容时指向 out/<name>/
+OUTD = os.path.join(WORK, 'music'); os.makedirs(OUTD, exist_ok=True)
+TL = json.load(open(os.path.join(WORK, 'timeline.json')))
+BPM = TL.get('bpm', 120); BEAT = 60 / BPM; S16 = BEAT / 4; BAR = BEAT * 4
+DUR = float(TL['dur']); N = int(round(DUR * SR))
+I0, I1 = TL['intro']; R0, R1 = TL['regroup']; H0, H1 = TL['high']
+L0, L1 = TL['lock']; E0, E1 = TL['end']; CALLS = TL['calls']
+SIL = [[I1 - 0.5, I1], [R1 - 0.5, R1]]
+
+rng = np.random.default_rng(52)
+ONSETS = []
+
+
+def q(t):
+ """强制 1/16 网格"""
+ g = round(t / S16) * S16
+ assert abs(g - t) < 1e-6, f'off-grid onset {t}'
+ return round(g, 6)
+
+
+def mark(t, part): ONSETS.append({'t': q(t), 'part': part})
+
+
+def stereo(): return np.zeros((N, 2))
+
+
+def put(buf, x, at, gain=1.0, pan=0.0):
+ """x 单声道或 (n,2);等功率声像"""
+ s = int(round(at * SR))
+ if s >= N: return
+ if x.ndim == 1:
+ l, r = np.cos((pan + 1) * np.pi / 4) * 1.414, np.sin((pan + 1) * np.pi / 4) * 1.414
+ x = np.stack([x * l, x * r], 1)
+ e = min(N, s + len(x)); buf[s:e] += x[:e - s] * gain
+
+
+def hz(m): return 440.0 * 2 ** ((m - 69) / 12)
+
+
+def blep_saw(freq, n, ph0=0.0):
+ """polyBLEP 锯齿;freq 可为标量或逐样本数组"""
+ f = np.broadcast_to(np.asarray(freq, float), (n,)) if np.ndim(freq) == 0 else freq
+ dt = f / SR; p = (ph0 + np.cumsum(dt)) % 1.0
+ y = 2 * p - 1; o = np.zeros(n)
+ m = p < dt; x = p[m] / dt[m]; o[m] = x + x - x * x - 1
+ m = p > 1 - dt; x = (p[m] - 1) / dt[m]; o[m] = x * x + x + x + 1
+ return y - o
+
+
+def square(freq, n, ph0=0.0):
+ return 0.5 * (blep_saw(freq, n, ph0) - blep_saw(freq, n, ph0 + 0.5))
+
+
+def adsr(n, a=0.003, tau=0.1, rel=0.01):
+ t = np.arange(n) / SR
+ e = np.minimum(1, t / max(a, 1e-4)) * np.exp(-np.maximum(t - a, 0) / tau)
+ r = int(rel * SR)
+ if r > 0: e[-r:] *= np.linspace(1, 0, r)
+ return e
+
+
+# ---------- 和声 ----------
+# MIDI: D2=38 A1=33 D1=26
+CH = {
+ 'Dm9': [50, 53, 57, 60, 64], # D F A C E
+ 'Bbmaj7': [46, 50, 53, 57, 60], # Bb D F A C
+ 'Fmaj9': [53, 57, 60, 64, 67], # F A C E G
+ 'G6': [55, 59, 62, 64, 69], # G B D E A (Dorian 的 B 本位)
+}
+ROOTS = {'Dm9': 38, 'Bbmaj7': 34, 'Fmaj9': 41, 'G6': 43}
+CYCLE = ['Dm9', 'Bbmaj7', 'Fmaj9', 'G6']
+
+
+def in_(t, a, b): return a <= t < b - 1e-9
+
+
+def chord_at(t):
+ b = int(t // BAR)
+ if in_(t, H0, H1): return ['Dm9', 'Bbmaj7'][int((t - H0) // BAR) % 2]
+ if in_(t, E0, E1 + 1): return 'Bbmaj7' if t < E0 + BAR else 'Dm9'
+ if in_(t, I0, I1): return ['Dm9', 'Dm9', 'Bbmaj7', 'Dm9'][int((t - I0) // BAR) % 4]
+ return CYCLE[b % 4]
+
+
+def call_idx(t):
+ for c in CALLS:
+ if in_(t, c['t0'], c['t1']): return c['i']
+ return -1
+
+
+NC = len(CALLS)
+def has_hat(i): return i >= 1
+def has_clap(i): return i >= 2 or (NC == 2 and i == 1)
+
+
+# ---------- 各声部缓冲 ----------
+ARP, BASS, DRUM, PAD = stereo(), stereo(), stereo(), stereo()
+
+# 原创 16 步琶音音型:索引进五音集合,第二项为八度偏移
+PAT = [(0, 0), (2, 0), (4, 0), (1, 1), (3, 0), (0, 1), (2, 0), (4, 0),
+ (1, 0), (3, 1), (4, 0), (2, 1), (0, 0), (4, 1), (3, 0), (1, 0)]
+
+
+def arp_note(m, t, cutoff, vel, glide=0.0, length=0.28, tau=0.085):
+ n = int(length * SR)
+ f = hz(m) * np.ones(n)
+ if glide: f = hz(m) * 2 ** (glide * np.minimum(1, np.arange(n) / (0.4 * SR)) / 12)
+ ph = rng.random()
+ x = 0.7 * blep_saw(f, n, ph) + 0.35 * square(f * 1.003, n, ph) + 0.25 * np.sin(2 * np.pi * np.cumsum(f / 2) / SR)
+ x = sosfilt(butter(2, min(cutoff, 9000), 'low', fs=SR, output='sos'), x)
+ return x * adsr(n, 0.002, tau, 0.02) * vel
+
+
+def add_arp(t, step, cutoff, vel, oct_=0, rate16=True, glide=0.0, length=None, tau=None, keep=5):
+ idx, o = PAT[step % 16]
+ if idx >= keep: return
+ m = CH[chord_at(t)][idx] + 12 * (o + oct_) + 12 # 琶音在 D4 以上
+ L = length or (0.28 if rate16 else 0.45); T = tau or (0.085 if rate16 else 0.16)
+ put(ARP, arp_note(m, t, cutoff, vel, glide, L, T), t, 1.0, pan=0.35 if step % 2 else -0.35)
+ mark(t, 'arp')
+
+
+def grid(a, b, step):
+ k = int(round(a / S16)); out = []
+ while k * S16 < b - 1e-9:
+ out.append(k * S16); k += int(round(step / S16))
+ return out
+
+
+# 1) 引子:2.0 起十六分,400 Hz;4–8 慢慢打开
+for t in grid(I0 + 2.0, I1 - 0.5, S16):
+ u = max(0, (t - (I0 + 4)) / 4)
+ cut = 400 * (1 + 2.2 * u ** 1.5)
+ vel = 0.35 + 0.25 * min(1, (t - I0 - 2) / 2)
+ add_arp(t, int(round(t / S16)), cut, vel)
+
+# 2) 部件段:全开;第 3 个起升八度
+for c in CALLS:
+ for t in grid(c['t0'], c['t1'], S16):
+ up = 1 if c['i'] >= 2 else 0
+ add_arp(t, int(round(t / S16)), 2600 if not up else 3000, 0.62, oct_=up)
+
+# 3) 重组:十六分 → 八分 → 四分,末段下行滑音
+act_end = R1 - 0.5
+t16_end, t8_end = act_end - 1.0, act_end - 0.5
+for t in grid(R0, t16_end, S16): add_arp(t, int(round(t / S16)), 2200, 0.55)
+desc = [4, 2, 0]
+for j, t in enumerate(grid(t16_end, t8_end, 2 * S16)):
+ m = CH[chord_at(t)][desc[min(j, 2)]] + 12
+ put(ARP, arp_note(m, t, 1800, 0.55, 0, 0.45, 0.16), t, 1.0, pan=0.3 - 0.6 * j); mark(t, 'arp')
+for t in grid(t8_end, act_end, 4 * S16):
+ m = CH[chord_at(t)][0] + 12
+ put(ARP, arp_note(m, t, 1500, 0.55, glide=-12, length=0.5, tau=0.3), t, 1.0); mark(t, 'arp')
+
+# 4) 点亮:十六分全开,高八度层叠
+for t in grid(H0, H1, S16):
+ st = int(round(t / S16))
+ add_arp(t, st, 3200, 0.6)
+ if st % 2 == 0:
+ idx, o = PAT[st % 16]; m = CH[chord_at(t)][idx] + 24 + 12 * o
+ put(ARP, arp_note(m, t, 3500, 0.22), t, 1.0, pan=-0.6 if st % 4 else 0.6)
+
+# 5) 落版:八分(半速感),滤波回收
+for t in grid(L0, L1, 2 * S16):
+ u = (t - L0) / (L1 - L0)
+ add_arp(t, int(round(t / (2 * S16))), 2000 - 700 * u, 0.5, rate16=False)
+
+# 6) 片尾:八分,一个音一个音拿掉
+end_arp_stop = E1 - 1.5
+for t in grid(E0, end_arp_stop, 2 * S16):
+ u = (t - E0) / (end_arp_stop - E0)
+ keep = 5 - int(u * 5)
+ add_arp(t, int(round(t / (2 * S16))), 1300 - 500 * u, 0.45 * (1 - 0.4 * u), rate16=False, keep=keep)
+
+# ---------- 低频:脉冲 / 低音 / 808 ----------
+def pulse_hit(t, vel=1.0, click=False):
+ n = int(0.42 * SR); f = hz(26)
+ x = square(f, n) * 0.6 + np.sin(2 * np.pi * 2 * f * np.arange(n) / SR)
+ x = lp(x, 180) * adsr(n, 0.004, 0.13, 0.03)
+ if click:
+ k = np.arange(int(0.12 * SR)) / SR
+ kk = np.sin(2 * np.pi * np.cumsum(55 + 110 * np.exp(-k / 0.02)) / SR) * np.exp(-k / 0.05)
+ x[:len(kk)] += 0.9 * kk
+ put(BASS, x * vel, t); mark(t, 'pulse')
+
+
+for t in grid(I0 + 4, I1 - 0.5, BEAT): pulse_hit(t, 0.3 + 0.12 * (t - I0 - 4) / 4)
+for t in grid(H0, H1, BEAT): pulse_hit(t, 0.9, click=True)
+for t in grid(L0, L1, 2 * BEAT): pulse_hit(t, 0.7) # 半速
+for t in grid(E0, E0 + BAR, 2 * BEAT): pulse_hit(t, 0.5)
+
+# 原创八分低音音型(每小节 8 步,半音相对根音,限制在 A1..D2 一带)
+BPAT = [0, 0, -5, 0, 0, -2, 0, -5]
+BPAT2 = [0, 0, 0, 2, 0, -2, 0, 0]
+
+
+def bass_note(m, t, vel, length=0.24, cut=380):
+ n = int(length * SR); f = hz(m)
+ x = 0.8 * blep_saw(f, n) + 0.5 * square(f * 0.998, n) + 0.6 * np.sin(2 * np.pi * f * np.arange(n) / SR)
+ e = adsr(n, 0.003, 0.12, 0.02)
+ lo = lp(x, cut) * e; hi = lp(x, cut * 2.5) * e * np.exp(-np.arange(n) / SR / 0.03)
+ put(BASS, (lo + 0.5 * hi) * vel, t); mark(t, 'bass')
+
+
+def bass_root(t):
+ r = ROOTS[chord_at(t)]
+ while r > 38: r -= 12
+ while r < 33: r += 12
+ return r
+
+
+def bass_run(a, b, vel, pat):
+ for t in grid(a, b, 2 * S16):
+ st = int(round((t % BAR) / (2 * S16)))
+ bass_note(bass_root(t) + pat[st], t, vel)
+
+
+for c in CALLS: bass_run(c['t0'], c['t1'], 0.62 + 0.1 * min(c['i'], 2), BPAT if c['i'] % 2 == 0 else BPAT2)
+bass_run(H0, H1, 0.9, BPAT)
+bass_note(bass_root(R0), R0, 0.7, length=0.9, cut=300) # 重组:一记长音后撤
+
+
+def sub808(t, vel=1.0, length=1.9):
+ n = int(length * SR); k = np.arange(n) / SR
+ f = hz(26) * (1 + 1.0 * np.exp(-k / 0.05)) # D2→D1 下滑
+ x = np.tanh(2.2 * np.sin(2 * np.pi * np.cumsum(f) / SR)) * adsr(n, 0.002, 0.9, 0.2)
+ put(BASS, lp(x, 220, 4) * vel, t); mark(t, 'sub')
+
+
+sub808(H0, 1.0)
+sub808(H0 + BAR, 0.8, 1.9)
+
+# ---------- 鼓 ----------
+def hat(t, vel):
+ n = int(0.06 * SR); x = hp(rng.standard_normal(n), 7500, 4) * np.exp(-np.arange(n) / SR / 0.015)
+ put(DRUM, x * vel, t, pan=0.25); mark(t, 'hat')
+
+
+def clap(t, vel):
+ n = int(0.3 * SR); k = np.arange(n) / SR; nz = rng.standard_normal(n)
+ env = np.zeros(n)
+ for d in (0, 0.011, 0.022): env += (k >= d) * np.exp(-np.maximum(k - d, 0) / (0.012 if d < 0.02 else 0.11))
+ x = bp(nz, 900, 2600) * env * 0.6 + hp(nz, 5000) * env * 0.25
+ x += 0.4 * np.sin(2 * np.pi * 190 * k) * np.exp(-k / 0.04)
+ put(DRUM, x * vel, t, pan=-0.1); mark(t, 'clap')
+
+
+HATV = [1, .45, .7, .45]
+for c in CALLS:
+ if has_hat(c['i']):
+ for t in grid(c['t0'], c['t1'], S16): hat(t, 0.28 * HATV[int(round(t / S16)) % 4])
+ if has_clap(c['i']):
+ for t in grid(c['t0'] + BEAT, c['t1'], 2 * BEAT): clap(t, 0.55)
+for t in grid(H0, H1, S16): hat(t, 0.32 * HATV[int(round(t / S16)) % 4])
+for t in grid(H0 + BEAT, H1, 2 * BEAT): clap(t, 0.62)
+for t in grid(L0 + S16 * 2, L0 + 2 * BAR, BEAT): hat(t, 0.09) # 落版开头只留很轻的反拍 hat
+
+# drop 冲击:宽噪声 + 反向吸气无,直接砸
+k = np.arange(int(1.2 * SR)) / SR
+imp = hp(rng.standard_normal(len(k)), 300) * np.exp(-k / 0.18)
+imp = lp(imp, 6000)
+put(DRUM, np.stack([imp, np.roll(imp, 240)], 1) * 0.35, H0); mark(H0, 'drop')
+
+# ---------- 和弦垫 ----------
+def pad_chord(t, dur, name, bright, vel, wide=False, attack=0.3, voices=4):
+ n = int(dur * SR); out = np.zeros((n, 2))
+ det = np.linspace(-1, 1, voices)
+ for m in CH[name]:
+ for ch in (0, 1):
+ for d in det:
+ cents = d * (18 if wide else 7) * (1 if ch == 0 else -1) + (3 if ch else 0)
+ out[:, ch] += blep_saw(hz(m) * 2 ** (cents / 1200), n, rng.random())
+ out /= voices * 5
+ out = np.stack([lp(out[:, c], bright, 2) for c in (0, 1)], 1)
+ kk = np.arange(n) / SR
+ env = np.minimum(1, kk / attack) * np.minimum(1, (dur - kk) / 0.25)
+ return out * env[:, None] * vel
+
+
+def add_pad(a, b, bright, vel, wide=False, attack=0.3, voices=4):
+ for t in grid(a, b, BAR):
+ d = min(BAR, b - t) + 0.25 # 重叠 0.25 s 交叉淡化
+ put(PAD, pad_chord(t, d, chord_at(t), bright, vel, wide, attack, voices), t); mark(t, 'chord')
+
+
+# 引子:0–2.6 上行 pad(滤波上扫),之后维持
+n = int((I1 - I0) * SR); kk = np.arange(n) / SR
+x = pad_chord(I0, I1 - I0, 'Dm9', 1200, 1.0, attack=2.0)
+sweep = np.clip(kk / 2.6, 0, 1)
+lo = np.stack([lp(x[:, c], 350) for c in (0, 1)], 1)
+x = lo * (1 - sweep[:, None]) + x * sweep[:, None]
+x *= (0.35 + 0.25 * sweep)[:, None]
+put(PAD, x, I0); mark(I0, 'chord')
+for c in CALLS: add_pad(c['t0'], c['t1'], 900 + 250 * min(c['i'], 2), 0.3 + 0.08 * min(c['i'], 2))
+add_pad(R0, R1 - 0.5, 800, 0.35)
+add_pad(H0, H1, 3200, 1.0, wide=True, attack=0.01, voices=7)
+add_pad(L0, L1, 1100, 0.5, attack=0.5)
+# 片尾拖尾:一个长和弦 + 最后 Dm9
+put(PAD, pad_chord(E0, BAR + 0.25, chord_at(E0), 1000, 0.5, attack=0.2), E0); mark(E0, 'chord')
+put(PAD, pad_chord(E0 + BAR, E1 - E0 - BAR, 'Dm9', 900, 0.5, attack=0.3), E0 + BAR); mark(E0 + BAR, 'chord')
+
+# ---------- 处理:中频让位、分段延时、门、收尾 ----------
+def mid_dip(buf, amt):
+ return buf - amt * np.stack([bp(buf[:, c], 1000, 4000) for c in (0, 1)], 1)
+
+
+ARP = mid_dip(ARP, 0.45); PAD = mid_dip(PAD, 0.35)
+
+gate = np.ones(N); kk = np.arange(N) / SR
+for a, b in SIL:
+ fo = 0.06
+ gate[(kk >= a - fo) & (kk < a)] = np.linspace(1, 0, int(((kk >= a - fo) & (kk < a)).sum()))
+ gate[(kk >= a) & (kk < b)] = 0.0
+ fi = (kk >= b) & (kk < b + 0.003); gate[fi] = np.linspace(0, 1, fi.sum())
+# 片尾:拖尾到 dur 归零
+fade = (kk >= E0 + 1.0)
+gate[fade] *= np.clip((DUR - 0.02 - kk[fade]) / (DUR - 0.02 - E0 - 1.0), 0, 1) ** 1.6
+gate[kk >= DUR - 0.02] = 0
+
+ARP *= gate[:, None]
+# 乒乓延时(附点八分),按静音切段,尾巴不跨静音
+bounds = [0] + [int(x * SR) for s in SIL for x in s] + [N]
+wet = np.zeros_like(ARP); D = int(3 * S16 * SR)
+for i in range(0, len(bounds), 2):
+ s, e = bounds[i], bounds[i + 1]; seg = ARP[s:e]
+ for r in range(1, 4):
+ off = D * r
+ if off >= e - s: break
+ g = 0.28 * 0.5 ** (r - 1); ch = (r % 2)
+ src = lp(seg[:, 0] + seg[:, 1], 2500)[:e - s - off] * 0.5
+ wet[s + off:e, ch] += src * g
+ARP = ARP + wet
+
+stems = {'arp': ARP * gate[:, None] * 0.55, 'bass': BASS * gate[:, None] * 0.75,
+ 'drums': DRUM * gate[:, None] * 0.9, 'pad': PAD * gate[:, None] * 0.6}
+mix = sum(stems.values())
+ceil = 10 ** (-1.2 / 20)
+mix = np.stack([limit(mix[:, c], ceil) for c in (0, 1)], 1) * gate[:, None]
+pk = np.abs(mix).max()
+if pk > ceil:
+ mix *= ceil / pk
+ for k2 in stems: stems[k2] *= ceil / pk
+
+sf.write(os.path.join(OUTD, 'score.wav'), mix.astype(np.float32), SR, subtype='PCM_24')
+STEMS = os.path.join(WORK, 'out', 'music_stems')
+os.makedirs(STEMS, exist_ok=True)
+for k2, v in stems.items():
+ sf.write(os.path.join(STEMS, f'{k2}.wav'), v.astype(np.float32), SR, subtype='PCM_24')
+ONSETS.sort(key=lambda o: (o['t'], o['part']))
+json.dump({'bpm': BPM, 'dur': DUR, 'onsets': ONSETS, 'silence': SIL},
+ open(os.path.join(OUTD, 'score.json'), 'w'), indent=1)
+print(f'score.wav {DUR}s, {len(ONSETS)} onsets, peak {20*np.log10(np.abs(mix).max()):.2f} dBFS')
diff --git a/styles/hologram-hud/demo/timeline.json b/styles/hologram-hud/demo/timeline.json
new file mode 100644
index 0000000..2f3f617
--- /dev/null
+++ b/styles/hologram-hud/demo/timeline.json
@@ -0,0 +1,80 @@
+{
+ "bpm": 120,
+ "bar": 2,
+ "dur": 39,
+ "intro": [
+ 0,
+ 8
+ ],
+ "calls": [
+ {
+ "i": 0,
+ "part": "battery",
+ "mode": "push",
+ "t0": 8,
+ "t1": 14
+ },
+ {
+ "i": 1,
+ "part": "motor",
+ "mode": "orbit",
+ "t0": 14,
+ "t1": 18
+ },
+ {
+ "i": 2,
+ "part": "brakes",
+ "mode": "loupe",
+ "t0": 18,
+ "t1": 22
+ }
+ ],
+ "regroup": [
+ 22,
+ 24
+ ],
+ "high": [
+ 24,
+ 28
+ ],
+ "lock": [
+ 28,
+ 34
+ ],
+ "end": [
+ 34,
+ 39
+ ],
+ "vo": [
+ {
+ "id": "intro",
+ "t": 3,
+ "text": "This is Volt. A city e-bike, stripped to what matters.",
+ "d": 3.032
+ },
+ {
+ "id": "c0",
+ "t": 9,
+ "text": "The battery hides inside the down tube. Eighty kilometres on one charge.",
+ "d": 4.373
+ },
+ {
+ "id": "c1",
+ "t": 14.25,
+ "text": "A two hundred and fifty watt hub motor. Silent, and sealed.",
+ "d": 3.566
+ },
+ {
+ "id": "c2",
+ "t": 18.25,
+ "text": "Hydraulic disc brakes. Sure stops, even in the rain.",
+ "d": 3.29
+ },
+ {
+ "id": "outro",
+ "t": 29,
+ "text": "Seventeen point four kilos. Ready when you are.",
+ "d": 2.816
+ }
+ ]
+}
\ No newline at end of file
diff --git a/styles/hologram-hud/demo/tools/cuecheck.py b/styles/hologram-hud/demo/tools/cuecheck.py
new file mode 100644
index 0000000..7ae7c37
--- /dev/null
+++ b/styles/hologram-hud/demo/tools/cuecheck.py
@@ -0,0 +1,23 @@
+"""卡点自检:画面关键事件(锁定 / 数值确认 / 点亮 / 热点 / CTA / 旁白起点)↔ 配乐 onset 与静音区。
+用法(仓库根):.venv/bin/python styles/hologram-hud/demo/tools/cuecheck.py"""
+import os, json
+D = os.environ.get('HH_WORK') or os.path.join(os.path.dirname(os.path.abspath(__file__)), '..')
+EV = json.load(open(os.path.join(D, 'events.json')))['ev']
+S = json.load(open(os.path.join(D, 'music', 'score.json')))
+on = sorted(o['t'] for o in S['onsets'])
+near = lambda t: min(abs(t - x) for x in on)
+KEY = {'lock', 'confirm', 'ignite', 'ping', 'cta', 'confirm_small', 'detect', 'scan_done', 'leader', 'dock', 'vo'}
+bad, rows = 0, []
+for e in EV:
+ if e['type'] not in KEY: continue
+ g = abs(e['t'] / .125 - round(e['t'] / .125)) * .125 # 离 1/16 网格
+ d = near(e['t'])
+ ok = g < 1e-3 and d < 1 / 24
+ bad += not ok
+ rows.append(f"{'OK ' if ok else 'BAD'} {e['t']:7.3f} {e['type']:<14} grid {g*1000:5.1f}ms onset {d*1000:5.1f}ms")
+print('\n'.join(rows))
+sil = [(e['t'], e['t'] + e['d']) for e in EV if e['type'] == 'silence']
+for a, b in sil:
+ ms = [s for s in S.get('silence', []) if abs(s[0] - a) < .02 and abs(s[1] - b) < .02]
+ print(f"silence {a:.2f}-{b:.2f}: {'OK' if ms else 'BAD(配乐没有对应静音)'}"); bad += not ms
+print('mismatches:', bad)
diff --git a/styles/hologram-hud/demo/tools/export.mjs b/styles/hologram-hud/demo/tools/export.mjs
new file mode 100644
index 0000000..ee10c05
--- /dev/null
+++ b/styles/hologram-hud/demo/tools/export.mjs
@@ -0,0 +1,18 @@
+// 导出 events.json(音效事件)、timeline.json(配乐网格)、out/srt.json(字幕)
+// 用法(仓库根):node styles/hologram-hud/demo/tools/export.mjs [content.json] [工作目录,默认 demo/]
+import fs from 'fs'; import path from 'path'; import { fileURLToPath } from 'url';
+const D = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
+const ROOT = path.resolve(D, '../../..');
+process.chdir(ROOT);
+const { openDemo, closeServer } = await import(path.join(ROOT, 'core/render/page.mjs'));
+const rel = path.relative(ROOT, D);
+const content = process.argv[2] || 'content.json', W = path.resolve(process.argv[3] || D);
+const q = `content=${content}&voices=${path.relative(D, path.join(W, 'voices')) || 'voices'}`;
+const { browser, page } = await openDemo(rel, { q });
+const r = await page.evaluate(() => ({ dur: window.DUR, ev: window.EV, subs: window.SUBS, tl: window.TIMELINE }));
+fs.mkdirSync(path.join(W, 'out'), { recursive: true });
+fs.writeFileSync(path.join(W, 'events.json'), JSON.stringify({ dur: r.dur, ev: r.ev }));
+fs.writeFileSync(path.join(W, 'timeline.json'), JSON.stringify(r.tl, null, 1));
+fs.writeFileSync(path.join(W, 'out/srt.json'), JSON.stringify(r.subs, null, 1));
+console.log('events', r.ev.length, 'dur', r.dur);
+await browser.close(); closeServer();
diff --git a/styles/hologram-hud/demo/tools/final_asr.py b/styles/hologram-hud/demo/tools/final_asr.py
new file mode 100644
index 0000000..fc24c9f
--- /dev/null
+++ b/styles/hologram-hud/demo/tools/final_asr.py
@@ -0,0 +1,23 @@
+"""成片 whisper 抽查:按旁白时间从 mp4 切片转写(期望文本用 lines.json 的 asr 字段,没有就用 text),并算 300–4000 Hz 人声/背景 SNR。
+用法(仓库根):.venv/bin/python styles/hologram-hud/demo/tools/final_asr.py styles/hologram-hud/hologram-hud.mp4"""
+import sys, os, json, re, subprocess, numpy as np, soundfile as sf
+from faster_whisper import WhisperModel
+from scipy.signal import butter, sosfilt, resample_poly
+D = os.environ.get('HH_WORK') or os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+VO = {v['id']: v for v in json.load(open(os.path.join(D, 'timeline.json')))['vo']}
+lines = json.load(open(os.path.join(D, 'lines.json')))
+tmp = os.path.join(D, 'out', 'final_audio.wav')
+subprocess.run(['ffmpeg', '-v', 'error', '-y', '-i', sys.argv[1], '-ac', '1', '-ar', '16000', tmp], check=True)
+y, sr = sf.read(tmp); m = WhisperModel('base.en', device='cpu', compute_type='int8')
+norm = lambda s: re.sub(r'[^a-z0-9 ]', '', s.lower().replace('-', ' ')).split()
+sos = butter(4, [300, 4000], 'band', fs=sr, output='sos'); ok = 0
+for L in lines:
+ t0 = VO[L['id']]['t']; v, vs = sf.read(os.path.join(D, 'voices', L['id'] + '.wav')); v = resample_poly(v, sr, vs)
+ a, b = int((t0 - .3) * sr), int(t0 * sr) + len(v) + int(.3 * sr)
+ segs, _ = m.transcribe(y[a:b].astype(np.float32), beam_size=5, language='en')
+ got = ' '.join(s.text.strip() for s in segs); exp = L.get('asr', L['text']); good = norm(got) == norm(exp); ok += good
+ seg = y[int(t0 * sr):int(t0 * sr) + len(v)]; vb = sosfilt(sos, v[:len(seg)]); sb = sosfilt(sos, seg)
+ gain = np.dot(sb, vb) / (np.dot(vb, vb) + 1e-12); rest = sb - gain * vb
+ snr = 10 * np.log10(np.sum((gain * vb) ** 2) / (np.sum(rest ** 2) + 1e-12))
+ print(('OK ' if good else 'DIFF'), L['id'], f'SNR {snr:+.1f} dB |', exp, '→', got)
+print(f'{ok}/{len(lines)} OK')
diff --git a/styles/hologram-hud/demo/tools/make_lines.mjs b/styles/hologram-hud/demo/tools/make_lines.mjs
new file mode 100644
index 0000000..8a6ba58
--- /dev/null
+++ b/styles/hologram-hud/demo/tools/make_lines.mjs
@@ -0,0 +1,9 @@
+// content.json → lines.json(Kokoro 配音输入)。用法:node tools/make_lines.mjs [content.json] [lines.json] [voice覆盖]
+import fs from 'fs'; import path from 'path'; import { fileURLToPath } from 'url';
+const D = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
+const src = path.resolve(D, process.argv[2] || 'content.json'), out = process.argv[3] ? path.resolve(process.argv[3]) : path.join(D, 'lines.json'); // 输出路径相对当前目录
+const C = JSON.parse(fs.readFileSync(src, 'utf8'));
+const v = process.argv[4] || C.voice?.id || 'af_heart', sp = C.voice?.speed ?? 0.96;
+const L = [{ id: 'intro', text: C.intro_vo, asr: C.intro_vo_asr }, ...C.callouts.map((c, i) => ({ id: 'c' + i, text: c.vo, asr: c.vo_asr })), { id: 'outro', text: C.outro_vo, asr: C.outro_vo_asr }]
+ .filter(l => l.text).map(l => { const o = { ...l, voice: v, speed: sp }; if (!o.asr) delete o.asr; return o; });
+fs.writeFileSync(out, JSON.stringify(L, null, 1)); console.log(out, L.length, 'lines', v);
diff --git a/styles/hologram-hud/demo/voices/dur.json b/styles/hologram-hud/demo/voices/dur.json
new file mode 100644
index 0000000..bcb11c5
--- /dev/null
+++ b/styles/hologram-hud/demo/voices/dur.json
@@ -0,0 +1,7 @@
+{
+ "intro": 3.032,
+ "c0": 4.373,
+ "c1": 3.566,
+ "c2": 3.29,
+ "outro": 2.816
+}
\ No newline at end of file
diff --git a/styles/hologram-hud/demo/voices/words.json b/styles/hologram-hud/demo/voices/words.json
new file mode 100644
index 0000000..29e2a8d
--- /dev/null
+++ b/styles/hologram-hud/demo/voices/words.json
@@ -0,0 +1,247 @@
+{
+"intro": [
+[
+"This",
+-0.6,
+0.14
+],
+[
+"is",
+0.14,
+0.26
+],
+[
+"Volt,",
+0.26,
+0.52
+],
+[
+"a",
+0.9,
+0.98
+],
+[
+"city",
+0.98,
+1.18
+],
+[
+"e",
+1.18,
+1.4
+],
+[
+"-bike",
+1.4,
+1.6
+],
+[
+"stripped",
+1.6,
+2.04
+],
+[
+"to",
+2.04,
+2.3
+],
+[
+"what",
+2.3,
+2.42
+],
+[
+"matters.",
+2.42,
+2.72
+]
+],
+"c0": [
+[
+"The",
+-0.6,
+0.06
+],
+[
+"battery",
+0.06,
+0.34
+],
+[
+"hides",
+0.34,
+0.8
+],
+[
+"inside",
+0.8,
+1.2
+],
+[
+"the",
+1.2,
+1.4
+],
+[
+"down",
+1.4,
+1.56
+],
+[
+"tube,",
+1.56,
+1.8
+],
+[
+"80",
+2.48,
+2.64
+],
+[
+"kilometers",
+2.64,
+2.96
+],
+[
+"on",
+2.96,
+3.44
+],
+[
+"one",
+3.44,
+3.62
+],
+[
+"charge.",
+3.62,
+4.04
+]
+],
+"c1": [
+[
+"A",
+-0.6,
+0.06
+],
+[
+"250",
+0.06,
+0.3
+],
+[
+"-watt",
+0.3,
+1.28
+],
+[
+"hub",
+1.28,
+1.44
+],
+[
+"motor,",
+1.44,
+1.7
+],
+[
+"silent",
+2.24,
+2.48
+],
+[
+"and",
+2.48,
+2.98
+],
+[
+"sealed.",
+2.98,
+3.22
+]
+],
+"c2": [
+[
+"Hydraulic",
+-0.6,
+0.5
+],
+[
+"disc",
+0.5,
+0.68
+],
+[
+"brakes",
+0.68,
+1.0
+],
+[
+"sure",
+1.0,
+1.7
+],
+[
+"stops",
+1.7,
+2.12
+],
+[
+"even",
+2.12,
+2.52
+],
+[
+"in",
+2.52,
+2.68
+],
+[
+"the",
+2.68,
+2.76
+],
+[
+"rain.",
+2.76,
+3.0
+]
+],
+"outro": [
+[
+"17",
+-0.6,
+0.3
+],
+[
+".4",
+0.3,
+0.94
+],
+[
+"kilos,",
+0.94,
+1.52
+],
+[
+"ready",
+1.76,
+1.96
+],
+[
+"when",
+1.96,
+2.22
+],
+[
+"you",
+2.22,
+2.4
+],
+[
+"are.",
+2.4,
+2.6
+]
+]
+}
\ No newline at end of file
diff --git a/styles/hologram-hud/hologram-hud.srt b/styles/hologram-hud/hologram-hud.srt
new file mode 100644
index 0000000..d6ff8e0
--- /dev/null
+++ b/styles/hologram-hud/hologram-hud.srt
@@ -0,0 +1,19 @@
+1
+00:00:02,900 --> 00:00:06,632
+This is Volt. A city e-bike, stripped to what matters.
+
+2
+00:00:08,900 --> 00:00:13,973
+The battery hides inside the down tube. Eighty kilometres on one charge.
+
+3
+00:00:14,150 --> 00:00:18,130
+A two hundred and fifty watt hub motor. Silent, and sealed.
+
+4
+00:00:18,150 --> 00:00:22,140
+Hydraulic disc brakes. Sure stops, even in the rain.
+
+5
+00:00:28,900 --> 00:00:32,416
+Seventeen point four kilos. Ready when you are.
diff --git a/styles/hologram-hud/poster.jpg b/styles/hologram-hud/poster.jpg
new file mode 100644
index 0000000..3157369
Binary files /dev/null and b/styles/hologram-hud/poster.jpg differ
diff --git a/styles/midcentury-toon/STYLE.md b/styles/midcentury-toon/STYLE.md
new file mode 100644
index 0000000..64171db
--- /dev/null
+++ b/styles/midcentury-toon/STYLE.md
@@ -0,0 +1,205 @@
+# Mid-century Cartoon — Style Prompt
+
+> 1950s flat colour and limited animation for "follow along" films: colour printed a few pixels off its broken ink line, bodies that hold still while hands do the work, abstract colour-block rooms, a calm classroom narrator, and a cool-jazz combo with a vibraphone chord on every step.
+> Demo: *Meet Pip* (40.0 s) · `midcentury-toon.mp4` · source in `demo/` · a product set-up guide for a fictional robot vacuum. It fits a product page, a QR code on the box, or a help centre.
+> **References (grammar only):** UPA studio's early-1950s shorts (*Gerald McBoing-Boing*, *Rooty Toot Toot*): colour and line on separate cels, geometric people and furniture, backgrounds that are only colour planes, limited animation. The Coronet and Encyclopaedia Britannica classroom films of the 1950s: the "Meet ___." opening, one sentence per picture, numbered step cards, a summary card at the end. Charley Harper and Mary Blair: the atomic-age palette of soft complementary colours and the geometry of their figures and objects. 1950s appliance manuals and adverts: numbered medallions, curved pointer arrows, round detail call-outs, sunburst backgrounds. Never copy their characters, drawings, lettering or music, and never write their names in a film.
+
+You are directing a 30–40 second **scene film** in the **Mid-century Cartoon** style. A scene film does not tell a story. It performs a real use: a set-up guide, a how-to, a recipe card, a safety card. The user gives you the thing and its steps. You decide the shots, the timing, the sound and the score, and you deliver a finished film. The viewer should come away able to do the thing.
+
+---
+
+## 1. What this style is
+
+Flat, printed-looking colour with a thin, breathing ink line that never quite closes. **Every fill is a separate "cel" printed about (6, 4) px off its line**, and that offset re-rolls on twos (12 fps, ±1.6 px), so the picture shimmers like hand-registered paint while the camera glides at 24 fps. The fills carry a light dry-brush tooth; paper grain and a warm vignette sit over everything.
+
+People and things are geometric. June, the demo's new homeowner, has an egg head with a long pointed nose that is part of the face's outline, a bob with a mustard headband, a coral turtleneck and navy cigarette trousers. Her **body is a held drawing: only her arms, hands, eyes and mouth animate.** Hands are four-finger cartoon gloves (three fingers and a thumb) in four shapes: open, flat, point and grip. Rooms are not drawn. A scene is one colour plane, a floor band, a horizon line with gaps, and one or two props: a wall edge, a socket, a phone.
+
+It is not the 1930s rubber-hose cartoon: no black-and-white, no bouncing world, no hot jazz. It is not a whiteboard explainer: it shows *how to do*, not *why*. The pictures are printed, not written on.
+
+## 2. Use cases: what this style is for
+
+| Use case | Shot structure | Information layers (in order) | Hold per layer | Length |
+|---|---|---|---|---|
+| **Product set-up guide** (the demo) | Hook reveal → one scene per step (wide + round detail call-out) → payoff (the product working) → tip → poster lockup | product name → title → step title → step detail on the action beat → payoff caption → tip → CTA | title ≥ 4 s; step title the whole step; detail ≥ chars/12 + 1 s; lockup ≥ 3 s clean | 30–40 s, 2–5 steps |
+| **Safety / rules card** (lab, pool, flight) | One held figure; each rule is a medallion stamp, a single hand gesture and a pictogram | rule number → rule → one "why" detail | 3–4 s per rule | 20–40 s, 3–6 rules |
+| **Recipe or ritual card** (coffee, plant care) | Tabletop side view; each step a call-out circle on the hands; the payoff is a top view where the result becomes a pattern | step → quantity/time → result | 3–5 s per step | 30–45 s |
+| **Onboarding for an app or service** | June with a phone; the screen lives in the call-out circle; signal rings travel to the device | screen action → setting value → confirmation stamp | 3–4 s per action | 20–30 s |
+| **Store or event notice** | Colour-block wipes between 3 cards; one character presents | headline → time/place → CTA | ≥ 3 s per card | 15–25 s |
+
+The demo is the first use case. All five use the same engine: `shape()` for any prop, `drawOwner()` for the presenter, `drawHand()` for close-ups, `callout()` / `medallionAt()` / `tag()` for layers, and a top-view plan for the payoff.
+
+**How the native moves serve information (not story):**
+- **Off-register colour** makes a flat info card feel hand-made, and warm enough to sit on a product page. Keep it on everything, text included.
+- **Limited animation** points the eye. When the body is still, the hand is the only thing moving, and that hand *is* the step. Give every step one hand action with anticipation → action → follow-through, landing on a beat.
+- **The round call-out** (a manual's magnifier) is the close-up. The wide stays for context and the hands get big inside the circle. The step's data (50 cm, 2.4 GHz, one second) lands inside or on that circle on the action beat, never as a slide.
+- **The numbered medallion** is both a hierarchy marker and a door. It stamps onto the outgoing scene's subject, and the camera goes through it into the next step.
+- **The payoff turns function into ornament.** In the demo, the vacuum's real route (wall-follow, then boustrophedon lanes that flow around furniture, with a small curl at every turn, stars and dots between lanes) draws itself room by room, one room per beat. Stepping back, it reads as an atomic-age textile.
+
+## 3. Visual language
+
+**Palette (demo; every value is a content.json field):**
+
+| Role | Hex |
+|---|---|
+| Paper | `#F4EAD5` (shade `#E6D8BC`, `#D4C29F`) |
+| Ink (warm black) | `#2B2420` |
+| Coral (accent, June's sweater) | `#E4613F` / dark `#B8452B` |
+| Mustard (hook ground, belts, dots) | `#E8B43A` / light `#F3D37F` |
+| Turquoise (the product) | `#3FA7A0` / dark `#257A74` |
+| Dusty blue / avocado / pink / plum (step grounds) | `#7F9CC0` · `#A7AE5B` · `#F0B4A8` · `#6E4A6B` |
+| Navy (trousers) · hair · skin | `#3B4766` · `#3A2621` · `#F2C7A0` |
+| Kraft (box) | `#C9955D` / `#A2713F` / `#DDB47F` |
+
+- **One ground colour per scene**, lighter tint for walls (`tint(col, .45)`), darker shade for floors (`shade(col, .16)`). Never place the product on its own colour or June on coral/pink.
+- **Line:** 3–5 px ink ribbons with ±40 % width breathing and 12–25 % breaks. Characters: 4 px. Props: 3–4.5 px. Walls in plans: 6–7 px, broken. Hands: one 6 px outline around the union of palm and fingers, 2.4 px finger separations.
+- **Shading:** one flat darker plane clipped inside a shape (never a gradient). Drop shadows are a copy of the shape offset (12, 12) in a paper shade at 50 %.
+- **Ornaments:** 4-point atomic sparkles, 8–18-point starbursts, sunburst rays (30 wedges, 55 % alpha), boomerang and kidney shapes, polka dots.
+- **Type:** Oleo Script Bold for the kicker ("Meet Pip."); Alfa Slab One for titles, numerals and step headers (ink with a cream or colour plate offset 4–7 px); Jost 500/600 for body, details, labels and captions (letter-spaced caps for small labels).
+- **Grain:** light (mux grain 4) plus the paper overlay; the look is print, not film.
+
+## 4. Motion language
+
+- **On twos:** character poses, hand shapes and the colour-cel jitter change at 12 fps. The camera, iris wipes, arrows, the plan route and rays move at 24 fps.
+- **Held body, moving hands:** switch poses with a single in-between (for example reach → one in-between → ta-da). A hand action has anticipation (pull back or lift 20–60 px), a fast action (0.15–0.25 s, eased out), a follow-through (recoil 6–10 px, settle, hand lifts away) and lands exactly on a beat.
+- **Pop-ins:** medallions, tags, labels and titles scale in with a back-ease (0.24–0.3 s, overshoot 1.9).
+- **Kneel pose** (`kneel: true`): hips drop 150 units so flat hands can reach floor props. The arms are solved with 2-bone IK (`kneelPose()`) so the hands stay on the object while it moves.
+- **Lettering:** the kicker writes on left→right with a clip; headers slide in from the left on twos.
+
+## 5. Camera language
+
+The camera is always "the stand": pushes, trucks, tilts, pull-backs, never handheld. One transition grammar, **the circle**:
+
+| Move | Where in the demo | Why |
+|---|---|---|
+| Slow push 1.00 → 1.07 | Hook | Collects the eye onto the product on its stage |
+| **Iris through the medallion** (circle grows from the stamp to full frame, 0.9 beat) | Every step change | The step number *is* the door |
+| Truck right + gentle push | Step 1 wide | Follows the push toward the wall |
+| Round detail call-out (frame in frame, with a dashed leader line to its subject) | Every step | Constant line weight at close-up scale; context stays visible |
+| Push into the phone, then pan along the signal rings | Step 2 | From person → interface → device |
+| Tilt down with the finger | Step 3 | The press is the most important action; the finger leads the frame |
+| **Button → iris → top view** | Step 3 → payoff | The start button opens into the plan; circle to circle |
+| **Pull-back + counter-rotation, 5.4× → 1.0×, −6° → 0°** (signature) | Payoff | Scale reveal: one lane → a whole flat printed like a textile |
+| Colour-block wipe (side for the tip, bottom-up for the lockup) | Tip, lockup | Changes the "page" of the manual |
+| Dead still ≥ 3 s | Lockup | Tells the viewer: this frame is the one to screenshot |
+| **Iris-out onto the product**, end card inside a circle | End | The classic cartoon ending, and the last circle |
+
+Keep key subjects at ≥ 1/3 frame height and out of the bottom 140 px (the caption card).
+
+## 6. Sound
+
+Three layers, always:
+- **Ambience:** a warm room tone (low-passed brown noise, about −42 dB) and a very quiet mantel-clock tick on the half-note grid. In the payoff, the product's motor hum (a band-passed saw with a slow LFO plus brush hiss) takes over.
+- **Foley by material:** cardboard (creak, dull flap thumps pitched a semitone apart, a swish into a slap), appliance plastic (a bright knock with a short hollow body; the plug click), wood floor scrapes, rubber stamps (thick and damped) for every medallion, paper swishes for wipes, slide whistles for dimension arrows, rising sine pips for "connected", pen scratches when a room's route draws, the ink line peeling off paper, an iris "shhk".
+- **Music:** an original West-Coast cool-jazz combo at 132 BPM: vibraphone (chords, arpeggios, glissandi, motor tremolo), flute (melody), pizzicato upright bass (walking), brushes (a swirl plus 2 and 4, sticks on the ride for the payoff), a celesta colour. **Every step lands on its own vibraphone chord** (F6, B♭maj7, C9), and the lockup brings those chords back one per medallion, transposed. Not ragtime, not a spy big band, not piano and strings.
+- **Rhythm arc:** normal → double-time at the payoff (key up a whole step) → half-time for the tip (the breath) → normal for the lockup.
+- **Silences:** A (0–1.36 s): no music, only the box. B (the last beat before the press): *everything* off, ambience included, so the first sound after it is the most important one: the start click. C (before the lockup): room tone only. The first sound after silence C is the first medallion stamp.
+- **J/L cuts:** music enters before the reveal; each step's line starts half a beat before its iris; the motor starts 0.2 s before the payoff; the last Wi-Fi pip rings into step 3; the payoff's glissando tail rings into the tip.
+- **Mix:** narration compressed on top, music ducks 8 dB under it, foley unducked, −14 LUFS, true peak −1.2.
+
+## 7. Subtitles & titles
+
+- **Caption card:** a paper-coloured rounded slab with a thin ink border (its colour cel offset 5 px), a slowly turning coral 8-point star at each end, Jost 500 42 px in ink, centred 60 px above the bottom. It fades in over 0.16 s with a 10 px rise. Hold ≥ max(1.8 s, speech + 0.6 s, chars/12 + 1 s).
+- **Step header:** an ink disc with a paper numeral (Alfa Slab), a small letter-spaced "STEP n OF N", and the step title in Alfa Slab 64 px with a cream plate. It slides in on twos.
+- **Detail tags:** a paper card with an accent star bullet, Jost 36 px. It pops on the action beat, on or next to the call-out.
+- **Narrator:** calm classroom authority. The demo uses Kokoro `am_michael` at 0.94. `bm_george` was tried: whisper heard "dock" as "dark" in his British vowel. Keep lines to one clause: "Step one. Set the dock against a wall."
+- **End card** (after the lockup, inside the iris circle): film title, style name, `Lemo-Opuscar`, `LemoLab × Claude Opus 5.5`, asset credits.
+
+## 8. Pitfalls we hit
+
+1. **The route must obey the product.** Our first payoff looped over the sofa. Fix: wall-follow first, then lanes that bend around furniture as **potential-flow streamlines** (`laneY()`): lanes never cross and never enter an obstacle ellipse (furniture + 30 px). Keep obstacles away from walls; a streamline squeezed against a wall piles lanes on top of each other.
+2. **Don't lay the whole pattern at once.** Draw it room by room, one room per beat, with the camera pulling back. Then return home on a dotted line that also avoids furniture.
+3. **Nose inside the outline.** A nose drawn as a separate wedge looks like a paper cone glued on. Build the head as one open spline from the bridge round the skull to under the nose, then close it at the nose tip (`chain + tip`). In 3/4 view, place the far eye left of the bridge so it shows.
+4. **Arms from the shoulders.** Shoulders sit at the torso corners (±40–46, −384). Draw sleeves as a thick ink ribbon with a coral ribbon on top. Thin ink arms read as sticks coming out of the neck.
+5. **Glove hands need gaps.** Drawing the fingers as fat blobs turns the hand into a cloud. Stroke every part first and fill every part second (one union outline), with slender fingers (rx 12–13, ry 5) and separation lines.
+6. **Floor reach.** A standing figure's hands stop about 190 units under the shoulder. Kneel and solve the arms with IK instead of stretching them.
+7. **Line weight in close-ups.** Zooming the world camera 3× triples the ink. Put close-ups in a call-out circle drawn at native scale.
+8. **Detail text needs its reading time.** "Against a wall, 50 cm clear each side" did not fit its 3 s window. The data moved into `detail` ("50 cm clear on each side") and the wall into the title and the line.
+9. **The payoff route + a caption arrow can collide with labels.** Put room labels *under* the plan and the caption in the top margin.
+10. **Iris content at negative local time.** When a transition draws the next scene before its start, clamp `t` to just past the start (otherwise poses and pop-ins are undefined).
+
+## 9. Production recipe (this repo)
+
+1. `demo/content.json` holds every word, number, colour, the voice and the payoff plan. `python3 demo/tools/lines.py` turns it into `lines.json`.
+2. Kokoro (`core/tts/tts.py`) → `voices/` + `dur.json`; `asr_check.py` until every line is OK (step numbers are compared as digits).
+3. The timeline is built from content: hook 4 bars, each step ≥ 3 bars (from its voice length), the last step 2 bars, then payoff 3, tip 2, lockup 3 and end 2 bars at 132 BPM. Three steps = 22 bars = 40.0 s.
+4. The score (`music/score.py`, forked to a sub-agent with the cue map) → `score.wav`, stems and `hits.json`.
+5. `core/render/events.mjs` exports the same event times the pictures use. `tools/cuecheck.py` checks every hit against the half-beat grid and the score (0 off in the demo). `mix.py` builds foley, voice, ducking and the three silences.
+6. `tools/cues.mjs` → `.srt`; render with `core/render/video.mjs` (960 frames ≈ 30 s with 2 workers); `mux.sh … 24 4`.
+7. `sh demo/build.sh` does all of it; `sh demo/build.sh stills` renders the content-swap test.
+
+## 10. Engine usage
+
+`demo/engine/toon.js` (the style), `demo/engine/chars.js` (the presenter, hands and product), `demo/engine/icons.js` (18 icons). All functions draw in the current canvas transform.
+
+| Function | What it draws | Key params |
+|---|---|---|
+| `setClock(t)` | Sets the clock for the on-twos register jitter; call once per frame | `t` seconds |
+| `shape(ctx, pts, o)` | **Any shape in this style**: off-register fill + tooth + broken ink line | `fill`, `line` (px), `off` [dx,dy] (default: jittered `REG`), `grain` 0–1, `breaks` 0–1, `shade` [{pts,color,alpha}], `seed` |
+| `ink(ctx, pts, w, o)` | Pressure ink ribbon along a polyline | `closed`, `breaks`, `wob`, `taper`, `color`, `upto` 0–1 (draw-on) |
+| `plane(ctx, pts, fill)` | Lineless ground plane | `off`, `grain` |
+| `text(ctx, str, x, y, o)` | Two-plate lettering | `font`, `fill`, `plate` (off-register colour plate), `off`, `align`, `rot`, `maxW`, `track` |
+| `fit(ctx, str, fam, px, maxW, maxLines, minPx)` | Wraps, then shrinks to fit | returns `{font, px, lines}` |
+| `arrow(ctx, from, to, o)` | The moving manual arrow | `u` draw-on, `bob` beat phase, `bend`, `head`, `fill`, `dashedShaft` |
+| `star` / `sparkle` / `rays` / `atom` / `kidney` / `boomerang` | Mid-century ornaments | radius, points, rotation, fill |
+| `REG` | Global register: `{dx:6, dy:4, jit:1.6, on:true}` | set `REG.on = false` for crisp diagrams |
+| `drawOwner(ctx, pose, t)` | The presenter | `x,y,s,dir,view('front'/'q'/'side'/'back'),face('neutral'/'happy'/'wow'/'focus'/'wink'),armF/armB{a1,a2},handF/handB,kneel,blink,look,prop{kind:'phone'/'dock'/'cable'}` |
+| `drawHand(ctx, x, y, angle, kind, side, scale)` | Four-finger glove: `'open'`, `'flat'`, `'point'`, `'grip'` | — |
+| `drawPip(ctx, x, y, o)` | Round robot product | `view('side'/'top')`, `s`, `light`, `press`, `brush`, `ang`, `colors{product,productD,trim,light}` |
+| `icon(ctx, name, cx, cy, size, o)` | Icon library: dock, phone, start, cable, wifi, plug, water, beans, cup, filter, box, clock, check, leaf, key, bulb, spark, gear | `main`, `light`, `dark` |
+
+Film-level helpers in `film.js` you can lift: `callout()` (round detail view with a leader line), `medallionAt()` (numbered stamp), `tag()` (detail card), `stepHeader()`, the potential-flow `laneY()` + `buildPath()` route generator, and the transition block in `renderFilm()` (medallion iris, button iris, colour-block wipe, iris-out).
+
+**Minimal example: a warm-orange four-point spark with a cursor-tail, in this style** (the "only colour" slot: keep `fill` fixed while the scene recolours):
+```js
+import { setClock, shape, ink, sparkle, starPts, spline, PAL } from './engine/toon.js';
+setClock(t); // register jitter on twos
+ctx.fillStyle = PAL.paper; ctx.fillRect(0, 0, 1920, 1080);
+// the tail: a broken ink stroke that draws on
+ink(ctx, spline([[520, 700], [700, 640], [860, 560]], false, 10), 6, { upto: Math.min(1, t / 0.6), breaks: 0.2 });
+// the spark: any closed path -> off-register fill + breathing ink line
+const pts = [];
+for (let i = 0; i < 8; i++) { const a = i * Math.PI / 4 - Math.PI / 2, r = i % 2 ? 26 : 110; pts.push([960 + Math.cos(a) * r, 520 + Math.sin(a) * r]); }
+shape(ctx, pts, { fill: '#D97757', line: 4.5, grain: 0.3, breaks: 0.15 });
+sparkle(ctx, 1040, 440, 28, { fill: PAL.white });
+```
+
+## 11. Swap in your content
+
+Everything readable and every colour comes from `demo/content.json`. The page reads `?content=<file>` for tests.
+
+| Field | Type | Range | If out of range |
+|---|---|---|---|
+| `product` | string | 1–12 chars | Squeezed to fit on the box label (`maxW`) |
+| `kind` | string | free | Only for your own reference |
+| `title` / `subtitle` | string | ≤ 36 / ≤ 24 chars | Title wraps to 2 lines in the hook, shrinks to 50 px on the lockup |
+| `hook.kicker` / `hook.line` | string | ≤ 14 chars / one sentence | Kicker squeezed to 760 px; the line becomes the first caption |
+| `steps[]` | array | **2–5** | Each step adds ≥ 3 bars (5.45 s); the lockup row respaces (R 104 → 88 px beyond 3 steps). 4 steps ≈ 45 s: trim the tip or end card if you need ≤ 40 s |
+| `steps[].title` | string | ≤ 22 chars | Shrinks to 40 px (header), wraps to 2 lines (lockup) |
+| `steps[].detail` | string | ≤ 30 chars | Wraps to 2 lines; must be readable in its window (chars/12 + 1 s) |
+| `steps[].icon` | enum | the 18 icon names | Unknown → `spark` |
+| `steps[].action` | enum | `place` (push to a wall + clearance diagram; uses `measure`), `tap` (phone pairing, signal rings to the product), `press` (finger + hold ring); anything else → `show` (icon in hand, finger taps it in the call-out) | — |
+| `steps[].measure` | string | e.g. "50 cm" | Only for `place`; empty = arrows without labels |
+| `steps[].line` | string | one short sentence | Voice + caption; a long line lengthens its step |
+| `payoff.caption` | string | ≤ 40 chars | Shrinks to 26 px |
+| `payoff.plan` | object | `y0,y1`, `dock[x,y]`, `zones[]` (name, x0, x1, color, checks), `rug`, `items[]` (shape: sofa, kidney, boomerang, chair, plant, table, bed; x, y, s, rot, color, accent) in 1920×1080 plan px | Zones narrower than 400 px get the wall-follow loop only; items become flow obstacles automatically |
+| `tip.label/text/icon/line` | strings | text ≤ 40 chars | Header shrinks; the ribbon widens |
+| `outro.line` / `outro.cta` | string | cta ≤ 48 chars | CTA shrinks to 20 px |
+| `palette` | object | `paper, ink, product, productDark, accent, hook, steps[], tip` | Missing keys fall back to the demo palette |
+| `voice` | object | Kokoro `id`, `speed` | — |
+| `film` | object | `name, style, credits` | End card |
+
+**Steps to swap:** edit `content.json` → `sh demo/build.sh` (it rebuilds lines, voice + whisper check, events, mix, captions, video). The score is written for 22 bars; if your step count changes the length, rerun the music sub-agent with the new section table, or keep 3 steps.
+
+**Minimal example** (only what changes):
+```json
+{
+ "product": "Mo", "title": "Your New Robot Mower", "subtitle": "Set Up in 4 Steps",
+ "hook": { "kicker": "Meet Mo.", "line": "Meet Mo, your new robot mower." },
+ "steps": [
+ { "title": "Set the base station", "detail": "Level ground, 1 m clear in front", "icon": "dock", "action": "place", "measure": "1 m", "line": "Step one. Set the base station on level ground." },
+ { "title": "Peg the boundary wire", "detail": "30 cm in from the lawn edge", "icon": "cable", "action": "show", "line": "Step two. Peg the wire around the lawn." }
+ ],
+ "palette": { "product": "#E4613F", "accent": "#3FA7A0", "hook": "#7F9CC0" }
+}
+```
+`demo/content_alt.json` is the full version of that example (a 4-step robot mower on a garden plan); its stills are in `demo/stills/alt_*.jpg`.
diff --git a/styles/midcentury-toon/TREATMENT.md b/styles/midcentury-toon/TREATMENT.md
new file mode 100644
index 0000000..97e6de0
--- /dev/null
+++ b/styles/midcentury-toon/TREATMENT.md
@@ -0,0 +1,257 @@
+# Mid-century Cartoon · 导演方案(Treatment)
+
+**片名** *Meet Pip*(认识一下 Pip)
+**场景** 产品上手指南:*Your New Robot Vacuum · Set Up in 3 Steps*(虚构产品 Pip 扫地机器人)。放在产品页、包装盒二维码、帮助中心。
+**时长** 40.0 s(22 小节 @132 BPM;场景 36.4 s + 结尾卡 3.6 s)| **画幅** 1920×1080 | **帧率** 24 fps 输出;角色、道具按 12 fps on twos,机位、转场、线色错位的抖动永远 24 fps 平滑。
+**一句话** 1950 年代教育片口吻的说明书动画:一个盒子像舞台幕布一样打开,"Meet Pip." 三个步骤各用一个圆形字章开场、一个关键手部动作收尾;按下开始后,Pip 的清扫路径在俯视平面图上画成一整张 50 年代的圈点花布,花布最后变成落版海报的底边。
+**看完能说出** "我能拿这个做任何小家电 / 小工具的上手指南:三到五步,每步一个动作,一张能截图的总结页。"
+
+---
+
+## 一、对标:学什么 / 刻意不学什么
+
+| 对标 | 学什么(语法) | 刻意不学 |
+|---|---|---|
+| **UPA 工作室 50 年代有限动画**(*Gerald McBoing-Boing* 1950、*Rooty Toot Toot* 1951、*The Tell-Tale Heart* 1953) | ① 线和色是两张赛璐珞,色块故意错位几像素;② 背景只是抽象色块、一条不闭合的地平线,不画完整房间;③ 身体不动,只动手、嘴、眼睛(有限动画),一个姿势到下一个姿势用 1–2 张中间画"跳"过去;④ 场景切换靠整片背景色换掉 | 不用任何原作角色造型、剪影、配色组合、片头字体;不做原作的"声音当画面"梗 |
+| **Coronet / Encyclopaedia Britannica 50 年代教育短片** | 温和权威的旁白腔("Meet ___.")、每一步一张字卡、一句旁白对一个画面、结尾一张总结卡 | 不用任何片头标识、真实机构名;不模仿老胶片划痕 |
+| **Charley Harper、Mary Blair** 的配色与造型 | 原子时代的柔和对比色(芥末黄、珊瑚、土耳其蓝、牛油果绿、灰蓝、淡粉);几何化的人物与家具(回旋镖桌、肾形沙发、星芒植物) | 不照搬任何一幅画、任何动物造型 |
+| **50 年代印刷说明书 / 家电广告**(语法) | 编号圆章、弯曲的指示箭头、局部放大圆框、光芒放射背景 | 不出现任何品牌、商标、真实产品外形 |
+
+### 和库内风格的区别
+| 容易撞的 | 它是什么 | 本片怎么不一样 |
+|---|---|---|
+| **rubber-hose**(30 年代橡皮管卡通) | 黑白、满屏弹跳、每个物体都在跳舞、热爵士大乐队 | 本片是 **50 年代彩色扁平 + 有限动画**:身体静止,只动手和道具;线色分离错位;颜色是原子时代柔和对比色;配乐是冷爵士小乐队(颤音琴 + 长笛 + 刷子鼓),不是 ragtime / 热爵士 |
+| **scifi-toon**(科幻情景卡通) | 粗描边沸腾线、对白喜剧、传送门 | 本片线条细而断续、不沸腾;没有对白喜剧,是旁白讲解"跟着做";没有发光、没有科幻道具 |
+| **whiteboard**(白板讲解) | 在白板上边讲边写、讲**原理** | 本片讲**操作步骤**(跟着做),一步一个动作;画面是印刷色块与纸感,不是书写过程 |
+| **iso-infographic / dark-keynote / living-screencast** 等已有场景 | 咖啡产地旅程、产品发布会、Claude Code 教程 | 本片的场景是"新买的东西三步装好"(上手指南 / 快速入门),不是发布、不是流程图、不是软件录屏 |
+
+---
+
+## 二、信息弧(替代情绪弧)
+
+| 层 | 内容(全部来自 content.json) | 上场方式 | 停留 |
+|---|---|---|---|
+| 0 钩子 | 盒子两扇门像舞台幕布一样甩开 | 第 1 帧门已经在转;0.45 s 左门落定、0.91 s 右门落定;1.36 s 背板倒下 → 光芒 + 奶油色聚光圆盘弹开 | — |
+| 1 主标题 | `hook.kicker` "Meet Pip." → `title` "Your New Robot Vacuum" → `subtitle` "SET UP IN 3 STEPS" | 1.82 s 手写体从左向右写出(和 Pip 的一跳同拍);2.73 s 厚衬线标题弹入;3.64 s 黑底胶囊副标 | 4.5 s(阅读需 4.2 s) |
+| 2 关键步骤 | `steps[i].title` + 大号编号圆章 | 每步第 1 拍:圆章"盖"下来,镜头穿过圆章进入该步 | 每步 3.6–5.5 s |
+| 3 细节数据 | `steps[i].detail`(50 cm、2.4 GHz、1 秒) | 每步第 3 拍:手部动作特写(画中画圆框)+ 会动的说明书箭头 + 数据标签 | ≥ 字数/12+1 s |
+| **高点** | 按下开始 → 清扫路径在平面图上画成一整张圈点花布 | 按键前 1 拍全静 → "咔"+ 全乐队升调;镜头从 Pip 的特写一路拉远成整张平面图 | 5.5 s |
+| 4 贴士 | `tip.text` "Pick up loose cables first." | 色块整片滑换 + "TIP" 星芒章敲下;June 拎起一根线(线就是墨线) | 3.6 s |
+| 5 落版 | 标题 + 三个步骤圆章 + 细节 + 贴士 + `outro.cta`,底边是刚才那张花布 | 三个圆章按拍落位(复用三步的颤音琴和弦),标题最后砸下;然后全部静止 | **4.1 s 全信息同时在场**(字幕在 33.9 s 退场,之后 2.5 s 纯净可截图) |
+| 结尾卡 | 片名、风格名、Lemo-Opuscar、LemoLab × Claude Opus 5.5、素材署名 | 圆形光圈(iris-out)收在 Pip 身上,再在圆里展开结尾卡 | 3.6 s |
+
+**一个高点**:全片只有一次原生招式的大爆发——按下开始(信息最重要的一刻:机器真正开始工作),路径即图案。
+
+---
+
+## 三、原生招式
+
+1. **线色错位(贯穿)**:每个形状 = 墨线层 + 色块层,色块层整体偏移约 (6, 4) px,并在 on twos 的每一张画上重新抖 ±1.6 px;墨线有粗细呼吸和故意的断笔,永远不完全闭合。文字也是两版套印(墨版 + 色版错位)。
+2. **有限动画**:June 的身体是一张"held drawing",只有手臂、手、眼、嘴、道具在动;姿势之间只给 1–2 张中间画,12 fps 步进。机位和光一直 24 fps 平滑——这个"画面在跳、镜头在滑"的反差就是 50 年代的味道。
+3. **抽象背景**:没有完整房间。每一步只有一整块底色 + 一条不闭合的地平线 + 一两个道具(插座、墙脚线)。场景切换 = 底色整片换掉。
+4. **会动的说明书箭头**:弯曲墨线箭杆自己画出来,实心箭头按拍子"点头"(回拉 18%),虚线箭杆的点会顺着方向走。
+5. **高点:路径即花布**(签名镜头):Pip 用"螺旋清扫"模式走过整个平面图,路径是一条拉长的次摆线(prolate trochoid),每走一个圈,圈心"啵"地弹出一颗芥末黄圆点(吸走的灰尘)。拉远之后,整张平面图是一块 50 年代圈点印花布。这块布随后变成落版海报的底边——**打扫本身就是装饰**,只有这种"色块 + 墨线图案"的媒介能把功能画成纹样。
+
+---
+
+## 四、角色与道具(关卡 1 设定表:`demo/stills/modelsheet_v1.jpg`)
+
+- **June(主人)**:几何化的 50 年代女性,约 600 px 高(s=1)。蛋形头 + UPA 式长尖鼻(打破轮廓)、深棕波波头外翻、芥末黄发带;珊瑚红 A 字摆连衣裙 + 白圆点 + 白色裙边条纹、白色小圆领、芥末黄腰带;两条细墨线腿、尖头平底鞋;手臂是细墨线,手是连指手套形。
+ - 表情:平静 / 开心(眯眼张嘴)/ 惊讶(圆眼 O 嘴)/ 专注(眉头下压、舌尖)/ 心领神会(单眼眨)。
+ - 关键姿势:TA-DA(双臂上举)、TAP(单手举手机、拇指点)、TIP!(食指竖起)。
+ - 规则:身体不动,只动手臂;转面只有 正面 / 3/4 / 侧面 / 背面 四张。
+- **Pip(产品)**:圆盘形扫地机,土耳其蓝顶盖 + 奶油色保险杠 + 一圈镀铬条;顶上一个奶油色电源键;前脸一颗珊瑚色"眼睛"状态灯;两只星号形边刷。侧视(3/4 俯角)和俯视两套画法;状态:灯灭 / 灯亮 / 按键按下。
+- **充电座**:50 年代收音机式的奶油色梯形,土耳其蓝格栅,两片镀铬触点。
+- **色板**:纸 `#F4EAD5` · 墨 `#2B2420` · 珊瑚 `#E4613F` · 芥末 `#E8B43A` · 土耳其蓝 `#3FA7A0` · 灰蓝 `#7F9CC0` · 牛油果 `#A7AE5B` · 淡粉 `#F0B4A8` · 李子紫 `#6E4A6B` · 发色 `#3A2621` · 肤色 `#F2C7A0`。
+ - 同色叠加检查:Pip(蓝绿)不上土耳其蓝底;June(珊瑚)不上珊瑚 / 淡粉底;每步底色与主体至少差一个明度档。
+
+---
+
+## 五、镜头表
+
+统一转场语法 = **"圆"**:Pip 是圆的,步骤编号是圆章,局部放大是圆框,结尾是圆形光圈。每次换场都穿过一个圆。
+
+| # | 段落 | 景别 / 角度 | 运动 | 时长 | 为什么 |
+|---|---|---|---|---|---|
+| 1 | 钩子:开箱 | 全景,平视正面(舞台式) | **慢推** 1.00 → 1.07,中心压在 Pip 上 | 7.27 s | 正面对称 = 舞台;推镜把注意力从盒子收到 Pip |
+| T1 | → 第 1 步 | — | **穿圆**:编号圆章"1"盖在 Pip 顶盖正中(圆对圆),镜头 6 帧冲进圆章,圆章内侧就是下一场的灰蓝底 | 0.45 s | 圆章 = 信息层级的标记,也是门 |
+| 2 | 第 1 步:放充电座 | 全景侧面 → 画中画圆框特写 | **横移**:沿一面抽象墙从左向右移 600 px 跟 June 端着充电座走到插座边;第 3 拍右侧滑入圆形"放大镜"框(画框中的画框),里面是充电座贴墙 + 两侧"50 cm"尺寸箭头长出来 | 5.45 s | 横移 = 在墙边找位置;放大圆框 = 说明书的局部详图 |
+| T2 | → 第 2 步 | — | 穿圆"2"(圆章盖在放大圆框上) | 0.45 s | |
+| 3 | 第 2 步:连 app | 中景 3/4 → 手机屏特写 | **推**:从 June 半身推到她手里的手机,手机屏变成满屏画中画;拇指按拍点两下,Wi-Fi 同心弧按拍向右扩散三圈,右下角 Pip 的灯按同样三拍闪三下,盖"✓" | 5.45 s | 推镜 = 注意力从人到界面;三拍扩散 = 信号"过去了" |
+| T3 | → 第 3 步 | — | 穿圆"3"(圆章盖在 Wi-Fi 圆心上) | 0.45 s | |
+| 4 | 第 3 步:按开始 | 特写,3/4 俯角 Pip 顶盖(占画高 55%) | **下摇**(tilt down):从 June 竖起的食指摇到按键;手指预备(抬高、停住)→ 按下 → 按住,按键周围一圈"1 秒"进度环按两拍画满 | 3.64 s | 按下是全片最重要的动作:特写 + 预备 + 全静 |
+| T4 | → 高点 | — | **匹配转场**:3/4 的 Pip 顶盖在画面同一位置旋转压平成俯视圆盘(圆对圆),牛油果底色整片换成平面图 | 0.3 s | 视角从"人看机器"变成"机器看房间" |
+| 5 | **高点:路径花布**(签名镜头) | 俯视,特写 → 全景 | **拉远 + 反旋转**:2.5× 贴着 Pip 走第一圈(第 1 小节慢),然后路径加速、镜头一路拉到 1.0× 同时从 −7° 转正,揭示整张平面图 = 一块圈点花布;房间名和说明标签("Pip maps the room as it goes" + 箭头指向 Pip)在第 2 小节上场 | 5.45 s | 尺度揭示:一个小圈 → 一整块布 |
+| 6 | 贴士 | 中近景侧面 | **色块滑换**(淡粉整块从右滑进来盖住平面图)+ 轻微**上移**:June 用两根手指从画面上"揭起"一根线——这根线只是墨线层,被揭走后色块层留下一道淡影;"TIP"星芒章敲下 | 3.64 s | 呼吸段:慢一半,一个动作,一句话 |
+| 7 | 落版 | 全景正面(海报) | **组装**:三枚圆章在第 1/2/3 拍依次落位、箭头画出、标题第 4 拍砸下、花布从底边升起;然后镜头完全静止 ≥ 3 s | 5.45 s | 全片唯一一次机位完全不动 = "可以截图了" |
+| 8 | 结尾卡 | — | **iris-out**:圆形光圈收在右下角的 Pip 身上,圆里展开结尾卡 | 3.64 s | 50 年代卡通的经典收尾,也是"圆"语法的最后一次 |
+
+镜头运动种类:推、横移、下摇、拉远 + 旋转、穿圆(变焦转场)、匹配旋转、色块滑换、iris-out ——≥ 4 种;景别:全 / 中 / 特写 / 俯视大全。
+关键时刻主体高度:开箱 Pip + 盒子 ≈ 1/3 画高、June ≈ 55%;第 3 步 Pip 顶盖 55%;落版主体(圆章行)≈ 1/3。
+
+---
+
+## 六、分镜节拍表(按秒,132 BPM:1 拍 = 0.4545 s,1 小节 = 1.818 s)
+
+| 时间 (s) | 小节.拍 | 画面 / 表演 | 声音 |
+|---|---|---|---|
+| 0.00 | 1.1 | 第 1 帧:盒子两扇门已经在转,顶盖两片纸板在抖;June 在右侧双手伸向盒子(惊讶脸) | 纸板吱呀;**无音乐**(静音 A 开始) |
+| 0.45 | 1.2 | 左门甩到底,回弹一下 | 纸板"嘭"(低频、闷) |
+| 0.91 | 1.3 | 右门甩到底 | 纸板"嘭"(高半度) |
+| 1.36 | 1.4 | 背板向后倒下,光芒 + 奶油圆盘弹开,6 颗星芒依次亮 | 颤音琴上行刮奏 + 吊镲渐强(音乐从这里进来 = J-cut) |
+| 1.82 | 2.1 | **Pip 灯亮、原地一跳**;June 切到 TA-DA(中间 1 张过渡);"Meet Pip." 从左向右写出 | 全乐队 "ta-da" 和弦(F6/9)+ 状态灯"叮" |
+| 2.0–4.6 | | 旁白 "Meet Pip, your new robot vacuum."(字幕同步) | 旁白;音乐闪避 −8 dB |
+| 2.73 | 2.3 | "Your New Robot Vacuum" 弹入 | 木鱼"嗒" |
+| 3.64 | 3.1 | "SET UP IN 3 STEPS" 胶囊 | 刷子军鼓一抹 |
+| 3.6–7.0 | | June 眨眼(2.9 s)、手臂落回;镜头继续慢推 | 长笛主题 A |
+| 6.82 | 4.4 | 编号圆章"1"盖在 Pip 顶盖上 | 橡皮章"嗵" |
+| 7.27 | 5.1 | 穿圆进入第 1 步(灰蓝底);步骤标题 "Place the dock" + 圆章缩到左上角 | 颤音琴和弦 F6(第 1 步和弦) |
+| 7.5–10.2 | | 旁白 "Step one. Set the dock against a wall." ;June 端着充电座,镜头横移跟到插座边 | 脚步不出声(有限动画);横移时轻微空气声 |
+| 8.18 | 5.3 | 她的双臂落下 = 充电座落地贴墙 | 塑料"咚"(木地板) |
+| 8.64 | 5.4 | 插头插进插座 | 插头"咔" |
+| 9.09 | 6.1 | 放大圆框从右滑入;"50 cm" 两个尺寸箭头从充电座两侧长出 | 两声滑哨上行(左、右声像) |
+| 9.5–12.7 | | 细节标签 "Against a wall, 50 cm clear each side";箭头按拍点头 | 箭头每次点头 = 钢片琴轻点 |
+| 12.27 | 7.4 | 圆章"2"盖在放大圆框上 | 橡皮章"嗵" |
+| 12.73 | 8.1 | 穿圆进入第 2 步(芥末底);"Connect the app" | 颤音琴和弦 B♭maj7 |
+| 12.9–15.6 | | 旁白 "Step two. Open the app and add Pip.";June 中景举手机(专注脸 + 舌尖),镜头推向手机 | |
+| 14.55 / 15.0 | 9.1 / 9.2 | 拇指点两下("Add Pip" 按钮) | 两声软塑料"嗒" |
+| 15.45 / 15.9 / 16.36 | 9.3 / 9.4 / 10.1 | Wi-Fi 弧三圈扩散;Pip 灯同拍闪三下;第三下盖 ✓ | 三声递升的"哔"(正弦 + 钢片琴),✓ = 印章 |
+| 16.4–18.2 | | 细节标签 "Home Wi-Fi, 2.4 GHz" | 第三声"哔"的尾音拖进下一场(L-cut) |
+| 17.73 | 10.4 | 圆章"3"盖在 Wi-Fi 圆心上 | 橡皮章"嗵" |
+| 18.18 | 11.1 | 穿圆进入第 3 步(牛油果底);Pip 顶盖特写;"Press start" | 颤音琴和弦 C9 |
+| 18.3–19.9 | | 旁白 "Step three. Press start.";镜头从 June 的食指下摇到按键;手指抬高(预备) | 贝斯半音爬升(紧张) |
+| 20.45 | 12.2 | 手指按下,按住;进度环开始画 | 按键"咔"(第一声,轻);**全静音 B 从 20.9 开始**:音乐和环境全部抽掉,只剩进度环极轻的"嘶" |
+| 21.36 | 12.4 | 进度环画满,"Hold for one second" 标签 | 静 |
+| **21.82** | **13.1** | **高点**:状态灯亮,匹配转场成俯视 | **"咔—叮"+ 全乐队回来并升一个全音(F → G),切到双倍时值(刷子换鼓棒敲叮叮镲,贝斯走八分)**;Pip 马达嗡声在 21.6 提前进(J-cut) |
+| 21.8–23.6 | 13 | 2.5× 贴着 Pip 走出充电座、画第一圈;每个圈 = 颤音琴一个音 | 马达嗡 + 边刷沙沙 + 颤音琴琶音 |
+| 23.6–27.3 | 14–15 | 路径加速,镜头拉远 + 转正;圈点花布铺满;说明标签 + 箭头 + 房间名上场(23.6) | 颤音琴琶音越来越密 → 变成刮奏;每颗圆点 = 钢片琴"叮"(稀疏取样) |
+| 27.27 | 16.1 | 淡粉色块整片从右滑进来(贴士);"TIP" 星芒章敲下 | 半速感(呼吸):只剩长笛独奏 + 拨弦贝斯 + 木鱼;刮奏尾巴拖进来(L-cut) |
+| 27.5–30.2 | | 旁白 "One tip: pick up loose cables first.";June 侧面,两指把一根墨线从纸上揭起,线下只留一道淡色影;Pip 在旁边眨一次灯 | 胶皮线"嗖"地被揭起 + 纸面"嘶" |
+| 30.2–30.9 | 17.3–17.4 | 近乎静音 C:只剩房间底噪 + 座钟两声滴答 | 静 |
+| 30.91 | 18.1 | 落版组装:圆章 1 落位 | 颤音琴 F6(第 1 步和弦重现) |
+| 31.36 / 31.82 | 18.2 / 18.3 | 圆章 2、3 落位,箭头画出 | B♭maj7 / C9 |
+| 32.27 | 18.4 | 标题砸下,花布从底边升起,贴士缎带展开 | 全乐队主题 A(G 大调)收尾句 |
+| 31.1–33.9 | | 旁白 "Three steps. That's all there is to it.";字幕 33.9 退场 | |
+| 33.9–36.36 | 19–20 | **纯净落版**:机位完全静止,只有星芒慢转、箭头点头、June 按拍摆手指(on twos) | 最后一个和弦 G6/9 + 颤音琴震音延音 |
+| 36.36 | 21.1 | iris-out 收在 Pip 身上 → 结尾卡 | 贝斯一声 + 钢片琴"叮"(button) |
+| 36.4–40.0 | 21–22 | 结尾卡 | 颤音琴和弦自然衰减 |
+
+---
+
+## 七、Cue map(音乐先行,画面卡这张表)
+
+**配乐类型**:原创 50 年代西海岸冷爵士小乐队——颤音琴(主和弦 + 琶音)、长笛(旋律)、低音提琴拨弦(行走贝斯)、刷子鼓(军鼓一抹 + 叮叮镲)、钢片琴(点缀)。**132 BPM,F 大调 → 高点升到 G 大调**。
+- 乐器:优先 `core/audio/sampler.py`(vibraphone、flute、upright/electric bass、drum_kit、celesta 视 INSTRUMENTS.md 为准),缺的用 numpy 合成(刷子 = 带通噪声包络,颤音琴震音 = 振幅 LFO)。
+- 不做 ragtime / 热爵士大乐队(rubber-hose 用过)、不做间谍大乐队(spy-titles 用过)、不做钢琴 + 弦乐。
+
+| 段 | 时间 | 小节 | 调 / 速度感 | 配器 | 情绪 | 必须卡的点 |
+|---|---|---|---|---|---|---|
+| 钩子 A(静) | 0.00–1.36 | 1.1–1.3 | — | **无音乐**,只有纸板拟音 | 好奇 | 0.45 / 0.91 门落定 |
+| 钩子 B | 1.36–7.27 | 1.4–4.4 | F 大调,原速 | 1.36 颤音琴刮奏 + 吊镲渐强 → 1.82 全乐队 ta-da → 长笛主题 A(4 小节乐句的前 3 小节),行走贝斯,刷子 | 欢迎、俏皮 | 1.82 和弦;2.73 木鱼;3.64 刷子;6.82 章 |
+| 第 1 步 | 7.27–12.73 | 5–7 | F,原速 | 颤音琴 F6 落拍;长笛主题 A 后半;贝斯行走 | 从容 | 7.27 和弦;8.18 / 8.64 放下 / 插上;9.09 滑哨 |
+| 第 2 步 | 12.73–18.18 | 8–10 | B♭(IV),原速 | 颤音琴 B♭maj7;长笛主题 B(上行问句);钢片琴跟 Wi-Fi 三声 | 专注 | 14.55 / 15.0 两次点;15.45 / 15.9 / 16.36 三圈 |
+| 第 3 步 | 18.18–21.82 | 11–12 | C9(V),原速 | 颤音琴 C9;贝斯半音爬升;鼓只剩叮叮镲 | 期待 | 20.45 按下;**20.9–21.82 全静** |
+| **高点** | 21.82–27.27 | 13–15 | **G 大调(升全音)+ 双倍时值** | 全乐队:鼓棒叮叮镲、贝斯八分、颤音琴随路径每圈一个音(琶音越来越密 → 刮奏)、长笛主题 A 高八度 | 释放、飞驰(加速) | 21.82 咔 + 全奏;每一圈 = 一个颤音琴音(由路径长度算出的圈时刻驱动) |
+| 贴士 | 27.27–30.91 | 16–17 | G,**半速感**(呼吸) | 长笛独奏 + 拨弦贝斯 + 木鱼;30.2 起近乎静音 | 轻松、叮嘱 | 27.27 章;28.6 揭线 |
+| 落版 | 30.91–36.36 | 18–20 | G,原速 | 三个步骤和弦按拍重现 → 全乐队主题 A 收尾句 → G6/9 延音 | 完整、满足 | 30.91 / 31.36 / 31.82 圆章;32.27 标题 |
+| 结尾卡 | 36.36–40.0 | 21–22 | G | button:贝斯一声 + 钢片琴"叮",颤音琴震音衰减 | 余韵 | 36.36 iris |
+
+**快慢变化**:原速 → 高点双倍时值(加速)→ 贴士半速(呼吸)→ 落版原速。
+**卡点自检**:沿用 microgame 的 `cuecheck` 思路,脚本读 `events.json` 的动作时刻与配乐的拍点表,误差 ≤ 1 帧。
+
+---
+
+## 八、声音设计表
+
+| 段落 | 环境底 | 主要拟音(材质) | 音乐状态 |
+|---|---|---|---|
+| 钩子 | 安静客厅底噪(低通粉噪 −42 dB)+ 座钟慢滴答 | 纸板:门甩开的吱呀、落定的闷"嘭"、顶盖的抖动;Pip:状态灯"叮"、一跳落地的软塑料"噗" | 0–1.36 无音乐(静音 A),1.36 刮奏进入 |
+| 第 1 步 | 客厅底噪 | 塑料座落在木地板"咚"、插头"咔"、尺寸箭头滑哨、箭头点头钢片琴 | 颤音琴 F6 + 长笛主题,旁白时闪避 |
+| 第 2 步 | 客厅底噪 | 软塑料按键"嗒"×2、Wi-Fi 三声递升"哔"、✓ 印章 | B♭maj7,钢片琴跟三声 |
+| 第 3 步 | 底噪 → 20.9 起全部抽掉 | 按键第一声轻"咔"、进度环极轻"嘶" | C9 → **全静(静音 B)** |
+| 高点 | 马达嗡声(带通锯齿 + 轻 LFO,J-cut 提前 0.2 s) | 按键大"咔—叮"(全片最重要的声音)、边刷沙沙(随速度变亮)、圆点弹出钢片琴"叮" | 全乐队 + 升调 + 双倍时值 |
+| 贴士 | 回到客厅底噪,马达嗡淡出(L-cut) | 色块滑入的纸面"唰"、星芒章"嗵"、胶皮线被揭起"嗖"+ 纸面"嘶"、Pip 眨灯"叮" | 半速:长笛 + 拨弦 + 木鱼;30.2 起近乎静音 C |
+| 落版 | 底噪 | 三枚圆章"嗵"(和弦同拍)、箭头画出的笔尖"沙"、标题砸下木块"咚"、花布升起的纸"唰" | 主题收尾 + 延音 |
+| 结尾卡 | 底噪淡出 | iris 收拢"咻" | button + 衰减 |
+
+**混音**:旁白压缩后置于最上层,音乐在旁白下闪避约 −8 dB;三层(环境 / 拟音 / 音乐)分轨混;静音 A / B / C 是真静(B 段连底噪都抽掉);响度 −14 LUFS;mux 颗粒 4(轻,印刷纸感)。
+**J/L-cut**:① 1.36 音乐先于 Pip 亮相进入(J);② Wi-Fi 第三声"哔"拖进第 3 步(L);③ 马达嗡在匹配转场前 0.2 s 进(J);④ 高点的刮奏尾巴拖进贴士(L);⑤ 每一步的旁白比穿圆早半拍开口(J)。
+
+---
+
+## 九、旁白与字幕
+
+- **声线**:Kokoro `bm_george`(温和权威的英式教育片腔),语速 0.94;制作阶段和 `am_michael` 各出一版试听后定。每句 `asr_check.py` 校对到全部 OK。
+- **台词**(全部在 content.json):
+ 1. Meet Pip, your new robot vacuum.
+ 2. Step one. Set the dock against a wall.
+ 3. Step two. Open the app and add Pip.
+ 4. Step three. Press start.
+ 5. One tip: pick up loose cables first.
+ 6. Three steps. That's all there is to it.
+- **字幕样式(时代字卡)**:奶油纸色圆角字卡 + 细墨线框(色块层按风格错位 5 px)、两端各一颗慢转的珊瑚色八角星;Jost Medium 42 px 墨色;底部居中,离下边 62 px;淡入 0.16 s + 上浮 10 px。
+ - 每句停留 ≥ max(1.8 s, 语音 + 0.6 s),且 ≥ 字数/12 + 1 s;主体构图避开底部 150 px。
+ - 高点段无旁白、无字幕(让画面和音乐说话);落版字幕 33.9 s 退场,留出纯净可截图画面。
+- 另交 `.srt`。
+
+---
+
+## 十、content.json(本批核心交付)
+
+| 字段 | 类型 | 范围 | 用在哪 |
+|---|---|---|---|
+| `product` | string | 1–12 字符 | 盒子印字、旁白里的名字 |
+| `kind` | string | — | 描述用 |
+| `title` / `subtitle` | string | ≤ 36 / ≤ 24 字符(超出自动缩字号、换两行) | 钩子第 1 层、落版标题 |
+| `hook.kicker` / `hook.line` | string | ≤ 14 / 旁白一句 | "Meet Pip." / 旁白 |
+| `steps[]` | array | **2–5 步** | 每步一场;时间线按步数和配音时长自动排(每步 ≥ 3 小节,最后一步固定 2 小节接高点) |
+| `steps[].title` / `detail` | string | ≤ 22 / ≤ 44 字符(超出缩字号 / 两行) | 步骤标题、细节数据层 |
+| `steps[].icon` | enum | 引擎图标库:dock, phone, start, cable, wifi, plug, water, beans, cup, filter, box, clock, check, leaf, key, bulb, spark, gear | 编号圆章、落版 |
+| `steps[].action` | enum | place, tap, press, plug, pour, twist(引擎的手部动作库) | 每步的关键手部动作特写 |
+| `steps[].line` | string | 旁白一句 | 旁白 + 字幕 |
+| `payoff.caption` / `rooms` | string / string[≤3] | — | 高点的说明标签 / 房间名 |
+| `tip.label` / `text` / `icon` / `line` | — | text ≤ 40 字符 | 贴士 |
+| `outro.line` / `cta` | string | cta ≤ 48 字符 | 结束旁白 / 行动号召 |
+| `palette` | object | 纸、墨、产品色、强调色、钩子底色、步骤底色数组、贴士底色、平面图三色 | 全片配色主题 |
+| `voice` | object | Kokoro 声线 id + 语速 | TTS |
+| `film` | object | 片名、风格名、署名 | 结尾卡 |
+
+换内容测试(关卡 2 交):`content_alt.json` 计划做一台虚构的**手冲咖啡机 "Drip"**,4 步(加水 / 放滤纸 / 加咖啡粉 / 按下冲煮),贴士 "Rinse the filter first.",换一套配色主题(李子紫 + 芥末 + 淡粉),高点的"路径花布"改成咖啡滴落的圆点图案(同一个图案引擎,不同路径函数)。
+
+---
+
+## 十一、技术方案
+
+- 纯 Canvas2D,`window.render(t)` 确定性渲染。
+- `demo/engine/toon.js`:风格引擎(线色错位 `reg()`、`shape()`、断笔墨线 `ink()`、两版套印文字 `text()`、星芒 / 光芒 / 原子 / 回旋镖 / 肾形、会动的说明书箭头 `arrow()`、自动换行缩字号 `fit()`、纸感收尾)。任意路径都能用这个风格画出来。
+- `demo/engine/chars.js`:June 与 Pip 的画法(有限动画的姿势参数);`demo/engine/icons.js`:图标库。
+- `demo/film.js`:只调用引擎,时间线从 content.json + 配音时长生成,卡在 132 BPM 网格上。
+- 起点代码:读过 `promo/opuscar98/sets/29/upa.js`(错位印刷 + 蜡笔颗粒 + 压力墨线的思路),在本目录重写并改为 12 fps 抖动错位、更细更断的线、更轻的颗粒;不 import、不复制电影内容。
+- 配乐 fork 一个子 agent(Opus 5.5)按本 cue map 写;高点的颤音琴"每圈一个音"由 `events.json` 导出的圈时刻驱动。
+- 渲染:整片走 `batch/tools/render_slot.mjs` 限流器,`--workers 2`。
+
+---
+
+## 十二、制作阶段修订(关卡 1 意见落实后,以成片为准)
+
+| 项 | 方案原稿 | 成片 | 理由 |
+|---|---|---|---|
+| 人设 | June 穿波点裙,为吸尘器欢呼的 50 年代主妇 | **June 改为"新房主"**:Mary Blair 式珊瑚色高领衫 + 藏青烟管裤 + 平底鞋,保留波波头和芥末发带 | 为家电欢呼的"主妇"是那个年代广告的刻板印象,放在开源库首页不合适。换成高领衫加长裤,保留时代的造型语法,气质变成"刚搬进新家、自己动手装东西的人" |
+| 鼻子 / 手 / 手臂 | 三角鼻贴在脸外;连指手套;手臂从脖子根长出 | 鼻子并进头部外轮廓(一条样条从鼻梁绕后脑到鼻下,在鼻尖闭合),3/4 侧远侧眼露出;四指 UPA 手套(open / flat / point / grip 四种);手臂从肩角出发,粗墨线 + 珊瑚色袖子 | 意见 2 |
+| 签名镜头路径 | 满屏螺旋卷圈,压在家具上 | 真实清扫逻辑:先沿墙一圈,再往返车道;车道按势流流线绕开家具轮廓(永不相交、永不进入家具);每个掉头是圆角 U 形 + 一个小卷;车道之间点星芒和圆点。按房间分拍画出(客厅 b4 → 走廊 b6 → 厨房 b8),最后沿虚线回到充电座(b11,和配乐重音同拍)。家具减到 4 件 | 意见 1 |
+| 三个步骤 | 只写在方案里 | 每步 = 全景(June 做这件事)+ 圆形局部放大框(手的特写),细节数据在动作落拍时出现在放大框上:①跪姿推充电座贴墙(预备回拉 → 推 → 撞墙回弹,b3.5 落"咚"),放大框翻面成正视尺寸图,两支"50 cm"箭头按拍长出;②放大框里是手机屏,食指两次点击(b4 / b5),三圈 Wi-Fi 弧从手机飞向 Pip(b6 / b7 / b8),Pip 同拍闪灯,✓ 盖章;③特写:食指从上方进入 → 悬停 → 抬高预备 → 按下 → 按住两拍(进度环),全静一拍 | 意见 5;三格自审图 `demo/stills/steps_review.jpg` |
+| 落版 | 底部粉色卷圈带;June / Pip 被裁 | 底边只留一条低对比的细花边(一条波线 + 小星);"Full manual" 胶囊放在干净的纸面上;June 和 Pip 完整收进画框 | 意见 4 |
+| 旁白声线 | 候选 bm_george | **am_michael**,语速 0.94 | bm_george 的英式元音让 whisper 把 "dock" 听成 "dark";am_michael 全部一次 OK。50 年代课堂片本来就是美式旁白 |
+| 台词 | "One tip: …"、"Three steps. That's all there is to it." | "Tip: pick up loose cables first."、"Three steps. That's it." | 意见 7:保证时长 ≤ 40 s,并让落版在字幕退场后留 2 s 纯净画面,没有砍步骤的停留 |
+| 第 1 步细节 | "Against a wall, 50 cm clear each side" | "50 cm clear on each side"("靠墙"在标题和旁白里) | 保证阅读时间(字数/12+1 s) |
+| 贴士 | 一根线被揭起 | 保留:June 跪姿伸手,第 2 拍抓住,墨线从抓住的一端一点点离开纸面,地上留一道淡色影后消失;Pip 眨灯致谢,第 5 拍向前滚动 | — |
+| 结尾卡 | 圆形光圈 | iris-out 收在落版右下角的 Pip 上 → 黑场一瞬 → 圆在画面中央张开,结尾卡在圆里 | — |
+
+### 返修一轮(关卡 2 意见,v1 已备份为 `midcentury-toon_v1.mp4` / `demo_v1/`)
+| 项 | 改动 |
+|---|---|
+| 第 3 步手臂 | 橙色直杆改成真手臂:上臂从右侧近水平进画,肘部弯,前臂斜向下,腕部有袖口线,入画竖向约占画高 38%;按下前手腕先上翘(预备)再下压,松开后回弹;细节标签移到左侧,不再被手臂穿过 |
+| 平面图引线 | 长黑线改成从说明牌伸出的短弯箭头,落在平面图上边缘(最长 160 px),不穿过房间 |
+| 走廊车道 | 走廊加两条直车道(上行 → 顶部小卷掉头 → 下行),星芒圆点落在两条车道之间 |
+| 高点第一小节 | 起始推近 5.4× → 2.6×,拉远从第 0.4 拍开始;按键圆张开 0.45 s → 0.28 s |
+| 落版 | Pip 光圈整体内收(右、下边距 ≥ 5%);June 放大到 s 0.66(约占画高 35%);iris-out 的圆心同步 |
diff --git a/styles/midcentury-toon/demo/CREDITS b/styles/midcentury-toon/demo/CREDITS
new file mode 100644
index 0000000..ba08e82
--- /dev/null
+++ b/styles/midcentury-toon/demo/CREDITS
@@ -0,0 +1,12 @@
+Meet Pip — Mid-century Cartoon demo · asset sources & licenses
+
+Artwork All characters (June, Pip), props, plans, icons and backgrounds drawn procedurally in code (engine/, film.js). No generated images.
+Music Original score, generated in code (music/score.py). See music/CREDITS_music.txt:
+ Drums: "MuldjordKit" by Lars Muldjord (drumgizmo.org), FreePats version, CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
+ Samples (CC0): Karoryfer Samples / sfzinstruments, VS Chamber Orchestra: Community Edition and Versilian Community Sample Library (Versilian Studios)
+Sound FX Synthesized in code (mix.py + core/audio/sfx.py). No recorded samples.
+Voice Kokoro-82M TTS (kokoro-onnx), Apache-2.0 — voice am_michael, speed 0.94.
+Fonts Oleo Script (Soytutype), Alfa Slab One (JM Solé), Jost (indestructible type*) — SIL Open Font License 1.1, files + licences in fonts/.
+Product "Pip" and "Mo" are fictional products. No real brand, product, logo or trademark appears.
+Style Grammar learned from 1950s UPA limited animation, 1950s classroom films and mid-century illustration (Charley Harper, Mary Blair).
+ No character, design, lettering or music from any of them is reproduced.
diff --git a/styles/midcentury-toon/demo/build.sh b/styles/midcentury-toon/demo/build.sh
new file mode 100755
index 0000000..a25e468
--- /dev/null
+++ b/styles/midcentury-toon/demo/build.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+# Rebuild "Meet Pip" from scratch: sh styles/midcentury-toon/demo/build.sh (run from anywhere)
+# Swap content: edit demo/content.json (or pass another file: CONTENT=content_alt.json sh build.sh stills)
+set -e
+cd "$(dirname "$0")/../../.."
+PY=.venv/bin/python; D=styles/midcentury-toon/demo; O=styles/midcentury-toon
+if [ "$1" = "stills" ]; then # content test: three stills from another content file, no audio needed
+ node core/render/still.mjs $D 3.5 32.4 41.3 --q "content=${CONTENT:-content_alt.json}" --prefix alt_ --out $D/out/alt; exit 0; fi
+python3 $D/tools/lines.py $D/content.json $D/lines.json # 1. narration lines from content.json
+$PY core/tts/tts.py $D/lines.json $D/voices # 2. Kokoro voice (am_michael)
+$PY core/tts/asr_check.py $D/lines.json $D/voices # 3. whisper check, every line must be OK
+$PY $D/music/score.py # 4. original cool-jazz score -> music/score.wav + stems + hits.json
+node core/render/events.mjs $D # 5. picture events -> events.json (same times drive the foley)
+$PY $D/tools/cuecheck.py # 6. cue check: picture hits vs grid + score
+$PY $D/mix.py # 7. foley + voice + ducking + silences -> mix.wav
+node $D/tools/cues.mjs > $D/out/cues.json && $PY core/render/srt.py $D/out/cues.json $O/midcentury-toon.srt # 8. subtitles
+node batch/tools/render_slot.mjs -- node core/render/video.mjs $D --fps 24 --workers 2 --out $D/out/video24.mp4 # 9. frames (render slot)
+sh core/render/mux.sh $D/out/video24.mp4 $D/mix.wav $O/midcentury-toon.mp4 24 4 # 10. -14 LUFS, light grain
+node core/render/still.mjs $D 6.0 35.8 --q nosubs=1 --prefix ns_ --out $D/out/still
+cp $D/out/still/ns_6.0.jpg $D/stills/styleframe.jpg; cp $D/out/still/ns_35.8.jpg $O/poster.jpg
+node core/render/still.mjs $D 0 --q test=sheet --prefix sheet_ --out $D/out/still && cp $D/out/still/sheet_0.jpg $D/stills/modelsheet_v2.jpg
diff --git a/styles/midcentury-toon/demo/content.json b/styles/midcentury-toon/demo/content.json
new file mode 100644
index 0000000..c969e7a
--- /dev/null
+++ b/styles/midcentury-toon/demo/content.json
@@ -0,0 +1,147 @@
+{
+ "product": "Pip",
+ "kind": "robot vacuum",
+ "title": "Your New Robot Vacuum",
+ "subtitle": "Set Up in 3 Steps",
+ "hook": {
+ "kicker": "Meet Pip.",
+ "line": "Meet Pip, your new robot vacuum."
+ },
+ "steps": [
+ {
+ "title": "Place the dock",
+ "detail": "50 cm clear on each side",
+ "icon": "dock",
+ "action": "place",
+ "line": "Step one. Set the dock against a wall.",
+ "measure": "50 cm"
+ },
+ {
+ "title": "Connect the app",
+ "detail": "Home Wi-Fi, 2.4 GHz",
+ "icon": "phone",
+ "action": "tap",
+ "line": "Step two. Open the app and add Pip."
+ },
+ {
+ "title": "Press start",
+ "detail": "Hold for one second",
+ "icon": "start",
+ "action": "press",
+ "line": "Step three. Press start."
+ }
+ ],
+ "payoff": {
+ "caption": "Pip maps the room as it goes",
+ "plan": {
+ "y0": 235,
+ "y1": 990,
+ "dock": [
+ 330,
+ 990
+ ],
+ "zones": [
+ {
+ "name": "Living room",
+ "x0": 170,
+ "x1": 1060,
+ "color": "#F0B4A8"
+ },
+ {
+ "name": "Hall",
+ "x0": 1060,
+ "x1": 1280,
+ "color": "#F4EAD5"
+ },
+ {
+ "name": "Kitchen",
+ "x0": 1280,
+ "x1": 1750,
+ "color": "#CBD08E",
+ "checks": true
+ }
+ ],
+ "rug": {
+ "x": 700,
+ "y": 700,
+ "rx": 280,
+ "ry": 170,
+ "color": "#B5C8DE"
+ },
+ "items": [
+ {
+ "shape": "sofa",
+ "x": 440,
+ "y": 440,
+ "s": 140,
+ "color": "#FBF6EA",
+ "accent": "#6E4A6B"
+ },
+ {
+ "shape": "boomerang",
+ "x": 760,
+ "y": 760,
+ "s": 100,
+ "rot": 0.15,
+ "color": "#A8704A"
+ },
+ {
+ "shape": "plant",
+ "x": 930,
+ "y": 330,
+ "s": 48,
+ "color": "#7E8538"
+ },
+ {
+ "shape": "table",
+ "x": 1515,
+ "y": 610,
+ "s": 74,
+ "color": "#FBF6EA",
+ "accent": "#E8B43A"
+ }
+ ]
+ }
+ },
+ "tip": {
+ "label": "Tip",
+ "text": "Pick up loose cables first.",
+ "icon": "cable",
+ "line": "Tip: pick up loose cables first."
+ },
+ "outro": {
+ "line": "Three steps. That's it.",
+ "cta": "Full manual: scan the code inside the lid"
+ },
+ "palette": {
+ "paper": "#F4EAD5",
+ "ink": "#2B2420",
+ "product": "#3FA7A0",
+ "productDark": "#257A74",
+ "accent": "#E4613F",
+ "hook": "#E8B43A",
+ "steps": [
+ "#7F9CC0",
+ "#E8B43A",
+ "#A7AE5B",
+ "#F0B4A8",
+ "#6E4A6B"
+ ],
+ "tip": "#F0B4A8",
+ "plan": [
+ "#F0B4A8",
+ "#E8B43A",
+ "#A7AE5B",
+ "#7F9CC0"
+ ]
+ },
+ "voice": {
+ "id": "am_michael",
+ "speed": 0.94
+ },
+ "film": {
+ "name": "Meet Pip",
+ "style": "Mid-century Cartoon",
+ "credits": "Fonts: Oleo Script, Alfa Slab One, Jost (SIL OFL). Voice: Kokoro-82M (Apache-2.0). Music & sound: original, synthesized in code."
+ }
+}
\ No newline at end of file
diff --git a/styles/midcentury-toon/demo/content_alt.json b/styles/midcentury-toon/demo/content_alt.json
new file mode 100644
index 0000000..41368fb
--- /dev/null
+++ b/styles/midcentury-toon/demo/content_alt.json
@@ -0,0 +1,140 @@
+{
+ "product": "Mo",
+ "kind": "robot lawn mower",
+ "title": "Your New Robot Mower",
+ "subtitle": "Set Up in 4 Steps",
+ "hook": {
+ "kicker": "Meet Mo.",
+ "line": "Meet Mo, your new robot mower."
+ },
+ "steps": [
+ {
+ "title": "Set the base station",
+ "detail": "Level ground, 1 m clear in front",
+ "icon": "dock",
+ "action": "place",
+ "measure": "1 m",
+ "line": "Step one. Set the base station on level ground."
+ },
+ {
+ "title": "Peg the boundary wire",
+ "detail": "30 cm in from the lawn edge",
+ "icon": "cable",
+ "action": "show",
+ "line": "Step two. Peg the wire around the lawn."
+ },
+ {
+ "title": "Pair the app",
+ "detail": "Home Wi-Fi, 2.4 GHz",
+ "icon": "phone",
+ "action": "tap",
+ "line": "Step three. Pair Mo with the app."
+ },
+ {
+ "title": "Press go",
+ "detail": "Hold for two seconds",
+ "icon": "start",
+ "action": "press",
+ "line": "Step four. Press go."
+ }
+ ],
+ "payoff": {
+ "caption": "Mo learns the lawn on the first run",
+ "plan": {
+ "y0": 235,
+ "y1": 990,
+ "dock": [
+ 330,
+ 990
+ ],
+ "zones": [
+ {
+ "name": "Front lawn",
+ "x0": 170,
+ "x1": 900,
+ "color": "#A7AE5B",
+ "checks": true
+ },
+ {
+ "name": "Path",
+ "x0": 900,
+ "x1": 1100,
+ "color": "#E6D8BC"
+ },
+ {
+ "name": "Back lawn",
+ "x0": 1100,
+ "x1": 1750,
+ "color": "#CBD08E",
+ "checks": true
+ }
+ ],
+ "items": [
+ {
+ "shape": "plant",
+ "x": 430,
+ "y": 430,
+ "s": 70,
+ "color": "#4F7A3A"
+ },
+ {
+ "shape": "bed",
+ "x": 640,
+ "y": 760,
+ "s": 110,
+ "color": "#F0B4A8",
+ "accent": "#E8B43A"
+ },
+ {
+ "shape": "kidney",
+ "x": 1400,
+ "y": 470,
+ "s": 150,
+ "color": "#7F9CC0",
+ "accent": "#FBF6EA"
+ },
+ {
+ "shape": "plant",
+ "x": 1560,
+ "y": 820,
+ "s": 64,
+ "color": "#4F7A3A"
+ }
+ ]
+ }
+ },
+ "tip": {
+ "label": "Tip",
+ "text": "Clear toys off the lawn first.",
+ "icon": "leaf",
+ "line": "Tip: clear toys off the lawn first."
+ },
+ "outro": {
+ "line": "Four steps. That's it.",
+ "cta": "Full guide: scan the code under the lid"
+ },
+ "palette": {
+ "paper": "#F2EBD9",
+ "ink": "#2B2420",
+ "product": "#E4613F",
+ "productDark": "#B8452B",
+ "accent": "#3FA7A0",
+ "hook": "#7F9CC0",
+ "steps": [
+ "#A7AE5B",
+ "#E8B43A",
+ "#F0B4A8",
+ "#B5C8DE"
+ ],
+ "tip": "#E8B43A"
+ },
+ "voice": {
+ "id": "am_michael",
+ "speed": 0.94
+ },
+ "film": {
+ "name": "Meet Mo",
+ "style": "Mid-century Cartoon",
+ "credits": "Fonts: Oleo Script, Alfa Slab One, Jost (SIL OFL). Voice: Kokoro-82M (Apache-2.0). Music & sound: original."
+ }
+}
\ No newline at end of file
diff --git a/styles/midcentury-toon/demo/engine/chars.js b/styles/midcentury-toon/demo/engine/chars.js
new file mode 100644
index 0000000..3fd8e18
--- /dev/null
+++ b/styles/midcentury-toon/demo/engine/chars.js
@@ -0,0 +1,255 @@
+// Cast for the demo, drawn with the engine: June (a geometric 1950s new homeowner, Mary Blair-style
+// turtleneck + cigarette trousers) and the product "Pip" with its dock.
+// Limited animation: bodies are held drawings; only arms, hands, eyes, mouth and props move.
+import { PAL, shape, ink, ellipse, spline, xform, move, rrect, rect, TAU, clamp, lerp, starPts, text, sparkle, reg, path } from './toon.js';
+
+export const NAVY = '#3B4766', NAVYD = '#2A3350';
+// ---------------------------------------------------------------- the owner
+// pose: { x, y, s, dir(1 right / -1 left), view:'q'|'front'|'side'|'back', face, armB:{a1,a2}, armF:{a1,a2},
+// handB/handF:'open'|'point'|'grip'|'flat', blink(0..1), look:[dx,dy], prop:{kind, hand:'F'|'B', ...} }
+// units: feet at (0,0); hair top ≈ -560. Angles: 0 = right, π/2 = down (screen, before dir mirroring).
+const UA = 100, FA = 92;
+export function armJoints(pose, which) {
+ const view = pose.view || 'q';
+ const sh = view === 'front' ? [which === 'F' ? 46 : -46, -384] : (which === 'F' ? [40, -384] : [-36, -386]);
+ const rest = view === 'front' ? (which === 'F' ? { a1: 1.36, a2: 1.5 } : { a1: 1.78, a2: 1.64 }) : (which === 'F' ? { a1: 1.3, a2: 1.52 } : { a1: 1.86, a2: 1.7 });
+ const arm = pose[which === 'F' ? 'armF' : 'armB'] || rest;
+ const el = [sh[0] + Math.cos(arm.a1) * UA, sh[1] + Math.sin(arm.a1) * UA];
+ const ha = [el[0] + Math.cos(arm.a2) * FA, el[1] + Math.sin(arm.a2) * FA];
+ return { sh, el, ha, a2: arm.a2 };
+}
+// local → screen for a pose (without camera)
+export function toScreen(pose, p) { const s = pose.s ?? 1, d = pose.dir ?? 1; return [pose.x + p[0] * s * d, pose.y + p[1] * s]; }
+
+// UPA four-finger hand (three fingers + thumb). Drawn along angle a from the wrist at (x,y).
+// kind: 'open' spread, 'flat' fingers together (pushing), 'point' index out, 'grip' curled fist. side ±1 = thumb side.
+export function drawHand(ctx, x, y, a, kind = 'open', side = 1, k = 1, skin = PAL.skin) {
+ const parts = [], seps = [];
+ const E = (cx, cy, rx, ry, rot = 0) => parts.push(ellipse(cx, cy, rx, ry, 18, 0, TAU, rot));
+ E(12, 0, 15, 13.5); // palm
+ if (kind === 'open') {
+ [-0.62, 0, 0.62].forEach(r => E(12 + Math.cos(r) * 25, Math.sin(r) * 25, 12, 5, r));
+ E(4, -15 * side, 10, 5, -1.35 * side);
+ } else if (kind === 'flat') {
+ [-10, 0, 10].forEach((dy, i) => E(34 + (i === 1 ? 3 : 0), dy, 13, 4.8));
+ E(10, -15 * side, 9, 5, -0.9 * side);
+ seps.push([[24, -5], [40, -5]], [[24, 5], [40, 5]]);
+ } else if (kind === 'point') {
+ E(38, -5 * side, 19, 4.8); E(25, 5 * side, 7, 6); E(20, 11 * side, 6, 5.5); E(8, -14 * side, 8.5, 5, -1.0 * side);
+ } else { E(26, -8, 6.5, 6.5); E(28, 1, 6.5, 6.5); E(25, 10, 6, 6); E(12, -14 * side, 9, 5.5, -0.4 * side); seps.push([[22, -3.5], [30, -3.5]], [[22, 5.5], [29, 5.5]]); }
+ const P = parts.map(p => xform(p, x, y, a, k));
+ ctx.save(); ctx.strokeStyle = PAL.ink; ctx.lineWidth = 6 * k; ctx.lineJoin = 'round';
+ for (const p of P) { path(ctx, p); ctx.stroke(); }
+ const o = reg(77, 0.6); ctx.fillStyle = skin;
+ for (const p of P) { path(ctx, move(p, o[0] * 0.5, o[1] * 0.5)); ctx.fill(); }
+ ctx.lineWidth = 2.4 * k; ctx.lineCap = 'round';
+ for (const s2 of seps) { const q = xform(s2, x, y, a, k); ctx.beginPath(); ctx.moveTo(...q[0]); ctx.lineTo(...q[1]); ctx.stroke(); }
+ ctx.restore();
+}
+
+function sleeve(ctx, J, seed, col = PAL.coral) {
+ const P = spline([J.sh, [(J.sh[0] + J.el[0]) / 2, (J.sh[1] + J.el[1]) / 2], J.el, [(J.el[0] + J.ha[0]) / 2, (J.el[1] + J.ha[1]) / 2], J.ha], false, 6);
+ ink(ctx, P, 26, { seed, taper: false, wob: 0.08 });
+ const o = reg(seed, 1);
+ ink(ctx, move(P, o[0] * 0.6, o[1] * 0.6), 17, { seed: seed + 1, taper: false, wob: 0.05, color: col });
+ // cuff
+ const a = J.a2, cx = J.ha[0] - Math.cos(a) * 8, cy = J.ha[1] - Math.sin(a) * 8;
+ ink(ctx, [[cx + Math.cos(a + 1.57) * 12, cy + Math.sin(a + 1.57) * 12], [cx - Math.cos(a + 1.57) * 12, cy - Math.sin(a + 1.57) * 12]], 3, { seed: seed + 2, taper: false, color: PAL.coralD });
+}
+function drawArm(ctx, pose, which, seed) {
+ const J = armJoints(pose, which);
+ const prop = pose.prop && (pose.prop.hand || 'F') === which ? pose.prop : null;
+ if (prop && prop.behind) drawProp(ctx, prop, J, pose);
+ sleeve(ctx, J, seed);
+ const hk = pose[which === 'F' ? 'handF' : 'handB'] || 'open';
+ drawHand(ctx, J.ha[0], J.ha[1], J.a2, hk, which === 'F' ? -1 : 1);
+ if (prop && !prop.behind) drawProp(ctx, prop, J, pose);
+ return J;
+}
+
+export function drawOwner(ctx, pose, t = 0) {
+ const view = pose.view || 'q', face = pose.face || 'neutral';
+ ctx.save(); ctx.translate(pose.x, pose.y); ctx.scale((pose.s ?? 1) * (pose.dir ?? 1), pose.s ?? 1);
+ if (pose.shadow !== false) { ctx.save(); ctx.globalAlpha = 0.16; ctx.fillStyle = PAL.ink; ctx.beginPath(); ctx.ellipse(6, 2, 86, 10, 0, 0, TAU); ctx.fill(); ctx.restore(); }
+ const front = view === 'front' || view === 'back';
+ if (pose.kneel) { drawKneelLegs(ctx); ctx.translate(0, 150); }
+ if (view !== 'back') drawArm(ctx, pose, 'B', 70);
+ // legs (cigarette trousers), ankles, flats
+ const legs = pose.kneel ? [] : front ? [[[-44, -286], [-2, -286], [-8, -26], [-34, -26]], [[2, -286], [44, -286], [34, -26], [8, -26]]]
+ : [[[-40, -286], [4, -286], [-4, -26], [-30, -26]], [[-2, -286], [44, -286], [34, -26], [10, -26]]];
+ legs.forEach((L, i) => {
+ const ax = (L[2][0] + L[3][0]) / 2;
+ shape(ctx, rect(ax - 7, -30, 14, 18), { fill: PAL.skin, line: 0, seed: 40 + i, grain: 0 });
+ shape(ctx, L, { fill: NAVY, line: 3.8, seed: 42 + i, grain: 0.3, breaks: 0.15, shade: i === 1 && !front ? [{ pts: [[26, -290], [60, -290], [60, 0], [22, 0]], color: NAVYD, alpha: 0.7 }] : null });
+ const fx = ax, sh = front ? ellipse(fx, -7, 17, 8, 16) : spline([[fx - 16, -12], [fx + 6, -15], [fx + 28, -6], [fx + 24, 0], [fx - 16, 0]], true, 4);
+ shape(ctx, sh, { fill: PAL.ink, line: 0, off: [0, 0], grain: 0 });
+ });
+ // sweater (turtleneck), tucked with a thin belt
+ const torso = spline([[-52, -380], [-40, -398], [40, -398], [52, -380], [44, -310], [46, -282], [-44, -282], [-46, -310]], true, 6);
+ shape(ctx, torso, { fill: PAL.coral, line: 4.2, seed: 50, grain: 0.35, breaks: 0.2,
+ shade: view === 'back' || front ? null : [{ pts: [[22, -400], [70, -400], [70, -270], [26, -270]], color: PAL.coralD, alpha: 0.5 }] });
+ shape(ctx, rrect(-45, -298, 91, 14, 5), { fill: PAL.mustard, line: 2.8, seed: 51, grain: 0.2, breaks: 0.3 });
+ // turtleneck roll
+ shape(ctx, rrect(-20, -424, 42, 30, 10), { fill: PAL.coral, line: 3.4, seed: 52, grain: 0.3, breaks: 0.2 });
+ for (let i = 0; i < 3; i++) ink(ctx, [[-16, -418 + i * 9], [18, -418 + i * 9]], 2, { seed: 53 + i, color: PAL.coralD, taper: false });
+ drawHead(ctx, pose, view, face, t);
+ if (view === 'back') { drawArm(ctx, pose, 'B', 70); }
+ drawArm(ctx, pose, 'F', 60);
+ ctx.restore();
+}
+
+// kneeling on one knee (facing +x): back knee on the floor, front foot flat; hips drop by 150
+function drawKneelLegs(ctx) {
+ const leg = (P, seed, col) => { ink(ctx, P, 44, { seed, taper: false, wob: 0.05 }); const o = reg(seed, 1); ink(ctx, move(P, o[0] * 0.6, o[1] * 0.6), 35, { seed: seed + 1, taper: false, wob: 0.04, color: col }); };
+ leg([[-16, -128], [-20, -24], [-96, -20]], 44, NAVYD);
+ shape(ctx, spline([[-150, -30], [-100, -38], [-92, -6], [-150, -4]], true, 4), { fill: PAL.ink, line: 0, off: [0, 0], grain: 0 });
+ leg([[18, -128], [96, -134], [100, -30]], 46, NAVY);
+ shape(ctx, spline([[84, -18], [110, -22], [140, -8], [136, 0], [84, 0]], true, 4), { fill: PAL.ink, line: 0, off: [0, 0], grain: 0 });
+}
+function hairQ() {
+ return spline([[-8, -566], [-54, -546], [-74, -500], [-72, -452], [-90, -432], [-74, -424], [-50, -440], [-36, -490], [-8, -514], [28, -516], [54, -512], [60, -530], [34, -560]], true, 6);
+}
+function drawHead(ctx, pose, view, face, t) {
+ const blink = pose.blink ?? 0, look = pose.look || [0, 0];
+ if (view === 'front' || view === 'back') {
+ const bob = spline([[-64, -524], [0, -566], [64, -524], [70, -454], [92, -432], [70, -426], [0, -440], [-70, -426], [-92, -432], [-70, -454]], true, 6);
+ shape(ctx, bob, { fill: PAL.hair, line: 0, seed: 60, grain: 0.3 });
+ if (view === 'back') { shape(ctx, spline([[-66, -520], [0, -568], [66, -520], [70, -440], [0, -418], [-70, -440]], true, 6), { fill: PAL.hair, line: 0, seed: 61, grain: 0.3 });
+ ink(ctx, spline([[-60, -528], [-20, -560], [26, -560], [62, -528]], false, 6), 10, { color: PAL.mustard, seed: 63, taper: false }); return; }
+ shape(ctx, ellipse(0, -478, 54, 64, 36), { fill: PAL.skin, line: 4, seed: 61, grain: 0.15, breaks: 0.25 });
+ shape(ctx, spline([[-58, -500], [-44, -548], [16, -560], [60, -508], [30, -518], [-6, -510], [-32, -518]], true, 6), { fill: PAL.hair, line: 0, seed: 62, grain: 0.3 });
+ ink(ctx, spline([[-58, -516], [-20, -552], [26, -552], [60, -516]], false, 6), 10, { color: PAL.mustard, seed: 63, taper: false });
+ [-21, 21].forEach((x, i) => eye(ctx, x + look[0], -484 + look[1], face, blink, i));
+ ink(ctx, spline([[2, -482], [-7, -458], [5, -455]], false, 4), 3.4, { seed: 64 });
+ mouth(ctx, 0, -436, face);
+ cheeks(ctx, [[-34, -458], [34, -458]]);
+ return;
+ }
+ // 3/4 and profile (facing +x): ONE outline that runs down the forehead, out to the nose point and back
+ shape(ctx, hairQ(), { fill: PAL.hair, line: 0, seed: 65, grain: 0.3 });
+ const side = view === 'side';
+ const chain = side ? [[48, -490], [46, -512], [30, -540], [-8, -552], [-46, -536], [-60, -496], [-56, -454], [-36, -424], [-4, -410], [24, -412], [40, -424], [44, -442], [50, -458]]
+ : [[52, -488], [50, -512], [34, -538], [-6, -552], [-44, -536], [-60, -496], [-56, -454], [-38, -424], [-8, -410], [22, -412], [38, -424], [44, -442], [52, -458]];
+ const tip = side ? [94, -470] : [88, -470];
+ const head = [...spline(chain, false, 6), tip];
+ shape(ctx, head, { fill: PAL.skin, line: 4, seed: 66, grain: 0.15, breaks: 0.12 });
+ // bangs sweep over the forehead + headband
+ shape(ctx, spline([[-44, -522], [-12, -562], [40, -552], [58, -522], [40, -514], [8, -512], [-20, -506]], true, 6), { fill: PAL.hair, line: 0, seed: 68, grain: 0.3 });
+ ink(ctx, spline([[-54, -512], [-24, -552], [22, -560], [52, -536]], false, 6), 10, { color: PAL.mustard, seed: 69, taper: false });
+ const E = side ? [[30, -492]] : [[6, -490], [38, -493]];
+ E.forEach(([x, y], i) => eye(ctx, x + look[0], y + look[1], face, blink, i, i === 1 ? 0.78 : 1));
+ mouth(ctx, side ? 32 : 28, -432, face);
+ cheeks(ctx, side ? [[2, -458]] : [[-14, -458]]);
+}
+
+function eye(ctx, x, y, face, blink, i, sx = 1) {
+ if (face === 'happy' || blink > 0.5 || (face === 'wink' && i === 0)) {
+ const up = face === 'happy' || face === 'wink';
+ ink(ctx, up ? [[x - 8 * sx, y + 3], [x, y - 5], [x + 8 * sx, y + 3]] : [[x - 8 * sx, y], [x + 8 * sx, y]], 4, { seed: 80 + i, taper: false });
+ } else {
+ const r = face === 'wow' ? 8.5 : 6.8;
+ shape(ctx, ellipse(x, y, r * 0.8 * sx, r * 1.3, 14), { fill: PAL.ink, line: 0, grain: 0, off: [0, 0] });
+ shape(ctx, ellipse(x + 1.5, y - 3.5, 2.2, 2.6, 8), { fill: PAL.white, line: 0, grain: 0, off: [0, 0] });
+ }
+ const by = face === 'wow' ? y - 25 : face === 'focus' ? y - 14 : y - 19, tilt = face === 'focus' ? (i ? -3 : 3) : 0;
+ ink(ctx, [[x - 9 * sx, by + tilt], [x + 9 * sx, by - tilt - 2]], 3.4, { seed: 90 + i, taper: true });
+}
+function mouth(ctx, x, y, face) {
+ if (face === 'happy') shape(ctx, spline([[x - 16, y - 6], [x + 12, y - 8], [x + 4, y + 11], [x - 10, y + 9]], true, 6), { fill: PAL.coralD, line: 3.2, seed: 95, grain: 0, breaks: 0 });
+ else if (face === 'wow') shape(ctx, ellipse(x - 2, y + 2, 7, 10, 16), { fill: PAL.coralD, line: 3.2, seed: 96, grain: 0, breaks: 0 });
+ else if (face === 'focus') { ink(ctx, [[x - 12, y], [x + 8, y - 2]], 3.4, { seed: 97 }); shape(ctx, ellipse(x + 8, y + 4, 5.5, 4.5, 10), { fill: PAL.coralL, line: 2.4, seed: 98, grain: 0, breaks: 0 }); }
+ else if (face === 'wink') ink(ctx, spline([[x - 16, y - 4], [x - 3, y + 6], [x + 11, y - 6]], false, 5), 3.6, { seed: 99 });
+ else ink(ctx, spline([[x - 12, y - 2], [x - 1, y + 4], [x + 9, y - 3]], false, 5), 3.4, { seed: 100 });
+}
+function cheeks(ctx, pts) { pts.forEach(([x, y], i) => shape(ctx, ellipse(x, y, 11, 7.5, 14), { fill: PAL.pink, line: 0, grain: 0, seed: 101 + i, alpha: 0.85 })); }
+
+// props held in a hand. J = arm joints (local units).
+function drawProp(ctx, prop, J, pose) {
+ const [hx, hy] = J.ha;
+ if (prop.kind === 'phone') {
+ ctx.save(); ctx.translate(hx + (prop.dx ?? 16), hy + (prop.dy ?? -30)); ctx.rotate(prop.rot ?? -0.2);
+ shape(ctx, rrect(-26, -46, 52, 92, 10), { fill: PAL.ink, line: 0, seed: 130, grain: 0.1, off: [0, 0] });
+ shape(ctx, rrect(-20, -38, 40, 70, 5), { fill: prop.screen || PAL.white, line: 0, seed: 131, grain: 0, off: [0, 0] });
+ shape(ctx, ellipse(0, -8, 11, 11, 16), { fill: PAL.coral, line: 2, seed: 132, grain: 0 });
+ ctx.restore();
+ } else if (prop.kind === 'dock') {
+ drawDock(ctx, hx + (prop.dx ?? 0), hy + (prop.dy ?? 0), prop.s ?? 0.8, prop.rot ?? 0);
+ } else if (prop.kind === 'cable') {
+ const pts = []; for (let i = 0; i <= 60; i++) { const u = i / 60; pts.push([hx + 14 + Math.sin(u * 13) * 16 * u, hy + 8 + u * (prop.len ?? 110)]); }
+ ink(ctx, pts, 6, { seed: 133, taper: false });
+ shape(ctx, rrect(pts[60][0] - 11, pts[60][1], 22, 28, 5), { fill: PAL.white, line: 3, seed: 134 });
+ }
+}
+
+// ---------------------------------------------------------------- the dock (charging base)
+export function drawDock(ctx, x, y, s = 1, rot = 0, o = {}) {
+ ctx.save(); ctx.translate(x, y); ctx.rotate(rot); ctx.scale(s, s);
+ // a mid-century radio-like wedge: cream body, teal face, two chrome contacts
+ shape(ctx, spline([[-70, 0], [-62, -104], [-40, -118], [40, -118], [62, -104], [70, 0]], true, 5), { fill: PAL.white, line: 4, seed: 140, grain: 0.25,
+ shade: [{ pts: [[30, -120], [80, -120], [80, 0], [44, 0]], color: PAL.paperD }] });
+ shape(ctx, rrect(-42, -94, 84, 44, 10), { fill: o.face || PAL.teal, line: 3.2, seed: 141, grain: 0.2 });
+ for (let i = 0; i < 4; i++) ink(ctx, [[-30, -84 + i * 8], [30, -84 + i * 8]], 2.2, { seed: 142 + i, color: PAL.tealDD, taper: false });
+ shape(ctx, rect(-30, -20, 16, 20), { fill: PAL.chrome, line: 2.5, seed: 146, grain: 0 });
+ shape(ctx, rect(14, -20, 16, 20), { fill: PAL.chrome, line: 2.5, seed: 147, grain: 0 });
+ if (o.light) shape(ctx, ellipse(0, -34, 6, 6, 10), { fill: PAL.coral, line: 2, seed: 148, grain: 0 });
+ ctx.restore();
+}
+
+// ---------------------------------------------------------------- Pip, the robot vacuum
+// o: { view:'side'|'top', s, light(0..1), brush (spin angle), face(1 = eye light looks right), ang (top view heading) }
+export function drawPip(ctx, x, y, o = {}) {
+ const s = o.s ?? 1, view = o.view || 'side';
+ ctx.save(); ctx.translate(x, y); ctx.scale(s, s);
+ const C = o.colors || {};
+ const top = C.product || PAL.teal, topD = C.productD || PAL.tealD, trim = C.trim || PAL.white, lightC = C.light || PAL.coral;
+ if (view === 'top') {
+ ctx.rotate(o.ang ?? 0);
+ const R = 120;
+ // side brushes (asterisks) at the front corners, spinning
+ [[-1, 1], [1, 1]].forEach(([sx], i) => {
+ const bx = 82, by = sx * 70;
+ for (let k = 0; k < 3; k++) { const a = (o.brush ?? 0) * sx + k * TAU / 3; ink(ctx, [[bx, by], [bx + Math.cos(a) * 44, by + Math.sin(a) * 44]], 3.2, { seed: 150 + k + i * 3, taper: true }); }
+ });
+ shape(ctx, ellipse(0, 0, R, R, 60), { fill: trim, line: 4.5, seed: 153, grain: 0.2 });
+ shape(ctx, ellipse(-6, 0, R * 0.84, R * 0.84, 60), { fill: top, line: 3.5, seed: 154, grain: 0.3,
+ shade: [{ pts: ellipse(-26, 16, R * 0.84, R * 0.84, 40), color: topD, alpha: 0.35 }] });
+ // bumper arc at the front (+x)
+ ink(ctx, ellipse(0, 0, R + 10, R + 10, 30, -1.1, 1.1), 6, { seed: 155, color: PAL.ink, taper: true });
+ // chrome ring + button
+ ink(ctx, ellipse(-10, 0, 44, 44, 40), 3, { closed: true, seed: 156, color: topD, breaks: 0.3 });
+ shape(ctx, ellipse(-10, 0, 30, 30, 30), { fill: trim, line: 3.5, seed: 157, grain: 0.1 });
+ ink(ctx, ellipse(-10, 0, 13, 13, 24, 0.7, TAU - 0.7), 3, { seed: 158 });
+ ink(ctx, [[-10, 0], [6, 0]], 3, { seed: 159, taper: false });
+ // eye light
+ const L = o.light ?? 1;
+ shape(ctx, ellipse(84, 0, 11, 11, 16), { fill: L > 0.5 ? lightC : PAL.inkSoft, line: 3, seed: 160, grain: 0 });
+ ctx.restore(); return;
+ }
+ // side / three-quarter-from-above view; (0,0) = floor contact centre
+ const R = 130, H = 56, ry = 40;
+ ctx.save(); ctx.globalAlpha = 0.2; ctx.fillStyle = PAL.ink; ctx.beginPath(); ctx.ellipse(8, 4, R * 1.05, ry * 0.7, 0, 0, TAU); ctx.fill(); ctx.restore();
+ // side brushes peeking out at the front bottom
+ [-1, 1].forEach((sx, i) => {
+ const bx = sx * 78, by = 10;
+ for (let k = 0; k < 3; k++) { const a = (o.brush ?? 0) * sx + k * TAU / 3; ink(ctx, [[bx, by], [bx + Math.cos(a) * 40, by + Math.sin(a) * 12]], 3, { seed: 170 + k + i * 3, taper: true }); }
+ });
+ const side = [[-R, -H], [R, -H], ...ellipse(0, 0, R, ry, 40, 0, Math.PI)];
+ shape(ctx, side, { fill: trim, line: 4.5, seed: 175, grain: 0.25,
+ shade: [{ pts: [[R * 0.45, -H - 10], [R + 12, -H - 10], [R + 12, 50], [R * 0.45, 50]], color: PAL.paperD, alpha: 0.9 }] });
+ // chrome stripe
+ ink(ctx, ellipse(0, -H * 0.42, R, ry, 40, 0.05, Math.PI - 0.05), 7, { color: PAL.chromeD, seed: 176, taper: false, wob: 0.1 });
+ // top disc
+ shape(ctx, ellipse(0, -H, R, ry, 60), { fill: top, line: 4.5, seed: 177, grain: 0.3,
+ shade: [{ pts: ellipse(22, -H + 10, R, ry, 40), color: topD, alpha: 0.4 }] });
+ ink(ctx, ellipse(-6, -H - 2, R * 0.6, ry * 0.6, 40), 3, { closed: true, color: topD, seed: 178, breaks: 0.35 });
+ // start button (pressable: o.press 0..1 sinks it)
+ const pr = o.press ?? 0;
+ shape(ctx, ellipse(-6, -H - 4 + pr * 5, 34, 13 - pr * 3, 30), { fill: o.btn || trim, line: 3.5, seed: 179, grain: 0.1 });
+ ink(ctx, ellipse(-6, -H - 4 + pr * 5, 11, 5, 24, -Math.PI / 2 + 0.7, Math.PI * 1.5 - 0.7), 2.6, { seed: 180 });
+ ink(ctx, [[-6, -H - 12 + pr * 5], [-6, -H - 4 + pr * 5]], 2.6, { seed: 182, taper: false });
+ // eye light on the front of the bumper
+ const L = o.light ?? 1;
+ shape(ctx, ellipse(34, -H * 0.62 + ry * 0.88, 11, 9, 16), { fill: L > 0.5 ? lightC : PAL.inkSoft, line: 3, seed: 181, grain: 0 });
+ if (L > 0.5) shape(ctx, ellipse(31, -H * 0.62 + ry * 0.88 - 3, 3, 2.4, 8), { fill: PAL.white, line: 0, grain: 0, off: [0, 0] });
+ ctx.restore();
+}
diff --git a/styles/midcentury-toon/demo/engine/icons.js b/styles/midcentury-toon/demo/engine/icons.js
new file mode 100644
index 0000000..86f2529
--- /dev/null
+++ b/styles/midcentury-toon/demo/engine/icons.js
@@ -0,0 +1,72 @@
+// Icon library, drawn in the mid-century manual style (flat off-register colour + broken ink).
+// icon(ctx, name, cx, cy, size, o) — size = box edge in px. Designed in a 200-unit box centred on 0,0.
+// Names: dock, phone, start, cable, wifi, plug, water, beans, cup, filter, box, clock, check, leaf, key, bulb, spark, gear
+import { PAL, shape, ink, ellipse, rrect, rect, spline, starPts, xform, TAU, sparkle } from './toon.js';
+
+const L = 5; // nominal ink width in icon units (scaled)
+export const ICONS = {
+ dock(ctx, c) {
+ shape(ctx, spline([[-64, 70], [-56, -30], [-36, -44], [36, -44], [56, -30], [64, 70]], true, 5), { fill: c.light, line: L, seed: 1, shade: [{ pts: [[26, -50], [70, -50], [70, 72], [36, 72]], color: PAL.paperD }] });
+ shape(ctx, rrect(-38, -22, 76, 40, 9), { fill: c.main, line: L * 0.7, seed: 2 });
+ for (let i = 0; i < 3; i++) ink(ctx, [[-26, -12 + i * 10], [26, -12 + i * 10]], 3, { color: c.dark, seed: 3 + i, taper: false });
+ shape(ctx, rect(-28, 44, 14, 26), { fill: PAL.chrome, line: 3, seed: 7 }); shape(ctx, rect(14, 44, 14, 26), { fill: PAL.chrome, line: 3, seed: 8 });
+ ink(ctx, spline([[64, 50], [86, 58], [92, 84]], false, 6), 5, { seed: 9 });
+ },
+ phone(ctx, c) {
+ shape(ctx, rrect(-50, -86, 100, 172, 18), { fill: PAL.ink, line: 0, seed: 11, off: [0, 0] });
+ shape(ctx, rrect(-40, -70, 80, 128, 6), { fill: c.light, line: 0, seed: 12 });
+ // wifi fan on screen
+ for (let i = 0; i < 3; i++) ink(ctx, ellipse(0, 20, 14 + i * 14, 14 + i * 14, 16, -Math.PI * 0.78, -Math.PI * 0.22), 5.5, { color: c.main, seed: 13 + i, taper: false });
+ shape(ctx, ellipse(0, 20, 6, 6, 10), { fill: c.main, line: 0, seed: 16 });
+ shape(ctx, ellipse(0, 72, 7, 7, 12), { fill: PAL.inkSoft, line: 0, seed: 17, off: [0, 0] });
+ },
+ start(ctx, c) {
+ shape(ctx, ellipse(0, 10, 86, 34, 40), { fill: c.dark, line: L, seed: 21 });
+ shape(ctx, [[-86, 10], [-86, -8], ...ellipse(0, -8, 86, 34, 40, Math.PI, TAU), [86, 10], ...ellipse(0, 10, 86, 34, 40, 0, Math.PI)], { fill: c.light, line: 0, seed: 22 });
+ shape(ctx, ellipse(0, -8, 86, 34, 40), { fill: c.main, line: L, seed: 23 });
+ ink(ctx, ellipse(0, -10, 22, 10, 20, -Math.PI / 2 + 0.8, Math.PI * 1.5 - 0.8), 5, { seed: 24, color: PAL.white });
+ ink(ctx, [[0, -26], [0, -10]], 5, { seed: 25, color: PAL.white, taper: false });
+ // press finger arrow
+ shape(ctx, [[-10, -120], [10, -120], [10, -76], [24, -76], [0, -52], [-24, -76], [-10, -76]], { fill: PAL.coral, line: 3.5, seed: 26 });
+ },
+ cable(ctx, c) {
+ const pts = []; for (let i = 0; i <= 80; i++) { const u = i / 80, a = u * TAU * 2.2; pts.push([-70 + u * 110 + Math.cos(a) * 30, Math.sin(a) * 30 + (u - 0.5) * 40]); }
+ ink(ctx, pts, 7, { seed: 31, taper: false });
+ shape(ctx, rrect(40, -8, 38, 30, 6), { fill: c.light, line: 4, seed: 32 });
+ ink(ctx, [[78, 0], [94, 0]], 4, { seed: 33, taper: false }); ink(ctx, [[78, 14], [94, 14]], 4, { seed: 34, taper: false });
+ // the "lift it" arrow
+ shape(ctx, [[-60, -58], [-44, -58], [-44, -92], [-30, -92], [-52, -118], [-74, -92], [-60, -92]], { fill: c.main, line: 3.5, seed: 35 });
+ },
+ wifi(ctx, c) { for (let i = 0; i < 3; i++) ink(ctx, ellipse(0, 50, 36 + i * 32, 36 + i * 32, 18, -Math.PI * 0.8, -Math.PI * 0.2), 12, { color: i === 2 ? c.main : PAL.ink, seed: 41 + i, taper: false }); shape(ctx, ellipse(0, 50, 14, 14, 12), { fill: c.main, line: 4, seed: 44 }); },
+ plug(ctx, c) {
+ shape(ctx, rrect(-40, -40, 80, 70, 14), { fill: c.light, line: L, seed: 51 });
+ shape(ctx, rect(-24, -80, 12, 42), { fill: PAL.chrome, line: 3.5, seed: 52 }); shape(ctx, rect(12, -80, 12, 42), { fill: PAL.chrome, line: 3.5, seed: 53 });
+ ink(ctx, spline([[0, 30], [0, 60], [30, 80], [70, 80]], false, 6), 7, { seed: 54 });
+ },
+ water(ctx, c) { shape(ctx, spline([[0, -90], [40, -20], [52, 30], [0, 76], [-52, 30], [-40, -20]], true, 8), { fill: c.main, line: L, seed: 61, shade: [{ pts: ellipse(20, 30, 40, 50, 20), color: c.dark, alpha: 0.4 }] }); sparkle(ctx, -18, 10, 18, { fill: PAL.white }); },
+ beans(ctx, c) { [[-34, -10, 0.5], [30, 20, -0.4]].forEach(([x, y, a], i) => { shape(ctx, ellipse(x, y, 48, 34, 30, 0, TAU, a), { fill: c.dark === PAL.ink ? PAL.brown : PAL.brown, line: L, seed: 62 + i }); ink(ctx, xform(spline([[-38, 4], [-10, -8], [10, 8], [38, -4]], false, 5), x, y, a), 4, { seed: 64 + i }); }); },
+ cup(ctx, c) {
+ shape(ctx, [[-60, -40], [60, -40], [44, 60], [-44, 60]], { fill: c.main, line: L, seed: 71 });
+ ink(ctx, ellipse(66, 6, 22, 26, 20, -1.4, 1.4), 7, { seed: 72 });
+ shape(ctx, ellipse(0, 72, 84, 12, 30), { fill: c.light, line: 4, seed: 73 });
+ for (let i = 0; i < 3; i++) ink(ctx, spline([[-26 + i * 26, -56], [-34 + i * 26, -76], [-22 + i * 26, -94]], false, 5), 5, { seed: 74 + i, color: PAL.inkSoft });
+ },
+ filter(ctx, c) { shape(ctx, [[-70, -50], [70, -50], [22, 60], [-22, 60]], { fill: c.light, line: L, seed: 81 }); for (let i = 0; i < 4; i++) ink(ctx, [[-50 + i * 30, -40], [-14 + i * 10, 50]], 3, { seed: 82 + i, color: c.dark }); },
+ box(ctx, c) {
+ shape(ctx, [[-70, -30], [70, -30], [70, 70], [-70, 70]], { fill: PAL.kraft, line: L, seed: 91, shade: [{ pts: [[30, -30], [70, -30], [70, 70], [30, 70]], color: PAL.kraftD }] });
+ shape(ctx, [[-70, -30], [-96, -70], [-20, -70], [0, -30]], { fill: PAL.kraftL, line: 4, seed: 92 }); shape(ctx, [[70, -30], [96, -70], [20, -70], [0, -30]], { fill: PAL.kraftL, line: 4, seed: 93 });
+ shape(ctx, ellipse(-10, 20, 26, 26, 20), { fill: c.main, line: 3.5, seed: 94 });
+ },
+ clock(ctx, c) { shape(ctx, ellipse(0, 0, 80, 80, 48), { fill: c.light, line: L, seed: 101 }); ink(ctx, [[0, 0], [0, -54]], 7, { seed: 102 }); ink(ctx, [[0, 0], [38, 18]], 7, { seed: 103 }); shape(ctx, ellipse(0, 0, 8, 8, 10), { fill: c.main, line: 0, seed: 104 }); },
+ check(ctx, c) { shape(ctx, ellipse(0, 0, 80, 80, 48), { fill: c.main, line: L, seed: 111 }); ink(ctx, [[-36, 0], [-8, 28], [40, -30]], 16, { seed: 112, color: PAL.white, taper: false }); },
+ leaf(ctx, c) { shape(ctx, spline([[0, 80], [-60, 10], [-30, -70], [0, -90], [30, -70], [60, 10]], true, 8), { fill: c.main, line: L, seed: 121 }); ink(ctx, [[0, 90], [0, -70]], 5, { seed: 122 }); },
+ key(ctx, c) { shape(ctx, ellipse(-40, 0, 40, 40, 30), { fill: c.main, line: L, seed: 131 }); shape(ctx, ellipse(-40, 0, 14, 14, 16), { fill: PAL.paper, line: 3.5, seed: 132 }); shape(ctx, [[0, -10], [86, -10], [86, 10], [70, 10], [70, 30], [56, 30], [56, 10], [0, 10]], { fill: c.main, line: L, seed: 133 }); },
+ bulb(ctx, c) { shape(ctx, spline([[0, -90], [56, -50], [40, 10], [24, 40], [-24, 40], [-40, 10], [-56, -50]], true, 8), { fill: c.light, line: L, seed: 141 }); shape(ctx, rrect(-24, 40, 48, 36, 6), { fill: PAL.chrome, line: 4, seed: 142 }); sparkle(ctx, 0, -40, 26, { fill: c.main }); },
+ spark(ctx, c) { shape(ctx, starPts(0, 0, 86, 8, 0.4), { fill: c.main, line: L, seed: 151 }); sparkle(ctx, 0, 0, 40, { fill: PAL.white }); },
+ gear(ctx, c) { const p = []; for (let i = 0; i < 32; i++) { const a = i / 32 * TAU, r = (i % 4 < 2) ? 84 : 64; p.push([Math.cos(a) * r, Math.sin(a) * r]); } shape(ctx, p, { fill: c.main, line: L, seed: 161 }); shape(ctx, ellipse(0, 0, 26, 26, 20), { fill: PAL.paper, line: 4, seed: 162 }); },
+};
+export function icon(ctx, name, cx, cy, size, o = {}) {
+ const c = { main: o.main || PAL.teal, light: o.light || PAL.white, dark: o.dark || PAL.tealD };
+ const f = ICONS[name] || ICONS.spark;
+ ctx.save(); ctx.translate(cx, cy); ctx.scale(size / 200, size / 200); f(ctx, c); ctx.restore();
+}
diff --git a/styles/midcentury-toon/demo/engine/toon.js b/styles/midcentury-toon/demo/engine/toon.js
new file mode 100644
index 0000000..b1881c6
--- /dev/null
+++ b/styles/midcentury-toon/demo/engine/toon.js
@@ -0,0 +1,320 @@
+// Mid-century Cartoon engine (1950s limited animation, UPA / educational-film lineage).
+// The look in four rules:
+// 1. colour and line are two separate "cels": every fill is printed a few px off its ink line,
+// and the offset re-jitters on twos (12 fps) so the picture breathes like a hand-registered cel;
+// 2. flat colour with a light dry-brush / print tooth, no gradients inside a shape;
+// 3. thin ink line with pressure and deliberate breaks (the line never fully closes);
+// 4. backgrounds are abstract colour planes, starbursts and atomic sparkles, never a full room.
+// Every function takes plain coordinates in the current ctx transform.
+
+export const PAL = {
+ paper: '#F4EAD5', paperD: '#E6D8BC', paperDD: '#D4C29F',
+ ink: '#2B2420', inkSoft: '#4A3F38',
+ coral: '#E4613F', coralD: '#B8452B', coralL: '#F0917A',
+ mustard: '#E8B43A', mustardD: '#C08A1E', mustardL: '#F3D37F',
+ teal: '#3FA7A0', tealD: '#257A74', tealDD: '#1B5753', tealL: '#8ACFC6',
+ blue: '#7F9CC0', blueD: '#5B789E', blueL: '#B5C8DE',
+ pink: '#F0B4A8', pinkD: '#D98F82',
+ avocado: '#A7AE5B', avocadoD: '#7E8538', avocadoL: '#CBD08E',
+ plum: '#6E4A6B', brown: '#7B4B2E', brownL: '#A8704A', kraft: '#C9955D', kraftD: '#A2713F', kraftL: '#DDB47F',
+ skin: '#F2C7A0', skinD: '#DDA37C', hair: '#3A2621', white: '#FBF6EA', chrome: '#C9CFCB', chromeD: '#8E9894',
+};
+
+// ---------- deterministic randomness ----------
+export function rng(seed) { let s = seed | 0 || 1; return () => { s = s + 0x6D2B79F5 | 0; let t = Math.imul(s ^ s >>> 15, 1 | s); t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t; return ((t ^ t >>> 14) >>> 0) / 4294967296; }; }
+export const hash = (x, y = 0, z = 0) => { const n = Math.sin(x * 127.1 + y * 311.7 + z * 74.7) * 43758.5453; return n - Math.floor(n); };
+export function noise(seed = 0) {
+ const g = (ix, iy) => hash(ix, iy, seed);
+ const n = (x, y = 0) => { const ix = Math.floor(x), iy = Math.floor(y), fx = x - ix, fy = y - iy, u = fx * fx * (3 - 2 * fx), v = fy * fy * (3 - 2 * fy);
+ return (g(ix, iy) * (1 - u) + g(ix + 1, iy) * u) * (1 - v) + (g(ix, iy + 1) * (1 - u) + g(ix + 1, iy + 1) * u) * v; };
+ n.fbm = (x, y, o = 4) => { let a = 0, w = 0.5, f = 1, s = 0; for (let i = 0; i < o; i++) { a += w * n(x * f, y * f); s += w; w *= 0.5; f *= 2; } return a / s; };
+ return n;
+}
+export const clamp = (x, a = 0, b = 1) => Math.max(a, Math.min(b, x));
+export const lerp = (a, b, t) => a + (b - a) * t;
+export const seg = (t, a, b) => clamp((t - a) / (b - a));
+export const ss = t => { t = clamp(t); return t * t * (3 - 2 * t); };
+export const eo = t => 1 - Math.pow(1 - clamp(t), 3);
+export const eio = t => { t = clamp(t); return t < .5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2; };
+export const back = (t, s = 1.7) => { t = clamp(t) - 1; return 1 + t * t * ((s + 1) * t + s); };
+export const TAU = Math.PI * 2;
+// limited animation: hold every drawing for two frames (12 fps)
+export const twos = (t, fps = 12) => Math.floor(t * fps + 1e-6) / fps;
+
+// ---------- the register (colour cel vs ink cel) ----------
+// base offset of the colour cel in px; jitter re-rolls on twos.
+export const REG = { dx: 6, dy: 4, jit: 1.6, on: true };
+let CLOCK = 0;
+export function setClock(t) { CLOCK = t; }
+export function reg(seed = 0, k = 1) {
+ if (!REG.on) return [0, 0];
+ const f = Math.floor(CLOCK * 12 + 1e-6);
+ return [(REG.dx + (hash(f, seed, 1) - 0.5) * 2 * REG.jit) * k, (REG.dy + (hash(f, seed, 2) - 0.5) * 2 * REG.jit) * k];
+}
+
+// ---------- geometry ----------
+export function spline(pts, closed = true, n = 8) {
+ const out = [], N = pts.length, get = i => closed ? pts[(i + N) % N] : pts[Math.max(0, Math.min(N - 1, i))];
+ const segs = closed ? N : N - 1;
+ for (let i = 0; i < segs; i++) {
+ const p0 = get(i - 1), p1 = get(i), p2 = get(i + 1), p3 = get(i + 2);
+ for (let k = 0; k < n; k++) {
+ const t = k / n, t2 = t * t, t3 = t2 * t;
+ out.push([0.5 * (2 * p1[0] + (-p0[0] + p2[0]) * t + (2 * p0[0] - 5 * p1[0] + 4 * p2[0] - p3[0]) * t2 + (-p0[0] + 3 * p1[0] - 3 * p2[0] + p3[0]) * t3),
+ 0.5 * (2 * p1[1] + (-p0[1] + p2[1]) * t + (2 * p0[1] - 5 * p1[1] + 4 * p2[1] - p3[1]) * t2 + (-p0[1] + 3 * p1[1] - 3 * p2[1] + p3[1]) * t3)]);
+ }
+ }
+ if (!closed) out.push(pts[N - 1]);
+ return out;
+}
+export const ellipse = (cx, cy, rx, ry, n = 48, a0 = 0, a1 = TAU, rot = 0) => {
+ const out = [];
+ for (let i = 0; i <= n; i++) { const a = a0 + (a1 - a0) * i / n, x = Math.cos(a) * rx, y = Math.sin(a) * ry; out.push([cx + x * Math.cos(rot) - y * Math.sin(rot), cy + x * Math.sin(rot) + y * Math.cos(rot)]); }
+ return out;
+};
+export const rect = (x, y, w, h) => [[x, y], [x + w, y], [x + w, y + h], [x, y + h]];
+export function rrect(x, y, w, h, r, n = 5) {
+ r = Math.min(r, w / 2, h / 2); const out = [];
+ const c = [[x + w - r, y + r, -Math.PI / 2], [x + w - r, y + h - r, 0], [x + r, y + h - r, Math.PI / 2], [x + r, y + r, Math.PI]];
+ for (const [cx, cy, a0] of c) for (let i = 0; i <= n; i++) { const a = a0 + Math.PI / 2 * i / n; out.push([cx + Math.cos(a) * r, cy + Math.sin(a) * r]); }
+ return out;
+}
+export const move = (pts, dx, dy) => pts.map(([x, y]) => [x + dx, y + dy]);
+export const xform = (pts, ox, oy, a = 0, s = 1, sy = s) => { const c = Math.cos(a), si = Math.sin(a); return pts.map(([x, y]) => [ox + c * x * s - si * y * sy, oy + si * x * s + c * y * sy]); };
+export function path(ctx, pts, closed = true) { ctx.beginPath(); pts.forEach(([x, y], i) => i ? ctx.lineTo(x, y) : ctx.moveTo(x, y)); if (closed) ctx.closePath(); }
+export function bbox(pts) { let a = 1e9, b = 1e9, c = -1e9, d = -1e9; for (const [x, y] of pts) { a = Math.min(a, x); b = Math.min(b, y); c = Math.max(c, x); d = Math.max(d, y); } return [a, b, c, d]; }
+export function plen(pts) { let L = 0; for (let i = 1; i < pts.length; i++) L += Math.hypot(pts[i][0] - pts[i - 1][0], pts[i][1] - pts[i - 1][1]); return L; }
+// first fraction u (0..1) of an open polyline, by length
+export function subpath(pts, u) {
+ if (u >= 1) return pts; if (u <= 0) return [pts[0]];
+ const L = plen(pts) * u, out = [pts[0]]; let acc = 0;
+ for (let i = 1; i < pts.length; i++) {
+ const d = Math.hypot(pts[i][0] - pts[i - 1][0], pts[i][1] - pts[i - 1][1]);
+ if (acc + d >= L) { const k = (L - acc) / (d || 1); out.push([lerp(pts[i - 1][0], pts[i][0], k), lerp(pts[i - 1][1], pts[i][1], k)]); break; }
+ acc += d; out.push(pts[i]);
+ }
+ return out;
+}
+export function pointAt(pts, u) { const s = subpath(pts, u); const a = s[s.length - 1], b = s[Math.max(0, s.length - 2)]; return { x: a[0], y: a[1], a: Math.atan2(a[1] - b[1], a[0] - b[0]) }; }
+
+// ---------- textures (built once, seeded) ----------
+let TEX = null;
+function mkc(S) { const c = new OffscreenCanvas(S, S); return [c, c.getContext('2d')]; }
+export function textures() {
+ if (TEX) return TEX;
+ const R = rng(4848), N = noise(48), S = 512;
+ // dry-brush tooth: short horizontal-ish flecks (the paint dragged across a cel)
+ const [dk, g1] = mkc(S);
+ for (let i = 0; i < 3600; i++) {
+ const x = R() * S, y = R() * S, l = 2 + R() * 9, a = (R() - 0.5) * 0.35;
+ g1.strokeStyle = `rgba(40,25,15,${0.05 + R() * 0.16})`; g1.lineWidth = 0.6 + R() * 1.6;
+ g1.beginPath(); g1.moveTo(x, y); g1.lineTo(x + Math.cos(a) * l, y + Math.sin(a) * l); g1.stroke();
+ }
+ // print holes: paper showing through thin ink
+ const [lt, g2] = mkc(S);
+ for (let i = 0; i < 2600; i++) {
+ const x = R() * S, y = R() * S, r = 0.4 + R() * 1.3 * (N.fbm(x / 50, y / 50) + 0.2);
+ g2.fillStyle = `rgba(255,250,236,${0.1 + R() * 0.32})`; g2.beginPath(); g2.ellipse(x, y, r * 1.6, r, 0.1, 0, TAU); g2.fill();
+ }
+ // paper: soft mottling + fibres
+ const [pf, g3] = mkc(S);
+ const img = g3.createImageData(S, S);
+ for (let y = 0; y < S; y++) for (let x = 0; x < S; x++) {
+ const v = (N.fbm(x / 26, y / 26, 3) - 0.5) * 46 + (hash(x, y, 7) - 0.5) * 26, i = (y * S + x) * 4;
+ img.data[i] = img.data[i + 1] = img.data[i + 2] = 128 + v; img.data[i + 3] = 255;
+ }
+ g3.putImageData(img, 0, 0);
+ for (let i = 0; i < 220; i++) {
+ const x = R() * S, y = R() * S, a = R() * TAU, l = 6 + R() * 16;
+ g3.strokeStyle = R() < 0.5 ? 'rgba(90,80,60,0.3)' : 'rgba(255,255,245,0.4)'; g3.lineWidth = 0.7;
+ g3.beginPath(); g3.moveTo(x, y); g3.quadraticCurveTo(x + Math.cos(a + 0.4) * l * 0.5, y + Math.sin(a + 0.4) * l * 0.5, x + Math.cos(a) * l, y + Math.sin(a) * l); g3.stroke();
+ }
+ TEX = { dk, lt, pf };
+ return TEX;
+}
+const patCache = new WeakMap();
+export function pat(ctx, name) {
+ let m = patCache.get(ctx); if (!m) { m = {}; patCache.set(ctx, m); }
+ if (!m[name]) m[name] = ctx.createPattern(textures()[name], 'repeat');
+ return m[name];
+}
+// tooth inside the current shape; k 0..1
+export function grainIn(ctx, pts, k = 0.35) {
+ if (k <= 0) return;
+ const [x0, y0, x1, y1] = bbox(pts);
+ ctx.save(); path(ctx, pts); ctx.clip();
+ ctx.globalAlpha *= 0.6 * k; ctx.fillStyle = pat(ctx, 'dk'); ctx.fillRect(x0 - 2, y0 - 2, x1 - x0 + 4, y1 - y0 + 4);
+ ctx.globalAlpha /= 0.6; ctx.globalAlpha *= 0.9; ctx.fillStyle = pat(ctx, 'lt'); ctx.fillRect(x0 - 2, y0 - 2, x1 - x0 + 4, y1 - y0 + 4);
+ ctx.restore();
+}
+
+// ---------- ink line: a pressure ribbon with breaks ----------
+export function ink(ctx, pts, w, o = {}) {
+ const { color = PAL.ink, closed = false, wob = 0.4, seed = 1, breaks = 0, taper = true, alpha = 1, upto = 1 } = o;
+ let P = closed ? [...pts, pts[0], pts[1] || pts[0]] : pts;
+ if (upto < 1) P = subpath(P, upto);
+ if (P.length < 2 || w <= 0) return;
+ const L = [0]; for (let i = 1; i < P.length; i++) L.push(L[i - 1] + Math.hypot(P[i][0] - P[i - 1][0], P[i][1] - P[i - 1][1]));
+ const total = L[L.length - 1]; if (total <= 0.5) return;
+ const step = Math.max(1.5, Math.min(w * 0.7, total / 600)), n = Math.max(2, Math.ceil(total / step));
+ const S = []; let j = 0;
+ for (let i = 0; i <= n; i++) {
+ const d = total * i / n; while (j < L.length - 2 && L[j + 1] < d) j++;
+ const u = (d - L[j]) / Math.max(1e-6, L[j + 1] - L[j]); S.push([P[j][0] + (P[j + 1][0] - P[j][0]) * u, P[j][1] + (P[j + 1][1] - P[j][1]) * u, d]);
+ }
+ const N = noise(seed * 13 + 5);
+ const wid = d => {
+ let k = 1 + wob * (N(d / (w * 16), 0.5) - 0.5) * 2;
+ if (taper && !closed) { const e = Math.min(d, total - d) / (w * 4); k *= Math.min(1, 0.3 + e * 0.7); }
+ return Math.max(0.08, k) * w * 0.5;
+ };
+ const runs = []; let cur = [];
+ for (let i = 0; i < S.length; i++) {
+ const gap = breaks > 0 && N(S[i][2] / (w * 11), 7.3) < breaks * 0.5;
+ if (gap) { if (cur.length > 1) runs.push(cur); cur = []; } else cur.push(S[i]);
+ }
+ if (cur.length > 1) runs.push(cur);
+ ctx.save(); ctx.globalAlpha *= alpha; ctx.fillStyle = color;
+ for (const run of runs) {
+ const left = [], right = [];
+ for (let i = 0; i < run.length; i++) {
+ const a = run[Math.max(0, i - 1)], b = run[Math.min(run.length - 1, i + 1)];
+ let nx = -(b[1] - a[1]), ny = b[0] - a[0]; const l = Math.hypot(nx, ny) || 1; nx /= l; ny /= l;
+ const r = wid(run[i][2]); left.push([run[i][0] + nx * r, run[i][1] + ny * r]); right.push([run[i][0] - nx * r, run[i][1] - ny * r]);
+ }
+ ctx.beginPath(); left.forEach(([x, y], i) => i ? ctx.lineTo(x, y) : ctx.moveTo(x, y));
+ for (let i = right.length - 1; i >= 0; i--) ctx.lineTo(right[i][0], right[i][1]);
+ ctx.closePath(); ctx.fill();
+ // round caps
+ const r0 = wid(run[0][2]), r1 = wid(run[run.length - 1][2]);
+ ctx.beginPath(); ctx.arc(run[0][0], run[0][1], r0, 0, TAU); ctx.arc(run[run.length - 1][0], run[run.length - 1][1], r1, 0, TAU); ctx.fill();
+ }
+ ctx.restore();
+}
+
+// ---------- the core call: a shape in this style ----------
+// o.fill colour (null = line only)
+// o.line ink width (0 = none) o.lineColor default ink
+// o.off [dx,dy] override of the register offset; o.reg = seed for the jitter; o.regK scale
+// o.grain tooth 0..1 o.breaks gaps in the line 0..1
+// o.shade [{pts,color,alpha}] flat shade planes clipped to the fill
+export function shape(ctx, pts, o = {}) {
+ const { fill = null, line = 0, lineColor = PAL.ink, grain = 0.35, breaks = 0.18, seed = 1, wob = 0.4, regK = 1, alpha = 1 } = o;
+ const off = o.off || reg(o.reg ?? seed, regK);
+ ctx.save(); ctx.globalAlpha *= alpha;
+ if (fill) {
+ const P = move(pts, off[0], off[1]);
+ ctx.save(); path(ctx, P); ctx.fillStyle = fill; ctx.fill();
+ if (o.shade) { ctx.clip(); for (const s of [].concat(o.shade)) { path(ctx, move(s.pts, off[0], off[1])); ctx.fillStyle = s.color; ctx.globalAlpha = alpha * (s.alpha ?? 1); ctx.fill(); ctx.globalAlpha = alpha; } }
+ ctx.restore();
+ grainIn(ctx, P, grain);
+ }
+ if (line > 0) ink(ctx, pts, line, { closed: true, color: lineColor, breaks, seed, wob });
+ ctx.restore();
+}
+// a flat plane with no line at all (backgrounds)
+export function plane(ctx, pts, fill, o = {}) { shape(ctx, pts, { fill, line: 0, grain: o.grain ?? 0.25, off: o.off || [0, 0], alpha: o.alpha ?? 1 }); }
+
+// ---------- mid-century ornaments ----------
+// starburst: n points, inner ratio, rotation. Used behind reveals and as the "clean!" sparkle.
+export function starPts(cx, cy, r, n = 8, inner = 0.42, rot = 0, sq = 1) {
+ const out = [];
+ for (let i = 0; i < n * 2; i++) { const a = rot + i * Math.PI / n - Math.PI / 2, rr = i % 2 ? r * inner : r; out.push([cx + Math.cos(a) * rr, cy + Math.sin(a) * rr * sq]); }
+ return out;
+}
+export function star(ctx, cx, cy, r, o = {}) {
+ const { n = 8, inner = 0.42, rot = 0, fill = PAL.white, line = 0, seed = 7 } = o;
+ shape(ctx, starPts(cx, cy, r, n, inner, rot), { fill, line, seed, grain: o.grain ?? 0.2, off: o.off, breaks: 0.3, alpha: o.alpha ?? 1 });
+}
+// the four-point atomic sparkle (thin concave star)
+export function sparkle(ctx, cx, cy, r, o = {}) {
+ const { rot = 0, fill = PAL.white, alpha = 1 } = o;
+ const pts = [];
+ for (let i = 0; i < 4; i++) {
+ const a = rot + i * Math.PI / 2 - Math.PI / 2, b = a + Math.PI / 4;
+ pts.push([cx + Math.cos(a) * r, cy + Math.sin(a) * r]);
+ pts.push([cx + Math.cos(b) * r * 0.14, cy + Math.sin(b) * r * 0.14]);
+ }
+ ctx.save(); ctx.globalAlpha *= alpha; path(ctx, pts); ctx.fillStyle = fill; ctx.fill(); ctx.restore();
+}
+// sunburst rays: alternating wedges from a centre (the 1950s advertising "glory")
+export function rays(ctx, cx, cy, n, r, fill, o = {}) {
+ const { rot = 0, k = 1, alpha = 1, r0 = 0 } = o;
+ ctx.save(); ctx.globalAlpha *= alpha; ctx.fillStyle = fill; ctx.beginPath();
+ for (let i = 0; i < n; i++) {
+ const a0 = rot + i * TAU / n, a1 = a0 + TAU / n * 0.5 * k;
+ ctx.moveTo(cx + Math.cos(a0) * r0, cy + Math.sin(a0) * r0); ctx.lineTo(cx + Math.cos(a0) * r, cy + Math.sin(a0) * r);
+ ctx.lineTo(cx + Math.cos(a1) * r, cy + Math.sin(a1) * r); ctx.lineTo(cx + Math.cos(a1) * r0, cy + Math.sin(a1) * r0); ctx.closePath();
+ }
+ ctx.fill(); ctx.restore();
+}
+// "atom": three elliptical orbits + nucleus (line-only ornament)
+export function atom(ctx, cx, cy, r, o = {}) {
+ const { color = PAL.ink, w = 3, rot = 0, nucleus = PAL.coral } = o;
+ for (let i = 0; i < 3; i++) ink(ctx, ellipse(cx, cy, r, r * 0.34, 40, 0, TAU, rot + i * Math.PI / 3), w, { closed: true, color, breaks: 0.25, seed: 30 + i });
+ shape(ctx, ellipse(cx, cy, r * 0.16, r * 0.16, 16), { fill: nucleus, line: 0, grain: 0 });
+}
+// boomerang / kidney outlines (furniture and background motifs)
+export const boomerang = (cx, cy, s, rot = 0) => xform(spline([[-1, -0.25], [-0.2, -0.05], [0.15, -0.55], [0.95, -0.2], [0.35, 0.1], [0.1, 0.45], [-0.85, 0.35]], true, 10), cx, cy, rot, s);
+export const kidney = (cx, cy, s, rot = 0) => xform(spline([[-1, -0.1], [-0.6, -0.55], [0.1, -0.45], [0.35, -0.15], [0.8, -0.45], [1.05, 0.05], [0.6, 0.5], [-0.4, 0.5]], true, 10), cx, cy, rot, s);
+// a fat dotted/dashed line (the diagram arrow shaft, the cleaning path)
+export function dashed(ctx, pts, w, dash, gap, phase = 0, color = PAL.ink, upto = 1) {
+ const P = upto < 1 ? subpath(pts, upto) : pts, L = plen(P); if (L < 1) return;
+ const period = dash + gap; let d = -((phase % period) + period) % period;
+ while (d < L) { const a = Math.max(0, d), b = Math.min(L, d + dash); if (b > a) { const s0 = subpath(P, a / L), s1 = subpath(P, b / L); ink(ctx, [s0[s0.length - 1], ...s1.slice(s0.length)], w, { color, taper: false, wob: 0.15, seed: Math.floor(d) }); } d += period; }
+}
+
+// ---------- the moving manual arrow ----------
+// A 1950s instruction-sheet arrow: curved ink shaft that draws itself on, a fat solid head, and a
+// bounce on the beat. from/to in px; bend = sideways bow as a fraction of the length.
+// u 0..1 draw-on progress bob 0..1 bounce phase (use beat phase)
+export function arrow(ctx, from, to, o = {}) {
+ const { u = 1, bob = 0, bend = 0.25, w = 7, color = PAL.ink, fill = PAL.coral, head = 34, dashedShaft = false, seed = 11 } = o;
+ const [x0, y0] = from, [x1, y1] = to, dx = x1 - x0, dy = y1 - y0, L = Math.hypot(dx, dy) || 1;
+ const nx = -dy / L, ny = dx / L, mx = (x0 + x1) / 2 + nx * L * bend, my = (y0 + y1) / 2 + ny * L * bend;
+ const pts = []; for (let i = 0; i <= 40; i++) { const t = i / 40, a = (1 - t) * (1 - t), b = 2 * t * (1 - t), c = t * t; pts.push([a * x0 + b * mx + c * x1, a * y0 + b * my + c * y1]); }
+ const k = 1 - Math.abs(Math.sin(bob * Math.PI)) * 0.18; // bob pulls the head back along the shaft
+ const shaft = subpath(pts, u * k);
+ const tip = shaft[shaft.length - 1], pre = subpath(pts, Math.max(0, u * k - 0.06)), p2 = pre[pre.length - 1];
+ const ang = Math.atan2(tip[1] - p2[1], tip[0] - p2[0]);
+ if (dashedShaft) dashed(ctx, subpath(shaft, 0.92), w, w * 2.4, w * 1.6, 0, color); else ink(ctx, subpath(shaft, 0.94), w, { color, seed, taper: true });
+ if (u > 0.15) {
+ const hs = head * ss(seg(u, 0.15, 0.5));
+ const H = xform([[0, 0], [-hs * 1.1, -hs * 0.62], [-hs * 0.78, 0], [-hs * 1.1, hs * 0.62]], tip[0] + Math.cos(ang) * hs * 0.25, tip[1] + Math.sin(ang) * hs * 0.25, ang);
+ shape(ctx, H, { fill, line: 3.5, seed: seed + 1, grain: 0.15, breaks: 0 });
+ }
+}
+
+// ---------- lettering ----------
+// Two-plate type: a colour plate printed off-register under an ink (or cream) plate.
+export function text(ctx, str, x, y, o = {}) {
+ const { font = '64px Jost', fill = PAL.ink, plate = null, align = 'left', base = 'alphabetic', track = 0, alpha = 1, seed = 3, rot = 0, maxW = 0 } = o;
+ ctx.save(); ctx.globalAlpha *= alpha; ctx.font = font; ctx.textAlign = align; ctx.textBaseline = base;
+ if (track) ctx.letterSpacing = track + 'px';
+ ctx.translate(x, y); ctx.rotate(rot);
+ if (maxW) { const w = ctx.measureText(str).width; if (w > maxW) ctx.scale(maxW / w, 1); }
+ if (plate) { const [ox, oy] = o.off || reg(seed, 0.8); ctx.fillStyle = plate; ctx.fillText(str, ox, oy); }
+ ctx.fillStyle = fill; ctx.fillText(str, 0, 0);
+ ctx.restore();
+}
+export function measure(ctx, str, font, track = 0) { ctx.save(); ctx.font = font; if (track) ctx.letterSpacing = track + 'px'; const w = ctx.measureText(str).width; ctx.restore(); return w; }
+// word-wrap into lines no wider than maxW; shrinks the font (down to minPx) before wrapping past maxLines
+export function fit(ctx, str, fam, px, maxW, maxLines = 2, minPx = px * 0.6) {
+ for (let p = px; p >= minPx; p -= 2) {
+ const font = fam.replace('{px}', p), words = String(str).split(/\s+/), lines = []; let cur = '';
+ for (const w of words) { const t = cur ? cur + ' ' + w : w; if (measure(ctx, t, font) <= maxW || !cur) cur = t; else { lines.push(cur); cur = w; } }
+ if (cur) lines.push(cur);
+ if (lines.length <= maxLines && lines.every(l => measure(ctx, l, font) <= maxW)) return { font, px: p, lines };
+ }
+ const font = fam.replace('{px}', minPx); return { font, px: minPx, lines: [String(str)] };
+}
+
+// ---------- finishing ----------
+export function paperFinish(ctx, W, H, k = 1) {
+ ctx.save(); ctx.setTransform(1, 0, 0, 1, 0, 0);
+ ctx.globalCompositeOperation = 'overlay'; ctx.globalAlpha = 0.26 * k; ctx.fillStyle = pat(ctx, 'pf'); ctx.fillRect(0, 0, W, H);
+ ctx.globalCompositeOperation = 'multiply'; ctx.globalAlpha = 0.14 * k;
+ const g = ctx.createRadialGradient(W / 2, H * 0.48, H * 0.45, W / 2, H * 0.5, H * 1.05); g.addColorStop(0, 'rgba(255,255,255,0)'); g.addColorStop(1, 'rgba(110,80,50,1)');
+ ctx.fillStyle = g; ctx.fillRect(0, 0, W, H);
+ ctx.restore();
+}
diff --git a/styles/midcentury-toon/demo/events.json b/styles/midcentury-toon/demo/events.json
new file mode 100644
index 0000000..a41a03b
--- /dev/null
+++ b/styles/midcentury-toon/demo/events.json
@@ -0,0 +1 @@
+{"dur":40,"ev":[{"t":0,"type":"creak","pan":-0.3},{"t":0.4345,"type":"box_thump","pan":-0.35,"pitch":0},{"t":0.8891,"type":"box_thump","pan":0.35,"pitch":1},{"t":1.3636,"type":"box_fall"},{"t":1.8182,"type":"ding","gain":0.8},{"t":1.8382,"type":"pen_write","dur":0.55},{"t":1.9782,"type":"vo","id":"hook"},{"t":2.1582,"type":"plastic_land"},{"t":2.7273,"type":"wood_tick"},{"t":6.8182,"type":"stamp"},{"t":7.0455,"type":"vo","id":"step0"},{"t":7.0455,"type":"whoosh","dur":0.4},{"t":7.3182,"type":"slide","gain":0.5},{"t":8,"type":"scrape","dur":0.35,"gain":0.5},{"t":8.1818,"type":"pop"},{"t":8.5909,"type":"scrape","dur":0.6},{"t":8.8636,"type":"plastic_thock"},{"t":9.3182,"type":"pop","gain":0.6},{"t":9.5455,"type":"plug_click"},{"t":9.5455,"type":"flip"},{"t":9.7727,"type":"whistle","pan":-0.5},{"t":10,"type":"whistle","pan":0.5,"up":1},{"t":12.2727,"type":"stamp"},{"t":12.5,"type":"vo","id":"step1"},{"t":12.5,"type":"whoosh","dur":0.4},{"t":12.7727,"type":"slide","gain":0.5},{"t":13.6364,"type":"pop"},{"t":14.5455,"type":"tap"},{"t":15,"type":"tap"},{"t":15,"type":"pop","gain":0.6},{"t":15.4545,"type":"beep","n":0},{"t":15.9091,"type":"beep","n":1},{"t":16.3636,"type":"beep","n":2},{"t":16.3636,"type":"stamp","gain":0.5},{"t":17.7273,"type":"stamp"},{"t":17.9545,"type":"vo","id":"step2"},{"t":17.9545,"type":"whoosh","dur":0.4},{"t":18.2273,"type":"slide","gain":0.5},{"t":18.6364,"type":"whoosh","dur":0.3,"gain":0.4},{"t":19.0909,"type":"pop","gain":0.6},{"t":20.4545,"type":"btn_soft"},{"t":20.4545,"type":"hold","dur":0.9090909090909091},{"t":21.6182,"type":"motor","dur":6.0545454545454565},{"t":21.8182,"type":"click_big"},{"t":23.6364,"type":"zone","n":0},{"t":24.5455,"type":"zone","n":1},{"t":25.4545,"type":"zone","n":2},{"t":26.8182,"type":"dock"},{"t":27.2727,"type":"paper_swish"},{"t":27.2727,"type":"stamp"},{"t":27.3527,"type":"vo","id":"tip"},{"t":28.1818,"type":"grab"},{"t":28.2727,"type":"peel","dur":1},{"t":29.5455,"type":"ding","gain":0.5},{"t":29.5455,"type":"roll","dur":0.45},{"t":30.9091,"type":"paper_swish","gain":0.6},{"t":30.9091,"type":"stamp","gain":0.8},{"t":31.3636,"type":"stamp","gain":0.8},{"t":31.4436,"type":"vo","id":"outro"},{"t":31.8182,"type":"stamp","gain":0.8},{"t":32.2727,"type":"wood_block"},{"t":32.5,"type":"paper_swish","gain":0.5},{"t":32.7273,"type":"pop","gain":0.6},{"t":36.3636,"type":"iris","dur":0.5454545454545454},{"t":37.0455,"type":"pop","gain":0.5}]}
\ No newline at end of file
diff --git a/styles/midcentury-toon/demo/film.js b/styles/midcentury-toon/demo/film.js
new file mode 100644
index 0000000..223bbe3
--- /dev/null
+++ b/styles/midcentury-toon/demo/film.js
@@ -0,0 +1,889 @@
+// "Meet Pip" — a product set-up guide in the mid-century cartoon style.
+// Everything readable comes from content.json; the timeline is rebuilt from the number of steps and the voice durations,
+// always on the 132 BPM grid. Scenes only call the engine (engine/*.js).
+import { PAL, setClock, shape, plane, ink, rays, ellipse, rect, rrect, spline, move, xform, star, sparkle, text, fit, measure, arrow, dashed,
+ paperFinish, kidney, boomerang, subpath, pointAt, plen, clamp, lerp, seg, ss, eo, eio, back, twos, TAU, hash } from './engine/toon.js';
+import { drawOwner, drawPip, drawDock, drawHand, armJoints } from './engine/chars.js';
+import { icon } from './engine/icons.js';
+
+const W = 1920, H = 1080;
+export const BPM = 132, BEAT = 60 / BPM, BAR = BEAT * 4;
+let C = null, D = {}, T = null, COL = null, EVS = [];
+
+// ------------------------------------------------------------------ colour helpers
+const hx = c => [1, 3, 5].map(i => parseInt(c.slice(i, i + 2), 16));
+const mix = (a, b, k) => { const A = hx(a), B = hx(b); return '#' + A.map((v, i) => Math.round(v + (B[i] - v) * k).toString(16).padStart(2, '0')).join(''); };
+const tint = (c, k) => mix(c, '#FFFFFF', k), shade = (c, k) => mix(c, '#2B2420', k);
+
+// ------------------------------------------------------------------ timeline
+export function setup(content, durs) {
+ C = content; D = durs || {};
+ const p = C.palette || {};
+ COL = { paper: p.paper || PAL.paper, ink: p.ink || PAL.ink, product: p.product || PAL.teal, productD: p.productDark || PAL.tealD, accent: p.accent || PAL.coral,
+ hook: p.hook || PAL.mustard, steps: p.steps || [PAL.blue, PAL.mustard, PAL.avocado, PAL.pink, PAL.plum], tip: p.tip || PAL.pink };
+ const vd = k => D[k] ?? estimate(k);
+ const S = []; let bar = 0;
+ const add = (kind, bars, extra = {}) => { S.push({ kind, t0: bar * BAR, t1: (bar + bars) * BAR, bar0: bar, bars, ...extra }); bar += bars; };
+ add('hook', 4);
+ const n = C.steps.length;
+ C.steps.forEach((s, i) => add('step', i === n - 1 ? 2 : Math.max(3, Math.ceil((vd('step' + i) + 1.6) / BAR)), { i, last: i === n - 1 }));
+ add('payoff', 3); add('tip', 2); add('lockup', 3); add('end', 2);
+ T = { S, dur: bar * BAR };
+ // voice cues: each step's line opens half a beat before its iris (J-cut)
+ const V = [];
+ V.push({ id: 'hook', t: S[0].t0 + BAR + 0.16 });
+ S.filter(s => s.kind === 'step').forEach(s => V.push({ id: 'step' + s.i, t: s.t0 - BEAT * 0.5 }));
+ V.push({ id: 'tip', t: sec('tip').t0 + 0.08 });
+ V.push({ id: 'outro', t: sec('lockup').t0 + BEAT + 0.08 });
+ V.forEach(v => { v.dur = vd(v.id); v.text = lineOf(v.id); });
+ T.V = V;
+ PATH = null; buildEvents();
+}
+function lineOf(k) { return k === 'hook' ? C.hook.line : k === 'tip' ? C.tip.line : k === 'outro' ? C.outro.line : C.steps[+k.slice(4)].line; }
+function estimate(k) { return lineOf(k).split(/\s+/).length / 2.9 + 0.2; }
+const sec = kind => T.S.find(s => s.kind === kind);
+export const DUR = () => T.dur;
+export function section(t) { return T.S.find(s => t >= s.t0 && t < s.t1) || T.S[T.S.length - 1]; }
+function subs() {
+ return T.V.map(v => {
+ const read = v.text.length / 12 + 1;
+ return { t0: v.t, t1: v.t + Math.max(1.8, v.dur + 0.6, read), text: v.text };
+ });
+}
+export function srtCues() { return subs().map(s => ({ t0: s.t0, t1: s.t1, text: s.text })); }
+export function events() { return EVS; }
+const ev = (t, type, o = {}) => EVS.push({ t: +t.toFixed(4), type, ...o });
+
+// ------------------------------------------------------------------ helpers
+function cam(ctx, cx, cy, z = 1, r = 0) { ctx.translate(W / 2, H / 2); ctx.scale(z, z); ctx.rotate(r); ctx.translate(-cx, -cy); }
+const w2s = (x, y, c) => { const dx = x - c.cx, dy = y - c.cy, co = Math.cos(c.r || 0), si = Math.sin(c.r || 0); return [W / 2 + c.z * (co * dx - si * dy), H / 2 + c.z * (si * dx + co * dy)]; };
+function bg(ctx, col) { ctx.fillStyle = col; ctx.fillRect(-4000, -4000, 9920, 9080); }
+const B = (s, b) => s.t0 + b * BEAT; // absolute time of beat b in section s
+const pop = (t, t0, d = 0.28) => back(seg(t, t0, t0 + d), 1.9);
+function blinkAt(u, ts) { return ts.some(b => u > b && u < b + 0.13) ? 1 : 0; }
+const colsOf = () => ({ product: COL.product, productD: COL.productD });
+
+// 1950s caption card
+function subtitle(ctx, t) {
+ const cue = subs().find(s => t >= s.t0 && t < s.t1); if (!cue) return;
+ const a = Math.min(ss(seg(t, cue.t0, cue.t0 + 0.16)), 1 - ss(seg(t, cue.t1 - 0.16, cue.t1)));
+ const f = fit(ctx, cue.text, '500 {px}px Jost', 42, 1280, 1, 30);
+ const w = measure(ctx, f.lines[0], f.font) + 120, h = 78, x = W / 2 - w / 2, y = H - 60 - h;
+ ctx.save(); ctx.globalAlpha = a; ctx.translate(0, (1 - a) * 10);
+ shape(ctx, rrect(x, y, w, h, 12), { fill: COL.paper, line: 3.2, seed: 901, grain: 0.15, breaks: 0.08, off: [5, 5] });
+ star(ctx, x + 30, y + h / 2, 14, { n: 8, inner: 0.4, fill: COL.accent, off: [0, 0], rot: t * 0.8 });
+ star(ctx, x + w - 30, y + h / 2, 14, { n: 8, inner: 0.4, fill: COL.accent, off: [0, 0], rot: -t * 0.8 });
+ text(ctx, f.lines[0], W / 2, y + h / 2 + f.px * 0.34, { font: f.font, fill: COL.ink, align: 'center' });
+ ctx.restore();
+}
+// step header: ink numeral badge + slab title (slides in on twos)
+function stepHeader(ctx, t, s, label, num) {
+ const k = eo(seg(twos(t), s.t0 + 0.05, s.t0 + 0.4));
+ if (k <= 0) return;
+ ctx.save(); ctx.translate(-(1 - k) * 520, 0);
+ shape(ctx, ellipse(128, 132, 54, 54, 40), { fill: COL.ink, line: 0, seed: 700, grain: 0.1, off: [0, 0] });
+ if (typeof num === 'number') text(ctx, String(num), 128, 154, { font: '62px Slab', fill: COL.paper, align: 'center' });
+ else star(ctx, 128, 132, 40, { n: 12, inner: 0.6, fill: COL.accent, off: [0, 0] }), text(ctx, num, 128, 141, { font: '24px Slab', fill: PAL.white, align: 'center' });
+ const small = typeof num === 'number' ? `STEP ${num} OF ${C.steps.length}` : '';
+ if (small) text(ctx, small, 206, 104, { font: '600 22px Jost', fill: COL.ink, track: 6 });
+ const f = fit(ctx, label, '{px}px Slab', 64, 1100, 1, 40);
+ text(ctx, f.lines[0], 204, small ? 170 : 156, { font: f.font, fill: COL.ink, plate: PAL.white, off: [4, 4] });
+ ctx.restore();
+}
+// detail tag: paper card with an accent star, pops on its beat
+function tag(ctx, t, t0, str, x, y, o = {}) {
+ const k = pop(t, t0); if (k <= 0) return null;
+ const f = fit(ctx, str, '500 {px}px Jost', o.px || 36, o.maxW || 620, 2, 24);
+ const w = Math.max(...f.lines.map(l => measure(ctx, l, f.font))) + 96, h = 30 + f.lines.length * f.px * 1.2;
+ const X = o.align === 'right' ? x - w : o.align === 'center' ? x - w / 2 : x;
+ ctx.save(); ctx.translate(X + w / 2, y + h / 2); ctx.scale(k, k); ctx.translate(-(X + w / 2), -(y + h / 2));
+ shape(ctx, rrect(X, y, w, h, 14), { fill: COL.paper, line: 3.6, seed: 710, grain: 0.15, off: [6, 5] });
+ star(ctx, X + 38, y + h / 2, 17, { n: 8, inner: 0.42, fill: COL.accent, off: [0, 0], rot: t * 0.6 });
+ f.lines.forEach((l, i) => text(ctx, l, X + 66, y + 15 + f.px * 0.92 + i * f.px * 1.2, { font: f.font, fill: COL.ink }));
+ ctx.restore();
+ return { x: X, y, w, h };
+}
+// frame-in-frame detail circle (the manual's magnifier call-out) with a leader line to its subject
+function callout(ctx, t, t0, cx, cy, r, inner, bgc, leader) {
+ const k = back(seg(t, t0, t0 + 0.32), 1.5); if (k <= 0) return;
+ const R = r * k;
+ if (leader) { const a = Math.atan2(leader[1] - cy, leader[0] - cx); dashed(ctx, [[cx + Math.cos(a) * (R + 14), cy + Math.sin(a) * (R + 14)], leader], 4, 14, 10, -t * 40, COL.ink, clamp(k)); shape(ctx, ellipse(leader[0], leader[1], 9, 9, 12), { fill: COL.ink, line: 0, off: [0, 0], grain: 0 }); }
+ shape(ctx, ellipse(cx, cy, R + 16, R + 16, 72), { fill: COL.paper, line: 4.5, seed: 720, grain: 0.15, breaks: 0.05 });
+ ctx.save(); ctx.beginPath(); ctx.arc(cx, cy, R, 0, TAU); ctx.clip();
+ ctx.fillStyle = bgc; ctx.fillRect(cx - R, cy - R, 2 * R, 2 * R);
+ ctx.translate(cx, cy); ctx.scale(k, k); inner(ctx); ctx.restore();
+ ink(ctx, ellipse(cx, cy, R, R, 72), 4, { closed: true, seed: 721, breaks: 0.1 });
+}
+// the step stamp: a numbered medallion that lands on the outgoing scene's subject one beat before the cut
+function medallionAt(ctx, t, tStamp, x, y, i, r = 104) {
+ const k = pop(t, tStamp, 0.24); if (k <= 0) return;
+ ctx.save(); ctx.translate(x, y); ctx.scale(k, k); ctx.rotate((1 - k) * 0.4);
+ star(ctx, 0, 0, r * 1.2, { n: 16, inner: 0.84, fill: PAL.white, off: [0, 0], rot: i * 0.2 });
+ shape(ctx, ellipse(0, 0, r, r, 64), { fill: COL.steps[i % COL.steps.length], line: 5, seed: 730 + i, grain: 0.3 });
+ text(ctx, String(i + 1), 0, r * 0.38, { font: `${Math.round(r * 1.1)}px Slab`, fill: COL.ink, plate: PAL.white, off: [5, 5], align: 'center' });
+ ctx.restore();
+}
+
+// ------------------------------------------------------------------ HOOK: the box opens like stage curtains
+const HOOK = { BX: 1040, FY: 820, BW: 440, BH: 320 };
+function hookCam(u, dur) { return { cx: 1010, cy: 560, z: lerp(1.0, 1.07, ss(u / dur)), r: 0 }; }
+function sceneHook(ctx, t, s) {
+ const u = t - s.t0, { BX, FY, BW, BH } = HOOK;
+ bg(ctx, COL.hook);
+ ctx.save();
+ const c = hookCam(u, s.t1 - s.t0); cam(ctx, c.cx, c.cy, c.z);
+ plane(ctx, rect(-300, FY - 4, W + 600, 700), tint(COL.hook, 0.35), { grain: 0.3 });
+ ink(ctx, [[120, FY - 4], [1820, FY - 6]], 4, { breaks: 0.35, seed: 5, taper: true });
+ const sb = back(seg(u, 3 * BEAT - 0.05, 3 * BEAT + 0.32), 1.6);
+ if (sb > 0) {
+ rays(ctx, BX, FY - 170, 30, 1500 * clamp(sb), tint(COL.hook, 0.35), { rot: u * 0.06, alpha: 0.55 });
+ const r = 330 * sb;
+ shape(ctx, ellipse(BX, FY - 170, r, r, 80), { fill: COL.paper, line: 0, grain: 0.15, off: [0, 0] });
+ ink(ctx, ellipse(BX, FY - 170, r + 22, r + 22, 80), 4, { closed: true, seed: 9, breaks: 0.4 });
+ for (let i = 0; i < 6; i++) {
+ const a = -2.05 + i * 0.44 + Math.sin(u * 1.3 + i) * 0.03, rr = r + 90 + (i % 2) * 50, k = back(seg(u, 3 * BEAT + 0.1 + i * 0.045, 3 * BEAT + 0.35 + i * 0.045));
+ sparkle(ctx, BX + Math.cos(a) * rr, FY - 170 + Math.sin(a) * rr, (26 + (i % 3) * 12) * k, { fill: i % 2 ? COL.accent : PAL.white });
+ }
+ }
+ const bw = 1 - eio(seg(u, 3 * BEAT - 0.18, 3 * BEAT));
+ if (bw > 0.01) shape(ctx, [[BX - BW / 2, FY - BH * bw], [BX + BW / 2, FY - BH * bw], [BX + BW / 2, FY], [BX - BW / 2, FY]], { fill: PAL.kraftD, line: 4, seed: 20, grain: 0.35 });
+ shape(ctx, [[BX - BW / 2 - 6, FY - 26], [BX + BW / 2 + 6, FY - 26], [BX + BW / 2, FY + 6], [BX - BW / 2, FY + 6]], { fill: PAL.kraft, line: 4, seed: 21, grain: 0.35,
+ shade: [{ pts: rect(BX + BW / 2 - 70, FY - 30, 80, 40), color: PAL.kraftD }] });
+ const hop = Math.sin(Math.PI * seg(u, 4 * BEAT - 0.02, 4 * BEAT + 0.34)) * 34;
+ const land = seg(u, 4 * BEAT + 0.34, 4 * BEAT + 0.5);
+ const hello = [10, 10.5].some(k => u >= k * BEAT && u < k * BEAT + 0.12);
+ drawPip(ctx, BX, FY - 26 - hop, { s: 1.42, light: u > 4 * BEAT && !hello ? 1 : 0, brush: twos(u) * 5, colors: colsOf() });
+ if (land > 0 && land < 1) for (let i = 0; i < 2; i++) sparkle(ctx, BX + (i ? 230 : -230), FY - 60, 30 * Math.sin(land * Math.PI), { fill: PAL.white });
+ const fl = Math.sin(u * 9) * Math.exp(-u * 2.5) * 0.12;
+ if (bw > 0.01) {
+ const top = FY - BH * bw;
+ shape(ctx, xform([[0, 0], [-BW / 2, 0], [-BW / 2 - 40, -110], [-20, -130]], BX - 2, top, -0.25 + fl), { fill: PAL.kraftL, line: 3.5, seed: 22, grain: 0.3 });
+ shape(ctx, xform([[0, 0], [BW / 2, 0], [BW / 2 + 40, -110], [20, -130]], BX + 2, top, 0.25 - fl), { fill: PAL.kraftL, line: 3.5, seed: 23, grain: 0.3 });
+ }
+ const door = (side, th) => {
+ const xh = BX + side * BW / 2, w = BW / 2, co = Math.cos(th), sn = Math.sin(th);
+ const xe = xh - side * w * co, dh = BH * 0.08 * sn, outer = co > 0;
+ const pts = [[xh, FY - BH], [xe, FY - BH - dh], [xe, FY + dh * 0.6], [xh, FY]];
+ shape(ctx, pts, { fill: outer ? PAL.kraft : PAL.kraftL, line: 4, seed: 30 + side, grain: 0.35 });
+ if (outer && co > 0.15) {
+ ctx.save(); ctx.beginPath(); pts.forEach(([x, y], i) => i ? ctx.lineTo(x, y) : ctx.moveTo(x, y)); ctx.closePath(); ctx.clip();
+ ctx.translate(xh, 0); ctx.scale(co, 1); ctx.translate(-xh, 0);
+ shape(ctx, ellipse(BX, FY - BH / 2, 120, 120, 48), { fill: COL.accent, line: 4, seed: 33, grain: 0.3 });
+ text(ctx, (C.product || '').toUpperCase(), BX, FY - BH / 2 + 30, { font: '96px Slab', fill: PAL.white, align: 'center', maxW: 220 });
+ ctx.restore();
+ } else if (!outer) {
+ for (let k = 1; k < 5; k++) { const xx = lerp(xh, xe, k / 5); ink(ctx, [[xx, FY - BH + 26 - dh * k / 5], [xx, FY - 20 + dh * 0.6 * k / 5]], 2.2, { seed: 34 + side * 7 + k, color: PAL.kraftD, breaks: 0.3 }); }
+ }
+ };
+ door(-1, lerp(0.42, Math.PI * 0.8, back(seg(u, 0, BEAT), 1.3)));
+ door(1, lerp(0.2, Math.PI * 0.8, back(seg(u, BEAT * 0.4, 2 * BEAT), 1.3)));
+ // June: reaching (anticipation) -> one in-between -> ta-da on the downbeat of bar 2 -> arms settle (follow-through)
+ const tu = twos(u);
+ const wig = Math.floor(tu * 6) % 2 ? 0.08 : -0.04;
+ const pose = tu >= 4 * BEAT + 1.3 ? { armB: { a1: 1.95, a2: 1.72 }, armF: { a1: -0.35, a2: -0.15 + (tu > 6 * BEAT && tu < 9 * BEAT ? wig : 0) }, face: tu > 12 * BEAT ? 'neutral' : 'happy', handB: 'open', handF: 'open' }
+ : tu >= 4 * BEAT - 1 / 12 ? { armB: { a1: -2.25, a2: -2.05 }, armF: { a1: -0.9, a2: -1.1 }, face: 'happy', handB: 'open', handF: 'open' }
+ : tu >= 4 * BEAT - 3 / 12 ? { armB: { a1: 2.95, a2: -2.7 }, armF: { a1: 0.05, a2: -0.45 }, face: 'wow', handB: 'open', handF: 'open' }
+ : { armB: { a1: 2.5, a2: 2.9 }, armF: { a1: 2.2, a2: 2.75 }, face: 'wow', handB: 'open', handF: 'open' };
+ drawOwner(ctx, { x: 1560, y: FY + 4, s: 1.04, dir: -1, view: 'q', blink: blinkAt(u, [3.3, 5.9]), ...pose }, u);
+ ctx.restore();
+ // lettering: layer 1 = product name, layer 2 = title
+ const k1 = seg(u, 4 * BEAT, 4 * BEAT + 0.55);
+ if (k1 > 0) { ctx.save(); ctx.beginPath(); ctx.rect(0, 0, 130 + 760 * eo(k1), H); ctx.clip();
+ text(ctx, C.hook.kicker, 130, 300, { font: '700 176px Oleo', fill: COL.ink, plate: PAL.white, off: [7, 7], rot: -0.06, maxW: 760 }); ctx.restore(); }
+ const k2 = back(seg(u, 6 * BEAT, 6 * BEAT + 0.3)), k3 = back(seg(u, 8 * BEAT, 8 * BEAT + 0.3));
+ if (k2 > 0) {
+ const f = fit(ctx, C.title, '{px}px Slab', 66, 720, 2, 44);
+ ctx.save(); ctx.translate(140, 400); ctx.scale(k2, k2);
+ f.lines.forEach((l, i) => text(ctx, l, 0, i * f.px * 1.1, { font: f.font, fill: COL.ink, plate: COL.accent, off: [5, 4] }));
+ ctx.restore();
+ if (k3 > 0) {
+ const y = 400 + f.lines.length * f.px * 1.1 + 12, st = C.subtitle.toUpperCase();
+ ctx.save(); ctx.globalAlpha = clamp(k3); ctx.translate(140, y);
+ shape(ctx, rrect(0, -40, measure(ctx, st, '600 32px Jost', 7) + 46, 58, 29), { fill: COL.ink, line: 0, grain: 0.1, off: [0, 0] });
+ text(ctx, st, 23, 1, { font: '600 32px Jost', fill: COL.paper, track: 7 });
+ ctx.restore();
+ }
+ }
+ const fp = w2s(BX, FY - 26 - 56 * 1.42 - 20, c);
+ medallionAt(ctx, t, B(s, s.bars * 4 - 1), fp[0], fp[1], 0);
+ return { focus: fp };
+}
+
+// ------------------------------------------------------------------ STEPS
+// A step = a wide shot (June doing it) + a frame-in-frame detail circle where the hands do the real action on the beat.
+// Each action returns the screen point where the next step's medallion will land.
+function sceneStep(ctx, t, s) {
+ const st = C.steps[s.i], col = COL.steps[s.i % COL.steps.length];
+ const act = { place: actPlace, tap: actTap, press: actPress }[st.action] || actShow;
+ const r = act(ctx, t, s, st, col);
+ stepHeader(ctx, t, s, st.title, s.i + 1);
+ return r;
+}
+function floor(ctx, col, y, x0 = -2000, x1 = 4000) {
+ plane(ctx, rect(x0, y, x1 - x0, 2000), shade(col, 0.16), { grain: 0.3 });
+ ink(ctx, [[x0 + 2100, y], [x1 - 2100, y + 2]], 4, { breaks: 0.3, seed: 801 });
+}
+// -- step action: place (push the thing against a wall, then show the clearance)
+function actPlace(ctx, t, s, st, col) {
+ const u = t - s.t0, b = x => B(s, x);
+ bg(ctx, col);
+ const FY = 820, WX = 1345;
+ // push: anticipation (pull back) b1.5-b2.5, push lands b3.5, follow-through recoil
+ const pullK = ss(seg(t, b(1.6), b(2.4))), pushK = eo(seg(t, b(2.9), b(3.5))), rec = Math.sin(Math.PI * seg(t, b(3.5), b(3.9))) * 8;
+ const dockX = 1180 - pullK * 24 + pushK * (WX - 64 - 1180 + 24) - rec;
+ const c = { cx: lerp(960, 1120, ss(seg(t, s.t0, b(4)))), cy: 600, z: lerp(1.0, 1.1, ss(seg(t, s.t0, s.t1))) };
+ ctx.save(); cam(ctx, c.cx, c.cy, c.z);
+ floor(ctx, col, FY);
+ // the wall: a lighter slab with a baseboard and an outlet
+ plane(ctx, rect(WX, -1000, 2000, FY + 1000), tint(col, 0.45), { grain: 0.25 });
+ ink(ctx, [[WX, -400], [WX, FY]], 5, { seed: 802 });
+ shape(ctx, rect(WX, FY - 30, 2000, 30), { fill: COL.paper, line: 3.5, seed: 803, grain: 0.2 });
+ const OX = WX + 90, OY = 660;
+ shape(ctx, rrect(OX - 30, OY - 44, 60, 88, 10), { fill: COL.paper, line: 3.5, seed: 804 });
+ [[-9, -14], [9, -14], [-9, 14], [9, 14]].forEach(([dx, dy], i) => shape(ctx, rrect(OX + dx - 3, OY + dy - 8, 6, 16, 2), { fill: COL.ink, line: 0, off: [0, 0], grain: 0 }));
+ // cord: dock -> outlet once plugged (b5)
+ const plugged = t >= b(5);
+ const cordEnd = plugged ? [OX, OY + 14] : [dockX + 120, FY - 10];
+ ink(ctx, spline([[dockX + 50, FY - 20], [dockX + 100, FY - 4], [lerp(dockX + 110, OX - 30, 0.6), FY - 30], cordEnd], false, 8), 5, { seed: 805, taper: false });
+ drawDock(ctx, dockX, FY, 0.9, 0, { light: plugged, face: COL.product });
+ // June kneeling behind the dock; hands flat on its back, arms follow the dock
+ const lift = ss(seg(t, b(4.4), b(5))) * 70;
+ const reach = dockX - 58 - lift * 0.3, hy = FY - 92 - lift;
+ const pose = kneelPose(1040, FY, 1.0, [reach, hy], [reach - 18, hy + 22], u, t >= b(3.5) && t < b(4.4) ? 'focus' : t >= b(4.4) ? 'happy' : 'neutral');
+ drawOwner(ctx, pose, u);
+ ctx.restore();
+ // detail circle: close-up of the hands pushing (b2) -> flips to the front clearance diagram (b5)
+ const CX = 1440, CY = 330, R = 250;
+ const flip = seg(t, b(5), b(5.4)), sq = Math.abs(Math.cos(flip * Math.PI));
+ callout(ctx, t, b(2), CX, CY, R, g => {
+ g.save(); g.scale(Math.max(0.02, sq), 1);
+ if (flip < 0.5) closePush(g, t, b, col, dockX); else clearance(g, t, b, col, st);
+ g.restore();
+ }, tint(col, 0.55), w2s(dockX, FY - 90, c));
+ tag(ctx, t, b(4.5), st.detail, CX, CY + R - 20, { align: 'center', maxW: 520 });
+ medallionAt(ctx, t, b(11), CX, CY, s.i + 1);
+ return { focus: [CX, CY] };
+}
+function kneelPose(x, fy, s, handF, handB, u, face) {
+ // arms solved (2-bone IK) so the flat hands sit on the given world points
+ const pose = { x, y: fy, s, dir: 1, view: 'q', kneel: true, face, blink: blinkAt(u, [0.9, 3.6]), handF: 'flat', handB: 'flat' };
+ const ik = (which, target) => {
+ const sh = armJoints({ ...pose, armF: { a1: 0, a2: 0 }, armB: { a1: 0, a2: 0 } }, which).sh;
+ const sx = x + sh[0] * s, sy = fy + (sh[1] + 150) * s;
+ const dx = (target[0] - sx) / s, dy = (target[1] - sy) / s, d = Math.min(Math.hypot(dx, dy), 190), base = Math.atan2(dy, dx);
+ const a = Math.acos(clamp((100 * 100 + d * d - 92 * 92) / (2 * 100 * d), -1, 1));
+ const a1 = base - a, el = [Math.cos(a1) * 100, Math.sin(a1) * 100];
+ const a2 = Math.atan2(dy * d / Math.hypot(dx, dy) - el[1], dx * d / Math.hypot(dx, dy) - el[0]);
+ return { a1, a2 };
+ };
+ pose.armF = ik('F', handF); pose.armB = ik('B', handB);
+ return pose;
+}
+function closePush(g, t, b, col, dockX) {
+ // big hands flat on the dock, pushing it to the wall line
+ const push = eo(seg(t, b(2.9), b(3.5))), pull = ss(seg(t, b(1.6), b(2.4))), rec = Math.sin(Math.PI * seg(t, b(3.5), b(3.9))) * 10;
+ const x = -120 - pull * 30 + push * 150 - rec, lift = ss(seg(t, b(4.2), b(4.7))) * 40;
+ plane(g, rect(-400, 90, 800, 400), shade(col, 0.16), { grain: 0.3 });
+ plane(g, rect(150, -400, 400, 490), tint(col, 0.25), { grain: 0.25 });
+ ink(g, [[150, -400], [150, 90]], 5, { seed: 811 }); ink(g, [[-400, 90], [400, 90]], 4, { seed: 812 });
+ drawDock(g, x, 90, 1.7, 0, { face: COL.product, light: t >= b(5) });
+ drawHand(g, x - 150, 0 - lift, 0.1, 'flat', 1, 2.3);
+ drawHand(g, x - 160, 50 - lift, 0.05, 'flat', 1, 2.3);
+ if (t > b(3.45) && t < b(3.9)) { const k = seg(t, b(3.45), b(3.9)); for (let i = 0; i < 3; i++) ink(g, [[160 + 14, -60 + i * 50], [160 + 14 + 30 * k + 10, -70 + i * 50 - 10 * k]], 4, { seed: 813 + i }); }
+}
+function clearance(g, t, b, col, st) {
+ // front view: dock against the wall, two dimension arrows grow out on the beat
+ plane(g, rect(-400, 100, 800, 400), shade(col, 0.16), { grain: 0.3 });
+ plane(g, rect(-400, -400, 800, 500), tint(col, 0.35), { grain: 0.2 });
+ ink(g, [[-400, 100], [400, 100]], 4, { seed: 821 });
+ drawDock(g, 0, 100, 0.95, 0, { face: COL.product, light: true });
+ const m = st.measure || '';
+ [[-1, b(5.5)], [1, b(6)]].forEach(([sd, tt], i) => {
+ const k = eo(seg(t, tt, tt + 0.3)); if (k <= 0) return;
+ const x0 = sd * 70, x1 = sd * (70 + 110 * k);
+ ink(g, [[x0, -150], [x0, -20]], 3, { seed: 822 + i, taper: false });
+ if (k > 0.95) ink(g, [[sd * 180, -150], [sd * 180, -20]], 3, { seed: 824 + i, taper: false });
+ arrow(g, [x0 + sd * 6, -100], [x1, -100], { u: 1, bend: 0, w: 5, head: 26, fill: COL.accent, bob: 0, seed: 826 + i });
+ if (m && k > 0.6) text(g, m, sd * 125, -122, { font: '600 34px Jost', fill: COL.ink, align: 'center', alpha: seg(k, 0.6, 1) });
+ });
+}
+// -- step action: tap (phone pairing)
+function actTap(ctx, t, s, st, col) {
+ const u = t - s.t0, b = x => B(s, x);
+ bg(ctx, col);
+ const FY = 900;
+ const c = { cx: lerp(820, 900, ss(seg(t, s.t0, b(6)))) + ss(seg(t, b(6), b(9))) * 120, cy: 560, z: lerp(1.0, 1.12, ss(seg(t, s.t0, b(5)))) };
+ ctx.save(); cam(ctx, c.cx, c.cy, c.z);
+ floor(ctx, col, FY);
+ // June holding the phone at chest height; free hand does the tapping gesture in sync with the close-up
+ const tapPh = t >= b(3.6) && t < b(4) || t >= b(4.6) && t < b(5) ? 1 : 0;
+ const pose = { x: 600, y: FY, s: 1.18, dir: 1, view: 'q', face: t < b(8) ? 'focus' : 'happy', look: [6, 8], blink: blinkAt(u, [1.2]),
+ armF: { a1: 1.05, a2: -0.72 }, armB: { a1: 0.95, a2: -0.2 - tapPh * 0.25 }, handF: 'grip', handB: 'point', prop: { kind: 'phone', hand: 'F', behind: false, rot: -0.12 } };
+ drawOwner(ctx, pose, u);
+ const J = armJoints(pose, 'F'), ph = [600 + (J.ha[0] + 16) * 1.18, FY + (J.ha[1] - 30) * 1.18];
+ // Pip across the room; wifi rings travel phone -> Pip on b6/b7/b8, Pip blinks as each arrives
+ const PX = 1420, PY = FY + 6;
+ const arrive = [6, 7, 8].map(k => b(k));
+ const lit = arrive.some(a => t >= a + 0.3 && t < a + 0.3 + 0.18) || t >= b(8) + 0.5;
+ drawPip(ctx, PX, PY, { s: 0.95, light: lit ? 1 : 0, colors: colsOf() });
+ arrive.forEach((a, i) => {
+ const k = seg(t, a, a + 0.42); if (k <= 0 || k >= 1) return;
+ const cx = lerp(ph[0], PX, k), cy = lerp(ph[1], PY - 80, k) - Math.sin(k * Math.PI) * 80;
+ const sc = 1 + k * 0.6;
+ for (let j = 0; j < 3; j++) { const rr = (34 + j * 30) * sc; ink(ctx, move(ellipse(cx - 60, cy, rr, rr, 22, -0.75, 0.75), 4, 3), 13, { seed: 840 + j, color: COL.accent, taper: false }); ink(ctx, ellipse(cx - 60, cy, rr, rr, 22, -0.75, 0.75), 4, { seed: 845 + j, color: COL.ink, taper: false }); }
+ });
+ ctx.restore();
+ // detail circle: the phone screen, big, with the index finger tapping twice
+ const CX = 1340, CY = 330, R = 250;
+ callout(ctx, t, b(2), CX, CY, R, g => phoneClose(g, t, b, st), tint(col, 0.5), w2s(ph[0], ph[1], c));
+ tag(ctx, t, b(5), st.detail, CX, CY + R - 20, { align: 'center', maxW: 520 });
+ const pipS = w2s(PX, PY - 80, c);
+ medallionAt(ctx, t, b(11), pipS[0], pipS[1], s.i + 1);
+ return { focus: pipS };
+}
+function phoneClose(g, t, b, st) {
+ // phone body
+ shape(g, rrect(-120, -210, 240, 440, 30), { fill: COL.ink, line: 0, seed: 850, grain: 0.1, off: [0, 0] });
+ shape(g, rrect(-100, -180, 200, 360, 12), { fill: COL.paper, line: 0, seed: 851, grain: 0.1, off: [0, 0] });
+ const page2 = t >= b(4.05), done = t >= b(8);
+ text(g, (C.product || '').toUpperCase(), 0, -140, { font: '30px Slab', fill: COL.ink, align: 'center' });
+ if (!page2) {
+ const k = t >= b(3.95) && t < b(4.25) ? 0.9 : 1;
+ shape(g, ellipse(0, -10, 70 * k, 70 * k, 40), { fill: COL.accent, line: 4, seed: 852 });
+ text(g, '+', 0, 12, { font: '80px Slab', fill: PAL.white, align: 'center' });
+ } else {
+ // wifi list; second tap selects the home network (the detail)
+ const sel = t >= b(4.95);
+ ['Home', 'Guest'].forEach((n, i) => {
+ const y = -80 + i * 70, on = sel && i === 0;
+ shape(g, rrect(-86, y, 172, 54, 10), { fill: on ? COL.product : PAL.white, line: 3, seed: 853 + i, grain: 0.1 });
+ for (let j = 0; j < 3; j++) ink(g, ellipse(-58, y + 38, 6 + j * 7, 6 + j * 7, 10, -2.4, -0.74), 3, { seed: 860 + j, color: on ? PAL.white : COL.ink, taper: false });
+ text(g, n, -30, y + 36, { font: '500 26px Jost', fill: on ? PAL.white : COL.ink });
+ });
+ if (done) { const k = pop(t, b(8)); g.save(); g.translate(0, 110); g.scale(k, k); icon(g, 'check', 0, 0, 90, { main: COL.product }); g.restore(); }
+ }
+ // the finger: anticipation lift, tap, follow-through
+ const tapAt = [b(4), b(5)], target = [[0, -10], [0, -53]];
+ let fx = 150, fy = 150, press = 0;
+ const cur = t < b(4.5) ? 0 : 1, tt = tapAt[cur];
+ const pre = ss(seg(t, tt - 0.45, tt - 0.12)), down = seg(t, tt - 0.12, tt), up = ss(seg(t, tt + 0.05, tt + 0.35));
+ const tg = target[cur];
+ fx = lerp(150, tg[0] + 20, pre); fy = lerp(150, tg[1] + 70, pre) - pre * 20 + down * 20 * (1 - up) + up * 60;
+ if (t > b(8.5)) { fx = 180; fy = 200; }
+ drawHand(g, fx + 40, fy + 40, -2.25, 'point', 1, 2.4);
+ if (t >= tt && t < tt + 0.3) { const k = seg(t, tt, tt + 0.3); ink(g, ellipse(tg[0], tg[1], 20 + k * 60, 20 + k * 60, 30), 4, { closed: true, color: COL.accent, alpha: 1 - k, seed: 870 }); }
+}
+// -- step action: press (the start button, hold for a beat-length second)
+function actPress(ctx, t, s, st, col) {
+ const u = t - s.t0, b = x => B(s, x);
+ bg(ctx, col);
+ const c = { cx: 960, cy: lerp(480, 545, ss(seg(t, s.t0, b(2.5)))), z: 1 };
+ ctx.save(); cam(ctx, c.cx, c.cy, c.z);
+ // a flat radial floor + rays for the close-up
+ rays(ctx, 960, 760, 28, 1400, tint(col, 0.25), { rot: u * 0.05, alpha: 0.6 });
+ const PX = 960, PY = 808, S = 2.3;
+ const hover = Math.sin(u * 5) * 6;
+ const tPress = b(5), pre = ss(seg(t, b(3.8), b(4.6))), down = eio(seg(t, b(4.75), tPress)), rel = ss(seg(t, B(s, 8) - 0.02, B(s, 8) + 0.18));
+ const pressed = t >= tPress && t < B(s, 8) + 0.05;
+ const btn = [PX - 6 * S, PY - (56 + 4) * S];
+ drawPip(ctx, PX, PY, { s: S, light: t >= B(s, 8) ? 1 : 0, press: pressed ? 1 : 0, colors: colsOf() });
+ // hold ring: fills over two beats while held
+ const hk = seg(t, tPress, tPress + 2 * BEAT);
+ if (hk > 0) {
+ ink(ctx, ellipse(btn[0], btn[1], 120, 50, 60), 6, { closed: true, color: shade(COL.productD, 0.2), alpha: 0.35, seed: 880, taper: false });
+ ink(ctx, ellipse(btn[0], btn[1], 120, 50, 60, -Math.PI / 2, -Math.PI / 2 + TAU * hk), 12, { color: COL.accent, taper: false, seed: 881 });
+ }
+ // finger from above: enters b1, hovers, anticipation lift, press, holds, lifts after the click
+ const enter = eo(seg(t, b(1), b(2)));
+ // wrist height: enters from upper right, hovers, lifts (anticipation), presses, holds, rebounds on release
+ const fy = lerp(180, btn[1] - 140, enter) + (t < b(3.8) ? hover : 0) - pre * 50 + down * 90 * (1 - rel) + rel * -70;
+ const relB = Math.sin(Math.PI * seg(t, B(s, 8) + 0.05, B(s, 8) + 0.4)) * Math.exp(-3 * seg(t, B(s, 8) + 0.05, B(s, 8) + 0.4));
+ // wrist cocks back before the press (hand tilts up), snaps down on the press, springs back after release
+ const wristA = Math.PI / 2 + 0.28 - pre * 0.45 + down * 0.45 * (1 - rel) - relB * 0.35;
+ const Wr = [btn[0] + 12 + (1 - enter) * 420, fy - 60];
+ const fa = -0.68 + pre * 0.08, el = [Wr[0] + Math.cos(fa) * 290, Wr[1] + Math.sin(fa) * 290];
+ const ua = -0.1, sh = [el[0] + Math.cos(ua) * 1100, el[1] + Math.sin(ua) * 1100];
+ const armP = spline([sh, [(sh[0] + el[0]) / 2, (sh[1] + el[1]) / 2], el, [(el[0] + Wr[0]) / 2, (el[1] + Wr[1]) / 2], Wr], false, 8);
+ ink(ctx, armP, 72, { seed: 882, taper: false, wob: 0.04 });
+ ink(ctx, move(armP, 5, 4), 56, { seed: 883, taper: false, color: PAL.coral, wob: 0.03 });
+ // elbow crease + cuff at the wrist
+ ink(ctx, [[el[0] - 16, el[1] + 18], [el[0] + 10, el[1] + 4]], 4, { seed: 885, color: PAL.coralD });
+ const cd = [Math.cos(fa), Math.sin(fa)], cn = [-cd[1], cd[0]], cc = [Wr[0] + cd[0] * 26, Wr[1] + cd[1] * 26];
+ ink(ctx, [[cc[0] + cn[0] * 30, cc[1] + cn[1] * 30], [cc[0] - cn[0] * 30, cc[1] - cn[1] * 30]], 5, { seed: 884, color: PAL.coralD, taper: false });
+ drawHand(ctx, Wr[0], Wr[1], wristA, 'point', 1, 2.6);
+ ctx.restore();
+ const tg = tag(ctx, t, b(2), st.detail, 80, 240, { maxW: 520 });
+ if (tg) { const k = clamp(seg(t, b(2), b(2.3))); ctx.save(); ctx.globalAlpha = k; icon(ctx, 'clock', tg.x + tg.w + 60, tg.y + tg.h / 2, 90, { main: COL.accent }); ctx.restore(); }
+ return { focus: w2s(btn[0], btn[1], c), btn: w2s(btn[0], btn[1], c) };
+}
+// -- fallback for any other action: show the icon big, a hand points and taps it on the beat
+function actShow(ctx, t, s, st, col) {
+ const u = t - s.t0, b = x => B(s, x);
+ bg(ctx, col);
+ const FY = 860, c = { cx: lerp(880, 980, ss(seg(t, s.t0, s.t1))), cy: 560, z: 1.05 };
+ ctx.save(); cam(ctx, c.cx, c.cy, c.z);
+ floor(ctx, col, FY);
+ const pose = { x: 620, y: FY, s: 1.15, dir: 1, view: 'q', face: t >= b(4) ? 'happy' : 'focus', armF: { a1: 0.5, a2: -0.3 }, handF: 'open', blink: blinkAt(u, [1.4]) };
+ drawOwner(ctx, pose, u);
+ const J = armJoints(pose, 'F'), hp = [620 + J.ha[0] * 1.15, FY + J.ha[1] * 1.15];
+ icon(ctx, st.icon, hp[0] + 70, hp[1] - 50, 150, { main: COL.product, dark: COL.productD });
+ ctx.restore();
+ const CX = 1400, CY = 340, R = 240;
+ callout(ctx, t, b(2), CX, CY, R, g => {
+ const k = 1 + Math.max(0, Math.sin(Math.PI * seg(t, b(4), b(4.4)))) * 0.08;
+ g.save(); g.scale(k, k); icon(g, st.icon, 0, 0, 300, { main: COL.product, dark: COL.productD }); g.restore();
+ const pre = ss(seg(t, b(3.2), b(3.8))), down = seg(t, b(3.85), b(4)), up = ss(seg(t, b(4.1), b(4.5)));
+ drawHand(g, 170 - pre * 60 + up * 40, 150 - pre * 40 + down * 20 + up * 40, -2.3, 'point', 1, 2.4);
+ }, tint(col, 0.5), w2s(hp[0] + 70, hp[1] - 50, c));
+ tag(ctx, t, b(4), st.detail, CX, CY + R - 20, { align: 'center', maxW: 520 });
+ medallionAt(ctx, t, b(s.bars * 4 - 1), CX, CY, s.i + 1);
+ return { focus: [CX, CY] };
+}
+
+// ------------------------------------------------------------------ PAYOFF: a real cleaning route that reads as an atomic-age print
+let PATH = null;
+function planOf() { return C.payoff.plan; }
+function obstacles() {
+ const P = planOf(), out = [];
+ for (const it of P.items) {
+ const m = 30;
+ if (it.shape === 'sofa' || it.shape === 'kidney') out.push({ cx: it.x, cy: it.y, rx: it.s * 1.05 + m, ry: it.s * 0.52 + m });
+ else if (it.shape === 'boomerang') out.push({ cx: it.x, cy: it.y, rx: it.s * 1.02 + m, ry: it.s * 0.55 + m });
+ else if (it.shape === 'chair') out.push({ cx: it.x, cy: it.y, rx: 70 * it.s + m, ry: 66 * it.s + m });
+ else if (it.shape === 'bed') out.push({ cx: it.x, cy: it.y, rx: it.s + m, ry: it.s * 0.6 + m });
+ else if (it.shape === 'plant') out.push({ cx: it.x, cy: it.y, rx: it.s + m, ry: it.s + m });
+ else if (it.shape === 'table') out.push({ cx: it.x, cy: it.y, rx: it.s * 1.72 + m, ry: it.s * 1.72 + m });
+ else out.push({ cx: it.x, cy: it.y, rx: (it.s || 60) + m, ry: (it.s || 60) + m });
+ }
+ return out;
+}
+// potential-flow streamline: a horizontal lane at y0 bends around each obstacle ellipse and never enters it
+function laneY(x, y0, obs) {
+ let y = y0;
+ for (const o of obs) {
+ const X = (x - o.cx) / o.rx, Y0 = (y0 - o.cy) / o.ry;
+ if (Math.abs(X) > 5 || Math.abs(Y0) > 3) continue;
+ const sg = Y0 >= 0 ? 1 : -1, a = Math.abs(Y0);
+ const f = Y => Y - Y / (X * X + Y * Y) - a;
+ let lo = Math.sqrt(Math.max(0, 1 - X * X)) + 1e-4, hi = a + 2;
+ if (f(lo) > 0) lo = 1e-4;
+ for (let i = 0; i < 40; i++) { const m = (lo + hi) / 2; if (f(m) > 0) hi = m; else lo = m; }
+ y += (sg * (lo + hi) / 2 - Y0) * o.ry;
+ }
+ return y;
+}
+function buildPath() {
+ if (PATH) return PATH;
+ const P = planOf(), obs = obstacles(), pts = [], marks = {}, decor = [];
+ const Z = P.zones, y0 = P.y0, y1 = P.y1, ins = 34, door = (P.y0 + P.y1) / 2;
+ const push = (p) => pts.push(p);
+ const lineTo = (x, y, n = 12) => { const a = pts[pts.length - 1]; for (let i = 1; i <= n; i++) push([lerp(a[0], x, i / n), lerp(a[1], y, i / n)]); };
+ const cum = () => plen(pts);
+ const loopAt = (cx, cy, r, dir) => { for (let j = 1; j <= 22; j++) { const a = Math.PI + dir * j / 22 * TAU; push([cx + r + Math.cos(a) * r, cy + Math.sin(a) * r * 1.0]); } };
+ push([P.dock[0], P.dock[1] - 44]);
+ Z.forEach((z, zi) => {
+ const L = z.x0 + ins, R = z.x1 - ins, Tp = y0 + ins, Bt = y1 - ins;
+ // enter the zone
+ if (zi === 0) lineTo(P.dock[0], Bt, 6); else lineTo(L, door, 10);
+ // 1. wall-follow: one loop round the zone (rounded corners)
+ const start = pts[pts.length - 1].slice();
+ const perim = zi === 0 ? [[L, Bt], [L, Tp], [R, Tp], [R, Bt], [start[0] + 30, Bt]] : [[L, Bt], [R, Bt], [R, Tp], [L, Tp], [L, door - 30]];
+ perim.forEach(([x, y]) => lineTo(x, y, Math.ceil(Math.hypot(x - pts[pts.length - 1][0], y - pts[pts.length - 1][1]) / 10)));
+ marks['perim' + zi] = cum();
+ // 2. lanes: boustrophedon, bottom -> top, bending round furniture; every turn is a small loop (the print's motif)
+ const narrow = z.x1 - z.x0 < 400, S = 82, n = narrow ? 0 : Math.max(3, Math.floor((Bt - Tp - 60) / S) | 1);
+ const gap = (Bt - Tp - 60) / (n - 1);
+ let first = true;
+ if (narrow) { // a hall: two straight lanes up and down, a curl at the top turn
+ const xa = L + (R - L) * 0.33, xb = L + (R - L) * 0.67, i0 = pts.length;
+ lineTo(xa, door, 8); lineTo(xa, Tp + 44, 40);
+ const cy = Tp + 44, r = (xb - xa) / 2;
+ for (let j = 1; j <= 10; j++) { const a = Math.PI + j / 10 * Math.PI; push([xa + r + Math.cos(a) * r, cy + Math.sin(a) * r * 0.9]); }
+ const ap = pts[pts.length - 1]; for (let j = 1; j <= 20; j++) { const ph = j / 20 * TAU; push([ap[0] - 11 + 11 * Math.cos(ph), ap[1] + 11 * Math.sin(ph)]); }
+ lineTo(xb, Bt - 44, 50);
+ for (let y = Tp + 110; y < Bt - 60; y += 120) decor.push({ x: (xa + xb) / 2, y, kind: (y / 120 | 0) % 2 ? 'star' : 'dot', idx: i0 + 8 + Math.round((y - Tp) / (Bt - Tp) * 40) });
+ }
+ for (let k = 0; k < n; k++) {
+ const yk = Bt - 30 - k * gap, dir = k % 2 ? -1 : 1, xa = dir > 0 ? L + 40 : R - 40, xb = dir > 0 ? R - 40 : L + 40;
+ const N = Math.ceil(Math.abs(xb - xa) / 8), lane = [];
+ for (let i = 0; i <= N; i++) { const x = lerp(xa, xb, i / N); lane.push([x, clamp(laneY(x, yk, obs), Tp + 14, Bt - 14)]); }
+ if (first) { if (zi > 0) lineTo(L, lane[0][1], 20); lineTo(lane[0][0], lane[0][1], 8); first = false; }
+ const l0 = pts.length;
+ lane.forEach(p => push(p));
+ // decor sits in the gap above this lane (stars + dots), revealed when the lane is drawn
+ if (k < n - 1) for (let x = L + 70 + (k % 2) * 64; x < R - 50; x += 128) {
+ const yy = laneY(x, yk - gap / 2, obs);
+ if (obs.some(o => ((x - o.cx) / o.rx) ** 2 + ((yy - o.cy) / o.ry) ** 2 < 1.25)) continue;
+ decor.push({ x, y: yy, kind: ((x / 128 | 0) + k) % 2 ? 'star' : 'dot', idx: l0 + Math.round((dir > 0 ? (x - xa) : (xa - x)) / 8) });
+ }
+ if (k < n - 1) { // U-turn: rounded corners outward, a small curl halfway up (the print's motif)
+ const [ex, ey] = pts[pts.length - 1], ny = clamp(laneY(ex, yk - gap, obs), Tp + 14, Bt - 14), r = Math.min((ey - ny) / 2, 34), ox = ex + dir * r, my = (ey + ny) / 2;
+ for (let j = 1; j <= 8; j++) { const th = j / 8 * Math.PI / 2; push([ex + dir * r * Math.sin(th), ey - r + r * Math.cos(th)]); }
+ lineTo(ox, my, 4);
+ for (let j = 1; j <= 20; j++) { const ph = j / 20 * TAU; push([ox + dir * 12 - dir * 12 * Math.cos(ph), my - 12 * Math.sin(ph)]); }
+ lineTo(ox, ny + r, 4);
+ for (let j = 1; j <= 8; j++) { const th = j / 8 * Math.PI / 2; push([ex + dir * r * Math.cos(th), ny + r - r * Math.sin(th)]); }
+ }
+ }
+ marks['zone' + zi] = cum();
+ // leave for the next zone through the door
+ if (zi < Z.length - 1) { const e = pts[pts.length - 1]; lineTo(R, e[1], 6); lineTo(R + 10, door, 12); lineTo(z.x1 + ins, door, 8); }
+ });
+ const homeFrom = pts.length - 1;
+ // 3. home: straight back to the dock through the doors (drawn as a dotted return line)
+ { const zl = Z[Z.length - 1], e = pts[pts.length - 1]; lineTo(e[0], y0 + ins, 6); lineTo(zl.x0 + ins, y0 + ins, 30); lineTo(zl.x0 + ins, door, 20); }
+ lineTo(Z[Z.length - 1].x0 + 30, door, 20);
+ lineTo(Z[0].x1 - 50, door, 20);
+ lineTo(Z[0].x1 - 50, y1 - 62, 30);
+ lineTo(P.dock[0], y1 - 62, 50);
+ lineTo(P.dock[0], P.dock[1] - 44, 10);
+ const tot = cum(), cumArr = [0]; for (let i = 1; i < pts.length; i++) cumArr.push(cumArr[i - 1] + Math.hypot(pts[i][0] - pts[i - 1][0], pts[i][1] - pts[i - 1][1]));
+ decor.forEach(d => d.u = cumArr[Math.min(d.idx, cumArr.length - 1)] / tot);
+ const M = {}; for (const k in marks) M[k] = marks[k] / tot;
+ M.homeStart = cumArr[homeFrom] / tot;
+ PATH = { pts, tot, M, decor, homeFrom };
+ return PATH;
+}
+// progress along the path: zone by zone, each landing on its beat
+function planProgress(t, s) {
+ const P = buildPath(), M = P.M, nz = planOf().zones.length, b = x => B(s, x);
+ const keys = [[s.t0 + 0.1, 0], [b(3.6), M.perim0]];
+ const zoneBeats = [4, 6, 8, 9.5].slice(0, nz);
+ for (let z = 0; z < nz; z++) {
+ const st = b(zoneBeats[z]), en = st + (z === 0 ? 0.75 : 0.6);
+ if (z > 0) keys.push([st, M['perim' + z] - (M['perim' + z] - M['zone' + (z - 1)]) * 1.0]);
+ keys.push([en, M['zone' + z]]);
+ }
+ keys.push([b(10.3), M.homeStart], [b(11), 1]);
+ // monotone piecewise: ease within each key pair
+ if (t <= keys[0][0]) return 0;
+ for (let i = 1; i < keys.length; i++) if (t <= keys[i][0]) { const [ta, pa] = keys[i - 1], [tb, pb] = keys[i]; return lerp(pa, pb, eio(seg(t, ta, tb))); }
+ return 1;
+}
+function drawItem(ctx, it) {
+ const cut = (pts, fill, seed, sh = PAL.paperDD) => shape(ctx, pts, { fill, line: 4.2, seed, grain: 0.3, shade: [{ pts: move(pts, 12, 12), color: sh, alpha: 0.5 }] });
+ if (it.shape === 'sofa') { const k = kidney(it.x, it.y, it.s, it.rot || 0); cut(k, it.color, 233);
+ [-0.55, -0.18, 0.18, 0.55].forEach((f, i) => shape(ctx, ellipse(it.x + f * it.s * 1.35, it.y - it.s * 0.02 + Math.abs(f) * 10, it.s * 0.2, it.s * 0.14, 20), { fill: it.accent, line: 3, seed: 234 + i, grain: 0.25 })); }
+ else if (it.shape === 'boomerang') cut(boomerang(it.x, it.y, it.s, it.rot || 0), it.color, 232, PAL.brown);
+ else if (it.shape === 'chair') { const p = spline([[it.x - 64, it.y - 58], [it.x + 64, it.y - 64], [it.x + 72, it.y + 58], [it.x - 58, it.y + 66]], true, 6); cut(p, it.color, 240);
+ shape(ctx, spline([[it.x - 36, it.y - 30], [it.x + 40, it.y - 34], [it.x + 44, it.y + 32], [it.x - 30, it.y + 38]], true, 6), { fill: it.accent, line: 3, seed: 241, grain: 0.25 }); }
+ else if (it.shape === 'plant') { star(ctx, it.x, it.y, it.s, { n: 9, inner: 0.35, fill: it.color, line: 3.5, rot: 0.2 }); shape(ctx, ellipse(it.x, it.y, it.s * 0.33, it.s * 0.33, 16), { fill: PAL.brown, line: 3, seed: 243 }); }
+ else if (it.shape === 'table') { for (let i = 0; i < 4; i++) { const a = i / 4 * TAU + 0.785; shape(ctx, ellipse(it.x + Math.cos(a) * it.s * 1.35, it.y + Math.sin(a) * it.s * 1.35, it.s * 0.36, it.s * 0.36, 24), { fill: it.accent, line: 3.5, seed: 251 + i, grain: 0.3 }); }
+ cut(ellipse(it.x, it.y, it.s, it.s, 56), it.color, 250); sparkle(ctx, it.x, it.y, it.s * 0.3, { fill: COL.accent }); }
+ else if (it.shape === 'kidney') { const k = kidney(it.x, it.y, it.s, it.rot || 0); cut(k, it.color, 261, shade(it.color, 0.25)); if (it.accent) ink(ctx, kidney(it.x, it.y, it.s * 0.75, it.rot || 0), 3, { closed: true, color: it.accent, seed: 262, breaks: 0.4 }); }
+ else if (it.shape === 'bed') { const e = ellipse(it.x, it.y, it.s, it.s * 0.6, 40); cut(e, it.color, 263, shade(it.color, 0.25));
+ for (let i = 0; i < 9; i++) { const a = i * 2.4, r = it.s * 0.55 * Math.sqrt((i + 0.5) / 9); star(ctx, it.x + Math.cos(a) * r, it.y + Math.sin(a) * r * 0.6, 14, { n: 5, inner: 0.45, fill: i % 2 ? PAL.white : (it.accent || PAL.mustard), off: [0, 0] }); } }
+ else cut(ellipse(it.x, it.y, it.s || 60, it.s || 60, 40), it.color || PAL.white, 260);
+}
+function drawPlan(ctx, t, prog, zoneShown) {
+ const P = planOf(), y0 = P.y0, y1 = P.y1, Z = P.zones, x0 = Z[0].x0, x1 = Z[Z.length - 1].x1;
+ Z.forEach((z, i) => {
+ plane(ctx, rrect(z.x0 + (i ? 4 : 0), y0, z.x1 - z.x0 - (i < Z.length - 1 ? 4 : 0), y1 - y0, 22), z.color, { off: [6, 4] });
+ if (z.checks) { ctx.save(); ctx.beginPath(); ctx.rect(z.x0 + 10, y0 + 4, z.x1 - z.x0 - 14, y1 - y0 - 8); ctx.clip(); ctx.globalAlpha = 0.2; ctx.fillStyle = PAL.white;
+ for (let i2 = 0; i2 < 14; i2++) for (let j = 0; j < 20; j++) if ((i2 + j) % 2 === 0) ctx.fillRect(z.x0 + 10 + i2 * 44, y0 + 4 + j * 44, 44, 44); ctx.restore(); }
+ });
+ if (P.rug) { shape(ctx, ellipse(P.rug.x, P.rug.y, P.rug.rx, P.rug.ry, 64), { fill: P.rug.color, line: 0, seed: 230, grain: 0.3, alpha: 0.8 });
+ ink(ctx, ellipse(P.rug.x, P.rug.y, P.rug.rx - 34, P.rug.ry - 26, 64), 3, { closed: true, seed: 231, color: shade(P.rug.color, 0.35), breaks: 0.45 }); }
+ // walls (broken ink), doors between zones
+ const door = (y0 + y1) / 2;
+ ink(ctx, [[x0 - 10, y0 - 10], [x1 + 10, y0 - 10]], 7, { breaks: 0.18, seed: 201 });
+ ink(ctx, [[x0 - 10, y1 + 10], [x1 + 10, y1 + 10]], 7, { breaks: 0.18, seed: 202 });
+ ink(ctx, [[x0 - 10, y0 - 10], [x0 - 10, y1 + 10]], 7, { breaks: 0.15, seed: 203 });
+ ink(ctx, [[x1 + 10, y0 - 10], [x1 + 10, y1 + 10]], 7, { breaks: 0.15, seed: 204 });
+ Z.slice(1).forEach((z, i) => { ink(ctx, [[z.x0, y0 - 6], [z.x0, door - 150]], 6, { seed: 205 + i }); ink(ctx, [[z.x0, door + 150], [z.x0, y1 + 6]], 6, { seed: 207 + i }); });
+ // the route
+ const R = buildPath(), cut = Math.min(prog, R.M.homeStart), drawn = subpath(R.pts, cut / 1);
+ ink(ctx, move(drawn, 5, 4), 9, { color: COL.accent, taper: false, wob: 0.1, seed: 210 });
+ ink(ctx, drawn, 2.6, { color: COL.ink, taper: false, wob: 0.25, seed: 211, breaks: 0.05 });
+ if (prog > R.M.homeStart) { const home = R.pts.slice(R.homeFrom); const hl = (prog - R.M.homeStart) / (1 - R.M.homeStart); dashed(ctx, home, 4, 6, 14, 0, COL.ink, hl); }
+ for (const d of R.decor) {
+ if (d.u > prog) continue;
+ const k = back(clamp((prog - d.u) * R.tot / 120), 2.2);
+ if (d.kind === 'star') sparkle(ctx, d.x, d.y, 17 * k, { fill: COL.ink, rot: 0 });
+ else shape(ctx, ellipse(d.x, d.y, 8 * k, 8 * k, 12), { fill: PAL.mustard, line: 0, grain: 0.1, off: [2, 2] });
+ }
+ P.items.forEach(it => drawItem(ctx, it));
+ // dock
+ ctx.save(); ctx.translate(P.dock[0], P.dock[1]);
+ shape(ctx, rrect(-70, -36, 140, 40, 10), { fill: PAL.white, line: 4, seed: 220 }); shape(ctx, rrect(-42, -28, 84, 16, 6), { fill: COL.product, line: 3, seed: 221 });
+ ctx.restore();
+ const h = pointAt(R.pts, Math.max(0.0008, prog));
+ const ang = prog >= 0.999 ? -Math.PI / 2 : h.a;
+ drawPip(ctx, h.x, h.y, { view: 'top', s: 0.44, ang, brush: twos(t) * 9, colors: colsOf() });
+ return h;
+}
+function payoffCam(t, s) {
+ const R = buildPath(), prog = planProgress(t, s), h = pointAt(R.pts, Math.max(0.0008, prog)), b = x => B(s, x);
+ const zk = ss(seg(t, b(0.4), b(5.2)));
+ const z = Math.exp(lerp(Math.log(2.6), Math.log(1.0), zk));
+ return { prog, h, c: { cx: lerp(h.x, 960, zk), cy: lerp(h.y, 590, zk), z, r: lerp(-0.1, 0, zk) } };
+}
+function scenePayoff(ctx, t, s) {
+ const { prog, c } = payoffCam(t, s), b = x => B(s, x);
+ bg(ctx, COL.paper);
+ ctx.save(); cam(ctx, c.cx, c.cy, c.z, c.r);
+ drawPlan(ctx, t, prog);
+ // room labels pop as each zone lands
+ const P = planOf(); const zb = [4, 6, 8, 9.5];
+ P.zones.forEach((z, i) => { const k = pop(t, b(zb[i])); if (k > 0) { ctx.save(); ctx.translate((z.x0 + z.x1) / 2, P.y1 + 54); ctx.scale(k, k);
+ text(ctx, z.name.toUpperCase(), 0, 0, { font: '600 24px Jost', fill: COL.ink, track: 6, align: 'center', maxW: z.x1 - z.x0 - 20 }); ctx.restore(); } });
+ ctx.restore();
+ // caption + manual arrow to Pip
+ const capA = ss(seg(t, b(4), b(4.6)));
+ if (capA > 0) {
+ const R = buildPath(), hh = pointAt(R.pts, Math.max(0.0008, prog)), hs = w2s(hh.x, hh.y, c);
+ const f = fit(ctx, C.payoff.caption, '500 {px}px Jost', 36, 700, 1, 26);
+ const bw = measure(ctx, f.lines[0], f.font) + 60, bh = 36 + f.px * 1.2, bx = 70, by = 40;
+ ctx.save(); ctx.globalAlpha = capA;
+ shape(ctx, rrect(bx, by, bw, bh, 14), { fill: COL.ink, line: 0, off: [0, 0], grain: 0.1 });
+ text(ctx, f.lines[0], bx + 30, by + 18 + f.px * 0.92, { font: f.font, fill: COL.paper });
+ const P2 = planOf(), edgeW = [clamp(hh.x, P2.zones[0].x0 + 60, P2.zones[P2.zones.length - 1].x1 - 60), P2.y0 - 18];
+ const eS = w2s(edgeW[0], edgeW[1], c), from = [bx + bw - 30, by + bh + 8];
+ const tx = clamp(eS[0], from[0] - 160, from[0] + 260), ty = Math.max(eS[1], from[1] + 40);
+ if (ty - from[1] < 160) arrow(ctx, from, [tx, ty], { u: ss(seg(t, b(4.2), b(4.8))), bob: (t / BEAT) % 1, bend: -0.35, w: 5, head: 24, fill: COL.accent });
+ ctx.restore();
+ }
+}
+
+// ------------------------------------------------------------------ TIP: a colour block slides in; the cable is just an ink line and peels off the page
+function sceneTip(ctx, t, s) {
+ const u = t - s.t0, b = x => B(s, x), col = COL.tip;
+ bg(ctx, col);
+ const FY = 860, c = { cx: lerp(1000, 1040, ss(seg(t, s.t0, s.t1))), cy: 640, z: lerp(1.28, 1.4, ss(seg(t, s.t0, s.t1))) };
+ ctx.save(); cam(ctx, c.cx, c.cy, c.z);
+ floor(ctx, col, FY);
+ // the cable: a wiggly ink line on the floor; its colour cel is a pale shadow left behind when the line is lifted
+ const cab = []; for (let i = 0; i <= 80; i++) { const v = i / 80; cab.push([860 + v * 330 + Math.sin(v * 16) * 16, FY + 30 + Math.sin(v * 7 + 1) * 14]); }
+ const grab = t >= b(2), liftK = eio(seg(t, b(2.2), b(3.2)));
+ const shadowA = 1 - seg(t, b(3.2), b(4.6));
+ if (shadowA > 0) ink(ctx, move(cab, 6, 5), 9, { color: shade(col, 0.12), alpha: shadowA, taper: false, seed: 890 });
+ // hand path: reach b1 (anticipation above), grip b2, lift b3, hold up b4+
+ const pose = { x: 700, y: FY, s: 1.12, dir: 1, view: 'q', kneel: true, face: t >= b(4) ? 'wink' : 'focus', blink: 0, handB: 'open' };
+ const hold = [960, FY - 300];
+ const reachP = [860, FY + 20];
+ const hand = t < b(1) ? [lerp(760, 880, eo(seg(t, s.t0, b(1)))), FY - 120] : t < b(2) ? [lerp(880, reachP[0], ss(seg(t, b(1.4), b(2)))), lerp(FY - 120, reachP[1], ss(seg(t, b(1.4), b(2))))] : [lerp(reachP[0], hold[0], liftK), lerp(reachP[1], hold[1], liftK)];
+ const kp = kneelPose(700, FY, 1.12, hand, [640, FY - 20], u, pose.face);
+ kp.handF = grab ? 'grip' : 'open'; kp.face = pose.face;
+ // lifted cable hangs from the hand, peeling off from the grabbed end
+ if (!grab) { ink(ctx, cab, 7, { taper: false, seed: 891 }); const e = cab[cab.length - 1]; shape(ctx, rrect(e[0], e[1] - 12, 34, 24, 6), { fill: PAL.white, line: 3.5, seed: 892 }); }
+ else {
+ const L = plen(cab), hangs = cab.map((p, i) => {
+ const d = (i / 80) * L, peel = liftK * (L + 240) - d; // how much of this point has come off the page
+ if (peel <= 0) return p;
+ const hx = hand[0] + 16, hy = hand[1] + 10, hangLen = Math.min(d, peel);
+ const hp = [hx + Math.sin(d / 40 + u * 3) * 10, hy + hangLen * 0.7];
+ const k = clamp(peel / 120);
+ return [lerp(p[0], hp[0], k), lerp(p[1], hp[1], k)];
+ });
+ ink(ctx, hangs, 7, { taper: false, seed: 891 });
+ const e = hangs[hangs.length - 1]; shape(ctx, rrect(e[0] - 13, e[1], 26, 34, 6), { fill: PAL.white, line: 3.5, seed: 892 });
+ }
+ drawOwner(ctx, kp, u);
+ // Pip waits, blinks thanks on b5 and rolls on
+ const roll = eo(seg(t, b(5), b(6))) * 80;
+ drawPip(ctx, 1440 - roll, FY + 6, { s: 0.95, light: t >= b(5) && t < b(5.3) ? 0 : 1, brush: t >= b(5) ? twos(u) * 6 : 0, colors: colsOf() });
+ ctx.restore();
+ stepHeader(ctx, t, s, C.tip.text, (C.tip.label || 'Tip').toUpperCase());
+}
+
+// ------------------------------------------------------------------ LOCKUP: the poster
+function medallion(ctx, i, cx, cy, R, k) {
+ const st = C.steps[i], col = COL.steps[i % COL.steps.length];
+ ctx.save(); ctx.translate(cx, cy); ctx.scale(k, k);
+ star(ctx, 0, 0, R * 1.18, { n: 16, inner: 0.84, fill: PAL.white, off: [0, 0], rot: i * 0.2, grain: 0.1 });
+ shape(ctx, ellipse(0, 0, R, R, 64), { fill: col, line: 4.5, seed: 300 + i, grain: 0.35 });
+ icon(ctx, st.icon, 0, 6, R * 1.25, { main: COL.product, light: PAL.white, dark: COL.productD });
+ shape(ctx, ellipse(-R * 0.74, -R * 0.74, R * 0.3, R * 0.3, 30), { fill: COL.ink, line: 0, seed: 310 + i, grain: 0.1, off: [0, 0] });
+ text(ctx, String(i + 1), -R * 0.74, -R * 0.74 + R * 0.14, { font: `${Math.round(R * 0.4)}px Slab`, fill: COL.paper, align: 'center' });
+ ctx.restore();
+}
+function sceneLockup(ctx, t, s) {
+ const u = t - s.t0, b = x => B(s, x);
+ bg(ctx, COL.paper);
+ // a thin lace of the route along the bottom edge (low contrast)
+ const BY = 1034;
+ plane(ctx, rect(0, BY, W, H - BY), tint(COL.tip, 0.35), { grain: 0.25 });
+ const lace = []; for (let x = -20; x <= W + 20; x += 6) lace.push([x, BY + 23 + Math.sin(x / 34) * 9]);
+ ink(ctx, move(lace, 3, 3), 6, { color: tint(COL.accent, 0.35), taper: false, seed: 331 });
+ for (let x = 30; x < W; x += 107) sparkle(ctx, x, BY + 24, 8, { fill: tint(COL.ink, 0.45) });
+ ink(ctx, [[-10, BY], [W + 10, BY]], 3.5, { seed: 330, breaks: 0.12 });
+ // title block slams on beat 4
+ const kt = pop(t, b(3), 0.3);
+ if (kt > 0) {
+ ctx.save(); ctx.translate(W / 2, 200); ctx.scale(kt, kt); ctx.translate(-W / 2, -200);
+ text(ctx, C.hook.kicker, W / 2, 124, { font: '700 76px Oleo', fill: COL.accent, align: 'center', rot: -0.03, maxW: 900 });
+ const f = fit(ctx, C.title, '{px}px Slab', 76, 1400, 1, 50);
+ text(ctx, f.lines[0], W / 2, 214, { font: f.font, fill: COL.ink, plate: COL.hook, off: [5, 4], align: 'center' });
+ text(ctx, C.subtitle.toUpperCase(), W / 2, 272, { font: '600 30px Jost', fill: COL.ink, align: 'center', track: 9 });
+ ctx.restore();
+ }
+ // steps land one per beat (their chords come back)
+ const n = C.steps.length, span = Math.min(1500, 430 * n), R = n > 3 ? 88 : 104, cy = 440;
+ for (let i = 0; i < n; i++) {
+ const cx = W / 2 - span / 2 + span * (i + 0.5) / n, k = pop(t, s.t0 + i * BEAT * (n > 3 ? 0.75 : 1), 0.26);
+ if (k <= 0) continue;
+ if (i > 0) { const px = W / 2 - span / 2 + span * (i - 0.5) / n; arrow(ctx, [px + R + 28, cy - 24], [cx - R - 34, cy - 24], { u: eo(seg(t, s.t0 + i * BEAT, s.t0 + i * BEAT + 0.3)), bob: ((t / BEAT) + i * 0.5) % 1, bend: -0.3, w: 5, head: 26, fill: COL.accent, dashedShaft: true, seed: 340 + i }); }
+ medallion(ctx, i, cx, cy, R, k);
+ ctx.save(); ctx.globalAlpha = clamp(k);
+ const tf = fit(ctx, C.steps[i].title, '600 {px}px Jost', 40, span / n - 40, 2, 26), ty = cy + R + 62;
+ tf.lines.forEach((l, j) => text(ctx, l, cx, ty + j * tf.px * 1.1, { font: tf.font, fill: COL.ink, align: 'center' }));
+ const df = fit(ctx, C.steps[i].detail || '', '400 {px}px Jost', 27, span / n - 70, 2, 20);
+ df.lines.forEach((l, j) => text(ctx, l, cx, ty + (tf.lines.length - 1) * tf.px * 1.1 + 42 + j * df.px * 1.22, { font: df.font, fill: PAL.inkSoft, align: 'center' }));
+ ctx.restore();
+ }
+ // tip ribbon + CTA
+ const kr = pop(t, b(3.5), 0.3);
+ if (kr > 0) {
+ const tf = fit(ctx, C.tip.text, '500 {px}px Jost', 38, 860, 1, 26);
+ const tw = measure(ctx, tf.lines[0], tf.font) + 240, tx = W / 2 - tw / 2, ty = 734, th = 88;
+ ctx.save(); ctx.translate(W / 2, ty + th / 2); ctx.scale(kr, kr); ctx.translate(-W / 2, -(ty + th / 2));
+ shape(ctx, [[tx - 34, ty], [tx + tw + 34, ty], [tx + tw + 6, ty + th / 2], [tx + tw + 34, ty + th], [tx - 34, ty + th], [tx - 6, ty + th / 2]], { fill: COL.tip, line: 4, seed: 350, off: [6, 5], grain: 0.25 });
+ star(ctx, tx + 66, ty + th / 2, 50, { n: 12, inner: 0.64, fill: COL.accent, line: 3, off: [0, 0], rot: u * 0.3 });
+ text(ctx, (C.tip.label || 'Tip').toUpperCase(), tx + 66, ty + th / 2 + 9, { font: '25px Slab', fill: PAL.white, align: 'center', maxW: 70 });
+ text(ctx, tf.lines[0], tx + 134, ty + th / 2 + tf.px * 0.34, { font: tf.font, fill: COL.ink });
+ icon(ctx, C.tip.icon, tx + tw - 44, ty + th / 2 + 4, 76, { main: COL.accent, light: PAL.white });
+ ctx.restore();
+ }
+ const kc = pop(t, b(4), 0.3);
+ if (kc > 0) {
+ const cf = fit(ctx, C.outro.cta, '500 {px}px Jost', 28, 900, 1, 20), cw = measure(ctx, cf.lines[0], cf.font) + 60;
+ ctx.save(); ctx.globalAlpha = clamp(kc);
+ shape(ctx, rrect(W / 2 - cw / 2, 858, cw, 54, 27), { fill: COL.ink, line: 0, off: [0, 0], grain: 0.1 });
+ text(ctx, cf.lines[0], W / 2, 894, { font: cf.font, fill: COL.paper, align: 'center' });
+ ctx.restore();
+ }
+ // the cast, fully in frame: June presents from the left, Pip on its starburst at the right
+ const kj = pop(t, b(4), 0.3);
+ if (kj > 0) {
+ const fs = n <= 3 ? 1 : 0.8;
+ ctx.save(); ctx.translate(1680, 890); ctx.scale(kj, kj); ctx.translate(-1680, -890);
+ rays(ctx, 1680, 860, 16, 128 * fs, COL.hook, { rot: u * 0.1, alpha: 0.9 });
+ shape(ctx, ellipse(1680, 860, 96 * fs, 96 * fs, 48), { fill: PAL.white, line: 0, grain: 0.1, off: [0, 0] });
+ drawPip(ctx, 1680, 912, { s: 0.56 * fs, light: 1, brush: twos(u) * 5, colors: colsOf() });
+ sparkle(ctx, 1580, 760, 24, { fill: COL.accent }); sparkle(ctx, 1790, 770, 16, { fill: COL.ink });
+ ctx.restore();
+ const wave = Math.floor(twos(u) / (BEAT * 2)) % 2;
+ ctx.save(); ctx.globalAlpha = clamp(kj);
+ drawOwner(ctx, { x: 190, y: 1016, s: 0.66 * fs, dir: 1, view: 'q', face: 'wink', armF: wave ? { a1: -0.4, a2: -1.35 } : { a1: -0.25, a2: -1.1 }, armB: { a1: 1.86, a2: 1.7 }, handF: 'point', handB: 'open' }, u);
+ ctx.restore();
+ }
+ return { pip: [1680, 880] };
+}
+
+// ------------------------------------------------------------------ END: iris-out onto Pip, the card lives in the circle
+function sceneEnd(ctx, t, s) {
+ const b = x => B(s, x), lk = sec('lockup');
+ const close = eio(seg(t, s.t0, b(1.2)));
+ if (close < 1) {
+ sceneLockup(ctx, t, lk);
+ const r = lerp(2300, 70, close);
+ ctx.save(); ctx.fillStyle = COL.ink; ctx.beginPath(); ctx.rect(-10, -10, W + 20, H + 20); ctx.arc(1680, 880, r, 0, TAU, true); ctx.fill(); ctx.restore();
+ ink(ctx, ellipse(1680, 880, r, r, 80), 5, { closed: true, color: COL.paper, seed: 950 });
+ return;
+ }
+ bg(ctx, COL.ink);
+ const k = back(seg(t, b(1.5), b(2.3)), 1.4), R = 450 * k;
+ if (R <= 1) { shape(ctx, ellipse(1680, 880, 70 * (1 - seg(t, b(1.2), b(1.5))), 70 * (1 - seg(t, b(1.2), b(1.5))), 40), { fill: COL.paper, line: 0, off: [0, 0], grain: 0 }); return; }
+ shape(ctx, ellipse(W / 2, H / 2, R, R, 90), { fill: COL.paper, line: 0, grain: 0.2, off: [0, 0] });
+ ink(ctx, ellipse(W / 2, H / 2, R + 18, R + 18, 90), 4, { closed: true, color: COL.paper, seed: 951, breaks: 0.3 });
+ const ka = seg(t, b(2.2), b(2.8));
+ if (ka <= 0) return;
+ ctx.save(); ctx.globalAlpha = ka;
+ const F = C.film || {};
+ text(ctx, F.name || C.hook.kicker, W / 2, 380, { font: '700 96px Oleo', fill: COL.ink, plate: COL.hook, off: [5, 4], align: 'center', maxW: 760 });
+ text(ctx, (F.style || '').toUpperCase(), W / 2, 450, { font: '600 28px Jost', fill: COL.accent, align: 'center', track: 8 });
+ ink(ctx, [[W / 2 - 150, 490], [W / 2 + 150, 490]], 3, { seed: 952, breaks: 0.2 });
+ text(ctx, 'Lemo-Opuscar', W / 2, 560, { font: '44px Slab', fill: COL.ink, align: 'center' });
+ text(ctx, 'LemoLab × Claude Opus 5.5', W / 2, 612, { font: '500 32px Jost', fill: COL.ink, align: 'center' });
+ const cf = fit(ctx, F.credits || '', '400 {px}px Jost', 21, 620, 4, 16);
+ cf.lines.forEach((l, i) => text(ctx, l, W / 2, 668 + i * cf.px * 1.35, { font: cf.font, fill: PAL.inkSoft, align: 'center' }));
+ drawPip(ctx, W / 2, 882, { view: 'top', s: 0.34, ang: -Math.PI / 2, colors: colsOf() });
+ ctx.restore();
+}
+
+// ------------------------------------------------------------------ renderer + transitions
+function drawSection(ctx, t, s) {
+ ctx.save();
+ let r = {};
+ if (s.kind === 'hook') r = sceneHook(ctx, t, s);
+ else if (s.kind === 'step') r = sceneStep(ctx, t, s);
+ else if (s.kind === 'payoff') scenePayoff(ctx, t, s);
+ else if (s.kind === 'tip') sceneTip(ctx, t, s);
+ else if (s.kind === 'lockup') r = sceneLockup(ctx, t, s);
+ else sceneEnd(ctx, t, s);
+ ctx.restore();
+ return r || {};
+}
+export function renderFilm(ctx, t, Q) {
+ setClock(t);
+ const S = T.S, idx = S.indexOf(section(t)), s = S[idx], nx = S[idx + 1], pv = S[idx - 1];
+ ctx.save();
+ // 1) iris through the step medallion: [next.t0 - 0.5 beat, next.t0 + 0.4 beat]
+ const irisOut = nx && nx.kind === 'step' && t >= nx.t0 - BEAT * 0.5 ? nx : null;
+ const irisIn = s.kind === 'step' && pv && t < s.t0 + BEAT * 0.4 ? s : null;
+ const pressIris = s.kind === 'payoff' && t < s.t0 + 0.28;
+ const blockIn = (s.kind === 'tip' && t < s.t0 + 0.3) || (s.kind === 'lockup' && t < s.t0 + 0.2);
+ if (irisOut || irisIn) {
+ const inc = irisOut || irisIn, prev = S[S.indexOf(inc) - 1];
+ const k = eio(seg(t, inc.t0 - BEAT * 0.5, inc.t0 + BEAT * 0.4));
+ const f = drawSection(ctx, Math.min(t, inc.t0 - 1e-3), prev).focus || [W / 2, H / 2];
+ const cx = lerp(f[0], W / 2, k), cy = lerp(f[1], H / 2, k), r = lerp(104, 1250, k * k);
+ ctx.save(); ctx.beginPath(); ctx.arc(cx, cy, r, 0, TAU); ctx.clip(); drawSection(ctx, Math.max(t, inc.t0 + 1e-3), inc); ctx.restore();
+ ink(ctx, ellipse(cx, cy, r, r, 90), 7, { closed: true, seed: 960 });
+ if (k < 0.5) { ctx.save(); ctx.globalAlpha = 1 - k * 2; ctx.translate(cx, cy); ctx.scale(1 + k * 3, 1 + k * 3);
+ text(ctx, String(inc.i + 1), 0, 104 * 0.38, { font: `${114}px Slab`, fill: COL.ink, plate: PAL.white, off: [5, 5], align: 'center' }); ctx.restore(); }
+ } else if (pressIris) {
+ // the start button opens into the plan (circle to circle)
+ const prev = pv, f = drawSection(ctx, prev.t1 - 1e-3, prev).btn || [W / 2, H / 2];
+ const k = eio(seg(t, s.t0, s.t0 + 0.28));
+ const cx = lerp(f[0], W / 2, k), cy = lerp(f[1], H / 2, k), r = lerp(40, 1250, k * k);
+ ctx.save(); ctx.beginPath(); ctx.arc(cx, cy, r, 0, TAU); ctx.clip(); drawSection(ctx, t, s); ctx.restore();
+ ink(ctx, ellipse(cx, cy, r, r, 90), 7, { closed: true, seed: 961 });
+ } else if (blockIn) {
+ // colour block wipe: tip slides in from the right; the lockup paper rises from the bottom
+ const d = s.kind === 'tip' ? 0.3 : 0.2, k = eio(seg(t, s.t0, s.t0 + d));
+ drawSection(ctx, pv.t1 - 1e-3, pv);
+ ctx.save(); ctx.beginPath();
+ if (s.kind === 'tip') ctx.rect(W * (1 - k), 0, W, H); else ctx.rect(0, H * (1 - k), W, H);
+ ctx.clip(); drawSection(ctx, t, s); ctx.restore();
+ if (s.kind === 'tip') ink(ctx, [[W * (1 - k), -10], [W * (1 - k), H + 10]], 6, { seed: 962 }); else ink(ctx, [[-10, H * (1 - k)], [W + 10, H * (1 - k)]], 6, { seed: 963 });
+ } else drawSection(ctx, t, s);
+ ctx.restore();
+ paperFinish(ctx, W, H, 1);
+ if (!(Q && Q.has('nosubs'))) subtitle(ctx, t);
+}
+
+// ------------------------------------------------------------------ sound events (same times drive the pictures)
+function buildEvents() {
+ EVS = [];
+ const S = T.S;
+ T.V.forEach(v => ev(v.t, 'vo', { id: v.id }));
+ const h = S[0]; const hb = x => B(h, x);
+ ev(0.0, 'creak', { pan: -0.3 }); ev(hb(1) - 0.02, 'box_thump', { pan: -0.35, pitch: 0 }); ev(hb(2) - 0.02, 'box_thump', { pan: 0.35, pitch: 1 });
+ ev(hb(3), 'box_fall', {}); ev(hb(4), 'ding', { gain: 0.8 }); ev(hb(4) + 0.34, 'plastic_land', {});
+ ev(hb(6), 'wood_tick', {}); ev(hb(4) + 0.02, 'pen_write', { dur: 0.55 });
+ S.forEach((s, k) => {
+ const b = x => B(s, x);
+ if (s.kind === 'step') {
+ ev(s.t0 - BEAT, 'stamp', {}); ev(s.t0 - BEAT * 0.5, 'whoosh', { dur: 0.4 });
+ ev(b(0.1), 'slide', { gain: 0.5 });
+ const a = C.steps[s.i].action;
+ if (a === 'place') { ev(b(2), 'pop', {}); ev(b(1.6), 'scrape', { dur: 0.35, gain: 0.5 }); ev(b(2.9), 'scrape', { dur: 0.6 }); ev(b(3.5), 'plastic_thock', {}); ev(b(4.5), 'pop', { gain: 0.6 }); ev(b(5), 'plug_click', {}); ev(b(5), 'flip', {}); ev(b(5.5), 'whistle', { pan: -0.5 }); ev(b(6), 'whistle', { pan: 0.5, up: 1 }); }
+ else if (a === 'tap') { ev(b(2), 'pop', {}); ev(b(4), 'tap', {}); ev(b(5), 'tap', {}); ev(b(5), 'pop', { gain: 0.6 }); [6, 7, 8].forEach((x, i) => ev(b(x), 'beep', { n: i })); ev(b(8), 'stamp', { gain: 0.5 }); }
+ else if (a === 'press') { ev(b(2), 'pop', { gain: 0.6 }); ev(b(1), 'whoosh', { dur: 0.3, gain: 0.4 }); ev(b(5), 'btn_soft', {}); ev(b(5), 'hold', { dur: 2 * BEAT }); }
+ else { ev(b(2), 'pop', {}); ev(b(4), 'tap', {}); ev(b(4), 'pop', { gain: 0.6 }); }
+ } else if (s.kind === 'payoff') {
+ ev(s.t0, 'click_big', {}); ev(s.t0 - 0.2, 'motor', { dur: s.t1 - s.t0 + 0.6 });
+ [4, 6, 8, 9.5].slice(0, planOf().zones.length).forEach((x, i) => ev(b(x), 'zone', { n: i }));
+ ev(b(11), 'dock', {});
+ } else if (s.kind === 'tip') {
+ ev(s.t0, 'paper_swish', {}); ev(s.t0, 'stamp', {});
+ ev(b(2), 'grab', {}); ev(b(2.2), 'peel', { dur: 1.0 }); ev(b(5), 'ding', { gain: 0.5 }); ev(b(5), 'roll', { dur: 0.45 });
+ } else if (s.kind === 'lockup') {
+ ev(s.t0, 'paper_swish', { gain: 0.6 });
+ C.steps.forEach((_, i) => ev(s.t0 + i * BEAT * (C.steps.length > 3 ? 0.75 : 1), 'stamp', { gain: 0.8 }));
+ ev(b(3), 'wood_block', {}); ev(b(3.5), 'paper_swish', { gain: 0.5 }); ev(b(4), 'pop', { gain: 0.6 });
+ } else if (s.kind === 'end') { ev(s.t0, 'iris', { dur: BEAT * 1.2 }); ev(B(s, 1.5), 'pop', { gain: 0.5 }); }
+ });
+ EVS.sort((a, b) => a.t - b.t);
+}
diff --git a/styles/midcentury-toon/demo/fonts/OFL-alfaslabone.txt b/styles/midcentury-toon/demo/fonts/OFL-alfaslabone.txt
new file mode 100644
index 0000000..2115577
--- /dev/null
+++ b/styles/midcentury-toon/demo/fonts/OFL-alfaslabone.txt
@@ -0,0 +1,93 @@
+Copyright 2016 The Alfa Slab One Project Authors (http://www.jmsole.cl | [email protected]), with Reserved Font Name "Alfa Slab".
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+http://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/styles/midcentury-toon/demo/fonts/OFL-jost.txt b/styles/midcentury-toon/demo/fonts/OFL-jost.txt
new file mode 100644
index 0000000..85b6b99
--- /dev/null
+++ b/styles/midcentury-toon/demo/fonts/OFL-jost.txt
@@ -0,0 +1,93 @@
+Copyright 2020 The Jost Project Authors (https://github.com/indestructible-type)
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+http://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/styles/midcentury-toon/demo/fonts/OFL-oleoscript.txt b/styles/midcentury-toon/demo/fonts/OFL-oleoscript.txt
new file mode 100644
index 0000000..7aa3e24
--- /dev/null
+++ b/styles/midcentury-toon/demo/fonts/OFL-oleoscript.txt
@@ -0,0 +1,93 @@
+Copyright (c) 2012, Soytutype ([email protected]|[email protected]), with Reserved Font Name "Oleo Script"
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+http://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/styles/midcentury-toon/demo/fonts/fonts.css b/styles/midcentury-toon/demo/fonts/fonts.css
new file mode 100644
index 0000000..8406532
--- /dev/null
+++ b/styles/midcentury-toon/demo/fonts/fonts.css
@@ -0,0 +1,4 @@
+@font-face { font-family: 'Oleo'; src: url(OleoScript-Regular.ttf) format('truetype'); font-weight: 400; font-display: block; }
+@font-face { font-family: 'Oleo'; src: url(OleoScript-Bold.ttf) format('truetype'); font-weight: 700; font-display: block; }
+@font-face { font-family: 'Slab'; src: url(AlfaSlabOne-Regular.ttf) format('truetype'); font-display: block; }
+@font-face { font-family: 'Jost'; src: url(Jost.ttf) format('truetype'); font-weight: 100 900; font-display: block; }
diff --git a/styles/midcentury-toon/demo/index.html b/styles/midcentury-toon/demo/index.html
new file mode 100644
index 0000000..388678a
--- /dev/null
+++ b/styles/midcentury-toon/demo/index.html
@@ -0,0 +1,6 @@
+<!doctype html>
+<html><head><meta charset="utf-8"><title>Meet Pip</title>
+<link rel="stylesheet" href="fonts/fonts.css">
+<style>html,body{margin:0;background:#000;overflow:hidden}canvas{position:absolute;left:0;top:0;display:block}</style>
+</head><body><canvas id="c" width="1920" height="1080"></canvas>
+<script type="module" src="main.js"></script></body></html>
diff --git a/styles/midcentury-toon/demo/lines.json b/styles/midcentury-toon/demo/lines.json
new file mode 100644
index 0000000..4d8f9d7
--- /dev/null
+++ b/styles/midcentury-toon/demo/lines.json
@@ -0,0 +1,44 @@
+[
+ {
+ "id": "hook",
+ "text": "Meet Pip, your new robot vacuum.",
+ "asr": "Meet Pip, your new robot vacuum.",
+ "voice": "am_michael",
+ "speed": 0.94
+ },
+ {
+ "id": "step0",
+ "text": "Step one. Set the dock against a wall.",
+ "asr": "Step 1. Set the dock against a wall.",
+ "voice": "am_michael",
+ "speed": 0.94
+ },
+ {
+ "id": "step1",
+ "text": "Step two. Open the app and add Pip.",
+ "asr": "Step 2. Open the app and add Pip.",
+ "voice": "am_michael",
+ "speed": 0.94
+ },
+ {
+ "id": "step2",
+ "text": "Step three. Press start.",
+ "asr": "Step 3. Press start.",
+ "voice": "am_michael",
+ "speed": 0.94
+ },
+ {
+ "id": "tip",
+ "text": "Tip: pick up loose cables first.",
+ "asr": "Tip: pick up loose cables first.",
+ "voice": "am_michael",
+ "speed": 0.94
+ },
+ {
+ "id": "outro",
+ "text": "Three steps. That's it.",
+ "asr": "Three steps. That's it.",
+ "voice": "am_michael",
+ "speed": 0.94
+ }
+]
\ No newline at end of file
diff --git a/styles/midcentury-toon/demo/main.js b/styles/midcentury-toon/demo/main.js
new file mode 100644
index 0000000..2b218cb
--- /dev/null
+++ b/styles/midcentury-toon/demo/main.js
@@ -0,0 +1,17 @@
+// Page contract: window.READY, window.render(t), window.DUR, window.EV
+import { textures } from './engine/toon.js';
+const Q = new URLSearchParams(location.search);
+const cv = document.getElementById('c'), g = cv.getContext('2d');
+await Promise.all(['700 80px Oleo', '400 80px Oleo', '80px Slab', '400 40px Jost', '500 40px Jost', '600 40px Jost', '700 40px Jost'].map(f => document.fonts.load(f)));
+textures();
+const content = await (await fetch(Q.get('content') || 'content.json')).json();
+let durs = {}; if (!Q.get('content') || Q.get('durs')) try { durs = await (await fetch(Q.get('durs') || 'voices/dur.json')).json(); } catch (e) {}
+const film = await import('./film.js');
+film.setup(content, durs);
+window.DUR = film.DUR(); window.EV = film.events(); window.SRT = film.srtCues();
+window.render = async t => {
+ g.setTransform(1, 0, 0, 1, 0, 0);
+ if (Q.get('test') === 'sheet') { (await import('./sheet.js')).drawSheet(g, t, content); return; }
+ film.renderFilm(g, t, Q);
+};
+window.READY = true;
diff --git a/styles/midcentury-toon/demo/mix.py b/styles/midcentury-toon/demo/mix.py
new file mode 100644
index 0000000..5feabeb
--- /dev/null
+++ b/styles/midcentury-toon/demo/mix.py
@@ -0,0 +1,155 @@
+"""Mix: score (music/score.wav) + Kokoro narration + material-true foley + room tone -> mix.wav
+Run from the repo root: .venv/bin/python styles/midcentury-toon/demo/mix.py
+(needs events.json from core/render/events.mjs, voices/ from core/tts/tts.py, music/score.wav from music/score.py)
+Three layers: ambience (room tone + a quiet mantel clock on the half-note grid, the vacuum motor in the payoff),
+foley (cardboard, plastic, paper, rubber stamp, cable), music; music ducks ~8 dB under the voice.
+Silences: B (last beat before the press) is truly silent — ambience removed too; C (before the lockup) keeps room tone only."""
+import sys, os, json, numpy as np, soundfile as sf, librosa
+ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../..'))
+sys.path.insert(0, ROOT)
+from core.audio.sfx import SR, t_, env_exp, bp, lp, hp, noise, norm, brown, click, clack, whoosh, creak, thump, ding, pop, add, compress, limit
+D = os.path.dirname(os.path.abspath(__file__))
+E = json.load(open(os.path.join(D, 'events.json')))
+DUR = E['dur']; N = int(round(DUR * SR)); EV = E['ev']
+BEAT = 60 / 132
+rng = np.random.default_rng(48)
+def nz(d): return rng.standard_normal(len(t_(d)))
+def env_ad(d, a=.004, tau=.1):
+ x = env_exp(d, tau); n = int(a * SR)
+ if n: x[:n] *= np.linspace(0, 1, n)
+ return x
+def M(*xs):
+ n = max(len(x) for x in xs); return sum(np.pad(x, (0, n - len(x))) for x in xs)
+def sine(f, d): return np.sin(2 * np.pi * np.cumsum(np.broadcast_to(f, len(t_(d))).astype(float)) / SR)
+
+# ---------------- foley by material ----------------
+def cardboard_thump(p=0): # a box flap landing: dull, papery low thud + fibre slap
+ d = .35; tt = t_(d)
+ return norm(M(sine(95 * 2 ** (p / 12) * (1 - .35 * tt), d) * env_exp(d, .06), lp(nz(d), 900) * env_exp(d, .03) * .8, bp(nz(d), 1500, 4000) * env_exp(d, .01) * .3))
+def cardboard_creak():
+ c = creak(1); d = len(c) / SR
+ return norm(c * .7 + bp(nz(d), 700, 2500)[:len(c)] * env_ad(d, .05, .1)[:len(c)] * .2)
+def box_fall(): # back wall falls away: swish then soft slap
+ d = .45; x = np.zeros(len(t_(d))); w = whoosh(.3, 1) * .5; x[:len(w)] += w
+ s = cardboard_thump(-4) * .7; o = int(.18 * SR); x[o:o + len(s)] += s[:len(x) - o]; return norm(x)
+def plastic(p=1.0, d=.18): # appliance plastic: bright knock with short hollow body
+ tt = t_(d)
+ return norm(hp(nz(d), 1500) * env_exp(d, .003) + sine(620 * p, d) * env_exp(d, .025) * .6 + sine(1340 * p, d) * env_exp(d, .015) * .3)
+def plastic_thock(): return norm(M(plastic(.8, .25), thump(.6, 85)[:int(.25 * SR)] * .6))
+def plug_click(): return norm(M(clack(1.3, 1)[:int(.12 * SR)], plastic(1.6, .12) * .6))
+def scrape(d=.5): # a plastic base dragged on a wooden floor
+ x = bp(nz(d), 300, 2400) * (0.6 + .4 * np.abs(np.sin(2 * np.pi * 31 * t_(d))))
+ return norm(x) * np.sin(np.pi * t_(d) / d) ** .7
+def stamp(): # rubber stamp: thick, damped, a little paper smack
+ d = .3; tt = t_(d)
+ return norm(sine(140 * (1 - .4 * tt), d) * env_exp(d, .035) + lp(nz(d), 1800) * env_exp(d, .012) * .9)
+def paper_swish(d=.3): return norm(bp(nz(d), 1800, 8000)) * np.sin(np.pi * t_(d) / d) ** 2
+def slide_whistle(up=True, d=.32):
+ f = np.linspace(700, 1500, len(t_(d))) if up else np.linspace(1500, 800, len(t_(d)))
+ return norm(sine(f * (1 + .01 * np.sin(2 * np.pi * 6 * t_(d))), d) + .1 * bp(nz(d), 1000, 3000)) * np.sin(np.pi * t_(d) / d) ** .6
+def soft_tap(): return norm(M(plastic(1.9, .08) * .7, lp(nz(.08), 2000) * env_exp(.08, .006)))
+def beep(n): # three rising "connected" pips (sine + a touch of bell)
+ d = .22; f = [1318.5, 1568, 2093][n]; return norm(sine(f, d) * env_ad(d, .004, .07) + sine(f * 2.01, d) * env_exp(d, .03) * .2)
+def pen_write(d=.5): x = bp(nz(d), 2000, 7000) * (0.5 + .5 * np.abs(np.sin(2 * np.pi * 11 * t_(d)))); return norm(x) * np.sin(np.pi * t_(d) / d)
+def wood_tick(): return norm(clack(1.1, 1)[:int(.1 * SR)])
+def btn_soft(): return norm(plastic(1.2, .1)) * .6
+def hold_hiss(d): return norm(bp(nz(d), 3000, 9000)) * env_ad(d, .05, d) * .4
+def click_big(): # THE button: two-stage mechanical click + rising chime
+ d = .6; x = np.zeros(len(t_(d)))
+ a = norm(clack(.9, 1)[:int(.1 * SR)]); x[:len(a)] += a
+ b = plastic(1.4, .12); o = int(.035 * SR); x[o:o + len(b)] += b * .8
+ ch = ding(1)[:len(x)]; x[:len(ch)] += ch * .5
+ return norm(x)
+def motor(d): # vacuum motor: saw hum + brushes, gentle LFO
+ tt = t_(d); f = 118 * (1 + .01 * np.sin(2 * np.pi * .7 * tt))
+ saw = (np.cumsum(f) / SR) % 1 * 2 - 1
+ x = bp(saw, 200, 2600) * .5 + bp(nz(d), 3000, 8000) * .12 * (0.7 + .3 * np.sin(2 * np.pi * 9 * tt))
+ e = np.minimum(1, tt / .25) * np.minimum(1, (d - tt) / .4)
+ return norm(x) * e
+def zone_swish(): return norm(M(pen_write(.6) * .8, paper_swish(.6) * .5))
+def dock_clunk(): return norm(M(plastic_thock(), np.pad(ding(.7), (int(.06 * SR), 0))[:int(.25 * SR)] * .3))
+def grab(): return norm(lp(nz(.12), 1500) * env_exp(.12, .02))
+def peel(d): # the ink line lifting off paper: sticky tearing hiss that rises
+ tt = t_(d); x = bp(nz(d), 1200, 6000) * (0.4 + .6 * (rng.random(len(tt)) > .7)) * np.linspace(.4, 1, len(tt))
+ return norm(lp(x, 7000)) * np.sin(np.pi * tt / d) ** .5
+def roll(d): x = M(lp(nz(d), 600) * .6, motor(d) * .3); return norm(x) * np.sin(np.pi * np.arange(len(x)) / len(x))
+def wood_block(): return norm(M(clack(.8, 1)[:int(.14 * SR)], thump(.5, 110)[:int(.14 * SR)] * .5))
+def iris(d): tt = t_(d); return norm(bp(nz(d), 1000, 6000) * np.linspace(1, .2, len(tt))) * np.sin(np.pi * tt / d)
+
+fx = np.zeros((N, 2)); vo = np.zeros((N, 2)); amb = np.zeros((N, 2))
+g = lambda e, k: e.get(k)
+for e in EV:
+ t, ty, gn, pan = e['t'], e['type'], e.get('gain', 1.0), e.get('pan', 0.0)
+ if ty == 'vo': continue
+ if ty == 'creak': add(fx, cardboard_creak(), t, .35 * gn, pan)
+ elif ty == 'box_thump': add(fx, cardboard_thump(e.get('pitch', 0)), t, .7, pan)
+ elif ty == 'box_fall': add(fx, box_fall(), t - .18, .55) # the slap lands on the beat
+ elif ty == 'ding': add(fx, ding(1), t, .35 * gn, .1)
+ elif ty == 'plastic_land': add(fx, plastic(.9, .2), t, .4)
+ elif ty == 'wood_tick': add(fx, wood_tick(), t, .25)
+ elif ty == 'pen_write': add(fx, pen_write(e.get('dur', .5)), t, .18, -.3)
+ elif ty == 'stamp': add(fx, stamp(), t, .75 * gn)
+ elif ty == 'whoosh': add(fx, whoosh(e.get('dur', .35), 1), t, .3 * gn)
+ elif ty == 'slide': add(fx, paper_swish(.25), t, .2 * gn, -.4)
+ elif ty == 'pop': add(fx, pop(1), t, .3 * gn, .3)
+ elif ty == 'scrape': add(fx, scrape(e.get('dur', .5)), t, .4 * gn, .1)
+ elif ty == 'plastic_thock': add(fx, plastic_thock(), t, .8, .2)
+ elif ty == 'plug_click': add(fx, plug_click(), t, .6, .35)
+ elif ty == 'flip': add(fx, paper_swish(.25), t, .25, .3)
+ elif ty == 'whistle': add(fx, slide_whistle(e.get('up', 0) == 1), t, .22, pan)
+ elif ty == 'tap': add(fx, soft_tap(), t, .55, .2)
+ elif ty == 'beep': add(fx, beep(e.get('n', 0)), t, .3, -.2 + .3 * e.get("n", 0))
+ elif ty == 'btn_soft': add(fx, btn_soft(), t, .5)
+ elif ty == 'hold': add(fx, hold_hiss(e.get('dur', .9)), t, .12)
+ elif ty == 'click_big': add(fx, click_big(), t, 1.0)
+ elif ty == 'motor': add(amb, motor(e.get('dur', 5)), t, .16)
+ elif ty == 'zone': add(fx, zone_swish(), t, .3, [-.4, 0, .4, 0][e.get('n', 0) % 4])
+ elif ty == 'dock': add(fx, dock_clunk(), t, .6, -.4)
+ elif ty == 'paper_swish': add(fx, paper_swish(.3), t, .35 * gn, .4)
+ elif ty == 'grab': add(fx, grab(), t, .4)
+ elif ty == 'peel': add(fx, peel(e.get('dur', 1)), t, .35)
+ elif ty == 'roll': add(fx, roll(e.get('dur', .45)), t, .25, .4)
+ elif ty == 'wood_block': add(fx, wood_block(), t, .6)
+ elif ty == 'iris': add(fx, iris(e.get('dur', .5)), t, .25)
+
+# ---------------- narration ----------------
+voice_env = np.zeros(N)
+for e in EV:
+ if e['type'] != 'vo': continue
+ y, sr = sf.read(os.path.join(D, 'voices', e['id'] + '.wav'))
+ if y.ndim > 1: y = y.mean(1)
+ y = librosa.resample(y, orig_sr=sr, target_sr=SR)
+ y = compress(norm(y, .9), thr=.3, ratio=3.0)
+ add(vo, y, e['t'], .85, 0)
+ s = int(e['t'] * SR); voice_env[s:s + len(y)] = 1
+
+# ---------------- ambience ----------------
+room = lp(brown(DUR), 900) * .018
+amb += np.stack([room, np.roll(room, 311)], 1)
+for k in range(int(DUR / (2 * BEAT))): # mantel clock, very quiet, on the half-note grid
+ t = k * 2 * BEAT
+ if 21.2 < t < 27.3: continue # the motor owns the payoff
+ add(amb, wood_tick(), t, .03, -.6)
+
+# ---------------- music + ducking ----------------
+mus, msr = sf.read(os.path.join(D, 'music', 'score.wav'))
+if msr != SR: mus = librosa.resample(mus.T, orig_sr=msr, target_sr=SR).T
+mus = mus[:N] if len(mus) >= N else np.pad(mus, ((0, N - len(mus)), (0, 0)))
+k = int(.12 * SR); sm = np.convolve(voice_env, np.ones(k) / k, 'same')
+duck = 1 - sm * (1 - 10 ** (-8 / 20))
+mus = mus * duck[:, None]
+
+# ---------------- silences ----------------
+def gate(buf, a, b, keep=0.0, fade=.03):
+ s, e = int(a * SR), int(b * SR); f = int(fade * SR)
+ m = np.ones(N); m[s:e] = keep
+ m[max(0, s - f):s] = np.linspace(1, keep, min(f, s)); m[e:e + f] = np.linspace(keep, 1, len(m[e:e + f]))
+ buf *= m[:, None]
+gate(amb, 20.909, 21.80) # B: true silence (the first sound after it is the button)
+gate(fx, 20.95, 21.80)
+gate(fx, 30.2, 30.905) # C: room tone only
+
+mix = mus * .9 + fx * .9 + vo + amb
+mix = limit(mix, .95)
+sf.write(os.path.join(D, 'mix.wav'), mix.astype(np.float32), SR)
+print('mix.wav', mix.shape, 'peak', float(np.abs(mix).max()))
diff --git a/styles/midcentury-toon/demo/music/CREDITS_music.txt b/styles/midcentury-toon/demo/music/CREDITS_music.txt
new file mode 100644
index 0000000..a67c89a
--- /dev/null
+++ b/styles/midcentury-toon/demo/music/CREDITS_music.txt
@@ -0,0 +1,3 @@
+Music: "Meet Pip" — original score, generated in code (midcentury-toon demo)
+Drums: "MuldjordKit" by Lars Muldjord (drumgizmo.org), FreePats version, licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
+Samples (CC0): Karoryfer Samples / sfzinstruments, VS Chamber Orchestra: Community Edition (Versilian Studios), Versilian Community Sample Library (Versilian Studios)
diff --git a/styles/midcentury-toon/demo/music/hits.json b/styles/midcentury-toon/demo/music/hits.json
new file mode 100644
index 0000000..25f0579
--- /dev/null
+++ b/styles/midcentury-toon/demo/music/hits.json
@@ -0,0 +1,122 @@
+{
+ "bpm": 132,
+ "beat": 0.45454545454545453,
+ "bar": 1.8181818181818181,
+ "duration": 40.0,
+ "silences": [
+ [
+ 0,
+ 1.364
+ ],
+ [
+ 20.909,
+ 21.818
+ ],
+ [
+ 30.2,
+ 30.909
+ ]
+ ],
+ "hits": [
+ {
+ "t": 1.3636,
+ "label": "hookB: vib gliss up + sus cymbal swell"
+ },
+ {
+ "t": 1.8182,
+ "label": "TA-DA full band F6/9"
+ },
+ {
+ "t": 2.7273,
+ "label": "woodblock"
+ },
+ {
+ "t": 3.6364,
+ "label": "brush swipe accent"
+ },
+ {
+ "t": 7.2727,
+ "label": "STEP 1 chord vib F6"
+ },
+ {
+ "t": 12.7273,
+ "label": "STEP 2 chord vib Bbmaj7"
+ },
+ {
+ "t": 15.4545,
+ "label": "celesta wifi C6"
+ },
+ {
+ "t": 15.9091,
+ "label": "celesta wifi E6"
+ },
+ {
+ "t": 16.3636,
+ "label": "celesta wifi G6"
+ },
+ {
+ "t": 18.1818,
+ "label": "STEP 3 chord vib C9"
+ },
+ {
+ "t": 20.4545,
+ "label": "key press: light vib single F#5"
+ },
+ {
+ "t": 21.8182,
+ "label": "CLIMAX full band G6/9 (key up a tone, double-time)"
+ },
+ {
+ "t": 23.6364,
+ "label": "arp1 living room"
+ },
+ {
+ "t": 24.5455,
+ "label": "arp2 hallway"
+ },
+ {
+ "t": 25.4545,
+ "label": "arp3 kitchen"
+ },
+ {
+ "t": 26.8182,
+ "label": "accent chord D13 + celesta ding (dock)"
+ },
+ {
+ "t": 27.0755,
+ "label": "vib gliss tail (L-cut into tips)"
+ },
+ {
+ "t": 27.2727,
+ "label": "TIPS half-time: flute solo + bass + woodblock"
+ },
+ {
+ "t": 30.9091,
+ "label": "recap step 1 G6"
+ },
+ {
+ "t": 31.3636,
+ "label": "recap step 2 Cmaj7"
+ },
+ {
+ "t": 31.8182,
+ "label": "recap step 3 D9"
+ },
+ {
+ "t": 32.2727,
+ "label": "full band closing phrase (G)"
+ },
+ {
+ "t": 34.5455,
+ "label": "final chord G6/9 (vib tremolo)"
+ },
+ {
+ "t": 36.3636,
+ "label": "BUTTON bass + celesta ding"
+ },
+ {
+ "t": 39.5,
+ "label": "fade to silence 39.5–40.0"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/styles/midcentury-toon/demo/music/score.py b/styles/midcentury-toon/demo/music/score.py
new file mode 100644
index 0000000..4940e03
--- /dev/null
+++ b/styles/midcentury-toon/demo/music/score.py
@@ -0,0 +1,412 @@
+"""《Meet Pip》配乐 —— 50 年代西海岸冷爵士小乐队(原创)
+颤音琴(主角)/ 长笛(旋律)/ 低音提琴拨弦 / 刷子鼓 + ride / 钢片琴(钟琴弱奏 + 正弦分音合成)
+132 BPM,4/4,40.000 s = 22 小节,F 大调 → 高点起 G 大调。
+在仓库根运行:.venv/bin/python styles/midcentury-toon/demo/music/score.py
+"""
+import sys, os, json
+sys.path.insert(0, '.')
+import numpy as np, soundfile as sf
+from scipy.signal import butter, sosfilt
+from core.audio import sampler as S
+from core.audio.sfx import SR, add
+
+OUT = os.path.dirname(os.path.abspath(__file__))
+S.seed(48)
+rng = np.random.default_rng(48)
+
+B = 60 / 132 # 1 拍
+BAR = 4 * B
+DUR = 40.0
+N = int(round(DUR * SR))
+SW = 0.60 # 摇摆八分:反拍落在拍内 60%
+
+
+def T(bar, beat=0.0, swing=SW):
+ """bar 从 1 数,beat 从 0 数(可小数);x.5 的反拍自动摇摆"""
+ whole = np.floor(beat + 1e-9); frac = beat - whole
+ if abs(frac - .5) < 1e-6: frac = swing
+ return (bar - 1) * BAR + (whole + frac) * B
+
+
+def M(p): return S.midi(p) if isinstance(p, str) else p
+
+
+stems = {k: np.zeros((N, 2), np.float32) for k in ('drums', 'bass', 'vib', 'lead')}
+hits = []
+def hit(t, label): hits.append(dict(t=round(float(t), 4), label=label))
+def jit(ms=6): return float(rng.uniform(-ms, ms)) / 1000
+
+
+# ---------------------------------------------------------------- 乐器封装
+def bp(x, lo, hi, o=2): return sosfilt(butter(o, [lo, hi], 'band', fs=SR, output='sos'), x)
+def lpf(x, f, o=2): return sosfilt(butter(o, f, 'low', fs=SR, output='sos'), x)
+
+
+def motor(x, rate=5.2, depth=.32, t0=0.0):
+ """颤音琴马达震音:振幅调制"""
+ t = np.arange(len(x)) / SR + t0
+ return x * (1 - depth * (.5 + .5 * np.sin(2 * np.pi * rate * t))).astype(np.float32)
+
+
+def vib(t, pitches, dur, vel=.5, pan=-.25, hard=False, trem=0.0, gain=1.0):
+ inst = 'vibraphone_hard' if hard else 'vibraphone'
+ for i, p in enumerate(pitches if isinstance(pitches, (list, tuple)) else [pitches]):
+ x = S.note(inst, M(p), dur, vel=vel)
+ if trem: x = motor(x, depth=trem, t0=i * .013)
+ add(stems['vib'], x, t, gain, pan + (i - 1.5) * .08)
+
+
+def vib_run(t0, pitches, step, vel0=.35, vel1=.6, pan=-.2, ring=1.2, gain=1.0):
+ """刮奏 / 琶音:逐音起,力度线性变化"""
+ n = len(pitches)
+ for i, p in enumerate(pitches):
+ v = vel0 + (vel1 - vel0) * i / max(1, n - 1)
+ add(stems['vib'], S.note('vibraphone_hard', M(p), ring, vel=v), t0 + i * step, gain, pan + .5 * i / n - .25)
+
+
+def flute(t, p, beats, vel=.55, stac=False, pan=.2, gain=1.0):
+ if stac and M(p) >= 69:
+ x = S.note('flute_stac', M(p), .2, vel=vel)
+ else:
+ x = S.note('flute', M(p), max(.12, beats * B * .92), vel=vel, release=.09)
+ add(stems['lead'], x, t - .02, gain, pan)
+
+
+def celesta(t, p, vel=.5, pan=.4, gain=1.0):
+ """钢片琴:钟琴弱奏(亮起音)+ 正弦分音合成(温暖的钢片泛音)"""
+ g = S.note('glockenspiel', M(p), 2.0, vel=min(.5, vel * .7))
+ f = S.hz(M(p)); d = 1.6; tt = np.arange(int(d * SR)) / SR
+ s = (np.sin(2 * np.pi * f * tt) * np.exp(-tt / .55) + .35 * np.sin(2 * np.pi * 2 * f * tt) * np.exp(-tt / .18)
+ + .12 * np.sin(2 * np.pi * 4.03 * f * tt) * np.exp(-tt / .05))
+ s *= np.minimum(1, tt / .002)
+ x = np.zeros(max(len(g), len(s)), np.float32); x[:len(g)] += g * .6; x[:len(s)] += (s * .22 * vel).astype(np.float32)
+ add(stems['lead'], x, t, gain, pan)
+
+
+def bass(t, p, beats=.9, vel=.6, gain=1.0):
+ add(stems['bass'], S.note('jazz_bass', M(p), max(.1, beats * B), vel=vel, release=.08), t - .015, gain, 0)
+
+
+def dk(t, var, vel, dur=None, pan=.3, gain=1.0):
+ add(stems['drums'], S.hit('drum_kit', var, vel, dur), t, gain, pan)
+
+
+def brush_tap(t, v=.5, pan=-.1):
+ d = .16; tt = np.arange(int(d * SR)) / SR
+ n = rng.standard_normal(len(tt))
+ x = bp(n, 1500, 9000) * np.exp(-tt / .045) + .5 * bp(n, 300, 1200) * np.exp(-tt / .02)
+ x += .25 * np.sin(2 * np.pi * 190 * tt) * np.exp(-tt / .03)
+ add(stems['drums'], (x / 3.2 * v).astype(np.float32), t, 1, pan)
+
+
+def brush_sweep(t, d, v=.3, pan=-.15, shape='arc'):
+ tt = np.arange(int(d * SR)) / SR
+ n = rng.standard_normal(len(tt))
+ x = bp(n, 1800, 7500) + .35 * bp(n, 500, 1800)
+ if shape == 'arc':
+ env = np.sin(np.pi * tt / d) ** 1.5
+ else: # 'hit':一抹重音,快起慢收
+ env = np.minimum(1, tt / .012) * np.exp(-tt / (d * .35))
+ add(stems['drums'], (x * env / 4 * v).astype(np.float32), t, 1, pan)
+
+
+def brushes(bar0, bar1, v=.3, taps=True, swirl=True, pedal=True):
+ """刷子:左手画圈(每 2 拍一圈)+ 2、4 拍点击 + 踩镲踏 2、4"""
+ for bar in range(bar0, bar1):
+ for h in (0, 2):
+ if swirl: brush_sweep(T(bar, h) + jit(4), 2 * B * 1.05, v * .8)
+ for bt in (1, 3):
+ if taps: brush_tap(T(bar, bt) + jit(4), v * 1.25)
+ if pedal: add(stems['drums'], S.hit('hihat', 'pedal', .35 * v / .3, .3), T(bar, bt) + .004, .45, .45)
+
+
+def ride(bar0, bar1, vel=.3, stick=False, eighths=False):
+ for bar in range(bar0, bar1):
+ pat = [0, .5, 1, 1.5, 2, 2.5, 3, 3.5] if eighths else [0, 1, 1.5, 2, 3, 3.5]
+ for b in pat:
+ acc = 1.0 if b in (1, 3) or (eighths and b == int(b)) else .7
+ if stick: sw = .56
+ else: sw = SW
+ dk(T(bar, b, sw) + jit(4), 'ride_right', vel * acc, dur=1.4, pan=.35, gain=.55 if not stick else .6)
+
+
+# ---------------------------------------------------------------- 和声(颤音琴 voicing / 贝斯根音)
+V = {
+ 'F6': ['A3', 'C4', 'D4', 'F4'],
+ 'F69': ['F3', 'A3', 'D4', 'G4', 'C5'],
+ 'Dm9': ['F3', 'A3', 'C4', 'E4'],
+ 'G13': ['F3', 'B3', 'E4'],
+ 'Gm7': ['F3', 'Bb3', 'D4'],
+ 'C13': ['Bb3', 'E4', 'A4'],
+ 'Bbmaj7': ['Bb3', 'D4', 'F4', 'A4'],
+ 'Am7': ['G3', 'C4', 'E4'],
+ 'C6': ['E4', 'G4', 'A4', 'C5'],
+ 'Bbm6': ['Db4', 'F4', 'G4', 'Bb4'],
+ 'C9': ['Bb3', 'D4', 'E4', 'G4'],
+ # G 大调
+ 'G69': ['G3', 'B3', 'E4', 'A4', 'D5'],
+ 'G6': ['B3', 'D4', 'E4', 'G4'],
+ 'Em9': ['G3', 'B3', 'D4', 'F#4'],
+ 'A13': ['G3', 'C#4', 'F#4'],
+ 'Am7g': ['G3', 'C4', 'E4'],
+ 'D13': ['F#3', 'C4', 'E4', 'B4'],
+ 'Cmaj7': ['C4', 'E4', 'G4', 'B4'],
+ 'D9': ['F#3', 'C4', 'E4', 'A4'],
+ 'Gmaj7': ['F#3', 'B3', 'D4', 'G4'],
+}
+
+
+def comp(bar, chord, vel=.32, charleston=True, second=None):
+ """颤音琴伴奏:拍 1 长 + 第 2 拍反拍短(Charleston)"""
+ vib(T(bar, 0) + jit(3), V[chord], 1.4 * B, vel)
+ if charleston: vib(T(bar, 1.5) + jit(3), V[second or chord], .6 * B, vel * .8)
+
+
+# ================================================================ 钩子 A 0–1.364:完全静音
+# ================================================================ 钩子 B 1.364:颤音琴上行刮奏 + 吊镲渐强
+g0 = T(1, 3)
+hit(g0, 'hookB: vib gliss up + sus cymbal swell')
+gl = ['C4', 'D4', 'F4', 'G4', 'A4', 'C5', 'D5', 'F5', 'G5', 'A5', 'C6']
+vib_run(g0, gl, (T(2, 0) - g0 - .03) / len(gl), .25, .6, ring=1.0)
+cr = S.hit('sus_cymbal', 'roll', .6)
+seg = int((T(2, 0) - g0) * SR); cr = cr[:seg] * np.linspace(0, 1, seg) ** 2.2
+add(stems['drums'], cr.astype(np.float32), g0, .9, .25)
+
+# ================================================================ 1.818 全乐队 ta-da F6/9
+t = T(2, 0); hit(t, 'TA-DA full band F6/9')
+vib(t, V['F69'], 2.2 * B, .72, hard=True, trem=.3)
+vib(t, ['A5'], 2.2 * B, .5, hard=True)
+bass(t, 'F1', 1.8, .85)
+flute(t, 'A5', .5, .6, stac=True)
+celesta(t, 'F6', .7)
+dk(t, 'crash_right', .55, dur=2.6, pan=.35, gain=.6)
+dk(t, 'kick_drum_left', .45, pan=0, gain=.6)
+brush_tap(t, .8)
+
+# ---------------- 主题 A(bars 2–4 + 落 bar 5)F 大调 —— 原创
+THEME_A = [ # (bar 偏移, 拍, 音, 拍长, stac)
+ (0, 1.0, 'A4', .5, 0), (0, 1.5, 'C5', .5, 0), (0, 2.0, 'F5', 1.0, 0), (0, 3.0, 'E5', .5, 1), (0, 3.5, 'D5', .5, 0),
+ (1, 0.0, 'C5', 1.5, 0), (1, 1.5, 'A4', .5, 0), (1, 2.0, 'B4', .5, 1), (1, 2.5, 'D5', .5, 0), (1, 3.0, 'G5', 1.0, 0),
+ (2, 0.0, 'F5', .5, 1), (2, 0.5, 'D5', .5, 0), (2, 1.0, 'Bb4', 1.0, 0), (2, 2.5, 'E5', .5, 0), (2, 3.0, 'G5', .5, 1), (2, 3.5, 'Bb5', .5, 0),
+ (3, 0.0, 'A5', 2.0, 0),
+]
+for bo, bt, p, ln, st in THEME_A:
+ t = T(2 + bo, bt)
+ if bo == 0 and bt == 1.0: continue # ta-da 后第一拍留给旁白起句,主题从第 2 拍反拍起
+ in_vo = 1.98 < t < 4.3
+ flute(t + jit(4), p, ln, .40 if in_vo else .52, stac=bool(st))
+# 旁白 1.98–4.3:颤音琴只落拍 1,贝斯行走
+comp(3, 'Dm9', .24, charleston=False); vib(T(3, 2), V['G13'], 1.2 * B, .22)
+comp(4, 'Gm7', .28, second='Gm7'); vib(T(4, 2), V['C13'], 1.2 * B, .28)
+t = T(2, 2); hit(t, 'woodblock'); add(stems['drums'], S.hit('woodblock', 'b', .55), t, .8, -.35)
+t = T(3, 0); hit(t, 'brush swipe accent'); brush_sweep(t, .55, 1.0, shape='hit'); brush_tap(t, 1.0)
+dk(t, 'kick_drum_left', .3, pan=0, gain=.5)
+brushes(2, 5, .3)
+ride(2, 5, .22)
+
+WALK = { # 每小节 4 个四分音符
+ 2: ['F2', 'A2', 'C3', 'C#3'], 3: ['D3', 'A2', 'G2', 'B2'], 4: ['G2', 'D2', 'C2', 'E2'],
+ 5: ['F2', 'A2', 'C3', 'D3'], 6: ['D3', 'C3', 'B2', 'G2'], 7: ['G2', 'Bb2', 'C3', 'A2'],
+ 8: ['Bb2', 'D3', 'F2', 'G#2'], 9: ['A2', 'E2', 'C2', 'F#2'], 10: ['G2', 'D2', 'Bb1', 'B1'],
+}
+for bar, ns in WALK.items():
+ for i, p in enumerate(ns):
+ if bar == 2 and i == 0: continue # ta-da 已放
+ bass(T(bar, i) + jit(4), p, .88, .62 if i == 0 else .55)
+
+# ================================================================ 第 1 步 7.273:颤音琴 F6
+t = T(5, 0); hit(t, 'STEP 1 chord vib F6')
+vib(t, V['F6'] + ['A4'], 3.0 * B, .62, trem=.28)
+# 主题 A'(轻):长笛高处接住,颤音琴在空档答句
+A2 = [
+ (0, 2.5, 'G5', .5, 0), (0, 3.0, 'F5', .5, 1), (0, 3.5, 'D5', .5, 0),
+ (1, 0.0, 'C5', 1.0, 0), (1, 1.5, 'D5', .5, 0), (1, 2.0, 'F5', .5, 1), (1, 2.5, 'A5', 1.5, 0),
+ (2, 0.0, 'G5', 1.5, 0), (2, 2.0, 'E5', .5, 1), (2, 2.5, 'C5', .5, 0), (2, 3.0, 'Bb4', .5, 0), (2, 3.5, 'C5', .5, 0),
+]
+for bo, bt, p, ln, st in A2:
+ flute(T(5 + bo, bt) + jit(4), p, ln, .42, stac=bool(st))
+comp(6, 'Dm9', .26, second='Dm9'); vib(T(6, 2), V['G13'], 1.2 * B, .24)
+comp(7, 'Gm7', .26, second='Gm7'); vib(T(7, 2), V['C13'], 1.2 * B, .26)
+vib_run(T(7, 3.5), ['C5', 'D5', 'E5'], B / 4, .22, .3, ring=.8) # 小答句推向第 2 步
+brushes(5, 8, .22, pedal=True)
+ride(6, 8, .16)
+
+# ================================================================ 第 2 步 12.727:颤音琴 B♭maj7,主题 B(上行问句)
+t = T(8, 0); hit(t, 'STEP 2 chord vib Bbmaj7')
+vib(t, V['Bbmaj7'] + ['D5'], 3.0 * B, .62, trem=.28)
+dk(t, 'kick_drum_left', .25, pan=0, gain=.45)
+THEME_B = [
+ (0, 0.5, 'D5', .5, 0), (0, 1.0, 'F5', .5, 1), (0, 1.5, 'A5', 1.0, 0), (0, 2.5, 'G5', .5, 0), (0, 3.0, 'F5', .5, 1), (0, 3.5, 'A5', .5, 0),
+ (1, 0.0, 'C6', 1.5, 0), (1, 1.5, 'B5', .5, 0),
+ (2, 0.5, 'D5', .5, 0), (2, 1.0, 'E5', .5, 1), (2, 1.5, 'G5', .5, 0), (2, 2.0, 'Bb5', 1.0, 0), (2, 3.0, 'C6', .5, 1), (2, 3.5, 'D6', 2.2, 0),
+]
+for bo, bt, p, ln, st in THEME_B:
+ flute(T(8 + bo, bt) + jit(4), p, ln, .5, stac=bool(st))
+comp(9, 'Am7', .28, charleston=False); vib(T(9, 2), V['C6'], 1.0 * B, .22)
+comp(10, 'Gm7', .28, charleston=False); vib(T(10, 2), V['Bbm6'], 1.6 * B, .3)
+# Wi-Fi 三声:钢片琴递升
+for tt, p in ((15.4545, 'C6'), (15.9091, 'E6'), (16.3636, 'G6')):
+ hit(tt, f'celesta wifi {p}'); celesta(tt, p, .6)
+brushes(8, 11, .28)
+ride(8, 11, .24)
+add(stems['drums'], S.hit('snare2', 'taps', .25, .5), T(10, 3.5), .5, -.1)
+
+# ================================================================ 第 3 步 18.182:颤音琴 C9,贝斯半音爬升,只剩 ride
+t = T(11, 0); hit(t, 'STEP 3 chord vib C9')
+vib(t, V['C9'], 4.0 * B, .72, trem=.3)
+for i, p in enumerate(['C2', 'C#2', 'D2', 'D#2', 'E2']):
+ bass(T(11 + i // 4, i % 4), p, .7, .5 + .05 * i)
+for b in [0, 1, 1.5, 2, 3, 3.5]:
+ dk(T(11, b), 'ride_right', .24 if b in (1, 3) else .17, dur=.6, pan=.35, gain=.5)
+for b in [0, 1, 1.5]:
+ dk(T(12, b), 'ride_right', .22 if b == 1 else .16, dur=.45, pan=.35, gain=.5)
+t = T(12, 1); hit(t, 'key press: light vib single F#5')
+vib(t, 'F#5', .5, .22)
+
+# ================================================================ 静音 B 20.909–21.818(掩码保证)
+# ================================================================ 高点 21.818:G 大调强奏、双倍时值
+t = T(13, 0); hit(t, 'CLIMAX full band G6/9 (key up a tone, double-time)')
+vib(t, V['G69'], 2.0 * B, .8, hard=True, trem=.3); vib(t, ['B5'], 2.0 * B, .55, hard=True)
+bass(t, 'G1', 1.0, .9)
+dk(t, 'crash_right', .75, dur=3.0, pan=.35, gain=.7)
+dk(t, 'kick_drum_left', .6, pan=0, gain=.7)
+celesta(t, 'D6', .6)
+# 长笛主题 A 高八度(+14 半音 = 升全音再高八度),第 3 小节改写成落到 26.818 的重音
+CLIMAX = [(bo, bt, S.midi(p) + 14, ln, st) for bo, bt, p, ln, st in THEME_A if bo < 2]
+CLIMAX += [(2, 0.0, 'G6', .5, 1), (2, 0.5, 'E6', .5, 0), (2, 1.0, 'C6', 1.0, 0), (2, 2.5, 'F#6', .5, 0), (2, 3.0, 'A6', 1.0, 0)]
+for bo, bt, p, ln, st in CLIMAX:
+ flute(T(13 + bo, bt, .56) + jit(3), p, ln, .62, stac=bool(st))
+# 伴奏
+comp(13, 'G69', .36, second='G6')
+vib(T(14, 0), V['Em9'], .9 * B, .34); vib(T(14, 2), V['A13'], .9 * B, .34)
+vib(T(15, 0), V['Am7g'], .9 * B, .34); vib(T(15, 2), V['D13'], .6 * B, .3)
+# 三次上行琶音(客厅 / 走廊 / 厨房),一次比一次高
+ARPS = [(T(14, 0), ['E4', 'G4', 'B4', 'D5', 'E5', 'G5'], 'arp1 living room'),
+ (T(14, 2), ['A4', 'C#5', 'E5', 'G5', 'A5', 'C#6'], 'arp2 hallway'),
+ (T(15, 0), ['C5', 'E5', 'G5', 'A5', 'C6', 'E6'], 'arp3 kitchen')]
+for i, (t, ps, lab) in enumerate(ARPS):
+ hit(t, lab); vib_run(t, ps, B / 4, .45 + .08 * i, .7 + .08 * i, pan=-.3, ring=1.1)
+# 26.818 重音 + 钢片琴叮(回充电座)
+t = T(15, 3); hit(t, 'accent chord D13 + celesta ding (dock)')
+vib(t, V['D13'], 1.0 * B, .75, hard=True)
+celesta(t, 'A6', .8); celesta(t + .003, 'D6', .45)
+dk(t, 'crash_right', .5, dur=2.0, pan=.4, gain=.55); dk(t, 'snare_2', .55, pan=.05, gain=.55); dk(t, 'kick_drum_left', .55, pan=0, gain=.6)
+bass(t, 'D2', 1.0, .8)
+# 刮奏尾巴拖进 27.273 之后(L-cut)
+gl2 = ['D5', 'E5', 'G5', 'A5', 'B5', 'D6', 'E6']
+vib_run(T(15, 3.5, .5) + .03, gl2, .052, .45, .3, pan=-.1, ring=1.6)
+hit(T(15, 3.5, .5) + .03, 'vib gliss tail (L-cut into tips)')
+# 贝斯八分音符(双倍时值)
+def eighths(bar, half, root, fifth, nxt):
+ r, f = M(root), M(fifth)
+ for i, p in enumerate([r, r + 12, f, M(nxt) - 1]):
+ bass(T(bar, half + i * .5, .56) + jit(3), p, .45, .62 if i == 0 else .5)
+for bar, half, r, f, nx in [(13, 0, 'G2', 'D3', 'G2'), (13, 2, 'G2', 'D3', 'E2'), (14, 0, 'E2', 'B2', 'A2'),
+ (14, 2, 'A2', 'E2', 'A2'), (15, 0, 'A2', 'E2', 'D2')]:
+ if (bar, half) == (13, 0):
+ for i, p in enumerate([None, M('G2'), M('D3'), M('G2') - 1]):
+ if p: bass(T(13, i * .5, .56), p, .45, .5)
+ else:
+ eighths(bar, half, r, f, nx)
+for i, p in enumerate(['D2', 'A2']): bass(T(15, 2 + i * .5, .56), p, .45, .55)
+bass(T(15, 3.5, .56), 'F#2', .45, .5)
+# 鼓:ride 鼓棒八分、军鼓 2/4、踩镲踏、底鼓
+ride(13, 16, .5, stick=True, eighths=True)
+for bar in (13, 14, 15):
+ for bt in (1, 3):
+ if (bar, bt) == (15, 3): continue
+ dk(T(bar, bt) + jit(3), 'snare_2', .38, pan=.05, gain=.45)
+ add(stems['drums'], S.hit('hihat', 'pedal', .5, .3), T(bar, bt), .45, .45)
+ for bt in (0, 2):
+ if (bar, bt) != (13, 0): dk(T(bar, bt), 'kick_drum_left', .3, pan=0, gain=.45)
+ dk(T(bar, 2.5, .56), 'snare_2', .18, pan=.05, gain=.4)
+
+# ================================================================ 贴士 27.273–30.2:半速感(长笛独句 + 贝斯 + 木鱼)
+t = T(16, 0); hit(t, 'TIPS half-time: flute solo + bass + woodblock')
+for tt, p, ln in [(T(16, 0), 'G2', 1.9), (T(16, 2), 'E2', 1.9), (T(17, 0), 'C2', 1.0), (T(17, 1), 'D2', 1.5)]:
+ bass(tt, p, ln, .55)
+for tt, v in [(T(16, 0), 'b'), (T(16, 2), 'c'), (T(17, 0), 'b')]:
+ add(stems['drums'], S.hit('woodblock', v, .4), tt, .6, -.35)
+for tt, p, ln, v in [(T(16, 1), 'D5', 1.4, .34), (T(16, 2.5), 'E5', .5, .3), (T(16, 3), 'G5', 1.5, .34),
+ (T(17, .5), 'F#5', .5, .3), (T(17, 1), 'D5', 1.6, .3)]:
+ flute(tt, p, ln, v)
+vib(T(16, 0), V['Gmaj7'], 2 * B, .16); vib(T(17, 0), V['Cmaj7'], 2 * B, .14)
+
+# ================================================================ 近乎静音 C 30.2–30.909(掩码)
+# ================================================================ 落版:三步和弦按拍重现(G6 / Cmaj7 / D9)
+for i, (bt, ch, bp_) in enumerate([(0, 'G6', 'G2'), (1, 'Cmaj7', 'C3'), (2, 'D9', 'D2')]):
+ t = T(18, bt); hit(t, f'recap step {i + 1} {ch}')
+ vib(t, V[ch], .42 * B, .62, hard=True); bass(t, bp_, .4, .75)
+# 32.273 全乐队主题 A 收尾句(G 大调)
+t = T(18, 3); hit(t, 'full band closing phrase (G)')
+CLOSE = [(18, 3.0, 'B4', .5, 0), (18, 3.5, 'D5', .5, 0),
+ (19, 0.0, 'G5', 1.0, 0), (19, 1.0, 'F#5', .5, 1), (19, 1.5, 'E5', .5, 0), (19, 2.0, 'D5', .5, 1), (19, 2.5, 'C5', .5, 0),
+ (19, 3.0, 'D5', .5, 1), (19, 3.5, 'F#5', .5, 0), (20, 0.0, 'A5', 3.6, 0)]
+for bar, bt, p, ln, st in CLOSE:
+ flute(T(bar, bt) + (0 if (bar, bt) == (20, 0) else jit(3)), p, ln, .45 if bar < 20 else .5, stac=bool(st))
+for i, p in enumerate(['G#2']): bass(T(18, 3), p, .88, .55)
+for i, p in enumerate(['A2', 'E2', 'D2', 'F#2']): bass(T(19, i) + jit(3), p, .88, .55)
+comp(19, 'Am7g', .26, charleston=False); vib(T(19, 2), V['D13'], 1.2 * B, .26)
+brushes(19, 20, .26); brush_tap(T(18, 3), .5)
+ride(19, 20, .2)
+# 34.545 最后和弦 G6/9:颤音琴震音延音
+t = T(20, 0); hit(t, 'final chord G6/9 (vib tremolo)')
+vib(t, V['G69'], 4 * B, .6, trem=.4)
+bass(t, 'G1', 3.5, .7)
+add(stems['drums'], S.hit('sus_cymbal', 'hit', .35), t, .5, .3)
+dk(t, 'kick_drum_left', .3, pan=0, gain=.45)
+# 震音:软槌轻滚(每拍两下,越来越轻)
+for k in range(1, 7):
+ vib(t + k * B / 2, ['B4', 'E5'], .5 * B, .2 - .02 * k, trem=.4, gain=.7)
+
+# ================================================================ 结尾卡 36.364:button
+t = T(21, 0); hit(t, 'BUTTON bass + celesta ding')
+bass(t, 'G1', .5, .9); celesta(t, 'G6', .75); celesta(t + .002, 'D6', .35)
+brush_tap(t, .7); dk(t, 'kick_drum_left', .35, pan=0, gain=.5)
+vib(t, ['B3', 'D4', 'E4', 'A4', 'G4'], 3.6, .34, trem=.35)
+hit(39.5, 'fade to silence 39.5–40.0')
+
+# ---------------------------------------------------------------- 混响、静音掩码、总线
+ROOM = dict(drums=(.3, .1), bass=(.22, .06), vib=(.45, .2), lead=(.4, .18))
+GAIN = dict(drums=.9, bass=1.05, vib=.95, lead=.85)
+for k in stems:
+ stems[k] = S.room(stems[k] * GAIN[k], size=ROOM[k][0], mix=ROOM[k][1]).astype(np.float32)
+
+tt = np.arange(N) / SR
+mask = np.ones(N)
+def cos_fade(a, b): # a→b 从 1 落到 0
+ s = (tt >= a) & (tt < b); mask[s] *= .5 + .5 * np.cos(np.pi * (tt[s] - a) / (b - a))
+mask[tt < 1.364] = 0
+cos_fade(20.70, 20.895); mask[(tt >= 20.895) & (tt < 21.818)] = 0
+cos_fade(29.98, 30.19); mask[(tt >= 30.19) & (tt < 30.909)] = 0
+cos_fade(39.5, 40.0)
+for k in stems: stems[k] *= mask[:, None].astype(np.float32)
+
+mix = sum(stems.values())
+# 总线限幅:算一条增益曲线,同时作用到 stems(stems 相加 = 成品)
+from scipy.ndimage import maximum_filter1d, uniform_filter1d
+ceil = 10 ** (-1.3 / 20)
+pk = np.abs(mix).max(axis=1)
+target = pk.max()
+pre = min(1.0, .98 / max(np.percentile(pk[pk > 0], 99.9), 1e-9)) # 先整体抬到合适电平
+pk *= pre
+n = int(.005 * SR)
+g = np.minimum(1, ceil / np.maximum(maximum_filter1d(pk, 2 * n + 1), 1e-9))
+g = uniform_filter1d(g, n) * pre
+g = np.minimum(g, ceil / np.maximum(np.abs(mix).max(axis=1), 1e-9))
+print('limiter min gain dB', 20 * np.log10(g.min()), 'pct<-3dB', (g < .708).mean())
+for k in stems: stems[k] *= g[:, None].astype(np.float32)
+mix = sum(stems.values())
+
+os.makedirs(f'{OUT}/stems', exist_ok=True)
+sf.write(f'{OUT}/score.wav', mix.astype(np.float32), SR, subtype='PCM_24')
+for k, x in stems.items():
+ sf.write(f'{OUT}/stems/{k}.wav', x.astype(np.float32), SR, subtype='PCM_24')
+hits.sort(key=lambda h: h['t'])
+json.dump(dict(bpm=132, beat=B, bar=BAR, duration=DUR, silences=[[0, 1.364], [20.909, 21.818], [30.2, 30.909]], hits=hits),
+ open(f'{OUT}/hits.json', 'w'), ensure_ascii=False, indent=1)
+used = ['vibraphone', 'vibraphone_hard', 'flute', 'flute_stac', 'jazz_bass', 'drum_kit', 'hihat', 'sus_cymbal',
+ 'woodblock', 'snare2', 'glockenspiel']
+open(f'{OUT}/CREDITS_music.txt', 'w').write(
+ 'Music: "Meet Pip" — original score, generated in code (midcentury-toon demo)\n' + '\n'.join(S.credits(used)) + '\n')
+print('done', mix.shape, 'peak dBFS', 20 * np.log10(np.abs(mix).max()))
diff --git a/styles/midcentury-toon/demo/sheet.js b/styles/midcentury-toon/demo/sheet.js
new file mode 100644
index 0000000..cdccd4b
--- /dev/null
+++ b/styles/midcentury-toon/demo/sheet.js
@@ -0,0 +1,60 @@
+// Model sheet: the owner (June) + the product (Pip). Rendered with ?test=sheet
+import { PAL, setClock, shape, ink, ellipse, rrect, rect, text, star, sparkle, paperFinish, plane } from './engine/toon.js';
+import { drawOwner, drawPip, drawDock, drawHand } from './engine/chars.js';
+
+export function drawSheet(ctx, t, C) {
+ setClock(0.25);
+ const W = 1920, H = 1080;
+ ctx.fillStyle = PAL.paper; ctx.fillRect(0, 0, W, H);
+ // header
+ text(ctx, 'Model Sheet', 60, 92, { font: '700 64px Oleo', fill: PAL.ink, plate: PAL.mustard, off: [4, 3] });
+ text(ctx, 'JUNE, THE NEW HOMEOWNER · PIP, THE PRODUCT', 420, 84, { font: '600 24px Jost', fill: PAL.inkSoft, track: 5 });
+ ink(ctx, [[60, 118], [1860, 118]], 3, { breaks: 0.2, seed: 2 });
+ // turnaround
+ plane(ctx, rrect(40, 140, 1000, 560, 20), PAL.blueL, { off: [0, 0], grain: 0.2 });
+ text(ctx, 'TURNAROUND', 70, 180, { font: '600 22px Jost', fill: PAL.ink, track: 5 });
+ const views = [['front', 1, 'FRONT'], ['q', 1, '3/4'], ['side', 1, 'PROFILE'], ['back', 1, 'BACK']];
+ views.forEach(([v, d, lab], i) => {
+ const x = 170 + i * 240;
+ ink(ctx, [[x - 110, 660], [x + 110, 660]], 2.5, { seed: 5 + i, breaks: 0.3 });
+ drawOwner(ctx, { x, y: 660, s: 0.78, dir: d, view: v, face: 'neutral' }, 0);
+ text(ctx, lab, x, 690, { font: '500 20px Jost', fill: PAL.inkSoft, align: 'center', track: 4 });
+ });
+ // height guides
+ [[660, 'feet'], [660 - 0.78 * 600, 'top']].forEach(([y], i) => ink(ctx, [[62, y], [1020, y]], 1.4, { seed: 9 + i, breaks: 0.6, alpha: 0.35 }));
+ // expressions (head crops)
+ plane(ctx, rrect(1060, 140, 820, 300, 20), PAL.pink, { off: [0, 0], grain: 0.2 });
+ text(ctx, 'EXPRESSIONS', 1090, 180, { font: '600 22px Jost', fill: PAL.ink, track: 5 });
+ [['neutral', 'NEUTRAL'], ['happy', 'DELIGHTED'], ['wow', 'SURPRISED'], ['focus', 'FOCUSED'], ['wink', 'KNOWING']].forEach(([f, lab], i) => {
+ const cx = 1150 + i * 160, cy = 300;
+ ctx.save(); ctx.beginPath(); ctx.arc(cx, cy, 70, 0, Math.PI * 2); ctx.fillStyle = PAL.white; ctx.fill(); ctx.clip();
+ drawOwner(ctx, { x: cx - 20, y: cy + 470, s: 0.98, view: 'q', face: f, dir: 1 }, 0);
+ ctx.restore();
+ ink(ctx, ellipse(cx, cy, 70, 70, 40), 3, { closed: true, seed: 20 + i, breaks: 0.2 });
+ text(ctx, lab, cx, cy + 108, { font: '500 18px Jost', fill: PAL.ink, align: 'center', track: 3 });
+ });
+ // key poses (limited animation: body held, only arms / hands / face change)
+ plane(ctx, rrect(1060, 460, 820, 580, 20), PAL.mustardL, { off: [0, 0], grain: 0.2 });
+ text(ctx, 'KEY POSES · body held, arms + face on twos', 1090, 500, { font: '600 22px Jost', fill: PAL.ink, track: 3 });
+ const py = 990;
+ drawOwner(ctx, { x: 1170, y: py, s: 0.66, view: 'q', face: 'happy', armB: { a1: -2.2, a2: -2.0 }, armF: { a1: -0.9, a2: -1.2 } }, 0);
+ drawOwner(ctx, { x: 1370, y: py, s: 0.66, view: 'q', face: 'focus', armF: { a1: 1.0, a2: -0.6 }, armB: { a1: 1.9, a2: 1.7 }, handF: 'grip', look: [4, 6], prop: { kind: 'phone', rot: -0.15 } }, 0);
+ drawOwner(ctx, { x: 1570, y: py, s: 0.66, view: 'q', face: 'focus', armF: { a1: 0.55, a2: 0.35 }, armB: { a1: 0.9, a2: 0.5 }, handF: 'flat', handB: 'flat' }, 0);
+ drawOwner(ctx, { x: 1770, y: py, s: 0.66, view: 'q', face: 'wink', armF: { a1: -0.25, a2: -1.25 }, armB: { a1: 1.86, a2: 1.7 }, handF: 'point' }, 0);
+ ['TA-DA', 'TAP', 'PUSH', 'TIP!'].forEach((l, i) => text(ctx, l, 1170 + i * 200, 1025, { font: '500 18px Jost', fill: PAL.inkSoft, align: 'center', track: 4 }));
+ // hands (four-finger UPA glove)
+ ['open', 'flat', 'point', 'grip'].forEach((k, i) => { drawHand(ctx, 1500 + i * 95, 560, -0.5, k, 1, 1.6); });
+ text(ctx, 'HANDS', 1640, 620, { font: '500 16px Jost', fill: PAL.inkSoft, align: 'center', track: 4 });
+ // Pip
+ plane(ctx, rrect(40, 720, 1000, 320, 20), PAL.avocadoL, { off: [0, 0], grain: 0.2 });
+ text(ctx, 'PIP · THE PRODUCT', 70, 760, { font: '600 22px Jost', fill: PAL.ink, track: 5 });
+ drawPip(ctx, 220, 960, { s: 0.9, light: 0 });
+ drawPip(ctx, 500, 960, { s: 0.9, light: 1, press: 1 });
+ drawPip(ctx, 760, 900, { view: 'top', s: 0.72, ang: -Math.PI / 2 });
+ drawDock(ctx, 950, 990, 0.9, 0, { light: true });
+ ['OFF', 'ON · PRESSED', 'TOP (PLAN VIEW)', 'DOCK'].forEach((l, i) => text(ctx, l, [220, 500, 760, 950][i], 1025, { font: '500 18px Jost', fill: PAL.inkSoft, align: 'center', track: 3 }));
+ // palette
+ const sw = [PAL.coral, PAL.mustard, PAL.teal, PAL.blue, PAL.avocado, PAL.pink, PAL.plum, PAL.hair, PAL.skin, PAL.ink, PAL.paper];
+ sw.forEach((c, i) => { shape(ctx, rrect(1440 + i * 38, 60, 30, 30, 6), { fill: c, line: 2, seed: 60 + i, grain: 0, off: [3, 2] }); });
+ paperFinish(ctx, W, H, 0.8);
+}
diff --git a/styles/midcentury-toon/demo/tools/cuecheck.py b/styles/midcentury-toon/demo/tools/cuecheck.py
new file mode 100644
index 0000000..0dbcee4
--- /dev/null
+++ b/styles/midcentury-toon/demo/tools/cuecheck.py
@@ -0,0 +1,18 @@
+"""Cue check: picture events (events.json) vs the 132 BPM grid and the score's hits (music/hits.json).
+python styles/midcentury-toon/demo/tools/cuecheck.py (after events.mjs + music/score.py)"""
+import json, os
+D = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..')
+E = json.load(open(os.path.join(D, 'events.json')))['ev']; H = json.load(open(os.path.join(D, 'music', 'hits.json')))
+beat = 60 / 132; hits = [h['t'] for h in H['hits']]
+KEY = {'box_thump', 'box_fall', 'ding', 'stamp', 'plastic_thock', 'plug_click', 'tap', 'beep', 'btn_soft', 'click_big', 'zone', 'dock', 'wood_block', 'iris'}
+bad = 0
+for e in E:
+ if e['type'] not in KEY: continue
+ g = round(e['t'] / (beat / 2)) * beat / 2; eg = (e['t'] - g) * 1000
+ nh = min(hits, key=lambda h: abs(h - e['t'])); eh = (e['t'] - nh) * 1000
+ ok = abs(eg) <= 42 or abs(eh) <= 42 # within one frame of the half-beat grid or a score hit
+ bad += not ok
+ print(f"{'OK ' if ok else 'OFF'} {e['t']:7.3f} {e['type']:14s} grid {eg:+6.1f} ms nearest hit {nh:7.3f} ({eh:+6.1f} ms)")
+sil = H.get('silences', [])
+print('silences in score:', sil)
+print('off-grid:', bad)
diff --git a/styles/midcentury-toon/demo/tools/cues.mjs b/styles/midcentury-toon/demo/tools/cues.mjs
new file mode 100644
index 0000000..613af19
--- /dev/null
+++ b/styles/midcentury-toon/demo/tools/cues.mjs
@@ -0,0 +1,8 @@
+// Export subtitle cues (for .srt) straight from the film's timeline: node tools/cues.mjs [content.json] > cues.json
+import fs from 'fs'; import path from 'path'; import { fileURLToPath } from 'url';
+const D = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
+const film = await import(path.join(D, 'film.js'));
+const C = JSON.parse(fs.readFileSync(path.join(D, process.argv[2] || 'content.json')));
+let durs = {}; try { durs = JSON.parse(fs.readFileSync(path.join(D, 'voices/dur.json'))); } catch (e) {}
+film.setup(C, durs);
+console.log(JSON.stringify(film.srtCues(), null, 1));
diff --git a/styles/midcentury-toon/demo/tools/lines.py b/styles/midcentury-toon/demo/tools/lines.py
new file mode 100644
index 0000000..dcf3494
--- /dev/null
+++ b/styles/midcentury-toon/demo/tools/lines.py
@@ -0,0 +1,8 @@
+"""Build lines.json (voice lines) from a content file: python lines.py content.json out.json"""
+import json, sys
+C = json.load(open(sys.argv[1])); v = C.get('voice', {})
+L = [('hook', C['hook']['line'])] + [(f'step{i}', s['line']) for i, s in enumerate(C['steps'])] + [('tip', C['tip']['line']), ('outro', C['outro']['line'])]
+import re
+NUM = {'one': '1', 'two': '2', 'three': '3', 'four': '4', 'five': '5'}
+asr = lambda t: re.sub(r'\b(Step|step) (one|two|three|four|five)\b', lambda m: m.group(1) + ' ' + NUM[m.group(2)], t)
+json.dump([{'id': k, 'text': t, 'asr': asr(t), 'voice': v.get('id', 'bm_george'), 'speed': v.get('speed', 0.94)} for k, t in L], open(sys.argv[2], 'w'), indent=1)
diff --git a/styles/midcentury-toon/demo/voices/dur.json b/styles/midcentury-toon/demo/voices/dur.json
new file mode 100644
index 0000000..c9e5a91
--- /dev/null
+++ b/styles/midcentury-toon/demo/voices/dur.json
@@ -0,0 +1,8 @@
+{
+ "hook": 2.307,
+ "step0": 2.56,
+ "step1": 2.47,
+ "step2": 1.569,
+ "tip": 1.972,
+ "outro": 1.555
+}
\ No newline at end of file
diff --git a/styles/midcentury-toon/demo/voices/words.json b/styles/midcentury-toon/demo/voices/words.json
new file mode 100644
index 0000000..b26a502
--- /dev/null
+++ b/styles/midcentury-toon/demo/voices/words.json
@@ -0,0 +1,194 @@
+{
+"hook": [
+[
+"Meet",
+-0.6,
+0.22
+],
+[
+"PIP,",
+0.22,
+0.56
+],
+[
+"your",
+0.84,
+0.9
+],
+[
+"new",
+0.9,
+1.06
+],
+[
+"robot",
+1.06,
+1.4
+],
+[
+"vacuum.",
+1.4,
+1.92
+]
+],
+"step0": [
+[
+"Step",
+-0.6,
+0.22
+],
+[
+"1.",
+0.22,
+0.52
+],
+[
+"Set",
+0.88,
+1.04
+],
+[
+"the",
+1.04,
+1.22
+],
+[
+"dock",
+1.22,
+1.44
+],
+[
+"against",
+1.44,
+1.8
+],
+[
+"a",
+1.8,
+2.02
+],
+[
+"wall.",
+2.02,
+2.26
+]
+],
+"step1": [
+[
+"Step",
+-0.6,
+0.22
+],
+[
+"2,",
+0.22,
+0.54
+],
+[
+"open",
+0.88,
+1.14
+],
+[
+"the",
+1.14,
+1.3
+],
+[
+"app",
+1.3,
+1.5
+],
+[
+"and",
+1.5,
+1.7
+],
+[
+"add",
+1.7,
+1.92
+],
+[
+"PIP.",
+1.92,
+2.28
+]
+],
+"step2": [
+[
+"Step",
+-0.6,
+0.22
+],
+[
+"3,",
+0.22,
+0.56
+],
+[
+"press",
+0.6,
+0.9
+],
+[
+"start.",
+0.9,
+1.28
+]
+],
+"tip": [
+[
+"Tip,",
+-0.6,
+0.16
+],
+[
+"pick",
+0.38,
+0.48
+],
+[
+"up",
+0.48,
+0.62
+],
+[
+"loose",
+0.62,
+0.82
+],
+[
+"cables",
+0.82,
+1.14
+],
+[
+"first.",
+1.14,
+1.64
+]
+],
+"outro": [
+[
+"Three",
+-0.6,
+0.22
+],
+[
+"steps,",
+0.22,
+0.58
+],
+[
+"that's",
+0.86,
+1.18
+],
+[
+"it.",
+1.18,
+1.32
+]
+]
+}
\ No newline at end of file
diff --git a/styles/midcentury-toon/midcentury-toon.srt b/styles/midcentury-toon/midcentury-toon.srt
new file mode 100644
index 0000000..1605b75
--- /dev/null
+++ b/styles/midcentury-toon/midcentury-toon.srt
@@ -0,0 +1,23 @@
+1
+00:00:01,978 --> 00:00:05,645
+Meet Pip, your new robot vacuum.
+
+2
+00:00:07,045 --> 00:00:11,212
+Step one. Set the dock against a wall.
+
+3
+00:00:12,500 --> 00:00:16,417
+Step two. Open the app and add Pip.
+
+4
+00:00:17,955 --> 00:00:20,955
+Step three. Press start.
+
+5
+00:00:27,353 --> 00:00:31,019
+Tip: pick up loose cables first.
+
+6
+00:00:31,444 --> 00:00:34,360
+Three steps. That's it.
diff --git a/styles/midcentury-toon/poster.jpg b/styles/midcentury-toon/poster.jpg
new file mode 100644
index 0000000..c1400ad
Binary files /dev/null and b/styles/midcentury-toon/poster.jpg differ
diff --git a/styles/silkscreen-poster/STYLE.md b/styles/silkscreen-poster/STYLE.md
new file mode 100644
index 0000000..3869efc
--- /dev/null
+++ b/styles/silkscreen-poster/STYLE.md
@@ -0,0 +1,199 @@
+# Silkscreen Travel Poster — Style Prompt
+
+> Opaque, hard-edged flat inks pulled one colour at a time through a screen: 4–6 inks per poster, stepped colour bands instead of gradients, thin paper-white gaps where the registration slips. Information is revealed the way the print is made: one layer, one beat.
+> Demo: *Three Trails* (38.4 s) · `silkscreen-poster.mp4` · source in `demo/`. A trail guide for a fictional park: three trail posters are printed, one faster than the last, the third is climbed in one long take, and all three end up on a visitor-center wall. No narration.
+> References (grammar only):
+> - **1930s–40s WPA national-park screen prints**: 4–6 flat inks, a lit face and a shade face per mountain, skies built from stepped bands, a dark information band at the foot of the poster, concentric sun rings.
+> - **Fifty-Nine Parks (contemporary)**: restraint in modern screen printing, paper as a colour, a series built on one template with a new palette per poster.
+> - **The physical process of screen printing**: hinged screen, squeegee pushing an ink bead across mesh, split-fountain pulls, drag streaks, pinholes, a raised edge of ink, off-register white slivers.
+>
+> Never copy a real poster's composition, park name, lettering or logo, and never name a real agency.
+
+## 1. What this style is
+
+A travel poster being **printed on camera**. Every colour is an opaque ink laid by its own pull of the squeegee; the later ink covers the earlier one completely. There is no halftone, no fluorescent ink and no line work: a shape exists only because its edge is where one flat ink stops. Gradients are forbidden. Skies and haze are built from **stepped bands**: a flat colour, then five stripes that get thinner, then the next colour.
+
+What makes it read as silkscreen and not as "flat vector art":
+- **Registration.** Every layer is offset by 1–3 px at 1080p. Where a shape is *knocked out* of the layer below (sun, sun rings, a waterfall), the slip leaves a crescent of bare paper on one side.
+- **Overprint edge.** Each layer is printed twice: a faint multiply ghost 2 u off, then the real ink. This leaves a darker sliver where the ink laps over the colour underneath.
+- **Ink thickness.** A thin light rim on the top-left edge of every ink shape and a dark rim bottom-right, drawn with fills only. Fresh ink behind the squeegee has a wet sheen that fades within a second.
+- **Paper.** Cream stock with fibres. The mottle and pinholes are drawn over the whole sheet in paper colour, so they only show on inked areas.
+
+How it differs from its neighbours in this library: **risograph** is translucent fluorescent overprint with halftone grain; **ukiyoe** is key-block line work with bokashi; **woodcut** is carved line; **lowpoly** is 3D facets. This style is opaque, line-free, flat and banded.
+
+## 2. Use cases: what this style is for
+
+Silkscreen posters are information design: a place, a name and three or four facts. The style is strongest when the film *is* the poster. The order of printing becomes the order of reading.
+
+| Use case | Shot structure | Information layers (in order) | Hold per layer | Length |
+|---|---|---|---|---|
+| **Trail / attraction guide** (the demo: park, resort, visitor-center screen) | Title banner pull → poster 1 printed layer by layer → poster 2 printed on eighth notes → last poster climbed in one take → pull back to the wall | park title → scene → trail name → difficulty → distance → time → climb → footer | title 3.2 s; name ≥ chars/12+1 s; stat row ≥ 2.2–3.0 s after its last item | 30–40 s for 3 trails |
+| **Event / festival poster** (outdoor concert, market, race) | One poster; squeegee hook → 4 scene pulls → headline pull → date/venue band → wall or shop-window pull-back | headline → date → venue → one line of call to action | headline 2.5 s, date+venue 3 s, final hold 3 s | 15–20 s |
+| **Destination series / tourism board** (one city, four neighbourhoods) | Same template, one palette per place; poster-to-poster transitions through the foreground (tree, lamp post, sail) | place name → one fact → series wall | 2.5 s per poster + 4 s wall | 20–30 s |
+| **Product or outdoor-brand drop** (a tent, a jacket, a bike) | Product as the "summit": layers printed around a flat product silhouette, then a palette swap per colourway (one poster re-inked 3 times) | name → colourway ×3 → price / date | 1.8 s per colourway | 12–18 s |
+| **Seasonal / opening-hours notice** | One poster re-printed in four palettes (spring → winter) with the same squeegee sweep | season name + hours per swap | 2 s per swap | 10–15 s |
+
+The demo is the first row. The others use the same engine: a scene is just a list of planes, the band template takes any 1–4 facts, and `swap` re-inks a whole poster in another palette.
+
+**How the native moves serve information** (not story):
+- *One ink, one beat*: each pull is one musical hit, so the eye is led through the layers in order and the facts are printed last, which is exactly when they are read.
+- *Split fountain*: several inks in one pull. It opens the film, because one stroke fills the frame with colour.
+- *Palette re-ink*: the whole poster pulled again in the next time-of-day palette. In the demo this is the data point "7 h": the day passes while the camera climbs.
+- *Registration slip → snap*: during the climb the layers hang loose (white gaps, paper-thickness shadows), then clamp into register with one hit. This is the only time the film pauses before the most important facts.
+- *Paper as a colour*: the waterfall is simply unprinted paper, the brightest thing on the sheet.
+- *The trail as a printed layer*: the route is a dashed line in the sun ink, stamped segment by segment as the camera follows it.
+
+## 3. Visual language
+
+- **Palette discipline**: one palette per poster, 6 inks: `sky1` (light sky), `sky2` (deep sky / bands), `far`, `mid`, `near` (darkest, also the info band), `sun` (the one bright accent: sun, trail, difficulty, climb). An optional `glow` is the lit face of mountains. A given poster should use ≤ 6 of these. The demo palettes are:
+ - dawn `#F6CD98 #EE9A73 #9A7FA8 #3E7079 #1E3B3F #FBE6B4`
+ - noon `#E4EEDC #86BCD0 #C2AE92 #4C8753 #1D4331 #F2C14A`
+ - golden `#F7D787 #E9A94F #A57C68 #5E7A45 #2B3A28 #FFF1C4`
+ - dusk `#F4B461 #D8613F #7C3E5F #43325A #1B1B2F #FBE3A6`
+ - Paper `#F2E8D2`. Title banner `#F7C66B #E4683F #2F6F73 #1C2A33`.
+- **Contrast is automatic**: text inks are picked by WCAG contrast against the ink underneath (`pickInk`). A night palette will not make the header vanish.
+- **Shapes**: mountains are midpoint-displaced ridges with a jagged lit facet; pines are one outline of drooping tiers plus a short trunk; water is a flat body with horizontal glint bars; forests are rows of pines on a solid base. Everything is drawn with hard edges.
+- **Poster template** (units 1000×1500): paper border 26 u; art area to y = 1140; the scene is shifted up 50 u, so a little sky is cropped to make room for the info band. The band (y 1148–1474, `near` ink) holds the trail name (Big Shoulders Display 900, up to 122 u, auto-fit), the number `01`–`04` in `sun`, a 6 u `sun` rule, and a row of stats: labels 34–38 u (Outfit 600, letter-spaced), values 48–68 u (Big Shoulders 800). Columns are sized by content. On a wall at 0.49 scale, labels are about 18 px and values about 31 px.
+- **Header**: park name tracked out at 62 u, printed in the sky.
+- **Texture budget**: paper tile at 0.6 u per texel, mottle multiply at 55 %, pinholes at 75 %, then ffmpeg grain 3. More than this starts to read as risograph.
+
+## 4. Motion language
+
+- **Pulls** are linear and steady (a real squeegee does not ease). The front is ragged: an unevenly filled drag tail about 30 u long. Accent inks start half a beat after the main ink of the same layer (`sub: 1`).
+- **Info band** items print left to right, 0.18 s each, on eighth notes. There is no fade anywhere.
+- **Screen lift**: the frame hinges up (vertical squash plus a growing shadow) over 0.4 s.
+- **Palette swap**: a wide squeegee travels diagonally (−12°) over the sheet in 0.35 s. Geometry is identical on both sides of the blade; only the inks change. Show only the blade, the bead and a sliver of handle.
+- **Layer parallax** (the climb): a plane's vertical offset is `(camTopY − camY) × (depth − 1) × 0.42`. Each spur slides sideways (Gaussian bump, 190 u × depth) as the camera passes it. Paper gaps (3 u) and thickness shadows (9 u, 28 %) scale with "looseness" and drop to zero on the registration snap.
+- **Ink bead**: a round, thick tube with a lit half, a dark underside, a continuous highlight, glints that roll with the squeegee's travel, and short viscous strands with a drop at the tip.
+
+## 5. Camera language
+
+| Move | Use | Demo |
+|---|---|---|
+| Truck with the squeegee, slight roll (−1.7°), frame edge and handle ends in view | hook: the squeegee holds its place in frame while the bands stream past | 0–1.0 s |
+| Fast pull-back (ease-out 0.65 s) | reveal the whole print as the screen lifts | 1.0–1.65 s |
+| Tilt across the print table | from one sheet to the next | 4.8 s |
+| Locked top-down full shot | watching layers stack | 5.4–7.8 s |
+| Push + tilt to the info band | reading | 7.8–9.0 s |
+| Truck through a foreground tree (screen-space silhouette in the previous poster's `near` ink, covers the frame for about 1 frame) | poster-to-poster transition | 13.2 s, 19.2 s |
+| Pull-back from a detail to the whole sheet | "the white is the waterfall" | 14.4 s |
+| **Crane up the trail, multi-plane parallax** (signature) | the hardest trail, one take | 19.2–23.4 s |
+| Tilt down from summit to band | the climb ends in the data | 24.0 s |
+| Log-zoom pull-back to the wall | final lockup, hold ≥ 3 s | 29.4–30.6 s |
+
+Unified transition grammar: layers change by squeegee; posters change through foreground trees; the film ends with a squeegee pulling the end-card ink. No dissolves and no bare cuts.
+
+## 6. Sound
+
+- **Music**: American outdoor folk, 100 BPM, D major, open-D guitar strums (physical model), slide guitar (numpy), VCSL harmonica, cajon kick, brushes, upright bass. **Each pull is one strum**, and the chords climb D – D/F# – G – A as the layers come nearer. Poster 2 doubles to eighth notes (acceleration). The climb builds instrument by instrument. The registration snap is the loudest downbeat in the film.
+- **Foley by material**: squeegee on mesh (band-passed noise with a 220–280 Hz amplitude grain from the mesh; faster pull = brighter), wet ink "squelch" (falling sine plus sticky noise), aluminium screen clack plus hinge creak, paper stamps for stats, 16th-note ticks for trail dashes, a paper hiss for sliding layers, and a wood-and-metal registration clamp.
+- **Ambience**: studio room tone; the lake inside poster 1 fades in when the screen lifts (the print "wakes up"); waterfall (J-cut 0.9 s early); mountain wind (J-cut into the silence, L-cut out onto the wall); visitor-center murmur, a door, footsteps.
+- **Silences**: 18.0–19.2 s (music off; the waterfall tail fades to about −59 dBFS; the first sound after it is a long slide up) and 23.4–24.0 s (wind only; the first sound after it is the clamp plus the full band).
+- Music ducks 2.5 dB under foley. Master: −14 LUFS.
+
+## 7. Titles & text
+
+No narration and no subtitles: the poster text *is* the information. The title card is a printed 4:1 banner (1800×440 u, title split into two balanced lines), framed to fill the width (≈5 % margins, ≈40 % of frame height), which becomes the header of the final wall (hung at 1150 px wide so the posters keep ≥30 px values). Reading rule for this batch: each text stays ≥ chars/12 + 1 s (min 1.5 s) after its **last** item lands. The timeline computes this from `content.json` and rounds up to the beat. The end card is printed as a last landscape mini-poster in two pulls: a split-fountain pull for the art (sky bands, sun ring, ridge, trail dashes, title), then a `near` pull for the info band (style name, `Lemo-Opuscar`, `LemoLab × Claude Opus 5.5`, font and sample credits).
+
+## 8. Pitfalls we hit
+
+- **Stroke-based edge effects draw internal lines on unioned paths.** A forest drawn as a union of pines showed every tree outline. Do sheen and trap with fills only: fill the shape, then fill it again shifted, inside a clip.
+- **Screen shadow darkened the whole print.** The frame's drop shadow must be a ring (even-odd), not a full rectangle, or everything under the mesh looks muddy.
+- **Blue shadow facets on granite read as water.** Keep shadow planes in `near` and put them on the inside faces next to the waterfall.
+- **A thick squeegee across a close-up splits the frame into "two pictures".** Tilt the blade, hide most of the handle, and keep the geometry continuous across it.
+- **Jagged-triangle ink beads read as paper edges.** The bead needs roundness: lit half, dark underside, highlight and strands.
+- **Parallax alone reads as "the mountains are moving".** Show paper gaps and thickness shadows while layers are loose, and snap them to zero with a sound.
+- **Night palettes hid the header and labels.** Choose text inks by contrast (`pickInk`), never by a fixed key.
+- **Wet-sheen gradient stuck at the end of the pull** (condition `p < 1.02` stays true forever). Fade it out by time.
+- **Tree-wipe covered the frame for 0.4 s** (a dark blank). Centre the silhouette on the switch time so full cover lasts about 1 frame.
+- Four trails at these reading times run to about 45 s. See §11 for how to compress.
+- **A 7:1 title banner is a sliver in a 16:9 frame** (about 1/5 of the height, lots of empty table). Make the banner about 4:1 so it can fill the width and about 40 % of the height.
+- **Random coloured dots on the table read as confetti or placeholders.** Build a real workbench: planks, grain, knots, a few large muted ink stains and torn tape.
+- **Close-ups on an info band must keep the whole band in frame** with ≥5 % side margins (z ≤ 1.75 for a 1000 u poster). Close-ups on a sheet being printed must keep the sheet's edge in frame, or the viewer sees only a flat colour.
+
+## 9. Production recipe (this repo)
+
+`sh styles/silkscreen-poster/demo/build.sh` rebuilds everything:
+1. `tools/timeline.mjs` prints the timeline derived from `content.json`.
+2. `core/render/events.mjs` → `events.json` (every pull, lift, band, name, item, wipe, swap, part, silence, clack).
+3. `music/compose.py` reads `events.json` → `score.wav` plus stems.
+4. `mix.py` → `mix.wav` (ambience, foley, ducking, silence windows).
+5. `tools/cuecheck.py` checks the mix onsets against the events: median error 4 ms; 30/33 within 1 frame. The rest are overlapping events and slow harmonica attacks.
+6. Render (`--workers 2`, through the batch render limiter when present) → `mux.sh … 24 3`.
+
+Files: `engine/silk.js` (print engine), `engine/scenes.js` (5 built-in scenes), `engine/poster.js` (template, banner, contrast), `film.js` (timeline and shots), `mix.py`, `music/compose.py`. Roughly 0.1 s per frame; a full render takes under a minute.
+
+## 10. Engine usage
+
+`engine/silk.js` prints **any shape** in this style: it only needs a `Path2D` in whatever units the current transform uses.
+
+| Function | What it does |
+|---|---|
+| `makeTextures(paperHex, seed)` | paper, mottle and pinhole tiles (once) |
+| `paperSheet(ctx, T, x, y, w, h)` | paper stock |
+| `ink(ctx, part, o)` | one ink layer. `part = { path, knock?, paint? }` (`knock` = knocked-out holes, `paint(ctx)` = custom fill such as text). `o = { color, reg:[dx,dy], clip, sheen, trap }` |
+| `wipeRegion(box, dir, p, seed)` / `wipeFront(...)` | the ragged squeegee front as a clip path, and where the blade is |
+| `squeegee(ctx, a, b, lead, o)` | blade from `a` to `b` moving along `lead`; `o.beads=[{t0,t1,color}]` (split fountain), `roll`, `handle` 0–1, `scale` |
+| `screenFrame(ctx, box, o)` | hinged screen with mesh, emulsion and tape; `lift` 0–1 |
+| `inkFinish(ctx, T, x, y, w, h)` | mottle and pinholes over the sheet |
+| `bandSteps(x, w, y0, y1, n)` | stepped colour bands (the gradient substitute) |
+| `ridgeLine`, `polyPath`, `circlePath`, `ringPath` | shape helpers |
+
+`engine/poster.js`: `buildPoster(content, trail, i, n)`, `drawPoster(ctx, P, { pal, T, prog, off, reg, sep, swap, items, … })`, `drawBanner`, `pickInk`. `engine/scenes.js`: `buildScene('lake'|'waterfall'|'ridge'|'forest'|'coast')` returns planes you can reorder or extend.
+
+Minimal example: a warm-orange `#D97757` four-point spark with a cursor tail, printed in two inks and knocked out of a sky, then pulled in by the squeegee:
+```js
+import { makeTextures, paperSheet, ink, wipeRegion, wipeFront, squeegee, inkFinish, polyPath, rectPath, circlePath } from './engine/silk.js';
+const T = makeTextures('#F2E8D2');
+paperSheet(ctx, T, 0, 0, 800, 600);
+const spark = polyPath([[400,180],[430,270],[520,300],[430,330],[400,420],[370,330],[280,300],[370,270]]);
+const tail = rectPath(540, 285, 160, 30);
+const p = 0.7; // 70 % of the pull done
+const clip = wipeRegion([0, 0, 800, 600], 'right', p, 3);
+ink(ctx, { path: rectPath(0, 0, 800, 600), knock: circlePath(400, 300, 150) }, { color: '#1C2A33', clip, sheen: 1 }); // sky with a knocked-out halo
+ink(ctx, { path: spark }, { color: '#D97757', reg: [2, -1], clip, sheen: 1, trap: 1 });
+ink(ctx, { path: tail }, { color: '#D97757', reg: [2, -1], clip, sheen: 1 });
+const x = wipeFront([0, 0, 800, 600], 'right', p);
+squeegee(ctx, [x + 10, -20], [x + 10, 620], [1, 0], { color: '#D97757', roll: x / 30 });
+inkFinish(ctx, T, 0, 0, 800, 600);
+```
+Single-colour posters: keep one palette key (usually `sun`) as the only colour and set the other inks to tints of one hue. `pickInk` keeps the text legible.
+
+## 11. Swap in your content
+
+All text, data and colour come from `demo/content.json`; `film.js` has no copy in it.
+
+| Field | Type | Range | If out of range |
+|---|---|---|---|
+| `park` | string | ≤ 22 chars | header is letter-spaced at 62 u; longer names overflow the sky width (shorten or reduce tracking) |
+| `title` | string | ≤ 34 chars | auto-fits 132 → 60 u on the banner; under 60 u it gets too small to read |
+| `footer` | string | ≤ 45 chars | one line in the banner strip; the wall hold grows with its reading time |
+| `trails[]` | array | **1–4** | 1 = press only (no climb); 2 = press + climb; 3 = press, quick, climb; 4 = press, quick, quick, climb (about 45 s, see below). Above 4, the wall posters become too small to read |
+| `trails[].name` | string | ≤ 22 chars | auto-fits 122 → 60 u |
+| `trails[].difficulty` | `easy` \| `moderate` \| `hard` \| `expert` | — | unknown values show 1 filled triangle |
+| `trails[].distance` | number | any | printed as `3.2 KM` (unit from `units.distance`) |
+| `trails[].time` | string | ≤ 7 chars (`1 h`, `45 min`) | the column widens and all values shrink together (min 48 u) |
+| `trails[].elevation` | number \| null | null hides the CLIMB column | shown in `sun` ink as `↑1,100 M` |
+| `trails[].scene` | `lake` \| `waterfall` \| `ridge` \| `forest` \| `coast` | built in | unknown → `lake` |
+| `trails[].time_of_day` | key into `palette` | `dawn`, `noon`, `golden`, `dusk`, `night` | missing → `noon`. The climb re-inks from the previous trail's palette through `golden` to this one |
+| `palette.<time>` | `{sky1, sky2, far, mid, near, sun, glow?}` | hex | text contrast is checked automatically |
+| `palette.paper`, `palette.wall`, `banner_time` | hex / object / key | — | — |
+
+**Steps**: edit `content.json` → `sh demo/build.sh`. There is no TTS; the music and mix re-time themselves from `events.json`. To preview another file without overwriting: `node core/render/still.mjs styles/silkscreen-poster/demo 30 --q content=content_alt.json`.
+
+**Four trails in 40 s**: the reading rule makes each middle poster about 6 s long. Options, in order of preference:
+1. Print the two middle posters **side by side on one table in the same pulls** (one quick section, two bands, read together).
+2. Drop the per-item stamp spacing from an eighth note to a sixteenth for middle posters.
+3. Skip the band close-up on middle posters and let them be read on the final wall (extend the wall hold by 2 s).
+
+`content_alt.json` (4 walks, dawn/golden/noon/night, a new park, wall and banner palette) is the tested example. Its stills are in `demo/stills/alt_*.jpg`.
+
+Minimal content:
+```json
+{ "park": "Pine Lake", "title": "One Walk at Pine Lake", "footer": "Open dawn to dusk",
+ "units": { "distance": "km", "elevation": "m" }, "banner_time": "dawn",
+ "trails": [ { "name": "Shore Path", "difficulty": "easy", "distance": 2, "time": "40 min",
+ "elevation": null, "scene": "lake", "time_of_day": "dawn" } ],
+ "palette": { "paper": "#F2E8D2",
+ "dawn": { "sky1": "#F6CD98", "sky2": "#EE9A73", "far": "#9A7FA8", "mid": "#3E7079", "near": "#1E3B3F", "sun": "#FBE6B4" } } }
+```
diff --git a/styles/silkscreen-poster/TREATMENT.md b/styles/silkscreen-poster/TREATMENT.md
new file mode 100644
index 0000000..c5665c5
--- /dev/null
+++ b/styles/silkscreen-poster/TREATMENT.md
@@ -0,0 +1,204 @@
+# Silkscreen Travel Poster · 导演方案(Treatment)
+
+**片名** *Three Trails*(画面上的片名来自 content.json:`3 Trails in Granite Valley`)
+**场景** 户外步道指南:虚构的 Granite Valley 园区,游客中心墙上的三张步道海报 + 一条横幅,从印刷台一路印到上墙。
+**时长** 38.4 s(片尾卡 3.6 s 在内)| **画幅** 1920×1080 | **帧率** 24 fps,刮板、镜头每帧平滑;套色抖动按 12 fps 步进
+**节拍** 100 BPM,4/4,一拍 0.6 s,一小节 2.4 s,全片 16 小节
+**旁白** 无(按派单)。信息全在海报上,不需要字幕和 `.srt`。
+**一句话** 刮板把第一层天空推满画面;三张步道海报按"天空 → 远山 → 中景 → 近景 → 信息带"一层层印出来,一张比一张快;第三张不再重印,镜头沿步道从谷底升到山脊,时间从中午走到黄昏,整张海报被重印了两遍;最后三张海报挂在游客中心的墙上,全部信息同时在场。
+**看完能说出** "这个能拿去做景区 / 国家公园 / 户外品牌的路线介绍,游客中心屏也能放。"
+
+> **关卡 1 后的修改(协调者意见,已全部落实)**
+> 1. 第 3 张不重演逐层印刷:批准。
+> 2. 签名镜头的重印:刮板改成斜着推(−12°),只露刀口、墨珠和一截手柄。刮板两侧几何完全一致,只换墨色,山脊线和步道虚线都跨过刀口接上。
+> 3. 视差的"纸版感":爬升时每层上沿多一道 3 u 纸白缝和一道 9 u 纸厚阴影,套色错位放大到约 ±6 px。静一拍后"卡嗒",错位和阴影同时归零。
+> 4. 钩子里的墨珠:改成圆润厚实的湿墨条(受光半边、背光下沿、连续高光,亮点随刮板滚动,短粗拉丝挂一滴)。刮过的地方透出网格。镜头拉开到 z≈2.7,让网框的边和刮板木柄入画。
+> 5. 信息带加高到 326 u(场景上移 50 u,裁掉一点天空)。上墙后标签约 18 px,数值约 31 px。列宽按内容分配,文字墨色按对比度自动挑。
+> 6. 瀑布:岩壁内侧加两块深色切面,把纸白瀑布夹在中间。水潭波纹简化成两道。
+> 7. 时长 38.4 s(含片尾卡)。4 条步道怎么压缩写在 STYLE.md §11。
+
+> **关卡 2 后的返修(v2;v1 备份为 `silkscreen-poster_v1.mp4` 和 `demo_v1/`)**
+> 1. **片名横幅:选"保留横幅、贴近",不把片名并进第 1 张海报。** 理由有三条:
+> - 横幅就是落版墙上的页眉,开头印、结尾挂,首尾呼应;
+> - 如果把片名并进第 1 张,三张海报的页眉会不一致,系列感就破了;
+> - 分色刮铺天空的钩子也要一张横向的纸才成立。
+>
+> 改法:
+> - 横幅从 7:1 改成 4:1(1800×440),片名断成两行;开场拉开后撑满画宽(左右边距约 5%),占画高约 39%。
+> - 台面换成旧木工作台:木板、木纹、节疤、干掉的墨渍(颜色压暗)、撕剩的胶带条。随机彩点去掉了。
+> - 墙上的横幅缩到 1150 px 宽,居中挂在海报上方,保证上墙后海报数值仍 ≥30 px。
+> 2. **第 2 张快印段**:
+> - 起始机位 z = 1.25,整张纸宽和上沿一直在画里,海报占画高 100%,不会再出现整屏只有一块浅色平涂;
+> - 拉到信息带时 z = 1.5,海报占画高约 78%。
+> 3. **信息带完整入画**:第 1 张 z = 1.55(左右边距约 12%),第 2 张 z = 1.5(约 13%),第 3 张下摇到信息带时 z 从 2.06 降到 1.72(约 7%)。CLIMB 一栏和 "01" 都完整。
+> 4. **片尾卡改成最后两刮**:第一刮用分色墨珠印出一张横版小海报(天空色带、日圈、山脊、步道虚线、片名),第二刮印深色信息带:风格名、Lemo-Opuscar、LemoLab × Claude Opus 5.5、字体与采样署名。第二刮有自己的刮墨声。
+
+---
+
+## 一、对标:学什么 / 刻意不学什么
+
+| 对标 | 学什么(语法) | 刻意不学 |
+|---|---|---|
+| **1930–40 年代 WPA 国家公园丝网海报** | 4–6 个不透明平涂色;山体用"受光面 + 背光面"两块硬边色;天空用**色带台阶**代替渐变(粗条到细条);底部一条深色信息带、大写粗体园区名;太阳用同心圈 | 不抄任何具体海报的构图、园区名、字体设计;不写 "National Park" 之类的真实机构字样 |
+| **当代 Fifty-Nine Parks 系列** | 现代丝印的套色克制;留白(纸色)当第七个颜色用;海报做成系列:同一套版式,每张换一套时间色 | 不学它的具体插画、编号样式和 logo 位置 |
+| **丝网印刷的物理过程**(参考工作室拍的印刷过程影像) | 网版铰链抬起落下;刮板把墨珠推过网纱;**分色刮(split fountain)**:刀口前摆几种墨,一刮出一条色带;刮痕、针孔、墨层边缘的厚度光;套色错位露出的细白缝 | 不做真实照片感的网版和刮板,全部按丝印自己的平涂语言画(两色木柄、一色胶条、平涂投影) |
+| **Wes Anderson 的俯拍桌面镜头**(只学镜头语法) | 俯拍、正交、物件对齐画框;快速横移接硬停 | 不学他的配色和对称人物调度 |
+
+## 二、和库里相近风格的区别(开工前看过成片和 STYLE.md)
+
+| 库内风格 | 它是什么 | 本风格怎么区分 |
+|---|---|---|
+| **risograph**(*Sunday Ride*) | 半透明荧光专色叠印出第四、第五色;网点半调、墨粒颗粒;角色喜剧 | **不透明**平涂墨层,后印的完全盖住先印的;**没有网点、没有荧光色、没有叠色混色**(唯一的叠色只在错位的一条细边上);颜色数 4–6 且每张海报独立一套;场景是信息海报,不是故事 |
+| **ukiyoe**(浮世绘) | 木版、墨线轮廓、普鲁士蓝、木纹与马连擦痕 | **完全没有线描**:形状只由色块的硬边界定义;纸面无木纹;天空是色带台阶,不是 bokashi 渐变 |
+| **lowpoly-island** | 3D 多边形小岛,平面着色的三角面 | 纯 2D 版画:山体切面是手工式的锯齿大块,不是三角网格;有纸、有墨、有套色错位 |
+| **woodcut** | 黑白刻线、刀痕 | 彩色、无刻线、无刀痕,靠平涂色面 |
+| **swiss-motion**(音乐会海报自排版) | 网格排版、纯字体动态 | 本片的字只是信息带里的一层版,主角是风景插画和印刷过程;排版固定成"旅行海报"模板 |
+
+库里已有的 demo 场景没有"路线 / 景点指南",本片不撞场景。
+
+## 三、信息弧(替代情绪弧)
+
+1. **钩子(0–1.2 s)**:第一帧就是刮板正在推墨:分色墨珠(橙红 / 金黄 / 青绿三段)在刀口前滚动,身后天空色带一刮就铺满整个画面。
+2. **分层上场**:
+ - 片名(横幅)→ 第 1 张:五层逐拍印,每层一个扫弦 → 信息带:名称 → 难度 → 距离 → 用时,一次只亮一个。
+ - 第 2 张用八分音符快印(加速),信息带同样顺序。
+ - 第 3 张的信息最重要(最难、最长、唯一有爬升),给它全片唯一的长镜头和高点。
+3. **一个高点**:山脊步道。镜头沿步道从谷底升到山顶,近景松林沉下去、三道山梁依次向两侧让开;步道虚线跟着镜头一段段印出来;海报被整张重印两次(中午 → 午后 → 黄昏),告诉观众"这条要走一整天"。到顶后静一拍,各层"卡嗒"一声套准,全乐队进。
+4. **落版**:三张海报 + 横幅挂在游客中心的木墙上,全部信息可读,停 4.2 s。这一帧就是可以直接截图的海报 / 封面。
+
+## 四、原生招式(只有丝印能做的)→ 怎么服务信息
+
+| 丝印原生能力 | 本片用法 |
+|---|---|
+| **一次一色的套印** | 每一层 = 一个节拍 = 一声扫弦;观众的眼睛被一层一层领着走,信息带最后印,所以最后被读到 |
+| **分色刮(split fountain)** | 开场钩子:一把刮板刮出三条色带,片名横幅的天空一刮成形 |
+| **色带台阶代替渐变** | 所有天空:一块大色 + 五条由粗到细的条纹过渡;横幅同理 |
+| **套色错位 → 细白缝 / 叠色边** | 太阳和光圈是从天空版里**镂空**的,错位让一边露出一弯纸白;每块版二次轻压一层 multiply 的边,留下一道深色叠印边;高点之前各层故意松开,"卡嗒"一声套准 |
+| **同一张海报整体换色表示时间** | 高点里的两次重印:一把大刮板从下往上推过整张海报,推过的地方从中午色换成黄昏色——"7 h"这条数据被画出来了 |
+| **墨层厚度的微弱光泽** | 每块墨的左上边一道亮边、右下边一道暗边;刚刮过的湿墨在刮板后面亮一截,随后变哑 |
+| **纸是第七个颜色** | 第 2 张的瀑布不上墨,就是纸本身(从岩壁版里镂空) |
+
+## 五、镜头表
+
+| # | 时间 | 景别 | 角度 | 运动 | 为什么 |
+|---|---|---|---|---|---|
+| 1 | 0.0–1.0 | 特写(刮板 + 墨珠) | 俯拍,画面滚转 −2.6° | **跟移**:机位随刮板横移,刮板稳在画右三分之一 | 钩子:一开始就在动作中间;横移时色带是水平条纹,画面不晃,只有刮板和山脊在走,读得清 |
+| 2 | 1.0–4.8 | 全景(整条横幅) | 俯拍 | **急拉**到全景(0.65 s,ease-out),滚转归零;读片名时缓推 3.5% | 刮完一抬网版就给全貌;片名需要 3.2 s 阅读,镜头只做极慢的推 |
+| 3 | 4.8–5.4 | 全景 → 全景 | 俯拍 | **下摇**:从横幅摇到下方的新纸 | 同一张印刷台,空间连续;刮板声提前进(J-cut) |
+| 4 | 5.4–7.8 | 全景(整张海报 + 网框) | 俯拍 | 固定 | 四层逐拍印,固定机位才看得清"一层盖一层" |
+| 5 | 7.8–13.2 | 近景(信息带) | 俯拍 | **推** + 下摇到信息带;读数时缓推 2% | 网版一抬,镜头去读信息;名称、难度、距离、用时逐个亮 |
+| T | 12.9–13.5 | — | — | **穿越横移**:一棵近景松树从右向左擦过镜头 | 转场语法:穿过上一张的近景树影进入下一张(在媒介里:树影就是上一张近景版的墨色) |
+| 6 | 13.2–15.0 | 中近景(岩壁与瀑布) | 俯拍 | 缓慢横移 → **拉**到海报下半 | 八分音符快印,镜头往后退给出整幅瀑布;瀑布是纸白,退开才看出"没印的那一块就是水" |
+| 7 | 15.0–18.6 | 中景(下半张 + 信息带) | 俯拍 | 固定 | 读信息 |
+| T | 18.9–19.5 | — | — | 穿越横移(在静音里) | 同一套转场,第二次 |
+| 8 | 19.2–23.4 | 近景 → 中景,**一镜到底** | 平视画面(海报内) | **升**(沿步道从谷底升到山顶)+ 多层视差 + 山梁左右让开 + 轻微拉 | **签名镜头**。起步缓、中段匀速、到顶减速;中途两次整张重印(大刮板自下而上) |
+| 9 | 23.4–24.0 | 中景(山顶 + 太阳) | — | 停(各层悬着、微微错位) | 静音一拍,给"卡嗒"留位置 |
+| 10 | 24.0–29.4 | 近景(信息带) | — | **下摇**:从山顶一路摇到信息带(0.9 s) | "爬上去再看数据":1,100 m 的爬升最后落在信息带上 |
+| 11 | 29.4–34.8 | 近景 → 大全景 | 平视 | **拉**(对数缩放,1.2 s)到整面墙;停 4.2 s,极慢推 1.2% | 尺度揭示:原来这是挂在游客中心墙上的一套海报;落版 |
+| 12 | 34.8–38.4 | 全屏 | — | 一把刮板从左到右刮上一层深色墨,就是片尾卡 | 片尾也用印刷语法收 |
+
+镜头运动种类:跟移、急拉、下摇、推、穿越横移、升(带视差)、拉、滚转,共 8 种;景别从特写到大全景。
+**签名镜头**:#8 沿步道升到山脊的一镜到底(多层视差 + 两次整张重印)。
+**转场语法统一**:层与层之间 = 刮板;海报与海报之间 = 穿过近景树影;最后 = 拉出到墙;片尾 = 刮板。没有淡入淡出和硬切。
+
+## 六、分镜节拍表(按秒;时间线由 content.json 推出来,条目数变了会自动重排)
+
+| 时间 | 小节.拍 | 画面 | 信息层 | 读秒要求 → 实际停留 |
+|---|---|---|---|---|
+| 0.0 | 1.1 | 刮板已在横幅 30% 处,分色墨珠,湿墨反光 | — | — |
+| 1.0 | 1.3− | 刮到头,刮板抬走,网版以上沿为铰链抬起 | — | — |
+| 1.2–1.5 | 1.3 | 第二刮(深墨):片名 `3 TRAILS IN GRANITE VALLEY` | 片名 | 26 字 → 3.17 s;实际 1.6–4.8 = 3.2 s |
+| 1.35–1.6 | — | 页脚条 + `FREE TRAIL MAPS AT THE VISITOR CENTER`(小字,此刻不求读,落版时读) | — | — |
+| 4.8–5.4 | 3.1 | 下摇到印刷台上的新纸,网框已落下 | — | — |
+| 5.4 / 6.0 / 6.6 / 7.2 | 3.2 / 3.3 / 3.4 / 4.1 | 第 1 张(湖,清晨):天空(+ 半拍后色带和太阳)/ 远山 / 湖面与对岸林线 / 近景大松与岸石;每刮 0.45 s,刮板从上往下 | 画面 | — |
+| 7.8 | 4.2 | 网版抬起(铰链声),镜头推向信息带 | — | — |
+| 8.4 | 4.3 | 信息带底色从左往右刮上,步道虚线一段段印出 | — | — |
+| 9.0 | 4.4 | 名称 `LAKESHORE LOOP` + 编号 `01` + 页眉园区名 | 名称 | 14 字 → 2.17 s;实际 4.2 s |
+| 9.6 / 9.9 / 10.2 | 5.1 / 5.1& / 5.2 | 难度(三个小山形,实心 1 个)/ 距离 / 用时 | 数据 | 15 字 → 2.25 s;最后一项起 3.0 s |
+| 12.9–13.5 | 6.2 | 树影转场(13.2 过中点) | — | — |
+| 12.9 / 13.5 / 13.8 / 14.1 | 八分音符 | 第 2 张(瀑布,中午):天空(在树影下已刮上)/ 远峰 / 岩壁(瀑布镂空成纸白)/ 近景 | 画面 | — |
+| 14.4–15.1 | 7.1 | 拉开,瀑布全貌 | — | — |
+| 14.7 / 15.0 | 7.1& / 7.2 | 信息带 / 名称 `CASCADE FALLS TRAIL` `02` | 名称 | 19 字 → 2.58 s;实际 4.2 s |
+| 15.3 / 15.6 / 15.9 | — | 难度(实心 2)/ 7 KM / 3 H | 数据 | 17 字 → 2.42 s;实际 2.7 s |
+| 18.0 | 8.3 | 音乐停,瀑布声淡出 → **静音 1** | — | — |
+| 18.9–19.5 | 8.4 | 树影转场(19.2 过中点)(只有一声很轻的叶子擦过) | — | — |
+| 19.2 | 9.1 | 第 3 张(山脊)已印好,镜头在谷底;滑棒吉他一个上滑长音 = 静音后第一个声音 | — | — |
+| 19.2–23.4 | 9.1–10.4 | **签名镜头**:升。19.5 近景松林沉出画;20.2 第三道山梁向左让开;20.6 **重印 1**(中午 → 午后);21.0 第二道向右让开;22.0 **重印 2**(午后 → 黄昏);22.4 第一道向左让开;虚线步道随镜头印到山顶 | 画面 | — |
+| 23.4–24.0 | 10.4 | 山顶 + 落日,各层悬着微错位,**静音 2**(只有风) | — | — |
+| 24.0 | 11.1 | **卡嗒**:所有层一下套准 + 全乐队强拍(全片高点) | — | — |
+| 24.0–24.9 | 11.1–11.2 | 下摇到信息带 | — | — |
+| 24.6 / 24.9 | 11.2 / 11.2& | 信息带 / 名称 `SUMMIT RIDGE` `03` | 名称 | 12 字 → 2.0 s;实际 4.5 s |
+| 25.2 / 25.5 / 25.8 / 26.1 | 11.3–11.4& | 难度(实心 3)/ 14 KM / 7 H / ↑ 1,100 M(爬升用太阳色,全片唯一) | 数据 | 24 字 → 3.0 s;实际 3.3 s |
+| 29.4–30.6 | 13.3–13.4 | 拉出到墙 | — | — |
+| 30.6–34.8 | 13.4–15.2 | **落版**:横幅 + 三张海报,全部信息在场;30.6 起读页脚 | 页脚 | 37 字 → 4.08 s;实际 4.2 s |
+| 34.8–35.3 | 15.3 | 刮板刮上片尾卡底色 | — | — |
+| 35.3–38.4 | — | 片尾卡:片名、`Silkscreen Travel Poster`、`Lemo-Opuscar`、`LemoLab × Claude Opus 5.5`、字体与素材署名 | — | 3.1 s |
+
+## 七、Cue map(100 BPM;配乐:美式户外民谣)
+
+配器:开放 D 调弦木吉他(`pluck.py` 物理建模,DADF#AD)、滑棒吉他(numpy:锯齿 + 共鸣体滤波,音高连续滑动)、口琴(numpy:簧片方波 + 呼吸噪声 + 颤音)、轻底鼓(`sfx.thump`)、刷子军鼓、低音拨弦。**每一层印下 = 一声吉他扫弦**,扫弦的和弦沿 D – D/F# – G – A 往上走,层越近和弦越高。
+
+| 段 | 时间 | 小节 | 配器 / 状态 | 卡点 |
+|---|---|---|---|---|
+| Intro | 0–4.8 | 1–2 | 开场已在进行:开放 D 震音扫弦(持续)+ 口琴长音在 1.5 进 | 1.0 抬网版 = 闷音"chk";1.2 片名刮 = 底鼓 + 下扫弦;1.5 口琴 |
+| A(第 1 张) | 4.8–13.2 | 3–5.5 | 四分音符扫弦,每层一声(5.4 D / 6.0 D/F# / 6.6 G / 7.2 A);7.8 底鼓 + 低音进;之后 2、4 拍刷子 | 8.4 信息带 = 长下扫;9.0 名称 = 口琴短句;9.6/9.9/10.2 = 三个空弦单音(D–F#–A);12.6 树影 = 上扫耙弦 |
+| B(第 2 张) | 13.2–18.0 | 6–8.2 | **加速**:八分音符扫弦 + 四踩底鼓;滑棒短句穿插 | 12.9/13.5/13.8/14.1 每层一声短扫;15.0 名称 = 滑棒上滑;三个数据 = 单音 |
+| 静音 1 | 18.0–19.2 | 8.3–8.4 | 音乐全停,只剩瀑布声淡出和房间底噪 | — |
+| C(签名) | 19.2–23.4 | 9–10.3 | 19.2 滑棒上滑长音(静音后第一个声音);19.8 起乐队逐件加入(底鼓 → 低音 → 扫弦 → 口琴和弦),渐强 | 20.6 重印 1 = 刷弦耙音 + 低音上行;22.0 重印 2 = 更大的耙音 + 镲片刷;近景 / 山梁让开 = 每道一声滑棒 |
+| 静音 2 | 23.4–24.0 | 10.4 | 一拍全停,只有山顶风 | — |
+| 高点 | 24.0 | 11.1 | **卡嗒**(木 + 金属对位夹)+ 全乐队强拍 D 大和弦 | 全片最响的一拍 |
+| D(读数) | 24.0–29.4 | 11–13.2 | 全乐队律动一小节后收成吉他 + 口琴 | 24.6 信息带 = 长扫;24.9 名称 = 口琴;4 个数据 = 4 个单音(最后的 1,100 m 用高八度) |
+| 尾 | 29.4–34.8 | 13.3–15.2 | 呼吸:只剩吉他分解和弦 + 口琴收句,30.6 落在 D 大和弦上延音 | 30.6 落版 = 和弦落定 |
+| 片尾 | 34.8–38.4 | 15.3–16 | 最后一声扫弦的余音 + 口琴一个长音淡出 | 34.8 片尾卡刮板 = 轻扫 |
+
+**快慢变化**:A 段四分音符 → B 段八分音符(加速)→ 静音 → C 段一个 4.2 s 的长镜头(呼吸 + 渐强)→ 静音一拍 → 高点 → 尾段收成两件乐器(减速)。
+卡点自检:做片时导出 `EV`,参照 `styles/microgame` 的 cuecheck 核对每个刮板落点、信息亮起和音乐事件的误差(目标 ≤ 1 帧)。
+
+## 八、声音设计表
+
+| 段落 | 环境底 | 主要拟音(材质) | 音乐状态 |
+|---|---|---|---|
+| 横幅(0–4.8) | 印刷工作室:低频房间底噪、远处窗外鸟叫很轻 | 刮板刮网(橡胶在尼龙网纱上:带颗粒的中频"嘶",亮度随刮速)、墨珠挤压的湿"咕"、刮板离网的"啪"、网版铰链"咔 + 弹簧吱" | Intro 震音扫弦 + 口琴 |
+| 第 1 张(4.8–13.2) | 工作室底噪;7.8 网版抬起那一刻,**画里的清晨湖边**(水声、潜鸟一声)淡入,好像海报里的世界醒了 | 每层刮墨(四次,一次比一次短)、回墨刀"刷"、网版抬起、信息带刮墨(更长、更重)、数据块落下(短"嗒"+ 纸面闷响)、步道虚线(每段一个极小的"嗒",量化到十六分音符) | A 段,扫弦逐层上行 |
+| 转场 1(12.6–13.2) | **J-cut**:瀑布声从 12.3 开始从底下涨上来 | 松针擦过的沙沙 + 空气"呼" | 上扫耙弦 |
+| 第 2 张(13.2–18.0) | 瀑布轰鸣(粉噪 + 低频) | 四次快刮(短促)、信息带、三个数据块 | B 段加速 |
+| 静音 1(18.0–19.2) | 瀑布淡出 → 近乎无声;**J-cut**:18.6 山谷的风先进来 | 树影擦过只留一声极轻的叶响 | 全停 |
+| 签名(19.2–23.4) | 山风,随高度变强、变亮 | 虚线逐段"嗒"、山梁让开(纸面滑动的"嘶")、两次重印(最长最重的刮墨声) | C 段渐强 |
+| 静音 2(23.4–24.0) | 只有山顶的风 | — | 全停 |
+| 高点(24.0) | 风 | **卡嗒**:对位夹合上(木 + 金属),全片最重要的一声 | 全乐队强拍 |
+| 读数(24.0–29.4) | 风渐小 | 信息带、四个数据块 | D 段 |
+| 墙(29.4–34.8) | **L-cut**:山风延续到拉出墙面,再被游客中心的室内声(轻微人声嘈杂、远处门、木地板脚步)接过 | 墙上一枚图钉"嗒"(拉出到位时) | 尾段,和弦落定延音 |
+| 片尾(34.8–38.4) | 室内声淡出 | 片尾卡刮墨一声 | **L-cut**:最后扫弦的余音盖过片尾卡 |
+
+三层都在;两处静音(18.0–19.2、23.4–24.0),静音后的第一个声音分别是"滑棒上滑"和"卡嗒 + 全乐队";J-cut 两次(瀑布、山风),L-cut 两次(山风进墙面、扫弦余音进片尾)。混音:拟音优先,音乐在每次刮墨时让 2–3 dB(ducking)。
+
+## 九、字幕 / 文字设计
+
+- 无旁白、无字幕。文字全部是"印出来的一层":Big Shoulders Display 900(大标题、步道名、编号,窄体粗无衬线,接近 WPA 手绘标题字)+ Outfit(数据、标签、页脚,几何无衬线)。两者 OFL。
+- 信息带是固定模板:步道名(自动缩字号适配宽度)+ 右侧编号 + 太阳色分隔线 + 2–4 个数据项(难度 / 距离 / 用时 / 爬升,爬升为空就不出现,列宽自动平分)。
+- 每个数据项自己一刮(从左往右 0.18 s),不做淡入。
+
+## 十、content.json(本批核心交付,初稿在 `demo/content.json`)
+
+| 字段 | 内容 |
+|---|---|
+| `park`、`title`、`footer` | 园区名(每张海报页眉)、片名(横幅)、页脚(横幅底条,落版时读) |
+| `trails[]`(1–4 条) | `name`、`difficulty`(easy / moderate / hard)、`distance`、`time`、`elevation`(可空)、`scene`(lake / waterfall / ridge / forest / coast,引擎内置)、`time_of_day`(dawn / noon / golden / dusk / night) |
+| `palette` | `paper`、`wall`、每个时刻一套 6 色(`sky1 sky2 far mid near sun`,可选 `glow` 受光面色)、横幅色 `banner` |
+| `banner_time`、`units` | 横幅用哪套色;距离、爬升单位 |
+
+时间线规则(代码里已实现):第 1 条 = 完整印刷,中间各条 = 快印,最后一条 = 签名爬升;每段的停留按"字数 / 12 + 1 s"自动算,最短 1.5 s,并对齐到拍。1 条时只有完整印刷,没有爬升。
+
+## 十一、风格帧(关卡 1)
+
+- `demo/stills/frame_v1_1_hook.jpg`:开场钩子(t = 0.4 s)。分色刮板,身后天空色带刚铺满,湿墨反光,网纱纹理,刀口前方还是纸。
+- `demo/stills/frame_v1_2_signature.jpg`:签名镜头(t = 22.2 s)。爬升中的第二次重印:大刮板自下而上推过,下半张已是黄昏色,上半张还是午后色,虚线步道正印到半山。
+- `demo/stills/frame_v1_3_landing.jpg`:落版(t = 34 s)。游客中心木墙、横幅 + 三张海报,全部信息可读。
+- 关卡 1 后的新版:`frame_v2_1_hook.jpg`、`frame_v2_2_signature.jpg`、`frame_v2_3_landing.jpg`。
+
+## 十二、已知风险 / 没把握的地方
+
+1. **签名镜头的视差**:海报本来是平的,拆成层做视差时,观众可能读成"山在动"而不是"版在分开"。计划用"卡嗒"套准和到顶前的一拍静止把"它们是版"交代清楚;做片时要再看动态。
+2. **第 3 张不重演逐层印刷**:前两张已经教会观众"一层一拍",第三张把时间让给爬升;这张的"印"改成步道虚线逐段印出 + 两次整张重印。这是对派单构思的一个有意改动。
+3. 第 2 张(瀑布)的岩壁目前偏平,关卡 2 前再加切面细节。
+4. 时长 38.4 s 接近上限:按阅读时间规则,4 条步道会超过 40 s(STYLE.md 会写明 4 条时建议压缩什么)。
diff --git a/styles/silkscreen-poster/demo/CREDITS b/styles/silkscreen-poster/demo/CREDITS
new file mode 100644
index 0000000..3f11187
--- /dev/null
+++ b/styles/silkscreen-poster/demo/CREDITS
@@ -0,0 +1,17 @@
+Three Trails — Silkscreen Travel Poster demo · credits
+
+All artwork, poster designs, the park, trails and data are fictional and drawn by code in this folder (engine/, film.js). No generated images.
+
+Fonts (SIL Open Font License 1.1)
+- Big Shoulders Display — Patric King / The Chicago Design Collective — fonts/BigShouldersDisplay.ttf, license fonts/OFL-BigShouldersDisplay.txt — https://github.com/google/fonts/tree/main/ofl/bigshouldersdisplay
+- Outfit — Rodrigo Fuenzalida — fonts/Outfit.ttf, license fonts/OFL-Outfit.txt — https://github.com/google/fonts/tree/main/ofl/outfit
+- League Gothic — The League of Moveable Type (bundled, not used in the final cut) — fonts/LeagueGothic.ttf, license fonts/OFL-LeagueGothic.txt
+
+Music (music/compose.py; original, 100 BPM open-D folk)
+- Acoustic guitar: physical-model strums (core/audio/pluck.py); slide guitar: additive synthesis in numpy.
+- VCSL — Versilian Community Sample Library (CC0 1.0), https://github.com/sgossner/VCSL: harmonica, cajon, snare (brushes), shaker.
+- VSCO 2 Community Edition (CC0 1.0), https://github.com/sgossner/VSCO-2-CE: suspended cymbal.
+- Karoryfer Samples "Sneakybass" upright bass (CC0 1.0), https://github.com/sfzinstruments
+
+Sound effects and ambience
+- Synthesized in mix.py: squeegee on mesh, ink bead, screen hinge, paper stamps, registration clamp, pine brush, lake, waterfall, wind, visitor-center room.
diff --git a/styles/silkscreen-poster/demo/build.sh b/styles/silkscreen-poster/demo/build.sh
new file mode 100755
index 0000000..a66ba6e
--- /dev/null
+++ b/styles/silkscreen-poster/demo/build.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+# 从零重现《Three Trails》:sh styles/silkscreen-poster/demo/build.sh(任意目录运行)
+# 换内容:改 demo/content.json(或 CONTENT=content_alt.json)后重跑本脚本。无旁白,不需要 TTS。
+set -e
+cd "$(dirname "$0")/../../.."
+PY=.venv/bin/python; D=styles/silkscreen-poster/demo; O=styles/silkscreen-poster
+Q=""; [ -n "$CONTENT" ] && Q="content=$CONTENT"
+node $D/tools/timeline.mjs $CONTENT # 1. 打印时间线(由 content.json 推出)
+node core/render/events.mjs $D # 2. 画面事件 → events.json(默认 content.json)
+$PY $D/music/compose.py # 3. 配乐 → music/score.wav + stems
+$PY $D/mix.py # 4. 环境 + 拟音 + 配乐让路 → mix.wav
+$PY $D/tools/cuecheck.py # 5. 卡点自检
+G="" # 整机渲染限流已在 core/render/video.mjs 里
+$G node core/render/video.mjs $D --fps 24 --workers 2 ${Q:+--q $Q} --out $D/out/video24.mp4 # 6. 逐帧渲染(限流器)
+sh core/render/mux.sh $D/out/video24.mp4 $D/mix.wav $O/silkscreen-poster.mp4 24 3 # 7. −14 LUFS,颗粒 3
+node core/render/still.mjs $D 33 --out $D/out/still --prefix sf_ && cp $D/out/still/sf_33.jpg $D/stills/styleframe.jpg && cp $D/out/still/sf_33.jpg $O/poster.jpg
+node core/render/still.mjs $D 2.5 19.2 30.5 39.5 --q content=content_alt.json --prefix alt_ --out $D/out/alt # 8. 换内容静帧
diff --git a/styles/silkscreen-poster/demo/content.json b/styles/silkscreen-poster/demo/content.json
new file mode 100644
index 0000000..70a4b6d
--- /dev/null
+++ b/styles/silkscreen-poster/demo/content.json
@@ -0,0 +1,47 @@
+{
+ "park": "Granite Valley",
+ "title": "3 Trails in Granite Valley",
+ "kicker": "Visitor Center Trail Guide",
+ "footer": "Free trail maps at the Visitor Center",
+ "units": { "distance": "km", "elevation": "m" },
+ "trails": [
+ {
+ "name": "Lakeshore Loop",
+ "difficulty": "easy",
+ "distance": 3.2,
+ "time": "1 h",
+ "elevation": null,
+ "scene": "lake",
+ "time_of_day": "dawn"
+ },
+ {
+ "name": "Cascade Falls Trail",
+ "difficulty": "moderate",
+ "distance": 7,
+ "time": "3 h",
+ "elevation": null,
+ "scene": "waterfall",
+ "time_of_day": "noon"
+ },
+ {
+ "name": "Summit Ridge",
+ "difficulty": "hard",
+ "distance": 14,
+ "time": "7 h",
+ "elevation": 1100,
+ "scene": "ridge",
+ "time_of_day": "dusk"
+ }
+ ],
+ "banner_time": "banner",
+ "palette": {
+ "banner": { "sky1": "#F7C66B", "sky2": "#E4683F", "far": "#2F6F73", "mid": "#2F6F73", "near": "#1C2A33", "sun": "#FBE3A6", "glow": "#F7C66B" },
+ "paper": "#F2E8D2",
+ "wall": { "board": "#5E4432", "groove": "#3F2C21", "rail": "#8A6547" },
+ "dawn": { "sky1": "#F6CD98", "sky2": "#EE9A73", "far": "#9A7FA8", "mid": "#3E7079", "near": "#1E3B3F", "sun": "#FBE6B4" },
+ "noon": { "sky1": "#E4EEDC", "sky2": "#86BCD0", "far": "#C2AE92", "mid": "#4C8753", "near": "#1D4331", "sun": "#F2C14A", "glow": "#F0DFA6" },
+ "golden": { "sky1": "#F7D787", "sky2": "#E9A94F", "far": "#A57C68", "mid": "#5E7A45", "near": "#2B3A28", "sun": "#FFF1C4", "glow": "#F4C065" },
+ "dusk": { "sky1": "#F4B461", "sky2": "#D8613F", "far": "#7C3E5F", "mid": "#43325A", "near": "#1B1B2F", "sun": "#FBE3A6", "glow": "#E8683F" },
+ "night": { "sky1": "#3D4B72", "sky2": "#27304F", "far": "#4E5C82", "mid": "#232B45", "near": "#12152A", "sun": "#EDE6C8" }
+ }
+}
diff --git a/styles/silkscreen-poster/demo/content_alt.json b/styles/silkscreen-poster/demo/content_alt.json
new file mode 100644
index 0000000..0adfc99
--- /dev/null
+++ b/styles/silkscreen-poster/demo/content_alt.json
@@ -0,0 +1,56 @@
+{
+ "park": "Cedar Point Shores",
+ "title": "4 Walks on Cedar Point",
+ "kicker": "Harbor Inn Guest Guide",
+ "footer": "Ask the front desk for a tide table",
+ "units": { "distance": "km", "elevation": "m" },
+ "trails": [
+ {
+ "name": "Tidepool Walk",
+ "difficulty": "easy",
+ "distance": 2.4,
+ "time": "45 min",
+ "elevation": null,
+ "scene": "coast",
+ "time_of_day": "dawn"
+ },
+ {
+ "name": "Old Cedar Grove",
+ "difficulty": "easy",
+ "distance": 5,
+ "time": "2 h",
+ "elevation": 120,
+ "scene": "forest",
+ "time_of_day": "golden"
+ },
+ {
+ "name": "Harbor Lake Circuit",
+ "difficulty": "moderate",
+ "distance": 8.5,
+ "time": "3 h",
+ "elevation": null,
+ "scene": "lake",
+ "time_of_day": "noon"
+ },
+ {
+ "name": "Signal Hill Night Hike",
+ "difficulty": "hard",
+ "distance": 11,
+ "time": "5 h",
+ "elevation": 640,
+ "scene": "ridge",
+ "time_of_day": "night"
+ }
+ ],
+ "banner_time": "banner",
+ "palette": {
+ "paper": "#EFE9DA",
+ "wall": { "board": "#3E5058", "groove": "#2A383E", "rail": "#6E8A8F" },
+ "banner": { "sky1": "#BFE0DA", "sky2": "#3E8A9A", "far": "#E0A43C", "mid": "#E0A43C", "near": "#1E2B3A", "sun": "#F6E3B0", "glow": "#BFE0DA" },
+ "dawn": { "sky1": "#F7D9C2", "sky2": "#E7928A", "far": "#6A8FB0", "mid": "#3D6F8E", "near": "#22354A", "sun": "#FFF0D2", "glow": "#F7D9C2" },
+ "noon": { "sky1": "#E8F1E6", "sky2": "#7CB6CF", "far": "#D0B98E", "mid": "#3E8A6A", "near": "#17392E", "sun": "#EFC03E", "glow": "#F3E3AE" },
+ "golden": { "sky1": "#F8DC8E", "sky2": "#E59A3A", "far": "#8D6B4A", "mid": "#51683A", "near": "#26301F", "sun": "#FFF3C9", "glow": "#F6C35A" },
+ "dusk": { "sky1": "#F4B461", "sky2": "#D8613F", "far": "#7C3E5F", "mid": "#43325A", "near": "#1B1B2F", "sun": "#FBE3A6", "glow": "#E8683F" },
+ "night": { "sky1": "#46598A", "sky2": "#28325A", "far": "#6C7BA8", "mid": "#2D3659", "near": "#11152A", "sun": "#F3EACB", "glow": "#9FB2E0" }
+ }
+}
diff --git a/styles/silkscreen-poster/demo/engine/poster.js b/styles/silkscreen-poster/demo/engine/poster.js
new file mode 100644
index 0000000..91d108d
--- /dev/null
+++ b/styles/silkscreen-poster/demo/engine/poster.js
@@ -0,0 +1,225 @@
+// poster.js · 旅行海报版式:场景层 + 页眉 + 底部标准信息带(名称、难度、距离、用时、爬升)+ 横幅
+// 所有文案来自 content.json;这里只负责排版和"怎么印上去"
+import { hex2rgb, ink, wipeRegion, wipeFront, inkFinish, paperSheet, texFill, rectPath, polyPath, circlePath, ringPath, clamp, lerp, hash } from './silk.js';
+import { buildScene, PW, PH, ART } from './scenes.js';
+
+export { PW, PH, ART };
+const FONT_D = 'BigShoulders', FONT_T = 'Outfit';
+const LEVEL = { easy: 1, moderate: 2, hard: 3, expert: 3 };
+
+function fitFont(ctx, text, weight, family, maxW, maxS, minS, ls = 0) {
+ let s = maxS;
+ for (; s > minS; s -= 2) { ctx.font = `${weight} ${s}px ${family}`; ctx.letterSpacing = (ls * s) + 'px'; if (ctx.measureText(text).width <= maxW) break; }
+ return s;
+}
+const fmtNum = (v) => typeof v === 'number' ? v.toLocaleString('en-US') : String(v);
+
+// 统计项:按 content 生成(elevation 为空就不出现)
+export function statItems(trail, units = { distance: 'km', elevation: 'm' }) {
+ const it = [];
+ it.push({ key: 'difficulty', label: 'LEVEL', value: String(trail.difficulty || '').toUpperCase(), level: LEVEL[(trail.difficulty || '').toLowerCase()] || 1 });
+ if (trail.distance != null) it.push({ key: 'distance', label: 'DISTANCE', value: `${fmtNum(trail.distance)} ${units.distance.toUpperCase()}` });
+ if (trail.time) it.push({ key: 'time', label: 'TIME', value: String(trail.time).toUpperCase() });
+ if (trail.elevation != null) it.push({ key: 'elevation', label: 'CLIMB', value: `↑${fmtNum(trail.elevation)} ${units.elevation.toUpperCase()}`, climb: true });
+ return it;
+}
+// 一条信息的最短停留(BRIEF_SCENE:字数/12 + 1,最少 1.5s)
+export const readTime = (s) => Math.max(1.5, String(s).length / 12 + 1);
+
+export function buildPoster(content, trail, idx, n) {
+ const sc = buildScene(trail.scene, 11 + idx * 17);
+ const items = statItems(trail, content.units);
+ // 步道折线累计长度
+ let L = 0; const tr = sc.trail.map((q, i, a) => { if (i) L += Math.hypot(q.x - a[i - 1].x, q.y - a[i - 1].y); return { ...q, s: L }; });
+ return { sc, trail, items, idx, n, paper: content.palette.paper, park: content.park, trailPts: tr, trailLen: L, seed: idx * 13 + 5 };
+}
+
+// 步道虚线(只画 plane 这一段,reveal = 已印出的弧长比例)
+function trailDashes(ctx, P, plane, reveal, color) {
+ const pts = P.trailPts, maxS = reveal * P.trailLen, dash = 16, gap = 12;
+ ctx.save(); ctx.strokeStyle = color; ctx.lineWidth = 7; ctx.lineCap = 'butt';
+ for (let i = 1; i < pts.length; i++) {
+ const a = pts[i - 1], b = pts[i]; if (b.plane !== plane && a.plane !== plane) continue;
+ if (b.plane !== plane) continue;
+ const len = b.s - a.s;
+ for (let s = Math.ceil(a.s / (dash + gap)) * (dash + gap); s < b.s && s < maxS; s += dash + gap) {
+ const t0 = (s - a.s) / len, t1 = Math.min(1, (Math.min(s + dash, maxS) - a.s) / len);
+ ctx.beginPath(); ctx.moveTo(lerp(a.x, b.x, t0), lerp(a.y, b.y, t0)); ctx.lineTo(lerp(a.x, b.x, t1), lerp(a.y, b.y, t1)); ctx.stroke();
+ }
+ }
+ ctx.restore();
+}
+
+
+// 对比度:按 WCAG 相对亮度挑一块与底色对比够的墨(换内容/换配色时文字不会"隐身")
+const lum = (h) => { const c = hex2rgb(h).map(v => { v /= 255; return v <= .03928 ? v / 12.92 : Math.pow((v + .055) / 1.055, 2.4); }); return .2126 * c[0] + .7152 * c[1] + .0722 * c[2]; };
+export const contrast = (a, b) => { const x = lum(a), y = lum(b); return (Math.max(x, y) + .05) / (Math.min(x, y) + .05); };
+export function pickInk(bgs, cands, need = 3) { bgs = [].concat(bgs); for (const c of cands) if (c && bgs.every(b => contrast(c, b) >= need)) return c; return cands.filter(Boolean).sort((a, b) => Math.min(...bgs.map(x => contrast(b, x))) - Math.min(...bgs.map(x => contrast(a, x))))[0]; }
+// ---- 版式常量 ----
+// 画面区到 y=1140;场景整体上移 SHIFT(裁掉一点天空),让出更高的信息带
+export const ARTV = [26, 26, 948, 1114], SHIFT = 50, BAND = [26, 1148, 948, 326];
+const NAME_Y = 1262, RULE_Y = 1290, LABEL_Y = 1348, VALUE_Y = 1440;
+
+// 旋转坐标系下的拉墨区域(换色重印用,斜着推)
+function tiltedWipe(ctx, p, angle, seed) {
+ const m = ctx.getTransform();
+ ctx.translate(PW / 2, PH / 2); ctx.rotate(angle); ctx.translate(-PW / 2, -PH / 2);
+ const box = [-400, -300, PW + 800, PH + 600];
+ ctx.clip(wipeRegion(box, 'up', p, seed, 50, 7));
+ ctx.setTransform(m);
+}
+export function swapFrontLine(p, angle) { // 刮板位置(海报坐标):返回刀口两端
+ const box = [-400, -300, PW + 800, PH + 600], y = wipeFront(box, 'up', p, 50);
+ const c = Math.cos(angle), s = Math.sin(angle), rot = (x, yy) => { const dx = x - PW / 2, dy = yy - PH / 2; return [PW / 2 + dx * c - dy * s, PH / 2 + dx * s + dy * c]; };
+ return [rot(-400, y), rot(PW + 400, y)];
+}
+
+// ---- 画一张海报(在当前变换下,海报单位) ----
+// st: { pal, T, prog(id)->0..1, off(id)->[dx,dy], reg, sep(0..1 纸版分离感), trail, band, name, header, items[], swap:{pal,p,angle}, finish }
+export function drawPoster(ctx, P, st) {
+ paperSheet(ctx, st.T, 0, 0, PW, PH);
+ body(ctx, P, st, st.pal);
+ if (st.swap && st.swap.p > 0) {
+ ctx.save(); tiltedWipe(ctx, st.swap.p, st.swap.angle ?? -.2, 7 + P.idx);
+ paperSheet(ctx, st.T, 0, 0, PW, PH);
+ body(ctx, P, st, st.swap.pal);
+ ctx.restore();
+ }
+ if (st.finish !== false) inkFinish(ctx, st.T, 0, 0, PW, PH, .6, 1);
+}
+const R2 = (seed, k, amp) => [(hash(seed * 3.1 + k) - .5) * 2 * amp, (hash(seed * 7.7 + k * 1.3) - .5) * 2 * amp];
+
+function body(ctx, P, st, pal) {
+ const prog = st.prog || (() => 1), off = st.off || (() => [0, 0]), regAmt = st.reg ?? 1, sep = st.sep || 0;
+ ctx.save(); ctx.beginPath(); ctx.rect(ARTV[0], ARTV[1], ARTV[2], ARTV[3]); ctx.clip();
+ ctx.translate(0, -SHIFT);
+ P.sc.planes.forEach((pl, k) => {
+ const p = prog(pl.id); if (p <= 0) return;
+ const [ox, oy] = off(pl.id, pl);
+ ctx.save(); ctx.translate(ox, oy);
+ const box = [ART[0] - ox, ART[1] - oy - 60, ART[2], ART[3] + 180];
+ // 纸版分离:这块版的轮廓往上错一点印一道纸白缝,再往上一道纸厚阴影(落在下层上)
+ if (sep > 0 && k > 1 && p >= 1) {
+ const sil = pl.parts[0].path;
+ ctx.save(); ctx.translate(0, -9 * sep); ctx.globalAlpha = .28 * Math.min(1, sep * 1.5); ctx.fillStyle = '#140f14'; ctx.fill(sil); ctx.restore();
+ ctx.save(); ctx.translate(1.5 * sep, -3.2 * sep); ctx.fillStyle = P.paper; ctx.fill(sil); ctx.restore();
+ }
+ pl.parts.forEach((pt, j) => {
+ const pp = pt.sub ? clamp(p * 1.35 - .35) : clamp(p * 1.35); // 点缀色晚半拍
+ if (pp <= 0) return;
+ const reg = R2(P.seed + k * 5 + j, 1, 2.2 * regAmt);
+ ink(ctx, pt, { color: pal[pt.ink] || (pt.ink === 'glow' ? pal.sky2 : pal.far), reg, clip: pp < 1 ? wipeRegion(box, st.dir || 'down', pp, P.seed + k * 3 + j, 30, 5) : null, sheen: 1, trap: 1, lw: 1.8 });
+ });
+ if (st.trail != null ? st.trail > 0 : true) {
+ const rv = st.trail ?? 1;
+ ctx.save(); ctx.translate(...R2(P.seed + 91, 1, 1.5 * regAmt)); trailDashes(ctx, P, pl.id, rv, pal.sun); ctx.restore();
+ }
+ ctx.restore();
+ });
+ ctx.restore();
+ // 页眉:园区名(印在天空上)
+ const hp = st.header ?? 1;
+ if (hp > 0) {
+ ink(ctx, { paint: (c) => { c.font = `800 62px ${FONT_D}`; c.letterSpacing = '14px'; c.textAlign = 'center'; c.textBaseline = 'alphabetic'; c.fillText(P.park.toUpperCase(), PW / 2 + 7, 112); } },
+ { color: pickInk([pal.sky2, pal.sky1], [pal.near, pal.sun, pal.sky1], 3), reg: R2(P.seed + 44, 1, 1.4 * regAmt), clip: hp < 1 ? wipeRegion([0, 40, PW, 100], 'right', hp, 3) : null });
+ }
+ // 信息带
+ const bp = st.band ?? 1;
+ if (bp > 0) {
+ ink(ctx, { path: rectPath(...BAND) }, { color: pal.near, reg: R2(P.seed + 51, 1, 1.2 * regAmt), clip: bp < 1 ? wipeRegion(BAND, 'right', bp, 9, 40) : null, sheen: 1 });
+ }
+ const np = st.name ?? 1;
+ if (np > 0) {
+ ink(ctx, { paint: (c) => {
+ const s = fitFont(c, P.trail.name.toUpperCase(), 900, FONT_D, 690, 122, 60, .01);
+ c.textAlign = 'left'; c.textBaseline = 'alphabetic'; c.fillText(P.trail.name.toUpperCase(), 64, NAME_Y);
+ } }, { color: pickInk(pal.near, [pal.sky1, pal.sun, pal.glow], 4.5), reg: R2(P.seed + 61, 1, 1.4 * regAmt), clip: np < 1 ? wipeRegion([40, 1150, 900, 130], 'right', np, 21, 30) : null });
+ ink(ctx, { paint: (c) => { c.font = `900 122px ${FONT_D}`; c.letterSpacing = '0px'; c.textAlign = 'right'; c.fillText(String(P.idx + 1).padStart(2, '0'), 938, NAME_Y); } },
+ { color: pal.sun, reg: R2(P.seed + 62, 1, 1.4 * regAmt), clip: np < 1 ? wipeRegion([780, 1150, 170, 130], 'down', np, 23, 30) : null });
+ ink(ctx, { path: rectPath(64, RULE_Y, 874, 6) }, { color: pal.sun, reg: R2(P.seed + 63, 1, 1.2 * regAmt), clip: np < 1 ? wipeRegion([60, RULE_Y - 10, 880, 26], 'right', np, 5, 20) : null });
+ }
+ // 统计项:一行 n 列;标签 38u(墙上 ≥18 px),数值 64u 窄体(墙上 ≥30 px);列宽按内容分配
+ const L = statLayout(ctx, P);
+ P.items.forEach((it, i) => {
+ const ip = st.items ? (st.items[i] ?? 0) : 1; if (ip <= 0) return;
+ const x = L.xs[i], cw = L.ws[i], box = [x - 6, LABEL_Y - 44, cw + 12, 150];
+ const clip = ip < 1 ? wipeRegion(box, 'right', ip, 31 + i, 24) : null;
+ ink(ctx, { paint: (c) => { c.font = `600 ${L.ls}px ${FONT_T}`; c.letterSpacing = (L.ls * .1) + 'px'; c.textAlign = 'left'; c.fillText(it.label, x, LABEL_Y); } },
+ { color: pickInk(pal.near, [pal.sky2, pal.glow, pal.far, pal.sky1], 3), reg: R2(P.seed + 70 + i, 1, 1.2 * regAmt), clip });
+ ink(ctx, { paint: (c) => {
+ let tx = x;
+ if (it.key === 'difficulty') { icons(c, x, it.level, L.vs); tx = x + L.vs * 1.3; }
+ c.font = `800 ${L.vs}px ${FONT_D}`; c.letterSpacing = (L.vs * .01) + 'px'; c.textAlign = 'left'; c.fillText(it.value, tx, VALUE_Y);
+ } }, { color: it.climb || it.key === 'difficulty' ? pickInk(pal.near, [pal.sun, pal.sky1], 4.5) : pickInk(pal.near, [pal.sky1, pal.sun, pal.glow], 4.5), reg: R2(P.seed + 80 + i, 1, 1.2 * regAmt), clip });
+ });
+}
+function icons(c, x, level, vs) { // 三个小山形:实心 = 难度级
+ const w = vs * .34, h = vs * .52, g = vs * .4;
+ for (let k = 0; k < 3; k++) {
+ const px = x + k * g; c.beginPath(); c.moveTo(px, VALUE_Y); c.lineTo(px + w / 2, VALUE_Y - h); c.lineTo(px + w, VALUE_Y); c.closePath();
+ if (k < level) c.fill(); else { c.save(); c.lineWidth = vs * .055; c.strokeStyle = c.fillStyle; c.globalAlpha *= .6; c.stroke(); c.restore(); }
+ }
+}
+function statLayout(ctx, P) {
+ if (P._stat) return P._stat;
+ const x0 = 64, x1 = 938, avail = x1 - x0, n = P.items.length;
+ let vs = 68, ls = 38, ws;
+ for (; ; vs -= 2, ls = Math.max(34, ls - 1)) {
+ ctx.save();
+ ws = P.items.map(it => {
+ ctx.font = `600 ${ls}px ${FONT_T}`; ctx.letterSpacing = (ls * .1) + 'px'; const lw = ctx.measureText(it.label).width;
+ ctx.font = `800 ${vs}px ${FONT_D}`; ctx.letterSpacing = (vs * .01) + 'px'; const vw = ctx.measureText(it.value).width + (it.key === 'difficulty' ? vs * 1.3 : 0);
+ return Math.max(lw, vw);
+ });
+ ctx.restore();
+ if (ws.reduce((a, b) => a + b, 0) + (n - 1) * 30 <= avail || vs <= 48) break;
+ }
+ const gap = n > 1 ? (avail - ws.reduce((a, b) => a + b, 0)) / (n - 1) : 0;
+ const xs = []; let x = x0; ws.forEach(w => { xs.push(x); x += w + Math.min(gap, 140); });
+ return (P._stat = { xs, ws, vs, ls });
+}
+
+// ---- 横幅(片名):1800×440 单位(约 4:1;开场贴近时撑满画宽、占画高约 40%) ----
+export const BW = 1800, BH = 440, BANNER_ART = [14, 14, 1772, 360];
+export const BANNER_BANDS = { sky2: [0, 150], sky1: [150, 300], far: [300, 374] }; // 分色刮的墨珠分段
+function splitTitle(ctx, text, family, size) { // 两行:按宽度最均衡的断点
+ const w = text.split(' '); if (w.length < 2) return [text];
+ ctx.font = `900 ${size}px ${family}`; let best = null;
+ for (let i = 1; i < w.length; i++) { const a = w.slice(0, i).join(' '), b = w.slice(i).join(' '); const d = Math.max(ctx.measureText(a).width, ctx.measureText(b).width); if (!best || d < best.d) best = { d, l: [a, b] }; }
+ return best.l;
+}
+export function drawBanner(ctx, content, st) {
+ const pal = st.pal, T = st.T;
+ paperSheet(ctx, T, 0, 0, BW, BH);
+ const sp = st.sky ?? 1;
+ ctx.save(); ctx.beginPath(); ctx.rect(...BANNER_ART); ctx.clip();
+ if (sp > 0) {
+ const clip = sp < 1 ? wipeRegion([0, 0, BW, BH], 'right', sp, 4, 34, 4) : null;
+ ink(ctx, { path: rectPath(0, 0, BW, BH), knock: ringPath(1590, 300, 118, 132) }, { color: pal.sky1, reg: [0, 0], clip, sheen: 1 });
+ const top = new Path2D(); top.rect(0, 0, BW, 96);
+ for (let i = 0; i < 5; i++) { const cell = 22, th = cell * (1 - (i + .5) / 5) * .95 + 1.5; top.rect(0, 96 + i * cell, BW, th); }
+ ink(ctx, { path: top }, { color: pal.sky2, reg: [1.2, .6], clip, sheen: 1, trap: .35 });
+ ink(ctx, { path: circlePath(1590, 300, 96) }, { color: pal.sun || pal.sky1, reg: [2, 1], clip, sheen: 1 });
+ const mt = []; mt.push([-10, 400]); for (let x = 0; x <= BW + 20; x += 20) { const y = 352 - 44 * Math.abs(Math.sin(x * .0035 + 1.3)) - 22 * Math.abs(Math.sin(x * .011)); mt.push([x, y]); } mt.push([BW + 20, 400]);
+ ink(ctx, { path: polyPath(mt) }, { color: pal.far, reg: [-.8, 1], clip, sheen: 1 });
+ }
+ ctx.restore();
+ const tp = st.title ?? 1;
+ if (tp > 0) {
+ ink(ctx, { paint: (c) => {
+ const T0 = content.title.toUpperCase(); let size = 150, lines = splitTitle(c, T0, FONT_D, size);
+ if (lines.length === 1) { size = fitFont(c, T0, 900, FONT_D, BW - 200, 170, 60, .02); }
+ else { c.font = `900 ${size}px ${FONT_D}`; c.letterSpacing = (size * .02) + 'px'; const m = Math.max(...lines.map(l => c.measureText(l).width)); if (m > BW - 200) size = Math.floor(size * (BW - 200) / m); c.font = `900 ${size}px ${FONT_D}`; c.letterSpacing = (size * .02) + 'px'; }
+ c.textAlign = 'center'; c.textBaseline = 'alphabetic';
+ if (lines.length === 1) c.fillText(T0, BW / 2, 200 + size * .35);
+ else { c.fillText(lines[0], BW / 2, 160); c.fillText(lines[1], BW / 2, 160 + size * .98); }
+ } }, { color: pickInk([pal.sky1, pal.sky2], [pal.near, pal.far], 3), reg: [1.5, -1], clip: tp < 1 ? wipeRegion([0, 20, BW, 330], 'right', tp, 17, 40) : null });
+ }
+ const fp = st.footer ?? 1;
+ if (fp > 0) {
+ const clip = fp < 1 ? wipeRegion([0, 378, BW, 56], 'right', fp, 19, 30) : null;
+ ink(ctx, { path: rectPath(14, 382, BW - 28, 44) }, { color: pal.near, reg: [0, 0], clip, sheen: 1 });
+ ink(ctx, { paint: (c) => { c.font = `600 25px ${FONT_T}`; c.letterSpacing = '9px'; c.textAlign = 'center'; c.fillText(content.footer.toUpperCase(), BW / 2, 413); } }, { color: pickInk(pal.near, [pal.sky1, pal.sun], 4.5), reg: [.8, .6], clip });
+ }
+ if (st.finish !== false) inkFinish(ctx, T, 0, 0, BW, BH, .6, 1);
+}
diff --git a/styles/silkscreen-poster/demo/engine/scenes.js b/styles/silkscreen-poster/demo/engine/scenes.js
new file mode 100644
index 0000000..4a5f20c
--- /dev/null
+++ b/styles/silkscreen-poster/demo/engine/scenes.js
@@ -0,0 +1,219 @@
+// scenes.js · 引擎内置场景:lake / waterfall / ridge / forest / coast
+// 每个场景返回按印刷顺序排好的"层"(plane):{ id, depth, parts:[{ ink, path, knock?, sub }] }
+// ink = 调色板键(sky1 sky2 far mid near sun),sub = 同一节拍里的第几刮(0 主色,1 点缀色,晚半拍)
+// depth:视差系数(1 = 纸面;<1 更远;>1 更近),只在"分层视差"镜头里用
+// 另返回 trail:步道折线 [{x,y,plane}],按所在层分段,虚线由海报层画
+// 坐标:海报单位,画幅 1000×1500,画面区 x 26..974、y 26..1190(其余为纸边和信息带)
+import { mulberry, polyPath, circlePath, ringPath, rectPath, unionPath, ridgeLine, bandSteps, lerp } from './silk.js';
+
+export const PW = 1000, PH = 1500, ART = [26, 26, 948, 1164];
+
+// ---- 形状积木 ----
+function pine(p, x, base, h, w, tiers = 4) { // 一棵程式化松树:层层下垂的枝盘 + 短树干,一条外轮廓
+ const tw = Math.max(3, w * .06), trunkTop = base - h * .1;
+ const R = [[x, base - h]];
+ for (let i = 0; i < tiers; i++) {
+ const t = (i + 1) / tiers;
+ const yb = base - h * .1 - (h * .9) * (1 - t) * .98; // 这一盘的下沿
+ const hw = w / 2 * (.28 + .72 * t); // 半宽:越往下越宽
+ R.push([x + hw, yb + h * .012]); // 下垂的枝梢
+ if (i < tiers - 1) R.push([x + hw * .42, yb - h * .02]); // 收回到下一盘的起点
+ }
+ R.push([x + tw, trunkTop], [x + tw, base + 6]);
+ const L = R.slice(1).reverse().map(q => [2 * x - q[0], q[1]]);
+ const pts = R.concat(L);
+ pts.forEach((q, i) => i ? p.lineTo(q[0], q[1]) : p.moveTo(q[0], q[1])); p.closePath();
+}
+function forest(x0, x1, base, hmin, hmax, seed, dense = 1, bottom = 1500) { // 一排松林 + 实底
+ const p = new Path2D(), r = mulberry(seed);
+ p.rect(x0 - 40, base, x1 - x0 + 80, bottom - base);
+ let x = x0 - 20;
+ while (x < x1 + 30) { const h = lerp(hmin, hmax, r()), w = h * (.34 + r() * .12); pine(p, x, base + 4, h, w, 3 + (r() * 3 | 0)); x += w * (.42 + r() * .35) / dense; }
+ return p;
+}
+function range(x0, x1, yBase, peaks, seed, rough = 22) { // 山脉剪影:peaks=[[x,y],...]
+ const pts = [[x0 - 30, yBase], [x0 - 30, peaks[0][1] + 60]];
+ let prev = [x0 - 30, peaks[0][1] + 60];
+ for (let i = 0; i < peaks.length; i++) { const seg = ridgeLine(prev, peaks[i], rough, 3, seed + i); pts.push(...seg.slice(1)); prev = peaks[i]; }
+ const end = [x1 + 30, peaks[peaks.length - 1][1] + 80]; pts.push(...ridgeLine(prev, end, rough, 3, seed + 99).slice(1));
+ pts.push([x1 + 30, yBase]);
+ return { path: polyPath(pts), pts };
+}
+// 受光面:每座峰从峰顶沿一侧往下的锯齿块(WPA 的两色山体)
+function facets(peaks, side, depth, seed, jag = 18) {
+ const p = new Path2D(), r = mulberry(seed);
+ for (const [x, y] of peaks) {
+ const d = depth * (.8 + r() * .5), sx = side * d * .75;
+ const pts = [[x, y]];
+ const n = 5;
+ for (let i = 1; i <= n; i++) { const t = i / n; pts.push([x + sx * t + (r() - .5) * jag, y + d * t]); pts.push([x + sx * t * .45 + side * jag * .3, y + d * t + jag * .5]); }
+ pts.push([x + side * 4, y + d * 1.05]);
+ pts.forEach((q, i) => i ? p.lineTo(q[0], q[1]) : p.moveTo(q[0], q[1])); p.closePath();
+ }
+ return p;
+}
+function sunParts(x, y, r, rings = 1) {
+ const knock = new Path2D(); knock.addPath(circlePath(x, y, r + 5));
+ for (let i = 0; i < rings; i++) knock.addPath(ringPath(x, y, r + 22 + i * 30, r + 32 + i * 30));
+ return { knock, disc: circlePath(x, y, r) };
+}
+function skyPlane(sunKnock, bandTop, bandBot, extraTop = 0) {
+ const flood = rectPath(-60, -60 - extraTop, PW + 120, 1700 + extraTop);
+ const top = new Path2D(); top.rect(-60, -60 - extraTop, PW + 120, bandTop + 60 + extraTop); top.addPath(bandSteps(-60, PW + 120, bandTop, bandBot, 5, 10));
+ return { id: 'sky', depth: .15, parts: [{ ink: 'sky1', path: flood, knock: sunKnock, sub: 0 }, { ink: 'sky2', path: top, sub: 1 }] };
+}
+function wavesPath(x0, x1, y0, y1, n, seed, len = 60) { // 水面反光:横向短条
+ const p = new Path2D(), r = mulberry(seed);
+ for (let i = 0; i < n; i++) { const y = lerp(y0, y1, Math.pow(r(), 1.3)), l = len * (.4 + r()) * (.4 + (y - y0) / (y1 - y0)), x = lerp(x0, x1, r()), th = 2.5 + (y - y0) / (y1 - y0) * 5; p.rect(x, y, l, th); }
+ return p;
+}
+
+// ================= LAKE(湖) =================
+function lake(seed) {
+ const sun = sunParts(640, 575, 92, 2);
+ const peaks = [[120, 430], [300, 360], [470, 455], [610, 400], [800, 470], [930, 420]];
+ const R = range(0, PW, 760, peaks, seed + 3, 26);
+ const lakeTop = 660;
+ const shore = forest(-40, 1040, 668, 26, 58, seed + 5, 1.3, 700);
+ const lakeP = rectPath(-60, lakeTop, PW + 120, 900);
+ const glints = new Path2D();
+ for (let i = 0; i < 12; i++) { const y = 690 + i * 22 + i * i * 1.6, w = 170 - i * 9 + (i % 3) * 18; glints.rect(640 - w / 2 + ((i * 37) % 23) - 11, y, w, 4 + i * .7); }
+ const refl = wavesPath(40, 900, 700, 1000, 22, seed + 7, 70);
+ // 近景:左侧大松 + 右侧松 + 前景岸石
+ const near = new Path2D();
+ pine(near, 110, 1250, 1080, 330, 7); pine(near, 250, 1260, 760, 250, 6); pine(near, -20, 1250, 900, 300, 6);
+ pine(near, 905, 1250, 820, 270, 6); pine(near, 1010, 1250, 1000, 300, 7);
+ near.addPath(polyPath([[-60, 1030], [140, 1000], [300, 1022], [420, 1060], [560, 1045], [720, 1070], [860, 1020], [1060, 1000], [1060, 1600], [-60, 1600]]));
+ near.addPath(polyPath([[560, 1045], [610, 990], [690, 975], [760, 1010], [790, 1060]])); // 岸边大石
+ const rockLit = polyPath([[610, 990], [690, 975], [705, 1000], [640, 1012]]);
+ const trail = [[500, 1200], [470, 1150], [520, 1110], [640, 1090], [780, 1100], [880, 1080], [990, 1060]].map(q => ({ x: q[0], y: q[1], plane: 'near' }));
+ return {
+ planes: [
+ skyPlane(sun.knock, 150, 360),
+ { id: 'sun', depth: .15, parts: [{ ink: 'sun', path: sun.disc, sub: 0 }] },
+ { id: 'far', depth: .35, parts: [{ ink: 'far', path: R.path, sub: 0 }, { ink: 'sky2', path: facets(peaks, 1, 110, seed + 11, 14), sub: 1 }] },
+ { id: 'mid', depth: .7, parts: [{ ink: 'sky2', path: lakeP, sub: 0 }, { ink: 'sun', path: glints, sub: 1 }, { ink: 'sky1', path: refl, sub: 1 }, { ink: 'mid', path: shore, sub: 0 }] },
+ { id: 'near', depth: 1.5, parts: [{ ink: 'near', path: near, sub: 0 }, { ink: 'mid', path: rockLit, sub: 1 }] },
+ ], trail, sun: [640, 575],
+ };
+}
+
+// ================= WATERFALL(瀑布) =================
+function waterfall(seed) {
+ const sun = sunParts(810, 190, 52, 1);
+ const peaks = [[90, 330], [260, 280], [430, 350], [640, 300], [860, 360]];
+ const R = range(0, PW, 700, peaks, seed + 3, 20);
+ // 峭壁:左右两块 + 后壁,中间 V 口出水;岩面用三块大切面(WPA 的刻面山石)
+ const cliff = polyPath([[-60, 430], [120, 398], [260, 412], [380, 440], [452, 478], [470, 520], [530, 520], [550, 476], [640, 452], [780, 424], [900, 440], [1060, 420], [1060, 1300], [-60, 1300]]);
+ const fall = polyPath([[470, 516], [530, 516], [538, 600], [552, 760], [578, 950], [422, 950], [448, 760], [462, 600]]);
+ const shadows = unionPath([
+ polyPath([[-60, 440], [120, 398], [70, 520], [130, 640], [60, 780], [140, 920], [80, 1000], [-60, 1000]]),
+ polyPath([[1060, 420], [900, 440], [950, 560], [880, 700], [960, 840], [900, 1000], [1060, 1000]]),
+ polyPath([[380, 441], [452, 478], [463, 600], [449, 760], [423, 950], [352, 950], [392, 770], [404, 600], [370, 520]]),
+ polyPath([[550, 476], [640, 453], [612, 540], [602, 700], [622, 850], [646, 950], [578, 950], [552, 760], [538, 600]])]);
+ const lit = new Path2D(); lit.addPath(polyPath([[120, 398], [260, 412], [380, 440], [452, 478], [456, 492], [380, 456], [260, 424], [124, 410]])); lit.addPath(polyPath([[550, 476], [640, 452], [780, 424], [900, 440], [900, 452], [780, 437], [640, 465], [552, 490]]));
+ const streaks = new Path2D(); for (let i = 0; i < 5; i++) { const x0 = 480 + i * 10, x1 = 452 + i * 24; streaks.addPath(polyPath([[x0, 560 + i * 20], [x0 + 3, 560 + i * 20], [x1 + 4, 940], [x1, 940]])); }
+ const topForest = unionPath([forest(-40, 230, 418, 40, 84, seed + 6, .8, 424), forest(700, 1040, 448, 40, 88, seed + 7, .8, 452)]);
+ const pool = new Path2D(); pool.ellipse(500, 985, 250, 48, 0, 0, Math.PI * 2);
+ const foam = new Path2D();
+ for (let i = 0; i < 2; i++) { const rx = 150 + i * 70, y = 978 + i * 18; foam.moveTo(500 - rx, y); foam.quadraticCurveTo(500, y + 10, 500 + rx, y); foam.quadraticCurveTo(500, y + 16, 500 - rx, y); foam.closePath(); }
+ foam.addPath(polyPath([[422, 950], [578, 950], [600, 968], [400, 968]]));
+ const slopeForest = unionPath([forest(-40, 300, 1010, 90, 170, seed + 8, .8, 1300), forest(700, 1040, 1000, 90, 180, seed + 9, .8, 1300)]);
+ const near = new Path2D();
+ pine(near, 40, 1260, 1000, 300, 7); pine(near, 180, 1270, 620, 210, 5);
+ pine(near, 920, 1260, 1060, 320, 8); pine(near, 1040, 1260, 820, 260, 6);
+ near.addPath(polyPath([[-60, 1080], [200, 1060], [330, 1110], [520, 1120], [700, 1100], [880, 1070], [1060, 1090], [1060, 1600], [-60, 1600]]));
+ const ferns = new Path2D(); for (let i = 0; i < 9; i++) { const x = 250 + i * 64, y = 1112 - (i % 3) * 6; ferns.addPath(polyPath([[x, y], [x + 22, y - 44 - (i % 2) * 18], [x + 32, y - 40], [x + 16, y]])); }
+ const trail = [[330, 1200], [360, 1150], [300, 1120], [360, 1090], [440, 1080]].map(q => ({ x: q[0], y: q[1], plane: 'near' }));
+ return {
+ planes: [
+ skyPlane(sun.knock, 110, 270),
+ { id: 'sun', depth: .15, parts: [{ ink: 'sun', path: sun.disc, sub: 0 }] },
+ { id: 'far', depth: .35, parts: [{ ink: 'sky2', path: R.path, sub: 0 }, { ink: 'sky1', path: facets(peaks, -1, 70, seed + 12, 10), sub: 1 }] },
+ { id: 'mid', depth: .7, parts: [{ ink: 'far', path: cliff, knock: fall, sub: 0 }, { ink: 'near', path: shadows, sub: 1 }, { ink: 'sky1', path: lit, sub: 1 }, { ink: 'sky1', path: streaks, sub: 1 }, { ink: 'sky2', path: pool, knock: foam, sub: 0 }, { ink: 'near', path: topForest, sub: 0 }, { ink: 'mid', path: slopeForest, sub: 0 }] },
+ { id: 'near', depth: 1.5, parts: [{ ink: 'near', path: near, sub: 0 }, { ink: 'mid', path: ferns, sub: 1 }] },
+ ], trail, dark: [920, 700],
+ };
+}
+
+// ================= RIDGE(山脊,纵深多层,签名镜头用) =================
+function ridge(seed) {
+ const sun = sunParts(735, 400, 105, 2);
+ const farPeaks = [[80, 400], [250, 350], [420, 420], [900, 390]];
+ const FR = range(0, PW, 800, farPeaks, seed + 2, 18);
+ const summit = [470, 250];
+ const main = polyPath([[-60, 620], [90, 540], [200, 470], [300, 380], [380, 330], summit, [520, 285], [560, 300], [610, 350], [680, 395], [760, 470], [860, 520], [1060, 600], [1060, 1600], [-60, 1600]]);
+ const mainLit = polyPath([summit, [520, 285], [560, 300], [610, 350], [680, 395], [760, 470], [860, 520], [1060, 600], [1060, 660], [820, 610], [700, 540], [600, 470], [540, 400], [490, 320]]);
+ const rim = polyPath([[380, 330], summit, [520, 285], [560, 300], [556, 309], [518, 296], [472, 262], [384, 339]]);
+ const spurA = polyPath([[-60, 700], [80, 640], [200, 600], [300, 590], [420, 630], [540, 690], [650, 760], [700, 800], [700, 1600], [-60, 1600]]);
+ const spurALit = polyPath([[200, 600], [300, 590], [420, 630], [540, 690], [650, 760], [560, 745], [440, 690], [330, 640]]);
+ const spurB = polyPath([[1060, 760], [930, 720], [820, 700], [700, 730], [600, 790], [500, 870], [460, 920], [460, 1600], [1060, 1600]]);
+ const spurBLit = polyPath([[820, 700], [700, 730], [600, 790], [500, 870], [560, 850], [660, 790], [760, 750]]);
+ const spurC = polyPath([[-60, 900], [60, 860], [180, 850], [300, 880], [420, 950], [520, 1010], [560, 1060], [560, 1600], [-60, 1600]]);
+ const spurCLit = polyPath([[60, 860], [180, 850], [300, 880], [420, 950], [340, 935], [200, 890]]);
+ const valley = forest(-60, 1060, 1060, 60, 130, seed + 8, 1.2, 1700);
+ const near = new Path2D(); pine(near, 60, 1300, 820, 260, 7); pine(near, -40, 1300, 1000, 300, 7); pine(near, 950, 1300, 760, 250, 6); pine(near, 1050, 1300, 980, 300, 7);
+ near.addPath(valley);
+ // 步道:从谷底之字形爬到山顶,按所在层分段
+ const T = [[500, 1200, 'near'], [470, 1130, 'near'], [520, 1060, 'near'], [440, 1020, 'spurC'], [360, 960, 'spurC'], [470, 930, 'spurB'], [560, 860, 'spurB'], [640, 800, 'spurB'], [560, 760, 'spurA'], [430, 700, 'spurA'], [330, 650, 'spurA'], [380, 610, 'main'], [440, 540, 'main'], [400, 470, 'main'], [455, 400, 'main'], [430, 330, 'main'], summit.concat('main')];
+ const trail = T.map(q => ({ x: q[0], y: q[1], plane: q[2] }));
+ return {
+ planes: [
+ skyPlane(sun.knock, 120, 300, 200),
+ { id: 'sun', depth: .1, parts: [{ ink: 'sun', path: sun.disc, sub: 0 }] },
+ { id: 'far', depth: .25, parts: [{ ink: 'far', path: FR.path, sub: 0 }] },
+ { id: 'main', depth: .5, parts: [{ ink: 'mid', path: main, sub: 0 }, { ink: 'far', path: mainLit, sub: 1 }, { ink: 'glow', path: rim, sub: 1 }] },
+ { id: 'spurA', depth: .8, side: -1, parts: [{ ink: 'far', path: spurA, sub: 0 }, { ink: 'glow', path: spurALit, sub: 1 }] },
+ { id: 'spurB', depth: 1.05, side: 1, parts: [{ ink: 'mid', path: spurB, sub: 0 }, { ink: 'far', path: spurBLit, sub: 1 }] },
+ { id: 'spurC', depth: 1.3, side: -1, parts: [{ ink: 'far', path: spurC, sub: 0 }, { ink: 'glow', path: spurCLit, sub: 1 }] },
+ { id: 'near', depth: 1.9, parts: [{ ink: 'near', path: near, sub: 0 }] },
+ ], trail, summit, sun: [735, 400],
+ };
+}
+
+// ================= FOREST(森林) =================
+function forestScene(seed) {
+ const sun = sunParts(300, 300, 70, 1);
+ const peaks = [[150, 420], [420, 380], [700, 430], [900, 400]];
+ const R = range(0, PW, 800, peaks, seed + 3, 18);
+ const back = forest(-40, 1040, 640, 80, 170, seed + 4, 1, 900);
+ const midF = forest(-40, 1040, 820, 150, 300, seed + 5, .9, 1300);
+ const near = new Path2D(); for (let i = 0; i < 6; i++) { const x = [-10, 150, 330, 690, 850, 1000][i], top = 190 + (i % 3) * 40; near.addPath(polyPath([[x - 20 - i % 2 * 8, top + 120], [x + 20 + i % 2 * 8, top + 120], [x + 30, 1300], [x - 30, 1300]])); pine(near, x, top + 260, 300, 150 + (i % 2) * 40, 4); }
+ near.addPath(polyPath([[-60, 1060], [300, 1040], [700, 1070], [1060, 1040], [1060, 1600], [-60, 1600]]));
+ const shafts = new Path2D(); for (let i = 0; i < 4; i++) { const x = 380 + i * 90; shafts.addPath(polyPath([[x, 700], [x + 30, 700], [x + 120, 1060], [x + 60, 1060]])); }
+ const trail = [[500, 1200], [540, 1130], [480, 1080], [520, 1050]].map(q => ({ x: q[0], y: q[1], plane: 'near' }));
+ return {
+ planes: [
+ skyPlane(sun.knock, 110, 280),
+ { id: 'sun', depth: .15, parts: [{ ink: 'sun', path: sun.disc, sub: 0 }] },
+ { id: 'far', depth: .35, parts: [{ ink: 'far', path: R.path, sub: 0 }, { ink: 'far', path: back, sub: 1 }] },
+ { id: 'mid', depth: .7, parts: [{ ink: 'mid', path: midF, sub: 0 }, { ink: 'sky1', path: shafts, sub: 1 }] },
+ { id: 'near', depth: 1.5, parts: [{ ink: 'near', path: near, sub: 0 }] },
+ ], trail,
+ };
+}
+
+// ================= COAST(海岸) =================
+function coast(seed) {
+ const sun = sunParts(700, 520, 80, 2);
+ const sea = rectPath(-60, 600, PW + 120, 1000);
+ const swell = wavesPath(0, 1000, 620, 960, 30, seed + 4, 90);
+ const stacks = polyPath([[160, 600], [190, 470], [240, 440], [270, 600]]); stacks.addPath(polyPath([[300, 600], [315, 520], [345, 530], [360, 600]]));
+ const cliffs = polyPath([[-60, 520], [120, 540], [240, 610], [340, 700], [420, 820], [480, 960], [520, 1300], [-60, 1300]]);
+ const cliffLit = polyPath([[120, 540], [240, 610], [340, 700], [420, 820], [380, 830], [300, 720], [200, 630]]);
+ const near = polyPath([[-60, 1040], [200, 1010], [500, 1040], [800, 1000], [1060, 1020], [1060, 1600], [-60, 1600]]);
+ const grass = new Path2D(); const r = mulberry(seed + 9); for (let i = 0; i < 40; i++) { const x = r() * 1000, y = 1000 + r() * 40; grass.addPath(polyPath([[x, y + 20], [x + 4 + r() * 10, y - 40 - r() * 60], [x + 8, y + 20]])); }
+ const trail = [[600, 1200], [640, 1120], [720, 1060], [820, 1020]].map(q => ({ x: q[0], y: q[1], plane: 'near' }));
+ return {
+ planes: [
+ skyPlane(sun.knock, 140, 330),
+ { id: 'sun', depth: .15, parts: [{ ink: 'sun', path: sun.disc, sub: 0 }] },
+ { id: 'far', depth: .35, parts: [{ ink: 'sky2', path: sea, sub: 0 }, { ink: 'sky1', path: swell, sub: 1 }, { ink: 'far', path: stacks, sub: 0 }] },
+ { id: 'mid', depth: .7, parts: [{ ink: 'mid', path: cliffs, sub: 0 }, { ink: 'far', path: cliffLit, sub: 1 }] },
+ { id: 'near', depth: 1.5, parts: [{ ink: 'near', path: near, sub: 0 }, { ink: 'near', path: grass, sub: 0 }] },
+ ], trail,
+ };
+}
+
+export const SCENES = { lake, waterfall, ridge, forest: forestScene, coast };
+export function buildScene(name, seed = 1) { const f = SCENES[name] || SCENES.lake; return f(seed); }
diff --git a/styles/silkscreen-poster/demo/engine/silk.js b/styles/silkscreen-poster/demo/engine/silk.js
new file mode 100644
index 0000000..7542b44
--- /dev/null
+++ b/styles/silkscreen-poster/demo/engine/silk.js
@@ -0,0 +1,301 @@
+// silk.js · 丝网印刷画风引擎(不透明平涂墨层 + 硬边 + 套色错位 + 刮板拉墨 + 墨层光泽 + 纸张)
+// 所有函数都在"当前 ctx 变换"下工作:调用方先把 ctx 变换到纸面坐标(单位随意,常用海报单位 u)。
+// 引擎只管"怎么印",不管"印什么":形状由调用方以 Path2D 或绘制函数给出。
+
+export const clamp = (x, a = 0, b = 1) => Math.max(a, Math.min(b, x));
+export const lerp = (a, b, t) => a + (b - a) * t;
+export function mulberry(seed) { return function () { seed |= 0; seed = seed + 0x6D2B79F5 | 0; let t = Math.imul(seed ^ seed >>> 15, 1 | seed); t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t; return ((t ^ t >>> 14) >>> 0) / 4294967296; }; }
+export const hash = n => { n = Math.sin(n * 127.1 + 311.7) * 43758.5453; return n - Math.floor(n); };
+export const vnoise = x => { const i = Math.floor(x), f = x - i, u = f * f * (3 - 2 * f); return lerp(hash(i), hash(i + 1), u); };
+
+// ---------- 颜色 ----------
+export function hex2rgb(h) { h = h.replace('#', ''); if (h.length === 3) h = h.split('').map(c => c + c).join(''); const n = parseInt(h, 16); return [n >> 16 & 255, n >> 8 & 255, n & 255]; }
+export const rgb2hex = ([r, g, b]) => '#' + [r, g, b].map(v => Math.round(clamp(v, 0, 255)).toString(16).padStart(2, '0')).join('');
+export const mix = (a, b, t) => { const A = hex2rgb(a), B = hex2rgb(b); return rgb2hex(A.map((v, i) => lerp(v, B[i], t))); };
+export const shade = (c, k) => mix(c, k > 0 ? '#ffffff' : '#000000', Math.abs(k));
+
+// ---------- 纹理(确定性,生成一次) ----------
+function tile(n, fn) { const c = document.createElement('canvas'); c.width = c.height = n; const g = c.getContext('2d'); fn(g, n); return c; }
+function noiseField(n, seed, cell) { // 可平铺值噪声 0..1
+ const r = mulberry(seed), gw = Math.ceil(n / cell), grid = [];
+ for (let i = 0; i < gw * gw; i++) grid.push(r());
+ const at = (x, y) => grid[((y % gw + gw) % gw) * gw + ((x % gw + gw) % gw)];
+ const out = new Float32Array(n * n);
+ for (let y = 0; y < n; y++) for (let x = 0; x < n; x++) {
+ const fx = x / cell, fy = y / cell, ix = Math.floor(fx), iy = Math.floor(fy), ux = fx - ix, uy = fy - iy;
+ const sx = ux * ux * (3 - 2 * ux), sy = uy * uy * (3 - 2 * uy);
+ out[y * n + x] = lerp(lerp(at(ix, iy), at(ix + 1, iy), sx), lerp(at(ix, iy + 1), at(ix + 1, iy + 1), sx), sy);
+ }
+ return out;
+}
+export function makeTextures(paperHex, seed = 7) {
+ const N = 512, P = hex2rgb(paperHex);
+ const n1 = noiseField(N, seed, 64), n2 = noiseField(N, seed + 1, 16), n3 = noiseField(N, seed + 2, 4);
+ // 纸:奶油底 + 低频云斑 + 纤维
+ const paper = tile(N, (g) => {
+ const im = g.createImageData(N, N);
+ for (let i = 0; i < N * N; i++) {
+ const v = (n1[i] - .5) * 10 + (n2[i] - .5) * 6 + (n3[i] - .5) * 7;
+ im.data[i * 4] = P[0] + v; im.data[i * 4 + 1] = P[1] + v; im.data[i * 4 + 2] = P[2] + v * 1.1; im.data[i * 4 + 3] = 255;
+ }
+ g.putImageData(im, 0, 0);
+ const r = mulberry(seed + 9);
+ for (let k = 0; k < 900; k++) { // 纤维:短弧线,稍亮或稍暗
+ const x = r() * N, y = r() * N, a = r() * Math.PI, l = 3 + r() * 9;
+ g.strokeStyle = r() < .5 ? 'rgba(255,255,250,.28)' : 'rgba(120,100,70,.10)'; g.lineWidth = .6 + r() * .5;
+ for (const ox of [0, -N, N]) for (const oy of [0, -N, N]) { g.beginPath(); g.moveTo(x + ox, y + oy); g.quadraticCurveTo(x + ox + Math.cos(a) * l * .5 + r() * 2, y + oy + Math.sin(a) * l * .5, x + ox + Math.cos(a) * l, y + oy + Math.sin(a) * l); g.stroke(); }
+ }
+ });
+ // 墨斑(multiply):墨层厚薄不均 + 沿刮印方向的拖痕(纵向)
+ const ns = noiseField(N, seed + 5, 32);
+ const mottle = tile(N, (g) => {
+ const im = g.createImageData(N, N);
+ const colStreak = new Float32Array(N); const r = mulberry(seed + 11);
+ for (let x = 0; x < N; x++) colStreak[x] = r() < .06 ? r() : 0;
+ for (let y = 0; y < N; y++) for (let x = 0; x < N; x++) {
+ const i = y * N + x;
+ let v = 255 - (n1[i] * 10 + ns[i] * 8 + n3[i] * 6) - colStreak[x] * 10 * (.5 + .5 * n2[(y * 3 % N) * N + x]);
+ im.data[i * 4] = v; im.data[i * 4 + 1] = v; im.data[i * 4 + 2] = v; im.data[i * 4 + 3] = 255;
+ }
+ g.putImageData(im, 0, 0);
+ });
+ // 漏墨针孔 + 干刮细痕(纸色,source-over):落在纸上看不见,落在墨上就是露白
+ const speck = tile(N, (g) => {
+ const r = mulberry(seed + 21); g.fillStyle = paperHex;
+ for (let k = 0; k < 520; k++) { const x = r() * N, y = r() * N, s = r() < .9 ? .5 + r() * .9 : 1.4 + r() * 1.6; g.globalAlpha = .35 + r() * .5; g.beginPath(); g.ellipse(x, y, s, s * (.6 + r() * .5), r() * 3, 0, 7); g.fill(); }
+ g.globalAlpha = .12; g.strokeStyle = paperHex;
+ for (let k = 0; k < 40; k++) { const x = r() * N, y = r() * N, l = 20 + r() * 90; g.lineWidth = .4 + r() * .6; g.beginPath(); g.moveTo(x, y); g.lineTo(x + (r() - .5) * 2, y + l); g.stroke(); }
+ g.globalAlpha = 1;
+ });
+ return { paper, mottle, speck, N };
+}
+
+// 把纹理当作 pattern 铺在当前坐标系里(texel 为 unit 大小)
+export function texFill(ctx, tex, x, y, w, h, unit = .6, op = 'source-over', alpha = 1, off = [0, 0]) {
+ const p = ctx.createPattern(tex, 'repeat');
+ p.setTransform(new DOMMatrix([unit, 0, 0, unit, off[0], off[1]]));
+ ctx.save(); ctx.globalCompositeOperation = op; ctx.globalAlpha = alpha; ctx.fillStyle = p; ctx.fillRect(x, y, w, h); ctx.restore();
+}
+// 纸面:纸色 + 纸纹
+export function paperSheet(ctx, T, x, y, w, h, unit = .6) { texFill(ctx, T.paper, x, y, w, h, unit); }
+// 印后整饰:墨斑、针孔(整张纸一起做,纸上看不出,墨上看得出)
+export function inkFinish(ctx, T, x, y, w, h, unit = .6, amt = 1) {
+ texFill(ctx, T.mottle, x, y, w, h, unit * 1.4, 'multiply', .55 * amt, [13, 7]);
+ texFill(ctx, T.speck, x, y, w, h, unit, 'source-over', .75 * amt, [5, 11]);
+}
+
+// ---------- 刮板拉墨的前沿 ----------
+// box = [x,y,w,h];dir = 'down'|'up'|'right'|'left';p = 0..1(前沿走过 box 的比例,含拖尾长度)
+// 返回 Path2D:已经印上的区域。前沿参差(墨没刮匀的拖丝),长度 tail(单位同坐标)。
+export function wipeRegion(box, dir, p, seed = 1, tail = 26, step = 5) {
+ const [x, y, w, h] = box, path = new Path2D();
+ if (p >= 1) { path.rect(x - 4000, y - 4000, w + 8000, h + 8000); return path; }
+ if (p <= 0) return path;
+ const along = dir === 'down' || dir === 'up' ? h : w, across = dir === 'down' || dir === 'up' ? w : h;
+ const front = -tail + p * (along + tail * 2); // 前沿(沿行进方向,从 box 起点计)
+ const pts = [];
+ for (let s = -8; s <= across + 8; s += step) {
+ const n = hash(Math.floor(s / step) * 7.13 + seed * 31.7), n2 = hash(Math.floor(s / step / 3) * 3.7 + seed);
+ const d = front - tail * (n * .65 + n2 * .35); // 越靠后越满
+ pts.push([s, d]);
+ }
+ const P = (a, b) => { // (across, along) → (x,y)
+ if (dir === 'down') return [x + a, y + b];
+ if (dir === 'up') return [x + a, y + h - b];
+ if (dir === 'right') return [x + b, y + a];
+ return [x + w - b, y + a];
+ };
+ const far = -4000;
+ let q = P(-8, far); path.moveTo(q[0], q[1]);
+ for (const [a, b] of pts) { q = P(a, b); path.lineTo(q[0], q[1]); }
+ q = P(across + 8, far); path.lineTo(q[0], q[1]); path.closePath();
+ return path;
+}
+// 前沿当前的位置(沿行进方向,坐标)——用来放刮板
+export function wipeFront(box, dir, p, tail = 26) {
+ const [x, y, w, h] = box, along = dir === 'down' || dir === 'up' ? h : w;
+ const f = -tail + p * (along + tail * 2);
+ if (dir === 'down') return y + f; if (dir === 'up') return y + h - f; if (dir === 'right') return x + f; return x + w - f;
+}
+
+// ---------- 一块墨层 ----------
+// part = { path: Path2D, knock?: Path2D(镂空), paint?: (ctx)=>void(自定义填充,如文字), rule?: 'nonzero'|'evenodd' }
+// o = { color, reg:[dx,dy](套色错位), clip?: Path2D(拉墨前沿), sheen:0..1(墨层边缘反光), trap:0..1(叠色边), alpha }
+export function ink(ctx, part, o) {
+ if (o.alpha === 0) return;
+ ctx.save();
+ if (o.clip) ctx.clip(o.clip);
+ const [dx, dy] = o.reg || [0, 0];
+ ctx.translate(dx, dy);
+ if (o.alpha != null && o.alpha < 1) ctx.globalAlpha = o.alpha;
+ ctx.fillStyle = o.color;
+ if (o.trap && !part.paint) { // 叠色边:同一块版轻轻二次压印(错开一点,multiply),在下层颜色上留一道深边
+ let g = part.path; if (part.knock) { g = new Path2D(); g.addPath(part.path); g.addPath(part.knock); }
+ ctx.save(); ctx.translate(o.trapOff?.[0] ?? 2.2, o.trapOff?.[1] ?? -1.6); ctx.globalCompositeOperation = 'multiply'; ctx.globalAlpha = (o.alpha ?? 1) * .45 * o.trap;
+ ctx.fill(g, part.knock ? 'evenodd' : (part.rule || 'nonzero')); ctx.restore();
+ }
+ if (part.paint) { part.paint(ctx, o.color); ctx.restore(); return; }
+ let p = part.path;
+ if (part.knock) { p = new Path2D(); p.addPath(part.path); p.addPath(part.knock); }
+ ctx.fill(p, part.knock ? 'evenodd' : (part.rule || 'nonzero'));
+ const rule = part.knock ? 'evenodd' : (part.rule || 'nonzero');
+ const lw = o.lw || 1.6;
+ if (o.sheen) { // 墨层厚度:只用填充做(并集内部不出线)——左上边一道亮边、右下边一道暗边
+ ctx.save(); ctx.clip(p, rule);
+ ctx.globalAlpha = (o.alpha ?? 1) * .22 * o.sheen; ctx.fillStyle = '#ffffff'; ctx.fill(p, rule);
+ ctx.globalAlpha = 1; ctx.fillStyle = o.color; ctx.translate(lw, lw); ctx.fill(p, rule);
+ ctx.translate(-lw * 2, -lw * 2); ctx.globalAlpha = .14 * o.sheen; ctx.fillStyle = '#000'; ctx.globalCompositeOperation = 'source-atop';
+ ctx.restore();
+ ctx.save(); ctx.clip(p, rule); ctx.translate(-lw * .8, -lw * .8);
+ const inv = new Path2D(); inv.rect(-1e5, -1e5, 2e5, 2e5); inv.addPath(p);
+ ctx.globalAlpha = .12 * o.sheen; ctx.fillStyle = '#000'; ctx.fill(inv, 'evenodd');
+ ctx.restore();
+ }
+ ctx.restore();
+}
+
+// ---------- 刮板 ----------
+// 在 (a→b) 这条线上画刮板(俯视),lead=前进方向单位向量;beads=[{t0,t1,color}] 沿刀口分段的墨珠(分色刮 = split fountain)
+// o: { scale, seed, roll(墨珠滚动相位,随时间变), handle(0..1 露出多少手柄), shadow, blade, wood }
+export function squeegee(ctx, a, b, lead, o = {}) {
+ const beads = o.beads || [{ t0: 0, t1: 1, color: o.color || '#333' }];
+ const ux = b[0] - a[0], uy = b[1] - a[1], L = Math.hypot(ux, uy), tx = ux / L, ty = uy / L;
+ const nx = lead[0], ny = lead[1], s = o.scale || 1, roll = o.roll || 0, hd = o.handle ?? 1, sd = o.seed || 0;
+ const pt = (t, d) => [a[0] + tx * L * t + nx * d * s, a[1] + ty * L * t + ny * d * s];
+ const poly = (list, fill) => { ctx.beginPath(); list.forEach((p, i) => i ? ctx.lineTo(p[0], p[1]) : ctx.moveTo(p[0], p[1])); ctx.closePath(); ctx.fillStyle = fill; ctx.fill(); };
+ const ext = 18 / L, back = -30 * hd;
+ // 投影
+ ctx.save(); ctx.globalAlpha = o.shadow ?? .2; ctx.translate(-nx * 6 * s + 8 * s, -ny * 6 * s + 10 * s);
+ poly([pt(-ext, back - 4), pt(1 + ext, back - 4), pt(1 + ext, 6), pt(-ext, 6)], '#000'); ctx.restore();
+ // 墨珠:刀口前一条圆润饱满的湿墨(粗圆头线),下沿暗、上沿一道连续高光,高光上的亮点随 roll 沿刀口滚动
+ const W0 = o.bead || 24;
+ const wAt = (t) => W0 * (.82 + .18 * Math.sin(t * 9 + sd) + .08 * Math.sin(t * 31 + sd * 2));
+ for (const bd of beads) {
+ const n = Math.max(12, Math.ceil((bd.t1 - bd.t0) * L / 6));
+ const up = [], dn = [];
+ for (let i = 0; i <= n; i++) { const t = lerp(bd.t0, bd.t1, i / n); up.push(pt(t, 3)); dn.push(pt(t, 3 + wAt(t))); }
+ // 两端收圆
+ ctx.beginPath(); up.forEach((p, i) => i ? ctx.lineTo(p[0], p[1]) : ctx.moveTo(p[0], p[1]));
+ for (let i = dn.length - 1; i >= 0; i--) ctx.lineTo(dn[i][0], dn[i][1]);
+ ctx.closePath();
+ ctx.save(); ctx.translate(5 * s, 7 * s); ctx.globalAlpha = .22; ctx.fillStyle = '#000'; ctx.fill(); ctx.restore(); // 墨珠落在网上的影子
+ ctx.fillStyle = bd.color; ctx.fill();
+ // 体积:受光的一半更亮、背光的一边更暗(三段平涂)
+ ctx.fillStyle = mix(bd.color, '#ffffff', .22);
+ ctx.beginPath(); for (let i = 0; i <= n; i++) { const t = lerp(bd.t0, bd.t1, i / n), p = pt(t, 3 + wAt(t) * .12); i ? ctx.lineTo(p[0], p[1]) : ctx.moveTo(p[0], p[1]); }
+ for (let i = n; i >= 0; i--) { const t = lerp(bd.t0, bd.t1, i / n), p = pt(t, 3 + wAt(t) * .5); ctx.lineTo(p[0], p[1]); } ctx.closePath(); ctx.fill();
+ ctx.fillStyle = mix(bd.color, '#000000', .18);
+ ctx.beginPath(); for (let i = 0; i <= n; i++) { const t = lerp(bd.t0, bd.t1, i / n), p = pt(t, 3 + wAt(t) * .72); i ? ctx.lineTo(p[0], p[1]) : ctx.moveTo(p[0], p[1]); }
+ for (let i = n; i >= 0; i--) { const t = lerp(bd.t0, bd.t1, i / n), p = pt(t, 3 + wAt(t) - .5); ctx.lineTo(p[0], p[1]); } ctx.closePath(); ctx.fill();
+ ctx.save(); ctx.lineJoin = 'round'; ctx.lineCap = 'round';
+ // 前沿暗边(墨的厚度)
+ ctx.strokeStyle = mix(bd.color, '#000000', .28); ctx.lineWidth = 3.2 * s;
+ ctx.beginPath(); for (let i = 0; i <= n; i++) { const t = lerp(bd.t0, bd.t1, i / n), p = pt(t, 3 + wAt(t) - 1.4); i ? ctx.lineTo(p[0], p[1]) : ctx.moveTo(p[0], p[1]); } ctx.stroke();
+ // 高光(连续的一道 + 滚动的亮点)
+ ctx.strokeStyle = 'rgba(255,255,255,.42)'; ctx.lineWidth = 2.4 * s;
+ ctx.beginPath(); for (let i = 0; i <= n; i++) { const t = lerp(bd.t0, bd.t1, i / n), p = pt(t, 3 + wAt(t) * .32); i ? ctx.lineTo(p[0], p[1]) : ctx.moveTo(p[0], p[1]); } ctx.stroke();
+ ctx.fillStyle = 'rgba(255,255,255,.75)';
+ const span = (bd.t1 - bd.t0) * L, gap = 46;
+ for (let q = ((roll * 60) % gap + gap) % gap; q < span; q += gap) {
+ const t = bd.t0 + q / L, p = pt(t, 3 + wAt(t) * .3), r = (2.2 + 1.2 * hash(Math.floor(q / gap) + sd)) * s;
+ ctx.beginPath(); ctx.ellipse(p[0], p[1], r * 1.8, r, Math.atan2(ty, tx), 0, 7); ctx.fill();
+ }
+ // 粘稠拉丝:墨珠前沿被扯出的短粗墨丝(根部宽、末端细,挂一小滴)
+ ctx.fillStyle = bd.color;
+ const ns = Math.max(1, Math.round(span / 70));
+ for (let k = 0; k < ns; k++) {
+ const h = hash(k * 7.3 + sd), t = lerp(bd.t0, bd.t1, (k + .25 + .5 * h) / ns);
+ const len = 5 + 7 * (.5 + .5 * Math.sin(roll * .9 + k * 2.1 + sd)), w0 = 4.5, base = 3 + wAt(t) - 3;
+ const q = (dt, d) => pt(t + dt * s / L, d);
+ const P0 = q(-w0, base), P1 = q(w0, base), P2 = q(.8, base + len), P3 = q(-.8, base + len);
+ ctx.beginPath(); ctx.moveTo(P0[0], P0[1]); ctx.quadraticCurveTo(...q(-1.2, base + len * .45), P3[0], P3[1]); ctx.lineTo(P2[0], P2[1]); ctx.quadraticCurveTo(...q(1.2, base + len * .45), P1[0], P1[1]); ctx.closePath(); ctx.fill();
+ const D = q(0, base + len + 1.4); ctx.beginPath(); ctx.arc(D[0], D[1], 2.2 * s, 0, 7); ctx.fill();
+ }
+ ctx.restore();
+ }
+ // 橡胶刀口
+ poly([pt(-ext * .6, -2), pt(1 + ext * .6, -2), pt(1 + ext * .6, 4), pt(-ext * .6, 4)], o.blade || '#23201E');
+ poly([pt(-ext * .6, 2.2), pt(1 + ext * .6, 2.2), pt(1 + ext * .6, 4), pt(-ext * .6, 4)], '#57524C');
+ // 木柄(可只露一截)
+ if (hd > 0) {
+ poly([pt(-ext, back), pt(1 + ext, back), pt(1 + ext, -2), pt(-ext, -2)], o.wood || '#C48A52');
+ poly([pt(-ext, back), pt(1 + ext, back), pt(1 + ext, back + 5 * hd), pt(-ext, back + 5 * hd)], '#D9A56C');
+ ctx.save(); ctx.strokeStyle = 'rgba(90,50,20,.35)'; ctx.lineWidth = 1.1 * s;
+ for (let k = 0; k < 5; k++) { const d = back + 6 + k * (-back - 8) / 5; ctx.beginPath(); for (let i = 0; i <= 30; i++) { const t = -ext + (1 + 2 * ext) * i / 30; const p = pt(t, d + Math.sin(t * 9 + k * 2) * 1.2); i ? ctx.lineTo(p[0], p[1]) : ctx.moveTo(p[0], p[1]); } ctx.stroke(); }
+ ctx.restore();
+ // 手柄两端的金属端盖
+ for (const t of [-ext, 1 + ext - 6 / L]) poly([pt(t, back), pt(t + 6 / L, back), pt(t + 6 / L, -2), pt(t, -2)], '#9A958B');
+ }
+}
+
+// ---------- 网版(俯视):铝框 + 网纱;lift 0..1 抬起(向铰链一侧压缩并落影) ----------
+// flood: 在网版上可见的"待印图案"(刮板前方已被回墨刮满的网孔):(ctx)=>void
+export function screenFrame(ctx, box, o = {}) {
+ const [x, y, w, h] = box, lift = o.lift || 0, fw = o.frame || 34;
+ ctx.save();
+ // 抬起:以上沿为铰链,纵向压缩(俯视时近似),并拉出投影
+ const k = 1 - .55 * lift, sh = 26 * lift + 6;
+ ctx.translate(0, y); ctx.scale(1, k); ctx.translate(0, -y);
+ ctx.save(); ctx.globalAlpha = .22 + .1 * lift; ctx.fillStyle = '#000';
+ const shp = new Path2D(); shp.rect(x + sh * .6, y + sh, w, h); shp.rect(x + sh * .6 + fw, y + sh + fw, w - fw * 2, h - fw * 2);
+ ctx.fill(shp, 'evenodd');
+ if (lift > 0) { ctx.globalAlpha = .12 * lift; ctx.fillRect(x + sh * .6 + fw, y + sh + fw, w - fw * 2, h - fw * 2); }
+ ctx.restore();
+ // 网纱
+ ctx.save(); ctx.beginPath(); ctx.rect(x + fw, y + fw, w - fw * 2, h - fw * 2); ctx.clip();
+ ctx.fillStyle = o.mesh || 'rgba(236,214,128,.20)'; ctx.fillRect(x, y, w, h);
+ if (o.flood) { ctx.save(); ctx.globalAlpha = .42; o.flood(ctx); ctx.restore(); }
+ if (o.meshLines !== false) {
+ ctx.strokeStyle = o.meshLine || 'rgba(120,100,40,.07)'; ctx.lineWidth = .35; const st = o.meshStep || 6;
+ ctx.beginPath();
+ for (let xx = x + fw; xx < x + w - fw; xx += st) { ctx.moveTo(xx, y); ctx.lineTo(xx, y + h); }
+ for (let yy = y + fw; yy < y + h - fw; yy += st) { ctx.moveTo(x, yy); ctx.lineTo(x + w, yy); }
+ ctx.stroke();
+ }
+ // 感光胶(不印的地方是一层半透明蓝绿色胶膜)
+ if (o.emulsion) { ctx.save(); ctx.globalAlpha = o.emulsionAlpha ?? .16; ctx.fillStyle = '#2E6F78'; ctx.fill(o.emulsion, 'evenodd'); ctx.restore(); }
+ ctx.restore();
+ // 铝框(平涂两色)
+ const fr = new Path2D(); fr.rect(x, y, w, h); fr.rect(x + fw, y + fw, w - fw * 2, h - fw * 2);
+ ctx.fillStyle = o.frameColor || '#B7B2A6'; ctx.fill(fr, 'evenodd');
+ const inner = new Path2D(); inner.rect(x + fw - 6, y + fw - 6, w - fw * 2 + 12, h - fw * 2 + 12); inner.rect(x + fw, y + fw, w - fw * 2, h - fw * 2);
+ ctx.fillStyle = '#8E897E'; ctx.fill(inner, 'evenodd');
+ ctx.fillStyle = '#D6D1C4'; ctx.fillRect(x, y, w, 5);
+ // 胶带(网框内沿的蓝色封边胶带)
+ ctx.fillStyle = o.tape || '#3C6E9E';
+ ctx.fillRect(x + fw, y + fw, w - fw * 2, 10); ctx.fillRect(x + fw, y + h - fw - 10, w - fw * 2, 10);
+ ctx.fillRect(x + fw, y + fw, 10, h - fw * 2); ctx.fillRect(x + w - fw - 10, y + fw, 10, h - fw * 2);
+ ctx.restore();
+}
+
+// ---------- 通用形状工具(任何形状都能交给 ink() 印) ----------
+export function polyPath(pts, close = true) { const p = new Path2D(); pts.forEach((q, i) => i ? p.lineTo(q[0], q[1]) : p.moveTo(q[0], q[1])); if (close) p.closePath(); return p; }
+export function circlePath(x, y, r) { const p = new Path2D(); p.arc(x, y, r, 0, Math.PI * 2); return p; }
+export function ringPath(x, y, r0, r1) { const p = new Path2D(); p.arc(x, y, r1, 0, Math.PI * 2); p.moveTo(x + r0, y); p.arc(x, y, r0, 0, Math.PI * 2, true); return p; }
+export function rectPath(x, y, w, h) { const p = new Path2D(); p.rect(x, y, w, h); return p; }
+export function unionPath(list) { const p = new Path2D(); for (const q of list) p.addPath(q); return p; }
+// 中点位移山脊线:a,b 端点,返回点列(确定性)
+export function ridgeLine(a, b, rough, depth, seed) {
+ let pts = [a, b]; const r = mulberry(seed);
+ for (let d = 0; d < depth; d++) {
+ const n = [pts[0]];
+ for (let i = 0; i < pts.length - 1; i++) { const p = pts[i], q = pts[i + 1]; n.push([(p[0] + q[0]) / 2 + (r() - .5) * rough * .2, (p[1] + q[1]) / 2 + (r() - .5) * rough]); n.push(q); }
+ pts = n; rough *= .52;
+ }
+ return pts;
+}
+// 色带台阶:在 [y0,y1] 之间从 colorA 过渡到 colorB 的横条(条宽由粗到细)——返回 B 色的 Path2D(叠在 A 上印)
+export function bandSteps(x, w, y0, y1, n = 5, curve = 0) {
+ const p = new Path2D(), H = y1 - y0;
+ // 第 i 条:位置越往下越细
+ let yy = y0;
+ for (let i = 0; i < n; i++) {
+ const cell = H / n, th = cell * (1 - (i + .5) / n) * .95 + 1.2;
+ const top = y0 + cell * i, bot = top + th;
+ p.moveTo(x, top);
+ for (let k = 0; k <= 24; k++) { const xx = x + w * k / 24; p.lineTo(xx, top + curve * Math.sin(k / 24 * Math.PI)); }
+ for (let k = 24; k >= 0; k--) { const xx = x + w * k / 24; p.lineTo(xx, bot + curve * Math.sin(k / 24 * Math.PI)); }
+ p.closePath(); yy = bot;
+ }
+ return p;
+}
diff --git a/styles/silkscreen-poster/demo/events.json b/styles/silkscreen-poster/demo/events.json
new file mode 100644
index 0000000..8e76f95
--- /dev/null
+++ b/styles/silkscreen-poster/demo/events.json
@@ -0,0 +1 @@
+{"dur":38.4,"ev":[{"t":0,"type":"squeegee","dur":1,"ink":"sky"},{"t":0,"type":"section","kind":"banner","t1":4.8,"time_of_day":null},{"t":1,"type":"lift"},{"t":1.2,"type":"squeegee","dur":0.3,"ink":"title"},{"t":1.35,"type":"squeegee","dur":0.25,"ink":"footer"},{"t":1.5,"type":"title"},{"t":4.8,"type":"tilt","i":0},{"t":4.8,"type":"section","kind":"press","t1":13.2,"time_of_day":"dawn"},{"t":5.4,"type":"pull","i":0,"layer":"sky","n":0,"dur":0.45},{"t":6,"type":"pull","i":0,"layer":"far","n":1,"dur":0.45},{"t":6.6,"type":"pull","i":0,"layer":"mid","n":2,"dur":0.45},{"t":7.2,"type":"pull","i":0,"layer":"near","n":3,"dur":0.45},{"t":7.8,"type":"lift","i":0},{"t":8.4,"type":"band","i":0},{"t":9,"type":"name","i":0},{"t":9.6,"type":"item","i":0,"k":0,"last":0,"climb":0},{"t":9.9,"type":"item","i":0,"k":1,"last":0,"climb":0},{"t":10.2,"type":"item","i":0,"k":2,"last":1,"climb":0},{"t":12.9,"type":"pull","i":1,"layer":"sky","n":0,"dur":0.26,"quick":1},{"t":13.2,"type":"wipe","i":1},{"t":13.2,"type":"section","kind":"quick","t1":19.2,"time_of_day":"noon"},{"t":13.5,"type":"pull","i":1,"layer":"far","n":1,"dur":0.26,"quick":1},{"t":13.8,"type":"pull","i":1,"layer":"mid","n":2,"dur":0.26,"quick":1},{"t":14.1,"type":"pull","i":1,"layer":"near","n":3,"dur":0.26,"quick":1},{"t":14.4,"type":"pullback","i":1},{"t":14.7,"type":"band","i":1},{"t":15,"type":"name","i":1},{"t":15.3,"type":"item","i":1,"k":0,"last":0,"climb":0},{"t":15.6,"type":"item","i":1,"k":1,"last":0,"climb":0},{"t":15.9,"type":"item","i":1,"k":2,"last":1,"climb":0},{"t":18,"type":"silence","dur":1.2,"pre":1},{"t":19.2,"type":"wipe","i":2},{"t":19.2,"type":"ascent","i":2,"dur":4.199999999999999},{"t":19.2,"type":"section","kind":"ascent","t1":29.4,"time_of_day":"dusk"},{"t":19.704,"type":"part","i":2,"layer":"near"},{"t":20.46,"type":"part","i":2,"layer":"spurC"},{"t":20.6,"type":"swap","i":2,"k":1,"dur":0.35},{"t":21.3,"type":"part","i":2,"layer":"spurB"},{"t":22,"type":"swap","i":2,"k":2,"dur":0.35},{"t":22.14,"type":"part","i":2,"layer":"spurA"},{"t":23.4,"type":"silence","dur":0.6000000000000014},{"t":24,"type":"clack","i":2},{"t":24,"type":"tiltdown","i":2},{"t":24.6,"type":"band","i":2},{"t":24.9,"type":"name","i":2},{"t":25.2,"type":"item","i":2,"k":0,"last":0,"climb":0},{"t":25.5,"type":"item","i":2,"k":1,"last":0,"climb":0},{"t":25.8,"type":"item","i":2,"k":2,"last":0,"climb":0},{"t":26.1,"type":"item","i":2,"k":3,"last":1,"climb":1},{"t":29.4,"type":"wallpull"},{"t":29.4,"type":"section","kind":"wall","t1":34.8,"time_of_day":null},{"t":30.6,"type":"land","dur":4.199999999999999},{"t":34.8,"type":"endcard","dur":3.6000000000000014},{"t":34.8,"type":"section","kind":"end","t1":38.4,"time_of_day":null},{"t":35.3,"type":"endpull","dur":0.3}]}
\ No newline at end of file
diff --git a/styles/silkscreen-poster/demo/film.js b/styles/silkscreen-poster/demo/film.js
new file mode 100644
index 0000000..61b3226
--- /dev/null
+++ b/styles/silkscreen-poster/demo/film.js
@@ -0,0 +1,427 @@
+// film.js · 场景 demo:户外步道指南(丝印旅行海报)
+// 时间线完全由 content.json 推出来(1–4 条步道都成立),100 BPM,一拍 0.6 s
+import { makeTextures, squeegee, screenFrame, wipeFront, wipeRegion, ink, rectPath, polyPath, circlePath, ringPath, clamp, lerp, mix, hash, mulberry, paperSheet, inkFinish } from './engine/silk.js';
+import { buildPoster, drawPoster, drawBanner, swapFrontLine, pickInk, BANNER_ART, BANNER_BANDS, PW, PH, ART, BW, BH, readTime } from './engine/poster.js';
+
+export const BPM = 100, B = 60 / BPM;
+const ss = t => { t = clamp(t); return t * t * (3 - 2 * t); };
+const eio = t => { t = clamp(t); return t < .5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2; };
+const eo = t => 1 - Math.pow(1 - clamp(t), 3);
+const ei = t => Math.pow(clamp(t), 3);
+const seg = (t, a, b) => clamp((t - a) / (b - a));
+const W = 1920, H = 1080;
+
+let C, T, POS, TL, ctx;
+// 世界坐标(印刷台):横幅居中在原点,海报在下方
+const BAN = [-900, -220]; // 横幅左上角(1800×440,中心在原点)
+const PO = [-500, 420]; // 海报左上角(印刷台上)
+
+export function setup(content, canvas) {
+ C = content; ctx = canvas.getContext('2d');
+ T = makeTextures(C.palette.paper, 7);
+ POS = C.trails.map((tr, i) => buildPoster(C, tr, i, C.trails.length));
+ TL = timeline();
+ return TL;
+}
+const pal = (key) => C.palette[key] || C.palette.noon;
+
+// ---------------- 时间线 ----------------
+function timeline() {
+ const n = POS.length, secs = [], ev = [];
+ const E = (t, type, o = {}) => ev.push({ t: +t.toFixed(3), type, ...o });
+ // S1 横幅 + 片名
+ const s1 = { kind: 'banner', t0: 0, sky: [-.45, 1.0], lift: 1.0, title: [1.2, 1.5], footer: [1.35, 1.6], pull: [1.0, 1.65], t1: 8 * B };
+ E(0, 'squeegee', { dur: 1.0, ink: 'sky' }); E(1.0, 'lift'); E(1.2, 'squeegee', { dur: .3, ink: 'title' }); E(1.35, 'squeegee', { dur: .25, ink: 'footer' });
+ E(1.5, 'title'); secs.push(s1);
+ let s = s1.t1;
+ POS.forEach((P, i) => {
+ const mode = i === 0 ? 'press' : (i === n - 1 && n > 1 ? 'ascent' : 'quick');
+ const statStr = P.items.map(it => it.value).join(' ');
+ const sec = { kind: mode, P, i, t0: s };
+ if (mode === 'press') {
+ sec.tilt = [s, s + B];
+ sec.pulls = { sky: s + B, far: s + 2 * B, mid: s + 3 * B, near: s + 4 * B };
+ sec.pullDur = .45; sec.lift = s + 5 * B; sec.push = [s + 5 * B, s + 7 * B];
+ sec.band = s + 6 * B; sec.name = s + 7 * B;
+ sec.items = P.items.map((_, k) => s + 8 * B + k * B / 2);
+ } else if (mode === 'quick') {
+ sec.pulls = { sky: s - .3, far: s + B / 2, mid: s + B, near: s + 1.5 * B };
+ sec.pullDur = .26; sec.back = [s + 2 * B, s + 3.2 * B];
+ sec.band = s + 2.5 * B; sec.name = s + 3 * B;
+ sec.items = P.items.map((_, k) => s + 3.5 * B + k * B / 2);
+ } else {
+ sec.climb = [s, s + 7 * B]; sec.clack = s + 8 * B; sec.down = [s + 8 * B, s + 9.5 * B];
+ sec.band = s + 9 * B; sec.name = s + 9.5 * B;
+ sec.items = P.items.map((_, k) => s + 10 * B + k * B / 2);
+ sec.pals = [...new Set([POS[i - 1] ? POS[i - 1].trail.time_of_day : 'noon', 'golden', P.trail.time_of_day])].filter(k => C.palette[k]);
+ }
+ // ---- 事件(音效 / 配乐卡点都从这里取) ----
+ if (mode === 'press') { E(sec.tilt[0], 'tilt', { i }); ['sky', 'far', 'mid', 'near'].forEach((k, j) => E(sec.pulls[k], 'pull', { i, layer: k, n: j, dur: sec.pullDur })); E(sec.lift, 'lift', { i }); }
+ else if (mode === 'quick') { E(s, 'wipe', { i }); ['sky', 'far', 'mid', 'near'].forEach((k, j) => E(sec.pulls[k], 'pull', { i, layer: k, n: j, dur: sec.pullDur, quick: 1 })); E(sec.back[0], 'pullback', { i }); }
+ else {
+ E(s, 'wipe', { i }); E(s, 'ascent', { i, dur: sec.climb[1] - sec.climb[0] });
+ const nS = sec.pals.length - 1; for (let k = 1; k <= nS; k++) E(lerp(sec.climb[0], sec.climb[1], k / (nS + 1)), 'swap', { i, k, dur: .35 });
+ ['near', 'spurC', 'spurB', 'spurA'].forEach((id, j) => E(lerp(sec.climb[0], sec.climb[1], [.12, .3, .5, .7][j]), 'part', { i, layer: id }));
+ E(sec.climb[1], 'silence', { dur: sec.clack - sec.climb[1] }); E(sec.clack, 'clack', { i }); E(sec.down[0], 'tiltdown', { i });
+ }
+ E(sec.band, 'band', { i }); E(sec.name, 'name', { i });
+ sec.items.forEach((a, k) => E(a, 'item', { i, k, last: k === sec.items.length - 1 ? 1 : 0, climb: P.items[k].climb ? 1 : 0 }));
+ const lastItem = sec.items[sec.items.length - 1] ?? sec.name;
+ const need = Math.max(sec.name + readTime(P.trail.name), lastItem + readTime(statStr));
+ sec.t1 = Math.ceil((need + .05) / B) * B + (mode === 'ascent' ? 0 : B);
+ secs.push(sec); s = sec.t1;
+ });
+ // S5 墙面落版
+ const foot = readTime(C.footer);
+ const wall = { kind: 'wall', t0: s, pull: [s, s + 2 * B], t1: 0 };
+ wall.hold0 = s + 2 * B; wall.t1 = wall.hold0 + Math.ceil(Math.max(3.6, foot) / B) * B;
+ secs.push(wall);
+ const end = { kind: 'end', t0: wall.t1, t1: wall.t1 + 6 * B }; secs.push(end);
+ // 快印段结尾的静音(进入签名段之前)
+ const asc = secs.find(q => q.kind === 'ascent'); if (asc) E(asc.t0 - 2 * B, 'silence', { dur: 2 * B, pre: 1 });
+ E(wall.t0, 'wallpull'); E(wall.hold0, 'land', { dur: wall.t1 - wall.hold0 }); E(end.t0, 'endcard', { dur: end.t1 - end.t0 }); E(end.t0 + .5, 'endpull', { dur: .3 });
+ secs.forEach(q => E(q.t0, 'section', { kind: q.kind, t1: q.t1, time_of_day: q.P ? q.P.trail.time_of_day : null }));
+ ev.sort((a, b) => a.t - b.t);
+ return { secs, ev, dur: end.t1 };
+}
+
+// ---------------- 相机 ----------------
+function cam(cx, cy, z, rot = 0) { ctx.setTransform(1, 0, 0, 1, 0, 0); ctx.translate(W / 2, H / 2); if (rot) ctx.rotate(rot); ctx.scale(z, z); ctx.translate(-cx, -cy); }
+
+// ---------------- 印刷台:旧木工作台(平涂木板 + 木纹 + 干掉的墨渍 + 胶带痕) ----------------
+const TABLE = '#6B4E36';
+let TABLE_CACHE = null;
+function buildTable() {
+ const r = mulberry(21), planks = [], stains = [], tapes = [];
+ const x0 = -2200, x1 = 2200, y0 = -1400, y1 = 2600, ph = 170;
+ const tones = ['#6E5039', '#664A34', '#73553C', '#6A4C35', '#5F4430'];
+ for (let y = y0, k = 0; y < y1; y += ph, k++) {
+ const grain = new Path2D(), knots = new Path2D();
+ for (let g = 0; g < 7; g++) {
+ const gy = y + 14 + g * 22 + r() * 8, amp = 3 + r() * 5, f = .002 + r() * .003, ph0 = r() * 6;
+ grain.moveTo(x0, gy); for (let x = x0; x <= x1; x += 40) grain.lineTo(x, gy + amp * Math.sin(x * f + ph0) + 2 * Math.sin(x * f * 3.7));
+ }
+ for (let q = 0; q < 3; q++) { const kx = x0 + r() * (x1 - x0), ky = y + 30 + r() * (ph - 60); knots.ellipse(kx, ky, 22 + r() * 18, 7 + r() * 5, 0, 0, 7); }
+ planks.push({ y, color: tones[k % tones.length], grain, knots });
+ }
+ // 干墨渍:不规则的平涂块(印刷时溢出的墨),颜色取自本片的调色板
+ const pals = Object.keys(C.palette).filter(k => C.palette[k] && C.palette[k].sky2).map(k => C.palette[k]);
+ const avoid = (x, y) => (x > PO[0] - 60 && x < PO[0] + PW + 60 && y > PO[1] - 60 && y < PO[1] + PH + 60) || (x > BAN[0] - 60 && x < BAN[0] + BW + 60 && y > BAN[1] - 60 && y < BAN[1] + BH + 60);
+ for (let i = 0; i < 12; i++) {
+ let x, y, n = 0; do { x = x0 + 300 + r() * (x1 - x0 - 600); y = y0 + 200 + r() * (y1 - y0 - 400); n++; } while (avoid(x, y) && n < 30);
+ const pp = pals[i % pals.length], col = [pp.sky2, pp.near, pp.sun, pp.mid, pp.far][(r() * 5) | 0];
+ const R = 50 + r() * 70, pts = [], m = 11;
+ for (let j = 0; j < m; j++) { const a = j / m * 6.283, rr = R * (.65 + .5 * r()) * (j % 3 === 0 ? 1.3 : 1); pts.push([x + Math.cos(a) * rr * 1.25, y + Math.sin(a) * rr * .8]); }
+ const path = new Path2D(); pts.forEach((q, j) => { const nq = pts[(j + 1) % m]; if (!j) path.moveTo((q[0] + nq[0]) / 2, (q[1] + nq[1]) / 2); else path.quadraticCurveTo(q[0], q[1], (q[0] + nq[0]) / 2, (q[1] + nq[1]) / 2); });
+ path.closePath();
+ if (r() < .45) { const d = new Path2D(); d.arc(x + R * 1.6, y + (r() - .5) * R, 4 + r() * 6, 0, 7); path.addPath(d); } // 甩出的墨点
+ if (r() < .35) { const sm = new Path2D(); const sx = x - R * 2.4; sm.rect(sx, y - 5, R * 1.8, 10 + r() * 6); path.addPath(sm); } // 刮刀抹痕
+ stains.push({ path, col: mix(col, TABLE, .45), a: .7 });
+ }
+ // 胶带痕:撕下后留下的旧胶带条(浅米色、边缘不齐)
+ for (let i = 0; i < 9; i++) {
+ let x, y, n = 0; do { x = x0 + 300 + r() * (x1 - x0 - 600); y = y0 + 200 + r() * (y1 - y0 - 400); n++; } while (avoid(x, y) && n < 30);
+ tapes.push({ x, y, w: 60 + r() * 120, h: 22 + r() * 8, a: (r() - .5) * .6, torn: r() < .6, dirty: r() < .5 });
+ }
+ return { planks, stains, tapes, x0, x1, ph };
+}
+function table() {
+ if (!TABLE_CACHE) TABLE_CACHE = buildTable();
+ const TB = TABLE_CACHE;
+ ctx.save(); ctx.setTransform(1, 0, 0, 1, 0, 0); ctx.fillStyle = TABLE; ctx.fillRect(0, 0, W, H); ctx.restore();
+ for (const p of TB.planks) {
+ ctx.fillStyle = p.color; ctx.fillRect(TB.x0, p.y, TB.x1 - TB.x0, TB.ph);
+ ctx.fillStyle = 'rgba(35,22,12,.55)'; ctx.fillRect(TB.x0, p.y, TB.x1 - TB.x0, 5); // 板缝
+ ctx.fillStyle = 'rgba(255,230,190,.07)'; ctx.fillRect(TB.x0, p.y + 5, TB.x1 - TB.x0, 3);
+ ctx.save(); ctx.strokeStyle = 'rgba(40,24,12,.22)'; ctx.lineWidth = 2; ctx.stroke(p.grain); ctx.fillStyle = 'rgba(40,24,12,.25)'; ctx.fill(p.knots); ctx.restore();
+ }
+ for (const s0 of TB.stains) { ctx.save(); ctx.globalAlpha = s0.a; ctx.fillStyle = s0.col; ctx.fill(s0.path); ctx.globalAlpha = s0.a * .5; ctx.translate(-2, -2); ctx.fillStyle = 'rgba(255,255,255,.25)'; ctx.fill(s0.path); ctx.restore(); }
+ for (const tp of TB.tapes) {
+ ctx.save(); ctx.translate(tp.x, tp.y); ctx.rotate(tp.a);
+ ctx.fillStyle = tp.dirty ? 'rgba(205,184,140,.75)' : 'rgba(222,204,160,.8)';
+ ctx.beginPath(); ctx.moveTo(-tp.w / 2, -tp.h / 2); ctx.lineTo(tp.w / 2, -tp.h / 2);
+ if (tp.torn) { for (let k = 0; k <= 5; k++) ctx.lineTo(tp.w / 2 + (k % 2 ? -6 : 3), -tp.h / 2 + tp.h * k / 5); } else ctx.lineTo(tp.w / 2, tp.h / 2);
+ ctx.lineTo(-tp.w / 2, tp.h / 2); ctx.closePath(); ctx.fill();
+ if (tp.dirty) { ctx.fillStyle = 'rgba(60,40,25,.25)'; ctx.fillRect(-tp.w / 2 + 6, -3, tp.w * .5, 5); }
+ ctx.restore();
+ }
+}
+function regTape(x, y, w, h) {
+ ctx.fillStyle = '#D9C38A';
+ const L = 60, th = 16;
+ for (const [px, py, sx, sy] of [[x, y, -1, -1], [x + w, y, 1, -1], [x, y + h, -1, 1], [x + w, y + h, 1, 1]]) {
+ ctx.fillRect(Math.min(px, px + sx * L), py + (sy < 0 ? -th : 0) - sy * 2, L, th);
+ ctx.fillRect(px + (sx < 0 ? -th : 0) - sx * 2, Math.min(py, py + sy * L), th, L);
+ }
+}
+function sheetShadow(x, y, w, h, a = .3) { ctx.save(); ctx.globalAlpha = a; ctx.fillStyle = '#000'; ctx.fillRect(x + 8, y + 12, w, h); ctx.restore(); }
+
+// ---------------- 各段 ----------------
+function banner(sec, t) {
+ const p = seg(t, sec.sky[0], sec.sky[1]);
+ const sqX = wipeFront([BAN[0], BAN[1], BW, BH], 'right', p, 34);
+ // 相机:先跟刮板横移(特写),刮完拉开看整条横幅,随后缓推
+ const k = eo(seg(t, sec.pull[0], sec.pull[1]));
+ const zc = lerp(1.95, 1.8, ss(seg(t, 0, 1.0))), zw = .96; // 开场特写 → 横幅撑满画宽(边距约 5%),占画高约 40%
+ const cxClose = sqX - 150, cyClose = 0;
+ let z = lerp(zc, zw, k), cx = lerp(cxClose, 0, k), cy = lerp(cyClose, 0, k);
+ z *= 1 + .03 * ss(seg(t, 1.8, sec.t1)); // 读片名时的缓推
+ cam(cx, cy, z, lerp(-.03, 0, k));
+ table();
+ regTape(BAN[0], BAN[1], BW, BH);
+ sheetShadow(BAN[0], BAN[1], BW, BH, .25);
+ ctx.save(); ctx.translate(BAN[0], BAN[1]);
+ drawBanner(ctx, C, { pal: pal(C.banner_time || 'golden'), T, sky: p, title: seg(t, sec.title[0], sec.title[1]), footer: seg(t, sec.footer[0], sec.footer[1]), reg: 1 });
+ ctx.restore();
+ // 湿墨反光:刚刮过的墨面在刮板后面亮一截,随刮板走、慢慢变哑
+ const wet = 1 - seg(t, sec.sky[1], sec.sky[1] + .8);
+ if (p > 0 && wet > 0) {
+ ctx.save(); ctx.globalAlpha = wet; ctx.beginPath(); ctx.rect(BAN[0] + 14, BAN[1] + 14, Math.max(0, sqX - BAN[0] - 14), BANNER_ART[3]); ctx.clip();
+ const g = ctx.createLinearGradient(sqX - 420, 0, sqX, 0); g.addColorStop(0, 'rgba(255,250,235,0)'); g.addColorStop(.6, 'rgba(255,250,235,.08)'); g.addColorStop(1, 'rgba(255,250,235,.34)');
+ ctx.fillStyle = g; ctx.fillRect(sqX - 420, BAN[1], 420, BH);
+ ctx.restore();
+ }
+ const lift = seg(t, sec.lift, sec.lift + .45);
+ const box = [BAN[0] - 90, BAN[1] - 90, BW + 180, BH + 180];
+ const emu = new Path2D(); emu.rect(box[0], box[1], box[2], box[3]); emu.rect(BAN[0] + 14, BAN[1] + 14, BW - 28, BANNER_ART[3]);
+ if (lift < 1) screenFrame(ctx, box, { lift: ss(lift), frame: 40, mesh: 'rgba(236,214,128,.03)', emulsion: emu, emulsionAlpha: .55, meshStep: 3.4, meshLine: 'rgba(70,60,30,.16)' });
+ // 刮板(分色刮:刀口上的墨珠按天空色带分段)
+ if (t < sec.lift + .35) {
+ const bp = pal(C.banner_time || 'golden');
+ const up = ss(seg(t, sec.lift, sec.lift + .35));
+ const x = sqX + 14 + up * 120, y0 = BAN[1] - 38, y1 = BAN[1] + BH + 38;
+ const tt = (yy) => (yy - y0) / (y1 - y0);
+ ctx.save(); ctx.globalAlpha = 1 - up;
+ const BB = BANNER_BANDS;
+ squeegee(ctx, [x, y0], [x, y1], [1, 0], { beads: [['sky2', bp.sky2], ['sky1', bp.sky1], ['far', bp.far]].map(([k, c]) => ({ t0: tt(BAN[1] + BB[k][0] + 16), t1: tt(BAN[1] + BB[k][1]), color: c })), seed: 3, scale: 1.25, roll: sqX / 30 });
+ ctx.restore();
+ }
+ // 片名刮板(快速一刮,深色墨)
+ const tp = seg(t, sec.title[0], sec.title[1]);
+ if (tp > 0 && tp < 1) {
+ const x = wipeFront([BAN[0], BAN[1] + 20, BW, 330], 'right', tp, 40) + 12;
+ squeegee(ctx, [x, BAN[1] - 38], [x, BAN[1] + BH + 38], [1, 0], { color: pal(C.banner_time || 'golden').near, seed: 5, roll: x / 30, scale: 1.25 });
+ }
+}
+
+// 海报在印刷台上的通用绘制
+function posterOnTable(P, st) {
+ regTape(PO[0], PO[1], PW, PH);
+ sheetShadow(PO[0], PO[1], PW, PH, .22);
+ ctx.save(); ctx.translate(PO[0], PO[1]); drawPoster(ctx, P, st); ctx.restore();
+}
+const pullProg = (sec, id, t) => { const k = id === 'sun' ? 'sky' : id; const a = sec.pulls[k] ?? sec.pulls.near; return seg(t, a, a + sec.pullDur); };
+function planeGroup(id) { return id === 'sun' ? 'sky' : ['main', 'spurA', 'spurB', 'spurC'].includes(id) ? 'mid' : id; }
+
+function press(sec, t) {
+ const P = POS[sec.i], pl = pal(P.trail.time_of_day);
+ // 相机:从横幅下摇到海报全景 → 推到信息带
+ const tilt = eio(seg(t, sec.tilt[0], sec.tilt[1]));
+ const push = eio(seg(t, sec.push[0], sec.push[1]));
+ const full = [0, PO[1] + PH / 2 - 10, .66];
+ const bandC = [0, PO[1] + 1290, 1.55];
+ let cx = lerp(0, full[0], tilt), cy = lerp(0, full[1], tilt), z = lerp(.96 * 1.03, full[2], tilt);
+ cx = lerp(cx, bandC[0], push); cy = lerp(cy, bandC[1], push); z = lerp(z, bandC[2], push);
+ z *= 1 + .02 * seg(t, sec.items[0], sec.t1);
+ cam(cx, cy, z); table();
+ if (tilt < 1) { ctx.save(); ctx.translate(BAN[0], BAN[1]); sheetShadow(0, 0, BW, BH, .25); drawBanner(ctx, C, { pal: pal(C.banner_time || 'golden'), T }); ctx.restore(); }
+ const st = { pal: pl, T, prog: id => pullProg(sec, planeGroup(id), t), band: seg(t, sec.band, sec.band + .3), name: seg(t, sec.name, sec.name + .3), header: seg(t, sec.name, sec.name + .3), trail: seg(t, sec.band, sec.band + .6), items: sec.items.map(a => seg(t, a, a + .18)) };
+ posterOnTable(P, st);
+ // 网版 + 刮板
+ const lift = seg(t, sec.lift, sec.lift + .4);
+ const box = [PO[0] - 70, PO[1] - 70, PW + 140, PH + 140];
+ if (lift < 1) screenFrame(ctx, box, { lift: ss(lift), frame: 44 });
+ for (const k of ['sky', 'far', 'mid', 'near']) {
+ const a = sec.pulls[k], p = seg(t, a, a + sec.pullDur);
+ if (p > 0 && p < 1) {
+ const y = PO[1] + wipeFront([0, ART[1] - 60, PW, ART[3] + 120], 'down', clamp(p * 1.35), 30) - 60 + 14;
+ const inkKey = k === 'sky' ? 'sky1' : k === 'far' ? P.sc.planes.find(q => q.id === 'far').parts[0].ink : k === 'mid' ? 'mid' : 'near';
+ squeegee(ctx, [PO[0] - 30, y], [PO[0] + PW + 30, y], [0, 1], { color: pl[inkKey], seed: a * 10, roll: y / 30, scale: 1.3 });
+ }
+ }
+}
+
+// 穿过近景树影的转场(屏幕空间遮挡物,颜色 = 上一张的近景墨)
+function treeWipe(t, t0, color) {
+ const u = seg(t, t0 - .3, t0 + .3); if (u <= 0 || u >= 1) return;
+ ctx.save(); ctx.setTransform(1, 0, 0, 1, 0, 0);
+ const w = W * 1.25, cxw = lerp(W + w / 2 + 120, -w / 2 - 120, ss(u)), x = cxw - w / 2; // 中点正好盖满画面(约 1 帧),此时换下一张
+ const p = new Path2D(); p.moveTo(x, -20);
+ for (let y = -20; y <= H + 20; y += 40) p.lineTo(x - 50 - 70 * hash(y * .37), y);
+ for (let y = H + 20; y >= -20; y -= 40) p.lineTo(x + w + 60 + 80 * hash(y * .61 + 3), y);
+ p.closePath(); ctx.fillStyle = color; ctx.fill(p);
+ ctx.restore();
+}
+
+function quick(sec, t) {
+ const P = POS[sec.i], pl = pal(P.trail.time_of_day);
+ const back = eio(seg(t, sec.back[0], sec.back[1]));
+ const s = seg(t, sec.t0 - .3, sec.back[0]);
+ const close = [0, PO[1] + 400 + 40 * s, 1.25 + .04 * s]; // 整张纸宽和上沿都在画里:知道在看哪张海报,海报占画高 100%
+ const bandC = [0, PO[1] + 1300, 1.5]; // 信息带完整入画,左右各留 ~13%
+ const cx = lerp(close[0], bandC[0], back), cy = lerp(close[1], bandC[1], back), z = lerp(close[2], bandC[2], back);
+ cam(cx, cy, z); table();
+ posterOnTable(P, { pal: pl, T, prog: id => pullProg(sec, planeGroup(id), t), band: seg(t, sec.band, sec.band + .25), name: seg(t, sec.name, sec.name + .3), header: seg(t, sec.far ?? sec.name, sec.name + .3), trail: seg(t, sec.band, sec.band + .5), items: sec.items.map(a => seg(t, a, a + .18)) });
+}
+
+// ---- 墙面(游客中心):布局 ----
+function wallLayout() {
+ // 横幅(4:1)居中挂在海报上方;高度预算先保证海报上墙后数值 ≥30 px(s ≥ .47)
+ const n = POS.length, gap = 54, maxW = 1700;
+ const bw0 = Math.min(1150, W * .62), bh0 = BH * bw0 / BW;
+ const s = Math.min((maxW - (n - 1) * gap) / n / PW, (H - 44 - bh0 - 26) / PH, .62);
+ const pw = PW * s, ph = PH * s, total = n * pw + (n - 1) * gap;
+ const bw = bw0, bs = bw / BW, bh = BH * bs;
+ const top = Math.max(14, (H - 30 - (bh + 26 + ph)) / 2);
+ const x0 = (W - total) / 2;
+ return { s, pw, ph, bs, bh, banner: [(W - bw) / 2, top], posters: POS.map((_, i) => [x0 + i * (pw + gap), top + bh + 26]) };
+}
+function wall(t, glint = -1) {
+ const Lw = wallLayout(), wp = C.palette.wall || { board: '#5E4432', groove: '#3F2C21', rail: '#8A6547' };
+ ctx.fillStyle = wp.board; ctx.fillRect(-2000, -2000, 6000, 6000);
+ ctx.fillStyle = wp.groove; for (let x = -1200; x < 3200; x += 96) ctx.fillRect(x, -2000, 5, 6000);
+ ctx.fillStyle = mix(wp.board, '#ffffff', .07); for (let x = -1200; x < 3200; x += 96) ctx.fillRect(x + 5, -2000, 3, 6000);
+ ctx.fillStyle = wp.rail; ctx.fillRect(-2000, H - 44, 6000, 18); ctx.fillStyle = wp.groove; ctx.fillRect(-2000, H - 26, 6000, 2000);
+ // 横幅
+ const [bx, by] = Lw.banner;
+ ctx.save(); ctx.globalAlpha = .35; ctx.fillStyle = '#1a120c'; ctx.fillRect(bx + 10, by + 12, BW * Lw.bs, BH * Lw.bs); ctx.restore();
+ ctx.save(); ctx.translate(bx, by); ctx.scale(Lw.bs, Lw.bs); drawBanner(ctx, C, { pal: pal(C.banner_time || 'golden'), T }); ctx.restore();
+ POS.forEach((P, i) => {
+ const [x, y] = Lw.posters[i];
+ ctx.save(); ctx.globalAlpha = .35; ctx.fillStyle = '#1a120c'; ctx.fillRect(x + 12, y + 14, Lw.pw, Lw.ph); ctx.restore();
+ ctx.save(); ctx.translate(x, y); ctx.scale(Lw.s, Lw.s); drawPoster(ctx, P, { pal: pal(P.trail.time_of_day), T }); ctx.restore();
+ // 图钉
+ ctx.fillStyle = '#C9C2B2'; for (const dx of [18, Lw.pw - 18]) { ctx.beginPath(); ctx.arc(x + dx, y + 16, 5, 0, 7); ctx.fill(); }
+ });
+ return Lw;
+}
+
+function ascent(sec, t) {
+ const P = POS[sec.i], Lw = wallLayout(), [wx, wy] = Lw.posters[sec.i];
+ const u = seg(t, sec.climb[0], sec.climb[1]);
+ const ue = u < .5 ? ss(u * 2) * .5 * .7 + u * .3 : .5 + (1 - Math.pow(1 - (u - .5) * 2, 2)) * .5; // 起步缓、中段匀速、到顶减速
+ // 相机(海报单位):谷底 → 山顶(同一镜头里升起)
+ const start = [520, 800, 2.3], top = [500, 400, 2.06], band = [500, 1300, 1.72];
+ let cx = lerp(start[0], top[0], ue), cy = lerp(start[1], top[1], ue), z = lerp(start[2], top[2], ue);
+ const dn = eio(seg(t, sec.down[0], sec.down[1]));
+ cx = lerp(cx, band[0], dn); cy = lerp(cy, band[1], dn); z = lerp(z, band[2], dn);
+ z *= 1 + .025 * ss(seg(t, sec.items[0], sec.t1)); // 读数时极慢推
+ // 各层视差:近层下沉更快;每道山梁在镜头经过它时向两侧让开,到顶后全部回位,卡嗒一声套准
+ const settle = seg(t, sec.climb[1], sec.clack);
+ const loose = 1 - ss(seg(t, sec.clack - .02, sec.clack + .04));
+ const pass = { near: .12, spurC: .3, spurB: .5, spurA: .7, main: .95 };
+ const off = (id, pl) => {
+ const f = pl.depth, dy = (top[1] - cy) * (f - 1) * .42;
+ const side = pl.side || 0, pu = pass[id] ?? 1;
+ const bump = Math.exp(-Math.pow((u - pu) / .16, 2)) * (1 - settle);
+ const sx = side * 190 * bump * (f - .3);
+ const jig = loose * 5 * (1 - settle * .6);
+ return [(sx + jig * Math.sin(f * 9)) * loose, (dy + bump * 40 * (f - .3) + jig * Math.cos(f * 7)) * loose];
+ };
+ // 换色:同一张海报随时间整体重印(中午 → 午后 → 黄昏)
+ const pals = sec.pals.map(pal); const nS = pals.length - 1;
+ const swapTimes = pals.slice(1).map((_, k) => lerp(sec.climb[0], sec.climb[1], (k + 1) / (nS + 1)));
+ let base = pals[0], swap = null;
+ swapTimes.forEach((st, k) => { const p = seg(t, st, st + .35); if (p >= 1) base = pals[k + 1]; else if (p > 0) swap = { pal: pals[k + 1], p, dir: 'up' }; });
+ // 转成墙面坐标
+ cam(wx + cx * Lw.s, wy + cy * Lw.s, z / Lw.s);
+ wall(t);
+ ctx.save(); ctx.translate(wx, wy); ctx.scale(Lw.s, Lw.s);
+ const ANG = -.21;
+ if (swap) swap.angle = ANG;
+ const sep = loose * (settle > 0 ? 1 - .5 * settle : 1) * clamp(u * 6);
+ drawPoster(ctx, P, { pal: base, T, off, reg: .35 + loose * 1.25, sep, swap, trail: clamp(u * 1.08), band: seg(t, sec.band, sec.band + .3), name: seg(t, sec.name, sec.name + .3), header: 1, items: sec.items.map(a => seg(t, a, a + .18)) });
+ // 重印换色:一把大刮板从下往上推过整张海报
+ if (swap) { // 斜着推的大刮板:只露刀口、墨珠和一截手柄
+ const [a0, a1] = swapFrontLine(swap.p, ANG), dx = a1[0] - a0[0], dy = a1[1] - a0[1], L = Math.hypot(dx, dy);
+ const nrm = [dy / L, -dx / L]; // 前进方向(向上偏)
+ const off2 = 26;
+ squeegee(ctx, [a0[0] + nrm[0] * -off2, a0[1] + nrm[1] * -off2], [a1[0] + nrm[0] * -off2, a1[1] + nrm[1] * -off2], nrm, { color: swap.pal.sky2, scale: 1.1, seed: 11, shadow: .1, handle: .3, roll: t * 40 });
+ }
+ ctx.restore();
+}
+
+function wallShot(sec, t) {
+ const Lw = wallLayout(), last = POS.length - 1, [wx, wy] = Lw.posters[last];
+ const k = eio(seg(t, sec.pull[0], sec.pull[1]));
+ const from = [wx + 500 * Lw.s, wy + 1300 * Lw.s, 1.72 * 1.025 / Lw.s];
+ const cx = lerp(from[0], W / 2, k), cy = lerp(from[1], H / 2, k), z = Math.exp(lerp(Math.log(from[2]), 0, k));
+ cam(cx, cy, z * (1 + .012 * seg(t, sec.hold0, sec.t1)));
+ wall(t);
+ // 墨层光泽:一道斜向的反光慢慢扫过三张海报(只在墨面上,很淡)
+ const g = seg(t, sec.hold0 + .6, sec.hold0 + 3.2);
+ if (g > 0 && g < 1) {
+ ctx.save(); ctx.beginPath(); Lw.posters.forEach(([x, y]) => ctx.rect(x, y, Lw.pw, Lw.ph)); ctx.rect(Lw.banner[0], Lw.banner[1], BW * Lw.bs, BH * Lw.bs); ctx.clip();
+ const gx = lerp(-300, W + 300, ss(g)), gr = ctx.createLinearGradient(gx - 220, 0, gx + 220, 0);
+ gr.addColorStop(0, 'rgba(255,248,230,0)'); gr.addColorStop(.5, 'rgba(255,248,230,.10)'); gr.addColorStop(1, 'rgba(255,248,230,0)');
+ ctx.setTransform(1, 0, 0, 1, 0, 0); ctx.transform(1, 0, -.35, 1, 190, 0); ctx.fillStyle = gr; ctx.fillRect(-400, 0, W + 800, H);
+ ctx.restore();
+ }
+}
+
+// 片尾:最后一刮 —— 把片尾信息印成一张横版小海报(分色刮印画面,第二刮印信息带)
+let END_CACHE = null;
+function endShapes() {
+ if (END_CACHE) return END_CACHE;
+ const far = [[-20, 600]]; for (let x = 0; x <= W + 40; x += 40) far.push([x, 470 - 70 * Math.abs(Math.sin(x * .0042 + .4)) - 30 * Math.abs(Math.sin(x * .013))]); far.push([W + 20, 600]);
+ const mid = [[-20, 620], [0, 540], [260, 470], [520, 520], [760, 430], [900, 360], [1010, 410], [1180, 500], [1420, 470], [1660, 530], [1940, 500], [1940, 620]];
+ const lit = [[900, 360], [1010, 410], [1180, 500], [1080, 505], [960, 430]];
+ const trail = []; for (let k = 0; k < 9; k++) trail.push([640 + k * 30 + (k % 2) * 12, 560 - k * 22]);
+ return (END_CACHE = { far: polyPath(far), mid: polyPath(mid), lit: polyPath(lit), trail });
+}
+function endCard(sec, t) {
+ cam(W / 2, H / 2, 1); wall(t);
+ const pl = pal(POS[POS.length - 1].trail.time_of_day), E0 = endShapes();
+ const p1 = seg(t, sec.t0, sec.t0 + .55), p2 = seg(t, sec.t0 + .5, sec.t0 + .8);
+ const M = 36, ART_B = 610;
+ ctx.setTransform(1, 0, 0, 1, 0, 0);
+ // 纸(整张换上一张新纸,随第一刮一起出现)
+ const c1 = wipeRegion([0, 0, W, H], 'right', p1, 3, 60, 8);
+ ctx.save(); ctx.clip(c1); paperSheet(ctx, T, 0, 0, W, H, 1.1);
+ ctx.save(); ctx.beginPath(); ctx.rect(M, M, W - 2 * M, ART_B - M); ctx.clip();
+ ink(ctx, { path: rectPath(0, 0, W, H), knock: ringPath(1660, 350, 128, 146) }, { color: pl.sky1, sheen: 1 });
+ const top = new Path2D(); top.rect(0, 0, W, 120); for (let i = 0; i < 5; i++) { const cell = 26, th = cell * (1 - (i + .5) / 5) * .95 + 2; top.rect(0, 120 + i * cell, W, th); }
+ ink(ctx, { path: top }, { color: pl.sky2, reg: [1.5, .8], sheen: 1, trap: .4 });
+ ink(ctx, { path: circlePath(1660, 350, 108) }, { color: pl.sun, reg: [3, 1.5], sheen: 1 });
+ ink(ctx, { path: E0.far }, { color: pl.far, reg: [-1, 1], sheen: 1, trap: 1 });
+ ink(ctx, { path: E0.mid }, { color: pl.mid, reg: [1.2, -.8], sheen: 1, trap: 1 });
+ ink(ctx, { path: E0.lit }, { color: pl.glow || pl.sky2, reg: [1.2, -.8], sheen: 1 });
+ ctx.strokeStyle = pl.sun; ctx.lineWidth = 7; E0.trail.forEach(([x, y]) => { ctx.beginPath(); ctx.moveTo(x, y); ctx.lineTo(x + 16, y - 11); ctx.stroke(); });
+ ctx.restore();
+ ink(ctx, { paint: (c) => { c.font = '900 118px BigShoulders'; c.letterSpacing = '3px'; c.textAlign = 'center'; c.fillText(C.title.toUpperCase(), W / 2 - 60, 300); } }, { color: pickInk([pl.sky1, pl.sky2], [pl.near, pl.mid], 3), reg: [2, -1] });
+ ctx.restore();
+ // 第二刮:信息带 + 署名
+ if (p2 > 0) {
+ const c2 = p2 < 1 ? wipeRegion([0, ART_B, W, H - ART_B], 'right', p2, 9, 50, 8) : null;
+ ink(ctx, { path: rectPath(M, ART_B + 12, W - 2 * M, H - ART_B - 12 - M) }, { color: pl.near, clip: c2, sheen: 1 });
+ const hi = pickInk(pl.near, [pl.sky1, pl.sun], 4.5), lo = pickInk(pl.near, [pl.sky2, pl.glow, pl.sky1], 3.5);
+ ink(ctx, { paint: (c) => { c.textAlign = 'center';
+ c.font = '700 40px Outfit'; c.letterSpacing = '14px'; c.fillStyle = pl.sun; c.fillText('SILKSCREEN TRAVEL POSTER', W / 2, ART_B + 100);
+ c.fillStyle = pl.sun; c.fillRect(W / 2 - 420, ART_B + 128, 840, 5);
+ c.fillStyle = hi; c.font = '600 38px Outfit'; c.letterSpacing = '9px'; c.fillText('LEMO-OPUSCAR', W / 2, ART_B + 196); c.fillText('LEMOLAB × CLAUDE OPUS 5.5', W / 2, ART_B + 248);
+ c.fillStyle = lo; c.font = '500 24px Outfit'; c.letterSpacing = '3px';
+ c.fillText('FONTS: BIG SHOULDERS DISPLAY, OUTFIT (SIL OFL)', W / 2, ART_B + 322);
+ c.fillText('SAMPLES: VCSL, VSCO 2 CE, KARORYFER (CC0) · ARTWORK, GUITARS & SOUND MADE IN CODE', W / 2, ART_B + 360);
+ } }, { color: hi, clip: c2, reg: [1.2, .6] });
+ }
+ inkFinish(ctx, T, 0, 0, W, H, 1.1, p1 >= 1 ? 1 : 0);
+ // 刮板
+ if (p1 > 0 && p1 < 1) { const x = wipeFront([0, 0, W, H], 'right', p1, 60); const BB = [[pl.sky2, 0, .28], [pl.sky1, .28, .5], [pl.far, .5, .6]];
+ squeegee(ctx, [x + 10, -40], [x + 10, H + 40], [1, 0], { beads: BB.map(([c, a, b]) => ({ t0: a + .04, t1: b, color: c })), scale: 1.6, seed: 9, roll: x / 30 }); }
+ if (p2 > 0 && p2 < 1) { const x = wipeFront([0, ART_B, W, H - ART_B], 'right', p2, 50); squeegee(ctx, [x + 10, ART_B - 10], [x + 10, H + 40], [1, 0], { color: pl.near, scale: 1.4, seed: 4, roll: x / 30 }); }
+}
+
+export function render(t) {
+ const sec = TL.secs.find(s => t >= s.t0 && t < s.t1) || TL.secs[TL.secs.length - 1];
+ ctx.setTransform(1, 0, 0, 1, 0, 0); ctx.fillStyle = TABLE; ctx.fillRect(0, 0, W, H);
+ if (sec.kind === 'banner') banner(sec, t);
+ else if (sec.kind === 'press') press(sec, t);
+ else if (sec.kind === 'quick') quick(sec, t);
+ else if (sec.kind === 'ascent') ascent(sec, t);
+ else if (sec.kind === 'wall') wallShot(sec, t);
+ else endCard(sec, t);
+ // 段间的树影转场
+ TL.secs.forEach((s, k) => { if ((s.kind === 'quick' || s.kind === 'ascent') && Math.abs(t - s.t0) < .3) { const prev = TL.secs[k - 1]; treeWipe(t, s.t0, pal(prev.P.trail.time_of_day).near); } });
+ ctx.setTransform(1, 0, 0, 1, 0, 0);
+}
+export const getTL = () => TL;
diff --git a/styles/silkscreen-poster/demo/fonts/OFL-BigShouldersDisplay.txt b/styles/silkscreen-poster/demo/fonts/OFL-BigShouldersDisplay.txt
new file mode 100644
index 0000000..b5a4e0d
--- /dev/null
+++ b/styles/silkscreen-poster/demo/fonts/OFL-BigShouldersDisplay.txt
@@ -0,0 +1,93 @@
+Copyright 2019 The Big Shoulders Project Authors (https://github.com/xotypeco/big_shoulders)
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+http://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/styles/silkscreen-poster/demo/fonts/OFL-LeagueGothic.txt b/styles/silkscreen-poster/demo/fonts/OFL-LeagueGothic.txt
new file mode 100644
index 0000000..06b467d
--- /dev/null
+++ b/styles/silkscreen-poster/demo/fonts/OFL-LeagueGothic.txt
@@ -0,0 +1,93 @@
+Copyright 2010 The League Gothic Project Authors (https://github.com/theleagueof/league-gothic)
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+https://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/styles/silkscreen-poster/demo/fonts/OFL-Outfit.txt b/styles/silkscreen-poster/demo/fonts/OFL-Outfit.txt
new file mode 100644
index 0000000..723cd44
--- /dev/null
+++ b/styles/silkscreen-poster/demo/fonts/OFL-Outfit.txt
@@ -0,0 +1,93 @@
+Copyright 2021 The Outfit Project Authors (https://github.com/Outfitio/Outfit-Fonts)
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+https://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/styles/silkscreen-poster/demo/fonts/fonts.css b/styles/silkscreen-poster/demo/fonts/fonts.css
new file mode 100644
index 0000000..1042069
--- /dev/null
+++ b/styles/silkscreen-poster/demo/fonts/fonts.css
@@ -0,0 +1,3 @@
+@font-face { font-family: 'BigShoulders'; src: url(BigShouldersDisplay.ttf) format('truetype'); font-weight: 100 900; font-display: block; }
+@font-face { font-family: 'Outfit'; src: url(Outfit.ttf) format('truetype'); font-weight: 100 900; font-display: block; }
+@font-face { font-family: 'LeagueGothic'; src: url(LeagueGothic.ttf) format('truetype'); font-weight: 400; font-display: block; }
diff --git a/styles/silkscreen-poster/demo/index.html b/styles/silkscreen-poster/demo/index.html
new file mode 100644
index 0000000..c7771ed
--- /dev/null
+++ b/styles/silkscreen-poster/demo/index.html
@@ -0,0 +1,6 @@
+<!doctype html>
+<html><head><meta charset="utf-8"><title>Three Trails</title>
+<link rel="stylesheet" href="fonts/fonts.css">
+<style>html,body{margin:0;background:#000;overflow:hidden}canvas{display:block}</style>
+</head><body><canvas id="c" width="1920" height="1080"></canvas>
+<script type="module" src="main.js"></script></body></html>
diff --git a/styles/silkscreen-poster/demo/main.js b/styles/silkscreen-poster/demo/main.js
new file mode 100644
index 0000000..02a813b
--- /dev/null
+++ b/styles/silkscreen-poster/demo/main.js
@@ -0,0 +1,8 @@
+import { setup, render } from './film.js';
+const Q = new URLSearchParams(location.search);
+await Promise.all(['900 40px BigShoulders', '800 40px BigShoulders', '500 40px Outfit', '600 40px Outfit', '700 40px Outfit', '800 40px Outfit'].map(f => document.fonts.load(f)));
+const content = await (await fetch(Q.get('content') || 'content.json')).json();
+const TL = setup(content, document.getElementById('c'));
+window.DUR = TL.dur; window.EV = TL.ev; window.TL = TL.secs.map(s => ({ kind: s.kind, t0: s.t0, t1: s.t1 }));
+window.render = t => render(t);
+window.READY = true;
diff --git a/styles/silkscreen-poster/demo/mix.py b/styles/silkscreen-poster/demo/mix.py
new file mode 100644
index 0000000..9feabbc
--- /dev/null
+++ b/styles/silkscreen-poster/demo/mix.py
@@ -0,0 +1,185 @@
+"""mix.py · 丝印旅行海报:环境底 + 拟音 + 配乐 → mix.wav
+仓库根运行:.venv/bin/python styles/silkscreen-poster/demo/mix.py
+所有卡点来自 demo/events.json(node core/render/events.mjs 导出),配乐来自 music/score.wav(music/compose.py)。
+材质:刮板 = 橡胶刀口在尼龙网纱上(带网格颗粒的中高频"嘶");墨 = 湿、黏的低频"咕";网框 = 铝框 + 铰链弹簧;纸 = 短促干燥的中频。
+"""
+import json, os, sys
+import numpy as np
+import soundfile as sf
+ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../..'))
+sys.path.insert(0, os.path.join(ROOT, 'core/audio'))
+from sfx import SR, t_, env_exp, bp, lp, hp, noise, norm, brown, clack, creak, thump, whoosh, compress, limit, add
+
+D = os.path.dirname(os.path.abspath(__file__))
+E = json.load(open(os.path.join(D, 'events.json')))
+DUR = E['dur'] + 1.5
+N = int(DUR * SR)
+rng = np.random.default_rng(11)
+amb = np.zeros((N, 2)); fol = np.zeros((N, 2))
+ev = [e for e in E['ev']]
+def evs(tp): return [e for e in ev if e['type'] == tp]
+def first(tp, **kw):
+ for e in ev:
+ if e['type'] == tp and all(e.get(k) == v for k, v in kw.items()): return e
+def fade(x, a=.01, b=.05):
+ n1, n2 = int(a * SR), int(b * SR); x = x.copy()
+ if n1: x[:n1] *= np.linspace(0, 1, n1)
+ if n2: x[-n2:] *= np.linspace(1, 0, n2)
+ return x
+
+# ---------------- 拟音积木 ----------------
+def scrape(d, v=1.0, bright=1.0, heavy=0.0, attack=.02):
+ """刮板刮网:宽带噪声 → 带通;网格颗粒 = 180–320 Hz 的幅度调制;速度快 = 更亮"""
+ n = noise(d); tt = t_(d)
+ grain = .65 + .35 * np.abs(np.sin(2 * np.pi * (220 + 60 * bright) * tt + rng.random() * 6)) ** 2
+ x = bp(n, 700 * bright, min(9000, 5200 * bright), 2) * grain
+ x += lp(noise(d), 380) * (.5 + heavy) * .6 # 刀口压着纸的低频
+ e = np.minimum(1, tt / max(attack, 1e-3)) * np.minimum(1, (d - tt) / .06) * (1 - .25 * tt / d)
+ return norm(x * e) * v
+def squelch(v=1.0, f=140):
+ """墨珠挤压的湿"咕":低频正弦下滑 + 黏滞噪声"""
+ d = .16; tt = t_(d)
+ x = np.sin(2 * np.pi * f * tt * (1 - .9 * tt)) * env_exp(d, .05) + lp(noise(d), 900) * env_exp(d, .03) * .5
+ return norm(x) * v
+def tick(v=1.0, f=3200):
+ d = .03; tt = t_(d)
+ return norm(hp(noise(d), 2500) * env_exp(d, .003) + np.sin(2 * np.pi * f * tt) * env_exp(d, .004) * .4) * v
+def stamp(v=1.0):
+ """数据块落下:纸面闷响 + 一点点刮"""
+ d = .14; tt = t_(d)
+ x = lp(noise(d), 1200) * env_exp(d, .012) + np.sin(2 * np.pi * 160 * tt) * env_exp(d, .03) * .7 + bp(noise(d), 2500, 6000) * env_exp(d, .006) * .4
+ return norm(x) * v
+def rustle(d=.6, v=1.0):
+ """松针擦过:高频碎噪 + 颗粒"""
+ tt = t_(d); crack = (rng.random(len(tt)) > .993) * rng.standard_normal(len(tt)) * 4
+ x = bp(noise(d), 2000, 8000) * .6 + hp(crack, 3000)
+ return norm(x * np.sin(np.pi * tt / d) ** 1.5) * v
+def paperslide(d=.35, v=1.0):
+ tt = t_(d); x = bp(noise(d), 900, 4200) * (.7 + .3 * np.sin(2 * np.pi * 31 * tt))
+ return norm(x * np.sin(np.pi * tt / d) ** 2) * v
+def regclack(v=1.0):
+ """对位夹合上:木头敲击 + 金属短振(全片最重要的一声)"""
+ d = .6; tt = t_(d)
+ wood = sum(a * np.sin(2 * np.pi * f * tt) * env_exp(d, tau) for f, a, tau in [(520, 1, .03), (1180, .6, .02), (240, .8, .05)])
+ metal = sum(a * np.sin(2 * np.pi * f * tt + p) * env_exp(d, tau) for f, a, tau in [(2410, .5, .18), (3890, .3, .12), (5230, .18, .08)] for p in [0])
+ tr = hp(noise(d), 3000) * env_exp(d, .002) * 1.2
+ return norm(wood + metal + tr) * v
+
+# ---------------- 环境底 ----------------
+def seg_env(a, b, fi, fo):
+ tt = np.arange(N) / SR
+ return np.clip(np.minimum((tt - a) / max(fi, 1e-3), (b - tt) / max(fo, 1e-3)), 0, 1)
+tt_all = np.arange(N) / SR
+# 印刷工作室:低频房间声 + 远处窗外鸟(0 → 13.2,横幅段更明显)
+room = lp(brown(DUR), 260) * .5 + bp(noise(DUR), 150, 900) * .08
+lift1 = first('lift', i=0)['t']; wipe1 = first('wipe', i=1)['t']
+studio = room * seg_env(-1, wipe1 + .1, .01, .4) * .05
+amb[:, 0] += studio; amb[:, 1] += studio * .95
+for t0 in [2.3, 3.6, 6.4]: # 窗外小鸟(很轻、偏右)
+ d = .22; x = np.sin(2 * np.pi * np.cumsum(3200 + 900 * np.sin(2 * np.pi * 14 * t_(d))) / SR) * env_exp(d, .08)
+ add(amb, x, t0, .012, .6)
+# 画里的清晨湖边:网版抬起时淡入(水拍岸 + 一声潜鸟),到转场结束
+w = lp(noise(DUR), 500) * (.6 + .4 * np.sin(2 * np.pi * .7 * tt_all) ** 2)
+lake = w * seg_env(lift1, wipe1 + .2, .6, .3) * .05
+amb[:, 0] += lake * .9; amb[:, 1] += lake
+d = 1.4; loon = np.sin(2 * np.pi * np.cumsum(np.interp(t_(d), [0, .3, 1.1, 1.4], [760, 1020, 980, 900])) / SR) * np.sin(np.pi * t_(d) / d) * (1 + .15 * np.sin(2 * np.pi * 6 * t_(d)))
+add(amb, lp(loon, 2500), lift1 + .5, .02, -.4)
+# 瀑布:J-cut,在第 1 张结尾前 0.9 s 从底下涨上来,静音前收掉
+sil_pre = first('silence', pre=1)
+fall = (bp(noise(DUR), 250, 5000) * .7 + lp(brown(DUR), 180) * .6)
+fenv = seg_env(wipe1 - .9, sil_pre['t'] + .15, .9, .5)
+amb[:, 0] += fall * fenv * .07; amb[:, 1] += fall * fenv * .075
+# 山风:J-cut(静音里 0.6 s 先进来),随高度变强变亮;L-cut 延续到墙面拉出后
+asc = first('ascent'); wallp = first('wallpull'); land = first('land')
+g = lp(noise(DUR), 900) * .6 + bp(noise(DUR), 900, 3500) * .25
+gust = .55 + .45 * np.sin(2 * np.pi * .23 * tt_all + 1) * np.sin(2 * np.pi * .11 * tt_all)
+height = np.clip((tt_all - asc['t']) / asc['dur'], 0, 1)
+wind = g * gust * (.5 + .7 * height) * seg_env(asc['t'] - .6, land['t'] + .9, .6, 1.1) * .06
+amb[:, 0] += wind; amb[:, 1] += np.roll(wind, 900)
+# 游客中心室内:拉出墙面时接过山风;轻人声嘈杂(带音节调制的带通噪声)、远处门、木地板脚步
+mur = bp(noise(DUR), 250, 1800) * (.5 + .5 * np.abs(np.sin(2 * np.pi * 3.1 * tt_all + np.sin(2 * np.pi * .7 * tt_all) * 3)))
+mur = mur * seg_env(wallp['t'] + .5, DUR, .9, 1.5) * .022
+amb[:, 0] += mur; amb[:, 1] += np.roll(mur, 2400)
+add(amb, thump(.5, 80), land['t'] + 1.7, .06, -.7) # 远处门
+for k in range(4): add(amb, bp(noise(.06), 300, 2000) * env_exp(.06, .012), land['t'] + 2.2 + k * .52, .05, .6 - k * .15)
+
+# ---------------- 拟音 ----------------
+for e in ev:
+ t, tp = e['t'], e['type']
+ if tp == 'squeegee':
+ dd = e['dur']
+ if e['ink'] == 'sky': # 开场刮板:已经在刮(无起音),从左往右
+ x = scrape(dd, .8, 1.0, .3, attack=.003)
+ n = len(x); pan = np.linspace(-.3, .5, n)
+ s0 = int(t * SR); fol[s0:s0 + n, 0] += x * np.cos((pan + 1) * np.pi / 4) * 1.2; fol[s0:s0 + n, 1] += x * np.sin((pan + 1) * np.pi / 4) * 1.2
+ add(fol, squelch(.8, 120), t + .03, .35, 0)
+ else:
+ add(fol, scrape(dd, .75, 1.25, .1), t, .7 if e['ink'] == 'title' else .45, .1)
+ elif tp == 'lift':
+ add(fol, clack(.65, 1), t, .35, 0); add(fol, creak(1), t + .05, .18, .2); add(fol, whoosh(.3, 1), t + .02, .12, 0)
+ add(fol, tick(.8, 1800), t + .32, .15, .25) # 弹簧
+ elif tp == 'pull':
+ dd = e['dur']; q = e.get('quick', 0)
+ add(fol, scrape(dd, 1, 1.1 + .15 * e['n'] + (.25 if q else 0), .2), t, .55 if not q else .45, -.2 + .15 * e['n'])
+ add(fol, squelch(1, 150 + 20 * e['n']), t, .22, 0)
+ elif tp == 'band':
+ add(fol, scrape(.34, 1, .9, .6), t, .6, -.2); add(fol, squelch(1, 110), t, .3, 0)
+ elif tp == 'name':
+ add(fol, scrape(.3, 1, 1.2, .3, attack=.004), t, .5, -.1); add(fol, squelch(1, 170), t, .35, 0); add(fol, thump(1, 95), t + .28, .22, 0)
+ elif tp == 'item':
+ add(fol, stamp(1), t, .8 if not e.get('climb') else .95, -.35 + .25 * e['k']); add(fol, tick(1, 2400), t, .25, -.35 + .25 * e['k'])
+ elif tp == 'wipe':
+ if e['i'] != 2: add(fol, rustle(.6, 1), t - .3, .32, .3); add(fol, whoosh(.55, 1), t - .28, .25, -.2)
+ elif tp in ('tilt', 'pullback', 'tiltdown'):
+ add(fol, whoosh(.5, 1), t, .07, 0)
+ elif tp == 'part':
+ add(fol, paperslide(.4, 1), t - .12, .22, -.5 if e['layer'] in ('spurA', 'spurC') else .5)
+ elif tp == 'swap':
+ add(fol, scrape(e['dur'] + .1, 1, .85, .8), t, .8 if e['k'] > 1 else .65, 0); add(fol, squelch(1, 95), t, .45, 0)
+ elif tp == 'clack':
+ add(fol, regclack(1), t, 1.0, 0); add(fol, thump(1, 60), t, .5, 0)
+ elif tp == 'wallpull':
+ add(fol, whoosh(1.1, 1), t, .1, 0)
+ elif tp == 'land':
+ add(fol, tick(1, 2600), t - .05, .12, .6) # 图钉
+ elif tp == 'endpull':
+ add(fol, scrape(e['dur'], 1, 1.2, .4), t, .45, .1); add(fol, squelch(1, 120), t, .2, 0)
+ elif tp == 'endcard':
+ add(fol, scrape(.5, 1, 1.0, .4), t, .5, 0); add(fol, squelch(1, 100), t, .25, 0)
+# 步道虚线逐段印出:第 1 张印信息带时 + 爬升全程,每十六分音符一个极小的"嗒"
+B = .6
+b0 = first('band', i=0)['t']
+for k in range(4): add(fol, tick(1, 3600 + 200 * k), b0 + k * B / 4, .08, .3)
+for k in range(int(asc['dur'] / (B / 2))): add(fol, tick(1, 3000 + 60 * (k % 5)), asc['t'] + .2 + k * B / 2, .07, -.2 + .03 * (k % 8))
+
+# ---------------- 配乐 + 让路 ----------------
+mus, sr = sf.read(os.path.join(D, 'music/score.wav'), always_2d=True)
+assert sr == SR
+m = np.zeros((N, 2)); L = min(N, len(mus)); m[:L] = mus[:L]
+# 让路:拟音包络 → 配乐压低 2.5 dB(快起慢放)
+fe = np.abs(fol).max(axis=1)
+from scipy.ndimage import maximum_filter1d, uniform_filter1d
+fe = uniform_filter1d(maximum_filter1d(fe, int(.12 * SR)), int(.05 * SR))
+duck = 1 - .25 * np.clip(fe / (fe.max() + 1e-9) * 3, 0, 1)
+m *= duck[:, None]
+# 爬升段渐强(配乐分支的建议:+3 dB 包络)
+ramp = 1 + .4 * np.clip((tt_all - asc['t']) / asc['dur'], 0, 1) * (tt_all < asc['t'] + asc['dur'])
+m *= ramp[:, None]
+
+# 静音窗:两处静音里配乐和拟音必须为零;环境只留规定的(瀑布尾巴 / 山风)
+for s in evs('silence'):
+ a, b = int((s['t'] + .03) * SR), int((s['t'] + s['dur'] - .005) * SR)
+ m[a:b] = 0; fol[a:b] *= 0
+ if s.get('pre'): amb[a:b] *= np.linspace(1, .35, b - a)[:, None]
+
+# 静音里只留一声很轻的松针擦过(进入签名段的树影转场)
+w2 = [e for e in evs('wipe')][-1]
+add(fol, rustle(.6, 1), w2['t'] - .3, .07, .3)
+mix = m * .62 + fol * .55 + amb * 1.0
+for c in range(2): mix[:, c] = limit(mix[:, c], .92)
+assert np.isfinite(mix).all()
+sf.write(os.path.join(D, 'mix.wav'), mix.astype(np.float32), SR, subtype='FLOAT')
+print('mix.wav', f'{DUR:.2f}s', 'peak', f'{20*np.log10(np.abs(mix).max()):.1f} dBFS')
+for s in evs('silence'):
+ a, b = int((s['t'] + .06) * SR), int((s['t'] + s['dur'] - .02) * SR)
+ print(f"silence {s['t']:.2f}-{s['t']+s['dur']:.2f} rms {20*np.log10(np.sqrt((mix[a:b]**2).mean())+1e-12):.1f} dBFS")
diff --git a/styles/silkscreen-poster/demo/music/compose.py b/styles/silkscreen-poster/demo/music/compose.py
new file mode 100644
index 0000000..2572aa6
--- /dev/null
+++ b/styles/silkscreen-poster/demo/music/compose.py
@@ -0,0 +1,294 @@
+# compose.py · 《Three Trails》配乐:美式户外民谣,100 BPM,D 大调,开放 D 调弦(DADF#AD)
+# 卡点全部从 ../events.json 读(画面时间改了,重跑本脚本即可对齐)。
+#
+# 配器与来源(全部 CC0 或代码合成):
+# - 钢弦民谣吉他:core/audio/pluck.py `acoustic_guitar` 物理建模(扫弦 / 耙弦 / 分解和弦 / 空弦单音)
+# - 滑棒吉他:本文件 numpy 合成(连续滑音相位积分、钢弦谐波、琴体共振滤波、滑棒摩擦噪声、颤音)
+# - 口琴:core/audio/sampler.py `harmonica`(VCSL,CC0 1.0)
+# - 低音:sampler `jazz_bass`(Karoryfer Sneakybass,CC0 1.0)
+# - 鼓:sampler `cajon`(VCSL,CC0 1.0)当底鼓;`snare2:taps`(VCSL,CC0)+ `shaker`(VCSL,CC0)当刷子律动;
+# `sus_cymbal`(VSCO 2 CE,CC0 1.0)做重印 2 的镲刷渐强与高点的镲
+# - 混响:sampler.room()
+# 运行:仓库根目录 .venv/bin/python styles/silkscreen-poster/demo/music/compose.py
+import sys, os, json
+ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../..'))
+sys.path.insert(0, ROOT)
+import numpy as np, soundfile as sf
+from scipy.signal import butter, sosfilt
+from core.audio import sampler as S, pluck as P
+from core.audio.sfx import SR, add
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+EVJ = json.load(open(os.path.join(HERE, '..', 'events.json')))
+DUR = EVJ['dur']; EV = EVJ['ev']; TOT = DUR + 1.5
+BEAT = .6; E8 = .3
+S.seed(7); rng = np.random.default_rng(7)
+
+def evs(tp, **kw): return [e for e in EV if e['type'] == tp and all(e.get(k) == v for k, v in kw.items())]
+def ev1(tp, **kw):
+ r = evs(tp, **kw); return r[0] if r else None
+
+N = int(TOT * SR)
+stem = {k: np.zeros((N, 2), np.float32) for k in ['guitar', 'slide', 'harmonica', 'drums', 'bass']}
+
+# ---------------- 和弦(开放 D 调弦的真实按法) ----------------
+CH = {
+ 'D': ['D2', 'A2', 'D3', 'F#3', 'A3', 'D4'],
+ 'D/F#': ['F#2', 'A2', 'D3', 'F#3', 'A3', 'D4'],
+ 'G': ['G2', 'D3', 'G3', 'B3', 'D4', 'G4'], # 5 品横按
+ 'A': ['A2', 'E3', 'A3', 'C#4', 'E4', 'A4'], # 7 品横按
+ 'Bm': ['B2', 'F#3', 'B3', 'D4', 'F#4', 'B4'],
+ 'Dhi': ['D3', 'A3', 'D4', 'F#4', 'A4', 'D5'], # 12 品
+}
+_cache = {}
+def strum(ch, at, vel=.7, dur=1.2, up=False, spread=.018, gain=1., pan=0., top=6, mute=False):
+ key = (ch, round(vel, 2), round(dur, 2), up, round(spread, 3), top, mute)
+ if key not in _cache:
+ ps = CH[ch][-top:] if not up else CH[ch][-top:]
+ kw = dict(damp=.85, t60=.08) if mute else {}
+ _cache[key] = P.strum('acoustic_guitar', ps, dur, vel, spread=spread, up=up, **kw)
+ add(stem['guitar'], _cache[key], at, gain, pan)
+
+def pick(p, at, vel=.7, dur=2., gain=1., pan=0.):
+ add(stem['guitar'], P.pluck('acoustic_guitar', p, dur, vel), at, gain, pan)
+
+def harm(p, at, dur, vel=.6, gain=1., pan=.15, attack=.04):
+ ps = p if isinstance(p, (list, tuple)) else [p]
+ # 口琴采样的气息起音 30–60 ms 才到 30–50%,提前 35 ms 放,让听感起音落在卡点上
+ for q in ps: add(stem['harmonica'], S.note('harmonica', q, dur, vel, attack=attack, release=.25), at - .035, gain / np.sqrt(len(ps)), pan)
+
+def bass(p, at, dur=.55, vel=.75, gain=1.):
+ add(stem['bass'], S.note('jazz_bass', p, dur, vel), at, gain, 0)
+
+def kick(at, vel=.8, gain=1.): add(stem['drums'], S.hit('cajon', 'bass', vel), at, gain * 1.2, 0)
+def slap(at, vel=.55, gain=1.): add(stem['drums'], S.hit('cajon', 'slap', vel), at, gain * .7, .1)
+def brush(at, vel=.5, gain=1.):
+ add(stem['drums'], S.hit('snare2', 'taps', vel), at, gain * .55, -.15)
+ n = rng.standard_normal(int(.16 * SR)).astype(np.float32)
+ n = sosfilt(butter(2, [1800, 7000], 'band', fs=SR, output='sos'), n).astype(np.float32)
+ n *= np.exp(-np.arange(len(n)) / SR / .05).astype(np.float32)
+ add(stem['drums'], n * .12, at, gain, -.2)
+def shake(at, vel=.4, gain=1., up=False): add(stem['drums'], S.hit('shaker', 'up' if up else 'down', vel), at, gain * .5, .3)
+def cymbal(at, var='hit', vel=.6, gain=1., dur=None): add(stem['drums'], S.hit('sus_cymbal', var, vel, dur), at, gain, -.25)
+
+# ---------------- 滑棒吉他(numpy 合成) ----------------
+def hz(p): return S.hz(p)
+def slide(at, path, dur, vel=.7, gain=1., pan=-.2, vib=(5.2, .12, .45), t60=3.2):
+ """path = [(t, 音名或midi), ...] 分段线性(半音域)滑动;返回并摆放"""
+ n = int(dur * SR); t = np.arange(n) / SR
+ ts = [a for a, _ in path]; ms = [S.midi(b) for _, b in path]
+ m = np.interp(t, ts, ms)
+ vd = np.clip((t - vib[2]) / .3, 0, 1) * vib[1] * np.sin(2 * np.pi * vib[0] * t)
+ f = 440 * 2 ** ((m + vd - 69) / 12)
+ ph = 2 * np.pi * np.cumsum(f) / SR
+ y = np.zeros(n)
+ bright = np.exp(-t / .9)
+ for k in range(1, 16):
+ amp = (1 / k) * (0.35 + 0.65 * bright ** (k / 4))
+ y += amp * np.sin(k * ph + k * .3) * (f * k < 9000)
+ env = np.minimum(1, t / .008) * np.exp(-t * 6.9 / t60)
+ y *= env
+ # 琴体共振 + 钢弦亮度
+ body = sosfilt(butter(2, [90, 260], 'band', fs=SR, output='sos'), y) * .6
+ y = y + body + sosfilt(butter(2, [2200, 3800], 'band', fs=SR, output='sos'), y) * .5
+ # 滑棒摩擦:随滑动速度
+ speed = np.abs(np.gradient(m) * SR)
+ fr = sosfilt(butter(2, [1500, 5000], 'band', fs=SR, output='sos'), rng.standard_normal(n)) * np.clip(speed / 12, 0, 1) * .05
+ y = (y + fr) * env ** 0
+ y = y / (np.abs(y).max() + 1e-9) * .5 * vel
+ k = min(n, 960); y[-k:] *= np.linspace(1, 0, k)
+ add(stem['slide'], y.astype(np.float32), at, gain, pan)
+
+# ================= 编曲 =================
+def T(tp, **kw):
+ e = ev1(tp, **kw); return e['t'] if e else None
+
+# ---- Intro:0 s 就在进行的开放 D 震音扫弦 ----
+lift0 = T('lift') # 1.0
+t = 0.0; i = 0
+while t < lift0 - .05:
+ strum('D', t, .38 + .12 * (t / lift0), dur=.35, up=bool(i % 2), spread=.008, gain=.8, top=5)
+ t += .15; i += 1
+strum('D', lift0, .6, dur=.08, mute=True, gain=1.1) # 抬网版:闷音 chk
+title = [e for e in evs('squeegee') if e.get('ink') == 'title'][0]['t'] # 1.2
+kick(title, .9); strum('D', title, .85, dur=3.2, spread=.02, gain=1.2); bass('D2', title, 2.2, .7, .9)
+ht = T('title') # 1.5
+harm(['D4', 'F#4', 'A4'], ht, 3.1, .62, 1.0, attack=.03)
+tilt = T('tilt', i=0)
+strum('G', ht + 4 * BEAT - .3, .5, dur=1.2, spread=.02, gain=.7) # 3.6 附近轻扫
+strum('A', tilt - E8, .5, dur=.5, up=True, spread=.012, gain=.7) # 下摇前的上耙
+
+# ---- A 段:第 1 张,每层一声扫弦,和弦逐层上行 ----
+pulls0 = sorted(evs('pull', i=0), key=lambda e: e['t'])
+for e, ch in zip(pulls0, ['D', 'D/F#', 'G', 'A']):
+ strum(ch, e['t'], .72 + .05 * e['n'], dur=1.4, spread=.022, gain=1.05)
+ if e['n'] == 0: kick(e['t'], .55, .7)
+lift1 = T('lift', i=0) # 7.8
+kick(lift1, .9); bass('D2', lift1, .55, .8)
+band0 = T('band', i=0); name0 = T('name', i=0)
+strum('D', band0, .8, dur=2.0, spread=.05, gain=1.0) # 长下扫
+harm('A4', name0, .28, .7); harm('B4', name0 + .3, .28, .7); harm('D5', name0 + .6, 1.2, .72)
+for e, p in zip(sorted(evs('item', i=0), key=lambda e: e['t']), ['D4', 'F#4', 'A4', 'D5']):
+ pick(p, e['t'], .8, 1.6, 1.1, .2)
+# 律动:lift1 之后到转场,bass 每拍 1、3,cajon 1、3,刷子 2、4,吉他八分轻扫
+w1 = T('wipe', i=1) # 13.2
+prog = ['D', 'D', 'G', 'G', 'D', 'D', 'A', 'A']
+t = lift1 + BEAT; k = 0
+while t < w1 - .35:
+ beat = int(round(t / BEAT)) % 4
+ if beat in (0, 2): kick(t, .6, .75); bass(['D2', 'G2', 'D2', 'A2'][(k // 4) % 4], t, .5, .7, .9)
+ else: brush(t, .5)
+ if t >= name0 + 1.4:
+ ch = prog[(k // 2) % len(prog)]
+ strum(ch, t, .42, dur=.5, spread=.012, gain=.55, top=4); strum(ch, t + E8, .32, dur=.3, up=True, spread=.01, gain=.45, top=4)
+ t += BEAT; k += 1
+strum('A', w1 - E8, .8, dur=.6, up=True, spread=.03, gain=1.0) # 转场前半拍上耙(同时是第 2 张天空刮)
+
+# ---- B 段:第 2 张,八分音符扫弦 + 四踩(加速) ----
+pulls1 = sorted(evs('pull', i=1), key=lambda e: e['t'])
+for e, ch in zip(pulls1[1:], ['G', 'A', 'D']):
+ strum(ch, e['t'], .85, dur=.5, spread=.012, gain=1.1)
+sil1 = [e for e in evs('silence') if e.get('pre')][0]; s1a, s1b = sil1['t'], sil1['t'] + sil1['dur']
+band1 = T('band', i=1); name1 = T('name', i=1)
+t = w1; k = 0; progB = ['D', 'G', 'A', 'D', 'Bm', 'G', 'A', 'A']
+while t < s1a - .01:
+ kick(t, .75, .85)
+ if k % 2 == 1: brush(t, .55)
+ shake(t + E8, .35); shake(t, .25, up=True)
+ bass(['D2', 'G2', 'A2', 'D2', 'B1', 'G2', 'A2', 'A2'][(k // 2) % 8], t, .28, .75, .85)
+ ch = progB[(k // 2) % 8]
+ if not any(abs(t - e['t']) < .05 for e in pulls1):
+ strum(ch, t, .5, dur=.3, spread=.01, gain=.6, top=5)
+ strum(ch, t + E8, .38, dur=.25, up=True, spread=.008, gain=.5, top=4)
+ t += BEAT; k += 1
+strum('D', band1, .82, dur=1.6, spread=.045, gain=.95)
+slide(name1, [(0, 'A3'), (.08, 'A3'), (.42, 'D4')], 1.6, .8, 1.0)
+for e, p in zip(sorted(evs('item', i=1), key=lambda e: e['t']), ['A4', 'D5', 'F#5', 'A5']):
+ pick(p, e['t'], .8, 1.4, 1.0, .2)
+
+# ---- C 段:签名爬升 ----
+asc = ev1('ascent'); a0 = asc['t']; a1 = a0 + asc['dur']
+sil2 = [e for e in evs('silence') if not e.get('pre')][0]; s2a, s2b = sil2['t'], sil2['t'] + sil2['dur']
+slide(a0, [(0, 'D3'), (.1, 'D3'), (.9, 'A3'), (1.3, 'A3'), (1.8, 'D4')], 3.2, .95, .7, vib=(5.0, .15, 1.9), t60=4.5)
+t = a0 + BEAT; k = 1
+while t < s2a - .01:
+ g = .35 + .8 * (t - a0) / (a1 - a0) # 渐强(到顶约 +9 dB)
+ kick(t, .5 + .35 * g, .8 * g + .2)
+ if t >= a0 + 2 * BEAT: bass(['D2', 'D2', 'G2', 'A2'][(k // 2) % 4], t, .5, .75, g)
+ if t >= a0 + 3 * BEAT:
+ ch = ['D', 'D', 'G', 'A', 'Bm', 'G', 'A', 'A'][(k // 2) % 8]
+ strum(ch, t, .45 + .3 * g, dur=.5, spread=.012, gain=1.0 * g, top=5)
+ strum(ch, t + E8, .35 + .2 * g, dur=.3, up=True, spread=.01, gain=.6 * g, top=4)
+ if t >= a0 + 4 * BEAT and k % 2 == 1: brush(t, .5 * g + .2)
+ if t >= a0 + 4 * BEAT and (k % 4 == 0): harm(['D4', 'F#4', 'A4'] if (k // 4) % 2 == 0 else ['D4', 'G4', 'B4'], t, 4 * BEAT * .95, .45 + .25 * g, .7 * g, attack=.08)
+ t += BEAT; k += 1
+for e in evs('swap'):
+ big = e['k'] >= 2
+ strum('Dhi' if big else 'A', e['t'], .95, dur=1.6, up=True, spread=.03 if big else .025, gain=1.3 if big else 1.1)
+ if big: cymbal(e['t'], 'cresc', .7, .9)
+for j, e in enumerate(sorted(evs('part'), key=lambda e: e['t'])):
+ tgt = ['A3', 'B3', 'D4', 'E4'][j % 4]
+ slide(e['t'], [(0, S.midi(tgt) - 2), (.12, tgt)], .9, .8, 1.25, pan=-.35, vib=(5.5, .1, .3), t60=1.4)
+
+# ---- 高点:卡嗒 = 全乐队强拍 ----
+cl = T('clack')
+kick(cl, 1.0, 1.4); add(stem['drums'], S.hit('snare2', 'on', .8), cl, .7, 0); cymbal(cl, 'hit', .9, 1.0)
+strum('D', cl, 1.0, dur=2.6, spread=.015, gain=1.5); strum('Dhi', cl + .01, .9, dur=2.4, spread=.012, gain=1.0, pan=.3)
+bass('D2', cl, 1.2, .95, 1.2); harm(['D4', 'F#4', 'A4', 'D5'], cl, .75, .75, 1.2, attack=.01)
+slide(cl, [(0, 'D4'), (.3, 'D4'), (.9, 'F#4')], 2.4, .8, .9, pan=-.3)
+
+# ---- D 段:读数(一小节律动 → 吉他 + 口琴) ----
+wp = T('wallpull'); land = T('land'); endc = T('endcard')
+band2 = T('band', i=2); name2 = T('name', i=2)
+items2 = sorted(evs('item', i=2), key=lambda e: e['t'])
+t = cl + BEAT; k = 1
+while t < wp - .05:
+ full = t < cl + 4 * BEAT
+ if full:
+ kick(t, .75 if k % 2 == 0 else .6, .9)
+ if k % 2 == 1: brush(t, .55)
+ bass(['D2', 'D2', 'G2', 'A2'][k % 4], t, .5, .75, .9)
+ ch = ['D', 'D', 'G', 'G', 'D', 'D', 'A', 'A'][(k // 2) % 8]
+ if not any(abs(t - x) < .05 for x in [band2, name2] + [e['t'] for e in items2]):
+ strum(ch, t, .45 if full else .35, dur=.5, spread=.012, gain=.65 if full else .5, top=5)
+ t += BEAT; k += 1
+strum('D', band2, .85, dur=2.0, spread=.035, gain=1.05)
+harm('A4', name2, .28, .8, 1.3, attack=.01); harm('B4', name2 + .3, .28, .75, 1.2); harm('F#5', name2 + .6, 1.1, .75, 1.2)
+base = ['D4', 'F#4', 'A4', 'D4']
+for j, e in enumerate(items2):
+ p = base[j % 4]
+ if e.get('climb'): p = S.midi(p) + 12
+ pick(p, e['t'], .85, 1.8, 1.15, .2)
+
+# ---- 尾:呼吸,分解和弦 + 口琴收句,落在 D ----
+arp = [('G', wp), ('A', wp + 2 * BEAT)]
+for ch, t0 in arp:
+ for j, p in enumerate(CH[ch][1:]):
+ pick(p, t0 + j * E8 * .5, .5, 1.6, .7, -.1 + .05 * j)
+harm('B4', wp, .55, .55); harm('A4', wp + .6, .55, .55); harm('E4', wp + 1.2 - .01, .3, .5)
+strum('D', land, .6, dur=4.0, spread=.06, gain=.95)
+harm(['D4', 'F#4', 'A4'], land, 3.9, .5, .9, attack=.3)
+bass('D2', land, 3.8, .6, .8)
+for j, p in enumerate(['A3', 'D4', 'F#4', 'A4', 'D5', 'A4', 'F#4', 'D4']):
+ pick(p, land + BEAT * (1 + j * .75), .35, 1.5, .55, .2 * np.sin(j))
+# ---- 片尾 ----
+strum('Dhi', endc, .45, dur=4.5, spread=.05, gain=.8)
+harm('A4', endc + .2, 3.8, .45, .75, attack=.6)
+
+# ================= 静音门、混响、输出 =================
+def gate(x):
+ g = np.ones(len(x), np.float32); tt = np.arange(len(x)) / SR
+ for a, b in [(s1a, s1b), (s2a, s2b)]:
+ g *= np.where(tt < a, 1, np.where(tt >= b, 1, np.clip(1 - (tt - a) / .06, 0, 1))).astype(np.float32)
+ return x * g[:, None]
+gains = {'guitar': .95, 'slide': .8, 'harmonica': .7, 'drums': .9, 'bass': .95}
+wet = {'guitar': .16, 'slide': .22, 'harmonica': .2, 'drums': .08, 'bass': .03}
+os.makedirs(os.path.join(HERE, 'stems'), exist_ok=True)
+out = {}
+for k, x in stem.items():
+ y = S.room(x * gains[k], size=.42, mix=wet[k])
+ y = gate(y) # 混响尾巴也在静音区收掉
+ out[k] = y.astype(np.float32)
+mix = sum(out.values())
+pk = np.abs(mix).max(); sc = 10 ** (-1.5 / 20) / pk
+mix *= sc
+for k in out: out[k] *= sc; sf.write(os.path.join(HERE, 'stems', k + '.wav'), out[k], SR, subtype='FLOAT')
+sf.write(os.path.join(HERE, 'score.wav'), mix, SR, subtype='FLOAT')
+
+# ================= 自检 =================
+assert np.isfinite(mix).all()
+print(f'dur {len(mix)/SR:.2f}s peak {20*np.log10(np.abs(mix).max()):.2f} dBFS')
+def rms_db(a, b):
+ x = mix[int(a * SR):int(b * SR)]; return 20 * np.log10(np.sqrt((x ** 2).mean()) + 1e-12)
+print(f'silence1 {s1a:.2f}-{s1b:.2f}: {rms_db(s1a + .08, s1b - .005):.1f} dBFS silence2 {s2a:.2f}-{s2b:.2f}: {rms_db(s2a + .08, s2b - .005):.1f} dBFS')
+import librosa
+mono = mix.mean(1)
+# 起音检测:hop 64(1.3 ms),onset_detect + backtrack 回溯到能量开始上升的位置(去掉 onset_strength 的固有滞后)
+hop = 64
+of = librosa.onset.onset_strength(y=mono, sr=SR, hop_length=hop)
+ons = librosa.onset.onset_detect(onset_envelope=of, sr=SR, hop_length=hop, backtrack=True, units='time', delta=.02, wait=4)
+tt = librosa.times_like(of, sr=SR, hop_length=hop)
+hm = out['harmonica'].mean(1)
+hof = librosa.onset.onset_strength(y=hm, sr=SR, hop_length=hop)
+hons = librosa.onset.onset_detect(onset_envelope=hof, sr=SR, hop_length=hop, backtrack=False, units='time', delta=.02, wait=4)
+def onset_near(t0, w=.04, src=None):
+ src = ons if src is None else src
+ c = src[(src >= t0 - w) & (src <= t0 + w)]
+ if not len(c): return None
+ d = c[np.argmin(np.abs(c - t0))]; j = np.searchsorted(tt, d + .01)
+ return d - t0, of[min(j, len(of) - 1)] / (np.median(of) + 1e-9)
+chk = [('lift', lift0), ('title', title), ('harm', ht)] + [(f'pull0.{e["n"]}', e['t']) for e in pulls0] + [('lift1', lift1), ('band0', band0), ('name0', name0)] \
+ + [(f'item0.{e["k"]}', e['t']) for e in evs('item', i=0)] + [(f'pull1.{e["n"]}', e['t']) for e in pulls1] + [('band1', band1), ('name1', name1)] \
+ + [(f'item1.{e["k"]}', e['t']) for e in evs('item', i=1)] + [('ascent', a0)] + [(f'swap{e["k"]}', e['t']) for e in evs('swap')] \
+ + [(f'part.{e["layer"]}', e['t']) for e in evs('part')] + [('clack', cl), ('band2', band2), ('name2', name2)] \
+ + [(f'item2.{e["k"]}', e['t']) for e in items2] + [('wallpull', wp), ('land', land), ('endcard', endc)]
+print(f'{"cue":14s} {"t":>7s} {"Δms":>6s} {"strength":>8s}')
+bad = 0
+for nm, t0 in chk:
+ r = onset_near(t0)
+ if r is None and nm in ('harm', 'name0', 'name2'): r = onset_near(t0, src=hons); nm += '(口琴分轨)'
+ if r is None: print(nm, 'none'); bad += 1; continue
+ d, s = r; flag = '' if abs(d) <= .010 else ' <-- >10ms'
+ bad += abs(d) > .010
+ print(f'{nm:14s} {t0:7.2f} {d*1000:6.1f} {s:8.1f}{flag}')
+print('cues >10ms:', bad)
diff --git a/styles/silkscreen-poster/demo/tools/cuecheck.py b/styles/silkscreen-poster/demo/tools/cuecheck.py
new file mode 100644
index 0000000..e4bd323
--- /dev/null
+++ b/styles/silkscreen-poster/demo/tools/cuecheck.py
@@ -0,0 +1,15 @@
+"""卡点自检:mix.wav 里每个画面事件附近(±80 ms)最近的起音,与事件时间比。
+仓库根运行:.venv/bin/python styles/silkscreen-poster/demo/tools/cuecheck.py"""
+import json, os, numpy as np, soundfile as sf, librosa
+D = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..')
+E = json.load(open(os.path.join(D, 'events.json')))
+y, sr = sf.read(os.path.join(D, 'mix.wav'), always_2d=True); y = y.mean(1)
+on = librosa.onset.onset_detect(y=y, sr=sr, hop_length=128, backtrack=True, units='time')
+keep = ('pull', 'lift', 'band', 'name', 'item', 'swap', 'clack', 'endcard', 'squeegee')
+bad, n, ds = 0, 0, []
+for e in E['ev']:
+ if e['type'] not in keep: continue
+ n += 1; d = on[np.argmin(np.abs(on - e['t']))] - e['t']; ds.append(d)
+ flag = '' if abs(d) <= 1 / 24 else ' <-- 超过 1 帧'
+ bad += bool(flag); print(f"{e['t']:6.2f} {e['type']:9s} {d*1000:+6.1f} ms{flag}")
+print(f'{n} 个卡点,{n-bad} 个在 1 帧(41.7 ms)以内,中位 |误差| {np.median(np.abs(ds))*1000:.1f} ms')
diff --git a/styles/silkscreen-poster/demo/tools/timeline.mjs b/styles/silkscreen-poster/demo/tools/timeline.mjs
new file mode 100644
index 0000000..a31c8f9
--- /dev/null
+++ b/styles/silkscreen-poster/demo/tools/timeline.mjs
@@ -0,0 +1,9 @@
+// 打印时间线(可换内容):node styles/silkscreen-poster/demo/tools/timeline.mjs [content_alt.json]
+import { openDemo, closeServer } from '../../../../core/render/page.mjs';
+import path from 'path'; import { fileURLToPath } from 'url';
+const dir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
+const c = process.argv[2];
+const { browser, page } = await openDemo(path.relative(process.cwd(), dir), { q: c ? 'content=' + c : '' });
+const r = await page.evaluate(() => ({ dur: window.DUR, tl: window.TL }));
+console.log('dur', r.dur.toFixed(2)); r.tl.forEach(s => console.log(s.kind.padEnd(7), s.t0.toFixed(2), '→', s.t1.toFixed(2)));
+await browser.close(); closeServer();
diff --git a/styles/silkscreen-poster/poster.jpg b/styles/silkscreen-poster/poster.jpg
new file mode 100644
index 0000000..6f900aa
Binary files /dev/null and b/styles/silkscreen-poster/poster.jpg differ