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>
202 lines
12 KiB
Markdown
202 lines
12 KiB
Markdown
---
|
||
id: ch13
|
||
order: 13
|
||
title: Draft、Plot、Robot 等专项工具
|
||
level: specialist
|
||
---
|
||
|
||
# 第 13 章 Draft、Plot、Robot 等专项工具
|
||
|
||
## 能力概览
|
||
|
||
这一章覆盖主线之外的十个专项模块。它们各自解决一类问题,但都不是建模必经路径。
|
||
先看全景表,再按需展开:
|
||
|
||
| 模块 | 能做什么 | 代表命令 | 入口 |
|
||
|---|---|---|---|
|
||
| Draft | 2D 线、圆、矩形、多边形;移动、旋转、阵列、克隆;尺寸标注 | `Draft_Line`、`Draft_Circle`、`Draft_Array`、`Draft_Dimension` | `workbench.html?module=Draft` |
|
||
| Robot | 六轴机器人、关节角、工具坐标系、轨迹 | `Robot_CreateRobot`、`Robot_AddToolShape` | `workbench.html?module=Robot` |
|
||
| Plot | 2D 图表:Figure / Axes / Series | `Plot_Axes`、`plot.pythonFamilyBatch` | `plot-python.html` |
|
||
| Cloud | 云文档保存与恢复(需远程服务) | `cloud.save`、`cloud.restore` | `workbench.html?module=Cloud` |
|
||
| JtReader | JT 格式文件读取 | `JtReader_*` | `workbench.html?module=JtReader` |
|
||
| Sandbox | 实验性自定义工作台 | `Sandbox_*` | `workbench.html?module=Sandbox` |
|
||
| Test | 内核自测入口 | 模块页测试命令 | `test.html` |
|
||
| TemplatePyMod | Python 模块模板与家族 | `templatepymod.*` | `templatepymod-family.html` |
|
||
| Tux | 示例模块 | `tux.*` | `workbench.html?module=Tux` |
|
||
| Show | 显示辅助 | `show.*` | `workbench.html?module=Show` |
|
||
|
||
> **本手册不涉及 OpenSCAD。** Web 端已整体移除该工作台:没有源码、没有注册表条目、
|
||
> 没有产物、也没有测试入口。遇到 `.scad` / `.csg` 文件时按不支持处理,不会回落到
|
||
> 外部 `openscad` 二进制。
|
||
|
||
## 13.1 Robot 机器人
|
||
|
||
`Robot_CreateRobot` 的面板是 Web 端少见的完整多分区面板,一共六组:
|
||
`Robot`(`Refresh / use selection`、`Undo`、`Redo`)、`Frame-relative jog`、
|
||
`Joint angles (degrees)`(`Set Home` / `Move to Home` / `Accept` / `Cancel edits`)、
|
||
`Robot Tool frame`、`World tool-end placement`,以及文档保存分组。
|
||
|
||

|
||
|
||
`Frame-relative jog` 是一整排相对当前坐标系的点动按钮:
|
||
`X− / X+ / Y− / Y+ / Z− / Z+ / A− / A+ / B− / B+ / C− / C+`。
|
||
它们在本页面注册为相对基座坐标系的平移与旋转增量。
|
||
|
||
打开面板时 `Joint angles` 分组显示 `Home: Not set — use Set Home`。
|
||
**点 `Set Home` 与点动按钮都不会更新这行提示**——实测点击后分组文本保持不变,
|
||
说明面板只渲染状态,没有接到可驱动机器人模型上。因此这一章不做"点按钮看姿态变化"
|
||
的演示,只把面板结构讲清楚。
|
||
|
||
`Robot_InsertWaypoint` 会在面板下方追加一个独立分组,里面是
|
||
`Insert waypoint` / `Undo` / `Redo` / `Cancel` / `Refresh` 五个按钮。
|
||
|
||

|
||
|
||
## 13.2 Plot 2D 图表
|
||
|
||
Plot 的顺序是固定的三层结构:Figure(画布)→ Axes(坐标系)→ Series(数据序列)。
|
||
Web 端 `Plot_Axes` 面板把这三层做成分组按钮:
|
||
|
||
| 分组 | 按钮 |
|
||
|---|---|
|
||
| Figure | `New figure`、`Close figure` |
|
||
| Axes | `Add axes`、`Apply axes edit`、`Remove axes and its series` |
|
||
| Presentation | `Apply presentation`、`Reset presentation inputs` |
|
||
| Series | `Remove selected series`、`Add series to active axes` |
|
||
| 导出 | `Download SVG`、`Save SVG to OPFS` |
|
||
|
||

|
||
|
||
点 `New figure` 再点 `Add axes` 之后:
|
||
|
||

|
||
|
||
**实测边界**:这两个按钮点击后页面里既不新增 `<svg>` 也不新增 `<canvas>`,
|
||
画布不会出现在任务面板旁边。所以本章不演示"画一条曲线再导出",
|
||
只列出面板提供的操作。跳层仍然会导致失败:没有 Axes 直接加 Series 会报错,
|
||
因为 Series 必须挂在一个坐标系下。
|
||
|
||
## 13.3 Draft 2D 绘图
|
||
|
||
Draft 在项目页的工作台下拉里可选,命名的意图是先画 2D 轮廓再转实体。
|
||
Web 端 `Draft_Rectangle` 的面板分两组:`Draft_Rectangle`(基点 XYZ、法向 XYZ、
|
||
length / height / face)与 `First corner (world coordinates, mm)`。
|
||
|
||

|
||
|
||
`Draft_Circle` 面板更简单,只有 `center` 与 `normal` 两组 XYZ。
|
||
|
||

|
||
|
||
**实测边界**:把矩形面板的六个数值填成基点 (0,0,0)、length 50、height 30 后,
|
||
面板底部提示仍是 `Pick first corner`——这类 Draft 图元要求先在三维视口里取点,
|
||
而后台壳层页面里没有 `<canvas>`,取不了点。`Draft_Line`、`Draft_Wire`、
|
||
`Draft_Array` 连面板都没有。因此 Draft 在当前 Web 端只能查看参数结构,不能落成几何。
|
||
|
||
要冻结结果请用 `Part_SimpleCopy`(第 2 章)。
|
||
|
||
## 13.4 其余模块与边界
|
||
|
||
- **Cloud**:Save/Restore 需要远程 S3 服务与凭据。**本地 OPFS 不受影响**,日常保存不需要 Cloud。
|
||
- **JtReader**:只读 JT 格式,命令少,按模块页实际暴露的项使用。
|
||
- **Sandbox / Test / Tux / TemplatePyMod / Show**:实验、自测、模板与显示辅助,不作为产品主流程。
|
||
它们存在于内核并有路由,但界面多为单命令探针页,不代表完整的桌面工作台体验。
|
||
|
||
## 边界与注意
|
||
|
||
- 这十个模块的 Web 界面多为**单命令探针页**,不是桌面级的完整工具栏。
|
||
- Robot 面板完整但未接可驱动机器人:关节角提示与点动按钮都不改变状态。
|
||
- Plot 面板完整但不在页面里渲染画布,`Download SVG` 之前没有任何可视化反馈。
|
||
- Draft 图元需要三维视口取点,壳层页面缺 canvas,只能看面板不能成型。
|
||
- Plot 的 Python 家族批处理走 `plot-python.html`,与其他模块的交互方式不同。
|
||
- Cloud 缺少远程服务时命令必然失败,这不是 Web 端缺陷。
|
||
- 本节所有命令都可在附录命令索引里按模块筛选查看状态。
|
||
|
||
## 专项工作台的面板与边界
|
||
|
||
| 工作台 | 界面表面 | 说明 |
|
||
|---|---|---|
|
||
| Draft | 10 项(含 Creation / Modification / Snap 三组工具栏) | 二维绘图与阵列、路径数组;取点依赖三维视口 |
|
||
| Robot | 9 项(关节、轨迹、形状、航点、Kuka 导出) | 机器人工作台可编辑轨迹,但不驱动真实机器人 |
|
||
| Cloud | 1 项(保存 / 恢复) | 远程存储未接入,只有本地 OPFS 传输入口 |
|
||
| Sandbox | 11 项(模型树 MVC、图像叠层、Menger 海绵等) | 实验性工具,命令可用但不保证数据兼容 |
|
||
| Test | 13 项(测试视图、TestTools / My Unittest 工具栏) | 开发自测入口,普通用户可忽略 |
|
||
| TemplatePyMod | 4 项菜单 | Python 模块模板,菜单为静态呈现(见第 16 章注记) |
|
||
| Plot / Show | 各 1 项 | Plot 为命令入口,Show 为显示辅助 |
|
||
|
||
这些工作台的面板数量少、边界多,使用前先确认对应内核能力是否可用;标为边界的命令不要当作功能缺失反复尝试。
|
||
|
||
### 专项工作台实拍
|
||
|
||
`Draft` 模块页(`workbench.html?module=Draft`)给出 `Draft GUI sources`(84 desktop · 4 Web · 6 task panels)与命令矩阵;
|
||
没有文档时不渲染任务面板,所以它只能用来查命令状态:
|
||
|
||

|
||
|
||
Draft 的真实工具栏在 `project.html?workbench=Draft`:`Workbench toolbars` 分四行——
|
||
Draft Creation(Line / Wire / Circle / Rectangle / Polygon…)、Modification(Move / Rotate / Scale / Fillet…)、Utility 与 Snap:
|
||
|
||

|
||
|
||
`Spreadsheet` 的表格在 Web 端是可编辑网格:点 `A1` 后在 `Cell contents` 输入 `=2+2`,点 `Apply`;
|
||
公式栏显示 `=2 + 2`,`A1` 结果为 4。30×8 个单元格全部可编辑,说明公式链路是通的:
|
||
|
||

|
||
|
||
`Import` 模块页显示 `Import GUI sources`(3 desktop · 6 Web · **0 task panels**)与 `import.*` 命令矩阵;
|
||
`Import_Iges` 仅注册、没有 Web 工作流。所以格式导入请走第 7 章的文件工具面板:
|
||
|
||

|
||
|
||
`Surface_Filling` 是曲面填充任务面板:`Ordered edges` / `Non-boundary edges`、`Vertices`、`Optional support face`,
|
||
以及 `Preview` / `Accept` / `Cancel`。无文档时提交会显示 `Error: Part document envelope is invalid`:
|
||
|
||

|
||
|
||
`Points_Import` 打开的是「Merge point clouds」面板:`Document` 选择、`Import point file`、`Open FCStd`、
|
||
`Select Cloud Points` 与显示属性,用于把点云文件合并进当前文档:
|
||
|
||

|
||
|
||
## 自检
|
||
|
||
- [ ] 能说出 Robot、Plot、Draft 各自解决什么问题。
|
||
- [ ] 能说出 Robot 面板的六个分组名,并解释 `Frame-relative jog` 的按钮语义。
|
||
- [ ] 能按 Figure → Axes → Series 的顺序说出三个层级,并知道 Web 端画布不渲染。
|
||
- [ ] 知道 Cloud 需要远程服务、本地 OPFS 不受影响。
|
||
- [ ] 明确知道 Web 端不提供 OpenSCAD。
|
||
|
||
## 常见错误
|
||
|
||
1. 以为点 Robot 的点动按钮能看到姿态变化——Web 端不会,面板未接模型。
|
||
2. 关节角单位混用度与弧度,在桌面版里姿态会完全不对。
|
||
3. Plot 没建 Axes 就加 Series,报错。
|
||
4. 未配置远程存储就点 Cloud Save,失败后误判为 Web 端缺陷。
|
||
5. 以为 `.scad` 文件能像 STEP 一样导入——Web 端不支持。
|
||
|
||
## 练习
|
||
|
||
1. 在 Robot 面板里点 `Set Home`,记录 `Joint angles` 分组的文本有没有变化,把这个结果写进缺口账本。
|
||
2. 在 Plot 面板里依次点 `New figure` 与 `Add axes`,用浏览器元素面板确认有没有新增 `<svg>` 或 `<canvas>`。
|
||
3. 在桌面 FreeCAD 里用 `Draft_Rectangle` + `Draft_Array` 做 3×3 阵列,作为 Web 端的对照基线。
|
||
4. 打开附录命令索引,按 `Cloud` 筛选,确认哪些命令标为边界。
|
||
|
||
## 实测命令数(2026-11-21 冒烟)
|
||
|
||
下表是 Web 构建在各工作台实测渲染出的命令按钮数,取自 `tools/workbench-panels-smoke.mjs`
|
||
(`docs/current/comprehensive-smoke-20260918/panels.json`)。数字用于判断“这个面板到底装了多少东西”,
|
||
不代表全部可用——可否执行仍取决于 worker 与文档状态。
|
||
|
||
| 模块 | 实测命令数 | 模块 | 实测命令数 |
|
||
|---|---:|---|---:|
|
||
| Draft | 50 | Cloud | 15 |
|
||
| Robot | 44 | JtReader | 8 |
|
||
| Plot | 4 | Sandbox | 73 |
|
||
| Show | 12 | Test | 27 |
|
||
| Tux | 2 | TemplatePyMod | 17 |
|
||
| Import | 15 | Measure | 16 |
|
||
| Start | 12 | Help | 4 |
|
||
|
||
> 这些数字会随桌面清单重生成而变化。手册每次构建都会重新统计命令索引;
|
||
> 若上表与附录命令索引冲突,以附录为准。
|