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>
123 lines
5.1 KiB
Markdown
123 lines
5.1 KiB
Markdown
---
|
||
id: ch04
|
||
order: 4
|
||
title: PartDesign 实体建模
|
||
level: core
|
||
---
|
||
|
||
# 第 4 章 PartDesign 实体建模
|
||
|
||
## 学习目标
|
||
|
||
1. 在 PartDesign 页面新建文档与 Body,理解 Body 是特征的容器。
|
||
2. 在 Body 内创建 Sketch,画出封闭轮廓。
|
||
3. 用 Pad 把草图拉伸成实体,理解 Length、Side 与 Reverse 的作用。
|
||
4. 知道 Pocket、Revolution、Hole、Fillet、Pattern 的入口与推荐顺序。
|
||
|
||
## 4.1 PartDesign 页面与 Body
|
||
|
||
Web 版 PartDesign 有独立页面 `/partdesign.html`,提供:
|
||
|
||
- 新建文档 / 新建 Body / 撤销 / 重做 / 保存。
|
||
- 基准对象、克隆、ShapeBinder。
|
||
- 草图工具:矩形、圆形、创建草图、贴附。
|
||
- 基于草图的特征:Pad、Pocket、Hole、Revolution、Groove、Helix、Loft、Pipe。
|
||
- 变换特征:Mirrored、LinearPattern、PolarPattern、Scaled、MultiTransform。
|
||
- 修饰特征:Draft、Thickness、Fillet、Chamfer;以及 Body 之间的布尔运算。
|
||
|
||
第一步永远是**新建文档 → 新建 Body**。之后的草图与特征都挂在当前 Body 下。
|
||
|
||
> 项目页的 Part 文档不能直接切成 PartDesign,需要原生所有权移交。
|
||
> 初学时请直接用 `/partdesign.html`,别在同一文档里混用两种所有者。
|
||
|
||
为什么需要 Body:Body 把一串特征打包成一个连续的实体演化过程。
|
||
Pad 依赖 Sketch,Pocket 依赖 Pad 的面——层级错了,后面的特征找不到父级。
|
||
|
||
## 4.2 创建草图与矩形
|
||
|
||
1. 点“新建文档”,再点“新建 Body”。
|
||
2. 点“创建草图”,默认在 Body 的 XY 平面创建 `Sketch1`。
|
||
3. 点“矩形”,在草图里生成一个封闭矩形轮廓。
|
||
|
||

|
||
|
||
草图必须在 Body 内,**且轮廓封闭**。轮廓有缺口时 Pad 会提示找不到可用 Profile,
|
||
这不是 bug,是草图本身没画完。
|
||
|
||
## 4.3 Pad:把草图拉成实体
|
||
|
||
点“Pad”打开基于草图的特征面板:
|
||
|
||
| 参数 | 本例取值 |
|
||
|---|---|
|
||
| Profile | `Sketch1` |
|
||
| Length | 10 mm |
|
||
| Sides | One side |
|
||
| Mode | Length |
|
||
| Offset | 0 |
|
||
| Taper angle | 0 |
|
||
| Side 2 | 不使用 |
|
||
| Reverse | 不勾选 |
|
||
|
||

|
||
|
||
点“创建 Pad”,Body 内出现 `Pad1`,视口显示拉伸后的实体。
|
||
|
||

|
||
|
||
`Mode` 决定长度的含义:`Length` 是总长,`Up to face` 是切到某个面,
|
||
`Through all` 是穿透全部。选错模式时长度输入框会失效,看着像坏了,其实是模式不对。
|
||
|
||
## 4.4 后续特征的工作顺序
|
||
|
||
PartDesign 的特征在 Body 内按顺序堆叠,顺序决定结果:
|
||
|
||
1. **加料**:Pad / Revolution / AdditivePipe / AdditiveLoft / AdditiveHelix。
|
||
2. **减料**:Pocket / Groove / SubtractivePipe / SubtractiveLoft / SubtractiveHelix。
|
||
3. **孔**:Hole,需要选放置面与孔规格。
|
||
4. **修饰**:Fillet / Chamfer / Draft / Thickness。
|
||
5. **变换**:Mirrored / LinearPattern / PolarPattern / MultiTransform。
|
||
6. **Body 布尔**:Body 之间的 Fuse / Cut / Common。
|
||
|
||
典型练习:在 `Pad1` 顶面新建草图 → 画一个圆 → 用 Pocket 贯穿 → 得到带孔实体。
|
||
|
||
**修饰特征放最后**:先倒角再开孔,倒角边上会被削掉;先开孔再倒角,边缘干净。
|
||
这个顺序错了只能删掉重建。
|
||
|
||
## 4.5 命令速查
|
||
|
||
| 组 | 命令 |
|
||
|---|---|
|
||
| Body / 草图 | `PartDesign_Body`、`PartDesign_NewSketch`、`PartDesign_CompSketches` |
|
||
| 加料 | `PartDesign_Pad`、`PartDesign_Revolution`、`PartDesign_AdditivePipe`、`AdditiveLoft`、`AdditiveHelix` |
|
||
| 减料 | `PartDesign_Pocket`、`PartDesign_Groove`、`SubtractivePipe`、`SubtractiveLoft`、`SubtractiveHelix` |
|
||
| 孔 / 修饰 | `PartDesign_Hole`、`PartDesign_Fillet`、`PartDesign_Chamfer`、`PartDesign_Draft`、`PartDesign_Thickness` |
|
||
| 变换 | `PartDesign_Mirrored`、`LinearPattern`、`PolarPattern`、`MultiTransform`、`Scaled` |
|
||
| 基准 / 引用 | `PartDesign_CompDatums`、`PartDesign_ShapeBinder`、`PartDesign_Clone`、`PartDesign_Boolean` |
|
||
|
||
完整状态见附录命令索引的 PartDesign 模块。
|
||
|
||
## 自检
|
||
|
||
- [ ] 文档里有 `Body1`,其下有 `Sketch1` 与 `Pad1`。
|
||
- [ ] Pad 的 Profile 是 `Sketch1`,Length = 10。
|
||
- [ ] 视口显示封闭实体,不是线框草图。
|
||
- [ ] 能重新打开 Pad 面板改 Length 并重算。
|
||
- [ ] 知道 Pocket 需要自己的草图与 Profile。
|
||
|
||
## 常见错误
|
||
|
||
1. 没新建 Body 就创建草图,特征没有容器。
|
||
2. 草图轮廓不封闭,Pad 找不到 Profile。
|
||
3. Pad 方向反了,实体伸到草图另一侧;勾 Reverse 或改 Side。
|
||
4. 在同一 Body 里跳顺序插特征,父特征被覆盖。
|
||
5. 用项目页的 Part 文档直接切 PartDesign,撞上所有权移交提示。
|
||
6. 先倒角后开孔,倒角被削掉。
|
||
|
||
## 练习
|
||
|
||
1. 把 Pad 的 Length 从 10 改成 20,记录体积与包围盒变化。
|
||
2. 在 `Pad1` 顶面新建草图,画一个圆,用 Pocket 做通孔。
|
||
3. 对一条边做 Fillet,半径 3 mm,再改成 1 mm 比较差异。
|
||
4. 用 `PartDesign_LinearPattern` 把刚才的孔阵列 3 个,间距 15 mm。
|