Interface design document and manual now share one authoritative surface inventory (333 surfaces across 9 categories, gap 0), and every chapter carries real Playwright screenshots of the panels it documents. - tools/fcweb: ui-surface-scan/ui-surface-inventory (deterministic --check), build-ui-doc renders panel catalog, workbench matrix and mapping tables; blank toolbar crops (<1 KB) are skipped and pruned instead of embedded - web/tools/manual: generate-panel-index (ch16), audit-ui-gaps, generate-final-status, generate-gaps-doc; pager is per-chapter so the manual no longer overflows horizontally - manual: 130 screenshot references / 128 PNGs, panel sections for ch02-ch13 - web/src: utility menus stop click propagation (menu reopened on item click); workbench shell gains an OPFS document picker so workbench.html can bind a real document instead of the fixed workbench-document id; Sketcher panel moves from the command column to the main stage Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
153 lines
8.8 KiB
Markdown
153 lines
8.8 KiB
Markdown
---
|
||
id: ch11
|
||
order: 11
|
||
title: TechDraw 工程图
|
||
level: specialist
|
||
---
|
||
|
||
# 第 11 章 TechDraw 工程图
|
||
|
||
## 能力概览
|
||
|
||
TechDraw 把三维模型投影成二维工程图:页面、视图、标注、导出四段。
|
||
工程图是有标准的交付物,与截图不是一回事。
|
||
|
||
| 类别 | 命令 |
|
||
|---|---|
|
||
| 页面 | `TechDraw_PageDefault`、`TechDraw_PageTemplate` |
|
||
| 视图 | `TechDraw_View`、`ProjectionGroup`、`SectionView`、`DetailView` |
|
||
| 标注 | `TechDraw_Dimension`、`Balloon`、`LeaderLine`、`WeldSymbol`、`SurfaceFinishSymbols` |
|
||
| 填充 | `TechDraw_Hatch`、`GeometricHatch` |
|
||
| 导出 | `TechDraw_ExportPageSVG`、`ExportPageDXF` |
|
||
| 其他 | `ArchView`、`DraftView`、`ActiveView`、`PrintAll` |
|
||
|
||

|
||
|
||
模块页左侧是 31 个 Web 模块的清单,右侧按命令分组列出页面、视图、标注与导出。
|
||
注意"命令出现"不等于"命令可执行",本章 11.2 会逐条给出实测结果。
|
||
|
||
## 11.1 出图工作流(标准顺序,桌面版)
|
||
|
||
下面这条链路是 TechDraw 的标准顺序,Web 端目前只能走到第 3 步之前,
|
||
每一步后面都标注了 Web 实测结果。
|
||
|
||
1. 先准备好实体模型(来自第 2 章 Part 或第 4 章 PartDesign)。
|
||
2. 新建页面:`TechDraw_PageDefault` 生成 A4 页,横向或纵向在属性里改。
|
||
3. 插入视图:`TechDraw_View` 选模型;需要一次出多个视图时用 `ProjectionGroup`。
|
||
4. 加剖视与局部放大:`SectionView`(剖切面 + 方向)、`DetailView`(圈选区域)。
|
||
5. 标注:`TechDraw_Dimension` 标尺寸,`Balloon` 标零件序号,
|
||
`SurfaceFinishSymbols` 标粗糙度,`WeldSymbol` 标焊缝。
|
||
6. 导出 `SVG` 或 `DXF`,或直接打印。
|
||
|
||
视图比例、投影方向、线型都由页面属性控制;改属性后要重新计算才刷新。
|
||
|
||
## 11.2 视图命令面板长什么样
|
||
|
||
`TechDraw_View` 在 Web 端有完整参数面板,字段与桌面一致:
|
||
投影页面、投影源对象、投影方向(X/Y/Z)、水平轴方向、投影比例、投影位置。
|
||
|
||

|
||
|
||
面板能填、能提交,这点与"只有灰按钮"的模块不同。真正的问题是提交之后拿不到文档,
|
||
下一节给出实测证据。
|
||
|
||

|
||
|
||
`SectionView` 的面板同样完整:剖切法向(Section normal)三个分量、页面选择
|
||
(Page / Automatic / Custom)、以及 `Use Selection` 直接从选中对象取剖切面。
|
||
|
||

|
||
|
||
## 11.3 当前 Web 边界
|
||
|
||
**这一章在 Web 端目前不能完整出图**,必须如实说明:
|
||
|
||
- **页面建不出来**:`TechDraw_PageDefault` 的面板里只有 `Image Hatch` 与
|
||
`Geometric Hatch` 两个按钮,没有"新建页面"入口。页面是出图的根对象,
|
||
没有页面,视图、标注、导出全都无从挂载。
|
||
- **视图提交拿不到文档**:在 `TechDraw_View` 里填好投影方向点"创建视图",
|
||
返回文本是 `invalid_request: Select source objects in the current document`。
|
||
面板能收到参数,但页面 Worker 里没有它要的源对象文档——**页面 Worker 与文档
|
||
Worker 之间没有桥**。
|
||
- 目前看到的 SVG 是渲染回退产物,**不是 TechDraw 的正式输出**,不能当图纸交付。
|
||
- 因此本手册把 Web 端 TechDraw 出图标为**边界**,模块页出现命令不等于命令可用。
|
||
|
||
如果需要正式工程图,现阶段请在桌面 FreeCAD 完成,再回到 Web 端继续其他工作。
|
||
|
||
## TechDraw 面板与标注工具
|
||
|
||
TechDraw 在 Web 端有 15 个任务面板与 10 组工具栏,按制图顺序分为三段:
|
||
|
||
| 阶段 | 面板 / 工具栏 | 用途 |
|
||
|---|---|---|
|
||
| 出图 | 投影组(Projection Group)、截面(Section)、复杂截面 | 从三维模型生成主视图、投影视图与剖视 |
|
||
| 标注 | 尺寸(Dimension)、尺寸修复(Dimension Repair)、引线(Leader Line)、球标(Balloon) | 线性/角度尺寸、失效尺寸修复、注释与零件序号 |
|
||
| 细节 | 中心线(Edit Centerline)、剖面线(Geometric / Image Hatch)、表面粗糙度、焊接符号、线型装饰 | 制图规范细节 |
|
||
|
||
页面、模板与图框由 TechDraw 主页面的页面面板管理;模板文字(Template text)面板用于填写标题栏。尺寸与标注都绑定到投影视图的几何上,改模型后需要刷新视图再检查是否有失效尺寸——失效项可以用 Dimension Repair 批量处理。
|
||
|
||
注意 Web 端的跨 Worker 文档桥存在边界:`TechDraw_PageDefault` 在页面 Worker 未持有目标文档时会报 Document does not exist,此时应先在当前文档内创建页面再取默认模板,不要依赖跨 Worker 调用。
|
||
|
||
完整 39 项表面见第 16 章。
|
||
|
||
### 五个 TechDraw 面板实拍
|
||
|
||
`TechDraw_PageDefault` 打开的是 Drawing page stacking 面板:`Fill Template Fields`、`View frames`、
|
||
`Redraw` / `Export SVG` / `Export PDF` / `Export DXF`、`Print All`、`Keep Updated`,以及 `Hatches` 填充组:
|
||
|
||

|
||
|
||
`TechDraw_View` 的字段区标题是「工程图视图」,共 7 个字段:页面、源对象、`投影方向 X/Y/Z`、水平轴方向、`投影比例`、位置 X / Y,
|
||
底部是「创建视图」与「取消」:
|
||
|
||

|
||
|
||
「创建视图」之后并不会生成视图,而是撞上跨 Worker 边界:底部返回 `invalid request: Select source objects in the current document`,
|
||
诊断 JSON 里的 `capabilityId` 是 `TechDraw.desktop:TechDraw_View`。这条错误说明当前文档里没有可投影的源对象,
|
||
需要先在同一个 Worker 持有的文档里建几何:
|
||
|
||

|
||
|
||
`TechDraw_SectionView` 是剖视面板(`TechDraw Section View task`):`Base view` / `section profile`、
|
||
`Section normal`(默认 0,0,1)、`Section origin`,以及 `Set View Direction` 的 Up / Down / Left / Right:
|
||
|
||

|
||
|
||
`TechDraw_ProjectionGroup` 打开的是 `Projection Group` 面板,但 `Use current selection` 处于禁用,
|
||
状态栏显示 `restricted: command is not runnable`——这条命令在 Web 端只到面板层,未接执行:
|
||
|
||

|
||
|
||
这五个页面都通过 `workbench.html?module=TechDraw&command=<命令>` 直接打开,面板结构完整;
|
||
能否真正生成页面仍取决于跨 Worker 文档前置(见上一段的边界说明)。
|
||
|
||
**实测缺口**:`TechDraw_Dimension` 与 `TechDraw_Annotation` 完全不渲染任务面板;
|
||
`TechDraw_Balloon` 只有禁用的 `Load selection` 初始态。这三条属命令未接面板,不要按「面板加载慢」反复重试。
|
||
|
||
## 边界与注意
|
||
|
||
- 跨 Worker 文档桥缺失是内核级边界,改界面修不好。
|
||
- 不要把视口截图或 SVG 回退当成工程图:它们没有视图投影、没有尺寸标注体系。
|
||
- 模块页的命令清单来自命令矩阵,包含尚未接通执行通道的条目。
|
||
|
||
## 自检
|
||
|
||
- [ ] 能说出页面、视图、标注、导出四类各一个命令。
|
||
- [ ] 能指出 `TechDraw_View` 面板的 7 个字段,并说出提交后返回什么错误。
|
||
- [ ] 能解释 TechDraw 跨 Worker 边界具体卡在哪里。
|
||
- [ ] 能区分 TechDraw 正式图纸与普通 SVG 截图。
|
||
- [ ] 知道桌面版与 Web 版当前的出图能力差异。
|
||
|
||
## 常见错误
|
||
|
||
1. 把 SVG 截图或视口截图当工程图交付。
|
||
2. 没有准备模型就先建页面。
|
||
3. 认为模块页出现命令就等于功能可用。
|
||
4. 忽略 `invalid_request: Select source objects in the current document`,以为重试几次就能成功。
|
||
|
||
## 练习
|
||
|
||
1. 在桌面 FreeCAD 完成一次三视图 + 尺寸标注,作为对照基线。
|
||
2. 在 Web 模块页打开 TechDraw,记录哪些命令失败、错误文本是什么。
|
||
3. 把对照结果写进 `web/manual/data/gap-ledger.json` 的边界条目。
|