Add 27-model production-line Web FreeCAD course tooling and pages

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
2026-11-13 04:16:04 +08:00
parent 789e18ca3e
commit 4eff6110e7
447 changed files with 29820 additions and 71 deletions

View File

@@ -0,0 +1,116 @@
# 生产线 27 件 GLB 初学者课程 · 接续点
更新:2026-11-12
计划:`/home/mes123456/.claude/plans/partitioned-puzzling-haven.md`
## 目标
用有头 Web FreeCAD 把 `/home/mes123456/FreeCADWasmDev/working/GLTFmodel/` 的 27 个 GLB
逐个创建为图元部件模型,18 集中文配音课程(约 3 小时)+ 图文课程页 + 交互页。
## 已完成(P0 部分)
- `build-line-spec.mjs`:27 个 GLB → `line-spec.json` + `line-inventory.md`。
- 完整 `node.matrix`/TRS/scale;Z-up 恒等映射(×1000),已用地面平面
4867.5×3673.2×310.1 mm 做轴向自检。
- 教学部件聚类:根子节点子树 → 凝聚合并/拆分;27 模型 / 88 部件;整线
bbox `[-2439.8,-2032.8,-1039.2,2714.3,1844.2,1473.6]` mm。
- 图元:默认世界对齐 Box;两轴近似相等且纵向拉长时 Cylinder;人工预算在
`overrides.json`。
- `sample-material-colors.py` → `material-colors.json`:296 个材质,184 个带贴图,
用 Pillow 采样贴图平均色;spec 中 60 个部件用 `textureAvg`,28 个用 `baseColorFactor`。
- 校核:`partCount=88` 与计划一致;ABB 11 段;颜色抽查(地面地线黄色、柜门浅灰)合理。
- 参考查看器已泛化:`web/src/delta-reference-panel.tsx` 支持 `{src,title,upAxis,modelsUrl}`,
新增 `LineReferencePanel`(27 件下拉、Z-up);项目页新增“产线参考模型”按钮。
`vite.config.ts` 的 `connect-src` 增加 `blob:`(GLTFLoader 贴图走 blob,原先被 CSP 拦截)。
- 冒烟通过:`spikes/line-reference-smoke.mjs`,27 个选项、地面与地线
`4.87 × 3.67 × 0.31 m`、0 pageError/0 consoleError;证据
`evidence/p0/reference-smoke.json` + `spikes/line-reference-smoke.png`。
- 颜色持久化已确认:DELTA 检查点 `Document.xml` 中每个对象都有
`WebDisplayColor`(`App::PropertyString`,`#rrggbb`),无需 `GuiDocument.xml`。
- P1 管线落地:`course.json`(18 集、88 对象,由 `build-course-json.mjs` 从 spec 生成)、
`record/generate-tts/assemble/verify/build-course-page`(line 薄包装,含
`page.route("**/line-glb/*.glb")` 回填)、`lib/{ui,build,line-precision,assembly}.mjs`。
- E01/E02/E03 smoke 全部通过(0 pageError/consoleError):
- E01:27 个参考模型,主控制柜 1.50×0.74×0.75 m,地面 4.87×3.67×0.31 m。
- E02:Spreadsheet 6 行 + 公式 `B8=B2+C2`(2244.1→2344.2→2244.1,含 0.01 容差)。
- E03:主控制柜 8 个 Box,保存 `checkpoints/E03.FCStd`(9,624 字节);
`line-precision` 8/8 通过、无多余对象;`Document.xml` 有 8 个 `WebDisplayColor`
(`#000000/#a2a6ad/#c5c5c5/#e5e9ec`)。
- E04:长控制柜 8 件,累计 16 对象,precision 通过;`checkpoints/E04.FCStd`。
- E05:柜门 + 双显示屏 5 件,累计 21 对象,precision 通过。
- E06:料仓/原料上料 7 件,累计 28 对象;非正圆件回退 Box,precision 通过。
- E07:上料/传送带 8 件,累计 36 对象,precision 通过。
- E08:旋转/称重 4 件,累计 40 对象,precision 通过。
- E09:夹取/辅助夹爪 8 件,累计 48,通过。
- E10:推料/存储 7 件,累计 55,通过。
- E11:检测块/支架/运送检测 4 件,累计 59;首次使用 `Part_Cylinder`
(R15×60 红色检测头),包围盒 30×30×60,通过。
- E12:原料装配/检测台 4 件,累计 63,通过。
- E13:三色灯/ Tool /原点 8 件,累计 71;3 个圆柱 + 纯红绿蓝坐标轴,
逐对象 `WebDisplayColor` 验证 `#ff0000/#00ff00/#0000ff`,通过。
- E14:ABB 11 件(含 R109.7×431.2 下臂圆柱),累计 82,通过。
- E15:复核集(无新几何),累计 82,通过。
- E16:三块地面 6 件,累计 88,通过;27 个模型全部建完。
- E17:Assembly 新建 `LineAssembly`,插入 88 条链接,通过(0 pageError)。
- E18:88 对象全量审计通过;选中 `CabinetA_P02` 导出 STEP/STL 到 OPFS;
保存 `E18.FCStd`(89,483 字节)与 `evidence/course.json`。
- **18/18 集 smoke 全部通过**(E02–E18 用 `COURSE_FAST=1` 快烟)。
- E01 媒体链路已完整验证:TTS 6 场景 → 有头录制 242.2 s → assemble →
verify 20 项检查、21 条字幕、6 张 stills。
- 课程页 `teaching/cases/production-line-course.html`:18 卡片、E01 视频、
17 集 pending、桌面/移动 0 错误、0 横向溢出(`evidence/course-page.json`)。
- 参考页 `teaching/cases/production-line-reference.html`:27 件下拉、Z-up,
地面 `4.87×3.67×0.31 m`,0 错误(`evidence/reference-page.json`,
截图 `production-line-reference.png`)。
- GLB 通过 `teaching/cases/line-models -> /home/.../working/GLTFmodel` 符号链接提供,
未复制进 public/dist。
- E02–E18 媒体批处理已在后台启动:`run-media-batch.sh`,日志
`evidence/media-batch.log`(TTS → record → assemble → verify)。
- E02 成片 261.6 s / 20 checks / 18 cues,passed。
- E03 成片 522.4 s / 22 checks / 20 cues,precision 8/8,passed;截图确认 File 菜单已关闭。
- E04 成片 523.3 s / 22 checks / 20 cues,precision 16/16,passed。
- E01 已在 Xvfb `:3` 重录并重新 assemble/verify:242.2 s / 20 checks / 21 cues,
passed;截图确认 File 菜单关闭。raw 录制文件已按集删除以节省磁盘。
- **E01 需重录**:首版录制时 File 菜单一直展开,遮住对象树/工具栏。已修
`lib/ui.mjs newDocument` 与 E01 驱动(新建文档后关闭所有 `details[open]`);
E02 不经过该路径,E03 起批处理会使用修复后的代码;E03 截图已确认菜单关闭。
- 整线交互页已生成:`production-line-assembly.html` + `production-line-assembly.png`;
STL 用 Node WASM 探针从 `E18.FCStd` 一次导出 88 件到 `teaching/cases/line-parts/`
(`spikes/export-stls-node.mjs`,182,192 字节),页面加载 88/88、27 个模型、
下拉 28 项、0 错误(`evidence/assembly-page.json`)。
- 参考页与装配页均已加入课程页 hero;课程页新增“分步截图”画廊(`stills/E##`)。
- `audit-course.mjs`:课程级审计(27 模型 / 88 部件 / 18 集媒体 + evidence + 检查点)。
- 共享修复:`lib/model-build.mjs` 在 S01 等待检查点对象数达到 `expectedNames - 新部件`
后再创建,避免快速模式下把已加载对象误认成新 Box(E07 首轮复现,修复后通过)。
- E03–E08 目前均为 smoke,尚未 TTS/录屏/合成。
## 真实残余
- E02–E18 的媒体成片仍在后台生成;完成前课程页保持 pending。
- 整线交互页 `production-line-assembly.html` 尚未生成;需要从 E18.FCStd 逐件导出
STL 到 `teaching/cases/line-parts/`,再用 three.js 拼场景。
- 课程页 hero 图只差 `production-line-assembly.png`。
- 88 对象重开视口已冒烟(E18 审计通过),但整线截图/相机仍需人工确认。
- 参考查看器首次选大文件(三柜子 17/24 MB)需等待。
- E18 的 STEP/STL 只导出了 `CabinetA_P02` 作为流程演示;全量 STL 导出待做。
## 下一步精确入口
1. E04:复制 E03 驱动结构,模型改为 `CabinetB`(8 部件),`checkpointIn: "E03"`;
先 smoke,再写 `script.zh.json`,再 generate-tts/record/assemble/verify。
2. E05–E13 按 `course.json` 的 models 列表批量推进(每集一个驱动,复用 `createBuilder`)。
3. E06 前先冒烟圆柱:`Part_Cylinder` → `Property Radius`/`Property Height` 或任务面板
`Radius`/`Height`,确保半径/高度写入并重算。
4. E17 前决定总装策略:27 个模型 Compound 链接 vs 88 个部件链接;用 E16 检查点做一次
88 对象重开性能冒烟。
5. 每集完成后:`record --smoke` → `generate-tts --episode` → `DISPLAY=:2 record --episode`
→ `assemble --episode` → `verify --episode` → 更新本文件。
## 关键路径
- 参考目录:`/home/mes123456/FreeCADWasmDev/working/GLTFmodel`
- 应用:`http://127.0.0.1:5181/project.html?workbench=Part`
- 课程服务:`5190`
- 复用:`web/tools/delta-course/`、`web/tools/carrier-course/lib/`
- 视频/配音工具:ffmpeg、`/home/mes123456/FreeCADWasmDev/working/FreeCAD/.venv-video/bin/edge-tts`

View File

@@ -0,0 +1,53 @@
# 生产线 27 件 GLB 初学者课程
用有头 Web FreeCAD 把 `/home/mes123456/FreeCADWasmDev/working/GLTFmodel/` 的 27 个 GLB
逐个创建为 88 个图元部件,18 集中文配音课程 + 图文课程页 + 交互页。
## 产物
| 文件 | 作用 |
|---|---|
| `line-spec.json` | 唯一几何真源:27 模型 / 88 部件,Z-up、mm、颜色 |
| `line-inventory.md` | 人可读零件表 |
| `course.json` | 18 集、对象列表、检查点关系 |
| `episodes/E01..E18/` | 每集 `driver.mjs` + `script.zh.json` |
| `checkpoints/E##.FCStd` | 累计检查点(E18 为交付主文档) |
| `evidence/E##/verification.json` | 每集媒体校验 |
| `evidence/course-audit.json` | 课程级 27/88/18 审计 |
| `teaching/media/line-course/` | MP4/WebM/VTT/SRT/海报 |
| `teaching/cases/production-line-course.html` | 图文课程页 |
| `teaching/cases/production-line-reference.html` | 27 件参考 GLB 查看器 |
| `teaching/cases/production-line-assembly.html` | 88 件重建结果交互页 |
## 生成顺序
```bash
node /home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/build-line-spec.mjs
node /home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/build-course-json.mjs
node /home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/record.mjs --episode E03 --smoke
node /home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/generate-tts.mjs --episode E03
DISPLAY=:2 node /home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/record.mjs --episode E03
node /home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/assemble.mjs --episode E03
node /home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/verify.mjs --episode E03
```
`COURSE_FAST=1` 只用于冒烟,正式录制必须去掉。
## 页面/服务
- 应用:`http://127.0.0.1:5181/project.html?workbench=Part`
- 课程服务:`http://127.0.0.1:5190/cases/production-line-course.html`
- 参考 GLB 不复制进 public/dist:`teaching/cases/line-models` 符号链接到参考目录;
录制时另由 `page.route("**/line-glb/*.glb")` 回填。
## 验收
```bash
node /home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/audit-course.mjs
node /home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/spikes/course-page-check.mjs
node /home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/spikes/reference-page-check.mjs
node /home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/spikes/assembly-page-check.mjs
```
精度口径:部件包围盒 ±1.5 mm、中心 ±3 mm、颜色每通道 ±0.02;模型整体 ±2/5 mm;
颜色从 FCStd `Document.xml` 的 `WebDisplayColor` 读取。

View File

@@ -0,0 +1,205 @@
#!/usr/bin/env node
// Assembles one episode: raw X11 recording + edge-tts narration + subtitles.
// Cuts are driven by raw/<episode>/markers.json; optional speedup-start/end
// markers compress repetitive UI stretches.
import fs from "node:fs";
import path from "node:path";
import { spawnSync } from "node:child_process";
import { fileURLToPath } from "node:url";
const here = path.dirname(fileURLToPath(import.meta.url));
const webRoot = path.resolve(here, "../..");
const args = process.argv.slice(2);
const option = (name, fallback = "") => {
const index = args.indexOf(name);
return index < 0 ? fallback : args[index + 1] ?? fallback;
};
const episodeId = option("--episode");
if (!episodeId) throw new Error("--episode is required");
const course = JSON.parse(fs.readFileSync(path.join(here, "course.json"), "utf8"));
const episode = course.episodes.find(item => item.id === episodeId);
if (!episode) throw new Error(`unknown episode ${episodeId}`);
const episodeDir = path.join(here, "episodes", episodeId);
const rawDir = path.join(here, "raw", episodeId);
const segmentsDir = path.join(episodeDir, "segments");
const audioDir = path.join(episodeDir, "audio");
const mediaDir = path.join(webRoot, "teaching", "media", "line-course");
const ffmpeg = "ffmpeg";
const ffprobe = "ffprobe";
const readJson = file => JSON.parse(fs.readFileSync(file, "utf8"));
const script = readJson(path.join(episodeDir, "script.zh.json"));
const durations = readJson(path.join(episodeDir, "audio-durations.json")).scenes;
const markerFile = readJson(path.join(rawDir, "markers.json"));
const markers = markerFile.markers;
const order = script.scenes.map(scene => scene.id);
const sceneStart = id => markers.find(entry => entry.id === "scene-start" && entry.scene === id);
const marker = id => markers.find(entry => entry.id === id);
for (const id of order) if (!sceneStart(id)) throw new Error(`missing scene-start ${id}`);
if (!marker("end")) throw new Error("recording is incomplete: missing end marker");
const captureStart = marker("captureStart")?.offset ?? 0;
const rawVideo = path.join(rawDir, "screen-recording.mp4");
if (!fs.existsSync(rawVideo)) throw new Error(`raw video missing: ${rawVideo}`);
for (const directory of [segmentsDir, mediaDir]) fs.mkdirSync(directory, { recursive: true });
const run = (command, argv, label) => {
const result = spawnSync(command, argv, { encoding: "utf8", maxBuffer: 512 * 1024 * 1024 });
if (result.status !== 0) throw new Error(`${label} failed (${result.status})\n${(result.stderr || "").slice(-5000)}`);
return result.stdout;
};
const probe = file => {
const text = String(run(ffprobe, ["-v", "error", "-show_entries", "format=duration", "-of", "default=nw=1:nk=1", file], `probe ${path.basename(file)}`)).trim();
const value = Number(text);
if (!Number.isFinite(value) || value <= 0) throw new Error(`bad duration for ${file}: ${text}`);
return value;
};
const round = value => Math.round(value * 1000) / 1000;
const concatList = (files, listPath) => {
fs.writeFileSync(listPath, files.map(file => `file '${file.replace(/'/g, "'\\''")}'`).join("\n") + "\n");
return listPath;
};
const videoArgs = output => ["-an", "-c:v", "libx264", "-preset", "veryfast", "-crf", "20",
"-pix_fmt", "yuv420p", "-profile:v", "high", "-level", "4.2", "-g", "60", "-r", "30",
"-movflags", "+faststart", output];
// Scene spans, with optional speedup compression.
const spans = [];
for (let index = 0; index < order.length; index++) {
const id = order[index];
const start = sceneStart(id).offset - captureStart;
const end = index + 1 < order.length
? sceneStart(order[index + 1]).offset - captureStart
: marker("end").offset - captureStart;
if (end <= start) throw new Error(`invalid span for ${id}: ${start}..${end}`);
spans.push({ id, start, end });
}
const segments = [];
for (const span of spans) {
const speedups = markers
.filter(entry => entry.id === "speedup-start" && entry.scene === span.id)
.map(entry => ({ start: entry.offset - captureStart, end: (markers.find(other => other.id === "speedup-end" && other.scene === span.id && other.offset > entry.offset)?.offset ?? span.end) - captureStart, factor: entry.factor ?? 6 }))
.filter(entry => entry.end > entry.start)
.sort((a, b) => a.start - b.start);
const parts = [];
let cursor = span.start;
const addCut = (from, to, factor, suffix) => {
if (to - from < 0.05) return;
const file = path.join(segmentsDir, `${span.id}${suffix}.mp4`);
const filter = factor > 1
? `setpts=(PTS-STARTPTS)/${factor},fps=30,crop=1600:860:0:40,scale=1600:900`
: "setpts=PTS-STARTPTS,fps=30,crop=1600:860:0:40,scale=1600:900";
run(ffmpeg, ["-y", "-ss", String(from), "-t", String(to - from), "-i", rawVideo,
"-vf", filter, ...videoArgs(file)], `${span.id} cut ${suffix}`);
parts.push({ file, duration: probe(file) });
};
for (const speed of speedups) {
if (speed.start > cursor) addCut(cursor, speed.start, 1, `-pre${parts.length}`);
addCut(speed.start, speed.end, speed.factor, `-fast${parts.length}`);
cursor = Math.max(cursor, speed.end);
}
if (cursor < span.end) addCut(cursor, span.end, 1, `-post${parts.length}`);
if (!parts.length) throw new Error(`no parts for ${span.id}`);
segments.push({ id: span.id, parts, duration: parts.reduce((sum, part) => sum + part.duration, 0) });
}
// Keep narration intact: when a scene is shorter than its voice-over, clone
// the last frame instead of letting the audio trim cut the sentence off.
for (const segment of segments) {
const narration = durations[segment.id]?.duration ?? 0;
const pad = narration + 0.3 - segment.duration;
if (pad > 0.1) {
const last = segment.parts.at(-1);
const padded = path.join(segmentsDir, `${segment.id}-pad.mp4`);
const before = probe(last.file);
run(ffmpeg, ["-y", "-i", last.file, "-vf", `tpad=stop_mode=clone:stop_duration=${pad.toFixed(3)}`,
...videoArgs(padded)], `${segment.id} pad`);
segment.duration = segment.duration - before + probe(padded);
last.file = padded;
console.log(`padded ${segment.id} by ${pad.toFixed(2)}s for narration`);
}
}
const videoOnly = path.join(segmentsDir, "video-only.mp4");
run(ffmpeg, ["-y", "-f", "concat", "-safe", "0", "-i", concatList(segments.flatMap(item => item.parts.map(part => part.file)), path.join(segmentsDir, "video-list.txt")),
"-c", "copy", videoOnly], "concat video");
const totalVideo = probe(videoOnly);
let cursor = 0;
for (const segment of segments) {
segment.start = round(cursor);
segment.end = round(cursor + segment.duration);
cursor += segment.duration;
}
const narrationWavs = [];
for (const segment of segments) {
const source = path.join(audioDir, `${segment.id}.mp3`);
if (!fs.existsSync(source)) throw new Error(`missing narration ${source}`);
const wav = path.join(segmentsDir, `audio-${segment.id}.wav`);
run(ffmpeg, ["-y", "-i", source, "-af", `apad=whole_dur=${segment.duration.toFixed(3)},atrim=0:${segment.duration.toFixed(3)}`,
"-ar", "48000", "-ac", "2", "-c:a", "pcm_s16le", wav], `audio ${segment.id}`);
narrationWavs.push(wav);
}
const narration = path.join(segmentsDir, "narration.wav");
run(ffmpeg, ["-y", "-f", "concat", "-safe", "0", "-i", concatList(narrationWavs, path.join(segmentsDir, "audio-list.txt")),
"-c:a", "pcm_s16le", narration], "concat narration");
const base = `${episode.id}-${episode.slug}`;
const mp4 = path.join(mediaDir, `${base}.mp4`);
run(ffmpeg, ["-y", "-i", videoOnly, "-i", narration, "-c:v", "copy", "-c:a", "aac", "-b:a", "192k",
"-ar", "48000", "-shortest", "-movflags", "+faststart", mp4], "mux mp4");
const webm = path.join(mediaDir, `${base}.webm`);
run(ffmpeg, ["-y", "-i", mp4, "-c:v", "libvpx-vp9", "-crf", "38", "-b:v", "0", "-row-mt", "1",
"-deadline", "good", "-cpu-used", "6", "-c:a", "libopus", "-b:a", "112k", webm], "webm");
const posterTime = (segments.find(item => item.id === "S02")?.start ?? 10) + 5;
const poster = path.join(mediaDir, `${base}-poster.png`);
run(ffmpeg, ["-y", "-ss", String(Math.min(posterTime, Math.max(totalVideo - 1, 0))), "-i", mp4,
"-frames:v", "1", "-q:v", "2", poster], "poster");
// Merge SRT cues into one timeline. Speedup regions are remapped by the
// ratio between the raw span and the assembled segment duration.
const toSeconds = text => {
const match = /^(\d+):(\d+):(\d+)[,.](\d+)$/.exec(text.trim());
if (!match) return null;
return Number(match[1]) * 3600 + Number(match[2]) * 60 + Number(match[3]) + Number(match[4]) / 1000;
};
const fmt = seconds => {
const ms = Math.round(seconds * 1000);
const h = Math.floor(ms / 3600000), m = Math.floor((ms % 3600000) / 60000), s = Math.floor((ms % 60000) / 1000), milli = ms % 1000;
return `${String(h).padStart(2, "0")}:${String(m).padStart(2, "0")}:${String(s).padStart(2, "0")}.${String(milli).padStart(3, "0")}`;
};
const cues = [];
for (const segment of segments) {
const srtPath = path.join(audioDir, `${segment.id}.srt`);
if (!fs.existsSync(srtPath)) continue;
const blocks = fs.readFileSync(srtPath, "utf8").replace(/\r/g, "").trim().split(/\n\n+/);
for (const block of blocks) {
const lines = block.split("\n");
const timing = lines.find(line => line.includes("-->"));
if (!timing) continue;
const [fromText, toText] = timing.split("-->").map(value => value.trim());
const from = toSeconds(fromText), to = toSeconds(toText);
if (from === null || to === null) continue;
cues.push({ from: segment.start + from, to: segment.start + to, text: lines.slice(lines.indexOf(timing) + 1).join("\n").trim() });
}
}
const vtt = ["WEBVTT", "", ...cues.map((cue, index) => `${index + 1}\n${fmt(cue.from)} --> ${fmt(cue.to)}\n${cue.text}\n`)].join("\n");
const vttPath = path.join(mediaDir, `${base}.zh.vtt`);
fs.writeFileSync(vttPath, vtt);
const srtPath = path.join(mediaDir, `${base}.zh.srt`);
fs.writeFileSync(srtPath, cues.map((cue, index) => `${index + 1}\n${fmt(cue.from).replace(".", ",")} --> ${fmt(cue.to).replace(".", ",")}\n${cue.text}\n`).join("\n"));
const assembly = {
schema: "freecad-web-line-course/video-assembly/v1",
generatedAt: new Date().toISOString(),
episode: episodeId,
title: episode.title,
status: "assembled",
source: path.relative(here, rawVideo),
captureStart,
totalVideo: round(totalVideo),
scenes: segments.map(segment => ({ id: segment.id, start: segment.start, end: segment.end, duration: round(segment.duration), narration: durations[segment.id]?.duration ?? null })),
outputs: { mp4: path.relative(webRoot, mp4), webm: path.relative(webRoot, webm), vtt: path.relative(webRoot, vttPath), srt: path.relative(webRoot, srtPath), poster: path.relative(webRoot, poster) },
cues: cues.length,
};
fs.writeFileSync(path.join(episodeDir, "assembly.json"), `${JSON.stringify(assembly, null, 2)}\n`);
console.log(JSON.stringify({ ok: true, episode: episodeId, totalVideo: assembly.totalVideo, scenes: assembly.scenes, outputs: assembly.outputs, cues: cues.length }, null, 2));

View File

@@ -0,0 +1,44 @@
#!/usr/bin/env node
// Course-level audit: 27 models / 88 parts, 18 episodes, media + evidence + checkpoints.
import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
const here = path.dirname(fileURLToPath(import.meta.url));
const webRoot = path.resolve(here, "../..");
const course = JSON.parse(fs.readFileSync(path.join(here, "course.json"), "utf8"));
const spec = JSON.parse(fs.readFileSync(path.join(here, "line-spec.json"), "utf8"));
const mediaDir = path.join(webRoot, "teaching", "media", "line-course");
const episodes = [];
for (const episode of course.episodes) {
const base = `${episode.id}-${episode.slug}`;
const media = [".mp4", ".webm", ".zh.vtt", ".zh.srt", "-poster.png"]
.map(suffix => ({ suffix, exists: fs.existsSync(path.join(mediaDir, `${base}${suffix}`)) }));
const evidencePath = path.join(here, "evidence", episode.id, "verification.json");
const evidence = fs.existsSync(evidencePath) ? JSON.parse(fs.readFileSync(evidencePath, "utf8")) : null;
const checkpoint = episode.checkpointOut
? fs.existsSync(path.join(here, "checkpoints", `${episode.id}.FCStd`)) : null;
episodes.push({
id: episode.id, slug: episode.slug, objects: episode.objects.length,
media, mediaOk: media.every(item => item.exists),
verification: evidence?.status ?? null, checkpoint,
ok: media.every(item => item.exists) && evidence?.status === "passed" && checkpoint !== false,
});
}
const models = spec.models.length;
const parts = spec.parts ? spec.parts.length : spec.models.reduce((sum, model) => sum + model.parts.length, 0);
const report = {
schema: "freecad-web-line-course/course-audit/v1",
generatedAt: new Date().toISOString(),
models, parts,
episodes: episodes.length,
mediaPassed: episodes.filter(episode => episode.mediaOk).length,
verificationPassed: episodes.filter(episode => episode.verification === "passed").length,
pending: episodes.filter(episode => !episode.ok).map(episode => episode.id),
detail: episodes,
ok: models === 27 && parts === 88 && episodes.length === 18 && episodes.every(episode => episode.ok),
};
fs.mkdirSync(path.join(here, "evidence"), { recursive: true });
fs.writeFileSync(path.join(here, "evidence", "course-audit.json"), `${JSON.stringify(report, null, 2)}\n`);
console.log(JSON.stringify({ ok: report.ok, models, parts, episodes: report.episodes,
mediaPassed: report.mediaPassed, verificationPassed: report.verificationPassed, pending: report.pending }));

View File

@@ -0,0 +1,117 @@
#!/usr/bin/env node
// Generates production-line-assembly.html from line-spec + exported STLs.
import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
const here = path.dirname(fileURLToPath(import.meta.url));
const webRoot = path.resolve(here, "../..");
const spec = JSON.parse(fs.readFileSync(path.join(here, "line-spec.json"), "utf8"));
const outFile = path.join(webRoot, "teaching", "cases", "production-line-assembly.html");
fs.copyFileSync(path.join(here, "line-spec.json"), path.join(webRoot, "teaching", "cases", "production-line-spec.json"));
const parts = spec.models.flatMap(model => model.parts.map(part => ({
partName: part.partName, model: model.name, modelLabel: model.label,
color: part.color, worldBBox: part.worldBBox,
})));
const models = spec.models.map(model => ({ name: model.name, label: model.label }));
const groundModels = new Set(["GroundPlane", "Plane", "Plane001"]);
const machineParts = parts.filter(part => !groundModels.has(part.model));
const machineBox = [0, 1, 2].map(axis => Math.min(...machineParts.map(part => part.worldBBox[axis])))
.concat([0, 1, 2].map(axis => Math.max(...machineParts.map(part => part.worldBBox[axis + 3]))));
const html = `<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="data:," />
<title>生产线 · 27 个模型 / 88 个部件重建结果</title>
<style>
html, body { margin: 0; height: 100%; background: #0d1318; color: #dbe6ee; font: 14px/1.5 system-ui, "Noto Sans SC", sans-serif; overflow: hidden; }
header { position: fixed; top: 0; left: 0; right: 0; z-index: 2; display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: #0b1116e6; border-bottom: 1px solid #2a3a45; flex-wrap: wrap; }
header h1 { margin: 0; font-size: 16px; }
header select { background: #0b1014; color: #dbe6ee; border: 1px solid #3f3f3f; border-radius: 4px; padding: 3px 6px; }
header .stats { color: #93a6b3; font-size: 12px; }
#view { position: fixed; inset: 48px 0 0 0; }
#hint { position: fixed; left: 16px; bottom: 12px; color: #6f8390; font-size: 12px; z-index: 2; }
</style>
<script type="importmap">{ "imports": { "three": "./vendor/three.module.js" } }</script>
</head>
<body>
<header>
<h1>生产线重建结果</h1>
<select id="model" aria-label="Filter model"><option value="">全部 27 个模型</option></select>
<span class="stats" id="stats">加载中…</span>
</header>
<div id="view"></div>
<p id="hint">左键旋转 · 滚轮缩放 · 右键平移</p>
<script type="module">
import * as THREE from "three";
import { OrbitControls } from "./vendor/OrbitControls.js";
import { STLLoader } from "./vendor/STLLoader.js";
const PARTS = ${JSON.stringify(parts)};
const MODELS = ${JSON.stringify(models)};
const host = document.getElementById("view");
const select = document.getElementById("model");
for (const model of MODELS) {
const option = document.createElement("option");
option.value = model.name; option.textContent = model.label;
select.appendChild(option);
}
const scene = new THREE.Scene();
scene.background = new THREE.Color(0x0d1318);
const camera = new THREE.PerspectiveCamera(42, host.clientWidth / host.clientHeight, 1, 20000);
camera.up.set(0, 0, 1);
const renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
renderer.setSize(host.clientWidth, host.clientHeight);
host.appendChild(renderer.domElement);
scene.add(new THREE.HemisphereLight(0xffffff, 0x334455, 2.4));
const key = new THREE.DirectionalLight(0xffffff, 2.2); key.position.set(400, 700, 500); scene.add(key);
const fill = new THREE.DirectionalLight(0xffffff, 0.8); fill.position.set(-600, 200, -400); scene.add(fill);
const root = new THREE.Group();
scene.add(root);
const byModel = new Map();
const loader = new STLLoader();
let loaded = 0;
for (const part of PARTS) {
try {
const buffer = await (await fetch("./line-parts/" + encodeURIComponent(part.partName) + ".stl")).arrayBuffer();
const geometry = loader.parse(buffer);
const color = new THREE.Color().setRGB(part.color[0], part.color[1], part.color[2], THREE.SRGBColorSpace);
const mesh = new THREE.Mesh(geometry, new THREE.MeshStandardMaterial({ color, metalness: 0.3, roughness: 0.6 }));
mesh.userData = { partName: part.partName, model: part.model };
if (!byModel.has(part.model)) { const group = new THREE.Group(); group.name = part.model; byModel.set(part.model, group); root.add(group); }
byModel.get(part.model).add(mesh);
loaded++;
} catch (error) { console.warn("part", part.partName, error); }
}
const [xmin, ymin, zmin, xmax, ymax, zmax] = ${JSON.stringify(machineBox)};
const size = new THREE.Vector3(xmax - xmin, ymax - ymin, zmax - zmin);
const center = new THREE.Vector3((xmin + xmax) / 2, (ymin + ymax) / 2, (zmin + zmax) / 2);
const maxSize = Math.max(size.x, size.y, size.z);
camera.position.set(center.x + maxSize * 1.05, center.y - maxSize * 1.35, center.z + maxSize * 0.75);
camera.lookAt(center);
const controls = new OrbitControls(camera, renderer.domElement);
controls.target.copy(center); controls.enableDamping = true; controls.dampingFactor = 0.08; controls.update();
document.getElementById("stats").textContent =
loaded + " / ${parts.length} 个部件 · ${spec.modelCount} 个模型 · 设备区 " + (size.x / 1000).toFixed(2) + " × " + (size.y / 1000).toFixed(2) + " × " + (size.z / 1000).toFixed(2) + " m";
select.addEventListener("change", () => {
for (const [model, group] of byModel) group.visible = !select.value || select.value === model;
});
addEventListener("resize", () => {
camera.aspect = host.clientWidth / host.clientHeight; camera.updateProjectionMatrix();
renderer.setSize(host.clientWidth, host.clientHeight);
});
const animate = () => { requestAnimationFrame(animate); controls.update(); renderer.render(scene, camera); };
animate();
window.__lineAssemblyStats = { loaded, models: byModel.size };
window.__lineAssemblyReady = true;
</script>
</body>
</html>
`;
fs.writeFileSync(outFile, html);
console.log(JSON.stringify({ ok: true, outFile, parts: parts.length, models: models.length }));

View File

@@ -0,0 +1,88 @@
#!/usr/bin/env node
// Builds course.json from line-spec.json and the fixed 18-episode mapping, so
// object lists always match the reference spec.
import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
const here = path.dirname(fileURLToPath(import.meta.url));
const spec = JSON.parse(fs.readFileSync(path.join(here, "line-spec.json"), "utf8"));
const byName = new Map(spec.models.map(model => [model.name, model]));
const episodes = [
["E01", "S0", "ui-and-reference", "界面与产线参考模型", [], ["ui", "reference-glb", "tree", "navigation", "opfs"], [180, 480]],
["E02", "S0", "measure-and-spec", "测量、单位与零件表", [], ["measure", "bbox", "units", "spreadsheet"], [180, 480]],
["E03", "S1", "cabinet-a", "主控制柜", ["CabinetA"], ["box", "compound", "placement", "color", "save"], [300, 900]],
["E04", "S1", "cabinet-b", "长控制柜", ["CabinetB"], ["box", "compound", "placement", "color", "save"], [300, 900]],
["E05", "S1", "doors-and-displays", "柜门与双显示屏", ["CabinetDoor", "DisplayA", "DisplayB"], ["box", "placement", "color", "save"], [240, 780]],
["E06", "S2", "hopper-and-raw-feeder", "料仓与原料上料", ["Hopper", "RawFeeder"], ["cylinder", "box", "compound", "color", "save"], [300, 900]],
["E07", "S2", "loader-and-conveyor", "上料与传送带送料", ["Loader", "ConveyorFeeder"], ["box", "compound", "placement", "color", "save"], [300, 900]],
["E08", "S2", "rotary-and-weigh", "旋转运送与称重平台", ["RotaryTransfer", "WeighPlatform"], ["cylinder", "box", "placement", "color", "save"], [240, 780]],
["E09", "S3", "pick-feeder-and-gripper", "夹取送料与辅助夹爪", ["PickFeeder", "AuxGripper"], ["box", "compound", "placement", "color", "save"], [300, 900]],
["E10", "S3", "pusher-and-store", "推料装置与物料存储区", ["Pusher", "MaterialStore"], ["box", "compound", "array", "color", "save"], [300, 900]],
["E11", "S3", "sensor-bracket-inspector", "检测块、支架与运送检测", ["SensorBlock", "TransportBracket", "TransportInspector"], ["box", "placement", "color", "save"], [240, 780]],
["E12", "S4", "assembly-and-inspection", "原料装配与检测台", ["RawAssembly", "InspectionTable"], ["box", "compound", "placement", "color", "save"], [240, 780]],
["E13", "S4", "lights-and-origin", "三色灯、工具坐标系与原点", ["StackLight", "ToolFrame", "OriginMarker"], ["cylinder", "box", "color", "save"], [240, 780]],
["E14", "S5", "abb-robot", "ABB IRB 120 六轴机器人", ["ABB_IRB_120"], ["box", "cylinder", "compound", "placement", "color", "save"], [360, 1080]],
["E15", "S5", "robot-station-review", "机器人工作站复核", [], ["review", "bbox", "color", "save"], [180, 600]],
["E16", "S6", "ground-and-lines", "地面平面与地线", ["GroundPlane", "Plane", "Plane001"], ["box", "placement", "color", "save"], [240, 780]],
["E17", "S6", "line-assembly", "整线总装", [], ["assembly", "insert-link", "joint", "solve", "save"], [300, 900]],
["E18", "S6", "audit-and-delivery", "精度审计与交付", [], ["audit", "export", "stl", "evidence"], [300, 900]],
];
let cumulative = [];
const result = [];
for (const [id, season, slug, title, modelNames, features, durationRange] of episodes) {
const models = modelNames.map(name => {
const model = byName.get(name);
if (!model) throw new Error(`line-spec has no model ${name} for ${id}`);
return model;
});
const objects = models.flatMap(model => model.parts.map(part => part.partName));
cumulative = [...new Set([...cumulative, ...objects])];
const index = episodes.findIndex(entry => entry[0] === id);
const previous = index > 0 ? episodes[index - 1][0] : null;
// E17 is an assembly demonstration and has no persisted document; E18 audits
// and saves from the E16 checkpoint.
const checkpointIn = id === "E01" || id === "E02" || id === "E03" ? null
: id === "E17" || id === "E18" ? "E16" : previous;
const checkpointOut = id === "E01" || id === "E02" || id === "E17" ? null : id;
result.push({
id, season, slug, title,
page: id === "E17" ? "assembly" : "project",
workbench: id === "E17" ? "Assembly" : "Part",
checkpointIn, checkpointOut,
expectedObjects: ["E01", "E02", "E17"].includes(id) ? null : objects.length,
objects,
checkpointObjects: cumulative.slice(),
models: models.map(model => ({
name: model.name, file: model.file, label: model.label,
parts: model.parts.map(part => part.partName),
})),
features, durationRange,
});
}
const course = {
schema: "freecad-web-line-course/course/v1",
title: "生产线 27 件 GLB 模型 Web FreeCAD 初学者视频课程",
voice: "zh-CN-XiaoxiaoNeural",
rate: "-4%",
appOrigin: "http://127.0.0.1:5181",
teachingOrigin: "http://127.0.0.1:5190",
seasons: [
{ id: "S0", title: "入门与参考模型", episodes: ["E01", "E02"] },
{ id: "S1", title: "机柜与显示屏", episodes: ["E03", "E04", "E05"] },
{ id: "S2", title: "上料与输送", episodes: ["E06", "E07", "E08"] },
{ id: "S3", title: "抓取、推料与存储", episodes: ["E09", "E10", "E11"] },
{ id: "S4", title: "装配与检测", episodes: ["E12", "E13"] },
{ id: "S5", title: "机器人工作站", episodes: ["E14", "E15"] },
{ id: "S6", title: "场景、总装与交付", episodes: ["E16", "E17", "E18"] },
],
episodes: result,
};
fs.writeFileSync(path.join(here, "course.json"), `${JSON.stringify(course, null, 2)}\n`);
console.log(JSON.stringify({ ok: true, episodes: result.length,
totalObjects: result.at(-1).checkpointObjects.length,
objectsByEpisode: Object.fromEntries(result.map(episode => [episode.id, episode.objects.length])) }));

View File

@@ -0,0 +1,171 @@
#!/usr/bin/env node
// Generates web/teaching/cases/production-line-course.html from course.json,
// per-episode scripts and the media directory. Missing media is marked pending.
import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
const here = path.dirname(fileURLToPath(import.meta.url));
const webRoot = path.resolve(here, "../..");
const course = JSON.parse(fs.readFileSync(path.join(here, "course.json"), "utf8"));
const mediaDir = path.join(webRoot, "teaching", "media", "line-course");
const outFile = path.join(webRoot, "teaching", "cases", "production-line-course.html");
const esc = value => String(value ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
const mediaBase = `/media/line-course/`;
const has = suffix => episode => fs.existsSync(path.join(mediaDir, `${episode.id}-${episode.slug}${suffix}`));
const episodeHtml = episode => {
const scriptPath = path.join(here, "episodes", episode.id, "script.zh.json");
const lesson = fs.existsSync(scriptPath)
? JSON.parse(fs.readFileSync(scriptPath, "utf8")).lesson ?? {}
: {};
const base = `${mediaBase}${episode.id}-${episode.slug}`;
const hasVideo = has(".mp4")(episode);
const parameters = (lesson.parameters ?? []).map(item =>
`<tr><th>${esc(item.name)}</th><td>${esc(item.value)}</td></tr>`).join("");
const checklist = (lesson.checklist ?? []).map(item => `<li>${esc(item)}</li>`).join("");
const mistakes = (lesson.mistakes ?? []).map(item => `<li>${esc(item)}</li>`).join("");
const objectives = (lesson.objectives ?? []).map(item => `<li>${esc(item)}</li>`).join("");
const source = path.join(here, "checkpoints", `${episode.id}.FCStd`);
const copied = path.join(mediaDir, "checkpoints", `${episode.id}.FCStd`);
if (fs.existsSync(source)) {
fs.mkdirSync(path.dirname(copied), { recursive: true });
fs.copyFileSync(source, copied);
}
const checkpoint = fs.existsSync(copied)
? `<a class="asset" href="${mediaBase}checkpoints/${episode.id}.FCStd" download>下载 ${episode.id} 检查点 FCStd</a>`
: `<span class="asset muted">检查点:${esc(episode.checkpointOut ?? "无")}</span>`;
const stillSource = path.join(here, "stills", episode.id);
const stillFiles = fs.existsSync(stillSource)
? fs.readdirSync(stillSource).filter(name => name.endsWith(".png")).sort()
: [];
const stillTarget = path.join(mediaDir, "stills", episode.id);
if (stillFiles.length) {
fs.mkdirSync(stillTarget, { recursive: true });
for (const name of stillFiles) fs.copyFileSync(path.join(stillSource, name), path.join(stillTarget, name));
}
const stillsHtml = stillFiles.map(name =>
`<figure><img loading="lazy" src="${mediaBase}stills/${episode.id}/${name}" alt="${esc(episode.id)} ${esc(name)}" /><figcaption>${esc(name.replace(/\.png$/, ""))}</figcaption></figure>`).join("");
return `<article class="episode${hasVideo ? "" : " pending"}" id="${esc(episode.id)}" data-episode="${esc(episode.id)}">
<header>
<span class="badge">${esc(episode.id)}</span>
<h3>${esc(episode.title)}</h3>
<label class="done"><input type="checkbox" data-progress="${esc(episode.id)}" /> 已完成</label>
</header>
${hasVideo
? `<video controls preload="metadata" poster="${base}-poster.png" width="100%">
<source src="${base}.mp4" type="video/mp4" />
<source src="${base}.webm" type="video/webm" />
<track kind="subtitles" srclang="zh" label="中文" src="${base}.zh.vtt" default />
</video>
<p class="links"><a href="${base}.mp4" download>MP4</a> · <a href="${base}.webm" download>WebM</a> · <a href="${base}.zh.srt" download>SRT</a></p>`
: `<p class="pending-note">视频待制作(脚本与参数已就绪)。</p>`}
<details><summary>分步截图(${stillFiles.length})</summary><div class="stills">${stillsHtml}</div></details>
<details><summary>学习目标与参数表</summary>
<ul>${objectives}</ul>
<table>${parameters}</table>
</details>
<details><summary>自检清单</summary><ul>${checklist}</ul></details>
<details><summary>常见错误与练习</summary><ul>${mistakes}</ul><p>${esc(lesson.exercise ?? "")}</p></details>
<p>${checkpoint}</p>
</article>`;
};
const seasons = (course.seasons ?? []).map(season => {
const episodes = season.episodes.map(id => course.episodes.find(item => item.id === id)).filter(Boolean);
return `<section class="season" id="${esc(season.id)}">
<h2>${esc(season.id)} · ${esc(season.title)}</h2>
<div class="grid">${episodes.map(episodeHtml).join("\n")}</div>
</section>`;
}).join("\n");
const heroHtml = fs.existsSync(path.join(webRoot, "teaching", "cases", "production-line-assembly.html"))
? `<section class="hero">
<h2>整线场景:参考模型与重建结果</h2>
<div class="hero-grid">
<figure><a href="/cases/production-line-assembly.html"><img src="/cases/production-line-assembly.png" alt="按参考 GLB 重建的生产线场景" /></a><figcaption>重建结果:FreeCAD 27 件模型 · <a href="/cases/production-line-assembly.html">交互查看</a></figcaption></figure>
<figure><a href="/cases/production-line-reference.html"><img src="/cases/production-line-reference.png" alt="参考 GLB 产线场景" /></a><figcaption>参考模型 27 个 GLB · <a href="/cases/production-line-reference.html">交互查看</a></figcaption></figure>
</div>
</section>` : "";
const html = `<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="data:," />
<title>${esc(course.title)}</title>
<style>
:root { color-scheme: dark; --bg: #0f1419; --panel: #17212b; --line: #2a3a45; --text: #dbe6ee; --muted: #93a6b3; --accent: #73c6d4; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 system-ui, "Noto Sans SC", sans-serif; }
header.top { position: sticky; top: 0; z-index: 2; background: #0b1116ee; border-bottom: 1px solid var(--line); padding: 12px 20px; backdrop-filter: blur(6px); }
header.top h1 { margin: 0 0 6px; font-size: 20px; }
.progress { height: 8px; background: var(--panel); border-radius: 4px; overflow: hidden; max-width: 520px; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
main { max-width: 1280px; margin: 0 auto; padding: 20px; }
.season h2 { margin: 28px 0 12px; font-size: 18px; color: var(--accent); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.episode { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.episode.pending { opacity: .75; border-style: dashed; }
.episode header { display: flex; align-items: center; gap: 8px; }
.episode h3 { margin: 0; font-size: 16px; flex: 1; }
.badge { background: #24414b; color: var(--accent); border-radius: 4px; padding: 1px 6px; font-size: 12px; }
.done { font-size: 12px; color: var(--muted); white-space: nowrap; }
video { background: #000; border-radius: 6px; aspect-ratio: 16 / 9; }
.links a, .asset { color: var(--accent); }
.muted { color: var(--muted); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 4px 6px; vertical-align: top; }
details { border-top: 1px solid var(--line); padding-top: 8px; font-size: 14px; }
.stills { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin-top: 8px; }
.stills figure { margin: 0; background: #0d1318; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.stills img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.stills figcaption { padding: 3px 6px; font-size: 11px; color: var(--muted); }
summary { cursor: pointer; color: var(--accent); }
ul { margin: 6px 0 6px 18px; padding: 0; }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } main { padding: 12px; } }
.hero { max-width: 1280px; margin: 18px auto 0; padding: 0 20px; }
.hero h2 { color: #73c6d4; font-size: 18px; margin: 0 0 10px; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hero figure { margin: 0; background: #17212b; border: 1px solid #2a3a45; border-radius: 10px; overflow: hidden; }
.hero img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #0d1318; }
.hero figcaption { padding: 8px 12px; font-size: 13px; color: #93a6b3; }
.hero a { color: #73c6d4; }
@media (max-width: 760px) { .hero-grid { grid-template-columns: 1fr; } }
</style>
</head>
<body>
<header class="top">
<h1>${esc(course.title)}</h1>
<div class="progress" aria-label="课程完成度"><span id="progress-bar"></span></div>
<p id="progress-text" class="muted" style="margin:6px 0 0;font-size:13px"></p>
</header>
<main>
${heroHtml}
${seasons}
</main>
<script>
const boxes = [...document.querySelectorAll('input[data-progress]')];
const key = 'line-course-progress-v1';
const load = () => { try { return JSON.parse(localStorage.getItem(key) || '{}'); } catch { return {}; } };
const save = value => localStorage.setItem(key, JSON.stringify(value));
const render = () => {
const done = boxes.filter(box => box.checked).length;
document.getElementById('progress-bar').style.width = boxes.length ? (100 * done / boxes.length) + '%' : '0';
document.getElementById('progress-text').textContent = done + ' / ' + boxes.length + ' 集已完成';
};
const state = load();
for (const box of boxes) {
box.checked = Boolean(state[box.dataset.progress]);
box.addEventListener('change', () => { const value = load(); value[box.dataset.progress] = box.checked; save(value); render(); });
}
render();
</script>
</body>
</html>
`;
fs.writeFileSync(outFile, html);
console.log(JSON.stringify({ ok: true, outFile, episodes: course.episodes.length }));

View File

@@ -0,0 +1,381 @@
#!/usr/bin/env node
// Parses all reference GLBs in working/GLTFmodel and writes line-spec.json:
// one teaching model per GLB, decomposed into 1-11 Box/Cylinder parts in
// FreeCAD coordinates (Z-up, millimetres).
//
// Key difference from build-delta-spec.mjs:
// - full node.matrix support (all 27 line GLBs store the root transform as a matrix)
// - these GLBs are already Z-up (three.js exported from a Z-up scene), so the
// axis map is identity, not DELTA's (x,-z,y)
// - teaching-part clustering, dominant material per part, scene bbox self-check
import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { createHash } from "node:crypto";
const here = path.dirname(fileURLToPath(import.meta.url));
const sourceDir = process.argv[2] ??
"/home/mes123456/FreeCADWasmDev/working/GLTFmodel";
const outFile = path.join(here, "line-spec.json");
const inventoryFile = path.join(here, "line-inventory.md");
const overrides = JSON.parse(fs.readFileSync(path.join(here, "overrides.json"), "utf8")).models;
const colorFile = path.join(here, "material-colors.json");
const sampledColors = fs.existsSync(colorFile)
? JSON.parse(fs.readFileSync(colorFile, "utf8")).files
: {};
const roundMm = value => Math.round(value * 1000) / 1000;
const toSrgb = value => value <= 0.0031308
? 12.92 * value
: 1.055 * Math.pow(value, 1 / 2.4) - 0.055;
const toLinear = value => value <= 0.04045
? value / 12.92
: Math.pow((value + 0.055) / 1.055, 2.4);
// ---- 4x4 row-major helpers (glTF stores matrices column-major) ----
const identity = () => [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]];
const mul = (a, b) => a.map((row, r) => [0, 1, 2, 3].map(c =>
row[0] * b[0][c] + row[1] * b[1][c] + row[2] * b[2][c] + row[3] * b[3][c]));
const apply = (m, v) => [0, 1, 2].map(r =>
m[r][0] * v[0] + m[r][1] * v[1] + m[r][2] * v[2] + m[r][3]);
const fromGltfMatrix = m => [0, 1, 2, 3].map(r => [0, 1, 2, 3].map(c => m[c * 4 + r]));
const quatMatrix = q => {
const [x, y, z, w] = q;
return [
[1 - 2 * (y * y + z * z), 2 * (x * y - z * w), 2 * (x * z + y * w), 0],
[2 * (x * y + z * w), 1 - 2 * (x * x + z * z), 2 * (y * z - x * w), 0],
[2 * (x * z - y * w), 2 * (y * z + x * w), 1 - 2 * (x * x + y * y), 0],
[0, 0, 0, 1],
];
};
const localMatrix = node => {
if (node.matrix) return fromGltfMatrix(node.matrix);
const m = quatMatrix(node.rotation ?? [0, 0, 0, 1]);
const [tx, ty, tz] = node.translation ?? [0, 0, 0];
const [sx, sy, sz] = node.scale ?? [1, 1, 1];
m[0][3] = tx; m[1][3] = ty; m[2][3] = tz;
for (let r = 0; r < 3; r++) { m[r][0] *= sx; m[r][1] *= sy; m[r][2] *= sz; }
return m;
};
const det3 = m => m[0][0] * (m[1][1] * m[2][2] - m[1][2] * m[2][1])
- m[0][1] * (m[1][0] * m[2][2] - m[1][2] * m[2][0])
+ m[0][2] * (m[1][0] * m[2][1] - m[1][1] * m[2][0]);
const readGlb = file => {
const buffer = fs.readFileSync(file);
let offset = 12; let gltf = null;
while (offset < buffer.length) {
const length = buffer.readUInt32LE(offset);
const type = buffer.toString("ascii", offset + 4, offset + 8);
if (type === "JSON") gltf = JSON.parse(buffer.toString("utf8", offset + 8, offset + 8 + length));
offset += 8 + length;
}
if (!gltf) throw new Error(`no JSON chunk in ${file}`);
return { buffer, gltf };
};
const materialInfo = (gltf, index, fileName) => {
const material = gltf.materials?.[index];
if (!material) return { name: "", linear: [0.8, 0.8, 0.8], srgb: [0.906, 0.906, 0.906], colorSource: "default" };
const factor = material.pbrMetallicRoughness?.baseColorFactor?.slice(0, 3) ?? [1, 1, 1];
const sampled = sampledColors?.[fileName]?.[String(index)];
const srgb = sampled?.srgb ?? factor.map(toSrgb);
return {
name: material.name ?? `material-${index}`,
linear: srgb.map(value => Math.round(toLinear(value) * 1e4) / 1e4),
srgb: srgb.map(value => Math.round(value * 1e4) / 1e4),
colorSource: sampled?.source ?? "baseColorFactor",
};
};
const accessorBox = accessor => {
if (!accessor?.min || !accessor?.max) return null;
return { min: accessor.min.slice(0, 3), max: accessor.max.slice(0, 3) };
};
// ---- per-file analysis ----
const analyzeGlb = file => {
const { buffer, gltf } = readGlb(file);
const scene = gltf.scenes?.[gltf.scene ?? 0] ?? { nodes: [] };
const nodes = gltf.nodes ?? [];
const meshes = gltf.meshes ?? [];
const entries = [];
const visit = (index, parentM, chain, top) => {
const node = nodes[index];
const world = mul(parentM, localMatrix(node));
const name = node.name ?? `node-${index}`;
const nextChain = [...chain, name];
if (node.mesh !== undefined) {
const mesh = meshes[node.mesh];
const materialTris = new Map();
let triangles = 0;
let bbox = null;
for (const [primitiveIndex, primitive] of (mesh.primitives ?? []).entries()) {
const accessor = gltf.accessors?.[primitive.attributes?.POSITION];
const box = accessorBox(accessor);
const count = primitive.indices !== undefined
? gltf.accessors[primitive.indices].count / 3
: (accessor?.count ?? 0) / 3;
triangles += count;
if (primitive.material !== undefined) {
materialTris.set(primitive.material, (materialTris.get(primitive.material) ?? 0) + count);
}
if (!box) continue;
for (const x of [box.min[0], box.max[0]]) for (const y of [box.min[1], box.max[1]])
for (const z of [box.min[2], box.max[2]]) {
const point = apply(world, [x, y, z]);
if (!bbox) bbox = { min: point.slice(), max: point.slice() };
else for (let axis = 0; axis < 3; axis++) {
bbox.min[axis] = Math.min(bbox.min[axis], point[axis]);
bbox.max[axis] = Math.max(bbox.max[axis], point[axis]);
}
}
entries.push({
key: `${index}:${primitiveIndex}`,
nodeName: name,
meshName: mesh.name ?? `mesh-${node.mesh}`,
chain: nextChain,
top,
topName: nextChain[1] ?? nextChain[0] ?? name,
bboxMm: bbox && {
min: bbox.min.map(value => roundMm(value * 1000)),
max: bbox.max.map(value => roundMm(value * 1000)),
},
triangles: Math.round(count),
materialTris,
primitiveMaterial: primitive.material,
});
bbox = null;
}
}
for (const child of node.children ?? []) visit(child, world, nextChain, top ?? child);
};
for (const rootIndex of scene.nodes ?? []) {
const root = nodes[rootIndex];
const rootM = localMatrix(root);
if (root.children?.length) {
for (const child of root.children) visit(child, rootM, [root.name ?? `node-${rootIndex}`], child);
} else {
visit(rootIndex, identity(), [], rootIndex);
}
}
// Dominant material per mesh entry.
for (const entry of entries) {
let best = entry.primitiveMaterial; let bestTris = -1;
for (const [index, tris] of entry.materialTris) if (tris > bestTris) { best = index; bestTris = tris; }
const material = materialInfo(gltf, best, path.basename(file));
entry.material = material.name;
entry.color = material.srgb;
entry.colorLinear = material.linear;
entry.colorSource = material.colorSource;
}
return { buffer, gltf, entries };
};
const unionBox = items => items.reduce((box, item) => {
if (!box) return { min: item.bboxMm.min.slice(), max: item.bboxMm.max.slice() };
for (let axis = 0; axis < 3; axis++) {
box.min[axis] = Math.min(box.min[axis], item.bboxMm.min[axis]);
box.max[axis] = Math.max(box.max[axis], item.bboxMm.max[axis]);
}
return box;
}, null);
const boxGap = (a, b) => {
let sum = 0;
for (let axis = 0; axis < 3; axis++) {
const gap = Math.max(0, Math.max(a.min[axis] - b.max[axis], b.min[axis] - a.max[axis]));
sum += gap * gap;
}
return Math.sqrt(sum);
};
const boxCenter = box => [0, 1, 2].map(axis => (box.min[axis] + box.max[axis]) / 2);
const centerDistance = (a, b) => {
const ca = boxCenter(a); const cb = boxCenter(b);
return Math.hypot(ca[0] - cb[0], ca[1] - cb[1], ca[2] - cb[2]);
};
const clusterBox = cluster => unionBox(cluster);
const mergeClosest = (clusters, target) => {
const result = clusters.map(cluster => cluster.slice());
while (result.length > target) {
let best = null;
for (let i = 0; i < result.length; i++) for (let j = i + 1; j < result.length; j++) {
const a = clusterBox(result[i]); const b = clusterBox(result[j]);
const score = boxGap(a, b) + centerDistance(a, b) * 1e-6;
if (!best || score < best.score) best = { i, j, score };
}
result[best.i] = [...result[best.i], ...result[best.j]];
result.splice(best.j, 1);
}
return result;
};
const splitLargest = (clusters, target) => {
const result = clusters.map(cluster => cluster.slice());
while (result.length < target) {
let index = -1; let size = 1;
for (let i = 0; i < result.length; i++) if (result[i].length > size) { index = i; size = result[i].length; }
if (index < 0) break;
const parts = mergeClosest(result[index].map(entry => [entry]), 2);
result.splice(index, 1, ...parts);
}
return result;
};
const groupEntries = (entries, override) => {
const byTop = new Map();
for (const entry of entries) {
const topName = entry.topName ?? entry.nodeName;
let key = entry.top;
if (override.groupBy === "axis") key = /^[xyz]/i.test(topName) ? topName[0].toUpperCase() : "Other";
if (override.groupBy === "prefix") {
key = override.prefixes.find(prefix => topName.startsWith(prefix)) ?? override.prefixes[0];
}
if (!byTop.has(key)) byTop.set(key, []);
byTop.get(key).push(entry);
}
let clusters = [...byTop.values()];
const budget = Math.max(1, Math.min(override.budget ?? clusters.length, entries.length));
if (clusters.length > budget) clusters = mergeClosest(clusters, budget);
if (clusters.length < budget) clusters = splitLargest(clusters, budget);
return { clusters, budget };
};
const sanitize = text => String(text).replace(/[^A-Za-z0-9_]+/g, "_").replace(/^_+|_+$/g, "").slice(0, 32) || "Part";
const primitiveFor = (cluster, dims) => {
const [x, y, z] = dims;
// A cylinder is only allowed when its AABB would stay within tolerance:
// the two cross-section dims must agree within 5% and Z must be the long axis.
const square = Math.abs(x - y) <= Math.max(1, Math.min(x, y) * 0.05);
if (!square) return "box";
if (z > Math.max(x, y) * 1.2) return "cylinder";
if (cluster.length === 1 && /料仓|电机|转盘|圆柱|轮|滚|灯|柱/.test(cluster[0].nodeName)) return "cylinder";
return "box";
};
const buildModel = (file, override) => {
const { buffer, gltf, entries } = analyzeGlb(file);
if (entries.length === 0) throw new Error(`no mesh entries in ${file}`);
const overall = unionBox(entries);
const { clusters, budget } = groupEntries(entries, override);
const courseName = override.courseName ?? sanitize(path.basename(file, ".glb"));
const label = override.label ?? path.basename(file, ".glb");
const parts = clusters.map((cluster, index) => {
const box = unionBox(cluster);
const dims = [0, 1, 2].map(axis => roundMm(box.max[axis] - box.min[axis]));
const triangles = cluster.reduce((sum, entry) => sum + entry.triangles, 0);
const materialCounts = new Map();
for (const entry of cluster) materialCounts.set(entry.material, (materialCounts.get(entry.material) ?? 0) + entry.triangles);
let material = ""; let best = -1;
for (const [name, count] of materialCounts) if (count > best) { material = name; best = count; }
const colorEntry = cluster.find(entry => entry.material === material) ?? cluster[0];
const nodeNames = [...new Set(cluster.map(entry => entry.nodeName))];
return {
partName: `${courseName}_P${String(index + 1).padStart(2, "0")}`,
label: nodeNames.length === 1 ? nodeNames[0] : `${label} 部件 ${index + 1}`,
primitive: primitiveFor(cluster, dims),
fcLocalDims: dims,
position: box.min.map(roundMm),
rotation: { axis: [0, 0, 1], angleDeg: 0 },
worldBBox: [box.min[0], box.min[1], box.min[2], box.max[0], box.max[1], box.max[2]].map(roundMm),
center: [0, 1, 2].map(axis => roundMm((box.min[axis] + box.max[axis]) / 2)),
color: colorEntry.color,
colorLinear: colorEntry.colorLinear,
colorSource: colorEntry.colorSource,
material,
meshCount: new Set(cluster.map(entry => entry.key.split(":")[0])).size,
triangleCount: Math.round(triangles),
nodeNames: nodeNames.slice(0, 12),
chain: cluster[0].chain,
};
});
const modelBox = [overall.min[0], overall.min[1], overall.min[2], overall.max[0], overall.max[1], overall.max[2]]
.map(roundMm);
return {
file: path.basename(file),
name: courseName,
label,
sha256: createHash("sha256").update(buffer).digest("hex"),
meshCount: new Set(entries.map(entry => entry.key.split(":")[0])).size,
triangleCount: entries.reduce((sum, entry) => sum + entry.triangles, 0),
partBudget: budget,
overallBBox: modelBox,
overallDims: [0, 1, 2].map(axis => roundMm(overall.max[axis] - overall.min[axis])),
parts,
};
};
const files = fs.readdirSync(sourceDir).filter(name => name.toLowerCase().endsWith(".glb")).sort();
const models = [];
const warnings = [];
for (const file of files) {
const override = overrides[file];
if (!override) warnings.push(`no overrides entry for ${file}; using defaults`);
models.push(buildModel(path.join(sourceDir, file), override ?? {}));
}
// Axis sanity check: the ground plane must span XY (4867 x 3673 mm) with a small Z thickness.
const ground = models.find(model => model.file === "地面平面.glb");
if (ground) {
const [x, y, z] = ground.overallDims;
const ok = Math.abs(x - 4867.5) < 20 && Math.abs(y - 3673.2) < 20 && z < 400;
if (!ok) throw new Error(`axis self-check failed: ground dims ${JSON.stringify(ground.overallDims)}; expected Z-up`);
}
const sceneMin = [0, 1, 2].map(axis => Math.min(...models.map(model => model.overallBBox[axis])));
const sceneMax = [0, 1, 2].map(axis => Math.max(...models.map(model => model.overallBBox[axis + 3])));
const sceneBBox = [...sceneMin, ...sceneMax].map(roundMm);
const spec = {
schema: "freecad-web-line-course/spec/v1",
generatedAt: new Date().toISOString(),
sourceDir,
units: { sourceNumerics: "meters", target: "mm", upAxis: "Z-up (identity map, x*1000,y*1000,z*1000)" },
modelCount: models.length,
partCount: models.reduce((sum, model) => sum + model.parts.length, 0),
triangleCount: models.reduce((sum, model) => sum + model.triangleCount, 0),
sceneBBox,
warnings,
models,
};
fs.writeFileSync(outFile, `${JSON.stringify(spec, null, 2)}\n`);
const lines = [
"# 生产线参考零件表",
"",
`生成时间:${spec.generatedAt}`,
`模型数:${spec.modelCount},教学部件数:${spec.partCount},三角面:${spec.triangleCount}`,
`整线包围盒(mm):${sceneBBox.map(value => value.toFixed(1)).join(", ")}`,
"",
"| 模型 | 文件 | 部件 | 尺寸 mm | 部件明细 |",
"|---|---|---|---|---|",
];
for (const model of models) {
const detail = model.parts.map(part =>
`${part.partName}(${part.primitive},${part.fcLocalDims.map(value => Math.round(value)).join("×")})`).join("; ");
lines.push(`| ${model.label} | ${model.file} | ${model.parts.length} | ${model.overallDims.map(value => Math.round(value)).join("×")} | ${detail} |`);
}
fs.writeFileSync(inventoryFile, `${lines.join("\n")}\n`);
// Small public index for the React reference viewer (GLBs are route-served,
// never copied into public/dist).
const publicIndex = path.resolve(here, "../../public/line/models.json");
fs.mkdirSync(path.dirname(publicIndex), { recursive: true });
fs.writeFileSync(publicIndex, `${JSON.stringify({
schema: "freecad-web-line-course/reference-models/v1",
models: models.map(model => ({
file: model.file, name: model.name, label: model.label,
dims: model.overallDims, parts: model.parts.length,
})),
}, null, 2)}\n`);
console.log(JSON.stringify({
publicIndex,
ok: true, outFile, inventoryFile, modelCount: spec.modelCount,
partCount: spec.partCount, sceneBBox: spec.sceneBBox,
warnings: warnings.length,
}));

View File

@@ -0,0 +1,109 @@
#!/usr/bin/env node
// Generates teaching/cases/production-line-reference.html: a Z-up three.js
// viewer with a 27-model selector. GLBs are served from the line-models symlink.
import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
const here = path.dirname(fileURLToPath(import.meta.url));
const webRoot = path.resolve(here, "../..");
const models = JSON.parse(fs.readFileSync(path.join(webRoot, "public", "line", "models.json"), "utf8")).models;
const outFile = path.join(webRoot, "teaching", "cases", "production-line-reference.html");
const esc = value => String(value ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
const html = `<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="data:," />
<title>生产线参考模型 · 27 个 GLB</title>
<style>
html, body { margin: 0; height: 100%; background: #0d1318; color: #dbe6ee; font: 14px/1.5 system-ui, "Noto Sans SC", sans-serif; overflow: hidden; }
header { position: fixed; top: 0; left: 0; right: 0; z-index: 2; display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: #0b1116e6; border-bottom: 1px solid #2a3a45; }
header h1 { margin: 0; font-size: 16px; }
header select { background: #0b1014; color: #dbe6ee; border: 1px solid #3f3f3f; border-radius: 4px; padding: 3px 6px; max-width: 240px; }
header .stats { color: #93a6b3; font-size: 12px; }
#view { position: fixed; inset: 48px 0 0 0; }
#hint { position: fixed; left: 16px; bottom: 12px; color: #6f8390; font-size: 12px; z-index: 2; }
</style>
<script type="importmap">{ "imports": { "three": "./vendor/three.module.js" } }</script>
</head>
<body>
<header>
<h1>生产线参考模型</h1>
<select id="model" aria-label="Reference model"></select>
<span class="stats" id="stats">加载中…</span>
</header>
<div id="view"></div>
<p id="hint">左键旋转 · 滚轮缩放 · 右键平移</p>
<script type="module">
import * as THREE from "three";
import { OrbitControls } from "./vendor/OrbitControls.js";
import { GLTFLoader } from "./vendor/GLTFLoader.js";
const MODELS = ${JSON.stringify(models)};
const host = document.getElementById("view");
const select = document.getElementById("model");
for (const model of MODELS) {
const option = document.createElement("option");
option.value = model.file;
option.textContent = model.label;
select.appendChild(option);
}
const scene = new THREE.Scene();
scene.background = new THREE.Color(0x0d1318);
const camera = new THREE.PerspectiveCamera(42, host.clientWidth / host.clientHeight, 0.001, 1000);
camera.up.set(0, 0, 1);
const renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
renderer.setSize(host.clientWidth, host.clientHeight);
host.appendChild(renderer.domElement);
scene.add(new THREE.HemisphereLight(0xffffff, 0x334455, 2.4));
const key = new THREE.DirectionalLight(0xffffff, 2.2); key.position.set(400, 700, 500); scene.add(key);
const fill = new THREE.DirectionalLight(0xffffff, 0.8); fill.position.set(-600, 200, -400); scene.add(fill);
const controls = new OrbitControls(camera, renderer.domElement);
controls.enableDamping = true; controls.dampingFactor = 0.08;
let root = null;
const load = async file => {
document.getElementById("stats").textContent = "加载中…";
if (root) {
scene.remove(root);
root.traverse(child => { if (child.isMesh) { child.geometry?.dispose(); child.material?.dispose?.(); } });
root = null;
}
const gltf = await new GLTFLoader().loadAsync("./line-models/" + encodeURIComponent(file));
root = gltf.scene;
scene.add(root);
const box = new THREE.Box3().setFromObject(root);
const size = box.getSize(new THREE.Vector3());
const center = box.getCenter(new THREE.Vector3());
root.position.sub(center);
const maxSize = Math.max(size.x, size.y, size.z) || 1;
camera.position.set(maxSize * 1.4, -maxSize * 2.0, maxSize * 1.1);
camera.near = maxSize / 500; camera.far = maxSize * 50; camera.updateProjectionMatrix();
controls.target.set(0, 0, 0); controls.update();
let meshes = 0;
root.traverse(child => { if (child.isMesh) meshes++; });
const stats = meshes + " 个网格 · 包围盒 " + size.x.toFixed(2) + " × " + size.y.toFixed(2) + " × " + size.z.toFixed(2) + " m";
document.getElementById("stats").textContent = stats;
window.__lineReferenceStats = { file, meshes, size: [size.x, size.y, size.z], stats };
};
select.addEventListener("change", () => load(select.value).catch(error => {
document.getElementById("stats").textContent = "加载失败:" + String(error?.message ?? error);
}));
addEventListener("resize", () => {
camera.aspect = host.clientWidth / host.clientHeight; camera.updateProjectionMatrix();
renderer.setSize(host.clientWidth, host.clientHeight);
});
const animate = () => { requestAnimationFrame(animate); controls.update(); renderer.render(scene, camera); };
animate();
await load(MODELS[0].file);
window.__lineReferenceReady = true;
</script>
</body>
</html>
`;
fs.writeFileSync(outFile, html);
console.log(JSON.stringify({ ok: true, outFile, models: models.length }));

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,80 @@
#!/usr/bin/env node
// Removes regenerable video-production caches (Chrome profiles, raw recordings
// whose final MP4 exists, per-scene segments and TTS audio caches).
// Usage: node cleanup-intermediates.mjs [--apply]
import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
const here = path.dirname(fileURLToPath(import.meta.url));
const webRoot = path.resolve(here, "../..");
const apply = process.argv.includes("--apply");
const sizeOf = target => {
let total = 0;
const stack = [target];
while (stack.length) {
const current = stack.pop();
let stat;
try { stat = fs.lstatSync(current); } catch { continue; }
if (stat.isDirectory()) {
for (const entry of fs.readdirSync(current)) stack.push(path.join(current, entry));
} else if (stat.isFile()) total += stat.size;
}
return total;
};
const seen = new Set();
const remove = (target, reason, items) => {
if (!fs.existsSync(target) || seen.has(target)) return;
seen.add(target);
const bytes = sizeOf(target);
items.push({ target: path.relative(webRoot, target), mb: Math.round(bytes / 1048576), reason });
if (apply) fs.rmSync(target, { recursive: true, force: true });
};
const items = [];
// Course tools with course.json -> media mapping.
for (const tool of ["line-course", "delta-course", "carrier-course"]) {
const toolDir = path.join(webRoot, "tools", tool);
const coursePath = path.join(toolDir, "course.json");
if (!fs.existsSync(coursePath)) continue;
const course = JSON.parse(fs.readFileSync(coursePath, "utf8"));
const mediaDir = path.join(webRoot, "teaching", "media", tool);
for (const episode of course.episodes) {
const finalMp4 = path.join(mediaDir, `${episode.id}-${episode.slug}.mp4`);
const evidence = path.join(toolDir, "evidence", episode.id, "verification.json");
const hasFinal = fs.existsSync(finalMp4) && fs.existsSync(evidence);
const rawDir = path.join(toolDir, "raw", episode.id);
remove(path.join(rawDir, "profile"), "Chrome profile cache", items);
if (hasFinal) {
remove(path.join(rawDir, "screen-recording.mp4"), "raw recording (final MP4 exists)", items);
remove(path.join(toolDir, "episodes", episode.id, "segments"), "scene segments (final MP4 exists)", items);
remove(path.join(toolDir, "episodes", episode.id, "audio"), "TTS audio cache (final MP4 exists)", items);
}
}
for (const name of fs.existsSync(path.join(toolDir, "raw")) ? fs.readdirSync(path.join(toolDir, "raw")) : []) {
remove(path.join(toolDir, "raw", name, "profile"), "Chrome profile cache", items);
}
}
// Standalone video projects whose final tour videos already exist.
for (const project of ["carrier-video", "bim-workshop-video"]) {
const projectDir = path.join(webRoot, "tools", project);
if (!fs.existsSync(projectDir)) continue;
// Only remove profiles, raw, segments, audio; keep scripts/cards/stills.
for (const name of ["profile", "raw", "segments", "audio"]) {
remove(path.join(projectDir, name), "video production cache", items);
}
}
// Stale tool backups.
for (const entry of fs.readdirSync(path.join(webRoot, "tools"))) {
if (/^tools\.bak\./.test(entry)) remove(path.join(webRoot, "tools", entry), "stale tools backup", items);
}
const totalMb = items.reduce((sum, item) => sum + item.mb, 0);
for (const item of items.sort((a, b) => b.mb - a.mb).slice(0, 20)) {
console.log(`${String(item.mb).padStart(6)} MB ${item.target} (${item.reason})`);
}
console.log(JSON.stringify({ apply, items: items.length, totalMb, freeBefore: null }));
if (!apply) console.log("dry run only; pass --apply to delete");

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,62 @@
{
"schema": "freecad-web-line-course/video-assembly/v1",
"generatedAt": "2026-11-12T20:05:40.924Z",
"episode": "E01",
"title": "界面与产线参考模型",
"status": "assembled",
"source": "raw/E01/screen-recording.mp4",
"captureStart": 0.909,
"totalVideo": 242.2,
"scenes": [
{
"id": "S00",
"start": 0,
"end": 22.033,
"duration": 22.033,
"narration": 20.16
},
{
"id": "S01",
"start": 22.033,
"end": 67.067,
"duration": 45.033,
"narration": 22.032
},
{
"id": "S02",
"start": 67.067,
"end": 122.1,
"duration": 55.033,
"narration": 25.344
},
{
"id": "S03",
"start": 122.1,
"end": 172.133,
"duration": 50.033,
"narration": 24.648
},
{
"id": "S04",
"start": 172.133,
"end": 217.167,
"duration": 45.033,
"narration": 23.304
},
{
"id": "S05",
"start": 217.167,
"end": 242.2,
"duration": 25.033,
"narration": 16.872
}
],
"outputs": {
"mp4": "teaching/media/line-course/E01-ui-and-reference.mp4",
"webm": "teaching/media/line-course/E01-ui-and-reference.webm",
"vtt": "teaching/media/line-course/E01-ui-and-reference.zh.vtt",
"srt": "teaching/media/line-course/E01-ui-and-reference.zh.srt",
"poster": "teaching/media/line-course/E01-ui-and-reference-poster.png"
},
"cues": 21
}

View File

@@ -0,0 +1,51 @@
{
"schema": "freecad-web-line-course/video-tts/v1",
"episode": "E01",
"generatedAt": "2026-11-12T18:52:47.070Z",
"voice": "zh-CN-XiaoxiaoNeural",
"rate": "-4%",
"scenes": {
"S00": {
"title": "标题",
"target": 18,
"duration": 20.16,
"media": "audio/S00.mp3",
"subtitles": "audio/S00.srt"
},
"S01": {
"title": "认识界面与新建文档",
"target": 45,
"duration": 22.032,
"media": "audio/S01.mp3",
"subtitles": "audio/S01.srt"
},
"S02": {
"title": "打开产线参考模型查看器",
"target": 55,
"duration": 25.344,
"media": "audio/S02.mp3",
"subtitles": "audio/S02.srt"
},
"S03": {
"title": "查看主控制柜",
"target": 50,
"duration": 24.648,
"media": "audio/S03.mp3",
"subtitles": "audio/S03.srt"
},
"S04": {
"title": "确认坐标系与单位",
"target": 45,
"duration": 23.304,
"media": "audio/S04.mp3",
"subtitles": "audio/S04.srt"
},
"S05": {
"title": "本集小结",
"target": 25,
"duration": 16.872,
"media": "audio/S05.mp3",
"subtitles": "audio/S05.srt"
}
}
}

View File

@@ -0,0 +1,80 @@
// E01: interface tour, create a document, open the 27-model reference viewer.
import fs from "node:fs";
import path from "node:path";
import { createSceneRunner } from "../../../carrier-course/lib/scene.mjs";
import { openLineReference, selectReferenceModel } from "../../lib/ui.mjs";
export async function run({ page, rec, script, stillsDir, rawDir }) {
const scene = createSceneRunner({ rec, page, script });
const shot = name => rec.shot(stillsDir, name);
const log = [];
const logStep = entry => {
log.push({ at: new Date().toISOString(), ...entry });
fs.writeFileSync(path.join(rawDir, "live-log.json"), `${JSON.stringify(log, null, 2)}\n`);
};
const footer = () => page.locator('footer [role="status"]').textContent().catch(() => "");
const drag = async (locator, dx, dy) => {
const box = await locator.boundingBox();
if (!box) return;
const x = box.x + box.width / 2; const y = box.y + box.height / 2;
await page.mouse.move(x, y); await page.mouse.down();
await page.mouse.move(x + dx, y + dy, { steps: 18 });
await page.mouse.up(); await page.waitForTimeout(400);
};
await scene("S00", async () => { await shot("S00-title"); });
await scene("S01", async () => {
await page.locator('nav[aria-label="Application menus"] details').filter({ hasText: "File" }).locator("summary").click();
await page.getByRole("button", { name: "新建 Document" }).click();
await page.waitForTimeout(2200);
await page.evaluate(() => {
for (const details of document.querySelectorAll('nav[aria-label="Application menus"] details[open]')) details.open = false;
});
await page.waitForTimeout(250);
await drag(page.locator('[aria-label="Imported native 3D view"]').first(), -120, -30);
logStep({ step: "document", status: await footer(), labels: await page.locator(".fc-tree-text").count() });
await shot("S01-interface");
});
let info = "";
await scene("S02", async () => {
const panel = await openLineReference(page);
const select = panel.locator('select[aria-label="Reference model"]');
for (let attempt = 0; attempt < 60; attempt++) {
await page.waitForTimeout(500);
info = await panel.locator("footer").textContent().catch(() => "");
if (/个网格/.test(info ?? "")) break;
}
const options = await select.locator("option").allTextContents();
if (options.length !== 27) throw new Error(`expected 27 reference models, got ${options.length}`);
logStep({ step: "reference", options: options.length, info });
await shot("S02-reference");
});
await scene("S03", async () => {
const panel = page.getByRole("complementary", { name: "Line reference viewer" });
info = await selectReferenceModel(panel, page, "主控制柜", /1\.50 × 0\.74 × 0\.75/);
logStep({ step: "cabinet", info });
if (!/1\.50 × 0\.74 × 0\.75/.test(info ?? "")) throw new Error(`cabinet dims mismatch: ${info}`);
await drag(panel.locator("canvas"), 100, 30);
await shot("S03-cabinet");
});
await scene("S04", async () => {
const panel = page.getByRole("complementary", { name: "Line reference viewer" });
info = await selectReferenceModel(panel, page, "地面与地线", /4\.87 × 3\.67 × 0\.31/);
logStep({ step: "ground", info });
if (!/4\.87 × 3\.67 × 0\.31/.test(info ?? "")) throw new Error(`ground dims mismatch: ${info}`);
await shot("S04-units");
});
await scene("S05", async () => {
fs.writeFileSync(path.join(rawDir, "E01-state.json"), `${JSON.stringify({
schema: "freecad-web-line-course/E01/state/v1",
generatedAt: new Date().toISOString(),
reference: "27 GLBs", viewer: info, log,
}, null, 2)}\n`);
await shot("S05-recap");
});
}

View File

@@ -0,0 +1,85 @@
{
"schema": "freecad-web-line-course/script/v1",
"episode": "E01",
"title": "界面与产线参考模型",
"voice": "zh-CN-XiaoxiaoNeural",
"rate": "-4%",
"scenes": [
{
"id": "S00",
"title": "标题",
"chapter": "第 1 集 · 入门",
"note": "27 个 GLB、约 88 个教学部件、18 集课程",
"target": 18,
"narration": "欢迎来到生产线建模课程。这一季我们要在网页版 FreeCAD 里,把二十七个参考模型逐个建出来,最后组成一条完整的生产线。课程一共十八集,从界面、测量开始,再按工位建模,最后总装和交付。"
},
{
"id": "S01",
"title": "认识界面与新建文档",
"chapter": "第 1 步 · 空白文档",
"note": "File → 新建 Document;左侧对象树、右侧属性面板、中间 3D 视口",
"target": 45,
"narration": "先看界面。左边是对象树,中间是三维视口,右边是属性面板。打开 File 菜单,点新建文档,得到一个空白文档。用鼠标左键拖动可以旋转视角,滚轮缩放。后面每个模型都会在这个文档里按参考坐标摆放。"
},
{
"id": "S02",
"title": "打开产线参考模型查看器",
"chapter": "第 2 步 · 27 件参考",
"note": "属性区「产线参考模型」;下拉列表 27 项;three.js 预览",
"target": 55,
"narration": "网页版内核没有开启 glTF 原生导入,所以我们用右侧的产线参考模型查看器来读 GLB。点开以后,下拉列表里有二十七个模型,可以逐个查看网格数和包围盒。这个查看器基于 three.js,不会改动 FreeCAD 的模型数据,只作为尺寸和外观的参考。"
},
{
"id": "S03",
"title": "查看主控制柜",
"chapter": "第 3 步 · 尺寸对照",
"note": "主控制柜:1.50 × 0.74 × 0.75 m",
"target": 50,
"narration": "先选主控制柜。底部显示它有一点五米长、零点七四米宽、零点七五米高,一共五十六个网格。拖动查看器里的模型,可以看到柜门、侧板和顶部结构。我们建模时不会逐个复制五十六个网格,而是拆成八个图元部件,保证整体尺寸和颜色一致。"
},
{
"id": "S04",
"title": "确认坐标系与单位",
"chapter": "第 4 步 · Z 轴向上",
"note": "地面与地线:4.87 × 3.67 × 0.31 m;FreeCAD 使用毫米、Z-up",
"target": 45,
"narration": "再选地面与地线。它长四点八七米、宽三点六七米、厚零点三一米,说明这批 GLB 是 Z 轴向上的场景,单位是米。到了 FreeCAD 里我们统一乘以一千,换成毫米,轴向保持不变。这个换算会在下一集的零件表里逐项核对。"
},
{
"id": "S05",
"title": "本集小结",
"chapter": "第 5 步 · 准备开始",
"note": "下一集:测量、单位换算与 27 件零件表",
"target": 25,
"narration": "这一集认识了界面、新建了文档,也确认了二十七个参考模型和坐标约定。下一集我们打开参考查看器,把每个模型的长宽高写进 Spreadsheet 零件表,并用公式核对单位换算。"
}
],
"lesson": {
"objectives": [
"认识 Web FreeCAD 的对象树、三维视口和属性面板",
"新建空白文档并在视口中旋转、缩放",
"打开产线参考模型查看器,确认 27 个 GLB 的尺寸",
"理解本批参考模型是 Z-up、米制,进入 FreeCAD 后统一换算为毫米"
],
"parameters": [
{ "name": "参考模型数量", "value": "27 个 GLB" },
{ "name": "教学部件总数", "value": "约 88 个 Box/Cylinder" },
{ "name": "主控制柜包围盒", "value": "1500 × 744 × 754 mm" },
{ "name": "地面与地线包围盒", "value": "4867 × 3673 × 310 mm" },
{ "name": "坐标约定", "value": "Z-up,米 ×1000 → 毫米" }
],
"checklist": [
"能新建文档,并看到左侧对象树为空",
"参考查看器下拉列表有 27 项",
"主控制柜显示 1.50 × 0.74 × 0.75 m",
"地面与地线显示 4.87 × 3.67 × 0.31 m",
"视口可以旋转和缩放"
],
"mistakes": [
"把参考查看器当成导入:它只显示 GLB,不会在文档里生成对象",
"把米直接当毫米填进属性面板,模型会小一千倍",
"把 GLB 的 Y-up 约定套到这批文件上,模型会躺倒"
],
"exercise": "在查看器里依次找到料仓、ABB IRB 120 和显示屏,记录它们的包围盒,下一集填进零件表。"
}
}

View File

@@ -0,0 +1,62 @@
{
"schema": "freecad-web-line-course/video-assembly/v1",
"generatedAt": "2026-11-12T19:14:45.522Z",
"episode": "E02",
"title": "测量、单位与零件表",
"status": "assembled",
"source": "raw/E02/screen-recording.mp4",
"captureStart": 0.903,
"totalVideo": 261.633,
"scenes": [
{
"id": "S00",
"start": 0,
"end": 18.033,
"duration": 18.033,
"narration": 13.848
},
{
"id": "S01",
"start": 18.033,
"end": 58.067,
"duration": 40.033,
"narration": 18.744
},
{
"id": "S02",
"start": 58.067,
"end": 146.533,
"duration": 88.467,
"narration": 29.472
},
{
"id": "S03",
"start": 146.533,
"end": 201.567,
"duration": 55.033,
"narration": 20.424
},
{
"id": "S04",
"start": 201.567,
"end": 236.6,
"duration": 35.033,
"narration": 17.904
},
{
"id": "S05",
"start": 236.6,
"end": 261.633,
"duration": 25.033,
"narration": 15.192
}
],
"outputs": {
"mp4": "teaching/media/line-course/E02-measure-and-spec.mp4",
"webm": "teaching/media/line-course/E02-measure-and-spec.webm",
"vtt": "teaching/media/line-course/E02-measure-and-spec.zh.vtt",
"srt": "teaching/media/line-course/E02-measure-and-spec.zh.srt",
"poster": "teaching/media/line-course/E02-measure-and-spec-poster.png"
},
"cues": 18
}

View File

@@ -0,0 +1,51 @@
{
"schema": "freecad-web-line-course/video-tts/v1",
"episode": "E02",
"generatedAt": "2026-11-12T19:03:32.049Z",
"voice": "zh-CN-XiaoxiaoNeural",
"rate": "-4%",
"scenes": {
"S00": {
"title": "标题",
"target": 18,
"duration": 13.848,
"media": "audio/S00.mp3",
"subtitles": "audio/S00.srt"
},
"S01": {
"title": "读取参考尺寸",
"target": 40,
"duration": 18.744,
"media": "audio/S01.mp3",
"subtitles": "audio/S01.srt"
},
"S02": {
"title": "建立零件表",
"target": 80,
"duration": 29.472,
"media": "audio/S02.mp3",
"subtitles": "audio/S02.srt"
},
"S03": {
"title": "用公式核对换算",
"target": 55,
"duration": 20.424,
"media": "audio/S03.mp3",
"subtitles": "audio/S03.srt"
},
"S04": {
"title": "检查零件表",
"target": 35,
"duration": 17.904,
"media": "audio/S04.mp3",
"subtitles": "audio/S04.srt"
},
"S05": {
"title": "本集小结",
"target": 25,
"duration": 15.192,
"media": "audio/S05.mp3",
"subtitles": "audio/S05.srt"
}
}
}

View File

@@ -0,0 +1,113 @@
// E02: reference table in a spreadsheet, unit conversion and formula.
import fs from "node:fs";
import path from "node:path";
import { createSceneRunner } from "../../../carrier-course/lib/scene.mjs";
import { openLineReference, spec } from "../../lib/ui.mjs";
export async function run({ page, rec, script, stillsDir, rawDir }) {
const scene = createSceneRunner({ rec, page, script });
const shot = name => rec.shot(stillsDir, name);
const log = [];
const logStep = entry => {
log.push({ at: new Date().toISOString(), ...entry });
fs.writeFileSync(path.join(rawDir, "live-log.json"), `${JSON.stringify(log, null, 2)}\n`);
};
const labels = () => page.locator(".fc-tree-text").allTextContents();
const round = value => Math.round(value * 10) / 10;
const setCell = async (address, value) => {
const cell = page.locator(`[role="gridcell"][data-cell-address="${address}"]`).first();
await cell.waitFor({ state: "visible", timeout: 30000 });
await cell.dblclick();
await page.waitForTimeout(300);
const input = page.locator('input[aria-label="Cell contents"]').first();
await input.fill(String(value));
await page.waitForTimeout(250);
const apply = page.locator('form button:has-text("Apply")').first();
if (await apply.isEnabled().catch(() => false)) await apply.click();
else await input.press("Enter");
await page.waitForTimeout(650);
};
const readCell = async address => {
const text = await page.locator(`[role="gridcell"][data-cell-address="${address}"]`).first().textContent();
return String(text ?? "").replace(new RegExp(`^${address}`), "").trim();
};
await scene("S00", async () => { await shot("S00-title"); });
await scene("S01", async () => {
const panel = await openLineReference(page);
for (let attempt = 0; attempt < 60; attempt++) {
await page.waitForTimeout(500);
if (/个网格/.test(await panel.locator("footer").textContent().catch(() => "") ?? "")) break;
}
const options = await panel.locator('select[aria-label="Reference model"] option').count();
if (options !== 27) throw new Error(`expected 27 reference models, got ${options}`);
await shot("S01-reference");
// Close the floating reference panel so the spreadsheet is unobstructed.
await panel.getByRole("button", { name: "Close reference viewer" }).click();
await page.waitForTimeout(400);
});
const rows = ["CabinetA", "Hopper", "ConveyorFeeder", "PickFeeder", "ABB_IRB_120", "GroundPlane"];
const chosen = rows.map(name => {
const model = spec().models.find(item => item.name === name);
const center = [0, 1, 2].map(axis => round((model.overallBBox[axis] + model.overallBBox[axis + 3]) / 2));
return { name, label: model.label, dims: model.overallDims.map(round), center };
});
await scene("S02", async () => {
const before = await labels();
await page.locator('select[aria-label="Workbench"]').selectOption("Spreadsheet");
await page.waitForTimeout(600);
await rec.clickSelector(page, 'button:has-text("Create spreadsheet")');
let sheet = null;
for (let attempt = 0; attempt < 30; attempt++) {
await page.waitForTimeout(500);
sheet = (await labels()).find(label => !before.includes(label)) ?? null;
if (sheet) break;
}
if (!sheet) throw new Error(`spreadsheet not created: ${JSON.stringify(await labels())}`);
logStep({ step: "sheet", sheet });
const header = ["模型", "长X", "宽Y", "高Z", "中心X", "中心Y", "中心Z"];
for (let column = 0; column < header.length; column++) await setCell(`${String.fromCharCode(65 + column)}1`, header[column]);
for (let row = 0; row < chosen.length; row++) {
await setCell(`A${row + 2}`, chosen[row].name);
const values = [...chosen[row].dims, ...chosen[row].center];
for (let column = 0; column < values.length; column++) await setCell(`${String.fromCharCode(66 + column)}${row + 2}`, values[column]);
logStep({ step: "row", name: chosen[row].name, dims: chosen[row].dims, center: chosen[row].center });
}
await shot("S02-table");
});
await scene("S03", async () => {
const first = chosen[0];
const expectedBefore = round(first.dims[0] + first.dims[1]);
const expectedAfter = round(1600 + first.dims[1]);
await setCell("A8", "长X+宽Y");
await setCell("B8", "=B2+C2");
const before = await readCell("B8");
await setCell("B2", 1600);
const after = await readCell("B8");
await setCell("B2", first.dims[0]);
const restored = await readCell("B8");
logStep({ step: "formula", before, after, restored });
const near = (actual, expected) => Math.abs(Number(actual) - expected) < 0.01;
if (!near(before, expectedBefore) || !near(after, expectedAfter) || !near(restored, expectedBefore))
throw new Error(`formula mismatch: ${before}/${expectedBefore} -> ${after}/${expectedAfter} -> ${restored}`);
await shot("S03-formula");
});
await scene("S04", async () => {
logStep({ step: "audit", rows: chosen.length, sheetVisible: await page.locator('[role="gridcell"][data-cell-address="A6"]').count() });
await shot("S04-audit");
});
await scene("S05", async () => {
fs.writeFileSync(path.join(rawDir, "E02-state.json"), `${JSON.stringify({
schema: "freecad-web-line-course/E02/state/v1",
generatedAt: new Date().toISOString(), rows: chosen, log,
}, null, 2)}\n`);
await shot("S05-recap");
});
}

View File

@@ -0,0 +1,84 @@
{
"schema": "freecad-web-line-course/script/v1",
"episode": "E02",
"title": "测量、单位与零件表",
"voice": "zh-CN-XiaoxiaoNeural",
"rate": "-4%",
"scenes": [
{
"id": "S00",
"title": "标题",
"chapter": "第 2 集 · 参考表",
"note": "27 件参考 → Spreadsheet 零件表 → 公式核对",
"target": 18,
"narration": "这一集把参考模型变成可执行的零件表。我们会从查看器读出六件代表模型的包围盒,写进 Spreadsheet,再用公式验证米和毫米的换算。"
},
{
"id": "S01",
"title": "读取参考尺寸",
"chapter": "第 1 步 · 查看器",
"note": "27 件参考;包围盒单位是米",
"target": 40,
"narration": "先打开产线参考模型查看器,确认列表里仍是二十七个模型。查看器底部的包围盒单位是米,保留两位小数。建模前必须把这些数字换算成毫米,否则属性面板里会小一千倍。"
},
{
"id": "S02",
"title": "建立零件表",
"chapter": "第 2 步 · Spreadsheet",
"note": "6 行代表模型:柜体、料仓、输送、抓取、机器人、地面",
"target": 80,
"narration": "切换到 Spreadsheet 工作台,新建电子表格。第一行写表头:模型、长X、宽Y、高Z、中心X、中心Y、中心Z。下面填入六件代表模型:主控制柜、料仓、传送带送料装置、夹取送料装置、ABB 机器人、地面与地线。尺寸和中心都按毫米填写,后续建模直接查这张表。"
},
{
"id": "S03",
"title": "用公式核对换算",
"chapter": "第 3 步 · 公式自检",
"note": "B8 = B2 + C2;改 B2 后结果同步变化,再恢复",
"target": 55,
"narration": "在第八行写一个公式,把主控制柜的长和宽相加。然后把长改成一六零零,结果应该同步增加一百。确认公式生效后,再把原值填回去。这个小测试说明零件表是活的,后面尺寸调整都能自动联动。"
},
{
"id": "S04",
"title": "检查零件表",
"chapter": "第 4 步 · 自检",
"note": "六行数据齐全、单位统一为毫米",
"target": 35,
"narration": "检查六行数据:模型名称、三个尺寸、三个中心坐标都齐全,单位统一是毫米。如果某一行的数量和查看器差一千倍,说明单位换算漏了;如果 Y 和 Z 对调,说明轴向搞错了。"
},
{
"id": "S05",
"title": "本集小结",
"chapter": "第 5 步 · 下一步",
"note": "下一集开始建主控制柜(8 个部件)",
"target": 25,
"narration": "这一集完成了零件表和公式自检。下一集开始建第一个模型:主控制柜。我们会把它拆成八个图元部件,逐个设尺寸、位置和颜色,最后合成一个柜体。"
}
],
"lesson": {
"objectives": [
"从参考查看器读取包围盒并换算成毫米",
"用 Spreadsheet 建立可复用的零件表",
"用公式核对尺寸联动,理解参数化表的用法",
"识别单位错误和轴向错误的典型症状"
],
"parameters": [
{ "name": "零件表列", "value": "模型、长X、宽Y、高Z、中心X、中心Y、中心Z" },
{ "name": "代表模型", "value": "主控制柜、料仓、传送带、夹取、ABB、地面" },
{ "name": "公式测试", "value": "B8 = B2 + C2;B2 1500 → 1600 → 1500" },
{ "name": "单位", "value": "全部为毫米" }
],
"checklist": [
"查看器列表为 27 项",
"六行零件表全部填写",
"公式 B8 能随 B2 变化",
"恢复原值后公式结果回到初始值",
"所有尺寸都是毫米量级"
],
"mistakes": [
"把查看器的米数直接填进毫米表",
"把 Z-up 当成 Y-up,Y/Z 对调",
"公式引用错列,导致结果与手算不一致"
],
"exercise": "把其余 21 件模型的包围盒也补进零件表,并按工位排序。"
}
}

View File

@@ -0,0 +1,69 @@
{
"schema": "freecad-web-line-course/video-assembly/v1",
"generatedAt": "2026-11-12T19:36:35.466Z",
"episode": "E03",
"title": "主控制柜",
"status": "assembled",
"source": "raw/E03/screen-recording.mp4",
"captureStart": 0.903,
"totalVideo": 522.367,
"scenes": [
{
"id": "S00",
"start": 0,
"end": 22.033,
"duration": 22.033,
"narration": 20.088
},
{
"id": "S01",
"start": 22.033,
"end": 52.067,
"duration": 30.033,
"narration": 11.544
},
{
"id": "S02",
"start": 52.067,
"end": 152.1,
"duration": 100.033,
"narration": 22.8
},
{
"id": "S03",
"start": 152.1,
"end": 252.167,
"duration": 100.067,
"narration": 20.88
},
{
"id": "S04",
"start": 252.167,
"end": 352.233,
"duration": 100.067,
"narration": 16.896
},
{
"id": "S05",
"start": 352.233,
"end": 452.3,
"duration": 100.067,
"narration": 16.632
},
{
"id": "S06",
"start": 452.3,
"end": 522.367,
"duration": 70.067,
"narration": 19.968
}
],
"outputs": {
"mp4": "teaching/media/line-course/E03-cabinet-a.mp4",
"webm": "teaching/media/line-course/E03-cabinet-a.webm",
"vtt": "teaching/media/line-course/E03-cabinet-a.zh.vtt",
"srt": "teaching/media/line-course/E03-cabinet-a.zh.srt",
"poster": "teaching/media/line-course/E03-cabinet-a-poster.png"
},
"cues": 20
}

View File

@@ -0,0 +1,58 @@
{
"schema": "freecad-web-line-course/video-tts/v1",
"episode": "E03",
"generatedAt": "2026-11-12T19:15:14.873Z",
"voice": "zh-CN-XiaoxiaoNeural",
"rate": "-4%",
"scenes": {
"S00": {
"title": "标题",
"target": 18,
"duration": 20.088,
"media": "audio/S00.mp3",
"subtitles": "audio/S00.srt"
},
"S01": {
"title": "新建文档",
"target": 30,
"duration": 11.544,
"media": "audio/S01.mp3",
"subtitles": "audio/S01.srt"
},
"S02": {
"title": "柜体与左侧立柱",
"target": 100,
"duration": 22.8,
"media": "audio/S02.mp3",
"subtitles": "audio/S02.srt"
},
"S03": {
"title": "右侧立柱与柜门",
"target": 100,
"duration": 20.88,
"media": "audio/S03.mp3",
"subtitles": "audio/S03.srt"
},
"S04": {
"title": "下横梁与上横梁",
"target": 100,
"duration": 16.896,
"media": "audio/S04.mp3",
"subtitles": "audio/S04.srt"
},
"S05": {
"title": "两块背板",
"target": 100,
"duration": 16.632,
"media": "audio/S05.mp3",
"subtitles": "audio/S05.srt"
},
"S06": {
"title": "精度自检与保存",
"target": 70,
"duration": 19.968,
"media": "audio/S06.mp3",
"subtitles": "audio/S06.srt"
}
}
}

View File

@@ -0,0 +1,69 @@
// E03: build CabinetA (8 teaching parts) from line-spec and save E03.
import fs from "node:fs";
import path from "node:path";
import { createSceneRunner } from "../../../carrier-course/lib/scene.mjs";
import { saveCheckpoint } from "../../../carrier-course/lib/ui-actions.mjs";
import { createBuilder } from "../../lib/build.mjs";
import { newDocument, spec } from "../../lib/ui.mjs";
import { checkLineCheckpoint } from "../../lib/line-precision.mjs";
const MODEL = "CabinetA";
export async function run({ page, rec, script, stillsDir, rawDir, webRoot }) {
const scene = createSceneRunner({ rec, page, script });
const shot = name => rec.shot(stillsDir, name);
const log = [];
const logStep = entry => {
log.push({ at: new Date().toISOString(), ...entry });
fs.writeFileSync(path.join(rawDir, "live-log.json"), `${JSON.stringify(log, null, 2)}\n`);
};
const model = spec().models.find(item => item.name === MODEL);
const parts = model.parts;
const names = parts.map(part => part.partName);
const builder = createBuilder({ page, rec, logStep });
await scene("S00", async () => { await shot("S00-title"); });
await scene("S01", async () => {
await newDocument(page);
logStep({ step: "document", labels: await builder.labels() });
await shot("S01-document");
});
const build = async part => {
const dims = part.fcLocalDims;
if (part.primitive === "cylinder") {
const radius = Math.max(0.1, dims[0] / 2);
const position = [part.center[0], part.center[1], part.position[2]];
await builder.createCylinder(part.partName, radius, dims[2], position);
} else {
await builder.createBox(part.partName, dims, part.position);
}
await builder.setColor(part.partName, part.color);
logStep({ step: "part", name: part.partName, dims, position: part.position, color: part.color });
};
for (let sceneIndex = 0; sceneIndex < 4; sceneIndex++) {
const slice = parts.slice(sceneIndex * 2, sceneIndex * 2 + 2);
await scene(`S0${sceneIndex + 2}`, async () => {
for (const part of slice) await build(part);
await shot(`S0${sceneIndex + 2}-parts`);
});
}
await scene("S06", async () => {
const saved = await saveCheckpoint({ page, rec, webRoot, episode: "E03", rawDir,
checkpointDir: path.join(webRoot, "tools", "line-course", "checkpoints"), expectedLabels: names });
logStep({ step: "checkpoint", ...saved });
const precision = await checkLineCheckpoint(saved.checkpoint ?? path.join(webRoot, "tools", "line-course", "checkpoints", "E03.FCStd"), names);
fs.writeFileSync(path.join(rawDir, "E03-precision.json"), `${JSON.stringify(precision, null, 2)}\n`);
if (!precision.ok) throw new Error(`precision failed: ${JSON.stringify({ extra: precision.extra,
models: precision.models.filter(item => !item.ok),
failures: precision.results.filter(item => !item.ok) })}`);
fs.writeFileSync(path.join(rawDir, "E03-state.json"), `${JSON.stringify({
schema: "freecad-web-line-course/E03/state/v1",
generatedAt: new Date().toISOString(), model: MODEL, parts: names, precision, log,
}, null, 2)}\n`);
await shot("S06-recap");
});
}

View File

@@ -0,0 +1,94 @@
{
"schema": "freecad-web-line-course/script/v1",
"episode": "E03",
"title": "主控制柜",
"voice": "zh-CN-XiaoxiaoNeural",
"rate": "-4%",
"scenes": [
{
"id": "S00",
"title": "标题",
"chapter": "第 3 集 · 第一个模型",
"note": "主控制柜 1500 × 744 × 754 mm,8 个部件",
"target": 18,
"narration": "从这一集开始建模型。第一个是主控制柜,整体尺寸一点五米乘零点七四米乘零点七五米。参考文件里有五十六个网格,我们拆成八个图元部件:柜体、两侧立柱、柜门、两根横梁和两块背板。"
},
{
"id": "S01",
"title": "新建文档",
"chapter": "第 1 步 · 空白文档",
"note": "File → 新建 Document;工作台 Part",
"target": 30,
"narration": "先新建一个空白文档,确认工作台是 Part。这一集的所有对象都会保存在 E03 检查点里,下一集从这个检查点继续。"
},
{
"id": "S02",
"title": "柜体与左侧立柱",
"chapter": "第 2 步 · P01、P02",
"note": "P02 柜体 1500 × 744.2 × 754;P01 立柱 440 × 134.3 × 597",
"target": 100,
"narration": "先建柜体,一个一千五乘七百四十四点二乘七百五十四的 Box,放在参考包围盒的最小角点。再建左侧立柱,四百四十乘一百三十四点三乘五百九十七,颜色是黑色。每个部件都用 Box 的尺寸框和 Position 面板精确放到参考位置。"
},
{
"id": "S03",
"title": "右侧立柱与柜门",
"chapter": "第 3 步 · P03、P04",
"note": "P03 立柱同 P01;P04 柜门 30 × 560 × 560",
"target": 100,
"narration": "右侧立柱和左侧对称,尺寸同样是四百四十乘一百三十四点三乘五百九十七。柜门是一块三十毫米厚的薄板,五百六十乘五百六十,放在柜体右前方。薄板最容易把厚度方向填错,注意 X 方向是三十。"
},
{
"id": "S04",
"title": "下横梁与上横梁",
"chapter": "第 4 步 · P05、P06",
"note": "P05 40 × 560 × 40;P06 40 × 560 × 40,顶部",
"target": 100,
"narration": "两根横梁都是四十乘五百六十乘四十,一根在下方,一根在顶部。它们连接左右立柱,给柜体加框。上横梁颜色更亮,下横梁与柜体同色,按参考颜色分别设置。"
},
{
"id": "S05",
"title": "两块背板",
"chapter": "第 5 步 · P07、P08",
"note": "P07、P08 各 440 × 30 × 560",
"target": 100,
"narration": "最后两块背板,都是四百四十乘三十乘五百六十,分别贴在左右两段柜体的后侧。到这里八个部件全部完成。检查对象树,应该正好有八个以 CabinetA 开头的对象。"
},
{
"id": "S06",
"title": "精度自检与保存",
"chapter": "第 6 步 · 检查点",
"note": "逐件包围盒/中心 ≤1.5/3 mm;保存 E03.FCStd",
"target": 70,
"narration": "保存前做精度自检:每个部件的包围盒误差不超过一点五毫米,中心误差不超过三毫米,颜色与参考的每个通道误差不超过零点零二。检查通过后保存 E03 检查点。下一集在这个基础上建长控制柜。"
}
],
"lesson": {
"objectives": [
"把复杂柜体拆成 8 个可参数化的图元部件",
"用 Box 的 Length/Width/Height 精确控制尺寸",
"用 Position 面板按参考最小角点摆放",
"用 Object Color 设置并保存部件颜色"
],
"parameters": [
{ "name": "柜体 P02", "value": "1500 × 744.2 × 754 mm @ (-35, -214.3, 0)" },
{ "name": "立柱 P01/P03", "value": "440 × 134.3 × 597 mm" },
{ "name": "柜门 P04", "value": "30 × 560 × 560 mm" },
{ "name": "横梁 P05/P06", "value": "40 × 560 × 40 mm" },
{ "name": "背板 P07/P08", "value": "440 × 30 × 560 mm" },
{ "name": "整体包围盒", "value": "1500 × 744 × 754 mm" }
],
"checklist": [
"对象树有 8 个 CabinetA_Pxx 对象",
"每个对象尺寸与参数表一致",
"柜门厚度方向为 X=30 mm",
"颜色与参考一致,黑色立柱不发白",
"保存后重新打开,对象和颜色仍在"
],
"mistakes": [
"把柜门厚度填到 Z 方向,门会变成一块立着的厚板",
"位置填成中心而不是最小角点,整体偏移半个尺寸",
"只设了显示颜色但没有触发应用,保存后颜色丢失"
],
"exercise": "把柜体 P02 的宽度改成 800 mm,观察整体包围盒变化,再改回 744.2。"
}
}

View File

@@ -0,0 +1,69 @@
{
"schema": "freecad-web-line-course/video-assembly/v1",
"generatedAt": "2026-11-12T20:00:02.143Z",
"episode": "E04",
"title": "长控制柜",
"status": "assembled",
"source": "raw/E04/screen-recording.mp4",
"captureStart": 0.904,
"totalVideo": 523.333,
"scenes": [
{
"id": "S00",
"start": 0,
"end": 18.033,
"duration": 18.033,
"narration": 13.896
},
{
"id": "S01",
"start": 18.033,
"end": 53.067,
"duration": 35.033,
"narration": 15.792
},
{
"id": "S02",
"start": 53.067,
"end": 153.1,
"duration": 100.033,
"narration": 18.288
},
{
"id": "S03",
"start": 153.1,
"end": 253.133,
"duration": 100.033,
"narration": 18.936
},
{
"id": "S04",
"start": 253.133,
"end": 353.2,
"duration": 100.067,
"narration": 16.056
},
{
"id": "S05",
"start": 353.2,
"end": 453.267,
"duration": 100.067,
"narration": 16.08
},
{
"id": "S06",
"start": 453.267,
"end": 523.333,
"duration": 70.067,
"narration": 17.232
}
],
"outputs": {
"mp4": "teaching/media/line-course/E04-cabinet-b.mp4",
"webm": "teaching/media/line-course/E04-cabinet-b.webm",
"vtt": "teaching/media/line-course/E04-cabinet-b.zh.vtt",
"srt": "teaching/media/line-course/E04-cabinet-b.zh.srt",
"poster": "teaching/media/line-course/E04-cabinet-b-poster.png"
},
"cues": 20
}

View File

@@ -0,0 +1,58 @@
{
"schema": "freecad-web-line-course/video-tts/v1",
"episode": "E04",
"generatedAt": "2026-11-12T19:37:06.669Z",
"voice": "zh-CN-XiaoxiaoNeural",
"rate": "-4%",
"scenes": {
"S00": {
"title": "标题",
"target": 18,
"duration": 13.896,
"media": "audio/S00.mp3",
"subtitles": "audio/S00.srt"
},
"S01": {
"title": "从 E03 检查点继续",
"target": 35,
"duration": 15.792,
"media": "audio/S01.mp3",
"subtitles": "audio/S01.srt"
},
"S02": {
"title": "左柜体与立柱",
"target": 100,
"duration": 18.288,
"media": "audio/S02.mp3",
"subtitles": "audio/S02.srt"
},
"S03": {
"title": "中柱与顶板",
"target": 100,
"duration": 18.936,
"media": "audio/S03.mp3",
"subtitles": "audio/S03.srt"
},
"S04": {
"title": "右侧小柜与下横梁",
"target": 100,
"duration": 16.056,
"media": "audio/S04.mp3",
"subtitles": "audio/S04.srt"
},
"S05": {
"title": "上横梁与背板",
"target": 100,
"duration": 16.08,
"media": "audio/S05.mp3",
"subtitles": "audio/S05.srt"
},
"S06": {
"title": "精度自检与保存",
"target": 70,
"duration": 17.232,
"media": "audio/S06.mp3",
"subtitles": "audio/S06.srt"
}
}
}

View File

@@ -0,0 +1,18 @@
// E04: build CabinetB (8 parts) on top of the E03 checkpoint.
import fs from "node:fs";
import path from "node:path";
import { createSceneRunner } from "../../../carrier-course/lib/scene.mjs";
import { buildEpisodeModels } from "../../lib/model-build.mjs";
export async function run({ page, rec, script, stillsDir, rawDir, webRoot }) {
const scene = createSceneRunner({ rec, page, script });
const shot = name => rec.shot(stillsDir, name);
const log = [];
const logStep = entry => {
log.push({ at: new Date().toISOString(), ...entry });
fs.writeFileSync(path.join(rawDir, "live-log.json"), `${JSON.stringify(log, null, 2)}\n`);
};
await scene("S00", async () => { await shot("S00-title"); });
await buildEpisodeModels({ page, rec, webRoot, rawDir, stillsDir, scene, shot, logStep, log,
episodeId: "E04", modelNames: ["CabinetB"] });
}

View File

@@ -0,0 +1,94 @@
{
"schema": "freecad-web-line-course/script/v1",
"episode": "E04",
"title": "长控制柜",
"voice": "zh-CN-XiaoxiaoNeural",
"rate": "-4%",
"scenes": [
{
"id": "S00",
"title": "标题",
"chapter": "第 4 集 · 长柜体",
"note": "长控制柜 2970 × 774 × 774 mm,8 个部件",
"target": 18,
"narration": "这一集建长控制柜,整体接近三米长,是主控制柜的两倍。它由左柜体、中间立柱、右侧小柜体、顶板和背板组成,同样拆成八个部件。"
},
{
"id": "S01",
"title": "从 E03 检查点继续",
"chapter": "第 1 步 · 打开检查点",
"note": "对象树保留主控制柜 8 个对象",
"target": 35,
"narration": "打开上一集保存的 E03 检查点。对象树里已经有主控制柜的八个对象,它们会一直保留在场景里。这一集的新对象接在后面,最后整条产线都在同一个文档中。"
},
{
"id": "S02",
"title": "左柜体与立柱",
"chapter": "第 2 步 · P01、P02",
"note": "P01 440 × 134.3 × 597;P02 1500 × 744.2 × 754",
"target": 100,
"narration": "先建左侧立柱,四百四十乘一百三十四点三乘五百九十七,黑色。再建左柜体,一千五乘七百四十四点二乘七百五十四。它们的 X 起点在一千五百毫米附近,比主控制柜更靠左。"
},
{
"id": "S03",
"title": "中柱与顶板",
"chapter": "第 3 步 · P03、P04",
"note": "P03 同左立柱;P04 顶板 2960 × 640 × 20",
"target": 100,
"narration": "第三件是中间立柱,和左立柱同尺寸。第四件是整条柜的顶板,两千九百六十乘六百四十乘二十毫米,厚度只有二十毫米,铺在柜体上方。顶板是长条薄板,注意长度放到 X 方向。"
},
{
"id": "S04",
"title": "右侧小柜与下横梁",
"chapter": "第 4 步 · P05、P06",
"note": "P05 540 × 640 × 600;P06 40 × 560 × 40",
"target": 100,
"narration": "右侧是一个更矮的小柜体,五百四十乘六百四十乘六百,放在柜体右端。再建一根下横梁,四十乘五百六十乘四十。小柜体和主体之间靠这根横梁连接。"
},
{
"id": "S05",
"title": "上横梁与背板",
"chapter": "第 5 步 · P07、P08",
"note": "P07 40 × 560 × 40 顶部;P08 440 × 30 × 560 背板",
"target": 100,
"narration": "上横梁和下横梁同尺寸,放在右侧小柜的顶部。最后是左段背板,四百四十乘三十乘五百六十。到这里长控制柜的八个部件完成,整线累计十六个对象。"
},
{
"id": "S06",
"title": "精度自检与保存",
"chapter": "第 6 步 · 检查点",
"note": "16 个累计对象全部通过逐件包围盒/中心/颜色断言",
"target": 70,
"narration": "保存前做全量自检:主控制柜和长控制柜一共十六个对象,每个部件的包围盒、中心、颜色都要通过。通过后保存 E04 检查点。下一集补上柜门和两块显示屏。"
}
],
"lesson": {
"objectives": [
"在已有检查点上增量建模,保持累计场景",
"用重复的立柱/横梁建立长柜体的节奏",
"控制薄板类部件的厚度方向",
"保存前做累计 16 对象的全量精度检查"
],
"parameters": [
{ "name": "整体包围盒", "value": "2970 × 774 × 774 mm" },
{ "name": "左柜体 P02", "value": "1500 × 744.2 × 754 mm" },
{ "name": "顶板 P04", "value": "2960 × 640 × 20.3 mm" },
{ "name": "右侧小柜 P05", "value": "540 × 640 × 600 mm" },
{ "name": "横梁 P06/P07", "value": "40 × 560 × 40 mm" },
{ "name": "背板 P08", "value": "440 × 30 × 560 mm" }
],
"checklist": [
"打开 E03 检查点后能看到 8 个 CabinetA 对象",
"新增 8 个 CabinetB_Pxx 对象",
"顶板厚度为 20 mm",
"累计 16 个对象全部通过精度检查",
"E04 检查点保存成功"
],
"mistakes": [
"新建了空白文档,丢掉上一集的柜体",
"顶板长度填到 Y 方向,柜体变成 T 形",
"右侧小柜和主体重叠过多,整体包围盒变短"
],
"exercise": "把顶板 P04 的厚度从 20 改成 30 mm,观察整体高度变化,再改回 20.3。"
}
}

View File

@@ -0,0 +1,51 @@
{
"schema": "freecad-web-line-course/video-tts/v1",
"episode": "E05",
"generatedAt": "2026-11-12T20:00:46.515Z",
"voice": "zh-CN-XiaoxiaoNeural",
"rate": "-4%",
"scenes": {
"S00": {
"title": "标题",
"target": 18,
"duration": 12.12,
"media": "audio/S00.mp3",
"subtitles": "audio/S00.srt"
},
"S01": {
"title": "从 E04 检查点继续",
"target": 30,
"duration": 11.088,
"media": "audio/S01.mp3",
"subtitles": "audio/S01.srt"
},
"S02": {
"title": "柜门与第一块屏幕底座",
"target": 100,
"duration": 19.92,
"media": "audio/S02.mp3",
"subtitles": "audio/S02.srt"
},
"S03": {
"title": "屏幕面板与第二块屏体",
"target": 100,
"duration": 17.928,
"media": "audio/S03.mp3",
"subtitles": "audio/S03.srt"
},
"S04": {
"title": "第二块屏幕面板",
"target": 90,
"duration": 14.448,
"media": "audio/S04.mp3",
"subtitles": "audio/S04.srt"
},
"S05": {
"title": "精度自检与保存",
"target": 70,
"duration": 18.816,
"media": "audio/S05.mp3",
"subtitles": "audio/S05.srt"
}
}
}

View File

@@ -0,0 +1,18 @@
// E05: cabinet door and two displays on top of the E04 checkpoint.
import fs from "node:fs";
import path from "node:path";
import { createSceneRunner } from "../../../carrier-course/lib/scene.mjs";
import { buildEpisodeModels } from "../../lib/model-build.mjs";
export async function run({ page, rec, script, stillsDir, rawDir, webRoot }) {
const scene = createSceneRunner({ rec, page, script });
const shot = name => rec.shot(stillsDir, name);
const log = [];
const logStep = entry => {
log.push({ at: new Date().toISOString(), ...entry });
fs.writeFileSync(path.join(rawDir, "live-log.json"), `${JSON.stringify(log, null, 2)}\n`);
};
await scene("S00", async () => { await shot("S00-title"); });
await buildEpisodeModels({ page, rec, webRoot, rawDir, stillsDir, scene, shot, logStep, log,
episodeId: "E05", modelNames: ["CabinetDoor", "DisplayA", "DisplayB"] });
}

View File

@@ -0,0 +1,86 @@
{
"schema": "freecad-web-line-course/script/v1",
"episode": "E05",
"title": "柜门与双显示屏",
"voice": "zh-CN-XiaoxiaoNeural",
"rate": "-4%",
"scenes": [
{
"id": "S00",
"title": "标题",
"chapter": "第 5 集 · 薄板与屏幕",
"note": "柜门 30 × 560 × 560;两块显示屏 249 × 161 × 312",
"target": 18,
"narration": "这一集补三件小模型:控制柜的柜门,以及两块相同的显示屏。它们都是薄板类零件,重点是厚度方向和屏幕前后层级。"
},
{
"id": "S01",
"title": "从 E04 检查点继续",
"chapter": "第 1 步 · 检查点",
"note": "累计 16 个对象",
"target": 30,
"narration": "打开 E04 检查点,场景里已经有十六个对象。柜体和长柜都已经就位,这一集的门和屏幕会贴在柜体前侧。"
},
{
"id": "S02",
"title": "柜门与第一块屏幕底座",
"chapter": "第 2 步 · 门、屏体",
"note": "柜门 P01 30 × 560 × 560;显示屏 A 屏体 249 × 161.2 × 312",
"target": 100,
"narration": "先建柜门,三十乘五百六十乘五百六十毫米,贴在主控制柜右前方。再建第一块显示屏的屏体,二百四十九乘一百六十一点二乘三百一十二,浅灰色外壳。注意屏幕的厚度在 Y 方向,高度在 Z 方向。"
},
{
"id": "S03",
"title": "屏幕面板与第二块屏体",
"chapter": "第 3 步 · 面板、屏体",
"note": "面板 204 × 115.7 × 148.4;显示屏 B 屏体同 A",
"target": 100,
"narration": "第一块屏幕的面板是深灰色,二百零四乘一百一十五点七乘一百四十八点四,向前突出一点。第二块显示屏的屏体与第一块完全相同,但位置更低、更靠右,是操作台侧面的副屏。"
},
{
"id": "S04",
"title": "第二块屏幕面板",
"chapter": "第 4 步 · 副屏面板",
"note": "面板 204 × 115.7 × 148.4,颜色同 A",
"target": 90,
"narration": "给第二块屏补上深灰面板。面板尺寸与第一块一致,位置按参考表放到副屏前方。到这里三件模型、五个部件完成,累计二十一个对象。"
},
{
"id": "S05",
"title": "精度自检与保存",
"chapter": "第 5 步 · 检查点",
"note": "21 个累计对象通过;保存 E05",
"target": 70,
"narration": "保存前做全量检查:二十一个对象的包围盒、中心、颜色全部通过。特别看两块屏的朝向和前后层级,如果面板跑到屏体后面,说明 Y 方向位置填反了。通过后保存 E05 检查点。"
}
],
"lesson": {
"objectives": [
"掌握薄板类零件的厚度方向",
"用同一套参数复用两块显示屏",
"理解屏幕外壳与面板的前后层级",
"在累计文档中检查对象命名和数量"
],
"parameters": [
{ "name": "柜门", "value": "30 × 560 × 560 mm" },
{ "name": "显示屏屏体", "value": "249 × 161.2 × 312 mm" },
{ "name": "显示屏面板", "value": "204 × 115.7 × 148.4 mm" },
{ "name": "显示屏 A 位置", "value": "(-1472.4, -127.7, 774) mm" },
{ "name": "显示屏 B 位置", "value": "(-1194.5, -325, 40) mm" },
{ "name": "累计对象", "value": "21" }
],
"checklist": [
"柜门厚度为 X=30 mm",
"两块屏体外壳尺寸相同",
"面板在屏体前方,颜色更深",
"对象树出现 DisplayA_P01/P02 与 DisplayB_P01/P02",
"累计 21 个对象全部通过精度检查"
],
"mistakes": [
"把柜门厚度填成 560,门变成方块",
"两块屏共用同一个位置,重叠在一起",
"面板和外壳颜色设反,屏幕看起来是凸出的白块"
],
"exercise": "把显示屏 B 的 Z 位置整体抬高 100 mm,观察它与操作台的关系,再恢复。"
}
}

View File

@@ -0,0 +1,18 @@
// E06: hopper and raw feeder on top of the E05 checkpoint.
import fs from "node:fs";
import path from "node:path";
import { createSceneRunner } from "../../../carrier-course/lib/scene.mjs";
import { buildEpisodeModels } from "../../lib/model-build.mjs";
export async function run({ page, rec, script, stillsDir, rawDir, webRoot }) {
const scene = createSceneRunner({ rec, page, script });
const shot = name => rec.shot(stillsDir, name);
const log = [];
const logStep = entry => {
log.push({ at: new Date().toISOString(), ...entry });
fs.writeFileSync(path.join(rawDir, "live-log.json"), `${JSON.stringify(log, null, 2)}\n`);
};
await scene("S00", async () => { await shot("S00-title"); });
await buildEpisodeModels({ page, rec, webRoot, rawDir, stillsDir, scene, shot, logStep, log,
episodeId: "E06", modelNames: ["Hopper", "RawFeeder"] });
}

View File

@@ -0,0 +1,94 @@
{
"schema": "freecad-web-line-course/script/v1",
"episode": "E06",
"title": "料仓与原料上料",
"voice": "zh-CN-XiaoxiaoNeural",
"rate": "-4%",
"scenes": [
{
"id": "S00",
"title": "标题",
"chapter": "第 6 集 · 上料起点",
"note": "料仓 280 × 250 × 200;原料上料 210 × 208 × 204",
"target": 18,
"narration": "这一集进入上料单元:先建料仓,再建原料上料机构。料仓负责存料,上料机构把原料送到输送线,两件都在产线左端。"
},
{
"id": "S01",
"title": "从 E05 检查点继续",
"chapter": "第 1 步 · 21 个对象",
"note": "柜体、门、显示屏已就位",
"target": 30,
"narration": "打开 E05 检查点,场景里已有二十一个对象。前三个工位的模型都在左前方,这一集的新对象继续往左扩展。"
},
{
"id": "S02",
"title": "料仓外箱与内胆",
"chapter": "第 2 步 · 料仓 2 件",
"note": "外箱 280 × 250 × 200;内胆 190.6 × 190.8 × 65",
"target": 100,
"narration": "料仓先建外箱,二百八十乘二百五十乘二百,底部落在七百七十四毫米的台面上。再建内胆,一百九十点六乘一百九十点八乘六十五,嵌在外箱内部。两件颜色一深一浅,形成料斗的层次。"
},
{
"id": "S03",
"title": "上料机架与导轨",
"chapter": "第 3 步 · P01、P02",
"note": "机架 84.8 × 56 × 189.7;导轨 77.2 × 27.4 × 16,绿色",
"target": 100,
"narration": "原料上料机构先建机架,八十四点八乘五十六乘一百八十九点七,浅米色。再建一条绿色导轨,七十七点二乘二十七点四乘十六,横在机架上方。绿色是这批参考模型里少数的高饱和色,很容易检查颜色是否设对。"
},
{
"id": "S04",
"title": "立柱与底板",
"chapter": "第 4 步 · P03、P04",
"note": "立柱 50 × 83.2 × 197.1;底板 210 × 208 × 186",
"target": 100,
"narration": "立柱五十乘八十三点二乘一百九十七点一,和机架同色。底板二百一十乘二百零八乘一百八十六,是上料机构的基座,颜色偏灰。底板比机架宽,注意 X、Y 两个方向不要填反。"
},
{
"id": "S05",
"title": "上料圆柱",
"chapter": "第 5 步 · P05 圆柱",
"note": "68.4 × 56.4 × 100;创建后用属性面板确认半径与高度",
"target": 110,
"narration": "最后一件是上料圆柱,六十八点四乘五十六点四乘一百毫米的包围盒。因为截面不是正圆,我们仍用 Box 精确复现它的包围盒,避免圆柱直径超出公差。打开 Part 的 Primitives,选择 Box,填入三个方向尺寸,再放到参考位置。"
},
{
"id": "S06",
"title": "精度自检与保存",
"chapter": "第 6 步 · 28 个对象",
"note": "累计 28 个对象通过;保存 E06",
"target": 70,
"narration": "保存前检查全部二十八个对象。重点看料仓是否落在台面上、绿色导轨颜色是否正确、底板有没有和机架错位。通过后保存 E06 检查点。下一集建上料与传送带送料装置。"
}
],
"lesson": {
"objectives": [
"建立料仓的外箱与内胆层次",
"用绿色导轨检验颜色设置",
"判断什么时候用 Box 而不是 Cylinder",
"在累计 28 个对象时保持精度检查"
],
"parameters": [
{ "name": "料仓外箱", "value": "280 × 250 × 200 mm @ Z=774" },
{ "name": "料仓内胆", "value": "190.6 × 190.8 × 65 mm" },
{ "name": "上料机架", "value": "84.8 × 56 × 189.7 mm" },
{ "name": "绿色导轨", "value": "77.2 × 27.4 × 16 mm,绿色" },
{ "name": "上料底板", "value": "210 × 208 × 186 mm" },
{ "name": "上料圆柱件", "value": "68.4 × 56.4 × 100 mm(非正圆,用 Box)" }
],
"checklist": [
"料仓外箱底部在 Z=774 mm",
"绿色导轨颜色正确",
"上料底板与机架没有左右错位",
"累计 28 个对象全部通过精度检查",
"E06 检查点保存成功"
],
"mistakes": [
"把非正圆截面强行做成圆柱,Y 方向超出公差",
"料仓落到 Z=0,沉到台面下面",
"绿色导轨忘记设颜色,验收时颜色通道对不上"
],
"exercise": "把料仓外箱高度从 200 改成 240 mm,观察内胆是否被完全包住,再改回 200。"
}
}

View File

@@ -0,0 +1,18 @@
// E07: loader and conveyor feeder on top of the E06 checkpoint.
import fs from "node:fs";
import path from "node:path";
import { createSceneRunner } from "../../../carrier-course/lib/scene.mjs";
import { buildEpisodeModels } from "../../lib/model-build.mjs";
export async function run({ page, rec, script, stillsDir, rawDir, webRoot }) {
const scene = createSceneRunner({ rec, page, script });
const shot = name => rec.shot(stillsDir, name);
const log = [];
const logStep = entry => {
log.push({ at: new Date().toISOString(), ...entry });
fs.writeFileSync(path.join(rawDir, "live-log.json"), `${JSON.stringify(log, null, 2)}\n`);
};
await scene("S00", async () => { await shot("S00-title"); });
await buildEpisodeModels({ page, rec, webRoot, rawDir, stillsDir, scene, shot, logStep, log,
episodeId: "E07", modelNames: ["Loader", "ConveyorFeeder"] });
}

View File

@@ -0,0 +1,94 @@
{
"schema": "freecad-web-line-course/script/v1",
"episode": "E07",
"title": "上料与传送带送料",
"voice": "zh-CN-XiaoxiaoNeural",
"rate": "-4%",
"scenes": [
{
"id": "S00",
"title": "标题",
"chapter": "第 7 集 · 输送线",
"note": "上料机构 375 × 140 × 212;传送带 614 × 270 × 205",
"target": 18,
"narration": "这一集把原料从料仓送到输送线:先建上料机构,再建传送带送料装置。传送带是整条线最长的部件组合之一,一共六个图元。"
},
{
"id": "S01",
"title": "从 E06 检查点继续",
"chapter": "第 1 步 · 28 个对象",
"note": "料仓和原料上料已就位",
"target": 30,
"narration": "打开 E06 检查点,场景里已有二十八个对象。料仓和原料上料在左端,这一集的输送线接在它们右侧。"
},
{
"id": "S02",
"title": "上料机架与顶梁",
"chapter": "第 2 步 · 上料 2 件",
"note": "机架 165 × 140 × 212;顶梁 319.9 × 40 × 30",
"target": 90,
"narration": "上料机构先建机架,一百六十五乘一百四十乘二百一十二,落在台面上。再建顶梁,三百一十九点九乘四十乘三十,横在机架顶部,向右侧伸出。顶梁是悬臂结构,位置要以包围盒最小角点为准。"
},
{
"id": "S03",
"title": "传送带框架与皮带",
"chapter": "第 3 步 · P03、P01",
"note": "框架 497 × 170 × 174;皮带 508.4 × 100 × 68.9 @ Z=906",
"target": 100,
"narration": "传送带先建底部框架,四百九十七乘一百七十乘一百七十四,落在台面上。再建皮带,五百零八点四乘一百乘六十八点九,抬到九百零六毫米高度。皮带比框架略长,这是正常的张紧余量。"
},
{
"id": "S04",
"title": "滚筒与料口",
"chapter": "第 4 步 · P02、P04",
"note": "黑色滚筒 44.5 × 152.5 × 34;料口 395 × 165 × 204.6",
"target": 100,
"narration": "在皮带右端加一个黑色滚筒,四十四点五乘一百五十二点五乘三十四。再建右侧料口,三百九十五乘一百六十五乘二百零四点六,是传送带与下一工位的接口。滚筒是黑色,料口是浅灰。"
},
{
"id": "S05",
"title": "挡板与侧轨",
"chapter": "第 5 步 · P05、P06",
"note": "挡板 120 × 89.1 × 21.5;侧轨 175 × 9 × 6.5",
"target": 90,
"narration": "最后两件是小零件:挡板一百二十乘八十九点一乘二十一点五,侧轨一百七十五乘九乘六点五。它们都在皮带上方,负责导向。小件最容易漏建,检查对象树里六个 ConveyorFeeder 对象是否齐全。"
},
{
"id": "S06",
"title": "精度自检与保存",
"chapter": "第 6 步 · 36 个对象",
"note": "累计 36 个对象通过;保存 E07",
"target": 70,
"narration": "保存前检查三十六个对象。重点看皮带是否高于框架、滚筒是否在右端、料口是否与皮带对齐。通过后保存 E07 检查点。下一集建旋转运送和称重平台。"
}
],
"lesson": {
"objectives": [
"建立悬臂式上料机构",
"理解传送带框架、皮带、滚筒的层级",
"用小件补齐模型细节",
"检查长条设备的 X 方向尺寸"
],
"parameters": [
{ "name": "上料机架", "value": "165 × 140 × 212 mm" },
{ "name": "上料顶梁", "value": "319.9 × 40 × 30 mm" },
{ "name": "传送带框架", "value": "497 × 170 × 174 mm" },
{ "name": "皮带", "value": "508.4 × 100 × 68.9 mm @ Z=906" },
{ "name": "滚筒", "value": "44.5 × 152.5 × 34 mm,黑色" },
{ "name": "料口", "value": "395 × 165 × 204.6 mm" }
],
"checklist": [
"上料顶梁向右侧伸出",
"皮带高于框架,Z 起点约 906 mm",
"黑色滚筒位于皮带右端",
"六个 ConveyorFeeder 对象齐全",
"累计 36 个对象全部通过精度检查"
],
"mistakes": [
"把皮带和框架放在同一高度,皮带陷进框架",
"滚筒位置放到左端,与料口方向相反",
"漏建挡板或侧轨,对象数少两件"
],
"exercise": "把皮带长度增加 20 mm,观察它与框架的相对长度,再恢复。"
}
}

View File

@@ -0,0 +1,18 @@
// E08: rotary transfer and weighing platform on top of E07.
import fs from "node:fs";
import path from "node:path";
import { createSceneRunner } from "../../../carrier-course/lib/scene.mjs";
import { buildEpisodeModels } from "../../lib/model-build.mjs";
export async function run({ page, rec, script, stillsDir, rawDir, webRoot }) {
const scene = createSceneRunner({ rec, page, script });
const shot = name => rec.shot(stillsDir, name);
const log = [];
const logStep = entry => {
log.push({ at: new Date().toISOString(), ...entry });
fs.writeFileSync(path.join(rawDir, "live-log.json"), `${JSON.stringify(log, null, 2)}\n`);
};
await scene("S00", async () => { await shot("S00-title"); });
await buildEpisodeModels({ page, rec, webRoot, rawDir, stillsDir, scene, shot, logStep, log,
episodeId: "E08", modelNames: ["RotaryTransfer", "WeighPlatform"] });
}

View File

@@ -0,0 +1,77 @@
{
"schema": "freecad-web-line-course/script/v1",
"episode": "E08",
"title": "旋转运送与称重平台",
"voice": "zh-CN-XiaoxiaoNeural",
"rate": "-4%",
"scenes": [
{
"id": "S00",
"title": "标题",
"chapter": "第 8 集 · 转盘与称重",
"note": "旋转运送 537 × 536 × 202;称重平台 200 × 199 × 175",
"target": 18,
"narration": "这一集建两个工位:旋转运送装置和称重平台。旋转装置把工件转九十度,称重平台记录重量,两件都只有两个部件,适合练习大平面和薄板。"
},
{
"id": "S01",
"title": "从 E07 检查点继续",
"chapter": "第 1 步 · 36 个对象",
"note": "输送线已就位",
"target": 30,
"narration": "打开 E07 检查点,场景里已有三十六个对象。传送带右端就是旋转运送装置的位置。"
},
{
"id": "S02",
"title": "旋转电机与转盘",
"chapter": "第 2 步 · 旋转 2 件",
"note": "电机 340 × 265 × 165,黑色;转盘 536.9 × 536.3 × 47 @ Z=929",
"target": 100,
"narration": "先建旋转电机,三百四十乘二百六十五乘一百六十五,黑色,落在台面上。再建转盘,五百三十六点九乘五百三十六点三乘四十七,抬到九百二十九毫米,是整条线上最大的圆形工作台。转盘用 Box 表达,保证包围盒精确。"
},
{
"id": "S03",
"title": "称重底座与台面",
"chapter": "第 3 步 · 称重 2 件",
"note": "底座 200 × 199.3 × 170;台面 149.7 × 150 × 5 @ Z=944",
"target": 100,
"narration": "称重平台先建底座,二百乘一百九十九点三乘一百七十。再建五毫米厚的台面,一百四十九点七乘一百五十,放在九百四十四毫米高度。台面很薄,Z 方向只有五毫米,别把厚度填到 X 或 Y。"
},
{
"id": "S04",
"title": "精度自检与保存",
"chapter": "第 4 步 · 40 个对象",
"note": "累计 40 个对象通过;保存 E08",
"target": 70,
"narration": "保存前检查四十个对象。重点看转盘是否水平、称重台面是否在底座正上方、两件是否落在同一台面高度。通过后保存 E08 检查点。下一集进入抓取工位。"
}
],
"lesson": {
"objectives": [
"建立大直径转盘的包围盒",
"控制薄台面的厚度方向",
"理解同一工位内两个部件的相对高度",
"在 40 个对象的累计文档中定位新对象"
],
"parameters": [
{ "name": "旋转电机", "value": "340 × 265 × 165 mm,黑色" },
{ "name": "转盘", "value": "536.9 × 536.3 × 47 mm @ Z=929" },
{ "name": "称重底座", "value": "200 × 199.3 × 170 mm" },
{ "name": "称重台面", "value": "149.7 × 150 × 5 mm @ Z=944" },
{ "name": "累计对象", "value": "40" }
],
"checklist": [
"转盘顶面高于电机",
"称重台面厚度为 5 mm",
"台面位于底座正上方",
"累计 40 个对象全部通过精度检查",
"E08 检查点保存成功"
],
"mistakes": [
"把转盘厚度 47 填到 Z 以外的方向",
"称重台面与底座错位半个尺寸",
"电机颜色忘记改成黑色"
],
"exercise": "把称重台面抬高 20 mm,观察它与底座之间出现间隙,再恢复。"
}
}

View File

@@ -0,0 +1,18 @@
// E09: pick feeder and auxiliary gripper on top of E08.
import fs from "node:fs";
import path from "node:path";
import { createSceneRunner } from "../../../carrier-course/lib/scene.mjs";
import { buildEpisodeModels } from "../../lib/model-build.mjs";
export async function run({ page, rec, script, stillsDir, rawDir, webRoot }) {
const scene = createSceneRunner({ rec, page, script });
const shot = name => rec.shot(stillsDir, name);
const log = [];
const logStep = entry => {
log.push({ at: new Date().toISOString(), ...entry });
fs.writeFileSync(path.join(rawDir, "live-log.json"), `${JSON.stringify(log, null, 2)}\n`);
};
await scene("S00", async () => { await shot("S00-title"); });
await buildEpisodeModels({ page, rec, webRoot, rawDir, stillsDir, scene, shot, logStep, log,
episodeId: "E09", modelNames: ["PickFeeder", "AuxGripper"] });
}

View File

@@ -0,0 +1,37 @@
{
"schema": "freecad-web-line-course/script/v1",
"episode": "E09",
"title": "夹取送料与辅助夹爪",
"voice": "zh-CN-XiaoxiaoNeural",
"rate": "-4%",
"scenes": [
{ "id": "S00", "title": "标题", "chapter": "第 9 集 · 抓取工位", "note": "夹取送料 1026 × 277 × 455;辅助夹爪 73 × 94 × 102", "target": 18,
"narration": "这一集进入抓取工位:一台横向夹取送料装置,加上机器人腕部的辅助夹爪。夹取装置是整条线上跨度最大的模型,有一米长。" },
{ "id": "S01", "title": "从 E08 检查点继续", "chapter": "第 1 步 · 40 个对象", "note": "输送与旋转工位已就位", "target": 30,
"narration": "打开 E08 检查点,场景里已有四十个对象。抓取装置会架在传送带和旋转工位之间,位置在一米左右的高度。" },
{ "id": "S02", "title": "夹爪与机架", "chapter": "第 2 步 · P01、P02", "note": "夹爪 148.5 × 60 × 60,黑色;机架 420 × 200 × 441.8", "target": 95,
"narration": "先建夹爪本体,一百四十八点五乘六十乘六十,黑色,放在一千一百四十四毫米高度。再建机架,四百二十乘二百乘四百四十一点八,落在台面上,是夹取装置的支撑。" },
{ "id": "S03", "title": "横梁与滑座", "chapter": "第 3 步 · P03、P04", "note": "横梁 810 × 72 × 82;滑座 242.9 × 143.2 × 119.2,深灰", "target": 95,
"narration": "横梁八百一十乘七十二乘八十二,横跨整个工位。滑座二百四十二点九乘一百四十三点二乘一百一十九点二,深灰色,挂在横梁下方。横梁很长,注意 X 方向尺寸不要少一位。" },
{ "id": "S04", "title": "气缸与辅助夹爪座", "chapter": "第 4 步 · P05、A01", "note": "气缸 70 × 59.3 × 141.5,黑色;夹爪座 73.3 × 94.3 × 38.1", "target": 95,
"narration": "气缸七十乘五十九点三乘一百四十一点五,黑色,连接滑座与夹爪。然后开始建机器人腕部的辅助夹爪:先建上座,七十三点三乘九十四点三乘三十八点一,浅灰。" },
{ "id": "S05", "title": "夹爪主体与指尖", "chapter": "第 5 步 · A02、A03", "note": "主体 40 × 53.1 × 70;指尖 34.1 × 29.9 × 53.9", "target": 95,
"narration": "辅助夹爪主体四十乘五十三点一乘七十,指尖三十四点一乘二十九点九乘五十三点九。三件都是浅灰色,靠尺寸差形成夹爪的开合结构。到这里累计四十八个对象。" },
{ "id": "S06", "title": "精度自检与保存", "chapter": "第 6 步 · 48 个对象", "note": "累计 48 个对象通过;保存 E09", "target": 70,
"narration": "保存前检查四十八个对象。重点看抓取横梁是否水平、夹爪是否在横梁下方、辅助夹爪三件是否对齐。通过后保存 E09 检查点。" }
],
"lesson": {
"objectives": ["建立一米级横向夹取机构", "控制悬臂与滑座的高度层级", "建立三件式夹爪结构", "在 48 个对象中检查新工位"],
"parameters": [
{ "name": "夹爪本体", "value": "148.5 × 60 × 60 mm,黑色" },
{ "name": "机架", "value": "420 × 200 × 441.8 mm" },
{ "name": "横梁", "value": "810 × 72 × 82 mm" },
{ "name": "滑座", "value": "242.9 × 143.2 × 119.2 mm" },
{ "name": "辅助夹爪上座", "value": "73.3 × 94.3 × 38.1 mm" },
{ "name": "辅助夹爪指尖", "value": "34.1 × 29.9 × 53.9 mm" }
],
"checklist": ["横梁跨度为 810 mm", "夹爪在横梁下方", "辅助夹爪三件对齐", "累计 48 个对象全部通过", "E09 检查点保存成功"],
"mistakes": ["横梁长度少填一位,整条抓取装置缩到十分之一", "滑座放到横梁上方", "辅助夹爪三件互相穿插"],
"exercise": "把滑座沿 X 方向移动 50 mm,观察它与横梁的相对位置,再恢复。"
}
}

View File

@@ -0,0 +1,18 @@
// E10: pusher and material store on top of E09.
import fs from "node:fs";
import path from "node:path";
import { createSceneRunner } from "../../../carrier-course/lib/scene.mjs";
import { buildEpisodeModels } from "../../lib/model-build.mjs";
export async function run({ page, rec, script, stillsDir, rawDir, webRoot }) {
const scene = createSceneRunner({ rec, page, script });
const shot = name => rec.shot(stillsDir, name);
const log = [];
const logStep = entry => {
log.push({ at: new Date().toISOString(), ...entry });
fs.writeFileSync(path.join(rawDir, "live-log.json"), `${JSON.stringify(log, null, 2)}\n`);
};
await scene("S00", async () => { await shot("S00-title"); });
await buildEpisodeModels({ page, rec, webRoot, rawDir, stillsDir, scene, shot, logStep, log,
episodeId: "E10", modelNames: ["Pusher", "MaterialStore"] });
}

View File

@@ -0,0 +1,36 @@
{
"schema": "freecad-web-line-course/script/v1",
"episode": "E10",
"title": "推料装置与物料存储区",
"voice": "zh-CN-XiaoxiaoNeural",
"rate": "-4%",
"scenes": [
{ "id": "S00", "title": "标题", "chapter": "第 10 集 · 推料与缓存", "note": "推料 490 × 336 × 588;存储区 352 × 83 × 413", "target": 18,
"narration": "这一集建推料装置和物料存储区。推料装置把工件推到检测位,存储区用四个小支座托住料盘。" },
{ "id": "S01", "title": "从 E09 检查点继续", "chapter": "第 1 步 · 48 个对象", "note": "抓取工位已就位", "target": 30,
"narration": "打开 E09 检查点,场景里已有四十八个对象。推料装置在输送线右侧,存储区更靠后。" },
{ "id": "S02", "title": "推料底座与推杆", "chapter": "第 2 步 · 推料 2 件", "note": "底座 490 × 230 × 85;推杆 149.6 × 336 × 532.6", "target": 100,
"narration": "推料装置先建底座,四百九十乘二百三十乘八十五,落在台面上。再建推杆,一百四十九点六乘三百三十六乘五百三十二点六,从底座向右伸出。推杆比底座高很多,是竖直安装的。" },
{ "id": "S03", "title": "存储区大板与第一支座", "chapter": "第 3 步 · P02、P01", "note": "大板 351.8 × 83 × 412.8;支座 39.9 × 40 × 30", "target": 100,
"narration": "物料存储区先建大板,三百五十一点八乘八十三乘四百一十二点八,浅灰。再建第一个小支座,三十九点九乘四十乘三十,放在大板左上角,颜色深一号。" },
{ "id": "S04", "title": "第二、第三支座", "chapter": "第 4 步 · P03、P04", "note": "两个支座同 39.9 × 40 × 30", "target": 95,
"narration": "第二支座放在大板右上角,第三支座放在左下角。三个支座的尺寸完全相同,区别只在位置。这种阵列件最容易复制错位置,建议每次都对照参考表的坐标。" },
{ "id": "S05", "title": "第四支座", "chapter": "第 5 步 · P05", "note": "右下角支座 39.9 × 40 × 30", "target": 90,
"narration": "最后一个支座放在右下角,四个角齐全,存储区的托架就完成了。累计对象达到五十五个。" },
{ "id": "S06", "title": "精度自检与保存", "chapter": "第 6 步 · 55 个对象", "note": "累计 55 个对象通过;保存 E10", "target": 70,
"narration": "保存前检查五十五个对象。四个支座的高度和颜色必须一致,推杆不能与存储区穿插。通过后保存 E10 检查点。" }
],
"lesson": {
"objectives": ["建立竖直推杆结构", "用四个同尺寸支座练习阵列位置", "检查阵列件的坐标是否成对", "在 55 个对象中定位新工位"],
"parameters": [
{ "name": "推料底座", "value": "490 × 230 × 85 mm" },
{ "name": "推杆", "value": "149.6 × 336 × 532.6 mm" },
{ "name": "存储区大板", "value": "351.8 × 83 × 412.8 mm" },
{ "name": "支座", "value": "39.9 × 40 × 30 mm × 4" },
{ "name": "累计对象", "value": "55" }
],
"checklist": ["推杆竖直安装", "四个支座位置成矩形", "支座颜色一致", "累计 55 个对象全部通过", "E10 检查点保存成功"],
"mistakes": ["推杆方向填反,向左侧伸出", "四个支座 Z 高度不一致", "只建了两个支座,对象数少两件"],
"exercise": "把四个支座的 Z 坐标统一加 10 mm,观察大板与支座的间隙,再恢复。"
}
}

View File

@@ -0,0 +1,18 @@
// E11: sensor block, transport bracket and transport inspector on top of E10.
import fs from "node:fs";
import path from "node:path";
import { createSceneRunner } from "../../../carrier-course/lib/scene.mjs";
import { buildEpisodeModels } from "../../lib/model-build.mjs";
export async function run({ page, rec, script, stillsDir, rawDir, webRoot }) {
const scene = createSceneRunner({ rec, page, script });
const shot = name => rec.shot(stillsDir, name);
const log = [];
const logStep = entry => {
log.push({ at: new Date().toISOString(), ...entry });
fs.writeFileSync(path.join(rawDir, "live-log.json"), `${JSON.stringify(log, null, 2)}\n`);
};
await scene("S00", async () => { await shot("S00-title"); });
await buildEpisodeModels({ page, rec, webRoot, rawDir, stillsDir, scene, shot, logStep, log,
episodeId: "E11", modelNames: ["SensorBlock", "TransportBracket", "TransportInspector"] });
}

View File

@@ -0,0 +1,32 @@
{
"schema": "freecad-web-line-course/script/v1",
"episode": "E11",
"title": "检测块、支架与运送检测",
"voice": "zh-CN-XiaoxiaoNeural",
"rate": "-4%",
"scenes": [
{ "id": "S00", "title": "标题", "chapter": "第 11 集 · 小件与圆柱", "note": "检测块 22 × 22 × 7;支架 60 × 113.5 × 310;检测头 75 × 148.5 × 325", "target": 18,
"narration": "这一集建三件小模型,最后一件带一个红色圆柱检测头,是第一次真正用 Cylinder 图元。" },
{ "id": "S01", "title": "从 E10 检查点继续", "chapter": "第 1 步 · 55 个对象", "note": "推料与存储已就位", "target": 30,
"narration": "打开 E10 检查点,场景里已有五十五个对象。这一集的三件模型都在检测区附近。" },
{ "id": "S02", "title": "小检测块与立架", "chapter": "第 2 步 · P01、P02", "note": "检测块 22 × 22 × 7;立架 60 × 113.5 × 310", "target": 100,
"narration": "先建检测块,二十二乘二十二乘七,只有七毫米高,是一块很薄的小板。再建运送支架,六十乘一百一十三点五乘三百一十,立在台面上。小件在视口里不容易点中,可以用对象树选择。" },
{ "id": "S03", "title": "检测头与红色圆柱", "chapter": "第 3 步 · 检测 2 件", "note": "检测头 75 × 148.5 × 325;圆柱 R15 × 60,红色", "target": 120,
"narration": "检测装置主体七十五乘一百四十八点五乘三百二十五。顶部是一个圆柱检测头,半径十五、高度六十毫米,颜色是红色。打开 Part 的 Primitives,选择 Cylinder,在属性面板把半径设为十五、高度设为六十,再放到检测头位置。" },
{ "id": "S04", "title": "精度自检与保存", "chapter": "第 4 步 · 59 个对象", "note": "累计 59 个对象通过;保存 E11", "target": 70,
"narration": "保存前检查五十九个对象。圆柱检测头的包围盒应该是三十乘三十乘六十,如果误差超过一点五毫米,说明半径或高度填错。通过后保存 E11 检查点。下一集建装配平台和检测台。" }
],
"lesson": {
"objectives": ["建立 7 mm 薄板小件", "第一次用 Part Cylinder 建圆柱", "确认圆柱包围盒 30 × 30 × 60", "检查小件在对象树中的命名"],
"parameters": [
{ "name": "检测块", "value": "22 × 22 × 7 mm" },
{ "name": "运送支架", "value": "60 × 113.5 × 310 mm" },
{ "name": "检测头主体", "value": "75 × 148.5 × 325 mm" },
{ "name": "红色圆柱", "value": "半径 15 mm × 高度 60 mm" },
{ "name": "累计对象", "value": "59" }
],
"checklist": ["检测块厚度为 7 mm", "圆柱半径 15、高度 60", "圆柱颜色为红色", "累计 59 个对象全部通过", "E11 检查点保存成功"],
"mistakes": ["圆柱半径填成直径 30", "圆柱高度填成 30", "小件在视口里点不中,误选了别的对象"],
"exercise": "把圆柱半径改成 12 mm,观察包围盒从 30 变成 24,再恢复 15。"
}
}

View File

@@ -0,0 +1,18 @@
// E12: raw assembly platform and inspection table on top of E11.
import fs from "node:fs";
import path from "node:path";
import { createSceneRunner } from "../../../carrier-course/lib/scene.mjs";
import { buildEpisodeModels } from "../../lib/model-build.mjs";
export async function run({ page, rec, script, stillsDir, rawDir, webRoot }) {
const scene = createSceneRunner({ rec, page, script });
const shot = name => rec.shot(stillsDir, name);
const log = [];
const logStep = entry => {
log.push({ at: new Date().toISOString(), ...entry });
fs.writeFileSync(path.join(rawDir, "live-log.json"), `${JSON.stringify(log, null, 2)}\n`);
};
await scene("S00", async () => { await shot("S00-title"); });
await buildEpisodeModels({ page, rec, webRoot, rawDir, stillsDir, scene, shot, logStep, log,
episodeId: "E12", modelNames: ["RawAssembly", "InspectionTable"] });
}

View File

@@ -0,0 +1,32 @@
{
"schema": "freecad-web-line-course/script/v1",
"episode": "E12",
"title": "原料装配与检测台",
"voice": "zh-CN-XiaoxiaoNeural",
"rate": "-4%",
"scenes": [
{ "id": "S00", "title": "标题", "chapter": "第 12 集 · 装配与检测", "note": "装配平台 498 × 145 × 338;检测台 75 × 148.5 × 325", "target": 18,
"narration": "这一集建原料装配平台和检测台。装配平台是一块大板加两个小件,检测台只有一根立柱,适合练习单件定位。" },
{ "id": "S01", "title": "从 E11 检查点继续", "chapter": "第 1 步 · 59 个对象", "note": "检测区小件已就位", "target": 30,
"narration": "打开 E11 检查点,场景里已有五十九个对象。装配平台在产线中部,检测台在右前方。" },
{ "id": "S02", "title": "装配大板与立柱", "chapter": "第 2 步 · A01、A02", "note": "大板 498.3 × 92 × 338.1;立柱 70.6 × 78.5 × 128.5", "target": 100,
"narration": "装配平台先建大板,四百九十八点三乘九十二乘三百三十八点一,抬到七百八十六毫米。再建一个小立柱,七十点六乘七十八点五乘一百二十八点五,深灰色,立在大板右前方。" },
{ "id": "S03", "title": "细杆与检测台", "chapter": "第 3 步 · A03、检测台", "note": "细杆 192.5 × 5 × 5;检测台 75 × 148.5 × 325", "target": 100,
"narration": "第三件是装配平台上的细杆,一百九十二点五乘五乘五,只有五毫米见方,是整批模型里最细的零件。最后建检测台,七十五乘一百四十八点五乘三百二十五,一根浅灰立柱,落在台面上。" },
{ "id": "S04", "title": "精度自检与保存", "chapter": "第 4 步 · 63 个对象", "note": "累计 63 个对象通过;保存 E12", "target": 70,
"narration": "保存前检查六十三个对象。细杆容易因为太细而被误判为缺失,确认对象树里有 RawAssembly_P03。通过后保存 E12 检查点。下一集建三色灯和坐标标记。" }
],
"lesson": {
"objectives": ["建立大板加立柱的装配平台", "处理 5 mm 见方的细杆", "建立单根立柱式检测台", "在 63 个对象中确认细杆存在"],
"parameters": [
{ "name": "装配大板", "value": "498.3 × 92 × 338.1 mm @ Z=786" },
{ "name": "装配立柱", "value": "70.6 × 78.5 × 128.5 mm" },
{ "name": "细杆", "value": "192.5 × 5 × 5 mm" },
{ "name": "检测台", "value": "75 × 148.5 × 325 mm" },
{ "name": "累计对象", "value": "63" }
],
"checklist": ["大板抬到 786 mm", "细杆尺寸 192.5 × 5 × 5", "检测台落在台面上", "累计 63 个对象全部通过", "E12 检查点保存成功"],
"mistakes": ["细杆尺寸填成 192.5 × 50 × 50", "装配立柱沉到大板下面", "检测台位置与其它工位重叠"],
"exercise": "把细杆直径从 5 改成 8 mm,观察它与大板的相对粗细,再恢复。"
}
}

View File

@@ -0,0 +1,18 @@
// E13: stack light, tool frame and origin marker on top of E12.
import fs from "node:fs";
import path from "node:path";
import { createSceneRunner } from "../../../carrier-course/lib/scene.mjs";
import { buildEpisodeModels } from "../../lib/model-build.mjs";
export async function run({ page, rec, script, stillsDir, rawDir, webRoot }) {
const scene = createSceneRunner({ rec, page, script });
const shot = name => rec.shot(stillsDir, name);
const log = [];
const logStep = entry => {
log.push({ at: new Date().toISOString(), ...entry });
fs.writeFileSync(path.join(rawDir, "live-log.json"), `${JSON.stringify(log, null, 2)}\n`);
};
await scene("S00", async () => { await shot("S00-title"); });
await buildEpisodeModels({ page, rec, webRoot, rawDir, stillsDir, scene, shot, logStep, log,
episodeId: "E13", modelNames: ["StackLight", "ToolFrame", "OriginMarker"] });
}

View File

@@ -0,0 +1,37 @@
{
"schema": "freecad-web-line-course/script/v1",
"episode": "E13",
"title": "三色灯、工具坐标系与原点",
"voice": "zh-CN-XiaoxiaoNeural",
"rate": "-4%",
"scenes": [
{ "id": "S00", "title": "标题", "chapter": "第 13 集 · 指示与坐标", "note": "三色灯 50 × 40 × 468;Tool 72 mm;原点 142 mm", "target": 18,
"narration": "这一集建三色警示灯和两组坐标标记。坐标标记用红绿蓝三色表示 XYZ 轴,是检查坐标轴向最直观的模型。" },
{ "id": "S01", "title": "从 E12 检查点继续", "chapter": "第 1 步 · 63 个对象", "note": "装配与检测已就位", "target": 30,
"narration": "打开 E12 检查点,场景里已有六十三个对象。三色灯在柜体顶部,坐标标记在原点附近。" },
{ "id": "S02", "title": "三色灯底座与灯柱", "chapter": "第 2 步 · 灯 2 件", "note": "底座 50 × 40 × 228;灯柱 R20 × 240,绿色", "target": 100,
"narration": "三色灯先建底座,五十乘四十乘二百二十八。灯柱用 Cylinder,半径二十、高度二百四十,颜色是绿色。灯柱和底座在 Z 方向叠放,总高四百六十八毫米。" },
{ "id": "S03", "title": "Tool 的 X、Y 轴", "chapter": "第 3 步 · 工具坐标 2 件", "note": "X 轴 67.7 × 9 × 9 红色;Y 轴 9 × 67.7 × 9 绿色", "target": 100,
"narration": "工具坐标系的 X 轴是一根红色长条,六十七点七乘九乘九。Y 轴是绿色长条,九乘六十七点七乘九。两根轴在原点相交,长度相同,方向分别沿 X 和 Y。" },
{ "id": "S04", "title": "Tool 的 Z 轴与原点 X、Y", "chapter": "第 4 步 · 圆柱 Z 轴", "note": "Z 轴 R4.5 × 67.7 蓝色;原点 X/Y 轴 132.8 长", "target": 110,
"narration": "Z 轴用 Cylinder,半径四点五、高度六十七点七,蓝色,沿 Z 方向立起来。然后建原点标记,尺寸更大:X 轴一百三十二点八,Y 轴一百三十二点八,同样是红绿两色。" },
{ "id": "S05", "title": "原点 Z 轴与收尾", "chapter": "第 5 步 · 原点 Z 轴", "note": "原点 Z 轴 R8.85 × 132.8 蓝色", "target": 100,
"narration": "原点标记的 Z 轴半径八点八五、高度一百三十二点八,蓝色。三组坐标标记的颜色必须严格是纯红、纯绿、纯蓝,后面验收会逐通道比较。累计对象七十一件。" },
{ "id": "S06", "title": "精度自检与保存", "chapter": "第 6 步 · 71 个对象", "note": "累计 71 个对象通过;保存 E13", "target": 70,
"narration": "保存前检查七十一个对象。重点看三根坐标轴的颜色和长度,以及三色灯是否立在柜顶。通过后保存 E13 检查点。下一集建 ABB 六轴机器人。" }
],
"lesson": {
"objectives": ["用 Cylinder 建立灯柱与 Z 轴", "用纯红/纯绿/纯蓝标记 XYZ 轴", "区分 72 mm 工具坐标与 142 mm 原点标记", "检查圆柱半径与高度"],
"parameters": [
{ "name": "三色灯底座", "value": "50 × 40 × 228 mm" },
{ "name": "三色灯柱", "value": "R20 × 240 mm,绿色" },
{ "name": "Tool X/Y 轴", "value": "67.7 × 9 × 9 mm,红/绿" },
{ "name": "Tool Z 轴", "value": "R4.5 × 67.7 mm,蓝色" },
{ "name": "原点 X/Y 轴", "value": "132.8 × 17.7 × 17.7 mm,红/绿" },
{ "name": "原点 Z 轴", "value": "R8.85 × 132.8 mm,蓝色" }
],
"checklist": ["灯柱半径 20、高度 240", "Tool 三轴长度一致", "原点三轴长度一致", "红绿蓝颜色通道正确", "累计 71 个对象全部通过"],
"mistakes": ["圆柱半径填成直径", "把 Z 轴做成立着的 Box", "红绿蓝设反,X 轴变绿"],
"exercise": "把 Tool 的 Z 轴高度改成 100 mm,观察三轴不再等长,再恢复 67.7。"
}
}

View File

@@ -0,0 +1,18 @@
// E14: ABB IRB 120 (11 parts) on top of E13.
import fs from "node:fs";
import path from "node:path";
import { createSceneRunner } from "../../../carrier-course/lib/scene.mjs";
import { buildEpisodeModels } from "../../lib/model-build.mjs";
export async function run({ page, rec, script, stillsDir, rawDir, webRoot }) {
const scene = createSceneRunner({ rec, page, script });
const shot = name => rec.shot(stillsDir, name);
const log = [];
const logStep = entry => {
log.push({ at: new Date().toISOString(), ...entry });
fs.writeFileSync(path.join(rawDir, "live-log.json"), `${JSON.stringify(log, null, 2)}\n`);
};
await scene("S00", async () => { await shot("S00-title"); });
await buildEpisodeModels({ page, rec, webRoot, rawDir, stillsDir, scene, shot, logStep, log,
episodeId: "E14", modelNames: ["ABB_IRB_120"] });
}

View File

@@ -0,0 +1,41 @@
{
"schema": "freecad-web-line-course/script/v1",
"episode": "E14",
"title": "ABB IRB 120 六轴机器人",
"voice": "zh-CN-XiaoxiaoNeural",
"rate": "-4%",
"scenes": [
{ "id": "S00", "title": "标题", "chapter": "第 14 集 · 机器人", "note": "ABB IRB 120,11 个部件,安装高度 774 mm", "target": 18,
"narration": "这一集建 ABB IRB 120 六轴机器人。参考文件有十七个网格,我们拆成十一个部件,从底座、转座、下臂、上臂,一直到腕部和夹爪。" },
{ "id": "S01", "title": "从 E13 检查点继续", "chapter": "第 1 步 · 71 个对象", "note": "机器人安装在产线左后方", "target": 30,
"narration": "打开 E13 检查点,场景里已有七十一个对象。机器人底座落在七百七十四毫米的安装面上,整机向 Y 方向前伸。" },
{ "id": "S02", "title": "底座与转座", "chapter": "第 2 步 · P01、P02", "note": "底座 214.9 × 217.3 × 177 黑色;转座 123 × 101.2 × 145 不锈钢", "target": 100,
"narration": "先建底座,二百一十四点九乘二百一十七点三乘一百七十七,黑色车漆。再建转座,一百二十三乘一百零一点二乘一百四十五,不锈钢色。转座是机器人第一轴,负责整臂回转。" },
{ "id": "S03", "title": "下臂圆柱", "chapter": "第 3 步 · P03", "note": "圆柱 R109.7 × 431.2,白色", "target": 100,
"narration": "下臂用一个圆柱表示,直径二百一十九点四、高度四百三十一点二,白色。选择 Part 的 Cylinder,半径填一百零九点七,高度填四百三十一点二,再放到参考位置。" },
{ "id": "S04", "title": "上臂与腕部", "chapter": "第 4 步 · P04、P05", "note": "上臂 115.5 × 234 × 188.1;腕部 62 × 110.5 × 82", "target": 100,
"narration": "上臂一百一十五点五乘二百三十四乘一百八十八点一,白色,向 Y 方向伸出。腕部六十二乘一百一十点五乘八十二,在手臂末端。" },
{ "id": "S05", "title": "腕部关节与黑色端板", "chapter": "第 5 步 · P06、P07", "note": "关节 126.9 × 193.5 × 93;端板 95.9 × 5 × 96", "target": 100,
"narration": "腕部关节一百二十六点九乘一百九十三点五乘九十三,白色。黑色端板只有五毫米厚,九十五点九乘九十六,是腕部的法兰面。" },
{ "id": "S06", "title": "夹爪座与夹爪", "chapter": "第 6 步 · P08、P09", "note": "夹爪座 70 × 27.5 × 70 黑色;夹爪 94.3 × 38 × 73.3 白钢", "target": 100,
"narration": "夹爪座七十乘二十七点五乘七十,黑色。夹爪本体九十四点三乘三十八乘七十三点三,白钢色。两件叠在腕部前端。" },
{ "id": "S07", "title": "两片夹指", "chapter": "第 7 步 · P10、P11", "note": "夹指 53.1 × 70 × 40;指尖 29.9 × 53.9 × 34.1", "target": 100,
"narration": "最后两片夹指,大的五十三点一乘七十乘四十,小的二十九点九乘五十三点九乘三十四点一,都是钢色。到这里机器人十一个部件完成,累计八十二个对象。" },
{ "id": "S08", "title": "精度自检与保存", "chapter": "第 8 步 · 82 个对象", "note": "累计 82 个对象通过;保存 E14", "target": 70,
"narration": "保存前检查八十二个对象。机器人的圆柱下臂包围盒应是二百一十九乘二百一十五乘四百三十一,如果直径或高度错,整体高度会明显不对。通过后保存 E14 检查点。" }
],
"lesson": {
"objectives": ["按六轴结构拆分机器人", "用 Cylinder 建立下臂", "区分黑色车漆、不锈钢、白钢三种颜色", "检查圆柱包围盒与整机高度"],
"parameters": [
{ "name": "底座", "value": "214.9 × 217.3 × 177 mm,黑色" },
{ "name": "下臂圆柱", "value": "R109.7 × 431.2 mm,白色" },
{ "name": "上臂", "value": "115.5 × 234 × 188.1 mm" },
{ "name": "腕部黑色端板", "value": "95.9 × 5 × 96 mm" },
{ "name": "夹爪本体", "value": "94.3 × 38 × 73.3 mm,白钢" },
{ "name": "整机高度", "value": "约 700 mm(Z 774–1474)" }
],
"checklist": ["下臂圆柱直径 219.4、高度 431.2", "黑色端板厚度 5 mm", "夹爪两片夹指齐全", "整机 Z 范围 774–1474 mm", "累计 82 个对象全部通过"],
"mistakes": ["圆柱半径填成 219.4(直径)", "下臂高度填成 43.12,机器人缩成一半", "黑色端板和白色腕部颜色设反"],
"exercise": "把下臂圆柱高度减少 50 mm,观察腕部位置下移,再恢复。"
}
}

View File

@@ -0,0 +1,74 @@
// E15: review the ABB work station (no new geometry) on top of E14.
import fs from "node:fs";
import path from "node:path";
import { createSceneRunner } from "../../../carrier-course/lib/scene.mjs";
import { saveCheckpoint } from "../../../carrier-course/lib/ui-actions.mjs";
import { openLineReference, selectReferenceModel, spec } from "../../lib/ui.mjs";
import { checkLineCheckpoint } from "../../lib/line-precision.mjs";
export async function run({ page, rec, script, stillsDir, rawDir, webRoot }) {
const scene = createSceneRunner({ rec, page, script });
const shot = name => rec.shot(stillsDir, name);
const log = [];
const logStep = entry => {
log.push({ at: new Date().toISOString(), ...entry });
fs.writeFileSync(path.join(rawDir, "live-log.json"), `${JSON.stringify(log, null, 2)}\n`);
};
const course = JSON.parse(fs.readFileSync(path.join(webRoot, "tools", "line-course", "course.json"), "utf8"));
const episode = course.episodes.find(item => item.id === "E15");
const expectedNames = episode.checkpointObjects;
await scene("S00", async () => { await shot("S00-title"); });
await scene("S01", async () => {
for (let attempt = 0; attempt < 120; attempt++) {
const labels = await page.locator(".fc-tree-text").allTextContents();
if (labels.filter(label => expectedNames.includes(label)).length >= expectedNames.length) break;
await page.waitForTimeout(500);
}
const labels = await page.locator(".fc-tree-text").allTextContents();
logStep({ step: "checkpoint", objects: labels.length });
if (labels.filter(label => expectedNames.includes(label)).length < expectedNames.length)
throw new Error(`E14 checkpoint incomplete: ${labels.length} labels`);
await shot("S01-checkpoint");
});
await scene("S02", async () => {
const panel = await openLineReference(page);
const robot = await selectReferenceModel(panel, page, "ABB IRB 120 机器人", /0\.22 × 0\.69 × 0\.70/);
const light = await selectReferenceModel(panel, page, "三色警示灯", /0\.05 × 0\.04 × 0\.47/);
const tool = await selectReferenceModel(panel, page, "工具坐标系", /0\.07 × 0\.07 × 0\.07/);
logStep({ step: "reference", robot, light, tool });
await shot("S02-reference");
});
await scene("S03", async () => {
// Orbit the main viewport to inspect the robot from a second angle.
const view = page.locator('[aria-label="Imported native 3D view"]').first();
const box = await view.boundingBox();
if (box) {
const x = box.x + box.width / 2; const y = box.y + box.height / 2;
await page.mouse.move(x, y); await page.mouse.down();
await page.mouse.move(x - 140, y - 40, { steps: 18 }); await page.mouse.up();
await page.waitForTimeout(500);
}
logStep({ step: "review", robot: spec().models.find(model => model.name === "ABB_IRB_120").overallDims });
await shot("S03-robot");
});
await scene("S04", async () => {
const saved = await saveCheckpoint({ page, rec, webRoot, episode: "E15", rawDir,
checkpointDir: path.join(webRoot, "tools", "line-course", "checkpoints"),
expectedLabels: expectedNames });
logStep({ step: "checkpoint", ...saved });
const checkpoint = path.join(webRoot, "tools", "line-course", "checkpoints", "E15.FCStd");
const precision = await checkLineCheckpoint(checkpoint, expectedNames);
fs.writeFileSync(path.join(rawDir, "E15-precision.json"), `${JSON.stringify(precision, null, 2)}\n`);
if (!precision.ok) throw new Error(`precision failed: ${JSON.stringify({ extra: precision.extra,
models: precision.models.filter(item => !item.ok) })}`);
fs.writeFileSync(path.join(rawDir, "E15-state.json"), `${JSON.stringify({
schema: "freecad-web-line-course/E15/state/v1", generatedAt: new Date().toISOString(), precision, log,
}, null, 2)}\n`);
await shot("S04-recap");
});
}

View File

@@ -0,0 +1,31 @@
{
"schema": "freecad-web-line-course/script/v1",
"episode": "E15",
"title": "机器人工作站复核",
"voice": "zh-CN-XiaoxiaoNeural",
"rate": "-4%",
"scenes": [
{ "id": "S00", "title": "标题", "chapter": "第 15 集 · 复核", "note": "不新增模型,复核 ABB、Tool、三色灯与整机位置", "target": 18,
"narration": "这一集不建新模型,专门复核机器人工作站。我们会检查 E14 检查点的八十二个对象,再把机器人、工具坐标和三色灯与参考模型逐一对齐。" },
{ "id": "S01", "title": "打开 E14 检查点", "chapter": "第 1 步 · 82 个对象", "note": "对象树完整才继续", "target": 45,
"narration": "打开 E14 检查点,等对象树加载完成。八十二个对象必须全部出现,缺一个后面总装就会少一件。检查时可以直接数对象树,也可以看属性区的对象计数。" },
{ "id": "S02", "title": "对照三件参考模型", "chapter": "第 2 步 · 参考查看器", "note": "ABB 0.22 × 0.69 × 0.70 m;三色灯 0.05 × 0.04 × 0.47 m;Tool 0.07³ m", "target": 75,
"narration": "打开参考查看器,依次选机器人、三色灯和工具坐标系。机器人包围盒零点二二乘零点六九乘零点七米,三色灯高零点四七米,工具坐标零点零七米见方。把这三个数字与场景里的位置对照。" },
{ "id": "S03", "title": "从第二个角度检查机器人", "chapter": "第 3 步 · 视口复核", "note": "旋转视口,检查底座、下臂、腕部层级", "target": 55,
"narration": "在主视口里旋转到侧面,检查机器人底座是否落在安装面、下臂是否竖直、腕部是否朝向来料方向。图元模型的轮廓是块状的,但层级和包围盒必须与参考一致。" },
{ "id": "S04", "title": "保存复核检查点", "chapter": "第 4 步 · E15", "note": "82 个对象精度通过;保存 E15", "target": 55,
"narration": "保存 E15 检查点,并做全量精度检查。八十二个对象的包围盒、中心和颜色全部通过后,进入最后两集:地面和整线总装。" }
],
"lesson": {
"objectives": ["复核机器人工作站的完整对象集", "用参考查看器核对三件关键模型", "从侧面检查机器人层级", "保存无新增几何的复核检查点"],
"parameters": [
{ "name": "累计对象", "value": "82" },
{ "name": "ABB 包围盒", "value": "219 × 688 × 700 mm" },
{ "name": "三色灯包围盒", "value": "50 × 40 × 468 mm" },
{ "name": "Tool 包围盒", "value": "72 × 72 × 72 mm" }
],
"checklist": ["对象树 82 个对象齐全", "ABB 包围盒与参考一致", "三色灯立在柜顶", "Tool 三轴等长", "E15 检查点保存成功"],
"mistakes": ["检查点未加载完就开始数对象", "把 Tool 的 72 mm 当成 720 mm", "只看了正面,没有检查侧面层级"],
"exercise": "在视口里隐藏地面,单独观察机器人工作站,再恢复显示。"
}
}

View File

@@ -0,0 +1,18 @@
// E16: ground plane and ground lines (3 models, 6 parts) on top of E15.
import fs from "node:fs";
import path from "node:path";
import { createSceneRunner } from "../../../carrier-course/lib/scene.mjs";
import { buildEpisodeModels } from "../../lib/model-build.mjs";
export async function run({ page, rec, script, stillsDir, rawDir, webRoot }) {
const scene = createSceneRunner({ rec, page, script });
const shot = name => rec.shot(stillsDir, name);
const log = [];
const logStep = entry => {
log.push({ at: new Date().toISOString(), ...entry });
fs.writeFileSync(path.join(rawDir, "live-log.json"), `${JSON.stringify(log, null, 2)}\n`);
};
await scene("S00", async () => { await shot("S00-title"); });
await buildEpisodeModels({ page, rec, webRoot, rawDir, stillsDir, scene, shot, logStep, log,
episodeId: "E16", modelNames: ["GroundPlane", "Plane", "Plane001"] });
}

View File

@@ -0,0 +1,33 @@
{
"schema": "freecad-web-line-course/script/v1",
"episode": "E16",
"title": "地面平面与地线",
"voice": "zh-CN-XiaoxiaoNeural",
"rate": "-4%",
"scenes": [
{ "id": "S00", "title": "标题", "chapter": "第 16 集 · 场景", "note": "三块地面,每块 4867 × 3673 × 310 mm", "target": 18,
"narration": "这一集补上场景:三块地面平面,每块由一块大板和一条黄色地线组成。它们尺寸相同、位置不同,正好练习重复模型。" },
{ "id": "S01", "title": "从 E15 检查点继续", "chapter": "第 1 步 · 82 个对象", "note": "机器人工作站复核完成", "target": 30,
"narration": "打开 E15 检查点,场景里已有八十二个对象。地面在整条产线下方,铺满约四点九米乘三点七米的范围。" },
{ "id": "S02", "title": "第一块地面与地线", "chapter": "第 2 步 · GroundPlane 2 件", "note": "大板 4867.5 × 3673.2 × 310.1;地线 4855.3 × 1109.3 × 0.1", "target": 110,
"narration": "第一块地面建大板,四千八百六十七点五乘三千六百七十三点二乘三百一十点一,深灰。再建黄色地线,四千八百五十五点三乘一千一百零九点三乘零点一,几乎是一条零厚度的带子。" },
{ "id": "S03", "title": "第二块地面", "chapter": "第 3 步 · Plane 2 件", "note": "同尺寸,位置偏移", "target": 100,
"narration": "第二块地面尺寸完全相同,位置平移。大板与地线的颜色和第一块一致。复制尺寸时不要复制位置,每块地面都要按参考表单独放。" },
{ "id": "S04", "title": "第三块地面", "chapter": "第 4 步 · Plane001 2 件", "note": "同尺寸,位置同第一块", "target": 100,
"narration": "第三块地面和第一块位置相同,是参考文件里的重复导出。我们仍然按独立模型创建,保证二十七个 GLB 全部有对应对象。累计八十八个对象。" },
{ "id": "S05", "title": "精度自检与保存", "chapter": "第 5 步 · 88 个对象", "note": "27 个模型、88 个部件全部到齐", "target": 75,
"narration": "保存前检查八十八个对象。三块地面的包围盒必须一致,黄色地线的 Z 厚度接近零。通过后保存 E16 检查点,二十七个参考模型全部建完。下一集做整线总装。" }
],
"lesson": {
"objectives": ["建立超大薄板地面", "重复模型但独立定位", "检查 88 个对象全部到齐", "为总装准备完整场景"],
"parameters": [
{ "name": "地面大板", "value": "4867.5 × 3673.2 × 310.1 mm" },
{ "name": "黄色地线", "value": "4855.3 × 1109.3 × 0.1 mm" },
{ "name": "地面模型", "value": "GroundPlane / Plane / Plane001" },
{ "name": "累计对象", "value": "88" }
],
"checklist": ["三块地面尺寸一致", "地线颜色为黄色", "地线 Z 厚度接近 0", "27 个模型 88 个部件全部存在", "E16 检查点保存成功"],
"mistakes": ["复制地面时连位置一起复制,三块重叠", "地线厚度填成 310,变成一堵墙", "漏掉第三块重复地面"],
"exercise": "把第二块地面沿 X 平移 500 mm,观察它与第一块的关系,再恢复。"
}
}

View File

@@ -0,0 +1,45 @@
// E17: create LineAssembly and insert all 88 part links from the E16 checkpoint.
import fs from "node:fs";
import path from "node:path";
import { createSceneRunner } from "../../../carrier-course/lib/scene.mjs";
import { createAssembly, insertLinks } from "../../lib/assembly.mjs";
export async function run({ page, rec, script, stillsDir, rawDir }) {
const scene = createSceneRunner({ rec, page, script });
const shot = name => rec.shot(stillsDir, name);
const log = [];
const logStep = entry => {
log.push({ at: new Date().toISOString(), ...entry });
fs.writeFileSync(path.join(rawDir, "live-log.json"), `${JSON.stringify(log, null, 2)}\n`);
};
let linksTask = null;
let result = null;
await scene("S00", async () => { await shot("S00-title"); });
await scene("S01", async () => {
linksTask = await createAssembly(page, { document: "LineAssembly", label: "生产线总装" });
logStep({ step: "created" });
await shot("S01-assembly");
});
await scene("S02", async () => {
result = await insertLinks(page, linksTask, "line-course-E16.FCStd", 88);
logStep({ step: "inserted", count: result.items.length });
await shot("S02-links");
});
await scene("S03", async () => {
if (result.items.length !== 88) throw new Error(`expected 88 links, got ${result.items.length}`);
logStep({ step: "audit", count: result.items.length });
await shot("S03-audit");
});
await scene("S04", async () => {
fs.writeFileSync(path.join(rawDir, "E17-state.json"), `${JSON.stringify({
schema: "freecad-web-line-course/E17/state/v1", generatedAt: new Date().toISOString(),
links: result.linkNames, log,
}, null, 2)}\n`);
await shot("S04-recap");
});
}

View File

@@ -0,0 +1,31 @@
{
"schema": "freecad-web-line-course/script/v1",
"episode": "E17",
"title": "整线总装",
"voice": "zh-CN-XiaoxiaoNeural",
"rate": "-4%",
"scenes": [
{ "id": "S00", "title": "标题", "chapter": "第 17 集 · 总装", "note": "把 E16 的 88 个部件插入 LineAssembly", "target": 18,
"narration": "这一集做整线总装。E16 检查点里已经有二十七个模型、八十八个部件,我们在 Assembly 工作台里新建总装文档,把它们逐个插入为链接。" },
{ "id": "S01", "title": "新建总装文档", "chapter": "第 1 步 · Create assembly", "note": "文档名 LineAssembly,标签“生产线总装”", "target": 45,
"narration": "打开 Assembly 工作台,新建装配文档,名称填 LineAssembly,标签填生产线总装。总装文档只引用源文档里的对象,不会复制几何,所以模型多了也不会让文件体积暴涨。" },
{ "id": "S02", "title": "插入 88 个部件链接", "chapter": "第 2 步 · Insert link", "note": "源文件 line-course-E16.FCStd;逐件插入", "target": 240,
"narration": "选择源文件 E16,加载源对象,然后逐个插入。八十八个部件会依次出现在已插入列表里。实际操作时可以看到每条链接的父子关系和源对象名。插入完成后点 Accept 确认。" },
{ "id": "S03", "title": "核对链接数量", "chapter": "第 3 步 · 自检", "note": "88 条链接;缺件/重复都要停下来", "target": 70,
"narration": "核对已插入链接的数量,必须是八十八条。少一条说明有部件没被选中,多一条说明重复插入。链接数量对上以后,整线总装就完成了。" },
{ "id": "S04", "title": "本集小结", "chapter": "第 4 步 · 下一步", "note": "总装是查看视图;最终以 E18 主文档交付", "target": 35,
"narration": "这一集完成了整线总装。总装文档用于查看和后续运动仿真,最终交付仍以 E18 的主文档和导出文件为准。下一集做全量精度审计、导出和课程交付。" }
],
"lesson": {
"objectives": ["在 Assembly 工作台新建总装文档", "把 88 个部件插入为链接", "核对链接数量避免缺件/重复", "理解链接装配与复制几何的区别"],
"parameters": [
{ "name": "总装文档", "value": "LineAssembly / 生产线总装" },
{ "name": "源文件", "value": "line-course-E16.FCStd" },
{ "name": "链接数量", "value": "88" },
{ "name": "源对象", "value": "27 个模型 / 88 个部件" }
],
"checklist": ["总装文档创建成功", "源对象列表加载完成", "88 条链接全部插入", "Accept 后链接保留", "没有重复链接"],
"mistakes": ["源文件选错,插入了旧检查点", "只插入一部分就 Accept", "重复点击 Insert 产生重复链接"],
"exercise": "在总装里选择一条链接,查看它的源文档和源对象名。"
}
}

View File

@@ -0,0 +1,91 @@
// E18: full audit, STEP/STL export and E18 checkpoint from the E16 master.
import fs from "node:fs";
import path from "node:path";
import { createSceneRunner } from "../../../carrier-course/lib/scene.mjs";
import { listOpfsFiles } from "../../../carrier-course/lib/opfs.mjs";
import { saveCheckpoint, selectTreeLabel, statusText, treeLabels } from "../../../carrier-course/lib/ui-actions.mjs";
import { checkLineCheckpoint } from "../../lib/line-precision.mjs";
const EXPORTS = "freecad-exports";
export async function run({ page, rec, script, stillsDir, rawDir, webRoot }) {
const scene = createSceneRunner({ rec, page, script });
const shot = name => rec.shot(stillsDir, name);
const log = [];
const logStep = entry => {
log.push({ at: new Date().toISOString(), ...entry });
fs.writeFileSync(path.join(rawDir, "live-log.json"), `${JSON.stringify(log, null, 2)}\n`);
};
const course = JSON.parse(fs.readFileSync(path.join(webRoot, "tools", "line-course", "course.json"), "utf8"));
const expected = course.episodes.find(item => item.id === "E18").checkpointObjects;
const exportsNow = () => listOpfsFiles(page, EXPORTS);
const openFiles = () => page.evaluate(() => {
const details = document.querySelector(".file-tools");
if (details) details.open = true;
});
const exportFormat = async (format, allowFailure = false) => {
const before = await exportsNow();
await page.locator('select[aria-label="Native export format"]').selectOption(format);
await page.waitForTimeout(300);
await rec.clickSelector(page, 'button[aria-label="导出选中对象"]');
let after = before;
for (let attempt = 0; attempt < 40; attempt++) {
await page.waitForTimeout(500);
after = await exportsNow();
if (after.some(name => !before.includes(name))) break;
}
const created = after.filter(name => !before.includes(name));
logStep({ step: "export", format, created, status: await statusText(page) });
if (!created.length && !allowFailure) throw new Error(`export ${format} produced no file`);
return created;
};
await scene("S00", async () => { await shot("S00-title"); });
await scene("S01", async () => {
let labels = [];
for (let attempt = 0; attempt < 120; attempt++) {
await page.waitForTimeout(500);
labels = await treeLabels(page);
if (labels.filter(label => expected.includes(label)).length >= expected.length) break;
}
logStep({ step: "opened", objects: labels.length });
if (labels.filter(label => expected.includes(label)).length < expected.length)
throw new Error(`E16 checkpoint incomplete: ${labels.length}`);
await shot("S01-audit");
});
await scene("S02", async () => {
await selectTreeLabel(page, "CabinetA_P02");
await openFiles();
await page.waitForTimeout(400);
await exportFormat("step");
await exportFormat("stl");
await shot("S02-exports");
});
await scene("S03", async () => {
const saved = await saveCheckpoint({ page, rec, webRoot, episode: "E18", rawDir,
checkpointDir: path.join(webRoot, "tools", "line-course", "checkpoints"), expectedLabels: expected });
logStep({ step: "checkpoint", ...saved });
const precision = await checkLineCheckpoint(path.join(webRoot, "tools", "line-course", "checkpoints", "E18.FCStd"), expected);
fs.writeFileSync(path.join(rawDir, "E18-precision.json"), `${JSON.stringify(precision, null, 2)}\n`);
if (!precision.ok) throw new Error(`precision failed: ${JSON.stringify({ extra: precision.extra,
models: precision.models.filter(item => !item.ok) })}`);
fs.writeFileSync(path.join(webRoot, "tools", "line-course", "evidence", "course.json"), `${JSON.stringify({
schema: "freecad-web-line-course/course-evidence/v1",
generatedAt: new Date().toISOString(),
objects: expected.length, models: precision.models.length,
precisionOk: precision.ok, exports: await exportsNow(), log,
}, null, 2)}\n`);
await shot("S03-recap");
});
await scene("S04", async () => {
fs.writeFileSync(path.join(rawDir, "E18-state.json"), `${JSON.stringify({
schema: "freecad-web-line-course/E18/state/v1", generatedAt: new Date().toISOString(),
labels: await treeLabels(page), exports: await exportsNow(), log,
}, null, 2)}\n`);
await shot("S04-delivery");
});
}

View File

@@ -0,0 +1,33 @@
{
"schema": "freecad-web-line-course/script/v1",
"episode": "E18",
"title": "精度审计与交付",
"voice": "zh-CN-XiaoxiaoNeural",
"rate": "-4%",
"scenes": [
{ "id": "S00", "title": "标题", "chapter": "第 18 集 · 交付", "note": "27 个模型 / 88 个部件全量审计与导出", "target": 18,
"narration": "最后一集做交付。我们打开 E16 主文档,对二十七个模型、八十八个部件做全量精度审计,导出 STEP 和 STL,并保存 E18 交付检查点。" },
{ "id": "S01", "title": "打开主文档并清点", "chapter": "第 1 步 · 88 个对象", "note": "对象树、模型名、部件名逐项核对", "target": 60,
"narration": "打开 E16 主文档,等八十八个对象全部加载。对象树按模型前缀排列:Cabinet、Display、Hopper、Conveyor、Pick、ABB、Ground,一眼能看出每个工位是否齐全。" },
{ "id": "S02", "title": "导出 STEP 与 STL", "chapter": "第 2 步 · 导出", "note": "选中 CabinetA_P02,导出 step 与 stl 到 OPFS", "target": 80,
"narration": "选中主控制柜柜体,打开文件工具,先导出 STEP,再导出 STL。文件会写入 OPFS 的 freecad-exports 目录,不会自动下载到本地。需要本地副本时,再到导出列表里点下载。" },
{ "id": "S03", "title": "全量精度审计与保存", "chapter": "第 3 步 · 审计", "note": "88 件包围盒/中心/颜色;保存 E18", "target": 90,
"narration": "运行全量精度审计:八十八个部件的包围盒误差不超过一点五毫米,中心误差不超过三毫米,颜色每个通道误差不超过零点零二。审计通过后保存 E18 检查点,并写入课程证据。" },
{ "id": "S04", "title": "交付清单", "chapter": "第 4 步 · 收尾", "note": "FCStd + STEP/STL + 课程页 + 交互页", "target": 55,
"narration": "交付内容有四类:E18 检查点 FCStd,导出的 STEP 和 STL,图文课程页,以及整线交互查看页。GLB 原生导出在当前内核仍被拦截,这一点如实记录在缺口文档里,不影响交付。" }
],
"lesson": {
"objectives": ["对 27 个模型 88 个部件做全量审计", "从 UI 导出 STEP/STL 到 OPFS", "保存 E18 交付检查点与证据", "理解 OPFS 与本地下载的边界"],
"parameters": [
{ "name": "模型数", "value": "27" },
{ "name": "部件数", "value": "88" },
{ "name": "部件包围盒容差", "value": "1.5 mm" },
{ "name": "中心容差", "value": "3 mm" },
{ "name": "颜色容差", "value": "每通道 0.02" },
{ "name": "导出目录", "value": "OPFS freecad-exports" }
],
"checklist": ["88 个对象全部加载", "STEP 导出成功", "STL 导出成功", "全量精度审计通过", "E18 检查点与课程证据写入"],
"mistakes": ["未选中对象就点导出,得到空文件", "把 OPFS 文件当成已下载到本地", "审计时只检查新对象,漏掉前面工位"],
"exercise": "在 freecad-exports 列表里找到刚导出的 STEP/STL,记录文件名与大小。"
}
}

View File

@@ -0,0 +1,259 @@
{
"mp4": {
"streams": [
{
"index": 0,
"codec_name": "h264",
"codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
"profile": "High",
"codec_type": "video",
"codec_tag_string": "avc1",
"codec_tag": "0x31637661",
"width": 1600,
"height": 900,
"coded_width": 1600,
"coded_height": 900,
"closed_captions": 0,
"film_grain": 0,
"has_b_frames": 2,
"pix_fmt": "yuv420p",
"level": 42,
"chroma_location": "left",
"field_order": "progressive",
"refs": 1,
"is_avc": "true",
"nal_length_size": "4",
"id": "0x1",
"r_frame_rate": "30/1",
"avg_frame_rate": "30/1",
"time_base": "1/15360",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 3719168,
"duration": "242.133333",
"bit_rate": "267139",
"bits_per_raw_sample": "8",
"nb_frames": "7264",
"extradata_size": 46,
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"language": "und",
"handler_name": "VideoHandler",
"vendor_id": "[0][0][0][0]",
"encoder": "Lavc60.31.102 libx264"
}
},
{
"index": 1,
"codec_name": "aac",
"codec_long_name": "AAC (Advanced Audio Coding)",
"profile": "LC",
"codec_type": "audio",
"codec_tag_string": "mp4a",
"codec_tag": "0x6134706d",
"sample_fmt": "fltp",
"sample_rate": "48000",
"channels": 2,
"channel_layout": "stereo",
"bits_per_sample": 0,
"initial_padding": 0,
"id": "0x2",
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0",
"time_base": "1/48000",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 11625504,
"duration": "242.198000",
"bit_rate": "99482",
"nb_frames": "11355",
"extradata_size": 5,
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"language": "und",
"handler_name": "SoundHandler",
"vendor_id": "[0][0][0][0]"
}
}
],
"format": {
"filename": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E01-ui-and-reference.mp4",
"nb_streams": 2,
"nb_programs": 0,
"format_name": "mov,mp4,m4a,3gp,3g2,mj2",
"format_long_name": "QuickTime / MOV",
"start_time": "0.000000",
"duration": "242.198000",
"size": "11365401",
"bit_rate": "375408",
"probe_score": 100,
"tags": {
"major_brand": "isom",
"minor_version": "512",
"compatible_brands": "isomiso2avc1mp41",
"encoder": "Lavf60.16.100"
}
}
},
"webm": {
"streams": [
{
"index": 0,
"codec_name": "vp9",
"codec_long_name": "Google VP9",
"profile": "Profile 0",
"codec_type": "video",
"codec_tag_string": "[0][0][0][0]",
"codec_tag": "0x0000",
"width": 1600,
"height": 900,
"coded_width": 1600,
"coded_height": 900,
"closed_captions": 0,
"film_grain": 0,
"has_b_frames": 0,
"sample_aspect_ratio": "1:1",
"display_aspect_ratio": "16:9",
"pix_fmt": "yuv420p",
"level": -99,
"color_range": "tv",
"chroma_location": "left",
"field_order": "progressive",
"refs": 1,
"r_frame_rate": "30/1",
"avg_frame_rate": "30/1",
"time_base": "1/1000",
"start_pts": 0,
"start_time": "0.000000",
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"HANDLER_NAME": "VideoHandler",
"VENDOR_ID": "[0][0][0][0]",
"ENCODER": "Lavc60.31.102 libvpx-vp9",
"DURATION": "00:04:02.133000000"
}
},
{
"index": 1,
"codec_name": "opus",
"codec_long_name": "Opus (Opus Interactive Audio Codec)",
"codec_type": "audio",
"codec_tag_string": "[0][0][0][0]",
"codec_tag": "0x0000",
"sample_fmt": "fltp",
"sample_rate": "48000",
"channels": 2,
"channel_layout": "stereo",
"bits_per_sample": 0,
"initial_padding": 312,
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0",
"time_base": "1/1000",
"start_pts": -7,
"start_time": "-0.007000",
"extradata_size": 19,
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"HANDLER_NAME": "SoundHandler",
"VENDOR_ID": "[0][0][0][0]",
"ENCODER": "Lavc60.31.102 libopus",
"DURATION": "00:04:02.226000000"
}
}
],
"format": {
"filename": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E01-ui-and-reference.webm",
"nb_streams": 2,
"nb_programs": 0,
"format_name": "matroska,webm",
"format_long_name": "Matroska / WebM",
"start_time": "-0.007000",
"duration": "242.226000",
"size": "5437171",
"bit_rate": "179573",
"probe_score": 100,
"tags": {
"COMPATIBLE_BRANDS": "isomiso2avc1mp41",
"MAJOR_BRAND": "isom",
"MINOR_VERSION": "512",
"ENCODER": "Lavf60.16.100"
}
}
}
}

View File

@@ -0,0 +1,512 @@
{
"schema": "freecad-web-line-course/video-verification/v1",
"generatedAt": "2026-11-12T20:05:45.261Z",
"episode": "E01",
"title": "界面与产线参考模型",
"status": "passed",
"checks": [
{
"name": "mp4 exists",
"passed": true,
"detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E01-ui-and-reference.mp4"
},
{
"name": "webm exists",
"passed": true,
"detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E01-ui-and-reference.webm"
},
{
"name": "vtt exists",
"passed": true,
"detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E01-ui-and-reference.zh.vtt"
},
{
"name": "srt exists",
"passed": true,
"detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E01-ui-and-reference.zh.srt"
},
{
"name": "poster exists",
"passed": true,
"detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E01-ui-and-reference-poster.png"
},
{
"name": "mp4 h264 1600x900",
"passed": true,
"detail": {
"index": 0,
"codec_name": "h264",
"codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
"profile": "High",
"codec_type": "video",
"codec_tag_string": "avc1",
"codec_tag": "0x31637661",
"width": 1600,
"height": 900,
"coded_width": 1600,
"coded_height": 900,
"closed_captions": 0,
"film_grain": 0,
"has_b_frames": 2,
"pix_fmt": "yuv420p",
"level": 42,
"chroma_location": "left",
"field_order": "progressive",
"refs": 1,
"is_avc": "true",
"nal_length_size": "4",
"id": "0x1",
"r_frame_rate": "30/1",
"avg_frame_rate": "30/1",
"time_base": "1/15360",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 3719168,
"duration": "242.133333",
"bit_rate": "267139",
"bits_per_raw_sample": "8",
"nb_frames": "7264",
"extradata_size": 46,
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"language": "und",
"handler_name": "VideoHandler",
"vendor_id": "[0][0][0][0]",
"encoder": "Lavc60.31.102 libx264"
}
}
},
{
"name": "mp4 aac audio",
"passed": true,
"detail": {
"index": 1,
"codec_name": "aac",
"codec_long_name": "AAC (Advanced Audio Coding)",
"profile": "LC",
"codec_type": "audio",
"codec_tag_string": "mp4a",
"codec_tag": "0x6134706d",
"sample_fmt": "fltp",
"sample_rate": "48000",
"channels": 2,
"channel_layout": "stereo",
"bits_per_sample": 0,
"initial_padding": 0,
"id": "0x2",
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0",
"time_base": "1/48000",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 11625504,
"duration": "242.198000",
"bit_rate": "99482",
"nb_frames": "11355",
"extradata_size": 5,
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"language": "und",
"handler_name": "SoundHandler",
"vendor_id": "[0][0][0][0]"
}
}
},
{
"name": "webm vp9/opus",
"passed": true,
"detail": {
"video": "vp9",
"audio": "opus"
}
},
{
"name": "duration in range",
"passed": true,
"detail": {
"duration": 242.198,
"range": [
180,
480
]
}
},
{
"name": "audio not silent",
"passed": true,
"detail": {
"mean": -25,
"max": -5.3
}
},
{
"name": "vtt cues",
"passed": true,
"detail": 21
},
{
"name": "media HTTP 200",
"passed": true,
"detail": {
"status": 200,
"type": "video/mp4",
"ranges": "bytes"
}
},
{
"name": "media MIME",
"passed": true,
"detail": "video/mp4"
},
{
"name": "media Accept-Ranges",
"passed": true,
"detail": "bytes"
},
{
"name": "media Range 206",
"passed": true,
"detail": 206
},
{
"name": "media bad Range 416",
"passed": true,
"detail": 416
},
{
"name": "session exists",
"passed": true,
"detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/raw/E01/session.json"
},
{
"name": "0 pageErrors",
"passed": true,
"detail": []
},
{
"name": "0 consoleErrors",
"passed": true,
"detail": []
},
{
"name": "stills exist",
"passed": true,
"detail": 6
}
],
"duration": 242.198,
"scenes": [
{
"id": "S00",
"start": 0,
"end": 22.033,
"duration": 22.033,
"narration": 20.16
},
{
"id": "S01",
"start": 22.033,
"end": 67.067,
"duration": 45.033,
"narration": 22.032
},
{
"id": "S02",
"start": 67.067,
"end": 122.1,
"duration": 55.033,
"narration": 25.344
},
{
"id": "S03",
"start": 122.1,
"end": 172.133,
"duration": 50.033,
"narration": 24.648
},
{
"id": "S04",
"start": 172.133,
"end": 217.167,
"duration": 45.033,
"narration": 23.304
},
{
"id": "S05",
"start": 217.167,
"end": 242.2,
"duration": 25.033,
"narration": 16.872
}
],
"cues": 21,
"audio": {
"mean": -25,
"max": -5.3
},
"stills": [
"S00-title.png",
"S01-interface.png",
"S02-reference.png",
"S03-cabinet.png",
"S04-units.png",
"S05-recap.png"
],
"precision": null,
"checkpoint": null,
"mp4": {
"video": {
"index": 0,
"codec_name": "h264",
"codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
"profile": "High",
"codec_type": "video",
"codec_tag_string": "avc1",
"codec_tag": "0x31637661",
"width": 1600,
"height": 900,
"coded_width": 1600,
"coded_height": 900,
"closed_captions": 0,
"film_grain": 0,
"has_b_frames": 2,
"pix_fmt": "yuv420p",
"level": 42,
"chroma_location": "left",
"field_order": "progressive",
"refs": 1,
"is_avc": "true",
"nal_length_size": "4",
"id": "0x1",
"r_frame_rate": "30/1",
"avg_frame_rate": "30/1",
"time_base": "1/15360",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 3719168,
"duration": "242.133333",
"bit_rate": "267139",
"bits_per_raw_sample": "8",
"nb_frames": "7264",
"extradata_size": 46,
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"language": "und",
"handler_name": "VideoHandler",
"vendor_id": "[0][0][0][0]",
"encoder": "Lavc60.31.102 libx264"
}
},
"audio": {
"index": 1,
"codec_name": "aac",
"codec_long_name": "AAC (Advanced Audio Coding)",
"profile": "LC",
"codec_type": "audio",
"codec_tag_string": "mp4a",
"codec_tag": "0x6134706d",
"sample_fmt": "fltp",
"sample_rate": "48000",
"channels": 2,
"channel_layout": "stereo",
"bits_per_sample": 0,
"initial_padding": 0,
"id": "0x2",
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0",
"time_base": "1/48000",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 11625504,
"duration": "242.198000",
"bit_rate": "99482",
"nb_frames": "11355",
"extradata_size": 5,
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"language": "und",
"handler_name": "SoundHandler",
"vendor_id": "[0][0][0][0]"
}
}
},
"webm": {
"video": {
"index": 0,
"codec_name": "vp9",
"codec_long_name": "Google VP9",
"profile": "Profile 0",
"codec_type": "video",
"codec_tag_string": "[0][0][0][0]",
"codec_tag": "0x0000",
"width": 1600,
"height": 900,
"coded_width": 1600,
"coded_height": 900,
"closed_captions": 0,
"film_grain": 0,
"has_b_frames": 0,
"sample_aspect_ratio": "1:1",
"display_aspect_ratio": "16:9",
"pix_fmt": "yuv420p",
"level": -99,
"color_range": "tv",
"chroma_location": "left",
"field_order": "progressive",
"refs": 1,
"r_frame_rate": "30/1",
"avg_frame_rate": "30/1",
"time_base": "1/1000",
"start_pts": 0,
"start_time": "0.000000",
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"HANDLER_NAME": "VideoHandler",
"VENDOR_ID": "[0][0][0][0]",
"ENCODER": "Lavc60.31.102 libvpx-vp9",
"DURATION": "00:04:02.133000000"
}
},
"audio": {
"index": 1,
"codec_name": "opus",
"codec_long_name": "Opus (Opus Interactive Audio Codec)",
"codec_type": "audio",
"codec_tag_string": "[0][0][0][0]",
"codec_tag": "0x0000",
"sample_fmt": "fltp",
"sample_rate": "48000",
"channels": 2,
"channel_layout": "stereo",
"bits_per_sample": 0,
"initial_padding": 312,
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0",
"time_base": "1/1000",
"start_pts": -7,
"start_time": "-0.007000",
"extradata_size": 19,
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"HANDLER_NAME": "SoundHandler",
"VENDOR_ID": "[0][0][0][0]",
"ENCODER": "Lavc60.31.102 libopus",
"DURATION": "00:04:02.226000000"
}
}
}
}

View File

@@ -0,0 +1,259 @@
{
"mp4": {
"streams": [
{
"index": 0,
"codec_name": "h264",
"codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
"profile": "High",
"codec_type": "video",
"codec_tag_string": "avc1",
"codec_tag": "0x31637661",
"width": 1600,
"height": 900,
"coded_width": 1600,
"coded_height": 900,
"closed_captions": 0,
"film_grain": 0,
"has_b_frames": 2,
"pix_fmt": "yuv420p",
"level": 42,
"chroma_location": "left",
"field_order": "progressive",
"refs": 1,
"is_avc": "true",
"nal_length_size": "4",
"id": "0x1",
"r_frame_rate": "30/1",
"avg_frame_rate": "30/1",
"time_base": "1/15360",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 4017664,
"duration": "261.566667",
"bit_rate": "492427",
"bits_per_raw_sample": "8",
"nb_frames": "7847",
"extradata_size": 46,
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"language": "und",
"handler_name": "VideoHandler",
"vendor_id": "[0][0][0][0]",
"encoder": "Lavc60.31.102 libx264"
}
},
{
"index": 1,
"codec_name": "aac",
"codec_long_name": "AAC (Advanced Audio Coding)",
"profile": "LC",
"codec_type": "audio",
"codec_tag_string": "mp4a",
"codec_tag": "0x6134706d",
"sample_fmt": "fltp",
"sample_rate": "48000",
"channels": 2,
"channel_layout": "stereo",
"bits_per_sample": 0,
"initial_padding": 0,
"id": "0x2",
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0",
"time_base": "1/48000",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 12558336,
"duration": "261.632000",
"bit_rate": "81042",
"nb_frames": "12265",
"extradata_size": 5,
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"language": "und",
"handler_name": "SoundHandler",
"vendor_id": "[0][0][0][0]"
}
}
],
"format": {
"filename": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E02-measure-and-spec.mp4",
"nb_streams": 2,
"nb_programs": 0,
"format_name": "mov,mp4,m4a,3gp,3g2,mj2",
"format_long_name": "QuickTime / MOV",
"start_time": "0.000000",
"duration": "261.632000",
"size": "19039999",
"bit_rate": "582191",
"probe_score": 100,
"tags": {
"major_brand": "isom",
"minor_version": "512",
"compatible_brands": "isomiso2avc1mp41",
"encoder": "Lavf60.16.100"
}
}
},
"webm": {
"streams": [
{
"index": 0,
"codec_name": "vp9",
"codec_long_name": "Google VP9",
"profile": "Profile 0",
"codec_type": "video",
"codec_tag_string": "[0][0][0][0]",
"codec_tag": "0x0000",
"width": 1600,
"height": 900,
"coded_width": 1600,
"coded_height": 900,
"closed_captions": 0,
"film_grain": 0,
"has_b_frames": 0,
"sample_aspect_ratio": "1:1",
"display_aspect_ratio": "16:9",
"pix_fmt": "yuv420p",
"level": -99,
"color_range": "tv",
"chroma_location": "left",
"field_order": "progressive",
"refs": 1,
"r_frame_rate": "30/1",
"avg_frame_rate": "30/1",
"time_base": "1/1000",
"start_pts": 0,
"start_time": "0.000000",
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"HANDLER_NAME": "VideoHandler",
"VENDOR_ID": "[0][0][0][0]",
"ENCODER": "Lavc60.31.102 libvpx-vp9",
"DURATION": "00:04:21.566000000"
}
},
{
"index": 1,
"codec_name": "opus",
"codec_long_name": "Opus (Opus Interactive Audio Codec)",
"codec_type": "audio",
"codec_tag_string": "[0][0][0][0]",
"codec_tag": "0x0000",
"sample_fmt": "fltp",
"sample_rate": "48000",
"channels": 2,
"channel_layout": "stereo",
"bits_per_sample": 0,
"initial_padding": 312,
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0",
"time_base": "1/1000",
"start_pts": -7,
"start_time": "-0.007000",
"extradata_size": 19,
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"HANDLER_NAME": "SoundHandler",
"VENDOR_ID": "[0][0][0][0]",
"ENCODER": "Lavc60.31.102 libopus",
"DURATION": "00:04:21.640000000"
}
}
],
"format": {
"filename": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E02-measure-and-spec.webm",
"nb_streams": 2,
"nb_programs": 0,
"format_name": "matroska,webm",
"format_long_name": "Matroska / WebM",
"start_time": "-0.007000",
"duration": "261.640000",
"size": "9592905",
"bit_rate": "293316",
"probe_score": 100,
"tags": {
"COMPATIBLE_BRANDS": "isomiso2avc1mp41",
"MAJOR_BRAND": "isom",
"MINOR_VERSION": "512",
"ENCODER": "Lavf60.16.100"
}
}
}
}

View File

@@ -0,0 +1,512 @@
{
"schema": "freecad-web-line-course/video-verification/v1",
"generatedAt": "2026-11-12T19:14:53.728Z",
"episode": "E02",
"title": "测量、单位与零件表",
"status": "passed",
"checks": [
{
"name": "mp4 exists",
"passed": true,
"detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E02-measure-and-spec.mp4"
},
{
"name": "webm exists",
"passed": true,
"detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E02-measure-and-spec.webm"
},
{
"name": "vtt exists",
"passed": true,
"detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E02-measure-and-spec.zh.vtt"
},
{
"name": "srt exists",
"passed": true,
"detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E02-measure-and-spec.zh.srt"
},
{
"name": "poster exists",
"passed": true,
"detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E02-measure-and-spec-poster.png"
},
{
"name": "mp4 h264 1600x900",
"passed": true,
"detail": {
"index": 0,
"codec_name": "h264",
"codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
"profile": "High",
"codec_type": "video",
"codec_tag_string": "avc1",
"codec_tag": "0x31637661",
"width": 1600,
"height": 900,
"coded_width": 1600,
"coded_height": 900,
"closed_captions": 0,
"film_grain": 0,
"has_b_frames": 2,
"pix_fmt": "yuv420p",
"level": 42,
"chroma_location": "left",
"field_order": "progressive",
"refs": 1,
"is_avc": "true",
"nal_length_size": "4",
"id": "0x1",
"r_frame_rate": "30/1",
"avg_frame_rate": "30/1",
"time_base": "1/15360",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 4017664,
"duration": "261.566667",
"bit_rate": "492427",
"bits_per_raw_sample": "8",
"nb_frames": "7847",
"extradata_size": 46,
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"language": "und",
"handler_name": "VideoHandler",
"vendor_id": "[0][0][0][0]",
"encoder": "Lavc60.31.102 libx264"
}
}
},
{
"name": "mp4 aac audio",
"passed": true,
"detail": {
"index": 1,
"codec_name": "aac",
"codec_long_name": "AAC (Advanced Audio Coding)",
"profile": "LC",
"codec_type": "audio",
"codec_tag_string": "mp4a",
"codec_tag": "0x6134706d",
"sample_fmt": "fltp",
"sample_rate": "48000",
"channels": 2,
"channel_layout": "stereo",
"bits_per_sample": 0,
"initial_padding": 0,
"id": "0x2",
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0",
"time_base": "1/48000",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 12558336,
"duration": "261.632000",
"bit_rate": "81042",
"nb_frames": "12265",
"extradata_size": 5,
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"language": "und",
"handler_name": "SoundHandler",
"vendor_id": "[0][0][0][0]"
}
}
},
{
"name": "webm vp9/opus",
"passed": true,
"detail": {
"video": "vp9",
"audio": "opus"
}
},
{
"name": "duration in range",
"passed": true,
"detail": {
"duration": 261.632,
"range": [
180,
480
]
}
},
{
"name": "audio not silent",
"passed": true,
"detail": {
"mean": -26.1,
"max": -5.3
}
},
{
"name": "vtt cues",
"passed": true,
"detail": 18
},
{
"name": "media HTTP 200",
"passed": true,
"detail": {
"status": 200,
"type": "video/mp4",
"ranges": "bytes"
}
},
{
"name": "media MIME",
"passed": true,
"detail": "video/mp4"
},
{
"name": "media Accept-Ranges",
"passed": true,
"detail": "bytes"
},
{
"name": "media Range 206",
"passed": true,
"detail": 206
},
{
"name": "media bad Range 416",
"passed": true,
"detail": 416
},
{
"name": "session exists",
"passed": true,
"detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/raw/E02/session.json"
},
{
"name": "0 pageErrors",
"passed": true,
"detail": []
},
{
"name": "0 consoleErrors",
"passed": true,
"detail": []
},
{
"name": "stills exist",
"passed": true,
"detail": 6
}
],
"duration": 261.632,
"scenes": [
{
"id": "S00",
"start": 0,
"end": 18.033,
"duration": 18.033,
"narration": 13.848
},
{
"id": "S01",
"start": 18.033,
"end": 58.067,
"duration": 40.033,
"narration": 18.744
},
{
"id": "S02",
"start": 58.067,
"end": 146.533,
"duration": 88.467,
"narration": 29.472
},
{
"id": "S03",
"start": 146.533,
"end": 201.567,
"duration": 55.033,
"narration": 20.424
},
{
"id": "S04",
"start": 201.567,
"end": 236.6,
"duration": 35.033,
"narration": 17.904
},
{
"id": "S05",
"start": 236.6,
"end": 261.633,
"duration": 25.033,
"narration": 15.192
}
],
"cues": 18,
"audio": {
"mean": -26.1,
"max": -5.3
},
"stills": [
"S00-title.png",
"S01-reference.png",
"S02-table.png",
"S03-formula.png",
"S04-audit.png",
"S05-recap.png"
],
"precision": null,
"checkpoint": null,
"mp4": {
"video": {
"index": 0,
"codec_name": "h264",
"codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
"profile": "High",
"codec_type": "video",
"codec_tag_string": "avc1",
"codec_tag": "0x31637661",
"width": 1600,
"height": 900,
"coded_width": 1600,
"coded_height": 900,
"closed_captions": 0,
"film_grain": 0,
"has_b_frames": 2,
"pix_fmt": "yuv420p",
"level": 42,
"chroma_location": "left",
"field_order": "progressive",
"refs": 1,
"is_avc": "true",
"nal_length_size": "4",
"id": "0x1",
"r_frame_rate": "30/1",
"avg_frame_rate": "30/1",
"time_base": "1/15360",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 4017664,
"duration": "261.566667",
"bit_rate": "492427",
"bits_per_raw_sample": "8",
"nb_frames": "7847",
"extradata_size": 46,
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"language": "und",
"handler_name": "VideoHandler",
"vendor_id": "[0][0][0][0]",
"encoder": "Lavc60.31.102 libx264"
}
},
"audio": {
"index": 1,
"codec_name": "aac",
"codec_long_name": "AAC (Advanced Audio Coding)",
"profile": "LC",
"codec_type": "audio",
"codec_tag_string": "mp4a",
"codec_tag": "0x6134706d",
"sample_fmt": "fltp",
"sample_rate": "48000",
"channels": 2,
"channel_layout": "stereo",
"bits_per_sample": 0,
"initial_padding": 0,
"id": "0x2",
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0",
"time_base": "1/48000",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 12558336,
"duration": "261.632000",
"bit_rate": "81042",
"nb_frames": "12265",
"extradata_size": 5,
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"language": "und",
"handler_name": "SoundHandler",
"vendor_id": "[0][0][0][0]"
}
}
},
"webm": {
"video": {
"index": 0,
"codec_name": "vp9",
"codec_long_name": "Google VP9",
"profile": "Profile 0",
"codec_type": "video",
"codec_tag_string": "[0][0][0][0]",
"codec_tag": "0x0000",
"width": 1600,
"height": 900,
"coded_width": 1600,
"coded_height": 900,
"closed_captions": 0,
"film_grain": 0,
"has_b_frames": 0,
"sample_aspect_ratio": "1:1",
"display_aspect_ratio": "16:9",
"pix_fmt": "yuv420p",
"level": -99,
"color_range": "tv",
"chroma_location": "left",
"field_order": "progressive",
"refs": 1,
"r_frame_rate": "30/1",
"avg_frame_rate": "30/1",
"time_base": "1/1000",
"start_pts": 0,
"start_time": "0.000000",
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"HANDLER_NAME": "VideoHandler",
"VENDOR_ID": "[0][0][0][0]",
"ENCODER": "Lavc60.31.102 libvpx-vp9",
"DURATION": "00:04:21.566000000"
}
},
"audio": {
"index": 1,
"codec_name": "opus",
"codec_long_name": "Opus (Opus Interactive Audio Codec)",
"codec_type": "audio",
"codec_tag_string": "[0][0][0][0]",
"codec_tag": "0x0000",
"sample_fmt": "fltp",
"sample_rate": "48000",
"channels": 2,
"channel_layout": "stereo",
"bits_per_sample": 0,
"initial_padding": 312,
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0",
"time_base": "1/1000",
"start_pts": -7,
"start_time": "-0.007000",
"extradata_size": 19,
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"HANDLER_NAME": "SoundHandler",
"VENDOR_ID": "[0][0][0][0]",
"ENCODER": "Lavc60.31.102 libopus",
"DURATION": "00:04:21.640000000"
}
}
}
}

View File

@@ -0,0 +1,259 @@
{
"mp4": {
"streams": [
{
"index": 0,
"codec_name": "h264",
"codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
"profile": "High",
"codec_type": "video",
"codec_tag_string": "avc1",
"codec_tag": "0x31637661",
"width": 1600,
"height": 900,
"coded_width": 1600,
"coded_height": 900,
"closed_captions": 0,
"film_grain": 0,
"has_b_frames": 2,
"pix_fmt": "yuv420p",
"level": 42,
"chroma_location": "left",
"field_order": "progressive",
"refs": 1,
"is_avc": "true",
"nal_length_size": "4",
"id": "0x1",
"r_frame_rate": "30/1",
"avg_frame_rate": "30/1",
"time_base": "1/15360",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 8023552,
"duration": "522.366667",
"bit_rate": "363911",
"bits_per_raw_sample": "8",
"nb_frames": "15671",
"extradata_size": 46,
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"language": "und",
"handler_name": "VideoHandler",
"vendor_id": "[0][0][0][0]",
"encoder": "Lavc60.31.102 libx264"
}
},
{
"index": 1,
"codec_name": "aac",
"codec_long_name": "AAC (Advanced Audio Coding)",
"profile": "LC",
"codec_type": "audio",
"codec_tag_string": "mp4a",
"codec_tag": "0x6134706d",
"sample_fmt": "fltp",
"sample_rate": "48000",
"channels": 2,
"channel_layout": "stereo",
"bits_per_sample": 0,
"initial_padding": 0,
"id": "0x2",
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0",
"time_base": "1/48000",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 25072608,
"duration": "522.346000",
"bit_rate": "46149",
"nb_frames": "24486",
"extradata_size": 5,
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"language": "und",
"handler_name": "SoundHandler",
"vendor_id": "[0][0][0][0]"
}
}
],
"format": {
"filename": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E03-cabinet-a.mp4",
"nb_streams": 2,
"nb_programs": 0,
"format_name": "mov,mp4,m4a,3gp,3g2,mj2",
"format_long_name": "QuickTime / MOV",
"start_time": "0.000000",
"duration": "522.366667",
"size": "27350199",
"bit_rate": "418865",
"probe_score": 100,
"tags": {
"major_brand": "isom",
"minor_version": "512",
"compatible_brands": "isomiso2avc1mp41",
"encoder": "Lavf60.16.100"
}
}
},
"webm": {
"streams": [
{
"index": 0,
"codec_name": "vp9",
"codec_long_name": "Google VP9",
"profile": "Profile 0",
"codec_type": "video",
"codec_tag_string": "[0][0][0][0]",
"codec_tag": "0x0000",
"width": 1600,
"height": 900,
"coded_width": 1600,
"coded_height": 900,
"closed_captions": 0,
"film_grain": 0,
"has_b_frames": 0,
"sample_aspect_ratio": "1:1",
"display_aspect_ratio": "16:9",
"pix_fmt": "yuv420p",
"level": -99,
"color_range": "tv",
"chroma_location": "left",
"field_order": "progressive",
"refs": 1,
"r_frame_rate": "30/1",
"avg_frame_rate": "30/1",
"time_base": "1/1000",
"start_pts": 0,
"start_time": "0.000000",
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"HANDLER_NAME": "VideoHandler",
"VENDOR_ID": "[0][0][0][0]",
"ENCODER": "Lavc60.31.102 libvpx-vp9",
"DURATION": "00:08:42.366000000"
}
},
{
"index": 1,
"codec_name": "opus",
"codec_long_name": "Opus (Opus Interactive Audio Codec)",
"codec_type": "audio",
"codec_tag_string": "[0][0][0][0]",
"codec_tag": "0x0000",
"sample_fmt": "fltp",
"sample_rate": "48000",
"channels": 2,
"channel_layout": "stereo",
"bits_per_sample": 0,
"initial_padding": 312,
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0",
"time_base": "1/1000",
"start_pts": -7,
"start_time": "-0.007000",
"extradata_size": 19,
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"HANDLER_NAME": "SoundHandler",
"VENDOR_ID": "[0][0][0][0]",
"ENCODER": "Lavc60.31.102 libopus",
"DURATION": "00:08:42.354000000"
}
}
],
"format": {
"filename": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E03-cabinet-a.webm",
"nb_streams": 2,
"nb_programs": 0,
"format_name": "matroska,webm",
"format_long_name": "Matroska / WebM",
"start_time": "-0.007000",
"duration": "522.366000",
"size": "14954458",
"bit_rate": "229026",
"probe_score": 100,
"tags": {
"COMPATIBLE_BRANDS": "isomiso2avc1mp41",
"MAJOR_BRAND": "isom",
"MINOR_VERSION": "512",
"ENCODER": "Lavf60.16.100"
}
}
}
}

View File

@@ -0,0 +1,615 @@
{
"schema": "freecad-web-line-course/video-verification/v1",
"generatedAt": "2026-11-12T19:36:51.981Z",
"episode": "E03",
"title": "主控制柜",
"status": "passed",
"checks": [
{
"name": "mp4 exists",
"passed": true,
"detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E03-cabinet-a.mp4"
},
{
"name": "webm exists",
"passed": true,
"detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E03-cabinet-a.webm"
},
{
"name": "vtt exists",
"passed": true,
"detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E03-cabinet-a.zh.vtt"
},
{
"name": "srt exists",
"passed": true,
"detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E03-cabinet-a.zh.srt"
},
{
"name": "poster exists",
"passed": true,
"detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E03-cabinet-a-poster.png"
},
{
"name": "mp4 h264 1600x900",
"passed": true,
"detail": {
"index": 0,
"codec_name": "h264",
"codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
"profile": "High",
"codec_type": "video",
"codec_tag_string": "avc1",
"codec_tag": "0x31637661",
"width": 1600,
"height": 900,
"coded_width": 1600,
"coded_height": 900,
"closed_captions": 0,
"film_grain": 0,
"has_b_frames": 2,
"pix_fmt": "yuv420p",
"level": 42,
"chroma_location": "left",
"field_order": "progressive",
"refs": 1,
"is_avc": "true",
"nal_length_size": "4",
"id": "0x1",
"r_frame_rate": "30/1",
"avg_frame_rate": "30/1",
"time_base": "1/15360",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 8023552,
"duration": "522.366667",
"bit_rate": "363911",
"bits_per_raw_sample": "8",
"nb_frames": "15671",
"extradata_size": 46,
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"language": "und",
"handler_name": "VideoHandler",
"vendor_id": "[0][0][0][0]",
"encoder": "Lavc60.31.102 libx264"
}
}
},
{
"name": "mp4 aac audio",
"passed": true,
"detail": {
"index": 1,
"codec_name": "aac",
"codec_long_name": "AAC (Advanced Audio Coding)",
"profile": "LC",
"codec_type": "audio",
"codec_tag_string": "mp4a",
"codec_tag": "0x6134706d",
"sample_fmt": "fltp",
"sample_rate": "48000",
"channels": 2,
"channel_layout": "stereo",
"bits_per_sample": 0,
"initial_padding": 0,
"id": "0x2",
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0",
"time_base": "1/48000",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 25072608,
"duration": "522.346000",
"bit_rate": "46149",
"nb_frames": "24486",
"extradata_size": 5,
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"language": "und",
"handler_name": "SoundHandler",
"vendor_id": "[0][0][0][0]"
}
}
},
{
"name": "webm vp9/opus",
"passed": true,
"detail": {
"video": "vp9",
"audio": "opus"
}
},
{
"name": "duration in range",
"passed": true,
"detail": {
"duration": 522.366667,
"range": [
300,
900
]
}
},
{
"name": "audio not silent",
"passed": true,
"detail": {
"mean": -28.7,
"max": -4.4
}
},
{
"name": "vtt cues",
"passed": true,
"detail": 20
},
{
"name": "media HTTP 200",
"passed": true,
"detail": {
"status": 200,
"type": "video/mp4",
"ranges": "bytes"
}
},
{
"name": "media MIME",
"passed": true,
"detail": "video/mp4"
},
{
"name": "media Accept-Ranges",
"passed": true,
"detail": "bytes"
},
{
"name": "media Range 206",
"passed": true,
"detail": 206
},
{
"name": "media bad Range 416",
"passed": true,
"detail": 416
},
{
"name": "session exists",
"passed": true,
"detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/raw/E03/session.json"
},
{
"name": "0 pageErrors",
"passed": true,
"detail": []
},
{
"name": "0 consoleErrors",
"passed": true,
"detail": []
},
{
"name": "stills exist",
"passed": true,
"detail": 7
},
{
"name": "checkpoint exists",
"passed": true,
"detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/checkpoints/E03.FCStd"
},
{
"name": "precision profile",
"passed": true,
"detail": {
"objectCount": 8,
"extra": [],
"models": [],
"failures": []
}
}
],
"duration": 522.366667,
"scenes": [
{
"id": "S00",
"start": 0,
"end": 22.033,
"duration": 22.033,
"narration": 20.088
},
{
"id": "S01",
"start": 22.033,
"end": 52.067,
"duration": 30.033,
"narration": 11.544
},
{
"id": "S02",
"start": 52.067,
"end": 152.1,
"duration": 100.033,
"narration": 22.8
},
{
"id": "S03",
"start": 152.1,
"end": 252.167,
"duration": 100.067,
"narration": 20.88
},
{
"id": "S04",
"start": 252.167,
"end": 352.233,
"duration": 100.067,
"narration": 16.896
},
{
"id": "S05",
"start": 352.233,
"end": 452.3,
"duration": 100.067,
"narration": 16.632
},
{
"id": "S06",
"start": 452.3,
"end": 522.367,
"duration": 70.067,
"narration": 19.968
}
],
"cues": 20,
"audio": {
"mean": -28.7,
"max": -4.4
},
"stills": [
"S00-title.png",
"S01-document.png",
"S02-parts.png",
"S03-parts.png",
"S04-parts.png",
"S05-parts.png",
"S06-recap.png"
],
"precision": {
"schema": "freecad-web-line-course/precision/v1",
"objectCount": 8,
"extra": [],
"results": [
{
"name": "CabinetA_P01",
"label": "主控制柜 部件 1",
"model": "CabinetA",
"tolerance": 1.5,
"ok": true,
"issues": []
},
{
"name": "CabinetA_P02",
"label": "主控制柜 部件 2",
"model": "CabinetA",
"tolerance": 1.5,
"ok": true,
"issues": []
},
{
"name": "CabinetA_P03",
"label": "主控制柜 部件 3",
"model": "CabinetA",
"tolerance": 1.5,
"ok": true,
"issues": []
},
{
"name": "CabinetA_P04",
"label": "ZX-JX02-02-02A______________¹___001",
"model": "CabinetA",
"tolerance": 1.5,
"ok": true,
"issues": []
},
{
"name": "CabinetA_P05",
"label": "ZX-JX02-02-03____²_______________¹___097",
"model": "CabinetA",
"tolerance": 1.5,
"ok": true,
"issues": []
},
{
"name": "CabinetA_P06",
"label": "ZX-JX02-02-03____²_______________¹___105",
"model": "CabinetA",
"tolerance": 1.5,
"ok": true,
"issues": []
},
{
"name": "CabinetA_P07",
"label": "ZX-JX02-02-80______013",
"model": "CabinetA",
"tolerance": 1.5,
"ok": true,
"issues": []
},
{
"name": "CabinetA_P08",
"label": "ZX-JX02-02-80______015",
"model": "CabinetA",
"tolerance": 1.5,
"ok": true,
"issues": []
}
],
"models": [
{
"name": "CabinetA",
"label": "主控制柜",
"parts": 8,
"ok": true,
"issues": []
}
],
"ok": true
},
"checkpoint": "checkpoints/E03.FCStd",
"mp4": {
"video": {
"index": 0,
"codec_name": "h264",
"codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
"profile": "High",
"codec_type": "video",
"codec_tag_string": "avc1",
"codec_tag": "0x31637661",
"width": 1600,
"height": 900,
"coded_width": 1600,
"coded_height": 900,
"closed_captions": 0,
"film_grain": 0,
"has_b_frames": 2,
"pix_fmt": "yuv420p",
"level": 42,
"chroma_location": "left",
"field_order": "progressive",
"refs": 1,
"is_avc": "true",
"nal_length_size": "4",
"id": "0x1",
"r_frame_rate": "30/1",
"avg_frame_rate": "30/1",
"time_base": "1/15360",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 8023552,
"duration": "522.366667",
"bit_rate": "363911",
"bits_per_raw_sample": "8",
"nb_frames": "15671",
"extradata_size": 46,
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"language": "und",
"handler_name": "VideoHandler",
"vendor_id": "[0][0][0][0]",
"encoder": "Lavc60.31.102 libx264"
}
},
"audio": {
"index": 1,
"codec_name": "aac",
"codec_long_name": "AAC (Advanced Audio Coding)",
"profile": "LC",
"codec_type": "audio",
"codec_tag_string": "mp4a",
"codec_tag": "0x6134706d",
"sample_fmt": "fltp",
"sample_rate": "48000",
"channels": 2,
"channel_layout": "stereo",
"bits_per_sample": 0,
"initial_padding": 0,
"id": "0x2",
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0",
"time_base": "1/48000",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 25072608,
"duration": "522.346000",
"bit_rate": "46149",
"nb_frames": "24486",
"extradata_size": 5,
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"language": "und",
"handler_name": "SoundHandler",
"vendor_id": "[0][0][0][0]"
}
}
},
"webm": {
"video": {
"index": 0,
"codec_name": "vp9",
"codec_long_name": "Google VP9",
"profile": "Profile 0",
"codec_type": "video",
"codec_tag_string": "[0][0][0][0]",
"codec_tag": "0x0000",
"width": 1600,
"height": 900,
"coded_width": 1600,
"coded_height": 900,
"closed_captions": 0,
"film_grain": 0,
"has_b_frames": 0,
"sample_aspect_ratio": "1:1",
"display_aspect_ratio": "16:9",
"pix_fmt": "yuv420p",
"level": -99,
"color_range": "tv",
"chroma_location": "left",
"field_order": "progressive",
"refs": 1,
"r_frame_rate": "30/1",
"avg_frame_rate": "30/1",
"time_base": "1/1000",
"start_pts": 0,
"start_time": "0.000000",
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"HANDLER_NAME": "VideoHandler",
"VENDOR_ID": "[0][0][0][0]",
"ENCODER": "Lavc60.31.102 libvpx-vp9",
"DURATION": "00:08:42.366000000"
}
},
"audio": {
"index": 1,
"codec_name": "opus",
"codec_long_name": "Opus (Opus Interactive Audio Codec)",
"codec_type": "audio",
"codec_tag_string": "[0][0][0][0]",
"codec_tag": "0x0000",
"sample_fmt": "fltp",
"sample_rate": "48000",
"channels": 2,
"channel_layout": "stereo",
"bits_per_sample": 0,
"initial_padding": 312,
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0",
"time_base": "1/1000",
"start_pts": -7,
"start_time": "-0.007000",
"extradata_size": 19,
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"HANDLER_NAME": "SoundHandler",
"VENDOR_ID": "[0][0][0][0]",
"ENCODER": "Lavc60.31.102 libopus",
"DURATION": "00:08:42.354000000"
}
}
}
}

View File

@@ -0,0 +1,259 @@
{
"mp4": {
"streams": [
{
"index": 0,
"codec_name": "h264",
"codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
"profile": "High",
"codec_type": "video",
"codec_tag_string": "avc1",
"codec_tag": "0x31637661",
"width": 1600,
"height": 900,
"coded_width": 1600,
"coded_height": 900,
"closed_captions": 0,
"film_grain": 0,
"has_b_frames": 2,
"pix_fmt": "yuv420p",
"level": 42,
"chroma_location": "left",
"field_order": "progressive",
"refs": 1,
"is_avc": "true",
"nal_length_size": "4",
"id": "0x1",
"r_frame_rate": "30/1",
"avg_frame_rate": "30/1",
"time_base": "1/15360",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 8036864,
"duration": "523.233333",
"bit_rate": "408909",
"bits_per_raw_sample": "8",
"nb_frames": "15697",
"extradata_size": 46,
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"language": "und",
"handler_name": "VideoHandler",
"vendor_id": "[0][0][0][0]",
"encoder": "Lavc60.31.102 libx264"
}
},
{
"index": 1,
"codec_name": "aac",
"codec_long_name": "AAC (Advanced Audio Coding)",
"profile": "LC",
"codec_type": "audio",
"codec_tag_string": "mp4a",
"codec_tag": "0x6134706d",
"sample_fmt": "fltp",
"sample_rate": "48000",
"channels": 2,
"channel_layout": "stereo",
"bits_per_sample": 0,
"initial_padding": 0,
"id": "0x2",
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0",
"time_base": "1/48000",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 25119984,
"duration": "523.333000",
"bit_rate": "41545",
"nb_frames": "24533",
"extradata_size": 5,
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"language": "und",
"handler_name": "SoundHandler",
"vendor_id": "[0][0][0][0]"
}
}
],
"format": {
"filename": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E04-cabinet-b.mp4",
"nb_streams": 2,
"nb_programs": 0,
"format_name": "mov,mp4,m4a,3gp,3g2,mj2",
"format_long_name": "QuickTime / MOV",
"start_time": "0.000000",
"duration": "523.333000",
"size": "30037875",
"bit_rate": "459177",
"probe_score": 100,
"tags": {
"major_brand": "isom",
"minor_version": "512",
"compatible_brands": "isomiso2avc1mp41",
"encoder": "Lavf60.16.100"
}
}
},
"webm": {
"streams": [
{
"index": 0,
"codec_name": "vp9",
"codec_long_name": "Google VP9",
"profile": "Profile 0",
"codec_type": "video",
"codec_tag_string": "[0][0][0][0]",
"codec_tag": "0x0000",
"width": 1600,
"height": 900,
"coded_width": 1600,
"coded_height": 900,
"closed_captions": 0,
"film_grain": 0,
"has_b_frames": 0,
"sample_aspect_ratio": "1:1",
"display_aspect_ratio": "16:9",
"pix_fmt": "yuv420p",
"level": -99,
"color_range": "tv",
"chroma_location": "left",
"field_order": "progressive",
"refs": 1,
"r_frame_rate": "30/1",
"avg_frame_rate": "30/1",
"time_base": "1/1000",
"start_pts": 0,
"start_time": "0.000000",
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"HANDLER_NAME": "VideoHandler",
"VENDOR_ID": "[0][0][0][0]",
"ENCODER": "Lavc60.31.102 libvpx-vp9",
"DURATION": "00:08:43.233000000"
}
},
{
"index": 1,
"codec_name": "opus",
"codec_long_name": "Opus (Opus Interactive Audio Codec)",
"codec_type": "audio",
"codec_tag_string": "[0][0][0][0]",
"codec_tag": "0x0000",
"sample_fmt": "fltp",
"sample_rate": "48000",
"channels": 2,
"channel_layout": "stereo",
"bits_per_sample": 0,
"initial_padding": 312,
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0",
"time_base": "1/1000",
"start_pts": -7,
"start_time": "-0.007000",
"extradata_size": 19,
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"HANDLER_NAME": "SoundHandler",
"VENDOR_ID": "[0][0][0][0]",
"ENCODER": "Lavc60.31.102 libopus",
"DURATION": "00:08:43.357000000"
}
}
],
"format": {
"filename": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E04-cabinet-b.webm",
"nb_streams": 2,
"nb_programs": 0,
"format_name": "matroska,webm",
"format_long_name": "Matroska / WebM",
"start_time": "-0.007000",
"duration": "523.357000",
"size": "16364008",
"bit_rate": "250139",
"probe_score": 100,
"tags": {
"COMPATIBLE_BRANDS": "isomiso2avc1mp41",
"MAJOR_BRAND": "isom",
"MINOR_VERSION": "512",
"ENCODER": "Lavf60.16.100"
}
}
}
}

View File

@@ -0,0 +1,686 @@
{
"schema": "freecad-web-line-course/video-verification/v1",
"generatedAt": "2026-11-12T20:00:33.833Z",
"episode": "E04",
"title": "长控制柜",
"status": "passed",
"checks": [
{
"name": "mp4 exists",
"passed": true,
"detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E04-cabinet-b.mp4"
},
{
"name": "webm exists",
"passed": true,
"detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E04-cabinet-b.webm"
},
{
"name": "vtt exists",
"passed": true,
"detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E04-cabinet-b.zh.vtt"
},
{
"name": "srt exists",
"passed": true,
"detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E04-cabinet-b.zh.srt"
},
{
"name": "poster exists",
"passed": true,
"detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E04-cabinet-b-poster.png"
},
{
"name": "mp4 h264 1600x900",
"passed": true,
"detail": {
"index": 0,
"codec_name": "h264",
"codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
"profile": "High",
"codec_type": "video",
"codec_tag_string": "avc1",
"codec_tag": "0x31637661",
"width": 1600,
"height": 900,
"coded_width": 1600,
"coded_height": 900,
"closed_captions": 0,
"film_grain": 0,
"has_b_frames": 2,
"pix_fmt": "yuv420p",
"level": 42,
"chroma_location": "left",
"field_order": "progressive",
"refs": 1,
"is_avc": "true",
"nal_length_size": "4",
"id": "0x1",
"r_frame_rate": "30/1",
"avg_frame_rate": "30/1",
"time_base": "1/15360",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 8036864,
"duration": "523.233333",
"bit_rate": "408909",
"bits_per_raw_sample": "8",
"nb_frames": "15697",
"extradata_size": 46,
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"language": "und",
"handler_name": "VideoHandler",
"vendor_id": "[0][0][0][0]",
"encoder": "Lavc60.31.102 libx264"
}
}
},
{
"name": "mp4 aac audio",
"passed": true,
"detail": {
"index": 1,
"codec_name": "aac",
"codec_long_name": "AAC (Advanced Audio Coding)",
"profile": "LC",
"codec_type": "audio",
"codec_tag_string": "mp4a",
"codec_tag": "0x6134706d",
"sample_fmt": "fltp",
"sample_rate": "48000",
"channels": 2,
"channel_layout": "stereo",
"bits_per_sample": 0,
"initial_padding": 0,
"id": "0x2",
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0",
"time_base": "1/48000",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 25119984,
"duration": "523.333000",
"bit_rate": "41545",
"nb_frames": "24533",
"extradata_size": 5,
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"language": "und",
"handler_name": "SoundHandler",
"vendor_id": "[0][0][0][0]"
}
}
},
{
"name": "webm vp9/opus",
"passed": true,
"detail": {
"video": "vp9",
"audio": "opus"
}
},
{
"name": "duration in range",
"passed": true,
"detail": {
"duration": 523.333,
"range": [
300,
900
]
}
},
{
"name": "audio not silent",
"passed": true,
"detail": {
"mean": -29.4,
"max": -5.4
}
},
{
"name": "vtt cues",
"passed": true,
"detail": 20
},
{
"name": "media HTTP 200",
"passed": true,
"detail": {
"status": 200,
"type": "video/mp4",
"ranges": "bytes"
}
},
{
"name": "media MIME",
"passed": true,
"detail": "video/mp4"
},
{
"name": "media Accept-Ranges",
"passed": true,
"detail": "bytes"
},
{
"name": "media Range 206",
"passed": true,
"detail": 206
},
{
"name": "media bad Range 416",
"passed": true,
"detail": 416
},
{
"name": "session exists",
"passed": true,
"detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/raw/E04/session.json"
},
{
"name": "0 pageErrors",
"passed": true,
"detail": []
},
{
"name": "0 consoleErrors",
"passed": true,
"detail": []
},
{
"name": "stills exist",
"passed": true,
"detail": 7
},
{
"name": "checkpoint exists",
"passed": true,
"detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/checkpoints/E04.FCStd"
},
{
"name": "precision profile",
"passed": true,
"detail": {
"objectCount": 16,
"extra": [],
"models": [],
"failures": []
}
}
],
"duration": 523.333,
"scenes": [
{
"id": "S00",
"start": 0,
"end": 18.033,
"duration": 18.033,
"narration": 13.896
},
{
"id": "S01",
"start": 18.033,
"end": 53.067,
"duration": 35.033,
"narration": 15.792
},
{
"id": "S02",
"start": 53.067,
"end": 153.1,
"duration": 100.033,
"narration": 18.288
},
{
"id": "S03",
"start": 153.1,
"end": 253.133,
"duration": 100.033,
"narration": 18.936
},
{
"id": "S04",
"start": 253.133,
"end": 353.2,
"duration": 100.067,
"narration": 16.056
},
{
"id": "S05",
"start": 353.2,
"end": 453.267,
"duration": 100.067,
"narration": 16.08
},
{
"id": "S06",
"start": 453.267,
"end": 523.333,
"duration": 70.067,
"narration": 17.232
}
],
"cues": 20,
"audio": {
"mean": -29.4,
"max": -5.4
},
"stills": [
"S00-title.png",
"S01-start.png",
"S02-parts.png",
"S03-parts.png",
"S04-parts.png",
"S05-parts.png",
"S06-recap.png"
],
"precision": {
"schema": "freecad-web-line-course/precision/v1",
"objectCount": 16,
"extra": [],
"results": [
{
"name": "CabinetA_P01",
"label": "主控制柜 部件 1",
"model": "CabinetA",
"tolerance": 1.5,
"ok": true,
"issues": []
},
{
"name": "CabinetA_P02",
"label": "主控制柜 部件 2",
"model": "CabinetA",
"tolerance": 1.5,
"ok": true,
"issues": []
},
{
"name": "CabinetA_P03",
"label": "主控制柜 部件 3",
"model": "CabinetA",
"tolerance": 1.5,
"ok": true,
"issues": []
},
{
"name": "CabinetA_P04",
"label": "ZX-JX02-02-02A______________¹___001",
"model": "CabinetA",
"tolerance": 1.5,
"ok": true,
"issues": []
},
{
"name": "CabinetA_P05",
"label": "ZX-JX02-02-03____²_______________¹___097",
"model": "CabinetA",
"tolerance": 1.5,
"ok": true,
"issues": []
},
{
"name": "CabinetA_P06",
"label": "ZX-JX02-02-03____²_______________¹___105",
"model": "CabinetA",
"tolerance": 1.5,
"ok": true,
"issues": []
},
{
"name": "CabinetA_P07",
"label": "ZX-JX02-02-80______013",
"model": "CabinetA",
"tolerance": 1.5,
"ok": true,
"issues": []
},
{
"name": "CabinetA_P08",
"label": "ZX-JX02-02-80______015",
"model": "CabinetA",
"tolerance": 1.5,
"ok": true,
"issues": []
},
{
"name": "CabinetB_P01",
"label": "长控制柜 部件 1",
"model": "CabinetB",
"tolerance": 1.5,
"ok": true,
"issues": []
},
{
"name": "CabinetB_P02",
"label": "长控制柜 部件 2",
"model": "CabinetB",
"tolerance": 1.5,
"ok": true,
"issues": []
},
{
"name": "CabinetB_P03",
"label": "长控制柜 部件 3",
"model": "CabinetB",
"tolerance": 1.5,
"ok": true,
"issues": []
},
{
"name": "CabinetB_P04",
"label": "ZX-JX02-02-02A______________¹___135",
"model": "CabinetB",
"tolerance": 1.5,
"ok": true,
"issues": []
},
{
"name": "CabinetB_P05",
"label": "长控制柜 部件 5",
"model": "CabinetB",
"tolerance": 1.5,
"ok": true,
"issues": []
},
{
"name": "CabinetB_P06",
"label": "ZX-JX02-02-03____²_______________¹___129",
"model": "CabinetB",
"tolerance": 1.5,
"ok": true,
"issues": []
},
{
"name": "CabinetB_P07",
"label": "ZX-JX02-02-03____²_______________¹___142",
"model": "CabinetB",
"tolerance": 1.5,
"ok": true,
"issues": []
},
{
"name": "CabinetB_P08",
"label": "ZX-JX02-02-80______016",
"model": "CabinetB",
"tolerance": 1.5,
"ok": true,
"issues": []
}
],
"models": [
{
"name": "CabinetA",
"label": "主控制柜",
"parts": 8,
"ok": true,
"issues": []
},
{
"name": "CabinetB",
"label": "长控制柜",
"parts": 8,
"ok": true,
"issues": []
}
],
"ok": true
},
"checkpoint": "checkpoints/E04.FCStd",
"mp4": {
"video": {
"index": 0,
"codec_name": "h264",
"codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
"profile": "High",
"codec_type": "video",
"codec_tag_string": "avc1",
"codec_tag": "0x31637661",
"width": 1600,
"height": 900,
"coded_width": 1600,
"coded_height": 900,
"closed_captions": 0,
"film_grain": 0,
"has_b_frames": 2,
"pix_fmt": "yuv420p",
"level": 42,
"chroma_location": "left",
"field_order": "progressive",
"refs": 1,
"is_avc": "true",
"nal_length_size": "4",
"id": "0x1",
"r_frame_rate": "30/1",
"avg_frame_rate": "30/1",
"time_base": "1/15360",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 8036864,
"duration": "523.233333",
"bit_rate": "408909",
"bits_per_raw_sample": "8",
"nb_frames": "15697",
"extradata_size": 46,
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"language": "und",
"handler_name": "VideoHandler",
"vendor_id": "[0][0][0][0]",
"encoder": "Lavc60.31.102 libx264"
}
},
"audio": {
"index": 1,
"codec_name": "aac",
"codec_long_name": "AAC (Advanced Audio Coding)",
"profile": "LC",
"codec_type": "audio",
"codec_tag_string": "mp4a",
"codec_tag": "0x6134706d",
"sample_fmt": "fltp",
"sample_rate": "48000",
"channels": 2,
"channel_layout": "stereo",
"bits_per_sample": 0,
"initial_padding": 0,
"id": "0x2",
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0",
"time_base": "1/48000",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 25119984,
"duration": "523.333000",
"bit_rate": "41545",
"nb_frames": "24533",
"extradata_size": 5,
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"language": "und",
"handler_name": "SoundHandler",
"vendor_id": "[0][0][0][0]"
}
}
},
"webm": {
"video": {
"index": 0,
"codec_name": "vp9",
"codec_long_name": "Google VP9",
"profile": "Profile 0",
"codec_type": "video",
"codec_tag_string": "[0][0][0][0]",
"codec_tag": "0x0000",
"width": 1600,
"height": 900,
"coded_width": 1600,
"coded_height": 900,
"closed_captions": 0,
"film_grain": 0,
"has_b_frames": 0,
"sample_aspect_ratio": "1:1",
"display_aspect_ratio": "16:9",
"pix_fmt": "yuv420p",
"level": -99,
"color_range": "tv",
"chroma_location": "left",
"field_order": "progressive",
"refs": 1,
"r_frame_rate": "30/1",
"avg_frame_rate": "30/1",
"time_base": "1/1000",
"start_pts": 0,
"start_time": "0.000000",
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"HANDLER_NAME": "VideoHandler",
"VENDOR_ID": "[0][0][0][0]",
"ENCODER": "Lavc60.31.102 libvpx-vp9",
"DURATION": "00:08:43.233000000"
}
},
"audio": {
"index": 1,
"codec_name": "opus",
"codec_long_name": "Opus (Opus Interactive Audio Codec)",
"codec_type": "audio",
"codec_tag_string": "[0][0][0][0]",
"codec_tag": "0x0000",
"sample_fmt": "fltp",
"sample_rate": "48000",
"channels": 2,
"channel_layout": "stereo",
"bits_per_sample": 0,
"initial_padding": 312,
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0",
"time_base": "1/1000",
"start_pts": -7,
"start_time": "-0.007000",
"extradata_size": 19,
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"HANDLER_NAME": "SoundHandler",
"VENDOR_ID": "[0][0][0][0]",
"ENCODER": "Lavc60.31.102 libopus",
"DURATION": "00:08:43.357000000"
}
}
}
}

View File

@@ -0,0 +1,12 @@
{
"schema": "freecad-web-line-course/assembly-page/v1",
"url": "http://127.0.0.1:5190/cases/production-line-assembly.html",
"errors": [],
"failed": [],
"stats": {
"loaded": 88,
"models": 27
},
"filters": 28,
"ok": true
}

View File

@@ -0,0 +1,588 @@
{
"schema": "freecad-web-line-course/course-audit/v1",
"generatedAt": "2026-11-12T19:33:10.216Z",
"models": 27,
"parts": 88,
"episodes": 18,
"mediaPassed": 2,
"verificationPassed": 2,
"pending": [
"E03",
"E04",
"E05",
"E06",
"E07",
"E08",
"E09",
"E10",
"E11",
"E12",
"E13",
"E14",
"E15",
"E16",
"E17",
"E18"
],
"detail": [
{
"id": "E01",
"slug": "ui-and-reference",
"objects": 0,
"media": [
{
"suffix": ".mp4",
"exists": true
},
{
"suffix": ".webm",
"exists": true
},
{
"suffix": ".zh.vtt",
"exists": true
},
{
"suffix": ".zh.srt",
"exists": true
},
{
"suffix": "-poster.png",
"exists": true
}
],
"mediaOk": true,
"verification": "passed",
"checkpoint": null,
"ok": true
},
{
"id": "E02",
"slug": "measure-and-spec",
"objects": 0,
"media": [
{
"suffix": ".mp4",
"exists": true
},
{
"suffix": ".webm",
"exists": true
},
{
"suffix": ".zh.vtt",
"exists": true
},
{
"suffix": ".zh.srt",
"exists": true
},
{
"suffix": "-poster.png",
"exists": true
}
],
"mediaOk": true,
"verification": "passed",
"checkpoint": null,
"ok": true
},
{
"id": "E03",
"slug": "cabinet-a",
"objects": 8,
"media": [
{
"suffix": ".mp4",
"exists": true
},
{
"suffix": ".webm",
"exists": true
},
{
"suffix": ".zh.vtt",
"exists": false
},
{
"suffix": ".zh.srt",
"exists": false
},
{
"suffix": "-poster.png",
"exists": false
}
],
"mediaOk": false,
"verification": null,
"checkpoint": true,
"ok": false
},
{
"id": "E04",
"slug": "cabinet-b",
"objects": 8,
"media": [
{
"suffix": ".mp4",
"exists": false
},
{
"suffix": ".webm",
"exists": false
},
{
"suffix": ".zh.vtt",
"exists": false
},
{
"suffix": ".zh.srt",
"exists": false
},
{
"suffix": "-poster.png",
"exists": false
}
],
"mediaOk": false,
"verification": null,
"checkpoint": true,
"ok": false
},
{
"id": "E05",
"slug": "doors-and-displays",
"objects": 5,
"media": [
{
"suffix": ".mp4",
"exists": false
},
{
"suffix": ".webm",
"exists": false
},
{
"suffix": ".zh.vtt",
"exists": false
},
{
"suffix": ".zh.srt",
"exists": false
},
{
"suffix": "-poster.png",
"exists": false
}
],
"mediaOk": false,
"verification": null,
"checkpoint": true,
"ok": false
},
{
"id": "E06",
"slug": "hopper-and-raw-feeder",
"objects": 7,
"media": [
{
"suffix": ".mp4",
"exists": false
},
{
"suffix": ".webm",
"exists": false
},
{
"suffix": ".zh.vtt",
"exists": false
},
{
"suffix": ".zh.srt",
"exists": false
},
{
"suffix": "-poster.png",
"exists": false
}
],
"mediaOk": false,
"verification": null,
"checkpoint": true,
"ok": false
},
{
"id": "E07",
"slug": "loader-and-conveyor",
"objects": 8,
"media": [
{
"suffix": ".mp4",
"exists": false
},
{
"suffix": ".webm",
"exists": false
},
{
"suffix": ".zh.vtt",
"exists": false
},
{
"suffix": ".zh.srt",
"exists": false
},
{
"suffix": "-poster.png",
"exists": false
}
],
"mediaOk": false,
"verification": null,
"checkpoint": true,
"ok": false
},
{
"id": "E08",
"slug": "rotary-and-weigh",
"objects": 4,
"media": [
{
"suffix": ".mp4",
"exists": false
},
{
"suffix": ".webm",
"exists": false
},
{
"suffix": ".zh.vtt",
"exists": false
},
{
"suffix": ".zh.srt",
"exists": false
},
{
"suffix": "-poster.png",
"exists": false
}
],
"mediaOk": false,
"verification": null,
"checkpoint": true,
"ok": false
},
{
"id": "E09",
"slug": "pick-feeder-and-gripper",
"objects": 8,
"media": [
{
"suffix": ".mp4",
"exists": false
},
{
"suffix": ".webm",
"exists": false
},
{
"suffix": ".zh.vtt",
"exists": false
},
{
"suffix": ".zh.srt",
"exists": false
},
{
"suffix": "-poster.png",
"exists": false
}
],
"mediaOk": false,
"verification": null,
"checkpoint": true,
"ok": false
},
{
"id": "E10",
"slug": "pusher-and-store",
"objects": 7,
"media": [
{
"suffix": ".mp4",
"exists": false
},
{
"suffix": ".webm",
"exists": false
},
{
"suffix": ".zh.vtt",
"exists": false
},
{
"suffix": ".zh.srt",
"exists": false
},
{
"suffix": "-poster.png",
"exists": false
}
],
"mediaOk": false,
"verification": null,
"checkpoint": true,
"ok": false
},
{
"id": "E11",
"slug": "sensor-bracket-inspector",
"objects": 4,
"media": [
{
"suffix": ".mp4",
"exists": false
},
{
"suffix": ".webm",
"exists": false
},
{
"suffix": ".zh.vtt",
"exists": false
},
{
"suffix": ".zh.srt",
"exists": false
},
{
"suffix": "-poster.png",
"exists": false
}
],
"mediaOk": false,
"verification": null,
"checkpoint": true,
"ok": false
},
{
"id": "E12",
"slug": "assembly-and-inspection",
"objects": 4,
"media": [
{
"suffix": ".mp4",
"exists": false
},
{
"suffix": ".webm",
"exists": false
},
{
"suffix": ".zh.vtt",
"exists": false
},
{
"suffix": ".zh.srt",
"exists": false
},
{
"suffix": "-poster.png",
"exists": false
}
],
"mediaOk": false,
"verification": null,
"checkpoint": true,
"ok": false
},
{
"id": "E13",
"slug": "lights-and-origin",
"objects": 8,
"media": [
{
"suffix": ".mp4",
"exists": false
},
{
"suffix": ".webm",
"exists": false
},
{
"suffix": ".zh.vtt",
"exists": false
},
{
"suffix": ".zh.srt",
"exists": false
},
{
"suffix": "-poster.png",
"exists": false
}
],
"mediaOk": false,
"verification": null,
"checkpoint": true,
"ok": false
},
{
"id": "E14",
"slug": "abb-robot",
"objects": 11,
"media": [
{
"suffix": ".mp4",
"exists": false
},
{
"suffix": ".webm",
"exists": false
},
{
"suffix": ".zh.vtt",
"exists": false
},
{
"suffix": ".zh.srt",
"exists": false
},
{
"suffix": "-poster.png",
"exists": false
}
],
"mediaOk": false,
"verification": null,
"checkpoint": true,
"ok": false
},
{
"id": "E15",
"slug": "robot-station-review",
"objects": 0,
"media": [
{
"suffix": ".mp4",
"exists": false
},
{
"suffix": ".webm",
"exists": false
},
{
"suffix": ".zh.vtt",
"exists": false
},
{
"suffix": ".zh.srt",
"exists": false
},
{
"suffix": "-poster.png",
"exists": false
}
],
"mediaOk": false,
"verification": null,
"checkpoint": true,
"ok": false
},
{
"id": "E16",
"slug": "ground-and-lines",
"objects": 6,
"media": [
{
"suffix": ".mp4",
"exists": false
},
{
"suffix": ".webm",
"exists": false
},
{
"suffix": ".zh.vtt",
"exists": false
},
{
"suffix": ".zh.srt",
"exists": false
},
{
"suffix": "-poster.png",
"exists": false
}
],
"mediaOk": false,
"verification": null,
"checkpoint": true,
"ok": false
},
{
"id": "E17",
"slug": "line-assembly",
"objects": 0,
"media": [
{
"suffix": ".mp4",
"exists": false
},
{
"suffix": ".webm",
"exists": false
},
{
"suffix": ".zh.vtt",
"exists": false
},
{
"suffix": ".zh.srt",
"exists": false
},
{
"suffix": "-poster.png",
"exists": false
}
],
"mediaOk": false,
"verification": null,
"checkpoint": null,
"ok": false
},
{
"id": "E18",
"slug": "audit-and-delivery",
"objects": 0,
"media": [
{
"suffix": ".mp4",
"exists": false
},
{
"suffix": ".webm",
"exists": false
},
{
"suffix": ".zh.vtt",
"exists": false
},
{
"suffix": ".zh.srt",
"exists": false
},
{
"suffix": "-poster.png",
"exists": false
}
],
"mediaOk": false,
"verification": null,
"checkpoint": true,
"ok": false
}
],
"ok": false
}

View File

@@ -0,0 +1,44 @@
{
"schema": "freecad-web-line-course/course-page/v1",
"generatedAt": "2026-11-12T19:32:57.513Z",
"viewports": [
{
"viewport": {
"width": 1600,
"height": 900
},
"status": 200,
"errors": [],
"failed": [
"404 http://127.0.0.1:5190/media/line-course/E03-cabinet-a-poster.png",
"404 http://127.0.0.1:5190/media/line-course/E03-cabinet-a.zh.vtt"
],
"videos": 3,
"sources": 6,
"tracks": 3,
"episodes": 18,
"pending": 15,
"checkboxes": 18,
"overflow": 0
},
{
"viewport": {
"width": 390,
"height": 844
},
"status": 200,
"errors": [],
"failed": [
"404 http://127.0.0.1:5190/media/line-course/E03-cabinet-a-poster.png",
"404 http://127.0.0.1:5190/media/line-course/E03-cabinet-a.zh.vtt"
],
"videos": 3,
"sources": 6,
"tracks": 3,
"episodes": 18,
"pending": 15,
"checkboxes": 18,
"overflow": 0
}
]
}

View File

@@ -0,0 +1,43 @@
{
"schema": "freecad-web-line-course/course-evidence/v1",
"generatedAt": "2026-11-12T18:52:22.645Z",
"objects": 88,
"models": 27,
"precisionOk": true,
"exports": [
"Box001.step",
"Box001.stl"
],
"log": [
{
"at": "2026-11-12T18:52:03.285Z",
"step": "opened",
"objects": 88
},
{
"at": "2026-11-12T18:52:08.190Z",
"step": "export",
"format": "step",
"created": [
"Box001.step"
],
"status": "已写入 OPFS:Box001.step (7179 bytes)"
},
{
"at": "2026-11-12T18:52:11.243Z",
"step": "export",
"format": "stl",
"created": [
"Box001.stl"
],
"status": "已写入 OPFS:Box001.stl (3052 bytes)"
},
{
"at": "2026-11-12T18:52:16.270Z",
"step": "checkpoint",
"savedName": "web_project_document_3.FCStd",
"bytes": 89483,
"checkpoint": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/checkpoints/E18.FCStd"
}
]
}

View File

@@ -0,0 +1,23 @@
{
"ok": true,
"steps": [
{
"step": "document",
"status": "Active document: project-document-3"
},
{
"step": "panel",
"options": 27,
"footer": "17 个网格 · 包围盒 0.22 × 0.69 × 0.70 m"
},
{
"step": "ground",
"footer": "6 个网格 · 包围盒 4.87 × 3.67 × 0.31 m"
}
],
"options": 27,
"groundFooter": "6 个网格 · 包围盒 4.87 × 3.67 × 0.31 m",
"pageErrors": [],
"consoleErrors": [],
"screenshot": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/spikes/line-reference-smoke.png"
}

View File

@@ -0,0 +1,28 @@
{
"schema": "freecad-web-line-course/reference-page/v1",
"url": "http://127.0.0.1:5190/cases/production-line-reference.html",
"errors": [],
"failed": [],
"options": 27,
"first": {
"file": "ABB_IRB_120.glb",
"meshes": 17,
"size": [
0.21935981968278861,
0.6875670778062306,
0.6995870320032749
],
"stats": "17 个网格 · 包围盒 0.22 × 0.69 × 0.70 m"
},
"ground": {
"file": "地面平面.glb",
"meshes": 6,
"size": [
4.86748194694519,
3.673230024902511,
0.3100616609702115
],
"stats": "6 个网格 · 包围盒 4.87 × 3.67 × 0.31 m"
},
"ok": true
}

View File

@@ -0,0 +1,20 @@
#!/bin/bash
# After the E02-E18 media batch: re-record E01 with the menu fix, rebuild the
# course page, run the three page checks and the course audit.
set -u
ROOT=/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course
LOG="$ROOT/evidence/finalize.log"
: > "$LOG"
echo "=== E01 TTS $(date -Iseconds) ===" >> "$LOG"
node "$ROOT/generate-tts.mjs" --episode E01 >> "$LOG" 2>&1 || { echo "E01 TTS FAILED" >> "$LOG"; exit 1; }
echo "=== E01 RECORD $(date -Iseconds) ===" >> "$LOG"
DISPLAY=:2 node "$ROOT/record.mjs" --episode E01 >> "$LOG" 2>&1 || { echo "E01 RECORD FAILED" >> "$LOG"; exit 1; }
node "$ROOT/assemble.mjs" --episode E01 >> "$LOG" 2>&1 || { echo "E01 ASSEMBLE FAILED" >> "$LOG"; exit 1; }
node "$ROOT/verify.mjs" --episode E01 >> "$LOG" 2>&1 || { echo "E01 VERIFY FAILED" >> "$LOG"; exit 1; }
echo "=== E01 DONE $(date -Iseconds) ===" >> "$LOG"
node "$ROOT/build-course-page.mjs" >> "$LOG" 2>&1
node "$ROOT/spikes/course-page-check.mjs" >> "$LOG" 2>&1
node "$ROOT/spikes/reference-page-check.mjs" >> "$LOG" 2>&1
node "$ROOT/spikes/assembly-page-check.mjs" >> "$LOG" 2>&1
node "$ROOT/audit-course.mjs" >> "$LOG" 2>&1
echo "=== ALL FINALIZED $(date -Iseconds) ===" >> "$LOG"

View File

@@ -0,0 +1,77 @@
#!/usr/bin/env node
// Generates Chinese narration for one episode (or all) with edge-tts.
// Audio/SRT are cached per scene; durations feed assemble.mjs.
import fs from "node:fs";
import path from "node:path";
import { spawnSync } from "node:child_process";
import { fileURLToPath } from "node:url";
const here = path.dirname(fileURLToPath(import.meta.url));
const args = process.argv.slice(2);
const option = (name, fallback = "") => {
const index = args.indexOf(name);
return index < 0 ? fallback : args[index + 1] ?? fallback;
};
const tts = "/home/mes123456/FreeCADWasmDev/working/FreeCAD/.venv-video/bin/edge-tts";
const ffprobe = "ffprobe";
const voices = ["zh-CN-XiaoxiaoNeural", "zh-CN-YunjianNeural", "zh-CN-YunxiNeural"];
function episodeIds() {
const requested = option("--episode");
if (requested) return [requested];
const course = JSON.parse(fs.readFileSync(path.join(here, "course.json"), "utf8"));
return course.episodes.map(episode => episode.id);
}
function synthesize(episode) {
const episodeDir = path.join(here, "episodes", episode);
const scriptPath = path.join(episodeDir, "script.zh.json");
if (!fs.existsSync(scriptPath)) throw new Error(`missing script ${scriptPath}`);
const script = JSON.parse(fs.readFileSync(scriptPath, "utf8"));
const audioDir = path.join(episodeDir, "audio");
fs.mkdirSync(audioDir, { recursive: true });
const durations = {};
const voiceList = [script.voice, ...voices].filter(Boolean);
for (const scene of script.scenes) {
const media = path.join(audioDir, `${scene.id}.mp3`);
const subtitles = path.join(audioDir, `${scene.id}.srt`);
let ok = fs.existsSync(media) && fs.statSync(media).size > 1000 && fs.existsSync(subtitles);
let lastError = "";
for (const voice of voiceList) {
for (let attempt = 0; attempt < 2 && !ok; attempt++) {
const result = spawnSync(tts, ["--voice", voice, `--rate=${script.rate ?? "-4%"}`,
"--text", scene.narration, "--write-media", media, "--write-subtitles", subtitles],
{ encoding: "utf8", timeout: 120000 });
if (result.status === 0 && fs.existsSync(media) && fs.statSync(media).size > 1000) {
ok = true;
console.log(JSON.stringify({ episode, scene: scene.id, voice, bytes: fs.statSync(media).size }));
} else {
lastError = `${result.status}: ${(result.stderr || result.stdout || "").slice(-300)}`;
console.log(JSON.stringify({ episode, scene: scene.id, voice, attempt, error: lastError }));
}
}
if (ok) break;
}
if (!ok) throw new Error(`TTS failed for ${episode}/${scene.id}: ${lastError}`);
const probe = spawnSync(ffprobe, ["-v", "error", "-show_entries", "format=duration",
"-of", "default=nw=1:nk=1", media], { encoding: "utf8" });
const duration = Number(probe.stdout.trim());
if (!Number.isFinite(duration) || duration <= 0) throw new Error(`Invalid duration for ${episode}/${scene.id}`);
durations[scene.id] = {
title: scene.title, target: scene.target, duration: Math.round(duration * 1000) / 1000,
media: path.relative(episodeDir, media), subtitles: path.relative(episodeDir, subtitles),
};
}
fs.writeFileSync(path.join(episodeDir, "audio-durations.json"), `${JSON.stringify({
schema: "freecad-web-line-course/video-tts/v1",
episode, generatedAt: new Date().toISOString(),
voice: script.voice, rate: script.rate, scenes: durations,
}, null, 2)}\n`);
return durations;
}
const results = {};
for (const episode of episodeIds()) {
results[episode] = synthesize(episode);
}
console.log(JSON.stringify({ ok: true, episodes: Object.keys(results), scenes: Object.values(results).reduce((sum, item) => sum + Object.keys(item).length, 0) }));

View File

@@ -0,0 +1,57 @@
// Assembly helpers shared by the line-course E17 episode.
export async function executeCommand(page, command, payload, timeout = 300000) {
const before = await page.evaluate(() => window.__freecadWorkbenchState?.response?.requestId ?? null);
await page.locator(`button[data-help-page="${command}"]`).first().click();
await page.locator("#payload-editor").fill(JSON.stringify(payload));
await page.getByRole("button", { name: "执行选中命令" }).click();
await page.waitForFunction(id => {
const response = window.__freecadWorkbenchState?.response;
return Boolean(response) && response.requestId !== id;
}, before, { timeout });
const response = await page.evaluate(() => window.__freecadWorkbenchState?.response);
if (response?.kind !== "result") throw new Error(`${command}: ${response?.error?.code} ${response?.error?.message}`);
return response.result?.records?.find(record => record.status === "exposed")?.result ?? response.result;
}
export async function createAssembly(page, { document = "LineAssembly", label = "生产线总装" } = {}) {
const create = page.getByRole("region", { name: "Create assembly" });
await create.waitFor({ state: "visible", timeout: 60000 });
await page.locator('input[aria-label="Assembly document name"]').fill(document);
await page.locator('input[aria-label="Assembly label"]').fill(label);
await create.getByRole("button", { name: "Create", exact: true }).click();
const linksTask = page.getByRole("region", { name: "Insert assembly link" });
await linksTask.waitFor({ state: "visible", timeout: 120000 });
return linksTask;
}
export async function insertLinks(page, linksTask, source = "line-course-E16.FCStd", expectedLinks = 27) {
await page.locator('select[aria-label="Insert link source file"]').selectOption(source);
await linksTask.getByRole("button", { name: "Load source", exact: true }).click();
await page.waitForFunction(() => {
const select = document.querySelector('select[aria-label="Insert link source object"]');
return select && select.options.length > 1;
}, null, { timeout: 180000 });
const options = (await page.locator('select[aria-label="Insert link source object"] option').allTextContents())
.filter(option => option && !option.startsWith("Choose"));
const select = page.locator('select[aria-label="Insert link source object"]');
const list = linksTask.locator('ul[aria-label="Inserted links"] li');
for (const option of options) {
await select.selectOption({ label: option });
await page.waitForTimeout(350);
await linksTask.getByRole("button", { name: "Insert", exact: true }).click();
await page.waitForTimeout(600);
}
await page.waitForTimeout(1200);
await linksTask.getByRole("button", { name: "Accept", exact: true }).click();
await page.waitForTimeout(1500);
const items = await list.allTextContents();
const linkNames = items.map(text => /→\s+([^(]+?)\s+\(/.exec(text)?.[1]?.trim()).filter(Boolean);
if (items.length !== expectedLinks) throw new Error(`expected ${expectedLinks} links, got ${items.length}`);
return { linkNames, items };
}
export async function buildAssembly(page, options = {}) {
const linksTask = await createAssembly(page, options);
const result = await insertLinks(page, linksTask, options.source, options.expectedLinks ?? 27);
return { document: options.document ?? "LineAssembly", ...result };
}

View File

@@ -0,0 +1,159 @@
// Shared UI building blocks for the production-line course drivers.
import { closeTask, openGroup, openPartMenu, removeObject, renameSelected,
selectTreeLabel, simpleCopy, treeLabels } from "../../carrier-course/lib/ui-actions.mjs";
export const hex = color => `#${color.map(value =>
Math.round(Math.min(1, Math.max(0, value)) * 255).toString(16).padStart(2, "0")).join("")}`;
export function createBuilder({ page, rec, logStep }) {
const labels = () => treeLabels(page);
const pause = ms => page.waitForTimeout(ms);
const applyLabel = async (from, to) => {
await selectTreeLabel(page, from);
const input = page.locator('input[aria-label="Object Label"]').first();
await input.fill(to);
await input.press("Enter");
await pause(700);
};
const place = async (label, part) => {
await selectTreeLabel(page, label);
await rec.clickSelector(page, 'button:has-text("Position")');
await page.locator('input[aria-label="Position X"]').first().fill(String(part.position[0]));
await page.locator('input[aria-label="Position Y"]').first().fill(String(part.position[1]));
await page.locator('input[aria-label="Position Z"]').first().fill(String(part.position[2]));
const [ax, ay, az] = part.rotation.axis;
await page.locator('input[aria-label="Rotation axis X"]').first().fill(String(ax));
await page.locator('input[aria-label="Rotation axis Y"]').first().fill(String(ay));
await page.locator('input[aria-label="Rotation axis Z"]').first().fill(String(az));
await page.locator('input[aria-label="Rotation angle"]').first().fill(String(part.rotation.angleDeg));
await rec.clickSelector(page, 'button[aria-label="应用位置与旋转"]');
await pause(1600);
await closeTask(page);
};
const setColor = async (label, color) => {
await selectTreeLabel(page, label);
const input = page.locator('input[aria-label="Object Color"]').first();
if (await input.count()) {
await input.fill(hex(color));
await input.dispatchEvent("change");
await pause(500);
}
};
const createBox = async (label, dims, localPosition, rotation) => {
const before = await labels();
await openPartMenu(page, rec);
await openGroup(page, "Primitives");
await rec.clickSelector(page, 'button[data-command="Part_Box"]');
await pause(800);
let created = null;
for (let attempt = 0; attempt < 20 && !created; attempt++) {
await pause(300);
created = (await labels()).find(item => !before.includes(item)) ?? null;
}
if (!created) throw new Error(`box ${label} not created`);
await selectTreeLabel(page, created);
await pause(300);
await page.locator('input[aria-label="Length"]').first().fill(String(dims[0]));
await page.locator('input[aria-label="Width"]').first().fill(String(dims[1]));
await page.locator('input[aria-label="Height"]').first().fill(String(dims[2]));
await rec.clickSelector(page, 'button:has-text("应用尺寸并重算")');
await pause(1400);
await closeTask(page);
await applyLabel(created, label);
if (localPosition) {
await selectTreeLabel(page, label);
await rec.clickSelector(page, 'button:has-text("Position")');
await page.locator('input[aria-label="Position X"]').first().fill(String(localPosition[0]));
await page.locator('input[aria-label="Position Y"]').first().fill(String(localPosition[1]));
await page.locator('input[aria-label="Position Z"]').first().fill(String(localPosition[2]));
if (rotation) {
await page.locator('input[aria-label="Rotation axis X"]').first().fill(String(rotation.axis[0]));
await page.locator('input[aria-label="Rotation axis Y"]').first().fill(String(rotation.axis[1]));
await page.locator('input[aria-label="Rotation axis Z"]').first().fill(String(rotation.axis[2]));
await page.locator('input[aria-label="Rotation angle"]').first().fill(String(rotation.angleDeg));
}
await rec.clickSelector(page, 'button[aria-label="应用位置与旋转"]');
await pause(900);
await closeTask(page);
}
logStep?.({ step: "box", label, dims, localPosition });
return label;
};
const createCylinder = async (label, radius, height, localPosition, rotation) => {
const before = await labels();
await openPartMenu(page, rec);
await openGroup(page, "Primitives");
await rec.clickSelector(page, 'button[data-command="Part_Cylinder"]');
await pause(800);
let created = null;
for (let attempt = 0; attempt < 20 && !created; attempt++) {
await pause(300);
created = (await labels()).find(item => !before.includes(item)) ?? null;
}
if (!created) throw new Error(`cylinder ${label} not created`);
await selectTreeLabel(page, created);
await applyLabel(created, label);
await selectTreeLabel(page, label);
for (const [name, value] of [["Property Radius", radius], ["Property Height", height]]) {
const input = page.locator(`input[aria-label="${name}"]`).first();
if (await input.count()) { await input.fill(String(value)); await input.press("Tab"); await pause(600); }
}
await closeTask(page);
if (localPosition) {
await selectTreeLabel(page, label);
await rec.clickSelector(page, 'button:has-text("Position")');
await page.locator('input[aria-label="Position X"]').first().fill(String(localPosition[0]));
await page.locator('input[aria-label="Position Y"]').first().fill(String(localPosition[1]));
await page.locator('input[aria-label="Position Z"]').first().fill(String(localPosition[2]));
if (rotation) {
await page.locator('input[aria-label="Rotation axis X"]').first().fill(String(rotation.axis[0]));
await page.locator('input[aria-label="Rotation axis Y"]').first().fill(String(rotation.axis[1]));
await page.locator('input[aria-label="Rotation axis Z"]').first().fill(String(rotation.axis[2]));
await page.locator('input[aria-label="Rotation angle"]').first().fill(String(rotation.angleDeg));
}
await rec.clickSelector(page, 'button[aria-label="应用位置与旋转"]');
await pause(900);
await closeTask(page);
}
logStep?.({ step: "cylinder", label, radius, height, localPosition });
return label;
};
const compoundCopy = async (sources, name, baseLabels) => {
await openPartMenu(page, rec);
const group = page.locator("details.part-submenu").filter({ has: page.locator("summary", { hasText: /^Compound$/ }) }).first();
if (!(await group.evaluate(element => element.open))) { await group.locator(":scope > summary").click(); await pause(300); }
await rec.clickSelector(page, '.part-command-menu button[data-command="Part_Compound"]');
const task = page.getByRole("region", { name: "Compound tools" });
await task.waitFor({ state: "visible", timeout: 30000 });
for (const source of sources) {
const box = task.locator("label").filter({ hasText: source }).first().locator('input[type="checkbox"]').first();
if (!(await box.isChecked())) await box.click();
await pause(250);
}
await task.getByRole("button", { name: "Create compound feature", exact: true }).click();
await pause(1400);
await closeTask(page);
const after = await labels();
const compound = after.find(label => !baseLabels.includes(label) && !sources.includes(label)) ?? null;
if (!compound) throw new Error(`compound not created: ${JSON.stringify(after)}`);
await selectTreeLabel(page, compound);
await simpleCopy({ page, rec, source: compound });
const copied = await labels();
const copy = copied.find(label => label !== compound && label.startsWith(compound)) ?? null;
if (!copy) throw new Error(`compound copy not found: ${JSON.stringify(copied)}`);
await selectTreeLabel(page, copy);
await renameSelected(page, name);
await removeObject(page, rec, compound);
for (const source of sources) await removeObject(page, rec, source);
logStep?.({ step: "compound", compound, copy, name, labels: await labels() });
return name;
};
return { labels, pause, place, setColor, createBox, createCylinder, compoundCopy, applyLabel };
}

View File

@@ -0,0 +1,109 @@
// Compares a built line-course checkpoint with line-spec.json.
// Geometry/centre come from the Node WASM probe (inspectFcstd); colours come
// from Document.xml's WebDisplayColor property, which the Web save persists.
import fs from "node:fs";
import path from "node:path";
import { execFileSync } from "node:child_process";
import { fileURLToPath } from "node:url";
import { inspectFcstd } from "../../carrier-course/lib/inspect.mjs";
const here = path.dirname(fileURLToPath(import.meta.url));
const spec = JSON.parse(fs.readFileSync(path.join(here, "..", "line-spec.json"), "utf8"));
const partByName = new Map(spec.models.flatMap(model =>
model.parts.map(part => [part.partName, { ...part, model: model.name }])));
const modelByName = new Map(spec.models.map(model => [model.name, model]));
const nearArray = (actual, expected, tolerance, label, issues) => {
if (!Array.isArray(actual) || actual.length !== expected.length) {
issues.push({ name: label, detail: { actual, expected } });
return;
}
const worst = Math.max(...actual.map((value, index) => Math.abs(Number(value) - Number(expected[index]))));
if (!Number.isFinite(worst) || worst > tolerance)
issues.push({ name: label, detail: { actual, expected, worst, tolerance } });
};
const parseHex = hex => {
const match = /^#?([0-9a-f]{6})$/i.exec(String(hex ?? "").trim());
if (!match) return null;
const value = parseInt(match[1], 16);
return [(value >> 16) & 255, (value >> 8) & 255, value & 255].map(channel => channel / 255);
};
const readDocumentColors = filePath => {
const xml = execFileSync("/usr/bin/unzip", ["-p", filePath, "Document.xml"],
{ encoding: "utf8", maxBuffer: 64 * 1024 * 1024 });
const colors = new Map();
const objects = xml.split("<Object ").slice(1);
for (const block of objects) {
const name = /\bname="([^"]*)"/.exec(block)?.[1];
const label = /<Property name="Label"[^>]*>\s*<String value="([^"]*)"/s.exec(block)?.[1] ?? name;
const color = /<Property name="WebDisplayColor"[^>]*>\s*<String value="([^"]*)"/s.exec(block)?.[1];
if (label) colors.set(label, color ?? null);
if (name && name !== label) colors.set(name, color ?? null);
}
return colors;
};
export function compareLinePart(expected, actual, color) {
const issues = [];
nearArray(actual.bbox, expected.worldBBox, 1.5, "bbox", issues);
nearArray(actual.center, expected.center, 3, "center", issues);
if (actual.valid !== true) issues.push({ name: "valid", detail: actual.valid });
const actualColor = parseHex(color);
const expectedColor = expected.color;
if (!actualColor) {
issues.push({ name: "color", detail: { actual: color, expected: expectedColor } });
} else {
const worst = Math.max(...actualColor.map((value, index) => Math.abs(value - expectedColor[index])));
if (worst > 0.02) issues.push({ name: "color", detail: { actual: actualColor, expected: expectedColor, worst } });
}
return { name: expected.partName, label: expected.label, model: expected.model,
tolerance: 1.5, ok: issues.length === 0, issues };
}
export async function checkLineCheckpoint(filePath, expectedNames) {
const { objects } = await inspectFcstd(filePath);
const byLabel = new Map(objects.map(object => [object.label, object]));
const colors = readDocumentColors(filePath);
const results = [];
for (const name of expectedNames) {
const expected = partByName.get(name);
if (!expected) throw new Error(`line-spec has no part ${name}`);
const actual = byLabel.get(name) ?? objects.find(object => object.name === name);
if (!actual) {
results.push({ name, ok: false, issues: [{ name: "missing", detail: expected.label }] });
continue;
}
results.push(compareLinePart(expected, actual, colors.get(actual.label) ?? colors.get(actual.name)));
}
const extra = objects.filter(object => !expectedNames.includes(object.label)).map(object => object.label);
const built = objects.filter(object => expectedNames.includes(object.label));
const models = [];
for (const model of spec.models) {
const names = model.parts.map(part => part.partName).filter(partName => expectedNames.includes(partName));
if (!names.length) continue;
const builtParts = built.filter(object => names.includes(object.label));
const issues = [];
nearArray(
builtParts.length ? [0, 1, 2].map(axis => Math.min(...builtParts.map(object => object.bbox[axis])))
.concat([0, 1, 2].map(axis => Math.max(...builtParts.map(object => object.bbox[axis + 3])))) : [],
[model.overallBBox[0], model.overallBBox[1], model.overallBBox[2],
model.overallBBox[3], model.overallBBox[4], model.overallBBox[5]],
model.parts.length <= 2 ? 2 : 5, "model-bbox", issues);
models.push({ name: model.name, label: model.label, parts: names.length, ok: issues.length === 0, issues });
}
return {
schema: "freecad-web-line-course/precision/v1",
objectCount: objects.length,
extra,
results,
models,
ok: results.every(result => result.ok) && extra.length === 0 && models.every(model => model.ok),
};
}
export function loadLineSpec() { return spec; }
export function lineModel(name) { return modelByName.get(name); }

View File

@@ -0,0 +1,92 @@
// Shared "build models -> save checkpoint -> precision" flow for line episodes.
// Scene ids: S00 title (driver), S01 document/checkpoint, S02.. build chunks of
// two parts, then S<last> save. Episode scripts use the same ids.
import fs from "node:fs";
import path from "node:path";
import { saveCheckpoint } from "../../carrier-course/lib/ui-actions.mjs";
import { createBuilder } from "./build.mjs";
import { newDocument, spec } from "./ui.mjs";
import { checkLineCheckpoint } from "./line-precision.mjs";
export async function buildEpisodeModels({
page, rec, webRoot, rawDir, stillsDir, scene, shot, logStep, log = [],
episodeId, modelNames, freshDocument = false,
}) {
const course = JSON.parse(fs.readFileSync(path.join(webRoot, "tools", "line-course", "course.json"), "utf8"));
const episode = course.episodes.find(item => item.id === episodeId);
if (!episode) throw new Error(`course.json has no episode ${episodeId}`);
const parts = modelNames.flatMap(name => {
const model = spec().models.find(item => item.name === name);
if (!model) throw new Error(`line-spec has no model ${name}`);
return model.parts;
});
const expectedNames = episode.checkpointObjects;
const builder = createBuilder({ page, rec, logStep });
await scene("S01", async () => {
if (freshDocument) {
await newDocument(page);
} else {
// Checkpoint loading is asynchronous; wait for the expected number of
// previous objects before creating anything, otherwise the new Box can
// be confused with an existing object (seen with COURSE_FAST=1).
const priorCount = expectedNames.length - parts.length;
for (let attempt = 0; attempt < 120; attempt++) {
const labels = await builder.labels();
if (labels.filter(label => expectedNames.includes(label)).length >= priorCount) break;
await page.waitForTimeout(500);
}
}
logStep({ step: "start", episode: episodeId, labels: await builder.labels(), freshDocument });
await shot("S01-start");
});
const buildPart = async part => {
const dims = part.fcLocalDims;
if (part.primitive === "cylinder") {
// Use the average radius so slightly elliptical references stay inside
// the 1.5 mm bbox tolerance on both axes (ABB_P03: 219.36 x 214.92).
const radius = Math.max(0.1, (dims[0] + dims[1]) / 4);
const position = [part.center[0], part.center[1], part.position[2]];
await builder.createCylinder(part.partName, radius, dims[2], position);
} else {
await builder.createBox(part.partName, dims, part.position);
}
await builder.setColor(part.partName, part.color);
logStep({ step: "part", name: part.partName, dims, position: part.position,
primitive: part.primitive, color: part.color });
};
const sceneIds = [];
for (let index = 0; index < parts.length; index += 2) {
const id = `S${String(2 + index / 2).padStart(2, "0")}`;
sceneIds.push(id);
const slice = parts.slice(index, index + 2);
await scene(id, async () => {
for (const part of slice) await buildPart(part);
await shot(`${id}-parts`);
});
}
const saveId = `S${String(2 + sceneIds.length).padStart(2, "0")}`;
await scene(saveId, async () => {
const saved = await saveCheckpoint({ page, rec, webRoot, episode: episodeId, rawDir,
checkpointDir: path.join(webRoot, "tools", "line-course", "checkpoints"),
expectedLabels: expectedNames });
logStep({ step: "checkpoint", ...saved });
const checkpoint = path.join(webRoot, "tools", "line-course", "checkpoints", `${episodeId}.FCStd`);
const precision = await checkLineCheckpoint(checkpoint, expectedNames);
fs.writeFileSync(path.join(rawDir, `${episodeId}-precision.json`), `${JSON.stringify(precision, null, 2)}\n`);
if (!precision.ok) throw new Error(`precision failed: ${JSON.stringify({ extra: precision.extra,
models: precision.models.filter(item => !item.ok),
failures: precision.results.filter(item => !item.ok) })}`);
fs.writeFileSync(path.join(rawDir, `${episodeId}-state.json`), `${JSON.stringify({
schema: `freecad-web-line-course/${episodeId}/state/v1`,
generatedAt: new Date().toISOString(), models: modelNames, parts: parts.map(part => part.partName),
precision, log,
}, null, 2)}\n`);
await shot(`${saveId}-recap`);
});
return { parts, expectedNames, sceneIds, saveId };
}

View File

@@ -0,0 +1,81 @@
// Shared project-page actions for the production-line course drivers.
import fs from "node:fs";
import { fileURLToPath } from "node:url";
export const REFERENCE_DIR = "/home/mes123456/FreeCADWasmDev/working/GLTFmodel";
export const footerStatus = page => page.locator('footer [role="status"]').textContent().catch(() => "");
export const treeLabels = page => page.locator(".fc-tree-text").allTextContents();
export async function newDocument(page) {
await page.locator('nav[aria-label="Application menus"] details').filter({ hasText: "File" }).locator("summary").click();
await page.getByRole("button", { name: "新建 Document" }).click();
await page.waitForTimeout(2000);
// The File details menu stays open otherwise and covers the tree/toolbar in
// every subsequent still; close it after creating the document.
await page.evaluate(() => {
for (const details of document.querySelectorAll('nav[aria-label="Application menus"] details[open]')) details.open = false;
});
await page.waitForTimeout(250);
}
export async function openFiles(page) {
await page.evaluate(() => {
const details = document.querySelector(".file-tools");
if (details) details.open = true;
});
await page.waitForTimeout(300);
}
export async function importReference(page, file, timeoutSeconds = 180) {
await openFiles(page);
await page.locator('input[aria-label="Import SCAD, CSG, JT, PLMXML, STEPZ, 3MF or shape files"]').setInputFiles(file);
let status = "";
for (let attempt = 0; attempt < timeoutSeconds; attempt++) {
await page.waitForTimeout(1000);
status = await footerStatus(page);
if (/Imported|failed|error|requires|cancel/i.test(status ?? "")) break;
}
return status;
}
export async function orbit(page, dx, dy) {
const view = page.locator('[aria-label="Imported native 3D view"]').first();
const box = await view.boundingBox();
if (!box) return false;
const x = box.x + box.width / 2; const y = box.y + box.height / 2;
await page.mouse.move(x, y);
await page.mouse.down();
await page.mouse.move(x + dx, y + dy, { steps: 18 });
await page.mouse.up();
await page.waitForTimeout(400);
return true;
}
export const spec = () => JSON.parse(fs.readFileSync(
fileURLToPath(new URL("../line-spec.json", import.meta.url)), "utf8"));
export const modelParts = name => {
const model = spec().models.find(item => item.name === name);
if (!model) throw new Error(`line-spec has no model ${name}`);
return model.parts;
};
export async function openLineReference(page) {
await page.getByRole("button", { name: "Toggle line reference viewer" }).click();
const panel = page.getByRole("complementary", { name: "Line reference viewer" });
await panel.waitFor({ state: "visible", timeout: 30000 });
return panel;
}
export async function selectReferenceModel(panel, page, label, expected = /个网格/) {
const select = panel.locator('select[aria-label="Reference model"]');
await select.selectOption({ label });
let footer = "";
for (let attempt = 0; attempt < 100; attempt++) {
await page.waitForTimeout(500);
footer = await panel.locator("footer").textContent().catch(() => "");
if (expected.test(footer ?? "")) return footer;
}
return footer;
}

View File

@@ -0,0 +1,35 @@
# 生产线参考零件表
生成时间:2026-11-12T18:03:40.094Z
模型数:27,教学部件数:88,三角面:996148
整线包围盒(mm):-2439.8, -2032.8, -1039.2, 2714.3, 1844.2, 1473.6
| 模型 | 文件 | 部件 | 尺寸 mm | 部件明细 |
|---|---|---|---|---|
| ABB IRB 120 机器人 | ABB_IRB_120.glb | 11 | 219×688×700 | ABB_IRB_120_P01(box,215×217×177); ABB_IRB_120_P02(box,123×101×145); ABB_IRB_120_P03(cylinder,219×215×431); ABB_IRB_120_P04(box,116×234×188); ABB_IRB_120_P05(box,62×111×82); ABB_IRB_120_P06(box,127×193×93); ABB_IRB_120_P07(box,96×5×96); ABB_IRB_120_P08(box,70×28×70); ABB_IRB_120_P09(box,94×38×73); ABB_IRB_120_P10(box,53×70×40); ABB_IRB_120_P11(box,30×54×34) |
| 工具坐标系 | Tool.glb | 3 | 72×72×72 | ToolFrame_P01(box,68×9×9); ToolFrame_P02(box,9×68×9); ToolFrame_P03(cylinder,9×9×68) |
| 主控制柜 | 三柜子.glb | 8 | 1500×744×754 | CabinetA_P01(box,440×134×597); CabinetA_P02(box,1500×744×754); CabinetA_P03(box,440×134×597); CabinetA_P04(box,30×560×560); CabinetA_P05(box,40×560×40); CabinetA_P06(box,40×560×40); CabinetA_P07(box,440×30×560); CabinetA_P08(box,440×30×560) |
| 长控制柜 | 三柜子1.glb | 8 | 2970×774×774 | CabinetB_P01(box,440×134×597); CabinetB_P02(box,1500×744×754); CabinetB_P03(box,440×134×597); CabinetB_P04(box,2960×640×20); CabinetB_P05(box,540×640×600); CabinetB_P06(box,40×560×40); CabinetB_P07(box,40×560×40); CabinetB_P08(box,440×30×560) |
| 三色警示灯 | 三色灯.glb | 2 | 50×40×468 | StackLight_P01(box,50×40×228); StackLight_P02(cylinder,40×40×240) |
| 上料机构 | 上料.glb | 2 | 375×140×212 | Loader_P01(box,165×140×212); Loader_P02(box,320×40×30) |
| 传送带送料装置 | 传送带送料装置.glb | 6 | 614×270×205 | ConveyorFeeder_P01(box,508×100×69); ConveyorFeeder_P02(box,45×153×34); ConveyorFeeder_P03(box,497×170×174); ConveyorFeeder_P04(box,395×165×205); ConveyorFeeder_P05(box,120×89×22); ConveyorFeeder_P06(box,175×9×7) |
| 原料上料装置 | 原料上料.glb | 5 | 210×208×204 | RawFeeder_P01(box,85×56×190); RawFeeder_P02(box,77×27×16); RawFeeder_P03(box,50×83×197); RawFeeder_P04(box,210×208×186); RawFeeder_P05(box,68×56×100) |
| 原料装配平台 | 原料装配.glb | 3 | 498×145×338 | RawAssembly_P01(box,498×92×338); RawAssembly_P02(box,71×79×128); RawAssembly_P03(box,193×5×5) |
| 原点标记 | 原点.glb | 3 | 142×142×142 | OriginMarker_P01(box,133×18×18); OriginMarker_P02(box,18×133×18); OriginMarker_P03(cylinder,18×18×133) |
| 地面与地线 | 地面平面.glb | 2 | 4867×3673×310 | GroundPlane_P01(box,4867×3673×310); GroundPlane_P02(box,4855×1109×0) |
| 夹取送料装置 | 夹取送料装置.glb | 5 | 1026×277×455 | PickFeeder_P01(box,149×60×60); PickFeeder_P02(box,420×200×442); PickFeeder_P03(box,810×72×82); PickFeeder_P04(box,243×143×119); PickFeeder_P05(box,70×59×141) |
| 地面平面 001 | 平面.001.glb | 2 | 4867×3673×310 | Plane001_P01(box,4867×3673×310); Plane001_P02(box,4855×1109×0) |
| 地面平面 | 平面.glb | 2 | 4867×3673×310 | Plane_P01(box,4867×3673×310); Plane_P02(box,4855×1109×0) |
| 推料装置 | 推料装置.glb | 2 | 490×336×588 | Pusher_P01(box,490×230×85); Pusher_P02(box,150×336×533) |
| 料仓 | 料仓.glb | 2 | 280×250×200 | Hopper_P01(box,191×191×65); Hopper_P02(box,280×250×200) |
| 新版检测块 | 新版2.glb | 1 | 22×22×7 | SensorBlock_P01(box,22×22×7) |
| 旋转运送装置 | 旋转运送装置.glb | 2 | 537×536×202 | RotaryTransfer_P01(box,340×265×165); RotaryTransfer_P02(box,537×536×47) |
| 显示屏 A | 显示屏.glb | 2 | 249×161×312 | DisplayA_P01(box,249×161×312); DisplayA_P02(box,204×116×148) |
| 显示屏 B | 显示屏1.glb | 2 | 249×161×312 | DisplayB_P01(box,249×161×312); DisplayB_P02(box,204×116×148) |
| 柜门 | 柜门.glb | 1 | 30×560×560 | CabinetDoor_P01(box,30×560×560) |
| 检测台 | 检测台.glb | 1 | 75×148×325 | InspectionTable_P01(box,75×148×325) |
| 物料存储区 | 物料存储区.glb | 5 | 352×83×413 | MaterialStore_P01(box,40×40×30); MaterialStore_P02(box,352×83×413); MaterialStore_P03(box,40×40×30); MaterialStore_P04(box,40×40×30); MaterialStore_P05(box,40×40×30) |
| 称重平台 | 称重平台.glb | 2 | 200×199×175 | WeighPlatform_P01(box,200×199×170); WeighPlatform_P02(box,150×150×5) |
| 辅助夹爪 | 辅助夹爪.glb | 3 | 73×94×102 | AuxGripper_P01(box,73×94×38); AuxGripper_P02(box,40×53×70); AuxGripper_P03(box,34×30×54) |
| 运送支架 | 运送支架.glb | 1 | 60×114×310 | TransportBracket_P01(box,60×114×310) |
| 运送检测装置 | 运送检测装置.glb | 2 | 75×148×325 | TransportInspector_P01(box,75×148×325); TransportInspector_P02(cylinder,30×30×60) |

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,32 @@
{
"schema": "freecad-web-line-course/overrides/v1",
"models": {
"ABB_IRB_120.glb": { "courseName": "ABB_IRB_120", "label": "ABB IRB 120 机器人", "budget": 11 },
"Tool.glb": { "courseName": "ToolFrame", "label": "工具坐标系", "budget": 3, "groupBy": "axis" },
"原点.glb": { "courseName": "OriginMarker", "label": "原点标记", "budget": 3, "groupBy": "axis" },
"三柜子.glb": { "courseName": "CabinetA", "label": "主控制柜", "budget": 8 },
"三柜子1.glb": { "courseName": "CabinetB", "label": "长控制柜", "budget": 8 },
"三色灯.glb": { "courseName": "StackLight", "label": "三色警示灯", "budget": 2 },
"上料.glb": { "courseName": "Loader", "label": "上料机构", "budget": 2 },
"传送带送料装置.glb": { "courseName": "ConveyorFeeder", "label": "传送带送料装置", "budget": 6 },
"原料上料.glb": { "courseName": "RawFeeder", "label": "原料上料装置", "budget": 5 },
"原料装配.glb": { "courseName": "RawAssembly", "label": "原料装配平台", "budget": 3 },
"地面平面.glb": { "courseName": "GroundPlane", "label": "地面与地线", "budget": 2, "groupBy": "prefix", "prefixes": ["平面", "地线"] },
"夹取送料装置.glb": { "courseName": "PickFeeder", "label": "夹取送料装置", "budget": 5 },
"平面.001.glb": { "courseName": "Plane001", "label": "地面平面 001", "budget": 2, "groupBy": "prefix", "prefixes": ["平面", "地线"] },
"平面.glb": { "courseName": "Plane", "label": "地面平面", "budget": 2, "groupBy": "prefix", "prefixes": ["平面", "地线"] },
"推料装置.glb": { "courseName": "Pusher", "label": "推料装置", "budget": 2 },
"料仓.glb": { "courseName": "Hopper", "label": "料仓", "budget": 2 },
"新版2.glb": { "courseName": "SensorBlock", "label": "新版检测块", "budget": 1 },
"旋转运送装置.glb": { "courseName": "RotaryTransfer", "label": "旋转运送装置", "budget": 2 },
"显示屏.glb": { "courseName": "DisplayA", "label": "显示屏 A", "budget": 2 },
"显示屏1.glb": { "courseName": "DisplayB", "label": "显示屏 B", "budget": 2 },
"柜门.glb": { "courseName": "CabinetDoor", "label": "柜门", "budget": 1 },
"检测台.glb": { "courseName": "InspectionTable", "label": "检测台", "budget": 1 },
"物料存储区.glb": { "courseName": "MaterialStore", "label": "物料存储区", "budget": 5 },
"称重平台.glb": { "courseName": "WeighPlatform", "label": "称重平台", "budget": 2 },
"辅助夹爪.glb": { "courseName": "AuxGripper", "label": "辅助夹爪", "budget": 3 },
"运送支架.glb": { "courseName": "TransportBracket", "label": "运送支架", "budget": 1 },
"运送检测装置.glb": { "courseName": "TransportInspector", "label": "运送检测装置", "budget": 2 }
}
}

View File

@@ -0,0 +1,141 @@
#!/usr/bin/env node
// Generic course episode recorder. Usage:
// DISPLAY=:2 node .../record.mjs --episode E01 [--smoke]
// The episode driver performs the real UI actions; this file owns browser,
// OPFS seeding, X11 capture, markers and session evidence.
import fs from "node:fs";
import path from "node:path";
import { fileURLToPath, pathToFileURL } from "node:url";
import { createCourseRecording } from "../carrier-course/lib/recording.mjs";
import { seedOpfsFromBytes, listOpfsFiles } from "../carrier-course/lib/opfs.mjs";
const here = path.dirname(fileURLToPath(import.meta.url));
const webRoot = path.resolve(here, "../..");
const args = process.argv.slice(2);
const option = (name, fallback = "") => {
const index = args.indexOf(name);
return index < 0 ? fallback : args[index + 1] ?? fallback;
};
const smoke = args.includes("--smoke");
const episodeId = option("--episode");
if (!episodeId) throw new Error("--episode is required (for example --episode E01)");
const course = JSON.parse(fs.readFileSync(path.join(here, "course.json"), "utf8"));
const episode = course.episodes.find(item => item.id === episodeId);
if (!episode) throw new Error(`unknown episode ${episodeId}`);
const driverPath = path.join(here, "episodes", episodeId, "driver.mjs");
if (!fs.existsSync(driverPath)) throw new Error(`missing driver ${driverPath}`);
const script = JSON.parse(fs.readFileSync(path.join(here, "episodes", episodeId, "script.zh.json"), "utf8"));
// A scene must stay on screen at least as long as its narration; otherwise the
// assembler trims the tail of the voice-over. Run generate-tts before recording.
const durationsFile = path.join(here, "episodes", episodeId, "audio-durations.json");
if (fs.existsSync(durationsFile)) {
const durations = JSON.parse(fs.readFileSync(durationsFile, "utf8")).scenes ?? {};
for (const scene of script.scenes) {
const audio = durations[scene.id]?.duration;
if (typeof audio === "number") scene.target = Math.max(scene.target ?? 0, Math.ceil(audio + 1.5));
}
}
const rawDir = path.join(here, "raw", episodeId);
const stillsDir = path.join(here, "stills", episodeId);
fs.mkdirSync(rawDir, { recursive: true });
fs.mkdirSync(stillsDir, { recursive: true });
const appOrigin = course.appOrigin;
const projectUrl = `${appOrigin}/project.html?workbench=${encodeURIComponent(episode.workbench)}`;
const pageForEpisode = () => {
if (episode.page === "project") return projectUrl;
if (episode.page === "assembly") return `${appOrigin}/workbench.html?module=Assembly&command=Assembly_CreateAssembly`;
if (episode.page === "techdraw") return `${appOrigin}/workbench.html?module=TechDraw&command=TechDraw_PageDefault`;
if (episode.page === "fem") return `${appOrigin}/workbench.html?module=Fem&document=FemDeck`;
return projectUrl;
};
const checkpointName = episode.checkpointIn ? `line-course-${episode.checkpointIn}.FCStd` : null;
const referenceGlbDir = "/home/mes123456/FreeCADWasmDev/working/GLTFmodel";
const targetUrl = checkpointName
? `${pageForEpisode()}&fcstd=${encodeURIComponent(checkpointName)}`
: pageForEpisode();
const rec = createCourseRecording({
rawDir,
schema: `freecad-web-line-course/${episodeId}`,
url: `${appOrigin}/project.html`,
smoke,
});
const page = await rec.open();
// Reference GLBs stay in working/GLTFmodel and are fulfilled per request, so
// the 197 MB set is never copied into public/ or dist/.
await page.route("**/line-glb/*.glb", route => {
const name = decodeURIComponent(new URL(route.request().url()).pathname.split("/").pop() ?? "");
const file = path.join(referenceGlbDir, name);
if (!fs.existsSync(file)) return route.fulfill({ status: 404, body: "missing" });
return route.fulfill({ status: 200, contentType: "model/gltf-binary", body: fs.readFileSync(file) });
});
const driver = await import(pathToFileURL(driverPath).href);
if (typeof driver.run !== "function") throw new Error(`${driverPath} must export run(context)`);
async function waitForProjectReady() {
if (episode.page && episode.page !== "project") {
await page.waitForFunction(() => Boolean(window.__freecadWorkbenchState), null, { timeout: 180000 });
await page.waitForTimeout(800);
return;
}
await page.waitForSelector('select[aria-label="Workbench"]', { timeout: 180000 });
await page.waitForSelector('[aria-label="Imported native 3D view"]', { timeout: 180000 });
await page.waitForTimeout(800);
}
try {
await page.waitForLoadState("domcontentloaded", { timeout: 180000 });
await page.waitForTimeout(600);
if (checkpointName) {
const checkpointPath = path.join(here, "checkpoints", `${episodeId}-in.FCStd`);
const fallback = path.join(here, "checkpoints", `${episode.checkpointIn}.FCStd`);
const file = fs.existsSync(checkpointPath) ? checkpointPath : fallback;
if (!fs.existsSync(file)) throw new Error(`missing checkpoint for ${episodeId}: ${file}`);
await seedOpfsFromBytes(page, checkpointName, fs.readFileSync(file));
console.log(JSON.stringify({ seeded: checkpointName, bytes: fs.statSync(file).size }));
}
await page.goto(targetUrl, { waitUntil: "domcontentloaded", timeout: 180000 });
await waitForProjectReady();
if (!smoke) await rec.startCapture();
const context = { page, rec, episode, course, script, stillsDir, rawDir, webRoot, appOrigin, smoke };
rec.mark("episode-start", { episode: episodeId, url: targetUrl });
await driver.run(context);
rec.mark("end", { episode: episodeId });
const opfsDocs = await listOpfsFiles(page, "freecad-documents").catch(() => []);
fs.writeFileSync(path.join(rawDir, "session.json"), `${JSON.stringify({
schema: `freecad-web-line-course/${episodeId}/session/v1`,
generatedAt: new Date().toISOString(),
episode: episodeId,
title: episode.title,
url: targetUrl,
smoke,
markers: rec.state.markers.length,
pageErrors: rec.state.pageErrors,
consoleErrors: rec.state.consoleErrors,
failedResponses: rec.state.failedResponses,
opfsDocuments: opfsDocs,
}, null, 2)}\n`);
await rec.close();
console.log(JSON.stringify({
ok: true,
episode: episodeId,
markers: rec.state.markers.length,
pageErrors: rec.state.pageErrors.length,
consoleErrors: rec.state.consoleErrors.length,
opfsDocuments: opfsDocs,
capture: rec.state.capturePath,
}));
process.exitCode = rec.state.pageErrors.length ? 1 : 0;
} catch (error) {
rec.mark("failure", { message: String(error?.message ?? error).slice(0, 400) });
await page.screenshot({ path: path.join(rawDir, "failure.png"), fullPage: false }).catch(() => {});
const labels = await page.locator(".fc-tree-text").allTextContents().catch(() => []);
const status = await page.locator("p.status").first().textContent().catch(() => "");
console.error(JSON.stringify({ ok: false, episode: episodeId, error: String(error?.stack ?? error), labels, status }));
await rec.close().catch(() => {});
process.exitCode = 1;
}

View File

@@ -0,0 +1,25 @@
#!/bin/bash
# Sequential TTS -> record -> assemble -> verify for the remaining line episodes.
# Run in the background; each step appends to evidence/media-batch.log.
set -u
ROOT=/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course
LOG="$ROOT/evidence/media-batch.log"
mkdir -p "$ROOT/evidence"
: > "$LOG"
for ep in E02 E03 E04 E05 E06 E07 E08 E09 E10 E11 E12 E13 E14 E15 E16 E17 E18; do
echo "=== $ep start $(date -Iseconds) ===" >> "$LOG"
if ! node "$ROOT/generate-tts.mjs" --episode "$ep" >> "$LOG" 2>&1; then
echo "=== $ep TTS FAILED ===" >> "$LOG"; continue
fi
if ! DISPLAY=:2 node "$ROOT/record.mjs" --episode "$ep" >> "$LOG" 2>&1; then
echo "=== $ep RECORD FAILED ===" >> "$LOG"; continue
fi
if ! node "$ROOT/assemble.mjs" --episode "$ep" >> "$LOG" 2>&1; then
echo "=== $ep ASSEMBLE FAILED ===" >> "$LOG"; continue
fi
if ! node "$ROOT/verify.mjs" --episode "$ep" >> "$LOG" 2>&1; then
echo "=== $ep VERIFY FAILED ===" >> "$LOG"; continue
fi
echo "=== $ep DONE $(date -Iseconds) ===" >> "$LOG"
done
echo "=== ALL DONE $(date -Iseconds) ===" >> "$LOG"

View File

@@ -0,0 +1,111 @@
#!/usr/bin/env python3
"""Samples embedded GLB base-color textures to representative sRGB colours.
Most line GLBs reference a baseColorTexture without a baseColorFactor, so the
material colour cannot be read from the JSON alone. This script decodes each
embedded image with Pillow, averages it (after downsampling), multiplies by the
factor when present, and writes material-colors.json for build-line-spec.mjs.
Usage: python3 -I sample-material-colors.py [sourceDir] [outFile]
"""
import io
import json
import os
import struct
import sys
from PIL import Image
here = os.path.dirname(os.path.abspath(__file__))
source_dir = sys.argv[1] if len(sys.argv) > 1 else "/home/mes123456/FreeCADWasmDev/working/GLTFmodel"
out_file = sys.argv[2] if len(sys.argv) > 2 else os.path.join(here, "material-colors.json")
def read_glb(path):
with open(path, "rb") as handle:
handle.read(12)
gltf = None
binary = b""
while True:
header = handle.read(8)
if len(header) < 8:
break
length, kind = struct.unpack("<II", header)
payload = handle.read(length)
if kind == 0x4E4F534A:
gltf = json.loads(payload.decode("utf-8"))
elif kind == 0x004E4942:
binary = payload
return gltf, binary
def image_bytes(gltf, binary, image_index):
image = gltf.get("images", [])[image_index]
if "bufferView" in image:
view = gltf["bufferViews"][image["bufferView"]]
start = view.get("byteOffset", 0)
return binary[start:start + view["byteLength"]]
uri = image.get("uri", "")
if uri.startswith("data:"):
import base64
return base64.b64decode(uri.split(",", 1)[1])
return b""
def average_srgb(payload):
with Image.open(io.BytesIO(payload)) as image:
image = image.convert("RGB")
image.thumbnail((64, 64))
pixels = list(image.getdata())
count = max(1, len(pixels))
rgb = [sum(pixel[channel] for pixel in pixels) / count for channel in range(3)]
return [round(value / 255.0, 4) for value in rgb]
def material_color(gltf, binary, index):
material = gltf.get("materials", [])[index]
pbr = material.get("pbrMetallicRoughness", {})
factor = pbr.get("baseColorFactor", [1.0, 1.0, 1.0, 1.0])[:3]
texture_info = pbr.get("baseColorTexture")
if texture_info is not None:
texture = gltf.get("textures", [])[texture_info["index"]]
image_index = texture.get("source")
if image_index is not None:
try:
sampled = average_srgb(image_bytes(gltf, binary, image_index))
return {
"srgb": [round(sampled[channel] * factor[channel], 4) for channel in range(3)],
"source": "textureAvg",
}
except Exception as error: # noqa: BLE001 - record and fall back
return {"srgb": [round(value, 4) for value in factor], "source": "factorFallback",
"error": str(error)[:120]}
return {"srgb": [round(value, 4) for value in factor], "source": "baseColorFactor"}
def main():
result = {}
failures = []
for name in sorted(os.listdir(source_dir)):
if not name.lower().endswith(".glb"):
continue
try:
gltf, binary = read_glb(os.path.join(source_dir, name))
except Exception as error: # noqa: BLE001
failures.append({"file": name, "error": str(error)[:120]})
continue
entry = {}
for index in range(len(gltf.get("materials", []))):
entry[str(index)] = material_color(gltf, binary, index)
result[name] = entry
with open(out_file, "w", encoding="utf-8") as handle:
json.dump({"schema": "freecad-web-line-course/material-colors/v1",
"sourceDir": source_dir, "files": result, "failures": failures},
handle, ensure_ascii=False, indent=1)
print(json.dumps({"ok": True, "outFile": out_file, "files": len(result),
"materials": sum(len(value) for value in result.values()),
"failures": len(failures)}, ensure_ascii=False))
if __name__ == "__main__":
main()

View File

@@ -0,0 +1,29 @@
// Checks production-line-assembly.html and captures the hero screenshot.
import fs from "node:fs";
import path from "node:path";
import { createRequire } from "node:module";
import { fileURLToPath } from "node:url";
const here = path.dirname(fileURLToPath(import.meta.url));
const webRoot = path.resolve(here, "../../..");
const require = createRequire(path.join(webRoot, "package.json"));
const { chromium } = require("playwright");
const url = "http://127.0.0.1:5190/cases/production-line-assembly.html";
const browser = await chromium.launch({ executablePath: "/usr/bin/google-chrome", headless: true,
args: ["--no-sandbox", "--enable-unsafe-swiftshader", "--use-gl=angle", "--use-angle=swiftshader"] });
const page = await browser.newPage({ viewport: { width: 1600, height: 900 } });
const errors = []; const failed = [];
page.on("pageerror", error => errors.push(String(error)));
page.on("console", message => { if (message.type() === "error") errors.push(message.text().slice(0, 200)); });
page.on("response", response => { if (response.status() >= 400) failed.push(`${response.status()} ${response.url()}`); });
const report = { schema: "freecad-web-line-course/assembly-page/v1", url, errors, failed };
await page.goto(url, { waitUntil: "load", timeout: 120000 });
await page.waitForFunction(() => window.__lineAssemblyReady === true, null, { timeout: 180000 });
await page.waitForTimeout(1200);
report.stats = await page.evaluate(() => window.__lineAssemblyStats);
report.filters = await page.locator('select[aria-label="Filter model"] option').count();
await page.screenshot({ path: path.join(webRoot, "teaching", "cases", "production-line-assembly.png") });
report.ok = report.stats?.loaded === 88 && report.stats?.models === 27 && report.filters === 28
&& errors.length === 0 && failed.length === 0;
fs.writeFileSync(path.join(here, "..", "evidence", "assembly-page.json"), `${JSON.stringify(report, null, 2)}\n`);
console.log(JSON.stringify(report));
await browser.close();

Some files were not shown because too many files have changed in this diff Show More