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,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,记录文件名与大小。"
}
}