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>
118 lines
4.4 KiB
Markdown
118 lines
4.4 KiB
Markdown
---
|
||
id: ch05
|
||
order: 5
|
||
title: Assembly 装配
|
||
level: core
|
||
---
|
||
|
||
# 第 5 章 Assembly 装配
|
||
|
||
## 学习目标
|
||
|
||
1. 在 Assembly 工作台创建装配文档。
|
||
2. 从 OPFS 里的 FCStd 源文件插入零件链接,理解链接不等于复制几何。
|
||
3. 认识 Ground、Joint、Solve、Exploded、BOM、Simulation 各自的用途。
|
||
4. 能判断装配失败是源文件、链接还是求解器的问题。
|
||
|
||
## 5.1 创建装配文档
|
||
|
||
打开 Assembly 工作台:
|
||
|
||
`workbench.html?module=Assembly&command=Assembly_CreateAssembly`
|
||
|
||
在“Assembly document”任务里填:
|
||
|
||
| 参数 | 本例取值 |
|
||
|---|---|
|
||
| Assembly document name | `ManualAssembly` |
|
||
| Assembly label | `手动装配` |
|
||
|
||
点 Create。装配文档与零件文档是**分开保存**的:装配里存的是链接与关节,
|
||
而不是零件几何的副本。所以改零件,装配才会跟着变。
|
||
|
||

|
||
|
||
## 5.2 插入零件链接
|
||
|
||
创建后自动进入 Insert Link 任务:
|
||
|
||
1. Source 选 OPFS 里的 `manual-assembly-source.FCStd`。
|
||
2. 点“Load source”,读取出源文件里的对象列表。
|
||
3. Object 选 `CabinetA_P01`,点 Insert。
|
||
4. 再选 `CabinetA_P02`,点 Insert。
|
||
5. 需要时设置 Position 的 X / Y / Z;Rigid link 表示刚性链接(不产生相对运动)。
|
||
6. 点 Accept 完成。
|
||
|
||

|
||
|
||
插入成功后列表显示:
|
||
|
||
```
|
||
CabinetA_P01 → Component (manual_assembly_source/Box)
|
||
CabinetA_P02 → Component001 (manual_assembly_source/Box001)
|
||
```
|
||
|
||
> **前提**:源文件必须已经在 OPFS 里。Web 版不能用本地绝对路径引用外部 FCStd,
|
||
> 所以要先把零件保存到 OPFS,再来插链接。
|
||
|
||
## 5.3 装配结果
|
||
|
||
Accept 之后,Assemblies 面板出现 `ManualAssembly`,其下是组件链接。
|
||
双击组件可以激活或编辑;链接与源文档保持关联,源文件变了装配会提示更新。
|
||
|
||

|
||
|
||
## 5.4 关节与求解
|
||
|
||
| 命令 | 用途 |
|
||
|---|---|
|
||
| `Assembly_ToggleGrounded` | 固定一个组件作为基准 |
|
||
| `Assembly_CreateJointFixed` | 固定关节 |
|
||
| `Assembly_CreateJointRevolute` | 旋转关节 |
|
||
| `Assembly_CreateJointSlider` | 滑动关节 |
|
||
| `Assembly_CreateJointBall` | 球关节 |
|
||
| `Assembly_CreateJointDistance` | 距离关节 |
|
||
| `Assembly_CreateJointAngle` | 角度关节 |
|
||
| `Assembly_CreateJointGears` / `Belt` / `RackPinion` / `Screw` | 齿轮 / 带 / 齿条 / 丝杠 |
|
||
| `Assembly_SolveAssembly` | 求解当前关节约束 |
|
||
| `Assembly_CreateView` | 爆炸视图 |
|
||
| `Assembly_CreateBom` | BOM 物料清单 |
|
||
| `Assembly_CreateSimulation` | 运动仿真 |
|
||
| `Assembly_ExportASMT` | 导出装配 |
|
||
|
||
典型顺序:**插入组件 → Ground 基准件 → 建关节(选两个组件与子元素)→ Solve →
|
||
读 Solver messages → 爆炸 / BOM / 仿真 → 导出**。
|
||
|
||
先 Ground 再建关节这一点很关键。没有固定件的装配,求解器会把所有组件一起漂移,
|
||
看起来像关节建错了。
|
||
|
||
## 边界与注意
|
||
|
||
- 源文件不在 OPFS 时 Source 下拉框是空的,先回去保存零件。
|
||
- 关节需要两个组件加各自的子元素(面、边、点),只有一个组件建不成。
|
||
- 改源文件后要更新链接,否则装配里还是旧几何。
|
||
- 装配文档不复制几何,所以单独拷走装配文件拿不到零件。
|
||
|
||
## 自检
|
||
|
||
- [ ] Assemblies 面板里有 `ManualAssembly`。
|
||
- [ ] Insert Link 列表里有 2 条链接。
|
||
- [ ] 源文件显示为 `manual-assembly-source.FCStd`。
|
||
- [ ] 能打开 Joint 面板并看到 Component 1 / 2 与 Subelement。
|
||
- [ ] Solve 后 Solver messages 没有 malformed 或 redundant 错误。
|
||
|
||
## 常见错误
|
||
|
||
1. 源文件不在 OPFS,Source 下拉框为空。
|
||
2. 只插入一个组件就建关节,缺少配对对象。
|
||
3. 重复点 Insert,产生重复链接。
|
||
4. 没 Ground 就 Solve,整个装配漂移。
|
||
5. 改了源文件但没更新链接,装配仍显示旧几何。
|
||
|
||
## 练习
|
||
|
||
1. 插入第三个组件 `CabinetA_P03`。
|
||
2. 把 `CabinetA_P01` 设为 Ground,再建一个 Fixed 关节连接 P01 与 P02。
|
||
3. 点 Solve,记录 Solver messages 里的 dof 与错误数量。
|
||
4. 建一个 Revolute 关节,改变角度后观察组件是否绕轴旋转。
|