Rewrite the beginner manual against measured Web behaviour
The manual claimed 32 modules and taught several workflows that do not run in the web port. Rewrite the chapter bodies and drive every new screenshot from a real interaction with a waitFor before each shot. Screenshots go from 33 to 63. ch06-ch13 grow from one page snapshot each to 3-7 shots taken in headed Chrome, all with empty pageErrors and consoleErrors and every PNG well above the 5 KB bar. Correct the text where the port differs from the desktop: - ch08: Mesh_FromPartShape has no task panel, so the main line becomes Mesh_BuildRegularSolid, which really returns typeId Mesh::Cube. - ch09: no BIM creation command has a panel; only Library, Setup, Material and Views are usable. - ch10: CAM_Job offers only None in its Model select and fails with cam_command_failed. - ch11: the recorded error was Document does not exist; the real one is invalid_request: Select source objects in the current document, and PageDefault cannot create a page at all. - ch12: FEM_Analysis has no panel, so the chain breaks at step one. - ch13: drop every OpenSCAD scene action and screenshot; Robot jog buttons, the Plot canvas and Draft viewport picking do not work, so the chapter documents the panels instead of pretending they run. Rebuild gives 15 chapters, 1575 command rows, 1721 search entries and 945197 bytes; check:manual passes both viewports with no errors, no broken images and no horizontal overflow. The gap ledger goes from 7 to 11 boundaries. Remove b-openscad-recompile, which should not exist while the workbench is removed, and record the five newly measured ones: BIM creation, Mesh_FromPartShape, Draft viewport picking, Robot without a model and Plot without a canvas. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,81 +1,133 @@
|
||||
# Web FreeCAD 全功能初学者教案 · 接续点
|
||||
|
||||
更新:2026-11-13
|
||||
计划:`/home/mes123456/.claude/plans/partitioned-puzzling-haven.md`
|
||||
更新:2026-11-15
|
||||
计划:`/home/mes123456/.claude/plans/sleepy-whistling-journal.md`(完全重写)
|
||||
|
||||
## 目标
|
||||
|
||||
单页中文 HTML 教案,覆盖 32 个模块;核心模块逐步精讲,专业模块 1–2 个工作流;
|
||||
1492 条命令全部进附录;小缺口修 React/内核,大边界如实标注。
|
||||
单页中文 HTML 教案,两层结构:入门主线(第 0–7 章)+ 全模块速查(第 8–13 章 + 附录)。
|
||||
图文并茂,内容完全对标语实测的软件功能;缺口按实测记账,不虚报。
|
||||
|
||||
## 已完成(P0)
|
||||
## 本轮重写范围(2026-11-15)
|
||||
|
||||
- `tools/manual/generate-features.mjs` → `manual/data/{manual-features,inventory-snapshot,coverage-audit}.json`
|
||||
- 32/32 模块有章节;1602 条命令记录(1492 桌面 + 110 注册路由);
|
||||
196 native handler 全部映射;312 精讲 / 1287 覆盖 / 3 边界。
|
||||
- 边界已识别:`CAM_Adaptive`、`FEM_ResultShow`、`TechDraw_PageDefault`;
|
||||
glTF/Cloud 等模块级边界待补入 gap ledger。
|
||||
- `tools/manual/capture.mjs`:Playwright 动作 DSL(goto/wait/click/fill/select/press/
|
||||
drag/eval/shot/save/assert),0 pageError/consoleError 门禁,截图 >5 KB,报告 JSON。
|
||||
- `tools/manual/build-manual.mjs` + `template.html`:单页 HTML,侧栏/搜索/进度/灯箱/
|
||||
命令索引/移动端抽屉;输出 `teaching/manual.html` + `manual-assets/`。
|
||||
- 第 1 章样章:`content/ch01-ui.md` + `scenarios/ch01-ui.json`;
|
||||
7 张真实截图(界面/Box/Placement/属性/视口/保存/总结)。
|
||||
- 页面检查通过:1440×900 与 390×844 均 0 错误、0 破坏图片、0 横向溢出;
|
||||
搜索 `Part_Box` 命中 4 条;命令索引 1602 行。
|
||||
- `package.json` 增加 `manual:features` / `build:manual` / `check:manual`。
|
||||
### 截图:33 张 → 63 张
|
||||
|
||||
- 第 2 章 Part:`content/ch02-part.md` + `scenarios/ch02-part.json`;
|
||||
4 张截图(图元、Cut 通孔、CheckGeometry、结果);断言 Cylinder R15/H40/Z-10、
|
||||
Cut 体积 81862.83 mm³、7 面/124 三角面;fixture 已保存。
|
||||
- 第 3 章 Sketcher:`content/ch03-sketcher.md` + `scenarios/ch03-sketcher.json`;
|
||||
5 张截图(New Sketch、编辑器、4 geometries 矩形、约束空间、关闭);
|
||||
通过表单坐标创建 60×40 矩形,断言 `4 geometries`。
|
||||
- 已确认 Web 布局边界:草图编辑器嵌在属性栏内、面板窄且需滚动;
|
||||
正文已如实说明,后续可用 React 把编辑器移到主舞台修复。
|
||||
- 第 4 章 PartDesign:`content/ch04-partdesign.md` + `scenarios/ch04-partdesign.json`;
|
||||
3 张截图(Sketch1 矩形、Pad 任务、Pad 结果);在 `/partdesign.html` 完成
|
||||
新建文档 → Body → 创建草图 → 矩形 → Pad Length=10 → 创建 Pad。
|
||||
- 记录边界:项目页 Part 文档切 PartDesign 需要 ownership handoff,教程改用独立
|
||||
`partdesign.html`。
|
||||
- **全部章节完成**:第 0–14 章(15 章)+ 自动附录命令索引,共 33 张真实截图。
|
||||
- 第 0 章 Start/文件工具;第 5 章 Assembly 创建+2 条链接;第 6 章 Spreadsheet;
|
||||
第 7 章导入导出;第 8–12 章 Mesh/BIM/CAM/TechDraw/FEM;第 13 章 OpenSCAD/Robot/Plot;
|
||||
第 14 章 27 件 GLB 产线案例。
|
||||
- 专章边界如实标注:TechDraw 跨 Worker、FEM 原生结果、CAM OpenCAMLib、
|
||||
Mesh/BIM 模块页 boundary、glTF 原生导入导出。
|
||||
- 最终页面检查:15 章 / 33 图 / 1602 命令 / 1736 搜索项;
|
||||
桌面与移动 0 错误、0 破图、0 横向溢出。
|
||||
- `manual/data/final-status.json` 记录完成状态。
|
||||
- 收口脚本 `tools/manual/finalize-features.mjs`:回写 14 个 workflow、34 张截图、
|
||||
12 条 `verified` 命令;生成 `manual/data/gap-ledger.json` 与
|
||||
`web/docs/current/web-freecad-manual-gaps.md`(7 条边界 + 布局/流程说明)。
|
||||
- 最终页面:15 章 / 33 张正文图(34 张采集图)/ 1602 命令 / 1736 搜索项;
|
||||
桌面与移动 0 错误、0 破图、0 溢出。
|
||||
ch06–ch13 的场景从「一句话 + 一张页面截图」改成**真操作驱动**:每个新增截图前
|
||||
都有 `waitFor` 断言 + 真实点击/填写,避免空页面截图。
|
||||
|
||||
| 章 | 图数 | 场景做法 |
|
||||
|---|---:|---|
|
||||
| ch06 | 1 → 5 | project.html 新建 Document → Workbench 切 Spreadsheet → Create spreadsheet;再依次打开 MassProperties(含 Refresh 前后)、Material_Edit、SetAppearance |
|
||||
| ch07 | 1 → 3 | 新建 Document → File → Open / import / export → 展开 file-tools 折叠面板;再切 Import 工作台 |
|
||||
| ch08 | 1 → 5 | Mesh_BuildRegularSolid 填 40/30/20 → Preview → Create(实测返回 `typeId: Mesh::Cube`)→ Mesh_Evaluation → Analyze Indices → Mesh_Export |
|
||||
| ch09 | 1 → 5 | BIM 模块页 → BIM_Library → BIM_Setup(Read current preferences 前后)→ BIM_Material |
|
||||
| ch10 | 1 → 4 | CAM_Job / CAM_Profile / CAM_Pocket_Shape / CAM_Post 四个面板 |
|
||||
| ch11 | 1 → 4 | TechDraw 页面 → View 面板(填 7 个字段)→ 提交返回错误 → SectionView 面板 |
|
||||
| ch12 | 1 → 7 | MaterialSolid 空面板 → 点结构钢预设(实测填入 210000/0.3/7850)→ ConstraintFixed → MeshNetgenFromShape(含提交后)→ SolverRun → ResultShow |
|
||||
| ch13 | 2 → 6 | Robot_CreateRobot 六分组 → Robot_InsertWaypoint → Draft_Rectangle → Draft_Circle → Plot 面板 → 点 New figure + Add axes 后 |
|
||||
|
||||
全部用 `--headed` 在 `DISPLAY=:1` 采集,每次运行 `pageErrors: []`、`consoleErrors: []`,
|
||||
所有 PNG 远高于 5 KB 门槛(最小 17 908 B)。
|
||||
|
||||
### 正文:与新截图和实测结论对齐
|
||||
|
||||
- **ch08 重排为 8.1 实测可走路径 / 8.2 桌面版标准路径**。原文把 `Mesh_FromPartShape`
|
||||
当主线教,实测该命令无面板;改以 `Mesh_BuildRegularSolid` 为主线,并给出真实返回值。
|
||||
- **ch09 §9.1 改为「桌面版标准顺序」并前置实测边界**:BIM 创建类命令一律无面板,
|
||||
可用的只有 Library / Setup / Material / Views 四个非创建类命令。
|
||||
- **ch10 §10.1 前置实测边界**:`CAM_Job` 的 Model 下拉只有 `None`,提交返回
|
||||
`cam_command_failed: The selected CAM document does not exist`;§10.2 改为三个操作面板的结构参考。
|
||||
- **ch11 新增 §11.2「视图命令面板长什么样」**:讲 7 个字段与 `SectionView` 的
|
||||
Section normal;边界改为「页面建不出来」+「视图提交拿不到文档」两条实测。
|
||||
错误文本从旧的 `Document does not exist` 更正为实测的
|
||||
`invalid_request: Select source objects in the current document`。
|
||||
- **ch12 新增 §12.2「逐步看 Web 端的 FEM 面板」**:六步逐面板;边界新增
|
||||
「`FEM_Analysis` 无面板,链路第一步即断」。
|
||||
- **ch13 完全重写 §13.1–13.3**:删除全部 OpenSCAD 场景动作与旧截图;
|
||||
Robot 改成讲面板结构并如实说明点动按钮不改变状态;Plot 说明画布不渲染;
|
||||
Draft 说明需要三维视口取点而壳层页面没有 canvas。
|
||||
|
||||
### 数据口径修正
|
||||
|
||||
旧接续点写的「32 个模块 / 1602 条命令 / 1736 搜索项」已过期。本轮实测口径:
|
||||
|
||||
- **31** 个 Web 可路由模块(不含 OpenSCAD)
|
||||
- 矩阵 1492 条:`native_handler` 196 / `restricted` 1296 / `not_implemented` 0
|
||||
- **不存在 `uiStatus` 字段**;早期「96 条可交互命令」来自旧注册表,不得再引用
|
||||
- 构建产物:15 章 / 1575 命令行 / 1721 搜索项 / 945 197 字节
|
||||
|
||||
## 验证结果(2026-11-15)
|
||||
|
||||
```
|
||||
npm run build:manual → {"ok":true,"chapters":15,"sections":15,"commands":1575,
|
||||
"searchEntries":1721,"bytes":945197}
|
||||
npm run check:manual → ok:true;两个视口均 errors:[] failed:[] brokenImages:[] overflow:0
|
||||
1440×900 与 390×844 各 63 images / 131 sections
|
||||
```
|
||||
|
||||
图片引用自检:`grep manual-assets` 得到 61 条正文引用,全部存在,0 缺失。
|
||||
未被引用的 7 张图是 ch01/ch03 的历史遗留(`03-placement`、`07-summary`、
|
||||
`02-sketch-editor`、`04-constraint-space`、`04-preview`、`05-closed`、`06-closed`),
|
||||
不是本轮产物,暂不处理。
|
||||
|
||||
OpenSCAD 自检:`manual/scenarios/` 0 处;`manual/content/` 4 处,
|
||||
全部是「Web 端不支持 / 不提供」的否定说明;`data/gap-ledger.json` 0 处
|
||||
(已删除 `b-openscad-recompile` 这条违反摘除规则的边界条目)。
|
||||
|
||||
## 缺口账本变化
|
||||
|
||||
`manual/data/gap-ledger.json`:7 → 11 条边界,全部带 `measuredAt: 2026-11-15`。
|
||||
|
||||
删除 1 条:`b-openscad-recompile`(OpenSCAD 整体不实现,不应留在账本里)。
|
||||
|
||||
更新 3 条(按本轮实测文本):
|
||||
`b-techdraw-worker`、`b-fem-native`、`b-cam-opencamlib`。
|
||||
|
||||
新增 5 条:`b-bim-no-creation`、`b-mesh-frompartshape`、`b-draft-needs-viewport`、
|
||||
`b-robot-no-model`、`b-plot-no-canvas`。
|
||||
|
||||
notes 由 3 条增至 6 条,新增:本轮重写范围说明、两套页面壳不可互换的结论、
|
||||
「字段面板能提交但缺父对象文档属前置未满足,不记产品回归」的判定口径。
|
||||
|
||||
## 真实残余
|
||||
|
||||
- `verified` 状态尚未回写:矩阵仍为 detailed/overview/boundary;截图与断言证据在
|
||||
`manual/data/capture/`,可在后续把有截图的章节升级为 verified。
|
||||
- 部分专业工作台(Mesh/BIM/TechDraw/FEM)截图来自模块页,展示命令清单与边界,
|
||||
不是完整任务工作流;正文已明确说明。
|
||||
- 命令索引 1602 行使 HTML 约 890 KB;图片外链,未嵌入。
|
||||
- 第 3 章草图编辑器位于属性栏的布局边界仍在;可用 React 移到主舞台。
|
||||
- 所有改动已提交/推送分支 `web-manual-20261113`。
|
||||
- **两套页面壳不可互换**:`project.html` 能新建 Document 且工作台下拉给 30 个工作台;
|
||||
`workbench.html?module=X` 对多数模块绑定固定文档 id `workbench-document`
|
||||
(`src/workbench-shell.tsx:1866`),既不能新建也不能打开文档。跨页跳转会丢文档。
|
||||
这是 ch09–ch12 只能取证面板、不能跑完整工作流的根因。
|
||||
- **Sketcher 布局缺口仍在**(计划第 4 步):草图编辑器嵌在属性栏,面板窄且需滚动,
|
||||
可用 React 移到主舞台。本轮未动,仍记为待修。
|
||||
- ch01/ch03 的 7 张历史遗留图未被正文引用,可考虑删除或补引用。
|
||||
- `manual/data/final-status.json` 与 `docs/current/web-freecad-manual-gaps.md`
|
||||
仍是 2026-11-13 的 32 模块口径,本轮未回写。
|
||||
- 本轮改动**尚未提交**。计划是等用户确认后单独一个提交,只提交
|
||||
`manual/content/`、`manual/scenarios/`、`manual/assets/` 下新增/替换的 PNG、
|
||||
`manual/data/gap-ledger.json`、`manual/CONTINUATION.md`;
|
||||
**不提交** 1.8 GB 的 `web/teaching/` 产物。
|
||||
- `web/continuationNotes.md` 的改动仍来自上一阶段,未提交。
|
||||
|
||||
## 下一步精确入口
|
||||
|
||||
1. 可选:把 capture 成功的章节回写为 `verified`,并补 `manual-gaps` 文档。
|
||||
2. 可选:用 React 把草图编辑器移到主舞台,修复第 3 章布局边界。
|
||||
3. 可选:补 Mesh/BIM/TechDraw/FEM 的完整任务截图,替换模块页截图。
|
||||
4. 复现命令:`npm run manual:features` → capture → `npm run build:manual` →
|
||||
`npm run check:manual`。
|
||||
1. 用户确认后提交本轮教案改动(排除 `web/teaching/`)。
|
||||
2. 可选:用 React 把 Sketcher 编辑器移到主舞台,修 §3 布局边界,
|
||||
然后重采 ch03 截图。
|
||||
3. 可选:回写 `final-status.json` 与 `docs/current/web-freecad-manual-gaps.md` 到 31 模块口径。
|
||||
4. 复现命令(cwd 必须是 `web/`,playwright 装在 `web/node_modules`):
|
||||
```bash
|
||||
cd /home/mes123456/FreeCADWasmDev/working/FreeCAD/web
|
||||
DISPLAY=:1 node tools/manual/capture.mjs --scenario manual/scenarios/ch08-mesh.json \
|
||||
--headed --origin http://127.0.0.1:5181
|
||||
npm run build:manual && npm run check:manual
|
||||
```
|
||||
|
||||
## 关键路径
|
||||
|
||||
- 应用:`http://127.0.0.1:5181/project.html?workbench=Part`
|
||||
- 应用:`http://127.0.0.1:5181/project.html`(主壳)、
|
||||
`http://127.0.0.1:5181/workbench.html?module=X&command=Y`(工作台壳)
|
||||
- 教学服务:`http://127.0.0.1:5190/manual.html`
|
||||
- 矩阵输入:`web/public/api/workbench-command-matrix.json`、
|
||||
`web/public/api/desktop-command-routes.json`、`web/src/module-registry.generated.ts`
|
||||
`web/src/module-registry.generated.ts`
|
||||
- 截图:`web/manual/assets/<chapter>/<workflow>/`
|
||||
- 证据:`web/manual/data/capture/<chapter>-<workflow>.json`
|
||||
- 采集器 DSL:`web/tools/manual/capture.mjs`(支持
|
||||
`goto/waitFor/click/fill/select/press/clickCanvas/assertText/wait/shot/...`)
|
||||
|
||||
Reference in New Issue
Block a user