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>
151
web/tools/cad-ui-rebuild/README.md
Normal file
@@ -0,0 +1,151 @@
|
||||
# cad-ui-rebuild · 在真实界面上重建 CAD 模型
|
||||
|
||||
把一个已经建好的 FreeCAD 工程**在 Web FreeCAD 的真实界面上一步一步重做一遍**,
|
||||
并证明重做结果与原始模型数值一致。用于:
|
||||
|
||||
- 给工程生成「照着点就能做出来」的界面操作说明与截图;
|
||||
- 回归验证界面没有退化(同样的输入必须得到同样的体积);
|
||||
- 培训材料,每一帧都是真实界面而不是示意图。
|
||||
|
||||
## 它做什么
|
||||
|
||||
对工程里的每个零件:
|
||||
|
||||
1. `build-steps` — 从该零件的构建记录 + 成品 FCStd 抽出**每一步的界面参数**
|
||||
(草图几何、约束、特征参数、位置、朝向)。
|
||||
2. `drive` — 打开浏览器,像人一样逐步点按钮、填字段,每步截一张图,
|
||||
并把界面算出的体积与构建记录比对。
|
||||
3. `assemble` — 新建装配体,把每个零件按位置和旋转插入。
|
||||
4. `accept` — 只读证据文件,判定上面三步是否真的成立。
|
||||
|
||||
## 三步接入一个新工程
|
||||
|
||||
### 1. 准备数据
|
||||
|
||||
工程目录里需要:
|
||||
|
||||
```
|
||||
<project>/
|
||||
project.json ← 唯一手写的文件,见下
|
||||
project.json.paths.replayDir/ <零件名>.json 每个零件的构建记录
|
||||
.../sampleDir/ <零件名>.FCStd 成品文件
|
||||
```
|
||||
|
||||
构建记录的每一步形如:
|
||||
|
||||
```json
|
||||
{ "step": 3, "label": "outer pad", "action": "setFeature",
|
||||
"args": { "object": "HousingBlock", "featureType": "Pad",
|
||||
"profile": "OuterProfile", "length": 260, "midplane": false },
|
||||
"volume": 26885040 }
|
||||
```
|
||||
|
||||
`action` 支持 `setSketch` / `setFeature` / `setGear` / `setPrimitive` / `setTransform`。
|
||||
|
||||
### 2. 写 `project.json`
|
||||
|
||||
```json
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/project/v1",
|
||||
"name": "my-project",
|
||||
"appOrigin": "http://127.0.0.1:5180",
|
||||
"paths": {
|
||||
"replayDir": "replays",
|
||||
"sampleDir": "samples",
|
||||
"outDir": "out",
|
||||
"stillsDir": "ui-stills"
|
||||
},
|
||||
"parts": [
|
||||
{ "id": "P01", "document": "MyPart", "title": "我的零件" }
|
||||
],
|
||||
"assembly": { "document": "MyAssembly", "groundDocument": "MyPart" }
|
||||
}
|
||||
```
|
||||
|
||||
- `paths.replayName`:记录文件名模式,`{document}` 会被替换。默认 `<document>.json`;
|
||||
记录另有命名的工程写 `"replayName": "trace-{document}.json"` 即可,不必改代码。
|
||||
- `paths.outDir` / `stillsDir`:产物位置,相对清单所在目录。
|
||||
- `pages`:每种命令在哪个页面。默认全部 `partdesign.html`(唯一同时有草图和特征的面板)。
|
||||
- `featureCommands`:特征类型到命令名的映射。默认已含 Pad/Pocket/Revolution/Groove。
|
||||
- `assembly` 可省略;省略则 `assemble.mjs` 与装配验收自动跳过。
|
||||
|
||||
### 3. 跑
|
||||
|
||||
```bash
|
||||
T=/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/cad-ui-rebuild
|
||||
|
||||
node $T/build-steps.mjs --project <project> # 生成 out/ui-steps/
|
||||
$T/sweep.sh --project <project> # 逐件驱动,产物在 out/ui-run/ 与 ui-stills/
|
||||
node $T/assemble.mjs --project <project> # 可选:装配
|
||||
node $T/accept.mjs --project <project> # 验收
|
||||
```
|
||||
|
||||
**想看着它做**:给 `drive.mjs` 加 `--headed`(再加 `--slow` 放慢)。
|
||||
界面会出现在 `DISPLAY` 指定的显示器上。
|
||||
|
||||
## 前置条件(不满足时先补,不要当作产品失败)
|
||||
|
||||
| 前置 | 怎么确认 |
|
||||
|---|---|
|
||||
| 应用在线 | `curl -s -o /dev/null -w '%{http_code}' $appOrigin/` 应为 `200` |
|
||||
| 内核产物就位 | `web/public/kernel/FreeCADWebPartDesignRuntimeProbe.{js,wasm}` 存在 |
|
||||
| 显示器非休眠 | `node capture-check.mjs --display :1` 输出 `"ok":true` |
|
||||
| 磁盘有余量 | 探针要读 130 MB wasm + 解压;剩余空间不足会静默卡死 |
|
||||
|
||||
显示器休眠时抓屏全是黑的。`capture-check.mjs` 用**均值 + 唯一颜色数**双判,
|
||||
因为休眠时残留的鼠标像素会让单看最大值的判据误判为正常。
|
||||
|
||||
## 输出
|
||||
|
||||
| 文件 | 内容 |
|
||||
|---|---|
|
||||
| `out/ui-steps/<document>.json` | 每步的完整界面参数 |
|
||||
| `out/ui-run/<document>.json` | 每步的实际体积 vs 期望体积、耗时、失败原因 |
|
||||
| `ui-stills/<id>/<scene>.png` | 每步一张真实界面截图 |
|
||||
| `out/ui-run/<assembly>-assembly.json` | 插入次数、旋转值、与记录的差异 |
|
||||
|
||||
## 为什么要这些字段
|
||||
|
||||
**朝向 `placementRotation`**:草图不总在 XY 平面上。壳体上的螺栓孔画在
|
||||
Y 方向的面上,键槽画在轴侧面。少这个字段,特征会"什么都没切",而体积只差几个百分点。
|
||||
|
||||
**圆弧角度精度**:`startAngle`/`endAngle` 是**弧度**。π 写成 `3.1416` 会让半径 41 的
|
||||
圆弧端点偏 1.6e-4 mm,远超 OCCT 的 1e-7 容差,轮廓闭合不上,挖切只得到一层薄片。
|
||||
本工具按 1e-9 保留。
|
||||
|
||||
**齿轮的 `position`**:齿轮表单的位置是独立的。不设就长在原点,与轴身重叠,
|
||||
体积只差 6%,不报错。
|
||||
|
||||
## 现成的工程清单
|
||||
|
||||
`projects/` 下已放好两份可直接使用的清单(详见 `projects/README.md`),
|
||||
覆盖仓库里现存的两代构建记录格式:
|
||||
|
||||
```bash
|
||||
node build-steps.mjs --project projects/secondary-reducer-pro.json
|
||||
node build-steps.mjs --project projects/secondary-reducer.json
|
||||
```
|
||||
|
||||
## 已知边界
|
||||
|
||||
- 只覆盖**建模 + 装配**。视频、配音、教案流水线不在这里。
|
||||
- `drive` 依赖中文界面文案(`新建文档`、`新建 Body`、`几何与约束`、`体积`)。
|
||||
- 装配的创建与插入走界面任务面板;关节与求解仍走工作台表单,尚未提供纯界面路径。
|
||||
|
||||
## 装配为什么去 `workbench.html`
|
||||
|
||||
`assembly.html` 是内核装配探针的夹具页(`src/assembly-slice.ts` 发
|
||||
`ASSEMBLY_*_FIXTURE` 请求,页面上那个 "Invalid type" 是它演示错误分支的按钮),
|
||||
没有创建与插入面板。真正的面板由 `src/workbench-shell.tsx` 按命令挂载:
|
||||
|
||||
| 面板 | 地址 |
|
||||
|---|---|
|
||||
| Create assembly | `workbench.html?module=Assembly&command=Assembly_CreateAssembly` |
|
||||
| Insert assembly link | `workbench.html?module=Assembly&command=Assembly_InsertLink` |
|
||||
|
||||
建完装配后插入面板自动挂出,无需再导航。需要把源 FCStd 放进 OPFS 的
|
||||
**`freecad-documents`**(不是 `freecad-exports`;后者是 STEP/STL 等导出物)。
|
||||
|
||||
插入面板的候选对象用复合键 `documentId:object`:不同零件文档里的对象常同名
|
||||
(减速器 23 件的实体都叫 `Body`),裸对象名作 option value 会让 23 个选项同值,
|
||||
每次插入都命中第一个打开的文档,而且什么错都不报。
|
||||
86
web/tools/cad-ui-rebuild/accept.mjs
Normal file
@@ -0,0 +1,86 @@
|
||||
#!/usr/bin/env node
|
||||
// Verify a project's evidence without re-running the browser.
|
||||
//
|
||||
// This is the tool's own acceptance profile: it answers "was every modelling
|
||||
// step actually performed through the UI, and did the UI produce the same
|
||||
// numbers as the scripted build?" from files on disk only.
|
||||
//
|
||||
// Usage: node accept.mjs --project <dir>
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { loadProject, projectFromArgv, readJson, replayPath } from "./manifest.mjs";
|
||||
import { readReplay } from "./lib/replay.mjs";
|
||||
import { stillName } from "./lib/stills.mjs";
|
||||
|
||||
const projectDir = projectFromArgv();
|
||||
const project = loadProject(projectDir, { requireParts: true });
|
||||
|
||||
const checks = [];
|
||||
const check = (id, name, ok, detail) => checks.push({ id, name, ok: Boolean(ok), detail });
|
||||
|
||||
const missing = [];
|
||||
const volumeMisses = [];
|
||||
const stepMismatches = [];
|
||||
const noStills = [];
|
||||
let totalSteps = 0;
|
||||
let partsSeen = 0;
|
||||
|
||||
for (const part of project.parts) {
|
||||
const stepsFile = path.join(project.paths.stepsDir, `${part.document}.json`);
|
||||
const runFile = path.join(project.paths.runDir, `${part.document}.json`);
|
||||
const replay = project.paths.replayDir ? readReplay(replayPath(project, part.document)) : null;
|
||||
|
||||
if (!fs.existsSync(stepsFile)) { missing.push(`${part.id}: no ui-steps`); continue; }
|
||||
partsSeen++;
|
||||
const steps = readJson(stepsFile).steps ?? [];
|
||||
totalSteps += steps.length;
|
||||
|
||||
if (replay && steps.length !== replay.steps.length)
|
||||
stepMismatches.push(`${part.id}: ${steps.length} ui steps vs ${replay.steps.length} replay steps`);
|
||||
for (const step of steps) if (!step.command) noStills.push(`${part.id} step ${step.step}: no command`);
|
||||
|
||||
// One still per step, named by the scene id the driver captured.
|
||||
const dir = path.join(project.paths.stillsDir, part.id);
|
||||
const files = fs.existsSync(dir) ? fs.readdirSync(dir).filter(name => name.endsWith(".png")) : [];
|
||||
if (!files.length) noStills.push(`${part.id}: no stills directory`);
|
||||
// Ask the same module the writer uses, so the checker cannot drift from it.
|
||||
for (const [index, step] of steps.entries()) {
|
||||
const stem = `${stillName(project, part, index, steps)}.png`;
|
||||
if (!files.includes(stem)) noStills.push(`${part.id} ${step.label} (${stem})`);
|
||||
}
|
||||
|
||||
if (!fs.existsSync(runFile)) { volumeMisses.push(`${part.id}: no ui-run evidence`); continue; }
|
||||
const run = readJson(runFile);
|
||||
if (!(run.steps === run.stepsTotal && run.failed === 0 && run.volumeMatches === true)) {
|
||||
const detail = run.steps === run.stepsTotal
|
||||
? `rel ${run.relativeError}` : `aborted at ${run.steps}/${run.stepsTotal ?? "?"}`;
|
||||
volumeMisses.push(`${part.id}: ${detail}`);
|
||||
}
|
||||
}
|
||||
|
||||
check("U1", "每件都有界面步骤清单", missing.length === 0, { missing: missing.slice(0, 8) });
|
||||
check("U2", "步骤数与回放一致且每步有命令", stepMismatches.length === 0 && noStills.every(item => !/no command/.test(item)),
|
||||
{ totalSteps, parts: partsSeen, mismatches: stepMismatches.slice(0, 8) });
|
||||
check("U3", "每步都有界面截图", noStills.filter(item => !/no command/.test(item)).length === 0,
|
||||
{ missing: noStills.slice(0, 8) });
|
||||
check("U4", "界面复现体积与回放一致(1e-6)", volumeMisses.length === 0, { failed: volumeMisses.slice(0, 8) });
|
||||
|
||||
if (project.assembly) {
|
||||
const reportFile = path.join(project.paths.runDir, `${project.assembly.document}-assembly.json`);
|
||||
if (!fs.existsSync(reportFile)) {
|
||||
check("U5", "装配经界面完成", false, { error: `no assembly report at ${reportFile}` });
|
||||
} else {
|
||||
const report = readJson(reportFile);
|
||||
check("U5", "装配插入完整且旋转保留",
|
||||
!report.fatal && report.mismatches?.length === 0
|
||||
&& report.inserted === report.expected?.inserts
|
||||
&& report.rotated === report.expected?.rotated,
|
||||
{ inserted: report.inserted, rotated: report.rotated, expected: report.expected,
|
||||
mismatches: (report.mismatches ?? []).slice(0, 6), fatal: report.fatal });
|
||||
}
|
||||
}
|
||||
|
||||
const failed = checks.filter(item => !item.ok);
|
||||
console.log(JSON.stringify({ passed: failed.length === 0, checks: checks.length, failed: failed.length,
|
||||
results: checks.map(item => ({ id: item.id, ok: item.ok, name: item.name, detail: item.ok ? undefined : item.detail })) }, null, 2));
|
||||
process.exitCode = failed.length ? 1 : 0;
|
||||
176
web/tools/cad-ui-rebuild/assemble.mjs
Normal file
@@ -0,0 +1,176 @@
|
||||
#!/usr/bin/env node
|
||||
// Build a project's assembly through the real UI.
|
||||
//
|
||||
// Everything a learner can click goes through the UI: create the assembly,
|
||||
// load each part document, insert it at a position and rotation, accept. Joints
|
||||
// and the solve still go through the workbench forms, in the order proven in
|
||||
// tools/line-manual/ui-assemble.mjs.
|
||||
//
|
||||
// Input: the project's assembly replay, which records every insertion as
|
||||
// {sourceDocument, sourceObject, position, rotation}. Nothing is invented: the
|
||||
// same replay the videos are cut from supplies the placement numbers.
|
||||
//
|
||||
// Usage: node assemble.mjs --project <dir> [--headed] [--dry]
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { createRequire } from "node:module";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { loadProject, projectFromArgv, readJson, replayPath } from "./manifest.mjs";
|
||||
import { createAssembly, createJoints, executeCommand, insertAll, insertedLinkCount, saveAssemblyBundle, solveAssembly, writeAssemblyReport, seedSources } from "./lib/assembly.mjs";
|
||||
|
||||
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 projectDir = projectFromArgv();
|
||||
const project = loadProject(projectDir, { requireAssembly: true });
|
||||
const args = process.argv.slice(2);
|
||||
const headed = args.includes("--headed");
|
||||
const dry = args.includes("--dry");
|
||||
|
||||
// The assembly replay lives beside the part replays and is identified by the
|
||||
// assembly document name, so a project needs no extra path setting.
|
||||
const replayFile = replayPath(project, project.assembly.document, { assembly: true });
|
||||
if (!fs.existsSync(replayFile)) throw new Error(`no assembly replay at ${replayFile}`);
|
||||
const replay = JSON.parse(fs.readFileSync(replayFile, "utf8"));
|
||||
const inserts = replay.steps.filter(step => step.insert).map(step => step.insert);
|
||||
if (!inserts.length) throw new Error(`assembly replay has no insertions: ${replayFile}`);
|
||||
|
||||
const rotated = inserts.filter(item => (item.rotation ?? [0, 0, 0, 1]).some((value, index) => index < 3 && value !== 0));
|
||||
const groundDocument = project.assembly.groundDocument ?? inserts[0]?.sourceDocument;
|
||||
|
||||
if (dry) {
|
||||
console.log(JSON.stringify({
|
||||
project: project.name, document: project.assembly.document,
|
||||
inserts: inserts.length, rotated: rotated.length, ground: groundDocument,
|
||||
sourceDocuments: [...new Set(inserts.map(item => item.sourceDocument))].length,
|
||||
}, null, 2));
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
const browser = await chromium.launch({
|
||||
executablePath: "/usr/bin/google-chrome", headless: !headed,
|
||||
args: ["--no-sandbox", "--disable-dev-shm-usage", "--enable-unsafe-swiftshader", "--use-gl=angle", "--use-angle=swiftshader"],
|
||||
});
|
||||
const page = await browser.newPage({ viewport: { width: 1600, height: 900 } });
|
||||
const errors = [];
|
||||
page.on("pageerror", error => errors.push(String(error).slice(0, 300)));
|
||||
page.on("console", message => { if (message.type() === "error") errors.push(message.text().slice(0, 300)); });
|
||||
|
||||
const started = Date.now();
|
||||
let done = [];
|
||||
let fatal = null;
|
||||
let joints = [];
|
||||
let solves = [];
|
||||
// Joints and the solve are optional replay content: a project that only inserts
|
||||
// links keeps the old report shape, and one that records joints gets them run
|
||||
// in replay order after the insertion session is committed.
|
||||
const jointSteps = replay.steps.filter(step => typeof step.action === "string" && step.action.startsWith("Assembly_CreateJoint"));
|
||||
const solveSteps = replay.steps.filter(step => step.action === "Assembly_SolveAssembly");
|
||||
// Saving is opt-in per project (`assembly.saveBundle`): it opens the BOM task
|
||||
// and clicks its own "Save FCStd" button, which stores to OPFS only.
|
||||
const bomSteps = project.assembly.saveBundle
|
||||
? replay.steps.filter(step => step.action === "Assembly_CreateBom") : [];
|
||||
let saved = null;
|
||||
try {
|
||||
// The Insert Link task only sees documents in the browser's OPFS, so the
|
||||
// sample FCStd files have to be staged there before any source can be loaded.
|
||||
if (!project.paths.sampleDir) throw new Error("project.json needs paths.sampleDir for UI-driven assembly");
|
||||
const sources = [];
|
||||
for (const document of [...new Set(inserts.map(item => item.sourceDocument))]) {
|
||||
const file = path.join(project.paths.sampleDir, `${document}.FCStd`);
|
||||
if (!fs.existsSync(file)) throw new Error(`missing source document ${file}`);
|
||||
sources.push({ name: `${document}.FCStd`, base64: fs.readFileSync(file).toString("base64") });
|
||||
}
|
||||
await page.goto(`${project.appOrigin}/`, { waitUntil: "domcontentloaded", timeout: 180000 });
|
||||
await seedSources(page, sources);
|
||||
|
||||
await createAssembly(page, {
|
||||
appOrigin: project.appOrigin,
|
||||
pagePath: project.pages.assembly,
|
||||
document: project.assembly.document,
|
||||
label: project.assembly.label ?? project.assembly.document,
|
||||
});
|
||||
done = await insertAll(page, inserts, { groundDocument });
|
||||
const reported = await insertedLinkCount(page);
|
||||
// Every insert must be reflected in the task's own list before we call it good.
|
||||
if (reported && reported !== done.length) {
|
||||
throw new Error(`task lists ${reported} links but ${done.length} were inserted`);
|
||||
}
|
||||
if (jointSteps.length) {
|
||||
joints = await createJoints(page, jointSteps);
|
||||
if (joints.length !== jointSteps.length) {
|
||||
throw new Error(`${joints.length} joints created, replay records ${jointSteps.length}`);
|
||||
}
|
||||
}
|
||||
for (const step of solveSteps) solves.push(await solveAssembly(page, step));
|
||||
if (bomSteps.length) {
|
||||
// The BOM command opens the task panel; its own Save FCStd button then
|
||||
// writes the bundle to OPFS (documents + manifest), never to disk.
|
||||
for (const step of bomSteps) await executeCommand(page, step.action, step.args);
|
||||
saved = await saveAssemblyBundle(page, { document: project.assembly.document });
|
||||
}
|
||||
} catch (error) {
|
||||
fatal = String(error).slice(0, 800);
|
||||
} finally {
|
||||
await browser.close();
|
||||
}
|
||||
|
||||
// Compare what the UI did against the replay, value by value: an insert that
|
||||
// silently dropped its rotation would still "succeed" and only show up as a
|
||||
// mis-assembled model much later.
|
||||
const mismatches = [];
|
||||
for (const [index, expected] of inserts.entries()) {
|
||||
const actual = done[index];
|
||||
if (!actual) { mismatches.push(`${expected.sourceDocument}: not inserted`); continue; }
|
||||
if (actual.sourceDocument !== expected.sourceDocument) mismatches.push(`#${index + 1} document ${actual.sourceDocument} != ${expected.sourceDocument}`);
|
||||
const quaternion = actual.rotation ?? [0, 0, 0, 1];
|
||||
const wanted = expected.rotation ?? [0, 0, 0, 1];
|
||||
if (quaternion.some((value, at) => Math.abs(value - wanted[at]) > 1e-6))
|
||||
mismatches.push(`${expected.sourceDocument}: rotation ${quaternion.join(",")} != ${wanted.join(",")}`);
|
||||
const position = actual.position ?? [0, 0, 0];
|
||||
const target = expected.position ?? [0, 0, 0];
|
||||
if (position.some((value, at) => Math.abs(value - target[at]) > 1e-6))
|
||||
mismatches.push(`${expected.sourceDocument}: position ${position.join(",")} != ${target.join(",")}`);
|
||||
}
|
||||
// A save that silently stored nothing is a persistence gap, not a detail.
|
||||
// Only the manifest is asserted here: the document store already holds the
|
||||
// staged source files, so its count says nothing about this save.
|
||||
if (bomSteps.length && !saved?.manifestStored) {
|
||||
mismatches.push(`OPFS 未存储装配清单 ${project.assembly.document}.assembly.json`);
|
||||
}
|
||||
|
||||
const report = {
|
||||
schema: "freecad-web-cad-ui-rebuild/assembly/v1",
|
||||
generatedAt: new Date().toISOString(),
|
||||
project: project.name,
|
||||
document: project.assembly.document,
|
||||
groundDocument,
|
||||
expected: { inserts: inserts.length, rotated: rotated.length, joints: jointSteps.length, solves: solveSteps.length },
|
||||
inserted: done.length,
|
||||
joints,
|
||||
solves: solves.map(solve => ({
|
||||
label: solve.label, components: solve.components.length,
|
||||
malformed: solve.components.filter(component => !Array.isArray(component.position) || component.position.length !== 3
|
||||
|| !component.position.every(Number.isFinite)
|
||||
|| !Array.isArray(component.rotation) || component.rotation.length !== 4
|
||||
|| !component.rotation.every(Number.isFinite)).length,
|
||||
diagnostics: solve.diagnostics,
|
||||
})),
|
||||
components: solves.at(-1)?.components ?? [],
|
||||
saved,
|
||||
rotated: done.filter(item => (item.rotation ?? [0, 0, 0, 1]).some((value, index) => index < 3 && value !== 0)).length,
|
||||
mismatches,
|
||||
seconds: (Date.now() - started) / 1000,
|
||||
fatal,
|
||||
pageErrors: errors.slice(-10),
|
||||
links: done,
|
||||
};
|
||||
const file = writeAssemblyReport(project.paths.runDir, project.assembly.document, report);
|
||||
console.log(JSON.stringify({
|
||||
document: project.assembly.document, inserted: report.inserted, rotated: report.rotated,
|
||||
expected: report.expected, mismatches: mismatches.length, fatal,
|
||||
seconds: Math.round(report.seconds), report: file,
|
||||
}));
|
||||
process.exitCode = fatal || mismatches.length ? 1 : 0;
|
||||
129
web/tools/cad-ui-rebuild/build-steps.mjs
Normal file
@@ -0,0 +1,129 @@
|
||||
#!/usr/bin/env node
|
||||
// Generate the per-step UI operation list for every part in a project.
|
||||
//
|
||||
// Reads each part's replay (the scripted build) plus one snapshot of the
|
||||
// finished FCStd to recover the sketch coordinates the replay compacted away.
|
||||
// Output: <outDir>/ui-steps/<document>.json and index.json
|
||||
//
|
||||
// Usage: node build-steps.mjs --project <dir> [partId ...]
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { loadProject, projectFromArgv, readJson, replayPath } from "./manifest.mjs";
|
||||
import { uiStepsFor } from "./lib/steps.mjs";
|
||||
import { readReplay } from "./lib/replay.mjs";
|
||||
|
||||
const here = path.dirname(fileURLToPath(import.meta.url));
|
||||
const webRoot = path.resolve(here, "../..");
|
||||
const repoRoot = path.resolve(webRoot, "..");
|
||||
|
||||
const projectDir = projectFromArgv();
|
||||
const project = loadProject(projectDir, { requireParts: true });
|
||||
const projectArg = process.argv.slice(2)[process.argv.slice(2).indexOf("--project") + 1];
|
||||
const wanted = process.argv.slice(2).filter(value => !value.startsWith("--") && value !== projectArg
|
||||
&& process.argv.slice(2)[process.argv.indexOf(value) - 1] !== "--project");
|
||||
|
||||
const { loadWasmProbe } = await import(path.join(repoRoot, "tools", "wasm-probe-runtime.mjs"));
|
||||
|
||||
fs.mkdirSync(project.paths.stepsDir, { recursive: true });
|
||||
const results = [];
|
||||
const failures = [];
|
||||
|
||||
const selected = wanted.length
|
||||
? project.parts.filter(part => wanted.includes(part.id) || wanted.includes(part.document))
|
||||
: project.parts;
|
||||
|
||||
// One probe instance serves every part: the module import is cached but each
|
||||
// loadWasmProbe() call instantiates a fresh kernel (and pthread workers), which
|
||||
// is the leak behind long full-catalog runs.
|
||||
let probe = null;
|
||||
const kernelFor = async () => {
|
||||
if (!probe) probe = await loadWasmProbe(path.join(webRoot, "public", "kernel"), "FreeCADWebPartDesignRuntimeProbe");
|
||||
return probe.kernel;
|
||||
};
|
||||
|
||||
for (const part of selected) {
|
||||
const replayFile = replayPath(project, part.document);
|
||||
const sampleFile = project.paths.sampleDir ? path.join(project.paths.sampleDir, `${part.document}.FCStd`) : null;
|
||||
if (!fs.existsSync(replayFile)) { failures.push(`${part.document}: missing replay ${replayFile}`); continue; }
|
||||
if (!sampleFile || !fs.existsSync(sampleFile)) { failures.push(`${part.document}: missing sample FCStd`); continue; }
|
||||
|
||||
const replay = readReplay(replayFile);
|
||||
const kernel = await kernelFor();
|
||||
const send = (action, args = {}) => JSON.parse(kernel.ccall("fc_web_dispatch_json", "string", ["string"], [JSON.stringify({
|
||||
cmd: "partdesign.document",
|
||||
args: { schema: "freecad-web-partdesign-document/v1", module: "PartDesign",
|
||||
document: part.document, action, includeMesh: false, ...args },
|
||||
})]));
|
||||
|
||||
let snapshot;
|
||||
try {
|
||||
// The probe's open action restores from a path inside the WASM filesystem;
|
||||
// it does not decode a `bytes` argument. The FCStd has to be written into
|
||||
// Emscripten's /tmp first, exactly as the browser build does.
|
||||
const stagedPath = `/tmp/${part.document}.FCStd`;
|
||||
kernel.FS.writeFile(stagedPath, fs.readFileSync(sampleFile));
|
||||
const opened = send("open", { path: stagedPath });
|
||||
if (!opened.ok) throw new Error(`open failed: ${String(opened.error).slice(0, 200)}`);
|
||||
const snap = send("snapshot");
|
||||
if (!snap.ok) throw new Error(`snapshot failed: ${String(snap.error).slice(0, 200)}`);
|
||||
snapshot = snap.result?.objects ?? [];
|
||||
} catch (error) {
|
||||
failures.push(`${part.document}: ${error.message}`);
|
||||
send("close");
|
||||
continue;
|
||||
}
|
||||
|
||||
const { steps, failures: local } = uiStepsFor(part.document, replay, snapshot, {
|
||||
pages: project.pages, featureCommands: project.featureCommands,
|
||||
});
|
||||
failures.push(...local);
|
||||
if (steps.length !== replay.steps.length) {
|
||||
failures.push(`${part.document}: ${steps.length} ui steps but the replay has ${replay.steps.length}`);
|
||||
}
|
||||
const record = {
|
||||
schema: "freecad-web-cad-ui-rebuild/ui-steps/v1",
|
||||
generatedAt: new Date().toISOString(),
|
||||
project: project.name,
|
||||
document: part.document,
|
||||
episode: part.id,
|
||||
title: part.title,
|
||||
steps,
|
||||
};
|
||||
fs.writeFileSync(path.join(project.paths.stepsDir, `${part.document}.json`), `${JSON.stringify(record, null, 2)}\n`);
|
||||
results.push({ id: part.id, document: part.document, steps: steps.length });
|
||||
send("close");
|
||||
}
|
||||
|
||||
// A subset run must not drop the other parts from the index: regenerate the
|
||||
// entries it touched and keep whatever an earlier full run recorded.
|
||||
const indexFile = path.join(project.paths.stepsDir, "index.json");
|
||||
const previous = [];
|
||||
if (wanted.length && fs.existsSync(indexFile)) {
|
||||
try {
|
||||
previous.push(...(JSON.parse(fs.readFileSync(indexFile, "utf8")).documents ?? []));
|
||||
} catch {
|
||||
// A corrupt index is rebuilt from this run only.
|
||||
}
|
||||
}
|
||||
const merged = new Map(previous.map(item => [item.document, item]));
|
||||
for (const item of results) merged.set(item.document, item);
|
||||
|
||||
const index = {
|
||||
schema: "freecad-web-cad-ui-rebuild/ui-steps-index/v1",
|
||||
generatedAt: new Date().toISOString(),
|
||||
project: project.name,
|
||||
documents: [...merged.values()],
|
||||
failures,
|
||||
};
|
||||
fs.writeFileSync(indexFile, `${JSON.stringify(index, null, 2)}\n`);
|
||||
|
||||
// Write to fd 1 synchronously: process.exit() below would otherwise race the
|
||||
// async pipe write. The probe's pthread worker keeps the event loop alive, so
|
||||
// a finished run has to exit explicitly or it looks hung after the summary.
|
||||
fs.writeFileSync(1, `${JSON.stringify({
|
||||
documents: results.length,
|
||||
steps: results.reduce((sum, item) => sum + item.steps, 0),
|
||||
failures,
|
||||
}, null, 2)}\n`);
|
||||
process.exit(failures.length ? 1 : 0);
|
||||
44
web/tools/cad-ui-rebuild/capture-check.mjs
Executable file
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env node
|
||||
// Pre-flight: prove the current display can actually be captured before a
|
||||
// recording lane starts.
|
||||
//
|
||||
// Four episodes were recorded on a display whose GL surface x11grab could not
|
||||
// see, and produced perfectly valid pure-black videos that passed every
|
||||
// structural check in verify.mjs. This check exists so that failure is caught
|
||||
// in 10 seconds instead of after a 4-minute recording.
|
||||
//
|
||||
// Usage: node check-capture.mjs [--display :1]
|
||||
import { spawnSync } from "node:child_process";
|
||||
import fs from "node:fs";
|
||||
|
||||
const args = process.argv.slice(2);
|
||||
const index = args.indexOf("--display");
|
||||
const display = index >= 0 ? args[index + 1] : (process.env.COURSE_VIDEO_DISPLAY ?? ":1");
|
||||
const out = "/tmp/freecad-capture-probe.png";
|
||||
fs.rmSync(out, { force: true });
|
||||
|
||||
const grab = spawnSync("ffmpeg", ["-y", "-f", "x11grab", "-video_size", "1600x900",
|
||||
"-i", `${display}.0+0,0`, "-frames:v", "1", out, "-loglevel", "error"], { encoding: "utf8" });
|
||||
if (!fs.existsSync(out)) {
|
||||
console.log(JSON.stringify({ ok: false, display, error: "capture produced no frame", stderr: grab.stderr?.slice(0, 200) }));
|
||||
process.exit(1);
|
||||
}
|
||||
const bytes = spawnSync("ffmpeg", ["-y", "-i", out, "-f", "rawvideo", "-pix_fmt", "gray", "-loglevel", "error", "-"],
|
||||
{ maxBuffer: 64 << 20 }).stdout ?? Buffer.alloc(0);
|
||||
let sum = 0;
|
||||
let max = 0;
|
||||
for (const value of bytes) { sum += value; if (value > max) max = value; }
|
||||
const mean = bytes.length ? sum / bytes.length : 0;
|
||||
// A live desktop contains thousands of colours across the whole frame. `max`
|
||||
// alone is a false positive: while the display is asleep a stray cursor pixel
|
||||
// can still be 255 while the rest of the frame is pure black, which is exactly
|
||||
// how the first re-record attempt passed its own preflight and produced four
|
||||
// more black episodes. Require real brightness AND real colour spread.
|
||||
const distinct = new Set();
|
||||
const rgb = spawnSync("ffmpeg", ["-y", "-i", out, "-f", "rawvideo", "-pix_fmt", "rgb24", "-loglevel", "error", "-"],
|
||||
{ maxBuffer: 128 << 20 }).stdout ?? Buffer.alloc(0);
|
||||
for (let index = 0; index + 2 < rgb.length; index += 3 * 997) distinct.add((rgb[index] << 16) | (rgb[index + 1] << 8) | rgb[index + 2]);
|
||||
const awake = mean > 3 && max > 24 && distinct.size > 20;
|
||||
console.log(JSON.stringify({ ok: awake, display, mean: Number(mean.toFixed(1)), max,
|
||||
distinctColors: distinct.size, bytes: bytes.length }));
|
||||
process.exitCode = awake ? 0 : 1;
|
||||
172
web/tools/cad-ui-rebuild/capture-replay.mjs
Normal file
@@ -0,0 +1,172 @@
|
||||
#!/usr/bin/env node
|
||||
// Capture the geometry a process trace needs in order to be replayed.
|
||||
//
|
||||
// A trace records WHAT happened (action, arguments, seconds, the object list
|
||||
// after each step) but carries no shapes: `snapshot` is null on every event and
|
||||
// the heavy geometry lists are compacted to {count, sha256}. The shapes do not
|
||||
// have to be re-simulated to get them back, though. Every PartDesign feature
|
||||
// keeps the *accumulated* result of the body up to and including itself, so one
|
||||
// `includeMesh` snapshot of the finished document already contains the shape of
|
||||
// the model after every step.
|
||||
//
|
||||
// This is the generic form of the reducer case's original script: the three
|
||||
// directories (traces, FCStd samples, replay output) and the source label are
|
||||
// arguments, so any process case can produce the same replay records.
|
||||
//
|
||||
// Output: <out-dir>/<document>.json, one record per trace step:
|
||||
// { step, label, action, seconds, args, feature, volume, faceCount,
|
||||
// mesh: { positions, normals, triangleCount, bounds } }
|
||||
// `feature` is the object the step created, derived from the trace itself (the
|
||||
// one new solid in `tips.objects` that was not there on the previous step), so
|
||||
// nothing is guessed from naming conventions.
|
||||
//
|
||||
// Usage:
|
||||
// node web/tools/cad-ui-rebuild/capture-replay.mjs \
|
||||
// --trace-dir <case>/out/traces \
|
||||
// --sample-dir <case>/out/FCStd \
|
||||
// --out-dir <case>/out/replay \
|
||||
// [--source-prefix web/teaching/cases/<case>/out/FCStd] \
|
||||
// [--only P01,CarrierDeck] [--assembly CarrierAssembly]
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const here = path.dirname(fileURLToPath(import.meta.url));
|
||||
export const webRoot = path.resolve(here, "..", "..");
|
||||
export const repoRoot = path.resolve(webRoot, "..");
|
||||
|
||||
const SCHEMA = "freecad-web-process-replay/v1";
|
||||
// Datum scaffolding is created with the body and is never a modelling step.
|
||||
const notAFeature = type => /^(App::(Origin|Line|Plane|Point)|PartDesign::Body)$/.test(type ?? "");
|
||||
|
||||
/** Keep 1 µm of positional resolution; that is far below any teaching need. */
|
||||
const q3 = value => Math.round(value * 1000) / 1000;
|
||||
|
||||
function trim(raw) {
|
||||
if (!raw?.positions?.length) return null;
|
||||
return {
|
||||
positions: Array.prototype.map.call(raw.positions, q3),
|
||||
normals: raw.normals?.length ? Array.prototype.map.call(raw.normals, v => Math.round(v * 1000) / 1000) : [],
|
||||
triangleCount: raw.triangleCount ?? raw.positions.length / 9,
|
||||
bounds: raw.bounds ?? null,
|
||||
};
|
||||
}
|
||||
|
||||
function parseArgs(argv) {
|
||||
const args = { only: [], assembly: [] };
|
||||
for (let index = 0; index < argv.length; index += 1) {
|
||||
const key = argv[index];
|
||||
const value = argv[index + 1];
|
||||
if (!key.startsWith("--")) continue;
|
||||
index += 1;
|
||||
if (key === "--trace-dir") args.traceDir = value;
|
||||
else if (key === "--sample-dir") args.sampleDir = value;
|
||||
else if (key === "--out-dir") args.outDir = value;
|
||||
else if (key === "--source-prefix") args.sourcePrefix = value;
|
||||
else if (key === "--only") args.only.push(...value.split(",").filter(Boolean));
|
||||
else if (key === "--assembly") args.assembly.push(...value.split(",").filter(Boolean));
|
||||
else throw new Error(`unknown argument ${key}`);
|
||||
}
|
||||
for (const key of ["traceDir", "sampleDir", "outDir"]) {
|
||||
if (!args[key]) throw new Error(`--${key.replace(/[A-Z]/g, c => `-${c.toLowerCase()}`)} is required`);
|
||||
}
|
||||
return args;
|
||||
}
|
||||
|
||||
/**
|
||||
* Snapshot one finished document and turn its trace into replay steps.
|
||||
* The caller owns the kernel lifecycle (see loadWasmProbe usage below).
|
||||
*/
|
||||
export function makeCapture({ kernel, sampleDir, sourcePrefix }) {
|
||||
const dispatch = (document, action, extra = {}) => JSON.parse(kernel.ccall("fc_web_dispatch_json", "string", ["string"], [JSON.stringify({
|
||||
cmd: "partdesign.document",
|
||||
args: { schema: "freecad-web-partdesign-document/v1", module: "PartDesign", document, action, includeMesh: false, ...extra },
|
||||
})]));
|
||||
return async function capture(document, trace) {
|
||||
const file = path.join(sampleDir, `${document}.FCStd`);
|
||||
if (!fs.existsSync(file)) throw new Error(`missing sample document ${file}`);
|
||||
kernel.FS.writeFile(`/tmp/${document}.FCStd`, fs.readFileSync(file));
|
||||
const opened = dispatch(document, "open", { path: `/tmp/${document}.FCStd` });
|
||||
if (!opened.ok) throw new Error(`${document} open failed: ${String(opened.error).slice(0, 200)}`);
|
||||
try {
|
||||
const started = Date.now();
|
||||
const snap = dispatch(document, "snapshot", { includeMesh: true });
|
||||
if (!snap.ok) throw new Error(`${document} snapshot failed: ${String(snap.error).slice(0, 200)}`);
|
||||
const meshMs = Date.now() - started;
|
||||
const byName = new Map((snap.result?.objects ?? []).map(object => [object.name, object]));
|
||||
|
||||
const steps = [];
|
||||
let previous = new Set();
|
||||
for (const event of trace.events) {
|
||||
const names = (event.tips?.objects ?? []).map(object => object.name);
|
||||
const created = names.filter(name => !previous.has(name));
|
||||
// A step may remove objects too (a pocket consumes its profile as the new
|
||||
// tip); the shape that matters is the newest solid in the body.
|
||||
const solid = created.map(name => byName.get(name)).filter(object => object && !notAFeature(object?.type)).at(-1) ?? null;
|
||||
previous = new Set(names);
|
||||
steps.push({
|
||||
step: event.step, label: event.label, action: event.action,
|
||||
seconds: event.seconds, args: event.args,
|
||||
feature: solid?.name ?? null,
|
||||
volume: solid?.volume ?? null,
|
||||
faceCount: solid?.faceCount ?? null,
|
||||
mesh: trim(solid?.mesh),
|
||||
});
|
||||
}
|
||||
return {
|
||||
schema: SCHEMA, document,
|
||||
source: sourcePrefix ? `${sourcePrefix.replace(/\/$/, "")}/${document}.FCStd` : file,
|
||||
meshMs, steps,
|
||||
};
|
||||
} finally {
|
||||
try { dispatch(document, "close"); } catch { /* document may already be closed */ }
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/** Run the whole capture over a directory of traces; returns the exit code. */
|
||||
export async function runCapture(args) {
|
||||
const { loadWasmProbe } = await import(path.join(repoRoot, "tools", "wasm-probe-runtime.mjs"));
|
||||
const { kernel } = await loadWasmProbe(path.join(webRoot, "public", "kernel"), "FreeCADWebPartDesignRuntimeProbe");
|
||||
const capture = makeCapture({ kernel, sampleDir: args.sampleDir, sourcePrefix: args.sourcePrefix });
|
||||
|
||||
const traces = fs.readdirSync(args.traceDir).filter(name => name.endsWith(".json")).sort();
|
||||
const results = [];
|
||||
const failures = [];
|
||||
fs.mkdirSync(args.outDir, { recursive: true });
|
||||
for (const name of traces) {
|
||||
const document = name.replace(/\.json$/, "");
|
||||
if (args.only.length && !args.only.includes(document)) continue;
|
||||
const trace = JSON.parse(fs.readFileSync(path.join(args.traceDir, name), "utf8"));
|
||||
// Assembly traces are a different kind of record: their steps insert whole
|
||||
// documents, so their geometry comes from the part replays instead.
|
||||
if (args.assembly.includes(document)) {
|
||||
results.push({ document, kind: "assembly", events: trace.events.length, steps: 0, bytes: 0 });
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
const replay = await capture(document, trace);
|
||||
const json = JSON.stringify(replay);
|
||||
fs.writeFileSync(path.join(args.outDir, `${document}.json`), json);
|
||||
const withMesh = replay.steps.filter(step => step.mesh).length;
|
||||
const solids = replay.steps.filter(step => step.feature).length;
|
||||
results.push({ document, kind: "part", events: trace.events.length, steps: replay.steps.length, withMesh, solids,
|
||||
bytes: json.length, meshMs: replay.meshMs });
|
||||
if (!withMesh) failures.push(`${document}: no step produced a mesh`);
|
||||
} catch (error) {
|
||||
failures.push(`${document}: ${error instanceof Error ? error.message : String(error)}`);
|
||||
}
|
||||
}
|
||||
kernel.PThread?.terminateAllThreads?.();
|
||||
fs.writeFileSync(path.join(args.outDir, "index.json"), `${JSON.stringify({
|
||||
schema: SCHEMA, generatedAt: new Date().toISOString(), documents: results, failures,
|
||||
}, null, 2)}\n`);
|
||||
console.log(JSON.stringify({ results, failures }, null, 2));
|
||||
return failures.length ? 1 : 0;
|
||||
}
|
||||
|
||||
async function main() {
|
||||
process.exitCode = await runCapture(parseArgs(process.argv.slice(2)));
|
||||
}
|
||||
|
||||
if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) await main();
|
||||
179
web/tools/cad-ui-rebuild/drive.mjs
Normal file
@@ -0,0 +1,179 @@
|
||||
#!/usr/bin/env node
|
||||
// Drive the real Web FreeCAD UI to rebuild one part, capturing a screenshot per step.
|
||||
//
|
||||
// Usage: node drive.mjs --project <dir> <partId|document> [--headed] [--slow]
|
||||
// Evidence: <outDir>/ui-run/<document>.json
|
||||
// <stillsDir>/<partId>/<scene>.png
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { createRequire } from "node:module";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { loadProject, projectFromArgv, readJson, replayPath } from "./manifest.mjs";
|
||||
import { PAGE, waitForWorkspace, newDocumentWithBody, runStep, tipVolume, selectTip } from "./lib/driver.mjs";
|
||||
import { readReplay } from "./lib/replay.mjs";
|
||||
import { stillName } from "./lib/stills.mjs";
|
||||
|
||||
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 projectDir = projectFromArgv();
|
||||
const project = loadProject(projectDir, { requireParts: true });
|
||||
|
||||
const args = process.argv.slice(2);
|
||||
// Skip the value that belongs to --project; it may be a directory or a manifest
|
||||
// file, and either way it is not a part id.
|
||||
const projectArg = args[args.indexOf("--project") + 1];
|
||||
const key = args.find(value => !value.startsWith("--") && value !== projectArg
|
||||
&& args[args.indexOf(value) - 1] !== "--project");
|
||||
if (!key) throw new Error("usage: drive.mjs --project <dir> <partId> [--headed] [--slow]");
|
||||
const part = project.parts.find(item => item.id === key || item.document === key);
|
||||
if (!part) throw new Error(`project ${project.name} has no part "${key}"`);
|
||||
|
||||
const headed = args.includes("--headed");
|
||||
const slow = args.includes("--slow") ? 350 : 0;
|
||||
|
||||
const stepsFile = path.join(project.paths.stepsDir, `${part.document}.json`);
|
||||
if (!fs.existsSync(stepsFile)) {
|
||||
throw new Error(`no ui-steps for ${part.document}; run build-steps.mjs --project ${projectDir} first`);
|
||||
}
|
||||
const uiSteps = JSON.parse(fs.readFileSync(stepsFile, "utf8"));
|
||||
const replayFile = replayPath(project, part.document);
|
||||
if (!fs.existsSync(replayFile)) throw new Error(`no replay for ${part.document} in ${project.paths.replayDir}`);
|
||||
const replay = readReplay(replayFile);
|
||||
|
||||
const stillsDir = path.join(project.paths.stillsDir, part.id);
|
||||
fs.mkdirSync(stillsDir, { recursive: true });
|
||||
fs.mkdirSync(project.paths.runDir, { recursive: true });
|
||||
|
||||
/**
|
||||
* Internal names of every tree row: the workspace's own object names.
|
||||
*
|
||||
* The tree pane sizes its viewport to the full row list (`document-tree.tsx`),
|
||||
* so every row stays mounted and a single read sees them all.
|
||||
*/
|
||||
async function internalNames(page) {
|
||||
const visible = await page.locator('[role="treeitem"] .fc-tree-col-internal').allTextContents();
|
||||
return [...new Set(visible.map(name => name.trim()).filter(Boolean))];
|
||||
}
|
||||
|
||||
/**
|
||||
* Wait for the workspace to finish a native transaction and publish it.
|
||||
*
|
||||
* `edit()` in the workspace renders "计算中..." while the kernel request is in
|
||||
* flight and only swaps `documents[document]` afterwards, so a heavy feature
|
||||
* (a chamfer over 180 deck edges takes tens of seconds) has no tree row yet
|
||||
* when the click handler returns. Poll until the row count exceeds `minimum`
|
||||
* and the busy status has cleared.
|
||||
*/
|
||||
async function waitForRows(page, minimum, timeout = 240000) {
|
||||
const deadline = Date.now() + timeout;
|
||||
let count = 0;
|
||||
const busy = () => page.evaluate(() => [...document.querySelectorAll('[role="status"]')]
|
||||
.some(node => (node.textContent ?? "").includes("计算中")));
|
||||
while (Date.now() < deadline) {
|
||||
count = await page.locator('[role="treeitem"]').count();
|
||||
if (count >= minimum && !(await busy())) return count;
|
||||
await page.waitForTimeout(250);
|
||||
}
|
||||
throw new Error(`model tree stayed at ${count} rows (wanted >= ${minimum}) for ${timeout} ms`);
|
||||
}
|
||||
|
||||
const browser = await chromium.launch({
|
||||
executablePath: "/usr/bin/google-chrome", headless: !headed,
|
||||
args: ["--no-sandbox", "--disable-dev-shm-usage", "--enable-unsafe-swiftshader", "--use-gl=angle", "--use-angle=swiftshader"],
|
||||
});
|
||||
const page = await browser.newPage({ viewport: { width: 1600, height: 900 } });
|
||||
const errors = [];
|
||||
page.on("pageerror", error => errors.push(String(error).slice(0, 300)));
|
||||
page.on("console", message => { if (message.type() === "error") errors.push(message.text().slice(0, 300)); });
|
||||
|
||||
const results = [];
|
||||
const uiNames = new Map();
|
||||
const started = Date.now();
|
||||
try {
|
||||
await page.goto(`${project.appOrigin}/${PAGE}`, { waitUntil: "domcontentloaded", timeout: 180000 });
|
||||
await waitForWorkspace(page);
|
||||
await newDocumentWithBody(page);
|
||||
|
||||
for (const [index, step] of uiSteps.steps.entries()) {
|
||||
const name = stillName(project, part, index, uiSteps.steps);
|
||||
const t0 = Date.now();
|
||||
let status = "ok";
|
||||
try {
|
||||
// The workspace names objects itself (Sketch1, Pad1 …), so a later step's
|
||||
// profile/sections/base/originals must be translated to the UI's name.
|
||||
const resolved = { ...step };
|
||||
// Every reference must resolve. A name that no earlier step recorded means
|
||||
// the plan is wrong; failing here beats letting the driver pick a default.
|
||||
const renamed = name => {
|
||||
if (uiNames.has(name)) return uiNames.get(name);
|
||||
throw new Error(`no UI object recorded for ${name}`);
|
||||
};
|
||||
if (resolved.profile) resolved.profile = renamed(resolved.profile);
|
||||
if (resolved.base) resolved.base = renamed(resolved.base);
|
||||
if (Array.isArray(resolved.sections) && resolved.sections.length) {
|
||||
resolved.sections = resolved.sections.map(section => (typeof section === "string" ? renamed(section) : section));
|
||||
}
|
||||
if (Array.isArray(resolved.originals) && resolved.originals.length) {
|
||||
resolved.originals = resolved.originals.map(renamed);
|
||||
}
|
||||
const before = new Set(await internalNames(page));
|
||||
const rowsBefore = await page.locator('[role="treeitem"]').count();
|
||||
await runStep(page, resolved);
|
||||
await waitForRows(page, rowsBefore + 1);
|
||||
// The workspace names objects itself (Sketch1, Pad7, Chamfer1 …). The new
|
||||
// row's internal name is the object name the reference selects expect, and
|
||||
// later steps address this object by the kernel's name, so record the pair.
|
||||
const created = (await internalNames(page)).filter(name => !before.has(name));
|
||||
if (created.length !== 1) throw new Error(`expected one new object, saw [${created.join(", ")}]`);
|
||||
uiNames.set(step.object, created[0]);
|
||||
} catch (error) {
|
||||
status = `fail: ${error instanceof Error ? error.message.slice(0, 240) : String(error)}`;
|
||||
}
|
||||
if (slow) await page.waitForTimeout(slow);
|
||||
await page.screenshot({ path: path.join(stillsDir, `${name}.png`) });
|
||||
await selectTip(page);
|
||||
const volume = await tipVolume(page);
|
||||
const expectedVolume = replay.steps[index]?.volume ?? null;
|
||||
const match = volume != null && expectedVolume
|
||||
? Math.abs(volume - expectedVolume) / Math.abs(expectedVolume) < 1e-6 : null;
|
||||
results.push({ step: step.step, label: step.label, kind: step.kind, command: step.command,
|
||||
uiName: step.kind === "sketch" ? uiNames.get(step.object) ?? null : null,
|
||||
volume, expectedVolume, volumeMatches: match, status, ms: Date.now() - t0 });
|
||||
if (status !== "ok") break;
|
||||
}
|
||||
|
||||
await selectTip(page);
|
||||
const volume = await tipVolume(page);
|
||||
const expected = replay.steps.at(-1)?.volume ?? null;
|
||||
const relative = volume != null && expected ? Math.abs(volume - expected) / Math.abs(expected) : null;
|
||||
const report = {
|
||||
schema: "freecad-web-cad-ui-rebuild/ui-run/v1",
|
||||
generatedAt: new Date().toISOString(),
|
||||
project: project.name,
|
||||
episode: part.id, document: part.document,
|
||||
steps: results.length, stepsTotal: uiSteps.steps.length,
|
||||
failed: results.filter(item => item.status !== "ok").length,
|
||||
volume, expected, relativeError: relative,
|
||||
volumeMatches: relative != null && relative < 1e-6,
|
||||
seconds: (Date.now() - started) / 1000,
|
||||
pageErrors: errors.slice(-10), results,
|
||||
};
|
||||
fs.writeFileSync(path.join(project.paths.runDir, `${part.document}.json`), `${JSON.stringify(report, null, 2)}\n`);
|
||||
console.log(JSON.stringify({ episode: part.id, steps: report.steps, failed: report.failed,
|
||||
volume, expected, relativeError: relative, volumeMatches: report.volumeMatches,
|
||||
seconds: Math.round(report.seconds), pageErrors: report.pageErrors.length }));
|
||||
process.exitCode = report.failed === 0 && report.steps === report.stepsTotal ? 0 : 1;
|
||||
} catch (error) {
|
||||
fs.writeFileSync(path.join(project.paths.runDir, `${part.document}.json`), `${JSON.stringify({
|
||||
schema: "freecad-web-cad-ui-rebuild/ui-run/v1", project: project.name,
|
||||
episode: part.id, document: part.document,
|
||||
fatal: String(error).slice(0, 800), results, pageErrors: errors.slice(-10),
|
||||
}, null, 2)}\n`);
|
||||
console.error(JSON.stringify({ fatal: String(error).slice(0, 400), pageErrors: errors.slice(-5) }));
|
||||
process.exitCode = 1;
|
||||
} finally {
|
||||
await browser.close();
|
||||
}
|
||||
278
web/tools/cad-ui-rebuild/lib/assembly.mjs
Normal file
@@ -0,0 +1,278 @@
|
||||
// Drive the assembly through the real UI.
|
||||
//
|
||||
// The part-building half of this tool is proven; assembly used to be built only
|
||||
// through kernel probe calls because the insert-link task hardcoded the identity
|
||||
// rotation. That is now a React control (`Insert link rotation W/X/Y/Z` plus
|
||||
// presets), so creation + every insertion can go through the same surface a
|
||||
// learner uses. Joints and solving still use the workbench parameter forms,
|
||||
// following the order proven in tools/line-manual/ui-assemble.mjs.
|
||||
//
|
||||
// Ordering matters and is not obvious: the first inserted link becomes the
|
||||
// grounded anchor, so the ground part must be inserted first, before anything
|
||||
// else. `orderedInserts` enforces that.
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
|
||||
/** Sort inserts so the ground part comes first, keeping the rest in authored order. */
|
||||
export function orderedInserts(inserts, groundDocument) {
|
||||
if (!groundDocument) return [...inserts];
|
||||
const ground = inserts.filter(item => item.sourceDocument === groundDocument);
|
||||
const rest = inserts.filter(item => item.sourceDocument !== groundDocument);
|
||||
return [...ground, ...rest];
|
||||
}
|
||||
|
||||
/** Wait for the assembly task surface to settle after an action. */
|
||||
const settle = (page, ms = 700) => page.waitForTimeout(ms);
|
||||
|
||||
/**
|
||||
* Copy the project's sample FCStd files into the browser's OPFS document
|
||||
* directory, which is where the Insert Link task lists sources from
|
||||
* (`listDocumentFiles()` in src/storage.ts reads `freecad-documents`, not
|
||||
* `freecad-exports`; exports hold STEP/STL/etc, not editable documents).
|
||||
*
|
||||
* The web app never reads the host filesystem, so a UI-driven assembly needs the
|
||||
* documents present in OPFS first. Documents are addressed by bare filename.
|
||||
*/
|
||||
export async function seedSources(page, files) {
|
||||
await page.evaluate(async (entries) => {
|
||||
const root = await navigator.storage.getDirectory();
|
||||
const dir = await root.getDirectoryHandle("freecad-documents", { create: true });
|
||||
for (const entry of entries) {
|
||||
const handle = await dir.getFileHandle(entry.name, { create: true });
|
||||
const writable = await handle.createWritable();
|
||||
const binary = atob(entry.base64);
|
||||
const bytes = new Uint8Array(binary.length);
|
||||
for (let index = 0; index < binary.length; index++) bytes[index] = binary.charCodeAt(index);
|
||||
await writable.write(bytes);
|
||||
await writable.close();
|
||||
}
|
||||
}, files);
|
||||
return files.map(entry => entry.name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Open the assembly page and create the assembly document.
|
||||
* Desktop equivalent: Assembly workbench → Create Assembly.
|
||||
*/
|
||||
export async function createAssembly(page, { appOrigin, pagePath, document, label }) {
|
||||
await page.goto(`${appOrigin}/${pagePath}`, { waitUntil: "domcontentloaded", timeout: 180000 });
|
||||
const create = page.locator('section[aria-label="Create assembly"]');
|
||||
await create.waitFor({ timeout: 180000 });
|
||||
await page.locator('input[aria-label="Assembly document name"]').first().fill(document);
|
||||
if (label) await page.locator('input[aria-label="Assembly label"]').first().fill(label);
|
||||
await create.getByRole("button", { name: "Create" }).first().click();
|
||||
await settle(page, 3000);
|
||||
}
|
||||
|
||||
/**
|
||||
* Open the Insert Link task and load one source file from OPFS.
|
||||
* The task loads one file per action; the kernel probe can batch, the UI cannot.
|
||||
*/
|
||||
export async function loadSource(page, fileName) {
|
||||
const task = page.locator('section[aria-label="Insert assembly link"]');
|
||||
await task.waitFor({ timeout: 120000 });
|
||||
const select = page.locator('select[aria-label="Insert link source file"]');
|
||||
await select.selectOption(fileName);
|
||||
await settle(page, 300);
|
||||
await task.getByRole("button", { name: "Load source", exact: true }).click();
|
||||
// Loading parses the FCStd; a large document takes a few seconds. The
|
||||
// "Insert" button is already visible before any load, so it is not a load
|
||||
// signal. Wait for the candidate list itself to fill, and for the status
|
||||
// line to name the file that was just loaded -- with several documents open
|
||||
// the options from the previous load are still present until this one lands.
|
||||
await page.waitForFunction(name => {
|
||||
const status = document.querySelector('section[aria-label="Insert assembly link"] p[role="status"]');
|
||||
const objects = document.querySelector('select[aria-label="Insert link source object"]');
|
||||
return Boolean(status) && status.textContent.includes(`Loaded ${name}`)
|
||||
&& Boolean(objects) && objects.options.length > 1;
|
||||
}, fileName, { timeout: 180000 });
|
||||
await settle(page, 600);
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert the loaded document's object at a position and rotation.
|
||||
*
|
||||
* The rotation fields are the React control that replaced the hardcoded
|
||||
* identity quaternion; passing [0,0,0,1] reproduces the old behaviour exactly.
|
||||
*/
|
||||
export async function insertLink(page, { sourceDocument, sourceObject, position, rotation, rigid = true }) {
|
||||
const task = page.locator('section[aria-label="Insert assembly link"]');
|
||||
const objectSelect = page.locator('select[aria-label="Insert link source object"]');
|
||||
// Option values are `documentId:object`. Parts share object names across
|
||||
// documents (`Body` exists in every reducer part), so the bare object name
|
||||
// cannot be used as the value -- the task would always resolve to whichever
|
||||
// document was opened first.
|
||||
const key = `${sourceDocument}:${sourceObject}`;
|
||||
const values = await objectSelect.evaluate(node => [...node.options].map(option => option.value));
|
||||
if (!values.includes(key)) throw new Error(`source object ${key} not among ${values.join(", ")}`);
|
||||
await objectSelect.selectOption(key);
|
||||
|
||||
for (const [index, axis] of ["X", "Y", "Z"].entries()) {
|
||||
const input = page.locator(`input[aria-label="Insert link position ${axis}"]`).first();
|
||||
await input.fill(String(position?.[index] ?? 0));
|
||||
await input.press("Enter");
|
||||
}
|
||||
const quaternion = rotation ?? [0, 0, 0, 1];
|
||||
for (const [index, axis] of ["W", "X", "Y", "Z"].entries()) {
|
||||
const input = page.locator(`input[aria-label="Insert link rotation ${axis}"]`).first();
|
||||
await input.fill(String(quaternion[index]));
|
||||
await input.press("Enter");
|
||||
}
|
||||
const rigidBox = task.locator('input[type="checkbox"]').first();
|
||||
if (await rigidBox.count()) await rigidBox.setChecked(rigid).catch(() => {});
|
||||
|
||||
await task.getByRole("button", { name: "Insert", exact: true }).click();
|
||||
await settle(page, 400);
|
||||
}
|
||||
|
||||
/** Commit the insertion session. */
|
||||
export async function acceptLinks(page) {
|
||||
const task = page.locator('section[aria-label="Insert assembly link"]');
|
||||
await task.getByRole("button", { name: "Accept", exact: true }).click();
|
||||
await settle(page, 2000);
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert every link in the planned order, loading each source document once.
|
||||
* Returns per-insert evidence so the caller can assert rotation was preserved.
|
||||
*/
|
||||
export async function insertAll(page, inserts, { groundDocument, loadOne = loadSource } = {}) {
|
||||
const ordered = orderedInserts(inserts, groundDocument);
|
||||
const loaded = new Set();
|
||||
const done = [];
|
||||
for (const item of ordered) {
|
||||
const fileName = `${item.sourceDocument}.FCStd`;
|
||||
if (!loaded.has(fileName)) { await loadOne(page, fileName); loaded.add(fileName); }
|
||||
await insertLink(page, item);
|
||||
done.push({ sourceDocument: item.sourceDocument, sourceObject: item.sourceObject,
|
||||
position: item.position, rotation: item.rotation ?? [0, 0, 0, 1] });
|
||||
}
|
||||
await acceptLinks(page);
|
||||
return done;
|
||||
}
|
||||
|
||||
/**
|
||||
* How many links the task reports, read from the visible list.
|
||||
* Used as a cheap post-condition before the expensive joint and solve steps.
|
||||
*/
|
||||
export async function insertedLinkCount(page) {
|
||||
return page.evaluate(() => document.querySelectorAll('ul[aria-label="Inserted links"] li').length);
|
||||
}
|
||||
|
||||
/**
|
||||
* Run one workbench command through the generic parameter form.
|
||||
*
|
||||
* Joints and the solve have no bespoke React control of their own, so they go
|
||||
* through the help-page panel the same way the E18 course episode does: click
|
||||
* the command, put its payload in #payload-editor, run it, wait for the state
|
||||
* response to change, and return the native result.
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
/** Component names follow insertion order: Component, Component001, … */
|
||||
export function componentName(index) {
|
||||
return index === 0 ? "Component" : `Component${String(index).padStart(3, "0")}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create every joint the replay records, in order. Each step already carries a
|
||||
* complete payload (selection + references), so nothing is re-derived here.
|
||||
*/
|
||||
export async function createJoints(page, steps) {
|
||||
const done = [];
|
||||
for (const step of steps) {
|
||||
const native = await executeCommand(page, step.action, step.args);
|
||||
done.push({
|
||||
label: step.label,
|
||||
type: native?.jointType ?? null,
|
||||
joint: native?.joint ?? null,
|
||||
message: native?.message ?? null,
|
||||
});
|
||||
}
|
||||
return done;
|
||||
}
|
||||
|
||||
/** Run the solve and summarise what the solver returned for every component. */
|
||||
export async function solveAssembly(page, step) {
|
||||
const native = await executeCommand(page, step.action, step.args);
|
||||
const components = (native?.components ?? []).map(component => ({
|
||||
object: component.object ?? component.name ?? null,
|
||||
position: component.placement?.position ?? null,
|
||||
rotation: component.placement?.rotation ?? null,
|
||||
}));
|
||||
return { label: step.label, components, diagnostics: native?.diagnostics ?? native?.messages ?? null };
|
||||
}
|
||||
|
||||
/**
|
||||
* Save the assembly through the BOM task's own "Save FCStd" button, then read
|
||||
* back what OPFS actually holds.
|
||||
*
|
||||
* Saving is OPFS-only by design (no automatic download). The bundle writes its
|
||||
* FCStd files through storage.writeDocumentFile (`freecad-documents`) and the
|
||||
* manifest `<documentId>.assembly.json` through writeRawStep (`freecad-1-2`),
|
||||
* so both stores are checked here.
|
||||
*/
|
||||
export async function saveAssemblyBundle(page, { document, timeout = 300000 }) {
|
||||
const section = page.locator('section[aria-label="Bill of materials task"]');
|
||||
await section.waitFor({ timeout: 120000 });
|
||||
const save = section.getByRole("button", { name: "Save FCStd", exact: true }).first();
|
||||
const accept = section.getByRole("button", { name: "Accept", exact: true }).first();
|
||||
// Native `save` refuses while the BOM task still owns an open session
|
||||
// ("Accept or cancel the task first", AssemblyInsertLink.h), and the button is
|
||||
// disabled for exactly that state -- clicking it blindly just times out.
|
||||
// Accepting commits the table (columns, settings) before the bundle is built,
|
||||
// so the saved FCStd carries what the task was showing.
|
||||
await page.waitForFunction(() => {
|
||||
const task = document.querySelector('section[aria-label="Bill of materials task"]');
|
||||
if (!task) return false;
|
||||
const buttons = [...task.querySelectorAll("button")];
|
||||
const button = name => buttons.find(node => node.textContent?.trim() === name);
|
||||
return Boolean(button("Save FCStd") && !button("Save FCStd").disabled)
|
||||
|| Boolean(button("Accept") && !button("Accept").disabled);
|
||||
}, null, { timeout: 120000 });
|
||||
if (await save.isDisabled()) await accept.click();
|
||||
await save.click();
|
||||
await page.waitForFunction(() => {
|
||||
const status = document.querySelector('section[aria-label="Bill of materials task"] p[role="status"]');
|
||||
return Boolean(status) && /OPFS|保存/.test(status.textContent);
|
||||
}, null, { timeout });
|
||||
return page.evaluate(async (documentId) => {
|
||||
const root = await navigator.storage.getDirectory();
|
||||
const list = async name => {
|
||||
try {
|
||||
const dir = await root.getDirectoryHandle(name, { create: false });
|
||||
const names = [];
|
||||
for await (const [entry] of dir.entries()) names.push(entry);
|
||||
return names.sort();
|
||||
} catch {
|
||||
return [];
|
||||
}
|
||||
};
|
||||
const documents = (await list("freecad-documents")).filter(name => name.endsWith(".FCStd"));
|
||||
const steps = await list("freecad-1-2");
|
||||
const manifest = `${documentId}.assembly.json`;
|
||||
return { files: documents, manifest, manifestStored: steps.includes(manifest) };
|
||||
}, document);
|
||||
}
|
||||
|
||||
/** Persist the assembly report next to the run evidence. */
|
||||
export function writeAssemblyReport(runDir, document, report) {
|
||||
fs.mkdirSync(runDir, { recursive: true });
|
||||
const file = path.join(runDir, `${document}-assembly.json`);
|
||||
fs.writeFileSync(file, `${JSON.stringify(report, null, 2)}\n`);
|
||||
return file;
|
||||
}
|
||||
581
web/tools/cad-ui-rebuild/lib/driver.mjs
Normal file
@@ -0,0 +1,581 @@
|
||||
// Drive the real Web FreeCAD UI to rebuild one part, step by step.
|
||||
//
|
||||
// Target page is `partdesign.html` (the standalone PartDesign workspace): it is
|
||||
// the only surface that renders the sketch editor AND the profile features.
|
||||
// The embedded PartDesign panel on project.html has no sketch controls at all
|
||||
// (they only appear when the Workbench select is set to Sketcher), so driving it
|
||||
// would need a workbench round-trip for every sketch.
|
||||
//
|
||||
// This exists to PROVE the generated instructions are true: every step in
|
||||
// out/ui-steps is performed through the same controls a learner would use, and
|
||||
// the finished volume is compared against the replay's. If the UI cannot express
|
||||
// a step this driver fails loudly rather than the manual describing an
|
||||
// impossible operation.
|
||||
|
||||
export const PAGE = "partdesign.html";
|
||||
|
||||
export async function waitForWorkspace(page) {
|
||||
await page.waitForSelector('[aria-label="Native PartDesign view"]', { timeout: 180000 });
|
||||
await page.waitForTimeout(1200);
|
||||
}
|
||||
|
||||
/** Start a fresh document and body, so each part is built in isolation. */
|
||||
export async function newDocumentWithBody(page) {
|
||||
await page.locator('button[aria-label="新建文档"]').first().click();
|
||||
await page.waitForTimeout(1500);
|
||||
await page.locator('button[aria-label="新建 Body"]').first().click();
|
||||
await page.waitForTimeout(1500);
|
||||
}
|
||||
|
||||
async function fillVector(page, label, values) {
|
||||
for (const [index, axis] of ["X", "Y", "Z"].entries()) {
|
||||
const input = page.locator(`input[aria-label="${label} ${axis}"]`).first();
|
||||
await input.fill(String(values?.[index] ?? 0));
|
||||
await input.press("Enter");
|
||||
}
|
||||
}
|
||||
|
||||
async function fillGeometryRow(page, index, geometry) {
|
||||
const n = index + 1;
|
||||
const typeSelect = page.locator(`select[aria-label="Geometry ${n} type"]`);
|
||||
await typeSelect.selectOption(geometry.type);
|
||||
await page.waitForTimeout(150);
|
||||
if (geometry.type === "line") {
|
||||
await fillVector(page, `Geometry ${n} start`, geometry.start);
|
||||
await fillVector(page, `Geometry ${n} end`, geometry.end);
|
||||
} else if (geometry.type === "circle" || geometry.type === "arc") {
|
||||
await fillVector(page, `Geometry ${n} center`, geometry.center);
|
||||
await page.locator(`input[aria-label="Geometry ${n} radius"]`).fill(String(geometry.radius));
|
||||
if (geometry.type === "arc") {
|
||||
await page.locator(`input[aria-label="Geometry ${n} startAngle"]`).fill(String(geometry.startAngle));
|
||||
await page.locator(`input[aria-label="Geometry ${n} endAngle"]`).fill(String(geometry.endAngle));
|
||||
}
|
||||
} else if (geometry.type === "ellipse") {
|
||||
await fillVector(page, `Geometry ${n} center`, geometry.center);
|
||||
await page.locator(`input[aria-label="Geometry ${n} majorRadius"]`).fill(String(geometry.majorRadius));
|
||||
await page.locator(`input[aria-label="Geometry ${n} minorRadius"]`).fill(String(geometry.minorRadius));
|
||||
} else if (geometry.type === "point") {
|
||||
await fillVector(page, `Geometry ${n} point`, geometry.point);
|
||||
}
|
||||
}
|
||||
|
||||
async function fillConstraintRow(page, index, constraint) {
|
||||
const n = index + 1;
|
||||
await page.locator(`select[aria-label="Constraint ${n} type"]`).selectOption(constraint.type);
|
||||
await page.waitForTimeout(150);
|
||||
for (const slot of ["first", "second", "third"]) {
|
||||
if (constraint[slot] === undefined) continue;
|
||||
const select = page.locator(`select[aria-label="Constraint ${n} ${slot}"]`).first();
|
||||
if (await select.count()) await select.selectOption(String(constraint[slot]));
|
||||
}
|
||||
for (const slot of ["firstPos", "secondPos", "thirdPos"]) {
|
||||
if (!constraint[slot]) continue;
|
||||
const select = page.locator(`select[aria-label="Constraint ${n} ${slot}"]`).first();
|
||||
if (await select.count()) await select.selectOption(constraint[slot]);
|
||||
}
|
||||
if (constraint.value !== undefined) {
|
||||
const input = page.locator(`input[aria-label="Constraint ${n} value"]`).first();
|
||||
if (await input.count()) await input.fill(String(constraint.value));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a sketch from a geometry+constraint list.
|
||||
*
|
||||
* The editor opens with a four-line rectangle preset, so the row count has to be
|
||||
* driven to the target shape: delete the surplus rows, then append and fill.
|
||||
*/
|
||||
export async function createSketch(page, step) {
|
||||
const group = page.locator('[role="group"][aria-label="Profile type"]').first();
|
||||
const label = step.profileType === "Circle" ? "圆形" : "几何与约束";
|
||||
await group.getByRole("button", { name: label }).first().click();
|
||||
await page.waitForTimeout(400);
|
||||
|
||||
if (step.profileType === "Circle") {
|
||||
const radius = step.geometries?.[0]?.radius ?? step.parameters?.Radius;
|
||||
if (radius !== undefined) await page.locator('input[aria-label="Sketch Radius"]').first().fill(String(radius));
|
||||
} else {
|
||||
const countGeometryRows = () => page.locator('select[aria-label^="Geometry "][aria-label$=" type"]').count();
|
||||
let rows = await countGeometryRows();
|
||||
while (rows > step.geometries.length) {
|
||||
await page.locator(`button[aria-label="Remove geometry ${rows}"]`).first().click();
|
||||
await page.waitForTimeout(100);
|
||||
rows = await countGeometryRows();
|
||||
}
|
||||
while (rows < step.geometries.length) {
|
||||
await page.locator('button[aria-label="Add sketch geometry"]').first().click();
|
||||
await page.waitForTimeout(100);
|
||||
rows = await countGeometryRows();
|
||||
}
|
||||
for (const [index, geometry] of step.geometries.entries()) await fillGeometryRow(page, index, geometry);
|
||||
|
||||
const countConstraintRows = () => page.locator('select[aria-label^="Constraint "][aria-label$=" type"]').count();
|
||||
let constraints = await countConstraintRows();
|
||||
while (constraints > step.constraints.length) {
|
||||
await page.locator(`button[aria-label="Remove constraint ${constraints}"]`).first().click();
|
||||
await page.waitForTimeout(100);
|
||||
constraints = await countConstraintRows();
|
||||
}
|
||||
while (constraints < step.constraints.length) {
|
||||
await page.locator('button[aria-label="Add sketch constraint"]').first().click();
|
||||
await page.waitForTimeout(100);
|
||||
constraints = await countConstraintRows();
|
||||
}
|
||||
for (const [index, constraint] of step.constraints.entries()) await fillConstraintRow(page, index, constraint);
|
||||
}
|
||||
|
||||
await fillVector(page, "Sketch", step.position ?? [0, 0, 0]);
|
||||
// A sketch is not always parallel to XY. Pick the plane whose quaternion the
|
||||
// kernel snapshot reported; the "Custom" branch types the raw quaternion when
|
||||
// the support is not one of the three axis-aligned planes.
|
||||
const plane = await page.locator('select[aria-label="Sketch plane"]').first();
|
||||
if (await plane.count()) {
|
||||
const rotation = step.placementRotation ?? [0, 0, 0, 1];
|
||||
const identity = rotation[0] === 0 && rotation[1] === 0 && rotation[2] === 0;
|
||||
if (identity) await plane.selectOption("XY");
|
||||
else {
|
||||
await plane.selectOption("Custom");
|
||||
const axes = ["W", "X", "Y", "Z"];
|
||||
for (const [index, axis] of axes.entries()) {
|
||||
const input = page.locator(`input[aria-label="Sketch rotation ${axis}"]`).first();
|
||||
if (await input.count()) { await input.fill(String(rotation[index])); await input.press("Enter"); }
|
||||
}
|
||||
}
|
||||
await page.waitForTimeout(200);
|
||||
}
|
||||
await page.locator('button[data-create-sketch]').first().click();
|
||||
await page.waitForTimeout(2200);
|
||||
}
|
||||
|
||||
/** The workspace names objects itself (Sketch1, Pad1 ...), so map as we go. */
|
||||
export async function lastProfileName(page) {
|
||||
await page.locator('[role="group"][aria-label="Profile feature"] button[data-feature-type="Pad"]').first().click().catch(() => {});
|
||||
await page.waitForTimeout(250);
|
||||
const values = await page.evaluate(() => {
|
||||
const select = document.querySelector('select[aria-label="Feature Profile"]');
|
||||
return select ? [...select.options].map(option => option.value).filter(Boolean) : [];
|
||||
});
|
||||
return values.at(-1) ?? null;
|
||||
}
|
||||
|
||||
/** Select several options by value and notify React, as the panel does. */
|
||||
async function selectMulti(page, locator, values) {
|
||||
const picked = await locator.evaluate((node, wanted) => {
|
||||
const found = [...node.options].filter(option => wanted.includes(option.value)).map(option => option.value);
|
||||
if (!found.length) return [];
|
||||
for (const option of node.options) option.selected = found.includes(option.value);
|
||||
node.dispatchEvent(new Event("change", { bubbles: true }));
|
||||
return found;
|
||||
}, values);
|
||||
await page.waitForTimeout(300);
|
||||
return picked;
|
||||
}
|
||||
|
||||
/** Open a collapsed `<details>` task group by the words in its summary. */
|
||||
async function openDesignGroup(page, pattern) {
|
||||
await page.evaluate(source => {
|
||||
const wanted = new RegExp(source, "i");
|
||||
for (const details of document.querySelectorAll("details.design-task-group")) {
|
||||
const summary = details.querySelector("summary");
|
||||
if (summary && wanted.test(summary.textContent ?? "")) details.open = true;
|
||||
}
|
||||
}, pattern);
|
||||
await page.waitForTimeout(300);
|
||||
}
|
||||
|
||||
async function fillNumber(page, label, value) {
|
||||
if (value === null || value === undefined) return;
|
||||
const input = page.locator(`input[aria-label="${label}"]`).first();
|
||||
if (await input.count()) { await input.fill(String(value)); await input.press("Enter"); }
|
||||
}
|
||||
|
||||
async function setCheckbox(page, label, checked) {
|
||||
const box = page.locator(`input[type="checkbox"][aria-label="${label}"]`).first();
|
||||
if (await box.count()) await box.setChecked(Boolean(checked)).catch(() => {});
|
||||
}
|
||||
|
||||
/** Pick one option whose value is a JSON [object, subelement] reference. */
|
||||
async function selectReference(page, locator, wanted) {
|
||||
if (!wanted) return;
|
||||
const object = typeof wanted === "string" ? wanted : wanted.object;
|
||||
const sub = typeof wanted === "string" ? null : wanted.subelements?.[0] ?? wanted.subelement ?? null;
|
||||
const match = await locator.evaluate((node, ref) => {
|
||||
for (const option of node.options) {
|
||||
try {
|
||||
const parsed = JSON.parse(option.value);
|
||||
const sameObject = parsed[0] === ref.object || `${parsed[0]}_${parsed[1]}` === ref.object;
|
||||
if (sameObject && (!ref.sub || parsed[1] === ref.sub)) return option.value;
|
||||
} catch { /* placeholder option text has no JSON value */ }
|
||||
}
|
||||
return null;
|
||||
}, { object, sub });
|
||||
if (!match) throw new Error(`no reference option for ${object}${sub ? "·" + sub : ""}`);
|
||||
await locator.selectOption(match);
|
||||
await page.waitForTimeout(300);
|
||||
}
|
||||
|
||||
/** Apply Pad / Pocket / Revolution / Hole / Loft / Pipe through the profile group. */
|
||||
export async function createFeature(page, step) {
|
||||
await page.locator(`[role="group"][aria-label="Profile feature"] button[data-feature-type="${step.featureType}"]`).first().click();
|
||||
await page.waitForTimeout(500);
|
||||
// Select by the name the UI actually gave the sketch, not the kernel's name.
|
||||
// A missing name must fail: picking "the last option" silently builds the
|
||||
// wrong solid once a body holds more than one profile.
|
||||
const profileName = step.uiProfile ?? step.profile;
|
||||
if (profileName) {
|
||||
const select = page.locator('select[aria-label="Feature Profile"]').first();
|
||||
const values = await select.evaluate(node => [...node.options].map(option => option.value));
|
||||
if (!values.includes(profileName)) throw new Error(`profile ${profileName} is not in the feature list`);
|
||||
await select.selectOption(profileName);
|
||||
await page.waitForTimeout(350);
|
||||
}
|
||||
if (step.length !== null && step.length !== undefined) {
|
||||
const input = page.locator('input[aria-label="Feature Length"]').first();
|
||||
if (await input.count()) { await input.fill(String(step.length)); await input.press("Enter"); }
|
||||
}
|
||||
if (step.featureType === "Revolution" && step.angle != null) {
|
||||
const input = page.locator('input[aria-label="Feature Angle"]').first();
|
||||
if (await input.count()) { await input.fill(String(step.angle)); await input.press("Enter"); }
|
||||
}
|
||||
// A Revolution without an axis spins the profile about an axis the form picked,
|
||||
// which produces a completely different solid (shafts came out 16x too large).
|
||||
// The axis select's values are JSON ["objectName","subelement"] pairs, so the
|
||||
// kernel's single axis name has to be matched against the first element.
|
||||
if (step.featureType === "Revolution") {
|
||||
const axisSelect = page.locator('select[aria-label="Feature Axis"]').first();
|
||||
if (await axisSelect.count()) {
|
||||
const wanted = step.axis ?? "X_Axis";
|
||||
const match = await axisSelect.evaluate((node, name) => {
|
||||
for (const option of node.options) {
|
||||
try {
|
||||
const [object, sub] = JSON.parse(option.value);
|
||||
if (object === name || `${object}_${sub}` === name || object === `${name}`.replace("_Axis", "")) return option.value;
|
||||
} catch { /* placeholder option */ }
|
||||
}
|
||||
// Fall back to matching the visible label, which reads "X-axis · ".
|
||||
const byLabel = [...node.options].find(option => option.textContent.trim().startsWith(name.replace("_", "-")));
|
||||
return byLabel ? byLabel.value : null;
|
||||
}, wanted);
|
||||
if (match) { await axisSelect.selectOption(match); await page.waitForTimeout(300); }
|
||||
else throw new Error(`no axis option for ${wanted}`);
|
||||
}
|
||||
}
|
||||
// Midplane has no checkbox: it is the Sides select's "Symmetric" option. That
|
||||
// select carries no aria-label and its options have no value attribute, so it
|
||||
// has to be found by the label text ("Sides") rather than by a value filter.
|
||||
const sides = page.locator('label:has(> select)').filter({ hasText: /^\s*Sides/ }).locator("select").first();
|
||||
const mode = step.midplane ? "Symmetric" : "One side";
|
||||
if (await sides.count()) {
|
||||
await sides.selectOption({ label: mode });
|
||||
await page.waitForTimeout(300);
|
||||
}
|
||||
// "Reversed" flips the extrusion direction of every profile feature the form
|
||||
// draws it for. Hole carries its own copy inside fillFeatureExtras. Without
|
||||
// this the flag was silently dropped and a pocket authored to cut upwards
|
||||
// still cut downwards, so the built solid disagreed with the recorded
|
||||
// reference while every step still "succeeded" (P05 CarrierHangar).
|
||||
if (step.reversed !== undefined && ["Pad", "Pocket", "Revolution", "Groove"].includes(step.featureType)) {
|
||||
await setCheckbox(page, "Reversed", step.reversed === true);
|
||||
}
|
||||
await fillFeatureExtras(page, step);
|
||||
await page.locator('button[data-create-feature]').first().click();
|
||||
await page.waitForTimeout(2500);
|
||||
}
|
||||
|
||||
/** Fields that only exist for one feature type (Loft, Pipe, Hole). */
|
||||
async function fillFeatureExtras(page, step) {
|
||||
if (step.featureType === "Loft" || step.featureType === "SubtractiveLoft") {
|
||||
const sections = (step.sections ?? []).map(section => (typeof section === "string" ? section : section?.object)).filter(Boolean);
|
||||
if (sections.length) {
|
||||
const picked = await selectMulti(page, page.locator('select[aria-label="Loft Sections"]').first(), sections);
|
||||
if (picked.length !== sections.length) throw new Error(`loft sections missing: wanted ${sections.join(",")} got ${picked.join(",") || "none"}`);
|
||||
}
|
||||
await setCheckbox(page, "Loft Ruled", step.ruled === true);
|
||||
await setCheckbox(page, "Loft Closed", step.closed === true);
|
||||
return;
|
||||
}
|
||||
if (step.featureType === "Pipe" || step.featureType === "SubtractivePipe") {
|
||||
const spine = step.spine ?? step.spineEdges?.[0] ?? null;
|
||||
if (spine) {
|
||||
const spineObject = typeof spine === "string" ? spine : spine.object;
|
||||
const spineSelect = page.locator('select[aria-label="Pipe Spine"]').first();
|
||||
if (await spineSelect.count()) {
|
||||
const values = await spineSelect.evaluate(node => [...node.options].map(option => option.value));
|
||||
const byValue = values.find(value => value === spineObject);
|
||||
const byLabel = await spineSelect.evaluate((node, name) => {
|
||||
const option = [...node.options].find(item => item.textContent.trim() === name
|
||||
|| item.textContent.trim().startsWith(`${name} `));
|
||||
return option ? option.value : null;
|
||||
}, spineObject);
|
||||
const chosen = byValue ?? byLabel;
|
||||
if (chosen) await spineSelect.selectOption(chosen);
|
||||
else throw new Error(`no pipe spine option for ${spineObject}`);
|
||||
await page.waitForTimeout(300);
|
||||
}
|
||||
}
|
||||
if (step.orientation) {
|
||||
const orientation = page.locator('select[aria-label="Pipe Orientation"]').first();
|
||||
if (await orientation.count()) await orientation.selectOption(step.orientation).catch(() => {});
|
||||
}
|
||||
if (step.transition) {
|
||||
const transition = page.locator('select[aria-label="Pipe Transition"]').first();
|
||||
if (await transition.count()) await transition.selectOption(step.transition).catch(() => {});
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (step.featureType === "Hole") {
|
||||
await fillNumber(page, "Hole Diameter", step.diameter);
|
||||
if (step.depthType) {
|
||||
const depthType = page.locator('select[aria-label="Hole Depth Type"]').first();
|
||||
if (await depthType.count()) await depthType.selectOption(step.depthType).catch(() => {});
|
||||
await page.waitForTimeout(200);
|
||||
}
|
||||
if (step.depthType !== "ThroughAll") await fillNumber(page, "Hole Depth", step.depth);
|
||||
await setCheckbox(page, "Reversed", step.reversed === true);
|
||||
}
|
||||
}
|
||||
|
||||
/** Fillet / Chamfer through the dress-up group (inside a collapsed details). */
|
||||
export async function createDressUp(page, step) {
|
||||
await openDesignGroup(page, "厚度|布尔与边缘|Dress");
|
||||
await page.locator(`[role="group"][aria-label="Dress-up feature"] button[data-dressup-type="${step.dressUpType}"]`).first().click();
|
||||
await page.waitForTimeout(400);
|
||||
if (step.base) {
|
||||
const base = page.locator('select[aria-label="Dress-up Base"]').first();
|
||||
if (await base.count()) {
|
||||
const values = await base.evaluate(node => [...node.options].map(option => option.value));
|
||||
if (!values.includes(step.base)) throw new Error(`dress-up base ${step.base} is not in the list`);
|
||||
await base.selectOption(step.base);
|
||||
await page.waitForTimeout(300);
|
||||
}
|
||||
}
|
||||
await fillNumber(page, "Dress-up Size", step.size);
|
||||
if (step.dressUpType === "Chamfer") {
|
||||
if (step.chamferType) {
|
||||
const type = page.locator('select[aria-label="Chamfer type"]').first();
|
||||
if (await type.count()) await type.selectOption(step.chamferType).catch(() => {});
|
||||
}
|
||||
await fillNumber(page, "Chamfer second distance", step.size2);
|
||||
await fillNumber(page, "Chamfer angle", step.angle);
|
||||
await setCheckbox(page, "Chamfer Flip direction", step.flipDirection === true);
|
||||
}
|
||||
if (step.useAllEdges) await setCheckbox(page, "Use all edges", true);
|
||||
else {
|
||||
// Edge checkboxes are numbered EdgeN inside the native references group.
|
||||
for (const edge of step.edges ?? []) {
|
||||
const name = typeof edge === "string" ? edge : `Edge${edge.index ?? edge}`;
|
||||
const box = page.locator(`input[type="checkbox"][aria-label="${name}"]`).first();
|
||||
if (!(await box.count())) throw new Error(`no edge checkbox ${name}`);
|
||||
await box.setChecked(true);
|
||||
}
|
||||
}
|
||||
await page.waitForTimeout(300);
|
||||
await page.locator('button[data-create-dressup]').first().click();
|
||||
await page.waitForTimeout(2500);
|
||||
}
|
||||
|
||||
/** Additive sphere primitive (bearing balls). */
|
||||
export async function createPrimitive(page, step) {
|
||||
const operation = page.locator('select[aria-label="Design primitive operation"]').first();
|
||||
await operation.selectOption("Additive");
|
||||
await page.locator('select[aria-label="Design primitive type"]').first().selectOption("Sphere");
|
||||
await page.waitForTimeout(300);
|
||||
if (step.parameters?.Radius != null) {
|
||||
const radius = page.locator('input[aria-label="Design primitive Radius"]').first();
|
||||
if (await radius.count()) await radius.fill(String(step.parameters.Radius));
|
||||
}
|
||||
for (const [index, axis] of ["X", "Y", "Z"].entries()) {
|
||||
const input = page.locator(`input[aria-label="Design primitive position ${axis}"]`).first();
|
||||
if (await input.count()) await input.fill(String(step.position?.[index] ?? 0));
|
||||
}
|
||||
await page.locator('button[aria-label="Create design primitive"]').first().click();
|
||||
await page.waitForTimeout(2500);
|
||||
}
|
||||
|
||||
/** Polar pattern (bearing balls). */
|
||||
export async function createPolarPattern(page, step) {
|
||||
// The transformation fieldset is inside a <details> that starts collapsed, so
|
||||
// its controls exist in the DOM but cannot be clicked until the group opens.
|
||||
await page.evaluate(() => {
|
||||
for (const details of document.querySelectorAll("details.design-task-group")) {
|
||||
const summary = details.querySelector("summary");
|
||||
if (summary && /Transformation/i.test(summary.textContent ?? "")) details.open = true;
|
||||
}
|
||||
});
|
||||
await page.waitForTimeout(300);
|
||||
const originals = page.locator('select[aria-label="PolarPattern Originals"]').first();
|
||||
const names = step.originals ?? [];
|
||||
if (names.length) {
|
||||
// Select by `value`, not by visible text: the option label is the object's
|
||||
// display label, which need not equal the object name. A multi-select whose
|
||||
// value never lands leaves the form invalid, so the commit button stays
|
||||
// disabled and a blind click only times out.
|
||||
const values = await originals.evaluate((node, wanted) => {
|
||||
const picked = [...node.options].filter(option => wanted.includes(option.value)).map(option => option.value);
|
||||
return picked.length ? picked : [...node.options].map(option => option.value).filter(Boolean);
|
||||
}, names);
|
||||
if (values.length) await originals.evaluate((node, picked) => {
|
||||
for (const option of node.options) option.selected = picked.includes(option.value);
|
||||
node.dispatchEvent(new Event("change", { bubbles: true }));
|
||||
}, values);
|
||||
await page.waitForTimeout(300);
|
||||
}
|
||||
if (step.angle != null) {
|
||||
const angle = page.locator('input[aria-label="PolarPattern Angle"]').first();
|
||||
if (await angle.count()) await angle.fill(String(step.angle));
|
||||
}
|
||||
// Without an axis the form keeps "Create PolarPattern" disabled, and a blind
|
||||
// click then waits 30 s and reports a generic failure. The select's values are
|
||||
// JSON ["object","subelement"] pairs, so match on the object name.
|
||||
const wantedAxis = step.rotationAxis?.object;
|
||||
if (wantedAxis) {
|
||||
const axisSelect = page.locator('select[aria-label="PolarPattern Axis"]').first();
|
||||
if (await axisSelect.count()) {
|
||||
const match = await axisSelect.evaluate((node, name) => {
|
||||
for (const option of node.options) {
|
||||
try { if (JSON.parse(option.value)[0] === name) return option.value; } catch { /* placeholder */ }
|
||||
}
|
||||
return null;
|
||||
}, wantedAxis);
|
||||
if (match) { await axisSelect.selectOption(match); await page.waitForTimeout(300); }
|
||||
else throw new Error(`no polar axis option for ${wantedAxis}`);
|
||||
}
|
||||
}
|
||||
if (step.occurrences != null) {
|
||||
const occurrences = page.locator('input[aria-label="PolarPattern Occurrences"]').first();
|
||||
if (await occurrences.count()) await occurrences.fill(String(step.occurrences));
|
||||
}
|
||||
await page.locator('button[aria-label="Create PolarPattern"]').first().click();
|
||||
await page.waitForTimeout(2500);
|
||||
}
|
||||
|
||||
/**
|
||||
* Volume of the body's current tip.
|
||||
*
|
||||
* The standalone page has no global object array; the property pane renders the
|
||||
* selected feature's volume as text ("体积33600.000000"). Read that, and fall
|
||||
* back to the tree's tip row when nothing is selected.
|
||||
*/
|
||||
export async function tipVolume(page) {
|
||||
return page.evaluate(() => {
|
||||
const pane = document.querySelector("aside.property-pane")?.textContent ?? "";
|
||||
const match = /体积\s*(-?[\d.]+(?:[eE][-+]?\d+)?)/.exec(pane);
|
||||
return match ? Number(match[1]) : null;
|
||||
});
|
||||
}
|
||||
|
||||
/** Try every feature tab until the property pane reports a volume. */
|
||||
export async function selectTip(page) {
|
||||
const rows = await page.locator('[role="treeitem"] .fc-tree-col-label').allTextContents();
|
||||
for (const name of rows.reverse()) {
|
||||
await page.locator(`[role="treeitem"] .fc-tree-col-label:text-is("${name}")`).first().click().catch(() => {});
|
||||
await page.waitForTimeout(400);
|
||||
if (await tipVolume(page) != null) return name;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Involute gear / sprocket. The Gear / Sprocket fieldset lives on the same
|
||||
* `partdesign.html` page as the sketch editor, so no page hop is needed; the
|
||||
* fields are `Gear <parameterName>` and the commit button has no data hook, so
|
||||
* it is found by its visible label.
|
||||
*/
|
||||
export async function createGear(page, step) {
|
||||
// The gear fieldset lives inside a collapsed <details> task group, so the
|
||||
// select exists in the DOM but is not interactable until the group is opened.
|
||||
await page.evaluate(() => {
|
||||
for (const details of document.querySelectorAll("details.design-task-group")) {
|
||||
const summary = details.querySelector("summary");
|
||||
if (summary && /Gear/i.test(summary.textContent ?? "")) details.open = true;
|
||||
}
|
||||
});
|
||||
await page.waitForTimeout(300);
|
||||
const kind = step.gearType === "Sprocket" ? "Sprocket" : "InvoluteGear";
|
||||
await page.locator('select[aria-label="Gear type"]').first().selectOption(kind);
|
||||
await page.waitForTimeout(400);
|
||||
for (const [key, value] of Object.entries(step.gearParameters ?? {})) {
|
||||
if (typeof value === "boolean") {
|
||||
const box = page.locator(`input[type="checkbox"][aria-label="Gear ${key}"]`).first();
|
||||
if (await box.count()) await box.setChecked(value).catch(() => {});
|
||||
continue;
|
||||
}
|
||||
if (typeof value !== "number") continue;
|
||||
const input = page.locator(`input[aria-label="Gear ${key}"]`).first();
|
||||
if (await input.count()) { await input.fill(String(value)); await input.press("Enter"); }
|
||||
}
|
||||
// Position and orientation: a gear body sits at an axial offset and often
|
||||
// faces along Y, so the placement is part of the operation, not a nicety.
|
||||
for (const [index, axis] of ["X", "Y", "Z"].entries()) {
|
||||
const input = page.locator(`input[aria-label="Gear position ${axis}"]`).first();
|
||||
if (await input.count()) { await input.fill(String(step.position?.[index] ?? 0)); await input.press("Enter"); }
|
||||
}
|
||||
const gearPlane = page.locator('select[aria-label="Gear plane"]').first();
|
||||
if (await gearPlane.count()) {
|
||||
const rotation = step.placementRotation ?? [0, 0, 0, 1];
|
||||
const identity = rotation[0] === 0 && rotation[1] === 0 && rotation[2] === 0;
|
||||
if (identity) await gearPlane.selectOption("XY");
|
||||
else {
|
||||
await gearPlane.selectOption("Custom");
|
||||
for (const [index, axis] of ["W", "X", "Y", "Z"].entries()) {
|
||||
const input = page.locator(`input[aria-label="Gear rotation ${axis}"]`).first();
|
||||
if (await input.count()) { await input.fill(String(rotation[index])); await input.press("Enter"); }
|
||||
}
|
||||
}
|
||||
await page.waitForTimeout(200);
|
||||
}
|
||||
const commit = page.getByRole("button", { name: /^Create gear$/ }).first();
|
||||
await commit.click();
|
||||
await page.waitForTimeout(2500);
|
||||
}
|
||||
|
||||
/** Mirrored: originals + plane, then "Create Mirrored". */
|
||||
export async function createMirrored(page, step) {
|
||||
await openDesignGroup(page, "Transformation");
|
||||
const originals = page.locator('select[aria-label="Mirrored Originals"]').first();
|
||||
const names = step.originals ?? [];
|
||||
if (names.length) {
|
||||
const picked = await selectMulti(page, originals, names);
|
||||
if (!picked.length) throw new Error(`mirrored originals missing: ${names.join(",")}`);
|
||||
}
|
||||
await selectReference(page, page.locator('select[aria-label="Mirrored Plane"]').first(), step.mirrorPlane);
|
||||
const commit = page.locator('button[aria-label="Create Mirrored"]').first();
|
||||
await commit.waitFor({ state: "visible", timeout: 15000 });
|
||||
await commit.click();
|
||||
await page.waitForTimeout(2500);
|
||||
}
|
||||
|
||||
/** LinearPattern: originals + direction + length + occurrences. */
|
||||
export async function createLinearPattern(page, step) {
|
||||
await openDesignGroup(page, "Transformation");
|
||||
const originals = page.locator('select[aria-label="LinearPattern Originals"]').first();
|
||||
const names = step.originals ?? [];
|
||||
if (names.length) {
|
||||
const picked = await selectMulti(page, originals, names);
|
||||
if (!picked.length) throw new Error(`linear pattern originals missing: ${names.join(",")}`);
|
||||
}
|
||||
await selectReference(page, page.locator('select[aria-label="LinearPattern Direction"]').first(), step.direction);
|
||||
await fillNumber(page, "LinearPattern Length", step.length);
|
||||
await fillNumber(page, "LinearPattern Occurrences", step.occurrences);
|
||||
await setCheckbox(page, "LinearPattern Reversed", step.reversed === true);
|
||||
const occurrences = page.locator('input[aria-label="LinearPattern Occurrences"]').first();
|
||||
if (await occurrences.count()) await occurrences.press("Enter");
|
||||
await page.locator('button[aria-label="Create LinearPattern"]').first().click();
|
||||
await page.waitForTimeout(2500);
|
||||
}
|
||||
|
||||
export async function createTransform(page, step) {
|
||||
if (step.transformType === "Mirrored") return createMirrored(page, step);
|
||||
if (step.transformType === "LinearPattern") return createLinearPattern(page, step);
|
||||
return createPolarPattern(page, step);
|
||||
}
|
||||
|
||||
export async function runStep(page, step) {
|
||||
if (step.kind === "sketch") return createSketch(page, step);
|
||||
if (step.kind === "gear") return createGear(page, step);
|
||||
if (step.kind === "feature") return createFeature(page, step);
|
||||
if (step.kind === "primitive") return createPrimitive(page, step);
|
||||
if (step.kind === "transform") return createTransform(page, step);
|
||||
if (step.kind === "dressup") return createDressUp(page, step);
|
||||
throw new Error(`ui-driver cannot perform kind "${step.kind}" (${step.label})`);
|
||||
}
|
||||
80
web/tools/cad-ui-rebuild/lib/replay.mjs
Normal file
@@ -0,0 +1,80 @@
|
||||
// Normalize a project's build records into one shape.
|
||||
//
|
||||
// Two record formats exist in this repository and both are real evidence, so
|
||||
// the tool has to read either rather than force every project to re-record:
|
||||
//
|
||||
// freecad-web-*/replay/v1 { steps: [ { step, label, action, args, volume } ] }
|
||||
// freecad-web-process-trace/v1 { events: [ { step, label, action, args, tips } ] }
|
||||
//
|
||||
// The only shape difference that matters downstream is the per-step volume:
|
||||
// the replay format carries it directly, the trace format only carries a whole
|
||||
// document listing (`tips.objects`) and the volume of the progressive body must
|
||||
// be picked out of it. A missing volume is legitimate -- a sketch step builds no
|
||||
// solid -- and is passed through as null rather than invented.
|
||||
|
||||
import fs from "node:fs";
|
||||
|
||||
const STEP_LIST_KEYS = ["steps", "events"];
|
||||
|
||||
// Actions that leave a solid in the Body. Everything else (setSketch, a datum,
|
||||
// a parameter edit) touches no geometry, so it has no volume to compare.
|
||||
const SOLID_ACTIONS = new Set(["setFeature", "setGear", "setPrimitive", "setTransform", "setDressUp"]);
|
||||
|
||||
function isSolidStep(action) {
|
||||
return SOLID_ACTIONS.has(String(action ?? ""));
|
||||
}
|
||||
|
||||
function stepVolume(entry) {
|
||||
return typeof entry.volume === "number" ? entry.volume : bodyVolume(entry.tips);
|
||||
}
|
||||
|
||||
/** Volume of the accumulating body, which is what each step is asserted against. */
|
||||
function bodyVolume(tips) {
|
||||
const objects = tips?.objects ?? [];
|
||||
const body = objects.find(object => object?.type === "PartDesign::Body");
|
||||
if (body) return typeof body.volume === "number" ? body.volume : null;
|
||||
// Documents without a Body (a bare Part::Feature, a primitive placed straight
|
||||
// into the document) report the volume on the tip feature itself.
|
||||
const tip = tips?.tip;
|
||||
if (tip && typeof tip.volume === "number") return tip.volume;
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read one document's build record from disk and return `{ document, steps }`.
|
||||
* Throws when the file is not a record this tool understands, so a wrong path
|
||||
* fails immediately instead of producing a plausible empty run.
|
||||
*/
|
||||
export function readReplay(file) {
|
||||
let text;
|
||||
try { text = fs.readFileSync(file, "utf8"); }
|
||||
catch (error) { throw new Error(`${file}: ${error.message}`); }
|
||||
let record;
|
||||
try { record = JSON.parse(text); }
|
||||
catch (error) { throw new Error(`${file}: not valid JSON (${error.message})`); }
|
||||
return normalizeReplay(record, file);
|
||||
}
|
||||
|
||||
/** Normalize an already-parsed record. */
|
||||
export function normalizeReplay(record, label = "replay") {
|
||||
if (!record || typeof record !== "object") throw new Error(`${label}: not an object`);
|
||||
const key = STEP_LIST_KEYS.find(name => Array.isArray(record[name]));
|
||||
if (!key) throw new Error(`${label}: has neither steps nor events; schema ${record.schema ?? "unknown"}`);
|
||||
const steps = record[key].map((entry, index) => {
|
||||
const step = entry.step ?? String(index + 1);
|
||||
return {
|
||||
step,
|
||||
label: entry.label ?? `step ${step}`,
|
||||
action: entry.action,
|
||||
args: entry.args ?? {},
|
||||
// Prefer the record's own per-step volume; fall back to the body listing.
|
||||
//
|
||||
// A sketch step builds no solid, and the trace format records the
|
||||
// *carried* body volume on it rather than 0 or null. That number belongs
|
||||
// to the previous feature, so asserting a sketch against it fails on every
|
||||
// sketch in the document. Only feature-like actions carry a solid.
|
||||
volume: isSolidStep(entry.action) ? stepVolume(entry) : null,
|
||||
};
|
||||
});
|
||||
return { schema: record.schema ?? null, document: record.document ?? null, source: key, steps };
|
||||
}
|
||||
225
web/tools/cad-ui-rebuild/lib/steps.mjs
Normal file
@@ -0,0 +1,225 @@
|
||||
// Turn a finished part into the exact list of UI operations that would rebuild it.
|
||||
//
|
||||
// The replay records each step's action and arguments, but it deliberately
|
||||
// compacts sketches to {count, sha256}: a trace should not carry thousands of
|
||||
// coordinates. The finished FCStd still holds them, and the kernel's snapshot
|
||||
// dumps every sketch's real geometry and constraints (PartDesignDocumentWorkflow
|
||||
// .cpp:1101-1150). So the UI instructions are generated from the same document
|
||||
// the videos render, never retyped by hand.
|
||||
|
||||
/**
|
||||
* Default page per command kind.
|
||||
*
|
||||
* The standalone PartDesign workspace is the only page that renders both the
|
||||
* sketch editor and the profile features, so every kind defaults to it. The old
|
||||
* copy of this table sent gears to workbench.html while the driver had already
|
||||
* moved gears onto partdesign.html — a project can still override any entry
|
||||
* through `project.json`'s `pages`.
|
||||
*/
|
||||
export const PAGE_FOR = {
|
||||
sketch: "partdesign.html",
|
||||
feature: "partdesign.html",
|
||||
gear: "partdesign.html",
|
||||
primitive: "partdesign.html",
|
||||
transform: "partdesign.html",
|
||||
dressup: "partdesign.html",
|
||||
};
|
||||
|
||||
const FEATURE_COMMAND = {
|
||||
Pad: "PartDesign_Pad",
|
||||
Pocket: "PartDesign_Pocket",
|
||||
Revolution: "PartDesign_Revolution",
|
||||
Groove: "PartDesign_Groove",
|
||||
Hole: "PartDesign_Hole",
|
||||
Loft: "PartDesign_AdditiveLoft",
|
||||
Pipe: "PartDesign_AdditivePipe",
|
||||
Helix: "PartDesign_AdditiveHelix",
|
||||
SubtractiveLoft: "PartDesign_SubtractiveLoft",
|
||||
SubtractivePipe: "PartDesign_SubtractivePipe",
|
||||
SubtractiveHelix: "PartDesign_SubtractiveHelix",
|
||||
Boolean: "PartDesign_Boolean",
|
||||
};
|
||||
|
||||
const TRANSFORM_COMMAND = {
|
||||
PolarPattern: "PartDesign_PolarPattern",
|
||||
LinearPattern: "PartDesign_LinearPattern",
|
||||
Mirrored: "PartDesign_Mirrored",
|
||||
Scaled: "PartDesign_Scaled",
|
||||
};
|
||||
|
||||
/**
|
||||
* Feature arguments that must survive into the UI step untouched.
|
||||
*
|
||||
* The panel names differ per feature type, but the replay already records them
|
||||
* under the kernel's own keys (`setFeature` accepts them verbatim), so copying
|
||||
* the known set is enough and keeps one table instead of one builder per type.
|
||||
*/
|
||||
const FEATURE_EXTRA = [
|
||||
"sections", "ruled", "closed",
|
||||
"spine", "spineEdges", "pipeMode", "transition", "referenceMode",
|
||||
"auxiliarySpine", "auxiliarySpineEdges", "auxiliaryCurvilinear", "binormal",
|
||||
"diameter", "depth", "depthType",
|
||||
];
|
||||
|
||||
const DRESS_UP_COMMAND = { Fillet: "PartDesign_Fillet", Chamfer: "PartDesign_Chamfer" };
|
||||
|
||||
/** Round to 1e-4 mm: finer than any drawing tolerance, and keeps the text short. */
|
||||
// Round only to kill float noise; 4 decimals broke arc closure (pi -> 3.1416
|
||||
// leaves a 1.6e-4 mm gap at r=41, far outside OCCT's 1e-7 confusion).
|
||||
const r4 = value => Math.round(Number(value) * 1e9) / 1e9;
|
||||
const triple = value => (Array.isArray(value) ? value.slice(0, 3).map(r4) : null);
|
||||
|
||||
/**
|
||||
* Describe one sketch for the geometry+constraint editor.
|
||||
*
|
||||
* The editor is laid out as rows: `Geometry N type` plus X/Y/Z (and radius or
|
||||
* angles), then `Constraint N type` plus its geometry/point slots. Keeping the
|
||||
* row order identical to the kernel's own means the numbering the learner reads
|
||||
* matches the numbering the kernel reported.
|
||||
*/
|
||||
export function describeSketch(sketch) {
|
||||
const geometries = (sketch.geometries ?? []).map(geometry => {
|
||||
const row = { type: geometry.type };
|
||||
if (geometry.type === "line") { row.start = triple(geometry.start); row.end = triple(geometry.end); }
|
||||
else if (geometry.type === "circle") { row.center = triple(geometry.center); row.radius = r4(geometry.radius); }
|
||||
else if (geometry.type === "arc") {
|
||||
row.center = triple(geometry.center); row.radius = r4(geometry.radius);
|
||||
row.startAngle = r4(geometry.startAngle); row.endAngle = r4(geometry.endAngle);
|
||||
} else if (geometry.type === "ellipse") {
|
||||
row.center = triple(geometry.center); row.majorRadius = r4(geometry.majorRadius);
|
||||
row.minorRadius = r4(geometry.minorRadius);
|
||||
} else if (geometry.type === "point") { row.point = triple(geometry.point); }
|
||||
else if (geometry.type === "bspline") row.points = (geometry.points ?? []).map(triple);
|
||||
return row;
|
||||
});
|
||||
const constraints = (sketch.constraints ?? []).map(constraint => {
|
||||
const row = { type: constraint.type };
|
||||
for (const key of ["first", "second", "third"]) if (constraint[key] != null) row[key] = constraint[key];
|
||||
for (const key of ["firstPos", "secondPos", "thirdPos"]) {
|
||||
if (constraint[key] && constraint[key] !== "none") row[key] = constraint[key];
|
||||
}
|
||||
if (constraint.value != null) row.value = r4(constraint.value);
|
||||
if (constraint.name) row.name = constraint.name;
|
||||
return row;
|
||||
});
|
||||
return {
|
||||
profileType: sketch.profileType ?? "Geometry",
|
||||
position: triple(sketch.position) ?? [0, 0, 0],
|
||||
// Sketches are not always parallel to XY. Bolt patterns on a Y-facing face
|
||||
// need a rotated support plane; the kernel snapshot now reports it and
|
||||
// `setSketch` accepts it.
|
||||
placementRotation: Array.isArray(sketch.placementRotation)
|
||||
? sketch.placementRotation.map(r4) : [0, 0, 0, 1],
|
||||
// Named constraints carry the dimensions of the simple profiles: a Circle
|
||||
// sketch has no geometry list at all, its radius IS the named constraint
|
||||
// "Radius" (the same conflation desktop Sketcher uses). Dropping this made
|
||||
// every Circle sketch non-reproducible.
|
||||
parameters: Object.fromEntries(Object.entries(sketch.parameters ?? {}).map(([key, value]) => [key, r4(value)])),
|
||||
geometries, constraints,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the UI step list for one document from its replay and a kernel snapshot.
|
||||
* @param {object} [options] `pages` and `featureCommands` from the project
|
||||
* manifest; anything absent falls back to the defaults above.
|
||||
*/
|
||||
export function uiStepsFor(document, replay, snapshotObjects, options = {}) {
|
||||
const pages = { ...PAGE_FOR, ...(options.pages ?? {}) };
|
||||
const featureCommands = { ...FEATURE_COMMAND, ...(options.featureCommands ?? {}) };
|
||||
const sketches = new Map();
|
||||
for (const object of snapshotObjects ?? []) {
|
||||
if (object.type === "Sketcher::SketchObject") sketches.set(object.name, object);
|
||||
}
|
||||
const failures = [];
|
||||
const steps = [];
|
||||
|
||||
for (const [index, step] of replay.steps.entries()) {
|
||||
const args = step.args ?? {};
|
||||
const objectName = args.object;
|
||||
const base = { step: step.step, label: step.label, action: step.action, object: objectName ?? null };
|
||||
|
||||
if (step.action === "setSketch") {
|
||||
const sketch = sketches.get(objectName);
|
||||
if (!sketch) { failures.push(`${document} step ${step.step}: sketch ${objectName} not in the document`); continue; }
|
||||
const described = describeSketch(sketch);
|
||||
// The replay's digest is the contract that these are the same arrays.
|
||||
if (args.geometries && typeof args.geometries === "object" && "count" in args.geometries
|
||||
&& args.geometries.count !== described.geometries.length)
|
||||
failures.push(`${document} step ${step.step}: ${described.geometries.length} geometries but the trace recorded ${args.geometries.count}`);
|
||||
// A simple profile without its dimension cannot be reproduced by hand.
|
||||
if (described.profileType === "Circle" && !(described.parameters?.Radius > 0))
|
||||
failures.push(`${document} step ${step.step}: Circle sketch ${objectName} has no Radius`);
|
||||
if (described.profileType === "Rectangle" && !(described.parameters?.Width > 0 && described.parameters?.Height > 0))
|
||||
failures.push(`${document} step ${step.step}: Rectangle sketch ${objectName} lacks Width/Height`);
|
||||
steps.push({
|
||||
...base, kind: "sketch", page: pages.sketch, command: "PartDesign_NewSketch",
|
||||
profileType: described.profileType, position: described.position,
|
||||
placementRotation: described.placementRotation,
|
||||
parameters: described.parameters,
|
||||
geometries: described.geometries, constraints: described.constraints,
|
||||
requireFullyConstrained: false,
|
||||
});
|
||||
} else if (step.action === "setFeature") {
|
||||
const command = featureCommands[args.featureType];
|
||||
if (!command) { failures.push(`${document} step ${step.step}: unknown featureType ${args.featureType}`); continue; }
|
||||
const extra = {};
|
||||
for (const key of FEATURE_EXTRA) if (args[key] !== undefined) extra[key] = args[key];
|
||||
steps.push({
|
||||
...base, kind: "feature", page: pages.feature, command,
|
||||
featureType: args.featureType, profile: args.profile ?? null, profileType: null,
|
||||
position: null, geometries: [], constraints: [],
|
||||
length: args.length ?? null, midplane: args.midplane === true, reversed: args.reversed === true,
|
||||
angle: args.angle ?? (args.featureType === "Revolution" ? 360 : null), axis: args.axis ?? null,
|
||||
...extra,
|
||||
});
|
||||
} else if (step.action === "setGear") {
|
||||
steps.push({
|
||||
...base, kind: "gear", page: pages.gear, command: "PartDesign_InvoluteGear",
|
||||
gearType: args.gearType, gearParameters: args.gearParameters ?? {},
|
||||
position: triple(args.position) ?? [0, 0, 0],
|
||||
placementRotation: Array.isArray(args.placementRotation)
|
||||
? args.placementRotation.map(r4) : [0, 0, 0, 1],
|
||||
geometries: [], constraints: [],
|
||||
});
|
||||
} else if (step.action === "setPrimitive") {
|
||||
steps.push({
|
||||
...base, kind: "primitive", page: pages.primitive, command: "PartDesign_AdditiveSphere",
|
||||
primitiveType: args.primitiveType, parameters: args.parameters ?? {},
|
||||
position: triple(args.position) ?? [0, 0, 0], geometries: [], constraints: [],
|
||||
});
|
||||
} else if (step.action === "setTransform") {
|
||||
// Older records omit transformType; they were all polar patterns, and the
|
||||
// driver branches on this field, so defaulting keeps them identical.
|
||||
const transformType = args.transformType ?? "PolarPattern";
|
||||
const command = TRANSFORM_COMMAND[transformType];
|
||||
if (!command) { failures.push(`${document} step ${step.step}: unknown transformType ${transformType}`); continue; }
|
||||
steps.push({
|
||||
...base, kind: "transform", page: pages.transform, command,
|
||||
transformType, originals: args.originals ?? [],
|
||||
occurrences: args.occurrences ?? null, angle: args.angle ?? null,
|
||||
rotationAxis: args.rotationAxis ?? null,
|
||||
mirrorPlane: args.mirrorPlane ?? null, direction: args.direction ?? null,
|
||||
length: args.length ?? null, reversed: args.reversed === true,
|
||||
geometries: [], constraints: [],
|
||||
});
|
||||
} else if (step.action === "setDressUp") {
|
||||
const command = DRESS_UP_COMMAND[args.dressUpType];
|
||||
if (!command) { failures.push(`${document} step ${step.step}: unknown dressUpType ${args.dressUpType}`); continue; }
|
||||
steps.push({
|
||||
...base, kind: "dressup", page: pages.dressup, command,
|
||||
dressUpType: args.dressUpType, base: args.base ?? null,
|
||||
size: args.size ?? null, edges: args.edges ?? [],
|
||||
useAllEdges: args.useAllEdges === true,
|
||||
chamferType: args.chamferType ?? null, size2: args.size2 ?? null,
|
||||
angle: args.angle ?? null, flipDirection: args.flipDirection === true,
|
||||
geometries: [], constraints: [],
|
||||
});
|
||||
} else {
|
||||
failures.push(`${document} step ${step.step}: unhandled action ${step.action}`);
|
||||
continue;
|
||||
}
|
||||
void index;
|
||||
}
|
||||
return { document, steps, failures };
|
||||
}
|
||||
41
web/tools/cad-ui-rebuild/lib/stills.mjs
Normal file
@@ -0,0 +1,41 @@
|
||||
// Where a step's screenshot is written, and what it is called.
|
||||
//
|
||||
// The writer (drive.mjs) and the checker (accept.mjs) must agree exactly, or a
|
||||
// project that never had a video pipeline gets a false "missing still" for
|
||||
// every step. A course script, when present, supplies the scene id and title;
|
||||
// without one the step number is enough. Both sides call these helpers.
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
|
||||
/** Scene id for step index (0-based): `S01` unless a course script says otherwise. */
|
||||
export function sceneId(project, part, index, steps) {
|
||||
const declared = part.sceneTitles?.[index + 1];
|
||||
if (declared) return declared;
|
||||
const script = readScript(project, part);
|
||||
const hit = script?.scenes?.find(item => item.step === index + 1);
|
||||
return hit?.id ?? `S${String(index + 1).padStart(2, "0")}`;
|
||||
}
|
||||
|
||||
/** Human title for a step, used inside the filename. */
|
||||
export function sceneTitle(project, part, index, steps) {
|
||||
const script = readScript(project, part);
|
||||
return script?.scenes?.find(item => item.step === index + 1)?.title
|
||||
?? steps[index]?.label ?? `step ${index + 1}`;
|
||||
}
|
||||
|
||||
/** Filename stem (no extension) for a step's still. */
|
||||
export function stillName(project, part, index, steps) {
|
||||
const title = String(sceneTitle(project, part, index, steps)).replace(/[^\w一-龥-]+/g, "_");
|
||||
return `${sceneId(project, part, index, steps)}-${title}`;
|
||||
}
|
||||
|
||||
/** Absolute path a step's still is written to. */
|
||||
export function stillPath(project, part, index, steps) {
|
||||
return path.join(project.paths.stillsDir, part.id, `${stillName(project, part, index, steps)}.png`);
|
||||
}
|
||||
|
||||
function readScript(project, part) {
|
||||
const file = path.join(project.root, "episodes", part.id, "script.zh.json");
|
||||
if (!fs.existsSync(file)) return null;
|
||||
try { return JSON.parse(fs.readFileSync(file, "utf8")); } catch { return null; }
|
||||
}
|
||||
158
web/tools/cad-ui-rebuild/manifest.mjs
Normal file
@@ -0,0 +1,158 @@
|
||||
#!/usr/bin/env node
|
||||
// Project manifest: the only thing a new project has to write.
|
||||
//
|
||||
// Every runner in this directory takes `--project <dir>` and reads
|
||||
// `<dir>/project.json`. Nothing here may assume a project name, an episode id
|
||||
// format, or a directory layout: those are exactly the couplings that made the
|
||||
// original reducer scripts non-reusable.
|
||||
//
|
||||
// A manifest is validated eagerly so a typo fails in a tenth of a second
|
||||
// instead of after two minutes of browser startup.
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
|
||||
export const MANIFEST_SCHEMA = "freecad-web-cad-ui-rebuild/project/v1";
|
||||
|
||||
// The standalone PartDesign workspace is the only page that carries both the
|
||||
// sketch editor and the profile features, so it is the correct default for
|
||||
// every modelling kind. A project can override any of them.
|
||||
const DEFAULT_PAGES = {
|
||||
sketch: "partdesign.html",
|
||||
feature: "partdesign.html",
|
||||
gear: "partdesign.html",
|
||||
primitive: "partdesign.html",
|
||||
transform: "partdesign.html",
|
||||
// assembly.html is the kernel probe's fixture page, not a workbench: the
|
||||
// Create/Insert tasks mount on the workbench surface, keyed by command.
|
||||
assembly: "workbench.html?module=Assembly&command=Assembly_CreateAssembly",
|
||||
};
|
||||
|
||||
const DEFAULT_FEATURE_COMMANDS = {
|
||||
Pad: "PartDesign_Pad",
|
||||
Pocket: "PartDesign_Pocket",
|
||||
Revolution: "PartDesign_Revolution",
|
||||
Groove: "PartDesign_Groove",
|
||||
};
|
||||
|
||||
const fail = message => {
|
||||
const error = new Error(message);
|
||||
error.isPrerequisite = true; // a bad manifest is a setup problem, not a product defect
|
||||
throw error;
|
||||
};
|
||||
|
||||
const resolveFrom = (base, value) => (path.isAbsolute(value) ? value : path.resolve(base, value));
|
||||
|
||||
/**
|
||||
* Load and validate a project manifest.
|
||||
*
|
||||
* `--project` accepts either a directory holding `project.json` or the manifest
|
||||
* file itself, so a project's config can live anywhere (this tool keeps the
|
||||
* ones it ships in `projects/`) without inventing a second flag.
|
||||
*
|
||||
* @param {string} projectPath absolute path to the project directory or its .json
|
||||
* @param {{requireParts?: boolean, requireAssembly?: boolean}} options
|
||||
*/
|
||||
export function loadProject(projectPath, options = {}) {
|
||||
const resolved = path.resolve(projectPath);
|
||||
const isFile = /\.json$/i.test(resolved);
|
||||
const file = isFile ? resolved : path.join(resolved, "project.json");
|
||||
const root = isFile ? path.dirname(resolved) : resolved;
|
||||
if (!fs.existsSync(file)) fail(`no manifest at ${file}`);
|
||||
let raw;
|
||||
try {
|
||||
raw = JSON.parse(fs.readFileSync(file, "utf8"));
|
||||
} catch (error) {
|
||||
fail(`project.json is not valid JSON: ${error.message}`);
|
||||
}
|
||||
|
||||
if (raw.schema && raw.schema !== MANIFEST_SCHEMA) {
|
||||
fail(`project.json schema is ${raw.schema}, expected ${MANIFEST_SCHEMA}`);
|
||||
}
|
||||
if (!raw.name) fail("project.json needs a name");
|
||||
|
||||
const paths = raw.paths ?? {};
|
||||
const outDir = resolveFrom(root, paths.outDir ?? "out");
|
||||
const project = {
|
||||
name: raw.name,
|
||||
root,
|
||||
appOrigin: raw.appOrigin ?? "http://127.0.0.1:5180",
|
||||
pages: { ...DEFAULT_PAGES, ...(raw.pages ?? {}) },
|
||||
featureCommands: { ...DEFAULT_FEATURE_COMMANDS, ...(raw.featureCommands ?? {}) },
|
||||
paths: {
|
||||
replayDir: paths.replayDir ? resolveFrom(root, paths.replayDir) : null,
|
||||
// Records are not always named `<document>.json`: one project prefixes
|
||||
// them (`trace-<document>.json`). `{document}` is substituted; the
|
||||
// default matches the records this tool itself writes.
|
||||
replayName: paths.replayName ?? "{document}.json",
|
||||
assemblyReplayName: paths.assemblyReplayName ?? paths.replayName ?? "{document}.json",
|
||||
sampleDir: paths.sampleDir ? resolveFrom(root, paths.sampleDir) : null,
|
||||
outDir,
|
||||
stepsDir: path.join(outDir, "ui-steps"),
|
||||
runDir: path.join(outDir, "ui-run"),
|
||||
stillsDir: resolveFrom(root, paths.stillsDir ?? "ui-stills"),
|
||||
},
|
||||
parts: (raw.parts ?? []).map(part => {
|
||||
if (!part.id) fail("every part needs an id");
|
||||
if (!part.document) fail(`part ${part.id} needs a document`);
|
||||
return {
|
||||
id: String(part.id),
|
||||
document: String(part.document),
|
||||
title: part.title ?? String(part.document),
|
||||
// Optional: which scene ids belong to which kernel step. Without it the
|
||||
// driver names stills by step number instead of the course scene id.
|
||||
sceneTitles: part.sceneTitles ?? null,
|
||||
};
|
||||
}),
|
||||
assembly: raw.assembly ?? null,
|
||||
};
|
||||
|
||||
if (options.requireParts && !project.parts.length) fail("project.json has no parts");
|
||||
if (options.requireParts && !project.paths.replayDir) fail("project.json needs paths.replayDir to read replays");
|
||||
if (options.requireAssembly) {
|
||||
if (!project.assembly) fail("project.json has no assembly block");
|
||||
if (!project.assembly.document) fail("assembly block needs a document name");
|
||||
}
|
||||
|
||||
// Part ids are used as directory names, so reject anything path-hostile.
|
||||
for (const part of project.parts) {
|
||||
if (!/^[\w.-]+$/.test(part.id)) fail(`part id "${part.id}" must be letters, digits, dot, dash or underscore`);
|
||||
}
|
||||
const duplicates = project.parts.filter((part, index) => project.parts.findIndex(other => other.id === part.id) !== index);
|
||||
if (duplicates.length) fail(`duplicate part ids: ${duplicates.map(part => part.id).join(", ")}`);
|
||||
|
||||
return project;
|
||||
}
|
||||
|
||||
/** Path of one record in the project's replay directory, honouring the name pattern. */
|
||||
export function replayPath(project, document, { assembly = false } = {}) {
|
||||
if (!project.paths.replayDir) fail(`project ${project.name} has no paths.replayDir`);
|
||||
const pattern = assembly ? project.paths.assemblyReplayName : project.paths.replayName;
|
||||
return path.join(project.paths.replayDir, pattern.replace("{document}", document));
|
||||
}
|
||||
|
||||
/** Resolve `--project` from argv, defaulting to the current directory. */
|
||||
export function projectFromArgv(argv = process.argv.slice(2), fallback = process.cwd()) {
|
||||
const index = argv.indexOf("--project");
|
||||
const value = index >= 0 ? argv[index + 1] : fallback;
|
||||
if (!value) fail("--project <dir> is required");
|
||||
return path.resolve(value);
|
||||
}
|
||||
|
||||
/** Read one JSON file, returning null when it is absent. */
|
||||
export function readJson(file) {
|
||||
return fs.existsSync(file) ? JSON.parse(fs.readFileSync(file, "utf8")) : null;
|
||||
}
|
||||
|
||||
/** `manifest.mjs --project <dir>` prints the part ids, one per line (used by sweep.sh). */
|
||||
if (import.meta.url === `file://${process.argv[1]}`) {
|
||||
const project = loadProject(projectFromArgv(), { requireParts: true });
|
||||
for (const part of project.parts) console.log(part.id);
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
/** Locate a part by id or document name. */
|
||||
export function findPart(project, key) {
|
||||
const part = project.parts.find(item => item.id === key || item.document === key);
|
||||
if (!part) fail(`project ${project.name} has no part "${key}"`);
|
||||
return part;
|
||||
}
|
||||
42
web/tools/cad-ui-rebuild/projects/README.md
Normal file
@@ -0,0 +1,42 @@
|
||||
# 工程清单目录
|
||||
|
||||
每个 `*.json` 是一个工程的接入清单(schema `freecad-web-cad-ui-rebuild/project/v1`),
|
||||
直接传给工具的 `--project`:
|
||||
|
||||
```bash
|
||||
node ../build-steps.mjs --project projects/secondary-reducer-pro.json
|
||||
```
|
||||
|
||||
| 清单 | 工程 | 构建记录格式 | 零件 |
|
||||
|---|---|---|---|
|
||||
| `secondary-reducer-pro.json` | `teaching/cases/secondary-reducer-pro` | `replay/v1`(`steps`,每步带 `volume`) | 23 |
|
||||
| `secondary-reducer.json` | `teaching/cases/secondary-reducer`(上一代) | `process-trace/v1`(`events`,体积取自 `tips`) | 23 |
|
||||
|
||||
两份清单覆盖了仓库里现存的两代构建记录格式。工具通过 `lib/replay.mjs`
|
||||
归一化二者,所以新工程无论用哪种格式都能直接接入。
|
||||
|
||||
`paths.replayName` 指定记录文件名,`{document}` 会被替换;默认 `<document>.json`。
|
||||
若某个工程的记录另有命名(例如旧工程用 `trace-<document>.json`),在清单里写
|
||||
`"replayName": "trace-{document}.json"` 即可,无需改代码。
|
||||
|
||||
`paths` 里的相对路径以**本目录**为基准。产物(`out/`、`ui-stills/`)写在清单
|
||||
所在目录下;若想让产物落到工程自己的目录,把 `outDir` / `stillsDir` 写成绝对路径
|
||||
或相对本目录的路径即可。
|
||||
|
||||
## 第二份清单证明了什么
|
||||
|
||||
两份清单不是复制品:它们喂给工具的输入形态不同。
|
||||
|
||||
| | `secondary-reducer-pro` | `secondary-reducer` |
|
||||
|---|---|---|
|
||||
| 记录键 | `steps[]`,每步直接带 `volume` | `events[]`,体积要从 `tips.objects` 里取 `PartDesign::Body` |
|
||||
| 记录文件名 | `<document>.json` | `trace-<document>.json` |
|
||||
| 有装配回放 | 是 | 否 |
|
||||
| 有教案脚本 | 是(截图按场景编号命名) | 否(截图按步号 `S01` 命名) |
|
||||
|
||||
三处差异各自对应一处曾经写死的假设,现在都改成了清单里的选项:
|
||||
`lib/replay.mjs` 归一化两种记录格式,`paths.replayName` 处理文件名,
|
||||
`lib/stills.mjs` 让写入方和校验方共用一套命名(缺教案脚本时退回步号)。
|
||||
|
||||
**验证**:`build-steps.mjs --project projects/secondary-reducer.json`
|
||||
→ 23 件 / 104 步 / 0 失败;逐件 `drive.mjs` 走出与记录一致的体积。
|
||||
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-run/v1",
|
||||
"generatedAt": "2026-11-19T12:01:44.026Z",
|
||||
"project": "secondary-reducer",
|
||||
"episode": "R01",
|
||||
"document": "Bearing6206_Balls",
|
||||
"steps": 2,
|
||||
"stepsTotal": 2,
|
||||
"failed": 0,
|
||||
"volume": 4040.284502,
|
||||
"expected": 4040.2845020573213,
|
||||
"relativeError": 1.4187455932224955e-11,
|
||||
"volumeMatches": true,
|
||||
"seconds": 103.933,
|
||||
"pageErrors": [],
|
||||
"results": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "ball",
|
||||
"kind": "primitive",
|
||||
"command": "PartDesign_AdditiveSphere",
|
||||
"uiName": null,
|
||||
"volume": 448.9205,
|
||||
"expectedVolume": 448.9205002285916,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 33507
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "ball pattern",
|
||||
"kind": "transform",
|
||||
"command": "PartDesign_PolarPattern",
|
||||
"uiName": null,
|
||||
"volume": 4040.284502,
|
||||
"expectedVolume": 4040.2845020573213,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34117
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-run/v1",
|
||||
"generatedAt": "2026-11-19T12:06:13.358Z",
|
||||
"project": "secondary-reducer",
|
||||
"episode": "R02",
|
||||
"document": "Bearing6206_Inner",
|
||||
"steps": 2,
|
||||
"stepsTotal": 2,
|
||||
"failed": 0,
|
||||
"volume": 6994.001612,
|
||||
"expected": 6994.001611914469,
|
||||
"relativeError": 1.2229150848124753e-11,
|
||||
"volumeMatches": true,
|
||||
"seconds": 109.348,
|
||||
"pageErrors": [],
|
||||
"results": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch1",
|
||||
"volume": 0,
|
||||
"expectedVolume": null,
|
||||
"volumeMatches": null,
|
||||
"status": "ok",
|
||||
"ms": 38870
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "revolution",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Revolution",
|
||||
"uiName": null,
|
||||
"volume": 6994.001612,
|
||||
"expectedVolume": 6994.001611914469,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34428
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-run/v1",
|
||||
"generatedAt": "2026-11-19T12:13:38.702Z",
|
||||
"project": "secondary-reducer",
|
||||
"episode": "R03",
|
||||
"document": "Bearing6206_Outer",
|
||||
"steps": 2,
|
||||
"stepsTotal": 2,
|
||||
"failed": 0,
|
||||
"volume": 11855.480945,
|
||||
"expected": 11855.480944361034,
|
||||
"relativeError": 5.389621102081815e-11,
|
||||
"volumeMatches": true,
|
||||
"seconds": 115.261,
|
||||
"pageErrors": [],
|
||||
"results": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch1",
|
||||
"volume": 0,
|
||||
"expectedVolume": null,
|
||||
"volumeMatches": null,
|
||||
"status": "ok",
|
||||
"ms": 39696
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "revolution",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Revolution",
|
||||
"uiName": null,
|
||||
"volume": 11855.480945,
|
||||
"expectedVolume": 11855.480944361034,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34488
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-run/v1",
|
||||
"generatedAt": "2026-11-19T12:13:32.040Z",
|
||||
"project": "secondary-reducer",
|
||||
"episode": "R04",
|
||||
"document": "Bearing6209_Balls",
|
||||
"steps": 2,
|
||||
"stepsTotal": 2,
|
||||
"failed": 0,
|
||||
"volume": 10725.308308,
|
||||
"expected": 10725.308307563699,
|
||||
"relativeError": 4.067957459436551e-11,
|
||||
"volumeMatches": true,
|
||||
"seconds": 108.575,
|
||||
"pageErrors": [],
|
||||
"results": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "ball",
|
||||
"kind": "primitive",
|
||||
"command": "PartDesign_AdditiveSphere",
|
||||
"uiName": null,
|
||||
"volume": 1072.530831,
|
||||
"expectedVolume": 1072.5308307563698,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 33691
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "ball pattern",
|
||||
"kind": "transform",
|
||||
"command": "PartDesign_PolarPattern",
|
||||
"uiName": null,
|
||||
"volume": 10725.308308,
|
||||
"expectedVolume": 10725.308307563699,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34137
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-run/v1",
|
||||
"generatedAt": "2026-11-19T12:13:38.830Z",
|
||||
"project": "secondary-reducer",
|
||||
"episode": "R05",
|
||||
"document": "Bearing6209_Inner",
|
||||
"steps": 2,
|
||||
"stepsTotal": 2,
|
||||
"failed": 0,
|
||||
"volume": 13949.564539,
|
||||
"expected": 13949.564539519452,
|
||||
"relativeError": 3.723776620326589e-11,
|
||||
"volumeMatches": true,
|
||||
"seconds": 115.63,
|
||||
"pageErrors": [],
|
||||
"results": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch1",
|
||||
"volume": 0,
|
||||
"expectedVolume": null,
|
||||
"volumeMatches": null,
|
||||
"status": "ok",
|
||||
"ms": 39797
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "revolution",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Revolution",
|
||||
"uiName": null,
|
||||
"volume": 13949.564539,
|
||||
"expectedVolume": 13949.564539519452,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34451
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-run/v1",
|
||||
"generatedAt": "2026-11-19T12:13:38.094Z",
|
||||
"project": "secondary-reducer",
|
||||
"episode": "R06",
|
||||
"document": "Bearing6209_Outer",
|
||||
"steps": 2,
|
||||
"stepsTotal": 2,
|
||||
"failed": 0,
|
||||
"volume": 22471.22645,
|
||||
"expected": 22471.22644921175,
|
||||
"relativeError": 3.507810959369447e-11,
|
||||
"volumeMatches": true,
|
||||
"seconds": 114.893,
|
||||
"pageErrors": [],
|
||||
"results": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch1",
|
||||
"volume": 0,
|
||||
"expectedVolume": null,
|
||||
"volumeMatches": null,
|
||||
"status": "ok",
|
||||
"ms": 40162
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "revolution",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Revolution",
|
||||
"uiName": null,
|
||||
"volume": 22471.22645,
|
||||
"expectedVolume": 22471.22644921175,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34429
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-run/v1",
|
||||
"generatedAt": "2026-11-19T12:16:15.030Z",
|
||||
"project": "secondary-reducer",
|
||||
"episode": "R07",
|
||||
"document": "Bearing6211_Balls",
|
||||
"steps": 2,
|
||||
"stepsTotal": 2,
|
||||
"failed": 0,
|
||||
"volume": 21046.990027,
|
||||
"expected": 21046.990026981934,
|
||||
"relativeError": 8.583746527582727e-13,
|
||||
"volumeMatches": true,
|
||||
"seconds": 107.922,
|
||||
"pageErrors": [],
|
||||
"results": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "ball",
|
||||
"kind": "primitive",
|
||||
"command": "PartDesign_AdditiveSphere",
|
||||
"uiName": null,
|
||||
"volume": 2104.699003,
|
||||
"expectedVolume": 2104.6990026981935,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 33607
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "ball pattern",
|
||||
"kind": "transform",
|
||||
"command": "PartDesign_PolarPattern",
|
||||
"uiName": null,
|
||||
"volume": 21046.990027,
|
||||
"expectedVolume": 21046.990026981934,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34138
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-run/v1",
|
||||
"generatedAt": "2026-11-19T12:17:08.866Z",
|
||||
"project": "secondary-reducer",
|
||||
"episode": "R08",
|
||||
"document": "Bearing6211_Inner",
|
||||
"steps": 2,
|
||||
"stepsTotal": 2,
|
||||
"failed": 0,
|
||||
"volume": 17781.661372,
|
||||
"expected": 17781.661369658123,
|
||||
"relativeError": 1.3170175996519803e-10,
|
||||
"volumeMatches": true,
|
||||
"seconds": 109.158,
|
||||
"pageErrors": [],
|
||||
"results": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch1",
|
||||
"volume": 0,
|
||||
"expectedVolume": null,
|
||||
"volumeMatches": null,
|
||||
"status": "ok",
|
||||
"ms": 38857
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "revolution",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Revolution",
|
||||
"uiName": null,
|
||||
"volume": 17781.661372,
|
||||
"expectedVolume": 17781.661369658123,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34421
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-run/v1",
|
||||
"generatedAt": "2026-11-19T12:18:59.594Z",
|
||||
"project": "secondary-reducer",
|
||||
"episode": "R09",
|
||||
"document": "Bearing6211_Outer",
|
||||
"steps": 2,
|
||||
"stepsTotal": 2,
|
||||
"failed": 0,
|
||||
"volume": 28399.617639,
|
||||
"expected": 28399.61763839215,
|
||||
"relativeError": 2.140351665020982e-11,
|
||||
"volumeMatches": true,
|
||||
"seconds": 109.663,
|
||||
"pageErrors": [],
|
||||
"results": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch1",
|
||||
"volume": 0,
|
||||
"expectedVolume": null,
|
||||
"volumeMatches": null,
|
||||
"status": "ok",
|
||||
"ms": 38843
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "revolution",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Revolution",
|
||||
"uiName": null,
|
||||
"volume": 28399.617639,
|
||||
"expectedVolume": 28399.61763839215,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34434
|
||||
}
|
||||
]
|
||||
}
|
||||
114
web/tools/cad-ui-rebuild/projects/out/ui-run/Coupling_input.json
Normal file
@@ -0,0 +1,114 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-run/v1",
|
||||
"generatedAt": "2026-11-19T12:24:12.467Z",
|
||||
"project": "secondary-reducer",
|
||||
"episode": "R10",
|
||||
"document": "Coupling_input",
|
||||
"steps": 8,
|
||||
"stepsTotal": 8,
|
||||
"failed": 0,
|
||||
"volume": 68246.890665,
|
||||
"expected": 68246.89066508244,
|
||||
"relativeError": 1.2079172979945846e-12,
|
||||
"volumeMatches": true,
|
||||
"seconds": 311.868,
|
||||
"pageErrors": [],
|
||||
"results": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "hub profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch1",
|
||||
"volume": 0,
|
||||
"expectedVolume": null,
|
||||
"volumeMatches": null,
|
||||
"status": "ok",
|
||||
"ms": 33877
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "hub",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Pad",
|
||||
"uiName": null,
|
||||
"volume": 74739.997193,
|
||||
"expectedVolume": 74739.9971933749,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34368
|
||||
},
|
||||
{
|
||||
"step": 3,
|
||||
"label": "flange profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch2",
|
||||
"volume": 0,
|
||||
"expectedVolume": 74739.9971933749,
|
||||
"volumeMatches": false,
|
||||
"status": "ok",
|
||||
"ms": 33819
|
||||
},
|
||||
{
|
||||
"step": 4,
|
||||
"label": "flange",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Pad",
|
||||
"uiName": null,
|
||||
"volume": 96186.64493,
|
||||
"expectedVolume": 96186.64492978324,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34326
|
||||
},
|
||||
{
|
||||
"step": 5,
|
||||
"label": "bore profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch3",
|
||||
"volume": 0,
|
||||
"expectedVolume": 96186.64492978324,
|
||||
"volumeMatches": false,
|
||||
"status": "ok",
|
||||
"ms": 33832
|
||||
},
|
||||
{
|
||||
"step": 6,
|
||||
"label": "bore",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Pocket",
|
||||
"uiName": null,
|
||||
"volume": 70325.054205,
|
||||
"expectedVolume": 70325.0542054321,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34385
|
||||
},
|
||||
{
|
||||
"step": 7,
|
||||
"label": "bolt profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch4",
|
||||
"volume": 0,
|
||||
"expectedVolume": 70325.0542054321,
|
||||
"volumeMatches": false,
|
||||
"status": "ok",
|
||||
"ms": 36995
|
||||
},
|
||||
{
|
||||
"step": 8,
|
||||
"label": "bolt pocket",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Pocket",
|
||||
"uiName": null,
|
||||
"volume": 68246.890665,
|
||||
"expectedVolume": 68246.89066508244,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34375
|
||||
}
|
||||
]
|
||||
}
|
||||
66
web/tools/cad-ui-rebuild/projects/out/ui-run/Gear2_80T.json
Normal file
@@ -0,0 +1,66 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-run/v1",
|
||||
"generatedAt": "2026-11-19T12:27:35.058Z",
|
||||
"project": "secondary-reducer",
|
||||
"episode": "R11",
|
||||
"document": "Gear2_80T",
|
||||
"steps": 4,
|
||||
"stepsTotal": 4,
|
||||
"failed": 0,
|
||||
"volume": 1374345.973163,
|
||||
"expected": 1374345.9731622054,
|
||||
"relativeError": 5.782030160588023e-13,
|
||||
"volumeMatches": true,
|
||||
"seconds": 198.445,
|
||||
"pageErrors": [],
|
||||
"results": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "gear profile",
|
||||
"kind": "gear",
|
||||
"command": "PartDesign_InvoluteGear",
|
||||
"uiName": null,
|
||||
"volume": 0,
|
||||
"expectedVolume": null,
|
||||
"volumeMatches": null,
|
||||
"status": "ok",
|
||||
"ms": 34639
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "pad",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Pad",
|
||||
"uiName": null,
|
||||
"volume": 1803982.587,
|
||||
"expectedVolume": 1803982.5869996948,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34493
|
||||
},
|
||||
{
|
||||
"step": 3,
|
||||
"label": "cut profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch1",
|
||||
"volume": 0,
|
||||
"expectedVolume": 1803982.5869996948,
|
||||
"volumeMatches": false,
|
||||
"status": "ok",
|
||||
"ms": 49929
|
||||
},
|
||||
{
|
||||
"step": 4,
|
||||
"label": "cut",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Pocket",
|
||||
"uiName": null,
|
||||
"volume": 1374345.973163,
|
||||
"expectedVolume": 1374345.9731622054,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 39837
|
||||
}
|
||||
]
|
||||
}
|
||||
66
web/tools/cad-ui-rebuild/projects/out/ui-run/Gear4_100T.json
Normal file
@@ -0,0 +1,66 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-run/v1",
|
||||
"generatedAt": "2026-11-19T12:30:47.076Z",
|
||||
"project": "secondary-reducer",
|
||||
"episode": "R12",
|
||||
"document": "Gear4_100T",
|
||||
"steps": 4,
|
||||
"stepsTotal": 4,
|
||||
"failed": 0,
|
||||
"volume": 3238339.769133,
|
||||
"expected": 3238339.769133226,
|
||||
"relativeError": 6.974120705212579e-14,
|
||||
"volumeMatches": true,
|
||||
"seconds": 196.486,
|
||||
"pageErrors": [],
|
||||
"results": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "gear profile",
|
||||
"kind": "gear",
|
||||
"command": "PartDesign_InvoluteGear",
|
||||
"uiName": null,
|
||||
"volume": 0,
|
||||
"expectedVolume": null,
|
||||
"volumeMatches": null,
|
||||
"status": "ok",
|
||||
"ms": 34409
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "pad",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Pad",
|
||||
"uiName": null,
|
||||
"volume": 4231048.657695,
|
||||
"expectedVolume": 4231048.657694664,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34413
|
||||
},
|
||||
{
|
||||
"step": 3,
|
||||
"label": "cut profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch1",
|
||||
"volume": 0,
|
||||
"expectedVolume": 4231048.657694664,
|
||||
"volumeMatches": false,
|
||||
"status": "ok",
|
||||
"ms": 49223
|
||||
},
|
||||
{
|
||||
"step": 4,
|
||||
"label": "cut",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Pocket",
|
||||
"uiName": null,
|
||||
"volume": 3238339.769133,
|
||||
"expectedVolume": 3238339.769133226,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 42315
|
||||
}
|
||||
]
|
||||
}
|
||||
210
web/tools/cad-ui-rebuild/projects/out/ui-run/HousingBase.json
Normal file
@@ -0,0 +1,210 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-run/v1",
|
||||
"generatedAt": "2026-11-19T12:53:14.967Z",
|
||||
"project": "secondary-reducer",
|
||||
"episode": "R13",
|
||||
"document": "HousingBase",
|
||||
"steps": 16,
|
||||
"stepsTotal": 16,
|
||||
"failed": 0,
|
||||
"volume": 4887641.232326,
|
||||
"expected": 4887641.23196484,
|
||||
"relativeError": 7.389257067722076e-11,
|
||||
"volumeMatches": true,
|
||||
"seconds": 641.936,
|
||||
"pageErrors": [],
|
||||
"results": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "outer profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch1",
|
||||
"volume": 0,
|
||||
"expectedVolume": null,
|
||||
"volumeMatches": null,
|
||||
"status": "ok",
|
||||
"ms": 46422
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "outer pad",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Pad",
|
||||
"uiName": null,
|
||||
"volume": 26885040,
|
||||
"expectedVolume": 26885040,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34480
|
||||
},
|
||||
{
|
||||
"step": 3,
|
||||
"label": "CavityBossLeft profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch2",
|
||||
"volume": 0,
|
||||
"expectedVolume": 26885040,
|
||||
"volumeMatches": false,
|
||||
"status": "ok",
|
||||
"ms": 44620
|
||||
},
|
||||
{
|
||||
"step": 4,
|
||||
"label": "CavityBossLeft",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Pocket",
|
||||
"uiName": null,
|
||||
"volume": 25138831.421113,
|
||||
"expectedVolume": 25138831.42110571,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34550
|
||||
},
|
||||
{
|
||||
"step": 5,
|
||||
"label": "CavityMiddle profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch3",
|
||||
"volume": 0,
|
||||
"expectedVolume": 25138831.42110571,
|
||||
"volumeMatches": false,
|
||||
"status": "ok",
|
||||
"ms": 37942
|
||||
},
|
||||
{
|
||||
"step": 6,
|
||||
"label": "CavityMiddle",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Pocket",
|
||||
"uiName": null,
|
||||
"volume": 7107223.421221,
|
||||
"expectedVolume": 7107223.421105716,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34471
|
||||
},
|
||||
{
|
||||
"step": 7,
|
||||
"label": "CavityBossRight profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch4",
|
||||
"volume": 0,
|
||||
"expectedVolume": 7107223.421105716,
|
||||
"volumeMatches": false,
|
||||
"status": "ok",
|
||||
"ms": 46805
|
||||
},
|
||||
{
|
||||
"step": 8,
|
||||
"label": "CavityBossRight",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Pocket",
|
||||
"uiName": null,
|
||||
"volume": 5361014.842572,
|
||||
"expectedVolume": 5361014.842211425,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34641
|
||||
},
|
||||
{
|
||||
"step": 9,
|
||||
"label": "bore profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch5",
|
||||
"volume": 0,
|
||||
"expectedVolume": 5361014.842211425,
|
||||
"volumeMatches": false,
|
||||
"status": "ok",
|
||||
"ms": 36324
|
||||
},
|
||||
{
|
||||
"step": 10,
|
||||
"label": "bores",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Pocket",
|
||||
"uiName": null,
|
||||
"volume": 4996968.656672,
|
||||
"expectedVolume": 4996968.656309765,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34631
|
||||
},
|
||||
{
|
||||
"step": 11,
|
||||
"label": "seal bore Near",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch6",
|
||||
"volume": 0,
|
||||
"expectedVolume": 4996968.656309765,
|
||||
"volumeMatches": false,
|
||||
"status": "ok",
|
||||
"ms": 36534
|
||||
},
|
||||
{
|
||||
"step": 12,
|
||||
"label": "seal bores Near",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Pocket",
|
||||
"uiName": null,
|
||||
"volume": 4954250.850562,
|
||||
"expectedVolume": 4954250.850202578,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34660
|
||||
},
|
||||
{
|
||||
"step": 13,
|
||||
"label": "seal bore Far",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch7",
|
||||
"volume": 0,
|
||||
"expectedVolume": 4954250.850202578,
|
||||
"volumeMatches": false,
|
||||
"status": "ok",
|
||||
"ms": 36642
|
||||
},
|
||||
{
|
||||
"step": 14,
|
||||
"label": "seal bores Far",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Pocket",
|
||||
"uiName": null,
|
||||
"volume": 4911533.044458,
|
||||
"expectedVolume": 4911533.04409538,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34669
|
||||
},
|
||||
{
|
||||
"step": 15,
|
||||
"label": "bolt profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch8",
|
||||
"volume": 0,
|
||||
"expectedVolume": 4911533.04409538,
|
||||
"volumeMatches": false,
|
||||
"status": "ok",
|
||||
"ms": 43381
|
||||
},
|
||||
{
|
||||
"step": 16,
|
||||
"label": "bolts",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Pocket",
|
||||
"uiName": null,
|
||||
"volume": 4887641.232326,
|
||||
"expectedVolume": 4887641.23196484,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34821
|
||||
}
|
||||
]
|
||||
}
|
||||
330
web/tools/cad-ui-rebuild/projects/out/ui-run/HousingCover.json
Normal file
@@ -0,0 +1,330 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-run/v1",
|
||||
"generatedAt": "2026-11-19T13:51:01.228Z",
|
||||
"project": "secondary-reducer",
|
||||
"episode": "R14",
|
||||
"document": "HousingCover",
|
||||
"steps": 26,
|
||||
"stepsTotal": 26,
|
||||
"failed": 0,
|
||||
"volume": 4418502.474112,
|
||||
"expected": 4418502.474178748,
|
||||
"relativeError": 1.5106450502802433e-11,
|
||||
"volumeMatches": true,
|
||||
"seconds": 978.322,
|
||||
"pageErrors": [],
|
||||
"results": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "outer profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch1",
|
||||
"volume": 0,
|
||||
"expectedVolume": null,
|
||||
"volumeMatches": null,
|
||||
"status": "ok",
|
||||
"ms": 41571
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "outer pad",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Pad",
|
||||
"uiName": null,
|
||||
"volume": 26454480,
|
||||
"expectedVolume": 26454480,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34437
|
||||
},
|
||||
{
|
||||
"step": 3,
|
||||
"label": "CoverCavityBossLeft profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch2",
|
||||
"volume": 0,
|
||||
"expectedVolume": null,
|
||||
"volumeMatches": null,
|
||||
"status": "ok",
|
||||
"ms": 44264
|
||||
},
|
||||
{
|
||||
"step": 4,
|
||||
"label": "CoverCavityBossLeft",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Pocket",
|
||||
"uiName": null,
|
||||
"volume": 24708271.421128,
|
||||
"expectedVolume": 24708271.42110571,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34495
|
||||
},
|
||||
{
|
||||
"step": 5,
|
||||
"label": "CoverCavityMiddle profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch3",
|
||||
"volume": 0,
|
||||
"expectedVolume": null,
|
||||
"volumeMatches": null,
|
||||
"status": "ok",
|
||||
"ms": 37319
|
||||
},
|
||||
{
|
||||
"step": 6,
|
||||
"label": "CoverCavityMiddle",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Pocket",
|
||||
"uiName": null,
|
||||
"volume": 6676663.421103,
|
||||
"expectedVolume": 6676663.421105708,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34461
|
||||
},
|
||||
{
|
||||
"step": 7,
|
||||
"label": "CoverCavityBossRight profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch4",
|
||||
"volume": 0,
|
||||
"expectedVolume": null,
|
||||
"volumeMatches": null,
|
||||
"status": "ok",
|
||||
"ms": 45199
|
||||
},
|
||||
{
|
||||
"step": 8,
|
||||
"label": "CoverCavityBossRight",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Pocket",
|
||||
"uiName": null,
|
||||
"volume": 4930454.842154,
|
||||
"expectedVolume": 4930454.842211417,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34542
|
||||
},
|
||||
{
|
||||
"step": 9,
|
||||
"label": "bore profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch5",
|
||||
"volume": 0,
|
||||
"expectedVolume": null,
|
||||
"volumeMatches": null,
|
||||
"status": "ok",
|
||||
"ms": 36201
|
||||
},
|
||||
{
|
||||
"step": 10,
|
||||
"label": "bores",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Pocket",
|
||||
"uiName": null,
|
||||
"volume": 4566408.656243,
|
||||
"expectedVolume": 4566408.656309761,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34577
|
||||
},
|
||||
{
|
||||
"step": 11,
|
||||
"label": "seal bore Near",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch6",
|
||||
"volume": 0,
|
||||
"expectedVolume": null,
|
||||
"volumeMatches": null,
|
||||
"status": "ok",
|
||||
"ms": 36435
|
||||
},
|
||||
{
|
||||
"step": 12,
|
||||
"label": "seal bores Near",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Pocket",
|
||||
"uiName": null,
|
||||
"volume": 4523690.850132,
|
||||
"expectedVolume": 4523690.850202577,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34612
|
||||
},
|
||||
{
|
||||
"step": 13,
|
||||
"label": "seal bore Far",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch7",
|
||||
"volume": 0,
|
||||
"expectedVolume": null,
|
||||
"volumeMatches": null,
|
||||
"status": "ok",
|
||||
"ms": 36369
|
||||
},
|
||||
{
|
||||
"step": 14,
|
||||
"label": "seal bores Far",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Pocket",
|
||||
"uiName": null,
|
||||
"volume": 4480973.044023,
|
||||
"expectedVolume": 4480973.044095389,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34544
|
||||
},
|
||||
{
|
||||
"step": 15,
|
||||
"label": "inspection profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch8",
|
||||
"volume": 0,
|
||||
"expectedVolume": null,
|
||||
"volumeMatches": null,
|
||||
"status": "ok",
|
||||
"ms": 34456
|
||||
},
|
||||
{
|
||||
"step": 16,
|
||||
"label": "inspection opening",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Pocket",
|
||||
"uiName": null,
|
||||
"volume": 4360210.22242,
|
||||
"expectedVolume": 4360210.222491388,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34838
|
||||
},
|
||||
{
|
||||
"step": 17,
|
||||
"label": "inspection bolt profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch9",
|
||||
"volume": 0,
|
||||
"expectedVolume": null,
|
||||
"volumeMatches": null,
|
||||
"status": "ok",
|
||||
"ms": 38372
|
||||
},
|
||||
{
|
||||
"step": 18,
|
||||
"label": "inspection bolts",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Pocket",
|
||||
"uiName": null,
|
||||
"volume": 4356393.187345,
|
||||
"expectedVolume": 4356393.187417279,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34703
|
||||
},
|
||||
{
|
||||
"step": 19,
|
||||
"label": "breather profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch10",
|
||||
"volume": 0,
|
||||
"expectedVolume": null,
|
||||
"volumeMatches": null,
|
||||
"status": "ok",
|
||||
"ms": 34529
|
||||
},
|
||||
{
|
||||
"step": 20,
|
||||
"label": "breather seat",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Pocket",
|
||||
"uiName": null,
|
||||
"volume": 4353251.594694,
|
||||
"expectedVolume": 4353251.594763685,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34730
|
||||
},
|
||||
{
|
||||
"step": 21,
|
||||
"label": "LiftBossA profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch11",
|
||||
"volume": 0,
|
||||
"expectedVolume": null,
|
||||
"volumeMatches": null,
|
||||
"status": "ok",
|
||||
"ms": 34610
|
||||
},
|
||||
{
|
||||
"step": 22,
|
||||
"label": "LiftBossA",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Pad",
|
||||
"uiName": null,
|
||||
"volume": 4391264.8658,
|
||||
"expectedVolume": 4391264.86587212,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34794
|
||||
},
|
||||
{
|
||||
"step": 23,
|
||||
"label": "LiftBossB profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch12",
|
||||
"volume": 0,
|
||||
"expectedVolume": null,
|
||||
"volumeMatches": null,
|
||||
"status": "ok",
|
||||
"ms": 34557
|
||||
},
|
||||
{
|
||||
"step": 24,
|
||||
"label": "LiftBossB",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Pad",
|
||||
"uiName": null,
|
||||
"volume": 4429278.136913,
|
||||
"expectedVolume": 4429278.1369805625,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34746
|
||||
},
|
||||
{
|
||||
"step": 25,
|
||||
"label": "lifting profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch13",
|
||||
"volume": 0,
|
||||
"expectedVolume": null,
|
||||
"volumeMatches": null,
|
||||
"status": "ok",
|
||||
"ms": 37042
|
||||
},
|
||||
{
|
||||
"step": 26,
|
||||
"label": "lifting threads",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Pocket",
|
||||
"uiName": null,
|
||||
"volume": 4418502.474112,
|
||||
"expectedVolume": 4418502.474178748,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34960
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-run/v1",
|
||||
"generatedAt": "2026-11-19T13:00:45.553Z",
|
||||
"project": "secondary-reducer",
|
||||
"episode": "R15",
|
||||
"document": "InspectionPlate",
|
||||
"steps": 4,
|
||||
"stepsTotal": 4,
|
||||
"failed": 0,
|
||||
"volume": 149853.969576,
|
||||
"expected": 149853.96957623312,
|
||||
"relativeError": 1.555659036712032e-12,
|
||||
"volumeMatches": true,
|
||||
"seconds": 176.771,
|
||||
"pageErrors": [],
|
||||
"results": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "plate profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch1",
|
||||
"volume": 0,
|
||||
"expectedVolume": null,
|
||||
"volumeMatches": null,
|
||||
"status": "ok",
|
||||
"ms": 33929
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "plate",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Pad",
|
||||
"uiName": null,
|
||||
"volume": 152907.597636,
|
||||
"expectedVolume": 152907.5976355224,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34437
|
||||
},
|
||||
{
|
||||
"step": 3,
|
||||
"label": "plate holes profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch2",
|
||||
"volume": 0,
|
||||
"expectedVolume": 152907.5976355224,
|
||||
"volumeMatches": false,
|
||||
"status": "ok",
|
||||
"ms": 37357
|
||||
},
|
||||
{
|
||||
"step": 4,
|
||||
"label": "plate holes",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Pocket",
|
||||
"uiName": null,
|
||||
"volume": 149853.969576,
|
||||
"expectedVolume": 149853.96957623312,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34454
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-run/v1",
|
||||
"generatedAt": "2026-11-19T13:04:26.320Z",
|
||||
"project": "secondary-reducer",
|
||||
"episode": "R16",
|
||||
"document": "Key_intermediate_Gear2_80T",
|
||||
"steps": 2,
|
||||
"stepsTotal": 2,
|
||||
"failed": 0,
|
||||
"volume": 4292.641517,
|
||||
"expected": 4292.641517292706,
|
||||
"relativeError": 6.818792500404117e-11,
|
||||
"volumeMatches": true,
|
||||
"seconds": 110.969,
|
||||
"pageErrors": [],
|
||||
"results": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "key profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch1",
|
||||
"volume": 0,
|
||||
"expectedVolume": null,
|
||||
"volumeMatches": null,
|
||||
"status": "ok",
|
||||
"ms": 37414
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "key pad",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Pad",
|
||||
"uiName": null,
|
||||
"volume": 4292.641517,
|
||||
"expectedVolume": 4292.641517292706,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34387
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-run/v1",
|
||||
"generatedAt": "2026-11-19T13:04:27.430Z",
|
||||
"project": "secondary-reducer",
|
||||
"episode": "R17",
|
||||
"document": "Key_output_Gear4_100T",
|
||||
"steps": 2,
|
||||
"stepsTotal": 2,
|
||||
"failed": 0,
|
||||
"volume": 8616.637061,
|
||||
"expected": 8616.637061435917,
|
||||
"relativeError": 5.059017450461284e-11,
|
||||
"volumeMatches": true,
|
||||
"seconds": 111.999,
|
||||
"pageErrors": [],
|
||||
"results": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "key profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch1",
|
||||
"volume": 0,
|
||||
"expectedVolume": null,
|
||||
"volumeMatches": null,
|
||||
"status": "ok",
|
||||
"ms": 37734
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "key pad",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Pad",
|
||||
"uiName": null,
|
||||
"volume": 8616.637061,
|
||||
"expectedVolume": 8616.637061435917,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34447
|
||||
}
|
||||
]
|
||||
}
|
||||
42
web/tools/cad-ui-rebuild/projects/out/ui-run/Seal_input.json
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-run/v1",
|
||||
"generatedAt": "2026-11-19T13:06:17.582Z",
|
||||
"project": "secondary-reducer",
|
||||
"episode": "R18",
|
||||
"document": "Seal_input",
|
||||
"steps": 2,
|
||||
"stepsTotal": 2,
|
||||
"failed": 0,
|
||||
"volume": 6590.366048,
|
||||
"expected": 6590.366048057392,
|
||||
"relativeError": 8.708445592774651e-12,
|
||||
"volumeMatches": true,
|
||||
"seconds": 109.164,
|
||||
"pageErrors": [],
|
||||
"results": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "seal profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch1",
|
||||
"volume": 0,
|
||||
"expectedVolume": null,
|
||||
"volumeMatches": null,
|
||||
"status": "ok",
|
||||
"ms": 38812
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "seal revolution",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Revolution",
|
||||
"uiName": null,
|
||||
"volume": 6590.366048,
|
||||
"expectedVolume": 6590.366048057392,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34451
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-run/v1",
|
||||
"generatedAt": "2026-11-19T13:08:08.874Z",
|
||||
"project": "secondary-reducer",
|
||||
"episode": "R19",
|
||||
"document": "Seal_intermediate",
|
||||
"steps": 2,
|
||||
"stepsTotal": 2,
|
||||
"failed": 0,
|
||||
"volume": 11832.318641,
|
||||
"expected": 11832.318641291999,
|
||||
"relativeError": 2.4678065206374903e-11,
|
||||
"volumeMatches": true,
|
||||
"seconds": 109.843,
|
||||
"pageErrors": [],
|
||||
"results": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "seal profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch1",
|
||||
"volume": 0,
|
||||
"expectedVolume": null,
|
||||
"volumeMatches": null,
|
||||
"status": "ok",
|
||||
"ms": 38909
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "seal revolution",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Revolution",
|
||||
"uiName": null,
|
||||
"volume": 11832.318641,
|
||||
"expectedVolume": 11832.318641291999,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34435
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-run/v1",
|
||||
"generatedAt": "2026-11-19T13:09:58.999Z",
|
||||
"project": "secondary-reducer",
|
||||
"episode": "R20",
|
||||
"document": "Seal_output",
|
||||
"steps": 2,
|
||||
"stepsTotal": 2,
|
||||
"failed": 0,
|
||||
"volume": 15635.162094,
|
||||
"expected": 15635.162094189784,
|
||||
"relativeError": 1.2138298168938272e-11,
|
||||
"volumeMatches": true,
|
||||
"seconds": 109.139,
|
||||
"pageErrors": [],
|
||||
"results": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "seal profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch1",
|
||||
"volume": 0,
|
||||
"expectedVolume": null,
|
||||
"volumeMatches": null,
|
||||
"status": "ok",
|
||||
"ms": 38864
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "seal revolution",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Revolution",
|
||||
"uiName": null,
|
||||
"volume": 15635.162094,
|
||||
"expectedVolume": 15635.162094189784,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34427
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-run/v1",
|
||||
"generatedAt": "2026-11-19T13:13:13.894Z",
|
||||
"project": "secondary-reducer",
|
||||
"episode": "R21",
|
||||
"document": "Shaft_input",
|
||||
"steps": 4,
|
||||
"stepsTotal": 4,
|
||||
"failed": 0,
|
||||
"volume": 381626.256711,
|
||||
"expected": 381626.25671142933,
|
||||
"relativeError": 1.125026644124189e-12,
|
||||
"volumeMatches": true,
|
||||
"seconds": 193.905,
|
||||
"pageErrors": [],
|
||||
"results": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "Gear1_20T involute",
|
||||
"kind": "gear",
|
||||
"command": "PartDesign_InvoluteGear",
|
||||
"uiName": null,
|
||||
"volume": 0,
|
||||
"expectedVolume": null,
|
||||
"volumeMatches": null,
|
||||
"status": "ok",
|
||||
"ms": 34575
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "Gear1_20T blank",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Pad",
|
||||
"uiName": null,
|
||||
"volume": 124615.703314,
|
||||
"expectedVolume": 124615.70331390205,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34375
|
||||
},
|
||||
{
|
||||
"step": 3,
|
||||
"label": "shaft profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch1",
|
||||
"volume": 0,
|
||||
"expectedVolume": 124615.70331390205,
|
||||
"volumeMatches": false,
|
||||
"status": "ok",
|
||||
"ms": 53994
|
||||
},
|
||||
{
|
||||
"step": 4,
|
||||
"label": "revolution",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Revolution",
|
||||
"uiName": null,
|
||||
"volume": 381626.256711,
|
||||
"expectedVolume": 381626.25671142933,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 35047
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-run/v1",
|
||||
"generatedAt": "2026-11-19T13:17:49.949Z",
|
||||
"project": "secondary-reducer",
|
||||
"episode": "R22",
|
||||
"document": "Shaft_intermediate",
|
||||
"steps": 6,
|
||||
"stepsTotal": 6,
|
||||
"failed": 0,
|
||||
"volume": 522631.338253,
|
||||
"expected": 522631.3382531433,
|
||||
"relativeError": 2.742033450346677e-13,
|
||||
"volumeMatches": true,
|
||||
"seconds": 274.918,
|
||||
"pageErrors": [],
|
||||
"results": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "Gear3_20T involute",
|
||||
"kind": "gear",
|
||||
"command": "PartDesign_InvoluteGear",
|
||||
"uiName": null,
|
||||
"volume": 0,
|
||||
"expectedVolume": null,
|
||||
"volumeMatches": null,
|
||||
"status": "ok",
|
||||
"ms": 34689
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "Gear3_20T blank",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Pad",
|
||||
"uiName": null,
|
||||
"volume": 180000.460342,
|
||||
"expectedVolume": 180000.4603423028,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34392
|
||||
},
|
||||
{
|
||||
"step": 3,
|
||||
"label": "shaft profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch1",
|
||||
"volume": 0,
|
||||
"expectedVolume": 180000.4603423028,
|
||||
"volumeMatches": false,
|
||||
"status": "ok",
|
||||
"ms": 59384
|
||||
},
|
||||
{
|
||||
"step": 4,
|
||||
"label": "revolution",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Revolution",
|
||||
"uiName": null,
|
||||
"volume": 525233.218638,
|
||||
"expectedVolume": 525233.2186379391,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 35054
|
||||
},
|
||||
{
|
||||
"step": 5,
|
||||
"label": "Gear2_80T keyseat profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch2",
|
||||
"volume": 0,
|
||||
"expectedVolume": 525233.2186379391,
|
||||
"volumeMatches": false,
|
||||
"status": "ok",
|
||||
"ms": 39316
|
||||
},
|
||||
{
|
||||
"step": 6,
|
||||
"label": "Gear2_80T keyseat",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Pocket",
|
||||
"uiName": null,
|
||||
"volume": 522631.338253,
|
||||
"expectedVolume": 522631.3382531433,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 35301
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-run/v1",
|
||||
"generatedAt": "2026-11-19T13:21:01.058Z",
|
||||
"project": "secondary-reducer",
|
||||
"episode": "R23",
|
||||
"document": "Shaft_output",
|
||||
"steps": 4,
|
||||
"stepsTotal": 4,
|
||||
"failed": 0,
|
||||
"volume": 823602.474324,
|
||||
"expected": 823602.4743236458,
|
||||
"relativeError": 4.2998342044607963e-13,
|
||||
"volumeMatches": true,
|
||||
"seconds": 190.088,
|
||||
"pageErrors": [],
|
||||
"results": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "shaft profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch1",
|
||||
"volume": 0,
|
||||
"expectedVolume": null,
|
||||
"volumeMatches": null,
|
||||
"status": "ok",
|
||||
"ms": 47839
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "revolution",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Revolution",
|
||||
"uiName": null,
|
||||
"volume": 828650.825654,
|
||||
"expectedVolume": 828650.8256539095,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34466
|
||||
},
|
||||
{
|
||||
"step": 3,
|
||||
"label": "Gear4_100T keyseat profile",
|
||||
"kind": "sketch",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"uiName": "Sketch2",
|
||||
"volume": 0,
|
||||
"expectedVolume": 828650.8256539095,
|
||||
"volumeMatches": false,
|
||||
"status": "ok",
|
||||
"ms": 36973
|
||||
},
|
||||
{
|
||||
"step": 4,
|
||||
"label": "Gear4_100T keyseat",
|
||||
"kind": "feature",
|
||||
"command": "PartDesign_Pocket",
|
||||
"uiName": null,
|
||||
"volume": 823602.474324,
|
||||
"expectedVolume": 823602.4743236458,
|
||||
"volumeMatches": true,
|
||||
"status": "ok",
|
||||
"ms": 34430
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-steps/v1",
|
||||
"generatedAt": "2026-11-19T11:39:07.773Z",
|
||||
"project": "secondary-reducer",
|
||||
"document": "Bearing6206_Balls",
|
||||
"episode": "R01",
|
||||
"title": "6206 钢球组",
|
||||
"steps": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "ball",
|
||||
"action": "setPrimitive",
|
||||
"object": "Ball",
|
||||
"kind": "primitive",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_AdditiveSphere",
|
||||
"primitiveType": "AdditiveSphere",
|
||||
"parameters": {
|
||||
"Radius": 4.75
|
||||
},
|
||||
"position": [
|
||||
0,
|
||||
23,
|
||||
0
|
||||
],
|
||||
"geometries": [],
|
||||
"constraints": []
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "ball pattern",
|
||||
"action": "setTransform",
|
||||
"object": "BallSet",
|
||||
"kind": "transform",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_PolarPattern",
|
||||
"transformType": "PolarPattern",
|
||||
"originals": [
|
||||
"Ball"
|
||||
],
|
||||
"occurrences": 9,
|
||||
"angle": 360,
|
||||
"rotationAxis": {
|
||||
"object": "X_Axis",
|
||||
"subelements": [
|
||||
""
|
||||
]
|
||||
},
|
||||
"geometries": [],
|
||||
"constraints": []
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-steps/v1",
|
||||
"generatedAt": "2026-11-19T11:39:14.472Z",
|
||||
"project": "secondary-reducer",
|
||||
"document": "Bearing6206_Inner",
|
||||
"episode": "R02",
|
||||
"title": "6206 内圈",
|
||||
"steps": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "profile",
|
||||
"action": "setSketch",
|
||||
"object": "InnerRingSketch",
|
||||
"kind": "sketch",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"profileType": "Geometry",
|
||||
"position": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"placementRotation": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"parameters": {},
|
||||
"geometries": [
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
8,
|
||||
15,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
-8,
|
||||
15,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
-8,
|
||||
15,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
-8,
|
||||
19.4375,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
-8,
|
||||
19.4375,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
-3.283689807,
|
||||
19.4375,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "arc",
|
||||
"center": [
|
||||
0,
|
||||
23,
|
||||
0
|
||||
],
|
||||
"radius": 4.845,
|
||||
"startAngle": 3.967693196,
|
||||
"endAngle": 5.457084765
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
3.283689807,
|
||||
19.4375,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
8,
|
||||
19.4375,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
8,
|
||||
19.4375,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
8,
|
||||
15,
|
||||
0
|
||||
]
|
||||
}
|
||||
],
|
||||
"constraints": [
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 0,
|
||||
"second": 1,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 1,
|
||||
"second": 2,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 2,
|
||||
"second": 3,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 3,
|
||||
"second": 4,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 4,
|
||||
"second": 5,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 5,
|
||||
"second": 0,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
}
|
||||
],
|
||||
"requireFullyConstrained": false
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "revolution",
|
||||
"action": "setFeature",
|
||||
"object": "InnerRing",
|
||||
"kind": "feature",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_Revolution",
|
||||
"featureType": "Revolution",
|
||||
"profile": "InnerRingSketch",
|
||||
"profileType": null,
|
||||
"position": null,
|
||||
"geometries": [],
|
||||
"constraints": [],
|
||||
"length": null,
|
||||
"midplane": false,
|
||||
"reversed": false,
|
||||
"angle": 360,
|
||||
"axis": "X_Axis"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-steps/v1",
|
||||
"generatedAt": "2026-11-19T11:39:27.356Z",
|
||||
"project": "secondary-reducer",
|
||||
"document": "Bearing6206_Outer",
|
||||
"episode": "R03",
|
||||
"title": "6206 外圈",
|
||||
"steps": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "profile",
|
||||
"action": "setSketch",
|
||||
"object": "OuterRingSketch",
|
||||
"kind": "sketch",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"profileType": "Geometry",
|
||||
"position": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"placementRotation": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"parameters": {},
|
||||
"geometries": [
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
-8,
|
||||
31,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
8,
|
||||
31,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
8,
|
||||
31,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
8,
|
||||
26.5625,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
8,
|
||||
26.5625,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
3.283689807,
|
||||
26.5625,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "arc",
|
||||
"center": [
|
||||
0,
|
||||
23,
|
||||
0
|
||||
],
|
||||
"radius": 4.845,
|
||||
"startAngle": 0.826100542,
|
||||
"endAngle": 2.315492112
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
-3.283689807,
|
||||
26.5625,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
-8,
|
||||
26.5625,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
-8,
|
||||
26.5625,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
-8,
|
||||
31,
|
||||
0
|
||||
]
|
||||
}
|
||||
],
|
||||
"constraints": [
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 0,
|
||||
"second": 1,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 1,
|
||||
"second": 2,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 2,
|
||||
"second": 3,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 3,
|
||||
"second": 4,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 4,
|
||||
"second": 5,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 5,
|
||||
"second": 0,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
}
|
||||
],
|
||||
"requireFullyConstrained": false
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "revolution",
|
||||
"action": "setFeature",
|
||||
"object": "OuterRing",
|
||||
"kind": "feature",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_Revolution",
|
||||
"featureType": "Revolution",
|
||||
"profile": "OuterRingSketch",
|
||||
"profileType": null,
|
||||
"position": null,
|
||||
"geometries": [],
|
||||
"constraints": [],
|
||||
"length": null,
|
||||
"midplane": false,
|
||||
"reversed": false,
|
||||
"angle": 360,
|
||||
"axis": "X_Axis"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-steps/v1",
|
||||
"generatedAt": "2026-11-19T11:39:33.615Z",
|
||||
"project": "secondary-reducer",
|
||||
"document": "Bearing6209_Balls",
|
||||
"episode": "R04",
|
||||
"title": "6209 钢球组",
|
||||
"steps": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "ball",
|
||||
"action": "setPrimitive",
|
||||
"object": "Ball",
|
||||
"kind": "primitive",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_AdditiveSphere",
|
||||
"primitiveType": "AdditiveSphere",
|
||||
"parameters": {
|
||||
"Radius": 6.35
|
||||
},
|
||||
"position": [
|
||||
0,
|
||||
32.5,
|
||||
0
|
||||
],
|
||||
"geometries": [],
|
||||
"constraints": []
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "ball pattern",
|
||||
"action": "setTransform",
|
||||
"object": "BallSet",
|
||||
"kind": "transform",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_PolarPattern",
|
||||
"transformType": "PolarPattern",
|
||||
"originals": [
|
||||
"Ball"
|
||||
],
|
||||
"occurrences": 10,
|
||||
"angle": 360,
|
||||
"rotationAxis": {
|
||||
"object": "X_Axis",
|
||||
"subelements": [
|
||||
""
|
||||
]
|
||||
},
|
||||
"geometries": [],
|
||||
"constraints": []
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-steps/v1",
|
||||
"generatedAt": "2026-11-19T11:39:35.148Z",
|
||||
"project": "secondary-reducer",
|
||||
"document": "Bearing6209_Inner",
|
||||
"episode": "R05",
|
||||
"title": "6209 内圈",
|
||||
"steps": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "profile",
|
||||
"action": "setSketch",
|
||||
"object": "InnerRingSketch",
|
||||
"kind": "sketch",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"profileType": "Geometry",
|
||||
"position": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"placementRotation": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"parameters": {},
|
||||
"geometries": [
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
9.5,
|
||||
22.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
-9.5,
|
||||
22.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
-9.5,
|
||||
22.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
-9.5,
|
||||
27.7375,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
-9.5,
|
||||
27.7375,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
-4.389774795,
|
||||
27.7375,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "arc",
|
||||
"center": [
|
||||
0,
|
||||
32.5,
|
||||
0
|
||||
],
|
||||
"radius": 6.477,
|
||||
"startAngle": 3.967693196,
|
||||
"endAngle": 5.457084765
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
4.389774795,
|
||||
27.7375,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
9.5,
|
||||
27.7375,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
9.5,
|
||||
27.7375,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
9.5,
|
||||
22.5,
|
||||
0
|
||||
]
|
||||
}
|
||||
],
|
||||
"constraints": [
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 0,
|
||||
"second": 1,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 1,
|
||||
"second": 2,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 2,
|
||||
"second": 3,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 3,
|
||||
"second": 4,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 4,
|
||||
"second": 5,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 5,
|
||||
"second": 0,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
}
|
||||
],
|
||||
"requireFullyConstrained": false
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "revolution",
|
||||
"action": "setFeature",
|
||||
"object": "InnerRing",
|
||||
"kind": "feature",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_Revolution",
|
||||
"featureType": "Revolution",
|
||||
"profile": "InnerRingSketch",
|
||||
"profileType": null,
|
||||
"position": null,
|
||||
"geometries": [],
|
||||
"constraints": [],
|
||||
"length": null,
|
||||
"midplane": false,
|
||||
"reversed": false,
|
||||
"angle": 360,
|
||||
"axis": "X_Axis"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-steps/v1",
|
||||
"generatedAt": "2026-11-19T11:39:36.548Z",
|
||||
"project": "secondary-reducer",
|
||||
"document": "Bearing6209_Outer",
|
||||
"episode": "R06",
|
||||
"title": "6209 外圈",
|
||||
"steps": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "profile",
|
||||
"action": "setSketch",
|
||||
"object": "OuterRingSketch",
|
||||
"kind": "sketch",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"profileType": "Geometry",
|
||||
"position": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"placementRotation": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"parameters": {},
|
||||
"geometries": [
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
-9.5,
|
||||
42.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
9.5,
|
||||
42.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
9.5,
|
||||
42.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
9.5,
|
||||
37.2625,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
9.5,
|
||||
37.2625,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
4.389774795,
|
||||
37.2625,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "arc",
|
||||
"center": [
|
||||
0,
|
||||
32.5,
|
||||
0
|
||||
],
|
||||
"radius": 6.477,
|
||||
"startAngle": 0.826100542,
|
||||
"endAngle": 2.315492112
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
-4.389774795,
|
||||
37.2625,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
-9.5,
|
||||
37.2625,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
-9.5,
|
||||
37.2625,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
-9.5,
|
||||
42.5,
|
||||
0
|
||||
]
|
||||
}
|
||||
],
|
||||
"constraints": [
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 0,
|
||||
"second": 1,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 1,
|
||||
"second": 2,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 2,
|
||||
"second": 3,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 3,
|
||||
"second": 4,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 4,
|
||||
"second": 5,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 5,
|
||||
"second": 0,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
}
|
||||
],
|
||||
"requireFullyConstrained": false
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "revolution",
|
||||
"action": "setFeature",
|
||||
"object": "OuterRing",
|
||||
"kind": "feature",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_Revolution",
|
||||
"featureType": "Revolution",
|
||||
"profile": "OuterRingSketch",
|
||||
"profileType": null,
|
||||
"position": null,
|
||||
"geometries": [],
|
||||
"constraints": [],
|
||||
"length": null,
|
||||
"midplane": false,
|
||||
"reversed": false,
|
||||
"angle": 360,
|
||||
"axis": "X_Axis"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-steps/v1",
|
||||
"generatedAt": "2026-11-19T11:39:38.099Z",
|
||||
"project": "secondary-reducer",
|
||||
"document": "Bearing6211_Balls",
|
||||
"episode": "R07",
|
||||
"title": "6211 钢球组",
|
||||
"steps": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "ball",
|
||||
"action": "setPrimitive",
|
||||
"object": "Ball",
|
||||
"kind": "primitive",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_AdditiveSphere",
|
||||
"primitiveType": "AdditiveSphere",
|
||||
"parameters": {
|
||||
"Radius": 7.95
|
||||
},
|
||||
"position": [
|
||||
0,
|
||||
38.75,
|
||||
0
|
||||
],
|
||||
"geometries": [],
|
||||
"constraints": []
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "ball pattern",
|
||||
"action": "setTransform",
|
||||
"object": "BallSet",
|
||||
"kind": "transform",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_PolarPattern",
|
||||
"transformType": "PolarPattern",
|
||||
"originals": [
|
||||
"Ball"
|
||||
],
|
||||
"occurrences": 10,
|
||||
"angle": 360,
|
||||
"rotationAxis": {
|
||||
"object": "X_Axis",
|
||||
"subelements": [
|
||||
""
|
||||
]
|
||||
},
|
||||
"geometries": [],
|
||||
"constraints": []
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-steps/v1",
|
||||
"generatedAt": "2026-11-19T11:39:39.400Z",
|
||||
"project": "secondary-reducer",
|
||||
"document": "Bearing6211_Inner",
|
||||
"episode": "R08",
|
||||
"title": "6211 内圈",
|
||||
"steps": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "profile",
|
||||
"action": "setSketch",
|
||||
"object": "InnerRingSketch",
|
||||
"kind": "sketch",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"profileType": "Geometry",
|
||||
"position": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"placementRotation": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"parameters": {},
|
||||
"geometries": [
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
10.5,
|
||||
27.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
-10.5,
|
||||
27.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
-10.5,
|
||||
27.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
-10.5,
|
||||
32.7875,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
-10.5,
|
||||
32.7875,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
-5.495859783,
|
||||
32.7875,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "arc",
|
||||
"center": [
|
||||
0,
|
||||
38.75,
|
||||
0
|
||||
],
|
||||
"radius": 8.109,
|
||||
"startAngle": 3.967693196,
|
||||
"endAngle": 5.457084765
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
5.495859783,
|
||||
32.7875,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
10.5,
|
||||
32.7875,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
10.5,
|
||||
32.7875,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
10.5,
|
||||
27.5,
|
||||
0
|
||||
]
|
||||
}
|
||||
],
|
||||
"constraints": [
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 0,
|
||||
"second": 1,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 1,
|
||||
"second": 2,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 2,
|
||||
"second": 3,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 3,
|
||||
"second": 4,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 4,
|
||||
"second": 5,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 5,
|
||||
"second": 0,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
}
|
||||
],
|
||||
"requireFullyConstrained": false
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "revolution",
|
||||
"action": "setFeature",
|
||||
"object": "InnerRing",
|
||||
"kind": "feature",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_Revolution",
|
||||
"featureType": "Revolution",
|
||||
"profile": "InnerRingSketch",
|
||||
"profileType": null,
|
||||
"position": null,
|
||||
"geometries": [],
|
||||
"constraints": [],
|
||||
"length": null,
|
||||
"midplane": false,
|
||||
"reversed": false,
|
||||
"angle": 360,
|
||||
"axis": "X_Axis"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-steps/v1",
|
||||
"generatedAt": "2026-11-19T11:39:40.699Z",
|
||||
"project": "secondary-reducer",
|
||||
"document": "Bearing6211_Outer",
|
||||
"episode": "R09",
|
||||
"title": "6211 外圈",
|
||||
"steps": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "profile",
|
||||
"action": "setSketch",
|
||||
"object": "OuterRingSketch",
|
||||
"kind": "sketch",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"profileType": "Geometry",
|
||||
"position": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"placementRotation": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"parameters": {},
|
||||
"geometries": [
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
-10.5,
|
||||
50,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
10.5,
|
||||
50,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
10.5,
|
||||
50,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
10.5,
|
||||
44.7125,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
10.5,
|
||||
44.7125,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
5.495859783,
|
||||
44.7125,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "arc",
|
||||
"center": [
|
||||
0,
|
||||
38.75,
|
||||
0
|
||||
],
|
||||
"radius": 8.109,
|
||||
"startAngle": 0.826100542,
|
||||
"endAngle": 2.315492112
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
-5.495859783,
|
||||
44.7125,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
-10.5,
|
||||
44.7125,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
-10.5,
|
||||
44.7125,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
-10.5,
|
||||
50,
|
||||
0
|
||||
]
|
||||
}
|
||||
],
|
||||
"constraints": [
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 0,
|
||||
"second": 1,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 1,
|
||||
"second": 2,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 2,
|
||||
"second": 3,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 3,
|
||||
"second": 4,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 4,
|
||||
"second": 5,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 5,
|
||||
"second": 0,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
}
|
||||
],
|
||||
"requireFullyConstrained": false
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "revolution",
|
||||
"action": "setFeature",
|
||||
"object": "OuterRing",
|
||||
"kind": "feature",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_Revolution",
|
||||
"featureType": "Revolution",
|
||||
"profile": "OuterRingSketch",
|
||||
"profileType": null,
|
||||
"position": null,
|
||||
"geometries": [],
|
||||
"constraints": [],
|
||||
"length": null,
|
||||
"midplane": false,
|
||||
"reversed": false,
|
||||
"angle": 360,
|
||||
"axis": "X_Axis"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,251 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-steps/v1",
|
||||
"generatedAt": "2026-11-19T11:39:42.298Z",
|
||||
"project": "secondary-reducer",
|
||||
"document": "Coupling_input",
|
||||
"episode": "R10",
|
||||
"title": "输入联轴器",
|
||||
"steps": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "hub profile",
|
||||
"action": "setSketch",
|
||||
"object": "HubProfile",
|
||||
"kind": "sketch",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"profileType": "Circle",
|
||||
"position": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"placementRotation": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"parameters": {
|
||||
"Radius": 23.8
|
||||
},
|
||||
"geometries": [],
|
||||
"constraints": [],
|
||||
"requireFullyConstrained": false
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "hub",
|
||||
"action": "setFeature",
|
||||
"object": "HubPad",
|
||||
"kind": "feature",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_Pad",
|
||||
"featureType": "Pad",
|
||||
"profile": "HubProfile",
|
||||
"profileType": null,
|
||||
"position": null,
|
||||
"geometries": [],
|
||||
"constraints": [],
|
||||
"length": 42,
|
||||
"midplane": false,
|
||||
"reversed": false,
|
||||
"angle": null,
|
||||
"axis": null
|
||||
},
|
||||
{
|
||||
"step": 3,
|
||||
"label": "flange profile",
|
||||
"action": "setSketch",
|
||||
"object": "FlangeProfile",
|
||||
"kind": "sketch",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"profileType": "Circle",
|
||||
"position": [
|
||||
0,
|
||||
0,
|
||||
33
|
||||
],
|
||||
"placementRotation": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"parameters": {
|
||||
"Radius": 36.4
|
||||
},
|
||||
"geometries": [],
|
||||
"constraints": [],
|
||||
"requireFullyConstrained": false
|
||||
},
|
||||
{
|
||||
"step": 4,
|
||||
"label": "flange",
|
||||
"action": "setFeature",
|
||||
"object": "FlangePad",
|
||||
"kind": "feature",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_Pad",
|
||||
"featureType": "Pad",
|
||||
"profile": "FlangeProfile",
|
||||
"profileType": null,
|
||||
"position": null,
|
||||
"geometries": [],
|
||||
"constraints": [],
|
||||
"length": 9,
|
||||
"midplane": false,
|
||||
"reversed": false,
|
||||
"angle": null,
|
||||
"axis": null
|
||||
},
|
||||
{
|
||||
"step": 5,
|
||||
"label": "bore profile",
|
||||
"action": "setSketch",
|
||||
"object": "BoreProfile",
|
||||
"kind": "sketch",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"profileType": "Circle",
|
||||
"position": [
|
||||
0,
|
||||
0,
|
||||
21
|
||||
],
|
||||
"placementRotation": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"parameters": {
|
||||
"Radius": 14
|
||||
},
|
||||
"geometries": [],
|
||||
"constraints": [],
|
||||
"requireFullyConstrained": false
|
||||
},
|
||||
{
|
||||
"step": 6,
|
||||
"label": "bore",
|
||||
"action": "setFeature",
|
||||
"object": "BorePocket",
|
||||
"kind": "feature",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_Pocket",
|
||||
"featureType": "Pocket",
|
||||
"profile": "BoreProfile",
|
||||
"profileType": null,
|
||||
"position": null,
|
||||
"geometries": [],
|
||||
"constraints": [],
|
||||
"length": 52,
|
||||
"midplane": true,
|
||||
"reversed": false,
|
||||
"angle": null,
|
||||
"axis": null
|
||||
},
|
||||
{
|
||||
"step": 7,
|
||||
"label": "bolt profile",
|
||||
"action": "setSketch",
|
||||
"object": "BoltProfile",
|
||||
"kind": "sketch",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"profileType": "Geometry",
|
||||
"position": [
|
||||
0,
|
||||
0,
|
||||
37.5
|
||||
],
|
||||
"placementRotation": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"parameters": {},
|
||||
"geometries": [
|
||||
{
|
||||
"type": "circle",
|
||||
"center": [
|
||||
30.1,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"radius": 3.5
|
||||
},
|
||||
{
|
||||
"type": "circle",
|
||||
"center": [
|
||||
15.05,
|
||||
26.067364654,
|
||||
0
|
||||
],
|
||||
"radius": 3.5
|
||||
},
|
||||
{
|
||||
"type": "circle",
|
||||
"center": [
|
||||
-15.05,
|
||||
26.067364654,
|
||||
0
|
||||
],
|
||||
"radius": 3.5
|
||||
},
|
||||
{
|
||||
"type": "circle",
|
||||
"center": [
|
||||
-30.1,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"radius": 3.5
|
||||
},
|
||||
{
|
||||
"type": "circle",
|
||||
"center": [
|
||||
-15.05,
|
||||
-26.067364654,
|
||||
0
|
||||
],
|
||||
"radius": 3.5
|
||||
},
|
||||
{
|
||||
"type": "circle",
|
||||
"center": [
|
||||
15.05,
|
||||
-26.067364654,
|
||||
0
|
||||
],
|
||||
"radius": 3.5
|
||||
}
|
||||
],
|
||||
"constraints": [],
|
||||
"requireFullyConstrained": false
|
||||
},
|
||||
{
|
||||
"step": 8,
|
||||
"label": "bolt pocket",
|
||||
"action": "setFeature",
|
||||
"object": "BoltPocket",
|
||||
"kind": "feature",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_Pocket",
|
||||
"featureType": "Pocket",
|
||||
"profile": "BoltProfile",
|
||||
"profileType": null,
|
||||
"position": null,
|
||||
"geometries": [],
|
||||
"constraints": [],
|
||||
"length": 52,
|
||||
"midplane": true,
|
||||
"reversed": false,
|
||||
"angle": null,
|
||||
"axis": null
|
||||
}
|
||||
]
|
||||
}
|
||||
243
web/tools/cad-ui-rebuild/projects/out/ui-steps/Gear2_80T.json
Normal file
@@ -0,0 +1,243 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-steps/v1",
|
||||
"generatedAt": "2026-11-19T11:39:52.336Z",
|
||||
"project": "secondary-reducer",
|
||||
"document": "Gear2_80T",
|
||||
"episode": "R11",
|
||||
"title": "一级大齿轮 80 齿",
|
||||
"steps": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "gear profile",
|
||||
"action": "setGear",
|
||||
"object": "InvoluteProfile",
|
||||
"kind": "gear",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_InvoluteGear",
|
||||
"gearType": "InvoluteGear",
|
||||
"gearParameters": {
|
||||
"NumberOfTeeth": 80,
|
||||
"Modules": 3,
|
||||
"PressureAngle": 20,
|
||||
"AddendumCoefficient": 1,
|
||||
"DedendumCoefficient": 1.25,
|
||||
"RootFilletCoefficient": 0.38,
|
||||
"ProfileShiftCoefficient": 0,
|
||||
"HighPrecision": false,
|
||||
"ExternalGear": true
|
||||
},
|
||||
"position": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"placementRotation": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"geometries": [],
|
||||
"constraints": []
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "pad",
|
||||
"action": "setFeature",
|
||||
"object": "GearPad",
|
||||
"kind": "feature",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_Pad",
|
||||
"featureType": "Pad",
|
||||
"profile": "InvoluteProfile",
|
||||
"profileType": null,
|
||||
"position": null,
|
||||
"geometries": [],
|
||||
"constraints": [],
|
||||
"length": 40,
|
||||
"midplane": false,
|
||||
"reversed": false,
|
||||
"angle": null,
|
||||
"axis": null
|
||||
},
|
||||
{
|
||||
"step": 3,
|
||||
"label": "cut profile",
|
||||
"action": "setSketch",
|
||||
"object": "CutProfile",
|
||||
"kind": "sketch",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"profileType": "Geometry",
|
||||
"position": [
|
||||
0,
|
||||
0,
|
||||
20
|
||||
],
|
||||
"placementRotation": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"parameters": {},
|
||||
"geometries": [
|
||||
{
|
||||
"type": "arc",
|
||||
"center": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"radius": 24.5,
|
||||
"startAngle": 0.32902161,
|
||||
"endAngle": 6.032703514
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
23.735431237,
|
||||
-6.072833277,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
28.752846243,
|
||||
-5.875698505,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
28.752846243,
|
||||
-5.875698505,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
28.203208823,
|
||||
8.113508003,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
28.203208823,
|
||||
8.113508003,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
23.185793816,
|
||||
7.91637323,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "circle",
|
||||
"center": [
|
||||
72.48,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"radius": 21.6
|
||||
},
|
||||
{
|
||||
"type": "circle",
|
||||
"center": [
|
||||
36.24,
|
||||
62.769521266,
|
||||
0
|
||||
],
|
||||
"radius": 21.6
|
||||
},
|
||||
{
|
||||
"type": "circle",
|
||||
"center": [
|
||||
-36.24,
|
||||
62.769521266,
|
||||
0
|
||||
],
|
||||
"radius": 21.6
|
||||
},
|
||||
{
|
||||
"type": "circle",
|
||||
"center": [
|
||||
-72.48,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"radius": 21.6
|
||||
},
|
||||
{
|
||||
"type": "circle",
|
||||
"center": [
|
||||
-36.24,
|
||||
-62.769521266,
|
||||
0
|
||||
],
|
||||
"radius": 21.6
|
||||
},
|
||||
{
|
||||
"type": "circle",
|
||||
"center": [
|
||||
36.24,
|
||||
-62.769521266,
|
||||
0
|
||||
],
|
||||
"radius": 21.6
|
||||
}
|
||||
],
|
||||
"constraints": [
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 0,
|
||||
"second": 1,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 1,
|
||||
"second": 2,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 2,
|
||||
"second": 3,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 3,
|
||||
"second": 0,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
}
|
||||
],
|
||||
"requireFullyConstrained": false
|
||||
},
|
||||
{
|
||||
"step": 4,
|
||||
"label": "cut",
|
||||
"action": "setFeature",
|
||||
"object": "MaterialCut",
|
||||
"kind": "feature",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_Pocket",
|
||||
"featureType": "Pocket",
|
||||
"profile": "CutProfile",
|
||||
"profileType": null,
|
||||
"position": null,
|
||||
"geometries": [],
|
||||
"constraints": [],
|
||||
"length": 60,
|
||||
"midplane": true,
|
||||
"reversed": false,
|
||||
"angle": null,
|
||||
"axis": null
|
||||
}
|
||||
]
|
||||
}
|
||||
243
web/tools/cad-ui-rebuild/projects/out/ui-steps/Gear4_100T.json
Normal file
@@ -0,0 +1,243 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-steps/v1",
|
||||
"generatedAt": "2026-11-19T11:40:04.407Z",
|
||||
"project": "secondary-reducer",
|
||||
"document": "Gear4_100T",
|
||||
"episode": "R12",
|
||||
"title": "二级大齿轮 100 齿",
|
||||
"steps": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "gear profile",
|
||||
"action": "setGear",
|
||||
"object": "InvoluteProfile",
|
||||
"kind": "gear",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_InvoluteGear",
|
||||
"gearType": "InvoluteGear",
|
||||
"gearParameters": {
|
||||
"NumberOfTeeth": 100,
|
||||
"Modules": 3,
|
||||
"PressureAngle": 20,
|
||||
"AddendumCoefficient": 1,
|
||||
"DedendumCoefficient": 1.25,
|
||||
"RootFilletCoefficient": 0.38,
|
||||
"ProfileShiftCoefficient": 0,
|
||||
"HighPrecision": false,
|
||||
"ExternalGear": true
|
||||
},
|
||||
"position": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"placementRotation": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"geometries": [],
|
||||
"constraints": []
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "pad",
|
||||
"action": "setFeature",
|
||||
"object": "GearPad",
|
||||
"kind": "feature",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_Pad",
|
||||
"featureType": "Pad",
|
||||
"profile": "InvoluteProfile",
|
||||
"profileType": null,
|
||||
"position": null,
|
||||
"geometries": [],
|
||||
"constraints": [],
|
||||
"length": 60,
|
||||
"midplane": false,
|
||||
"reversed": false,
|
||||
"angle": null,
|
||||
"axis": null
|
||||
},
|
||||
{
|
||||
"step": 3,
|
||||
"label": "cut profile",
|
||||
"action": "setSketch",
|
||||
"object": "CutProfile",
|
||||
"kind": "sketch",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"profileType": "Geometry",
|
||||
"position": [
|
||||
0,
|
||||
0,
|
||||
30
|
||||
],
|
||||
"placementRotation": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"parameters": {},
|
||||
"geometries": [
|
||||
{
|
||||
"type": "arc",
|
||||
"center": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"radius": 29.5,
|
||||
"startAngle": 0.306041376,
|
||||
"endAngle": 6.039975785
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
28.631816809,
|
||||
-7.104158374,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
33.734755845,
|
||||
-6.943792054,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
33.734755845,
|
||||
-6.943792054,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
33.2321837,
|
||||
9.048312912,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
33.2321837,
|
||||
9.048312912,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
28.129244664,
|
||||
8.887946592,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "circle",
|
||||
"center": [
|
||||
90.6,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"radius": 27
|
||||
},
|
||||
{
|
||||
"type": "circle",
|
||||
"center": [
|
||||
45.3,
|
||||
78.461901583,
|
||||
0
|
||||
],
|
||||
"radius": 27
|
||||
},
|
||||
{
|
||||
"type": "circle",
|
||||
"center": [
|
||||
-45.3,
|
||||
78.461901583,
|
||||
0
|
||||
],
|
||||
"radius": 27
|
||||
},
|
||||
{
|
||||
"type": "circle",
|
||||
"center": [
|
||||
-90.6,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"radius": 27
|
||||
},
|
||||
{
|
||||
"type": "circle",
|
||||
"center": [
|
||||
-45.3,
|
||||
-78.461901583,
|
||||
0
|
||||
],
|
||||
"radius": 27
|
||||
},
|
||||
{
|
||||
"type": "circle",
|
||||
"center": [
|
||||
45.3,
|
||||
-78.461901583,
|
||||
0
|
||||
],
|
||||
"radius": 27
|
||||
}
|
||||
],
|
||||
"constraints": [
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 0,
|
||||
"second": 1,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 1,
|
||||
"second": 2,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 2,
|
||||
"second": 3,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 3,
|
||||
"second": 0,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
}
|
||||
],
|
||||
"requireFullyConstrained": false
|
||||
},
|
||||
{
|
||||
"step": 4,
|
||||
"label": "cut",
|
||||
"action": "setFeature",
|
||||
"object": "MaterialCut",
|
||||
"kind": "feature",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_Pocket",
|
||||
"featureType": "Pocket",
|
||||
"profile": "CutProfile",
|
||||
"profileType": null,
|
||||
"position": null,
|
||||
"geometries": [],
|
||||
"constraints": [],
|
||||
"length": 80,
|
||||
"midplane": true,
|
||||
"reversed": false,
|
||||
"angle": null,
|
||||
"axis": null
|
||||
}
|
||||
]
|
||||
}
|
||||
1279
web/tools/cad-ui-rebuild/projects/out/ui-steps/HousingBase.json
Normal file
1397
web/tools/cad-ui-rebuild/projects/out/ui-steps/HousingCover.json
Normal file
@@ -0,0 +1,157 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-steps/v1",
|
||||
"generatedAt": "2026-11-19T11:40:17.213Z",
|
||||
"project": "secondary-reducer",
|
||||
"document": "InspectionPlate",
|
||||
"episode": "R15",
|
||||
"title": "检查盖板",
|
||||
"steps": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "plate profile",
|
||||
"action": "setSketch",
|
||||
"object": "PlateProfile",
|
||||
"kind": "sketch",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"profileType": "Circle",
|
||||
"position": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"placementRotation": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"parameters": {
|
||||
"Radius": 78
|
||||
},
|
||||
"geometries": [],
|
||||
"constraints": [],
|
||||
"requireFullyConstrained": false
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "plate",
|
||||
"action": "setFeature",
|
||||
"object": "PlatePad",
|
||||
"kind": "feature",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_Pad",
|
||||
"featureType": "Pad",
|
||||
"profile": "PlateProfile",
|
||||
"profileType": null,
|
||||
"position": null,
|
||||
"geometries": [],
|
||||
"constraints": [],
|
||||
"length": 8,
|
||||
"midplane": false,
|
||||
"reversed": false,
|
||||
"angle": null,
|
||||
"axis": null
|
||||
},
|
||||
{
|
||||
"step": 3,
|
||||
"label": "plate holes profile",
|
||||
"action": "setSketch",
|
||||
"object": "PlateHoleProfile",
|
||||
"kind": "sketch",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"profileType": "Geometry",
|
||||
"position": [
|
||||
0,
|
||||
0,
|
||||
4
|
||||
],
|
||||
"placementRotation": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"parameters": {},
|
||||
"geometries": [
|
||||
{
|
||||
"type": "circle",
|
||||
"center": [
|
||||
70,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"radius": 4.5
|
||||
},
|
||||
{
|
||||
"type": "circle",
|
||||
"center": [
|
||||
35,
|
||||
60.621778265,
|
||||
0
|
||||
],
|
||||
"radius": 4.5
|
||||
},
|
||||
{
|
||||
"type": "circle",
|
||||
"center": [
|
||||
-35,
|
||||
60.621778265,
|
||||
0
|
||||
],
|
||||
"radius": 4.5
|
||||
},
|
||||
{
|
||||
"type": "circle",
|
||||
"center": [
|
||||
-70,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"radius": 4.5
|
||||
},
|
||||
{
|
||||
"type": "circle",
|
||||
"center": [
|
||||
-35,
|
||||
-60.621778265,
|
||||
0
|
||||
],
|
||||
"radius": 4.5
|
||||
},
|
||||
{
|
||||
"type": "circle",
|
||||
"center": [
|
||||
35,
|
||||
-60.621778265,
|
||||
0
|
||||
],
|
||||
"radius": 4.5
|
||||
}
|
||||
],
|
||||
"constraints": [],
|
||||
"requireFullyConstrained": false
|
||||
},
|
||||
{
|
||||
"step": 4,
|
||||
"label": "plate holes",
|
||||
"action": "setFeature",
|
||||
"object": "PlateHoleCut",
|
||||
"kind": "feature",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_Pocket",
|
||||
"featureType": "Pocket",
|
||||
"profile": "PlateHoleProfile",
|
||||
"profileType": null,
|
||||
"position": null,
|
||||
"geometries": [],
|
||||
"constraints": [],
|
||||
"length": 12,
|
||||
"midplane": true,
|
||||
"reversed": false,
|
||||
"angle": null,
|
||||
"axis": null
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-steps/v1",
|
||||
"generatedAt": "2026-11-19T11:40:18.589Z",
|
||||
"project": "secondary-reducer",
|
||||
"document": "Key_intermediate_Gear2_80T",
|
||||
"episode": "R16",
|
||||
"title": "中间轴键",
|
||||
"steps": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "key profile",
|
||||
"action": "setSketch",
|
||||
"object": "KeyProfile",
|
||||
"kind": "sketch",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"profileType": "Geometry",
|
||||
"position": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"placementRotation": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"parameters": {},
|
||||
"geometries": [
|
||||
{
|
||||
"type": "arc",
|
||||
"center": [
|
||||
4.5,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"radius": 4.5,
|
||||
"startAngle": 1.570796327,
|
||||
"endAngle": 4.71238898
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
4.5,
|
||||
-4.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
31.5,
|
||||
-4.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "arc",
|
||||
"center": [
|
||||
31.5,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"radius": 4.5,
|
||||
"startAngle": 4.71238898,
|
||||
"endAngle": 7.853981634
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
31.5,
|
||||
4.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
4.5,
|
||||
4.5,
|
||||
0
|
||||
]
|
||||
}
|
||||
],
|
||||
"constraints": [
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 0,
|
||||
"second": 1,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 1,
|
||||
"second": 2,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 2,
|
||||
"second": 3,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 3,
|
||||
"second": 0,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
}
|
||||
],
|
||||
"requireFullyConstrained": false
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "key pad",
|
||||
"action": "setFeature",
|
||||
"object": "KeyBody",
|
||||
"kind": "feature",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_Pad",
|
||||
"featureType": "Pad",
|
||||
"profile": "KeyProfile",
|
||||
"profileType": null,
|
||||
"position": null,
|
||||
"geometries": [],
|
||||
"constraints": [],
|
||||
"length": 14,
|
||||
"midplane": false,
|
||||
"reversed": false,
|
||||
"angle": null,
|
||||
"axis": null
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-steps/v1",
|
||||
"generatedAt": "2026-11-19T11:40:20.345Z",
|
||||
"project": "secondary-reducer",
|
||||
"document": "Key_output_Gear4_100T",
|
||||
"episode": "R17",
|
||||
"title": "输出轴键",
|
||||
"steps": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "key profile",
|
||||
"action": "setSketch",
|
||||
"object": "KeyProfile",
|
||||
"kind": "sketch",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"profileType": "Geometry",
|
||||
"position": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"placementRotation": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"parameters": {},
|
||||
"geometries": [
|
||||
{
|
||||
"type": "arc",
|
||||
"center": [
|
||||
5,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"radius": 5,
|
||||
"startAngle": 1.570796327,
|
||||
"endAngle": 4.71238898
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
5,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
51,
|
||||
-5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "arc",
|
||||
"center": [
|
||||
51,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"radius": 5,
|
||||
"startAngle": 4.71238898,
|
||||
"endAngle": 7.853981634
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
51,
|
||||
5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
5,
|
||||
5,
|
||||
0
|
||||
]
|
||||
}
|
||||
],
|
||||
"constraints": [
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 0,
|
||||
"second": 1,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 1,
|
||||
"second": 2,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 2,
|
||||
"second": 3,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 3,
|
||||
"second": 0,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
}
|
||||
],
|
||||
"requireFullyConstrained": false
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "key pad",
|
||||
"action": "setFeature",
|
||||
"object": "KeyBody",
|
||||
"kind": "feature",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_Pad",
|
||||
"featureType": "Pad",
|
||||
"profile": "KeyProfile",
|
||||
"profileType": null,
|
||||
"position": null,
|
||||
"geometries": [],
|
||||
"constraints": [],
|
||||
"length": 16,
|
||||
"midplane": false,
|
||||
"reversed": false,
|
||||
"angle": null,
|
||||
"axis": null
|
||||
}
|
||||
]
|
||||
}
|
||||
177
web/tools/cad-ui-rebuild/projects/out/ui-steps/Seal_input.json
Normal file
@@ -0,0 +1,177 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-steps/v1",
|
||||
"generatedAt": "2026-11-19T11:41:16.465Z",
|
||||
"project": "secondary-reducer",
|
||||
"document": "Seal_input",
|
||||
"episode": "R18",
|
||||
"title": "输入轴油封",
|
||||
"steps": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "seal profile",
|
||||
"action": "setSketch",
|
||||
"object": "SealProfile",
|
||||
"kind": "sketch",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"profileType": "Geometry",
|
||||
"position": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"placementRotation": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"parameters": {},
|
||||
"geometries": [
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
-3.5,
|
||||
23,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
3.5,
|
||||
23,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
3.5,
|
||||
23,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
3.5,
|
||||
17.8,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
3.5,
|
||||
17.8,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
0.7,
|
||||
15.6,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
0.7,
|
||||
15.6,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
0.7,
|
||||
14,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
0.7,
|
||||
14,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
-3.5,
|
||||
14,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
-3.5,
|
||||
14,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
-3.5,
|
||||
23,
|
||||
0
|
||||
]
|
||||
}
|
||||
],
|
||||
"constraints": [
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 0,
|
||||
"second": 1,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 1,
|
||||
"second": 2,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 2,
|
||||
"second": 3,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 3,
|
||||
"second": 4,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 4,
|
||||
"second": 5,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 5,
|
||||
"second": 0,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
}
|
||||
],
|
||||
"requireFullyConstrained": false
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "seal revolution",
|
||||
"action": "setFeature",
|
||||
"object": "SealBody",
|
||||
"kind": "feature",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_Revolution",
|
||||
"featureType": "Revolution",
|
||||
"profile": "SealProfile",
|
||||
"profileType": null,
|
||||
"position": null,
|
||||
"geometries": [],
|
||||
"constraints": [],
|
||||
"length": null,
|
||||
"midplane": false,
|
||||
"reversed": false,
|
||||
"angle": 360,
|
||||
"axis": "X_Axis"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-steps/v1",
|
||||
"generatedAt": "2026-11-19T11:41:18.286Z",
|
||||
"project": "secondary-reducer",
|
||||
"document": "Seal_intermediate",
|
||||
"episode": "R19",
|
||||
"title": "中间轴油封",
|
||||
"steps": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "seal profile",
|
||||
"action": "setSketch",
|
||||
"object": "SealProfile",
|
||||
"kind": "sketch",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"profileType": "Geometry",
|
||||
"position": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"placementRotation": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"parameters": {},
|
||||
"geometries": [
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
-4.5,
|
||||
30.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
4.5,
|
||||
30.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
4.5,
|
||||
30.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
4.5,
|
||||
25.3,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
4.5,
|
||||
25.3,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
0.9,
|
||||
23.1,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
0.9,
|
||||
23.1,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
0.9,
|
||||
21.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
0.9,
|
||||
21.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
-4.5,
|
||||
21.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
-4.5,
|
||||
21.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
-4.5,
|
||||
30.5,
|
||||
0
|
||||
]
|
||||
}
|
||||
],
|
||||
"constraints": [
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 0,
|
||||
"second": 1,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 1,
|
||||
"second": 2,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 2,
|
||||
"second": 3,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 3,
|
||||
"second": 4,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 4,
|
||||
"second": 5,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 5,
|
||||
"second": 0,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
}
|
||||
],
|
||||
"requireFullyConstrained": false
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "seal revolution",
|
||||
"action": "setFeature",
|
||||
"object": "SealBody",
|
||||
"kind": "feature",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_Revolution",
|
||||
"featureType": "Revolution",
|
||||
"profile": "SealProfile",
|
||||
"profileType": null,
|
||||
"position": null,
|
||||
"geometries": [],
|
||||
"constraints": [],
|
||||
"length": null,
|
||||
"midplane": false,
|
||||
"reversed": false,
|
||||
"angle": 360,
|
||||
"axis": "X_Axis"
|
||||
}
|
||||
]
|
||||
}
|
||||
177
web/tools/cad-ui-rebuild/projects/out/ui-steps/Seal_output.json
Normal file
@@ -0,0 +1,177 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-steps/v1",
|
||||
"generatedAt": "2026-11-19T11:41:19.435Z",
|
||||
"project": "secondary-reducer",
|
||||
"document": "Seal_output",
|
||||
"episode": "R20",
|
||||
"title": "输出轴油封",
|
||||
"steps": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "seal profile",
|
||||
"action": "setSketch",
|
||||
"object": "SealProfile",
|
||||
"kind": "sketch",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"profileType": "Geometry",
|
||||
"position": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"placementRotation": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"parameters": {},
|
||||
"geometries": [
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
-5,
|
||||
35.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
5,
|
||||
35.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
5,
|
||||
35.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
5,
|
||||
30.3,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
5,
|
||||
30.3,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
1,
|
||||
28.1,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
1,
|
||||
28.1,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
1,
|
||||
26.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
1,
|
||||
26.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
-5,
|
||||
26.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
-5,
|
||||
26.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
-5,
|
||||
35.5,
|
||||
0
|
||||
]
|
||||
}
|
||||
],
|
||||
"constraints": [
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 0,
|
||||
"second": 1,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 1,
|
||||
"second": 2,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 2,
|
||||
"second": 3,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 3,
|
||||
"second": 4,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 4,
|
||||
"second": 5,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 5,
|
||||
"second": 0,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
}
|
||||
],
|
||||
"requireFullyConstrained": false
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "seal revolution",
|
||||
"action": "setFeature",
|
||||
"object": "SealBody",
|
||||
"kind": "feature",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_Revolution",
|
||||
"featureType": "Revolution",
|
||||
"profile": "SealProfile",
|
||||
"profileType": null,
|
||||
"position": null,
|
||||
"geometries": [],
|
||||
"constraints": [],
|
||||
"length": null,
|
||||
"midplane": false,
|
||||
"reversed": false,
|
||||
"angle": 360,
|
||||
"axis": "X_Axis"
|
||||
}
|
||||
]
|
||||
}
|
||||
431
web/tools/cad-ui-rebuild/projects/out/ui-steps/Shaft_input.json
Normal file
@@ -0,0 +1,431 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-steps/v1",
|
||||
"generatedAt": "2026-11-19T11:41:24.195Z",
|
||||
"project": "secondary-reducer",
|
||||
"document": "Shaft_input",
|
||||
"episode": "R21",
|
||||
"title": "输入轴",
|
||||
"steps": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "Gear1_20T involute",
|
||||
"action": "setGear",
|
||||
"object": "PinionProfile1",
|
||||
"kind": "gear",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_InvoluteGear",
|
||||
"gearType": "InvoluteGear",
|
||||
"gearParameters": {
|
||||
"NumberOfTeeth": 20,
|
||||
"Modules": 3,
|
||||
"PressureAngle": 20,
|
||||
"AddendumCoefficient": 1,
|
||||
"DedendumCoefficient": 1.25,
|
||||
"RootFilletCoefficient": 0.38,
|
||||
"ProfileShiftCoefficient": 0,
|
||||
"HighPrecision": false,
|
||||
"ExternalGear": true
|
||||
},
|
||||
"position": [
|
||||
201,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"placementRotation": [
|
||||
0,
|
||||
0.707106781,
|
||||
0,
|
||||
0.707106781
|
||||
],
|
||||
"geometries": [],
|
||||
"constraints": []
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "Gear1_20T blank",
|
||||
"action": "setFeature",
|
||||
"object": "PinionPad1",
|
||||
"kind": "feature",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_Pad",
|
||||
"featureType": "Pad",
|
||||
"profile": "PinionProfile1",
|
||||
"profileType": null,
|
||||
"position": null,
|
||||
"geometries": [],
|
||||
"constraints": [],
|
||||
"length": 45,
|
||||
"midplane": true,
|
||||
"reversed": false,
|
||||
"angle": null,
|
||||
"axis": null
|
||||
},
|
||||
{
|
||||
"step": 3,
|
||||
"label": "shaft profile",
|
||||
"action": "setSketch",
|
||||
"object": "ShaftProfile",
|
||||
"kind": "sketch",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"profileType": "Geometry",
|
||||
"position": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"placementRotation": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"parameters": {},
|
||||
"geometries": [
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
0,
|
||||
14,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
92,
|
||||
14,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
92,
|
||||
14,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
92,
|
||||
15,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
92,
|
||||
15,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
112,
|
||||
15,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
112,
|
||||
15,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
112,
|
||||
19,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
112,
|
||||
19,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
159,
|
||||
19,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
159,
|
||||
19,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
159,
|
||||
17,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
159,
|
||||
17,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
243,
|
||||
17,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
243,
|
||||
17,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
243,
|
||||
19,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
243,
|
||||
19,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
310,
|
||||
19,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
310,
|
||||
19,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
310,
|
||||
15,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
310,
|
||||
15,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
330,
|
||||
15,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
330,
|
||||
15,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
330,
|
||||
14,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
330,
|
||||
14,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
342,
|
||||
14,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
342,
|
||||
14,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
342,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
342,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
0,
|
||||
14,
|
||||
0
|
||||
]
|
||||
}
|
||||
],
|
||||
"constraints": [
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 0,
|
||||
"second": 1,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 1,
|
||||
"second": 2,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 2,
|
||||
"second": 3,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 3,
|
||||
"second": 4,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 4,
|
||||
"second": 5,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 5,
|
||||
"second": 6,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 6,
|
||||
"second": 7,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 7,
|
||||
"second": 8,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 8,
|
||||
"second": 9,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 9,
|
||||
"second": 10,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 10,
|
||||
"second": 11,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 11,
|
||||
"second": 12,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 12,
|
||||
"second": 13,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 13,
|
||||
"second": 14,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 14,
|
||||
"second": 15,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 15,
|
||||
"second": 0,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
}
|
||||
],
|
||||
"requireFullyConstrained": false
|
||||
},
|
||||
{
|
||||
"step": 4,
|
||||
"label": "revolution",
|
||||
"action": "setFeature",
|
||||
"object": "ShaftBody",
|
||||
"kind": "feature",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_Revolution",
|
||||
"featureType": "Revolution",
|
||||
"profile": "ShaftProfile",
|
||||
"profileType": null,
|
||||
"position": null,
|
||||
"geometries": [],
|
||||
"constraints": [],
|
||||
"length": null,
|
||||
"midplane": false,
|
||||
"reversed": false,
|
||||
"angle": 360,
|
||||
"axis": "X_Axis"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,618 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-steps/v1",
|
||||
"generatedAt": "2026-11-19T11:41:29.382Z",
|
||||
"project": "secondary-reducer",
|
||||
"document": "Shaft_intermediate",
|
||||
"episode": "R22",
|
||||
"title": "中间轴",
|
||||
"steps": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "Gear3_20T involute",
|
||||
"action": "setGear",
|
||||
"object": "PinionProfile1",
|
||||
"kind": "gear",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_InvoluteGear",
|
||||
"gearType": "InvoluteGear",
|
||||
"gearParameters": {
|
||||
"NumberOfTeeth": 20,
|
||||
"Modules": 3,
|
||||
"PressureAngle": 20,
|
||||
"AddendumCoefficient": 1,
|
||||
"DedendumCoefficient": 1.25,
|
||||
"RootFilletCoefficient": 0.38,
|
||||
"ProfileShiftCoefficient": 0,
|
||||
"HighPrecision": false,
|
||||
"ExternalGear": true
|
||||
},
|
||||
"position": [
|
||||
190.5,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"placementRotation": [
|
||||
0,
|
||||
0.707106781,
|
||||
0,
|
||||
0.707106781
|
||||
],
|
||||
"geometries": [],
|
||||
"constraints": []
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "Gear3_20T blank",
|
||||
"action": "setFeature",
|
||||
"object": "PinionPad1",
|
||||
"kind": "feature",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_Pad",
|
||||
"featureType": "Pad",
|
||||
"profile": "PinionProfile1",
|
||||
"profileType": null,
|
||||
"position": null,
|
||||
"geometries": [],
|
||||
"constraints": [],
|
||||
"length": 65,
|
||||
"midplane": true,
|
||||
"reversed": false,
|
||||
"angle": null,
|
||||
"axis": null
|
||||
},
|
||||
{
|
||||
"step": 3,
|
||||
"label": "shaft profile",
|
||||
"action": "setSketch",
|
||||
"object": "ShaftProfile",
|
||||
"kind": "sketch",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"profileType": "Geometry",
|
||||
"position": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"placementRotation": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"parameters": {},
|
||||
"geometries": [
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
0,
|
||||
21.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
16,
|
||||
21.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
16,
|
||||
21.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
16,
|
||||
22.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
16,
|
||||
22.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
39,
|
||||
22.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
39,
|
||||
22.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
104.5,
|
||||
22.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
104.5,
|
||||
22.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
104.5,
|
||||
24.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
104.5,
|
||||
24.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
148.5,
|
||||
24.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
148.5,
|
||||
24.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
148.5,
|
||||
26.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
148.5,
|
||||
26.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
156.5,
|
||||
26.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
156.5,
|
||||
26.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
156.5,
|
||||
24.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
156.5,
|
||||
24.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
224.5,
|
||||
24.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
224.5,
|
||||
24.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
224.5,
|
||||
26.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
224.5,
|
||||
26.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
234,
|
||||
26.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
234,
|
||||
26.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
234,
|
||||
22.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
234,
|
||||
22.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
257,
|
||||
22.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
257,
|
||||
22.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
257,
|
||||
21.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
257,
|
||||
21.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
269,
|
||||
21.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
269,
|
||||
21.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
269,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
269,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
0,
|
||||
21.5,
|
||||
0
|
||||
]
|
||||
}
|
||||
],
|
||||
"constraints": [
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 0,
|
||||
"second": 1,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 1,
|
||||
"second": 2,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 2,
|
||||
"second": 3,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 3,
|
||||
"second": 4,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 4,
|
||||
"second": 5,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 5,
|
||||
"second": 6,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 6,
|
||||
"second": 7,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 7,
|
||||
"second": 8,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 8,
|
||||
"second": 9,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 9,
|
||||
"second": 10,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 10,
|
||||
"second": 11,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 11,
|
||||
"second": 12,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 12,
|
||||
"second": 13,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 13,
|
||||
"second": 14,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 14,
|
||||
"second": 15,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 15,
|
||||
"second": 16,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 16,
|
||||
"second": 17,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 17,
|
||||
"second": 18,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 18,
|
||||
"second": 0,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
}
|
||||
],
|
||||
"requireFullyConstrained": false
|
||||
},
|
||||
{
|
||||
"step": 4,
|
||||
"label": "revolution",
|
||||
"action": "setFeature",
|
||||
"object": "ShaftBody",
|
||||
"kind": "feature",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_Revolution",
|
||||
"featureType": "Revolution",
|
||||
"profile": "ShaftProfile",
|
||||
"profileType": null,
|
||||
"position": null,
|
||||
"geometries": [],
|
||||
"constraints": [],
|
||||
"length": null,
|
||||
"midplane": false,
|
||||
"reversed": false,
|
||||
"angle": 360,
|
||||
"axis": "X_Axis"
|
||||
},
|
||||
{
|
||||
"step": 5,
|
||||
"label": "Gear2_80T keyseat profile",
|
||||
"action": "setSketch",
|
||||
"object": "KeyseatProfile1",
|
||||
"kind": "sketch",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"profileType": "Geometry",
|
||||
"position": [
|
||||
126.5,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"placementRotation": [
|
||||
0,
|
||||
0.707106781,
|
||||
0,
|
||||
0.707106781
|
||||
],
|
||||
"parameters": {},
|
||||
"geometries": [
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
7,
|
||||
19,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
-7,
|
||||
19,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
-7,
|
||||
19,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
-7,
|
||||
28.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
-7,
|
||||
28.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
7,
|
||||
28.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
7,
|
||||
28.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
7,
|
||||
19,
|
||||
0
|
||||
]
|
||||
}
|
||||
],
|
||||
"constraints": [
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 0,
|
||||
"second": 1,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 1,
|
||||
"second": 2,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 2,
|
||||
"second": 3,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 3,
|
||||
"second": 0,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
}
|
||||
],
|
||||
"requireFullyConstrained": false
|
||||
},
|
||||
{
|
||||
"step": 6,
|
||||
"label": "Gear2_80T keyseat",
|
||||
"action": "setFeature",
|
||||
"object": "KeyseatPocket1",
|
||||
"kind": "feature",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_Pocket",
|
||||
"featureType": "Pocket",
|
||||
"profile": "KeyseatProfile1",
|
||||
"profileType": null,
|
||||
"position": null,
|
||||
"geometries": [],
|
||||
"constraints": [],
|
||||
"length": 36,
|
||||
"midplane": true,
|
||||
"reversed": false,
|
||||
"angle": null,
|
||||
"axis": null
|
||||
}
|
||||
]
|
||||
}
|
||||
484
web/tools/cad-ui-rebuild/projects/out/ui-steps/Shaft_output.json
Normal file
@@ -0,0 +1,484 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-steps/v1",
|
||||
"generatedAt": "2026-11-19T11:41:30.982Z",
|
||||
"project": "secondary-reducer",
|
||||
"document": "Shaft_output",
|
||||
"episode": "R23",
|
||||
"title": "输出轴",
|
||||
"steps": [
|
||||
{
|
||||
"step": 1,
|
||||
"label": "shaft profile",
|
||||
"action": "setSketch",
|
||||
"object": "ShaftProfile",
|
||||
"kind": "sketch",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"profileType": "Geometry",
|
||||
"position": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"placementRotation": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"parameters": {},
|
||||
"geometries": [
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
0,
|
||||
26.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
88,
|
||||
26.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
88,
|
||||
26.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
88,
|
||||
27.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
88,
|
||||
27.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
113,
|
||||
27.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
113,
|
||||
27.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
231.5,
|
||||
27.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
231.5,
|
||||
27.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
231.5,
|
||||
29.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
231.5,
|
||||
29.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
295.5,
|
||||
29.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
295.5,
|
||||
29.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
295.5,
|
||||
31.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
295.5,
|
||||
31.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
306,
|
||||
31.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
306,
|
||||
31.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
306,
|
||||
27.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
306,
|
||||
27.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
331,
|
||||
27.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
331,
|
||||
27.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
331,
|
||||
26.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
331,
|
||||
26.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
343,
|
||||
26.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
343,
|
||||
26.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
343,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
343,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
0,
|
||||
26.5,
|
||||
0
|
||||
]
|
||||
}
|
||||
],
|
||||
"constraints": [
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 0,
|
||||
"second": 1,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 1,
|
||||
"second": 2,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 2,
|
||||
"second": 3,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 3,
|
||||
"second": 4,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 4,
|
||||
"second": 5,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 5,
|
||||
"second": 6,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 6,
|
||||
"second": 7,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 7,
|
||||
"second": 8,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 8,
|
||||
"second": 9,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 9,
|
||||
"second": 10,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 10,
|
||||
"second": 11,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 11,
|
||||
"second": 12,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 12,
|
||||
"second": 13,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 13,
|
||||
"second": 14,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 14,
|
||||
"second": 0,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
}
|
||||
],
|
||||
"requireFullyConstrained": false
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"label": "revolution",
|
||||
"action": "setFeature",
|
||||
"object": "ShaftBody",
|
||||
"kind": "feature",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_Revolution",
|
||||
"featureType": "Revolution",
|
||||
"profile": "ShaftProfile",
|
||||
"profileType": null,
|
||||
"position": null,
|
||||
"geometries": [],
|
||||
"constraints": [],
|
||||
"length": null,
|
||||
"midplane": false,
|
||||
"reversed": false,
|
||||
"angle": 360,
|
||||
"axis": "X_Axis"
|
||||
},
|
||||
{
|
||||
"step": 3,
|
||||
"label": "Gear4_100T keyseat profile",
|
||||
"action": "setSketch",
|
||||
"object": "KeyseatProfile1",
|
||||
"kind": "sketch",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_NewSketch",
|
||||
"profileType": "Geometry",
|
||||
"position": [
|
||||
263.5,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"placementRotation": [
|
||||
0,
|
||||
0.707106781,
|
||||
0,
|
||||
0.707106781
|
||||
],
|
||||
"parameters": {},
|
||||
"geometries": [
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
8,
|
||||
23.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
-8,
|
||||
23.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
-8,
|
||||
23.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
-8,
|
||||
33.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
-8,
|
||||
33.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
8,
|
||||
33.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"start": [
|
||||
8,
|
||||
33.5,
|
||||
0
|
||||
],
|
||||
"end": [
|
||||
8,
|
||||
23.5,
|
||||
0
|
||||
]
|
||||
}
|
||||
],
|
||||
"constraints": [
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 0,
|
||||
"second": 1,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 1,
|
||||
"second": 2,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 2,
|
||||
"second": 3,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
},
|
||||
{
|
||||
"type": "Coincident",
|
||||
"first": 3,
|
||||
"second": 0,
|
||||
"firstPos": "end",
|
||||
"secondPos": "start"
|
||||
}
|
||||
],
|
||||
"requireFullyConstrained": false
|
||||
},
|
||||
{
|
||||
"step": 4,
|
||||
"label": "Gear4_100T keyseat",
|
||||
"action": "setFeature",
|
||||
"object": "KeyseatPocket1",
|
||||
"kind": "feature",
|
||||
"page": "partdesign.html",
|
||||
"command": "PartDesign_Pocket",
|
||||
"featureType": "Pocket",
|
||||
"profile": "KeyseatProfile1",
|
||||
"profileType": null,
|
||||
"position": null,
|
||||
"geometries": [],
|
||||
"constraints": [],
|
||||
"length": 56,
|
||||
"midplane": true,
|
||||
"reversed": false,
|
||||
"angle": null,
|
||||
"axis": null
|
||||
}
|
||||
]
|
||||
}
|
||||
123
web/tools/cad-ui-rebuild/projects/out/ui-steps/index.json
Normal file
@@ -0,0 +1,123 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/ui-steps-index/v1",
|
||||
"generatedAt": "2026-11-19T11:41:30.989Z",
|
||||
"project": "secondary-reducer",
|
||||
"documents": [
|
||||
{
|
||||
"id": "R01",
|
||||
"document": "Bearing6206_Balls",
|
||||
"steps": 2
|
||||
},
|
||||
{
|
||||
"id": "R02",
|
||||
"document": "Bearing6206_Inner",
|
||||
"steps": 2
|
||||
},
|
||||
{
|
||||
"id": "R03",
|
||||
"document": "Bearing6206_Outer",
|
||||
"steps": 2
|
||||
},
|
||||
{
|
||||
"id": "R04",
|
||||
"document": "Bearing6209_Balls",
|
||||
"steps": 2
|
||||
},
|
||||
{
|
||||
"id": "R05",
|
||||
"document": "Bearing6209_Inner",
|
||||
"steps": 2
|
||||
},
|
||||
{
|
||||
"id": "R06",
|
||||
"document": "Bearing6209_Outer",
|
||||
"steps": 2
|
||||
},
|
||||
{
|
||||
"id": "R07",
|
||||
"document": "Bearing6211_Balls",
|
||||
"steps": 2
|
||||
},
|
||||
{
|
||||
"id": "R08",
|
||||
"document": "Bearing6211_Inner",
|
||||
"steps": 2
|
||||
},
|
||||
{
|
||||
"id": "R09",
|
||||
"document": "Bearing6211_Outer",
|
||||
"steps": 2
|
||||
},
|
||||
{
|
||||
"id": "R10",
|
||||
"document": "Coupling_input",
|
||||
"steps": 8
|
||||
},
|
||||
{
|
||||
"id": "R11",
|
||||
"document": "Gear2_80T",
|
||||
"steps": 4
|
||||
},
|
||||
{
|
||||
"id": "R12",
|
||||
"document": "Gear4_100T",
|
||||
"steps": 4
|
||||
},
|
||||
{
|
||||
"id": "R13",
|
||||
"document": "HousingBase",
|
||||
"steps": 16
|
||||
},
|
||||
{
|
||||
"id": "R14",
|
||||
"document": "HousingCover",
|
||||
"steps": 26
|
||||
},
|
||||
{
|
||||
"id": "R15",
|
||||
"document": "InspectionPlate",
|
||||
"steps": 4
|
||||
},
|
||||
{
|
||||
"id": "R16",
|
||||
"document": "Key_intermediate_Gear2_80T",
|
||||
"steps": 2
|
||||
},
|
||||
{
|
||||
"id": "R17",
|
||||
"document": "Key_output_Gear4_100T",
|
||||
"steps": 2
|
||||
},
|
||||
{
|
||||
"id": "R18",
|
||||
"document": "Seal_input",
|
||||
"steps": 2
|
||||
},
|
||||
{
|
||||
"id": "R19",
|
||||
"document": "Seal_intermediate",
|
||||
"steps": 2
|
||||
},
|
||||
{
|
||||
"id": "R20",
|
||||
"document": "Seal_output",
|
||||
"steps": 2
|
||||
},
|
||||
{
|
||||
"id": "R21",
|
||||
"document": "Shaft_input",
|
||||
"steps": 4
|
||||
},
|
||||
{
|
||||
"id": "R22",
|
||||
"document": "Shaft_intermediate",
|
||||
"steps": 6
|
||||
},
|
||||
{
|
||||
"id": "R23",
|
||||
"document": "Shaft_output",
|
||||
"steps": 4
|
||||
}
|
||||
],
|
||||
"failures": []
|
||||
}
|
||||
14
web/tools/cad-ui-rebuild/projects/run-legacy-sweep.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
# Drive every part of projects/secondary-reducer.json through the headed UI.
|
||||
# Skipped parts are the ones already driven (their evidence is reused).
|
||||
set -u
|
||||
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
OUT="$HERE/projects/out"
|
||||
mkdir -p "$OUT"
|
||||
for id in $(node "$HERE/manifest.mjs" --project "$HERE/projects/secondary-reducer.json"); do
|
||||
[ -f "$OUT/ui-run/$id.json" ] && { echo "$id skip"; continue; }
|
||||
DISPLAY=:1 timeout 2400 node "$HERE/drive.mjs" --project "$HERE/projects/secondary-reducer.json" "$id" --headed \
|
||||
> "$OUT/$id.log" 2>&1
|
||||
echo "$id exit=$? $(tail -c 200 "$OUT/$id.log" | tr '\n' ' ')"
|
||||
done
|
||||
echo SWEEP_DONE
|
||||
144
web/tools/cad-ui-rebuild/projects/secondary-reducer-pro.json
Normal file
@@ -0,0 +1,144 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/project/v1",
|
||||
"name": "secondary-reducer-pro",
|
||||
"appOrigin": "http://127.0.0.1:5180",
|
||||
"paths": {
|
||||
"replayDir": "../../../teaching/cases/secondary-reducer-pro/out/replay",
|
||||
"sampleDir": "../../../public/samples/secondary-reducer-pro",
|
||||
"outDir": "out",
|
||||
"stillsDir": "ui-stills"
|
||||
},
|
||||
"pages": {
|
||||
"sketch": "partdesign.html",
|
||||
"feature": "partdesign.html",
|
||||
"gear": "partdesign.html",
|
||||
"primitive": "partdesign.html",
|
||||
"transform": "partdesign.html",
|
||||
"assembly": "workbench.html?module=Assembly&command=Assembly_CreateAssembly"
|
||||
},
|
||||
"parts": [
|
||||
{
|
||||
"id": "P01",
|
||||
"document": "Gear2_80T",
|
||||
"title": "一级大齿轮 80 齿"
|
||||
},
|
||||
{
|
||||
"id": "P02",
|
||||
"document": "Gear4_100T",
|
||||
"title": "二级大齿轮 100 齿"
|
||||
},
|
||||
{
|
||||
"id": "P03",
|
||||
"document": "Shaft_input",
|
||||
"title": "输入轴(带 20 齿小齿轮)"
|
||||
},
|
||||
{
|
||||
"id": "P04",
|
||||
"document": "Shaft_intermediate",
|
||||
"title": "中间轴(双联,带 20 齿小齿轮 + 键槽)"
|
||||
},
|
||||
{
|
||||
"id": "P05",
|
||||
"document": "Shaft_output",
|
||||
"title": "输出轴(带键槽,72.5 rpm)"
|
||||
},
|
||||
{
|
||||
"id": "P06",
|
||||
"document": "Bearing6206_Inner",
|
||||
"title": "6206 轴承内圈"
|
||||
},
|
||||
{
|
||||
"id": "P07",
|
||||
"document": "Bearing6206_Outer",
|
||||
"title": "6206 轴承外圈"
|
||||
},
|
||||
{
|
||||
"id": "P08",
|
||||
"document": "Bearing6206_Balls",
|
||||
"title": "6206 轴承滚珠(9 粒圆周阵列)"
|
||||
},
|
||||
{
|
||||
"id": "P09",
|
||||
"document": "Bearing6209_Inner",
|
||||
"title": "6209 轴承内圈"
|
||||
},
|
||||
{
|
||||
"id": "P10",
|
||||
"document": "Bearing6209_Outer",
|
||||
"title": "6209 轴承外圈"
|
||||
},
|
||||
{
|
||||
"id": "P11",
|
||||
"document": "Bearing6209_Balls",
|
||||
"title": "6209 轴承滚珠"
|
||||
},
|
||||
{
|
||||
"id": "P12",
|
||||
"document": "Bearing6211_Inner",
|
||||
"title": "6211 轴承内圈"
|
||||
},
|
||||
{
|
||||
"id": "P13",
|
||||
"document": "Bearing6211_Outer",
|
||||
"title": "6211 轴承外圈"
|
||||
},
|
||||
{
|
||||
"id": "P14",
|
||||
"document": "Bearing6211_Balls",
|
||||
"title": "6211 轴承滚珠"
|
||||
},
|
||||
{
|
||||
"id": "P15",
|
||||
"document": "Key_intermediate_Gear2_80T",
|
||||
"title": "中间轴平键(80 齿齿轮用)"
|
||||
},
|
||||
{
|
||||
"id": "P16",
|
||||
"document": "Key_output_Gear4_100T",
|
||||
"title": "输出轴平键(100 齿齿轮用)"
|
||||
},
|
||||
{
|
||||
"id": "P17",
|
||||
"document": "Seal_input",
|
||||
"title": "输入轴骨架油封"
|
||||
},
|
||||
{
|
||||
"id": "P18",
|
||||
"document": "Seal_intermediate",
|
||||
"title": "中间轴骨架油封"
|
||||
},
|
||||
{
|
||||
"id": "P19",
|
||||
"document": "Seal_output",
|
||||
"title": "输出轴骨架油封"
|
||||
},
|
||||
{
|
||||
"id": "P20",
|
||||
"document": "Coupling_input",
|
||||
"title": "输入联轴器(轮毂 + 法兰 + 内孔 + 螺栓孔)"
|
||||
},
|
||||
{
|
||||
"id": "P21",
|
||||
"document": "HousingBase",
|
||||
"title": "剖分式下箱体(16 步)"
|
||||
},
|
||||
{
|
||||
"id": "P22",
|
||||
"document": "HousingCover",
|
||||
"title": "上箱盖(26 步,含观察孔与吊耳)"
|
||||
},
|
||||
{
|
||||
"id": "P23",
|
||||
"document": "InspectionPlate",
|
||||
"title": "观察孔盖板"
|
||||
}
|
||||
],
|
||||
"assembly": {
|
||||
"document": "SecondaryReducer",
|
||||
"label": "SecondaryReducer",
|
||||
"objects": [
|
||||
"Body"
|
||||
],
|
||||
"groundDocument": "HousingBase"
|
||||
}
|
||||
}
|
||||
129
web/tools/cad-ui-rebuild/projects/secondary-reducer.json
Normal file
@@ -0,0 +1,129 @@
|
||||
{
|
||||
"schema": "freecad-web-cad-ui-rebuild/project/v1",
|
||||
"name": "secondary-reducer",
|
||||
"appOrigin": "http://127.0.0.1:5180",
|
||||
"paths": {
|
||||
"replayDir": "../../../teaching/cases/secondary-reducer/out/opfs/freecad-exports",
|
||||
"sampleDir": "../../../teaching/cases/secondary-reducer/out/opfs/freecad-exports",
|
||||
"outDir": "out",
|
||||
"stillsDir": "ui-stills",
|
||||
"replayName": "trace-{document}.json"
|
||||
},
|
||||
"parts": [
|
||||
{
|
||||
"id": "R01",
|
||||
"document": "Bearing6206_Balls",
|
||||
"title": "6206 钢球组"
|
||||
},
|
||||
{
|
||||
"id": "R02",
|
||||
"document": "Bearing6206_Inner",
|
||||
"title": "6206 内圈"
|
||||
},
|
||||
{
|
||||
"id": "R03",
|
||||
"document": "Bearing6206_Outer",
|
||||
"title": "6206 外圈"
|
||||
},
|
||||
{
|
||||
"id": "R04",
|
||||
"document": "Bearing6209_Balls",
|
||||
"title": "6209 钢球组"
|
||||
},
|
||||
{
|
||||
"id": "R05",
|
||||
"document": "Bearing6209_Inner",
|
||||
"title": "6209 内圈"
|
||||
},
|
||||
{
|
||||
"id": "R06",
|
||||
"document": "Bearing6209_Outer",
|
||||
"title": "6209 外圈"
|
||||
},
|
||||
{
|
||||
"id": "R07",
|
||||
"document": "Bearing6211_Balls",
|
||||
"title": "6211 钢球组"
|
||||
},
|
||||
{
|
||||
"id": "R08",
|
||||
"document": "Bearing6211_Inner",
|
||||
"title": "6211 内圈"
|
||||
},
|
||||
{
|
||||
"id": "R09",
|
||||
"document": "Bearing6211_Outer",
|
||||
"title": "6211 外圈"
|
||||
},
|
||||
{
|
||||
"id": "R10",
|
||||
"document": "Coupling_input",
|
||||
"title": "输入联轴器"
|
||||
},
|
||||
{
|
||||
"id": "R11",
|
||||
"document": "Gear2_80T",
|
||||
"title": "一级大齿轮 80 齿"
|
||||
},
|
||||
{
|
||||
"id": "R12",
|
||||
"document": "Gear4_100T",
|
||||
"title": "二级大齿轮 100 齿"
|
||||
},
|
||||
{
|
||||
"id": "R13",
|
||||
"document": "HousingBase",
|
||||
"title": "下壳体"
|
||||
},
|
||||
{
|
||||
"id": "R14",
|
||||
"document": "HousingCover",
|
||||
"title": "上壳体"
|
||||
},
|
||||
{
|
||||
"id": "R15",
|
||||
"document": "InspectionPlate",
|
||||
"title": "检查盖板"
|
||||
},
|
||||
{
|
||||
"id": "R16",
|
||||
"document": "Key_intermediate_Gear2_80T",
|
||||
"title": "中间轴键"
|
||||
},
|
||||
{
|
||||
"id": "R17",
|
||||
"document": "Key_output_Gear4_100T",
|
||||
"title": "输出轴键"
|
||||
},
|
||||
{
|
||||
"id": "R18",
|
||||
"document": "Seal_input",
|
||||
"title": "输入轴油封"
|
||||
},
|
||||
{
|
||||
"id": "R19",
|
||||
"document": "Seal_intermediate",
|
||||
"title": "中间轴油封"
|
||||
},
|
||||
{
|
||||
"id": "R20",
|
||||
"document": "Seal_output",
|
||||
"title": "输出轴油封"
|
||||
},
|
||||
{
|
||||
"id": "R21",
|
||||
"document": "Shaft_input",
|
||||
"title": "输入轴"
|
||||
},
|
||||
{
|
||||
"id": "R22",
|
||||
"document": "Shaft_intermediate",
|
||||
"title": "中间轴"
|
||||
},
|
||||
{
|
||||
"id": "R23",
|
||||
"document": "Shaft_output",
|
||||
"title": "输出轴"
|
||||
}
|
||||
]
|
||||
}
|
||||
BIN
web/tools/cad-ui-rebuild/projects/ui-stills/R01/S01-ball.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 41 KiB |
BIN
web/tools/cad-ui-rebuild/projects/ui-stills/R02/S01-profile.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 52 KiB |
BIN
web/tools/cad-ui-rebuild/projects/ui-stills/R03/S01-profile.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 52 KiB |
BIN
web/tools/cad-ui-rebuild/projects/ui-stills/R04/S01-ball.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 41 KiB |
BIN
web/tools/cad-ui-rebuild/projects/ui-stills/R05/S01-profile.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 52 KiB |
BIN
web/tools/cad-ui-rebuild/projects/ui-stills/R06/S01-profile.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 52 KiB |
BIN
web/tools/cad-ui-rebuild/projects/ui-stills/R07/S01-ball.png
Normal file
|
After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 41 KiB |
BIN
web/tools/cad-ui-rebuild/projects/ui-stills/R08/S01-profile.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 52 KiB |
BIN
web/tools/cad-ui-rebuild/projects/ui-stills/R09/S01-profile.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 35 KiB |
BIN
web/tools/cad-ui-rebuild/projects/ui-stills/R10/S02-hub.png
Normal file
|
After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 35 KiB |
BIN
web/tools/cad-ui-rebuild/projects/ui-stills/R10/S04-flange.png
Normal file
|
After Width: | Height: | Size: 50 KiB |
|
After Width: | Height: | Size: 35 KiB |
BIN
web/tools/cad-ui-rebuild/projects/ui-stills/R10/S06-bore.png
Normal file
|
After Width: | Height: | Size: 51 KiB |
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 38 KiB |
BIN
web/tools/cad-ui-rebuild/projects/ui-stills/R11/S02-pad.png
Normal file
|
After Width: | Height: | Size: 50 KiB |
|
After Width: | Height: | Size: 29 KiB |
BIN
web/tools/cad-ui-rebuild/projects/ui-stills/R11/S04-cut.png
Normal file
|
After Width: | Height: | Size: 49 KiB |
|
After Width: | Height: | Size: 38 KiB |
BIN
web/tools/cad-ui-rebuild/projects/ui-stills/R12/S02-pad.png
Normal file
|
After Width: | Height: | Size: 50 KiB |
|
After Width: | Height: | Size: 43 KiB |
BIN
web/tools/cad-ui-rebuild/projects/ui-stills/R12/S04-cut.png
Normal file
|
After Width: | Height: | Size: 49 KiB |
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 50 KiB |