feat(carrier): 航空母舰 PartDesign 有头创建工具包与初学者教学

- 新数据链 web/teaching/cases/carrier-partdesign:20 件零件(spec.json 唯一来源)、
  内核建造器 parts/*.mjs、traces/FCStd/replay 全量产物;装配 20 插入 + 19 关节。
- 工具包 tools/carrier:catalog / preflight / create-part / create-assembly /
  create-all / list / self-test / README,按零件与装配拆分为独立工具。
- 共享驱动扩展 web/tools/cad-ui-rebuild:Loft/Pipe/Hole/Fillet/Chamfer/Mirrored/
  LinearPattern 交互,Reversed 复选框补齐;装配 saveAssemblyBundle 先 Accept 再保存。
- 教学:lessons.mjs 新增 carrier 组(环境课 + 20 件 + 装配),suite-runner 增加
  carrier-part/carrier-assembly,生成 carrier-toolkit.html 并接入 index 与控制台证据。

验证:20 件 210 步全部有头通过(P05 修复后 39640 m³;P06 回归 8/8);
装配 20/20 插入、19/19 关节、20 组件 0 畸形、0 mismatch;check:carrier、
check:reducer、check-console --live 全绿。

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
2026-11-25 18:46:27 +08:00
parent b876ad5742
commit 87b2a6cb8a
335 changed files with 80492 additions and 5 deletions

View File

@@ -9,10 +9,12 @@
*/
import { groups as reducerGroups, parts as reducerParts } from "../../../tools/reducer/catalog.mjs";
import { groups as carrierGroups, parts as carrierParts } from "../../../tools/carrier/catalog.mjs";
export const GROUPS = [
{ id: "basics", title: "准备:让环境可用", workbench: "系统", blurb: "先证明 dist、Chrome、显示和静态服务都就绪,再谈功能。" },
{ id: "reducer", title: "二级减速器:逐件建模", workbench: "Reducer", blurb: "23 个零件各自一课,在真实界面里从头建出来;最后是装配课。" },
{ id: "carrier", title: "航空母舰:逐件建模与装配", workbench: "Carrier", blurb: "20 个 PartDesign 零件(舰体、甲板、舰岛、舰载机…)各一课,再装配成整舰。" },
{ id: "shell", title: "壳层与入口", workbench: "Shell", blurb: "COOP/COEP 隔离、工作台外壳、命令面板与偏好——所有功能的前提。" },
{ id: "part", title: "Part:参数化零件", workbench: "Part", blurb: "图元、布尔、任务面板;最直观的建模入口。" },
{ id: "partdesign", title: "PartDesign:实体特征", workbench: "PartDesign", blurb: "Body、草图、Pad 与边缘特征、Thickness。" },
@@ -265,6 +267,57 @@ function volumeText(volume) {
return volume == null ? "—" : `${Math.round(volume).toLocaleString("en-US")} mm³`;
}
/**
* The 20-part carrier curriculum, read from tools/carrier/catalog.mjs.
*
* Same shape as the reducer, with two differences that matter to a beginner:
* every part lives in one shared ship coordinate system (so each one is shown
* where it sits on the vessel), and the last lesson assembles all 20 into one
* document with 19 fixed joints.
*/
function carrierLessons() {
const parts = carrierParts();
const byGroup = new Map(carrierGroups().map((group) => [group.id, group.label]));
const intro = {
id: "lesson-carrier-environment",
groupId: "carrier",
title: "航母 · 工具与前置自检(不启动浏览器)",
level: "入门",
durationMin: 1,
summary: "先确认 20 件零件的界面步骤、构建记录与源文档齐全,再谈重建。本课用 dry run 只做前置检查,不打开 Chrome。",
sees: ["零件清单、步数、记录体积与缺失项", "缺项时可直接执行的修复命令"],
expect: "前置全部满足;缺项判「前置失败」,不算产品失败。",
job: { kind: "carrier-part", partId: parts[0]?.id ?? "P01", dry: true },
};
const perPart = parts.map((part) => {
const system = byGroup.get(part.system) ?? part.systemLabel ?? part.system;
const features = part.featureTypes?.length ? `特征:${part.featureTypes.join("、")}。` : "";
return {
id: `lesson-carrier-${part.id.toLowerCase()}`,
groupId: "carrier",
title: `${part.id} · ${part.title}`,
level: part.steps <= 4 ? "入门" : "进阶",
durationMin: Math.max(3, Math.round(part.steps * 1.5) + 2),
summary: `在真实界面里重建 ${part.document}(${system}):共 ${part.steps} 步。${features}完成后界面算出的体积应与构建记录 ${volumeText(part.volume)} 一致。`,
sees: ["PartDesign 草图 → 特征 → 修整的逐步骤操作", "每步截图与最终体积对比"],
expect: `create-part ${part.id} 判 pass(体积相对误差在引擎容差内)。`,
job: { kind: "carrier-part", partId: part.id },
};
});
const assembly = {
id: "lesson-carrier-assembly",
groupId: "carrier",
title: "装配 · 20 件合成航空母舰",
level: "进阶",
durationMin: 20,
summary: "新建装配文档 CarrierAssembly,按舰体坐标系逐个插入 20 个零件链接,接地舰体,为其余 19 件各建一个固定关节再求解。",
sees: ["插入面板逐个装载源文档并保持统一位姿", "19 个固定关节与求解后的组件位形"],
expect: "create-assembly 判 pass:插入 20/20、关节 19/19、求解组件无畸形、无失配。",
job: { kind: "carrier-assembly" },
};
return [intro, ...perPart, assembly];
}
/** The 23-part reducer curriculum comes from the toolkit catalog, not a copy. */
function reducerLessons() {
const parts = reducerParts();
@@ -308,7 +361,7 @@ function reducerLessons() {
}
export function buildLessons(catalog) {
const lessons = [...CORE_LESSONS, ...reducerLessons(), ...chapterLessons(catalog), ...moduleLessons(catalog), ...crosscutLessons(catalog)];
const lessons = [...CORE_LESSONS, ...reducerLessons(), ...carrierLessons(), ...chapterLessons(catalog), ...moduleLessons(catalog), ...crosscutLessons(catalog)];
const seen = new Set();
for (const lesson of lessons) {
if (seen.has(lesson.id)) throw new Error(`课程 id 重复:${lesson.id}`);