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>
5.0 KiB
5.0 KiB
id, order, title, level
| id | order | title | level |
|---|---|---|---|
| ch02 | 2 | Part 图元与布尔 | core |
第 2 章 Part 图元与布尔
学习目标
- 从 Part 菜单创建 Box、Cylinder 等参数化图元。
- 在属性面板改尺寸与 Placement,而不是反复重建对象。
- 用 Cut 做通孔,理解 Base / Tool 与布尔结果的关系。
- 用 CheckGeometry 检查实体有效性,看懂体积、面数、三角面数。
2.1 Part 菜单与工作流
Part 工作台把命令分成九组:Primitives、Solids、Boolean、Split、Compound、 Copy、Join、Feature、Inspection。
初学阶段只走一条主线:图元 → 布尔 → 检查。其余工具等这条主线熟了再展开。
本例要做出一个带通孔的底板:
- 底板:80 × 60 × 20 的 Box,标签
PartBase。 - 圆柱:半径 15、高度 40,标签
Cylinder1,沿 Z 放到-10, 让它从底板下方穿到上方。
2.2 创建与修改图元
- 打开
Part → Primitives → Box,任务面板填Length 80 / Width 60 / Height 20。 - 点“应用尺寸并重算”,把标签改为
PartBase。 - 打开
Part → Primitives → Cylinder。圆柱会以默认参数立即创建。 - 选中
Cylinder1,在属性面板 Data 区把Radius改成 15、Height改成 40。 - 在同面板把 Placement 的 Position 设为
(40, 30, -10)。
为什么 Z 要设成 -10:圆柱高度 40、底面在 -10,顶面就到 +30,
完整穿过厚度 20 的底板。位置不对,布尔结果就是实心块。
图元建好后,尺寸与位置都在属性面板改。重新打开命令只会再建一个新对象。
2.3 布尔 Cut
选中底板和圆柱这两个对象,打开 Part → Boolean → Cut。
Part 会用当前选择(或前两个对象)建立 Cut1,属性面板显示
Operation = Cut、Base = PartBase、Tool = Cylinder1。
检查结果:
| 指标 | 值 | 说明 |
|---|---|---|
| 体积 | 81862.83 mm³ | 小于原始 96000,说明真的挖掉了材料 |
| Faces | 7 | 底板 6 面 + 孔壁 1 面 |
| Triangles | 124 | 显示用的三角面数 |
| 包围盒 | 80 × 60 × 20 mm | 外形没变 |
如果体积仍是 96000,说明圆柱根本没和底板相交:回头检查圆柱的
Height 与 Placement 的 Z。
2.4 检查几何
选中 Cut1,打开 Part → Inspection → Check Geometry,
勾选对象后点“Check shapes”。任务面板列出 BOP 检查结果,有效实体应当没有错误。
布尔做多了容易留下微小自交或开放边,这类问题体积数字看不出来, 只有 CheckGeometry 能发现。养成布尔之后必查的习惯。
2.5 其他 Part 工具速查
| 组 | 命令 | 用途 |
|---|---|---|
| Boolean | Part_Fuse / Part_Common |
并集 / 交集 |
| Split | Part_Slice / Part_SliceApart / Part_XOR |
切片、拆开、异或 |
| Join | Part_JoinConnect / Part_JoinEmbed / Part_JoinCutout |
连接、嵌入、挖槽 |
| Compound | Part_Compound / Part_ExplodeCompound |
合成 / 炸开复合体 |
| Copy | Part_SimpleCopy / Part_TransformedCopy / Part_RefineShape |
复制与清理 |
| Feature | Part_Extrude / Part_Revolve / Part_Loft / Part_Sweep |
拉伸、旋转、放样、扫掠 |
| Dress-up | Part_Fillet / Part_Chamfer |
圆角 / 倒角 |
| Offset | Part_Offset / Part_Offset2D / Part_Thickness |
3D / 2D 偏移、抽壳 |
| Inspection | Part_CheckGeometry / Part_Defeaturing |
几何检查、去特征 |
| 显示 | Part_ColorPerFace / Part_SectionCut |
逐面上色、剖切 |
完整命令与状态见附录命令索引。
自检
- 对象树里有
PartBase、Cylinder1、Cut1三个对象。 Cylinder1的 Radius = 15、Height = 40、Position Z = -10。Cut1体积 81862.83 mm³,不是 96000。Cut1的 Faces = 7、Triangles = 124。- CheckGeometry 报告没有错误。
常见错误
- 圆柱还是默认高度 10 且位于底板下方,Cut 后体积不变。
- 只选中一个对象就执行 Cut,报“需要两个对象”。
- 改了图元尺寸但没重算,布尔用的还是旧形状。
- Cut 的 Base / Tool 选反,得到的孔形与预期相反。
- 做完布尔不检查几何,留下自交问题带到导出环节。
练习
- 把圆柱半径改成 10,观察体积变化,再改回 15。
- 用
Part_Fuse把PartBase与Cylinder1合并,比较与 Cut 的体积差别。 - 用
Part_SimpleCopy复制Cut1,再对副本跑Part_CheckGeometry。 - 把圆柱改成不穿透(Height 10、Z = 0),观察体积与预期是否一致。



