Add Part chapter with verified boolean and geometry captures

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
2026-11-13 11:23:18 +08:00
parent bc40c77153
commit 6a7efb5432
17 changed files with 669 additions and 13 deletions

View File

@@ -25,9 +25,14 @@
搜索 `Part_Box` 命中 4 条;命令索引 1602 行。
- `package.json` 增加 `manual:features` / `build:manual` / `check:manual`。
- 第 2 章 Part:`content/ch02-part.md` + `scenarios/ch02-part.json`;
4 张截图(图元、Cut 通孔、CheckGeometry、结果);断言 Cylinder R15/H40/Z-10、
Cut 体积 81862.83 mm³、7 面/124 三角面;fixture 已保存。
- 手册当前 2 章、10 张图、1602 条命令;桌面/移动 0 错误、0 破图、0 溢出。
## 真实残余
- 只完成第 1 章;第 0、2–15 章正文与截图未开始。
- 第 0、3–15 章正文与截图未开始(第 1、2 章已完成)。
- 边界只按精确命令匹配 3 条;需补 Fem/CAM/Cloud/Import 的模块级边界与桌面入口。
- 已验证状态(verified)尚未接入:当前 status 只有 detailed/overview/boundary;
截图断言通过后需回写矩阵与徽章。
@@ -37,8 +42,8 @@
## 下一步精确入口
1. 第 2 章:`content/ch02-part.md` + `scenarios/ch02-part.json`;
覆盖 Box/Cylinder/Boolean/Extrude/Revolve/Loft/Sweep/Fillet/Chamfer/Compound。
1. 第 3 章 Sketcher:`content/ch03-sketcher.md` + `scenarios/ch03-sketcher.json`;
覆盖线/矩形/圆/弧、约束、尺寸、ValidateSketch;再补第 0 章启动/OPFS 导读。
2. 边界补录:`generate-features.mjs` 的 `boundaries` 增加
Fem 原生对象、CAM 其余受限命令、Import_Gltf、Cloud、Material;
同步 `web/docs/current/web-freecad-manual-gaps.md`。

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 KiB

View File

@@ -0,0 +1,100 @@
---
id: ch02
order: 2
title: Part 图元与布尔
level: core
---
# 第 2 章 Part 图元与布尔
## 学习目标
- 从 Part 菜单创建 Box、Cylinder 等参数化图元。
- 在属性面板修改尺寸与 Placement,而不是反复重建对象。
- 用 Cut 做通孔,理解 Base/Tool 与布尔结果。
- 用 CheckGeometry 检查实体有效性,并看懂体积、面数、三角面数。
## 2.1 Part 菜单与工作流
Part 工作台把命令分成九组:Primitives、Solids、Boolean、Split、Compound、Copy、
Join、Feature、Inspection。初学者先掌握“图元 → 布尔 → 检查”这条主线。
![Part 工作台:菜单、对象树、属性面板与视口](./manual-assets/ch02/part-primitives-boolean/01-primitives.png)
本例先建一个 80 × 60 × 20 的 Box(标签 `PartBase`),再建一个半径 15、高度 40 的
Cylinder(`Cylinder1`),把圆柱沿 Z 放到 `-10`,让它从底板下方穿到上方。
## 2.2 创建与修改图元
1. 打开 `Part → Primitives → Box`,任务面板填 Length/Width/Height。
2. 点“应用尺寸并重算”,把标签改为 `PartBase`。
3. 打开 `Part → Primitives → Cylinder`。圆柱会立即以默认参数创建。
4. 选中 `Cylinder1`,在属性面板的 Data 区把 `Radius` 改为 15、`Height` 改为 40。
5. 用 Placement 把 Position 设为 `(40, 30, -10)`。
> 图元创建后,尺寸与位置都在属性面板里改;重新打开命令只会再建一个新对象。
## 2.3 布尔 Cut
选中底板和圆柱后,打开 `Part → Boolean → Cut`。Part 会用当前选择(或前两个对象)
自动建立 `Cut1`,属性面板显示 Operation=Cut、Base=`PartBase`、Tool=`Cylinder1`。
![Cut 结果:通孔、体积 81862.8 mm³、7 个面、124 个三角面](./manual-assets/ch02/part-primitives-boolean/02-boolean-cut.png)
检查结果:
| 指标 | 值 |
|---|---|
| 体积 | 81862.83 mm³(= 96000 − 圆柱穿过部分) |
| Faces | 7 |
| Triangles | 124 |
| 包围盒 | 80 × 60 × 20 mm |
如果体积仍等于 96000,说明圆柱没有与底板相交:检查圆柱的高度与 Z 位置。
## 2.4 检查几何
选中 `Cut1`,打开 `Part → Inspection → Check Geometry`,勾选对象后点 “Check shapes”。
任务面板会列出 BOP 检查结果;有效实体应没有错误。
![CheckGeometry 任务:选择 Cut1 并执行检查](./manual-assets/ch02/part-primitives-boolean/03-check-geometry.png)
![检查后的结果视图](./manual-assets/ch02/part-primitives-boolean/04-result.png)
## 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 三个对象。
- [ ] Cylinder 的 Radius=15、Height=40,Position Z=-10。
- [ ] Cut1 体积约 81862.83 mm³,不是 96000。
- [ ] Cut1 的 Faces=7,Triangles=124。
- [ ] CheckGeometry 没有错误。
## 常见错误
1. 圆柱高度仍为默认 10、且位于底板下方,Cut 体积不变。
2. 只选中一个对象就执行 Cut,得到 “select two objects”。
3. 修改图元后没有重算,布尔仍用旧形状。
4. 把 Cut 的 Base/Tool 选反,得到相反的孔形。
## 练习
1. 把圆柱半径改为 10,观察体积变化,再恢复 15。
2. 用 `Part_Fuse` 把 PartBase 与 Cylinder1 合并,比较与 Cut 的差别。
3. 复制 Cut1(`Part_SimpleCopy`),再用 `Part_CheckGeometry` 检查副本。

View File

@@ -0,0 +1,314 @@
{
"schema": "freecad-web-manual/capture/v1",
"generatedAt": "2026-11-13T03:21:43.209Z",
"chapter": "ch02",
"workflow": "part-primitives-boolean",
"scenario": "manual/scenarios/ch02-part.json",
"origin": "http://127.0.0.1:5181",
"ok": true,
"trace": [
{
"at": "2026-11-13T03:21:19.724Z",
"action": "goto",
"url": "/project.html?workbench=Part"
},
{
"at": "2026-11-13T03:21:20.778Z",
"action": "waitFor",
"selector": "select[aria-label=\"Workbench\"]",
"text": null
},
{
"at": "2026-11-13T03:21:22.653Z",
"action": "click",
"selector": "nav[aria-label=\"Application menus\"] details"
},
{
"at": "2026-11-13T03:21:22.815Z",
"action": "click",
"selector": "新建 Document"
},
{
"at": "2026-11-13T03:21:24.818Z",
"action": "eval"
},
{
"at": "2026-11-13T03:21:24.903Z",
"action": "click",
"selector": ".part-menu > summary"
},
{
"at": "2026-11-13T03:21:25.298Z",
"action": "click",
"selector": "details.part-submenu"
},
{
"at": "2026-11-13T03:21:25.606Z",
"action": "click",
"selector": "button[data-command=\"Part_Box\"]"
},
{
"at": "2026-11-13T03:21:26.539Z",
"action": "click",
"selector": ".fc-tree-text"
},
{
"at": "2026-11-13T03:21:26.564Z",
"action": "fill",
"selector": "input[aria-label=\"Length\"]",
"value": 80
},
{
"at": "2026-11-13T03:21:26.588Z",
"action": "fill",
"selector": "input[aria-label=\"Width\"]",
"value": 60
},
{
"at": "2026-11-13T03:21:26.602Z",
"action": "fill",
"selector": "input[aria-label=\"Height\"]",
"value": 20
},
{
"at": "2026-11-13T03:21:26.721Z",
"action": "click",
"selector": "应用尺寸并重算"
},
{
"at": "2026-11-13T03:21:27.974Z",
"action": "click",
"selector": "Close task / Cancel"
},
{
"at": "2026-11-13T03:21:28.040Z",
"action": "click",
"selector": ".fc-tree-text"
},
{
"at": "2026-11-13T03:21:28.062Z",
"action": "fill",
"selector": "input[aria-label=\"Object Label\"]",
"value": "PartBase"
},
{
"at": "2026-11-13T03:21:28.070Z",
"action": "press",
"key": "Enter"
},
{
"at": "2026-11-13T03:21:28.699Z",
"action": "click",
"selector": ".part-menu > summary"
},
{
"at": "2026-11-13T03:21:28.989Z",
"action": "click",
"selector": "details.part-submenu"
},
{
"at": "2026-11-13T03:21:29.275Z",
"action": "click",
"selector": "button[data-command=\"Part_Cylinder\"]"
},
{
"at": "2026-11-13T03:21:30.703Z",
"action": "click",
"selector": ".fc-tree-text"
},
{
"at": "2026-11-13T03:21:31.121Z",
"action": "fill",
"selector": "input[aria-label=\"Property Radius\"]",
"value": 15
},
{
"at": "2026-11-13T03:21:31.148Z",
"action": "press",
"key": "Tab"
},
{
"at": "2026-11-13T03:21:32.062Z",
"action": "fill",
"selector": "input[aria-label=\"Property Height\"]",
"value": 40
},
{
"at": "2026-11-13T03:21:32.081Z",
"action": "press",
"key": "Tab"
},
{
"at": "2026-11-13T03:21:33.285Z",
"action": "assertValue",
"selector": "input[aria-label=\"Property Radius\"]",
"value": "15"
},
{
"at": "2026-11-13T03:21:33.288Z",
"action": "assertValue",
"selector": "input[aria-label=\"Property Height\"]",
"value": "40"
},
{
"at": "2026-11-13T03:21:33.297Z",
"action": "click",
"selector": "Close task / Cancel"
},
{
"at": "2026-11-13T03:21:33.316Z",
"action": "fill",
"selector": "input[aria-label=\"Object Label\"]",
"value": "PartHole"
},
{
"at": "2026-11-13T03:21:33.323Z",
"action": "press",
"key": "Enter"
},
{
"at": "2026-11-13T03:21:33.892Z",
"action": "click",
"selector": "Position"
},
{
"at": "2026-11-13T03:21:34.063Z",
"action": "fill",
"selector": "input[aria-label=\"Position X\"]",
"value": 40
},
{
"at": "2026-11-13T03:21:34.085Z",
"action": "fill",
"selector": "input[aria-label=\"Position Y\"]",
"value": 30
},
{
"at": "2026-11-13T03:21:34.105Z",
"action": "fill",
"selector": "input[aria-label=\"Position Z\"]",
"value": -10
},
{
"at": "2026-11-13T03:21:34.194Z",
"action": "click",
"selector": "应用位置与旋转"
},
{
"at": "2026-11-13T03:21:35.241Z",
"action": "click",
"selector": "Close task / Cancel"
},
{
"at": "2026-11-13T03:21:35.555Z",
"action": "shot",
"name": "01-primitives",
"bytes": 226412
},
{
"at": "2026-11-13T03:21:35.605Z",
"action": "click",
"selector": ".part-menu > summary"
},
{
"at": "2026-11-13T03:21:35.887Z",
"action": "click",
"selector": "details.part-submenu"
},
{
"at": "2026-11-13T03:21:36.180Z",
"action": "click",
"selector": "button[data-command=\"Part_Cut\"]"
},
{
"at": "2026-11-13T03:21:38.389Z",
"action": "click",
"selector": "Close task / Cancel"
},
{
"at": "2026-11-13T03:21:38.393Z",
"action": "assertVisible",
"selector": ".fc-tree-text:has-text(\"Cut\")"
},
{
"at": "2026-11-13T03:21:38.570Z",
"action": "shot",
"name": "02-boolean-cut",
"bytes": 222860
},
{
"at": "2026-11-13T03:21:38.652Z",
"action": "click",
"selector": ".fc-tree-text"
},
{
"at": "2026-11-13T03:21:38.653Z",
"action": "eval"
},
{
"at": "2026-11-13T03:21:39.686Z",
"action": "click",
"selector": "button[data-command=\"Part_CheckGeometry\"]"
},
{
"at": "2026-11-13T03:21:40.919Z",
"action": "shot",
"name": "03-check-geometry",
"bytes": 244203
},
{
"at": "2026-11-13T03:21:41.014Z",
"action": "click",
"selector": "Close task / Cancel"
},
{
"at": "2026-11-13T03:21:41.245Z",
"action": "shot",
"name": "04-result",
"bytes": 224664
},
{
"at": "2026-11-13T03:21:43.209Z",
"action": "save",
"name": "web_project_document_3.FCStd",
"bytes": 5026,
"status": "Saved web_project_document_3.FCStd to OPFS (5026 bytes)"
}
],
"shots": [
{
"id": "ch02/part-primitives-boolean/01-primitives",
"file": "manual/assets/ch02/part-primitives-boolean/01-primitives.png",
"bytes": 226412,
"sha256": "10a819e0bf885dbe881601246e422b28450ca8ffd5880d575177e70e0ea670f3",
"fullPage": true,
"selector": null
},
{
"id": "ch02/part-primitives-boolean/02-boolean-cut",
"file": "manual/assets/ch02/part-primitives-boolean/02-boolean-cut.png",
"bytes": 222860,
"sha256": "f5dd55dcff3545363fc83838f05c4285927d6cddedbe54ca9168b486187bd8b1",
"fullPage": true,
"selector": null
},
{
"id": "ch02/part-primitives-boolean/03-check-geometry",
"file": "manual/assets/ch02/part-primitives-boolean/03-check-geometry.png",
"bytes": 244203,
"sha256": "f6773dfc61eeabd9c7b464845c0ca10b07b9a940cbf6a3d9787c7c601bcc6959",
"fullPage": true,
"selector": null
},
{
"id": "ch02/part-primitives-boolean/04-result",
"file": "manual/assets/ch02/part-primitives-boolean/04-result.png",
"bytes": 224664,
"sha256": "89598c30b8f23317adf0c37c6bd84a481112dfe62af3984ee43665a0232f7e4b",
"fullPage": true,
"selector": null
}
],
"pageErrors": [],
"consoleErrors": []
}

View File

@@ -1,6 +1,6 @@
{
"schema": "freecad-web-manual/page-check/v1",
"generatedAt": "2026-11-13T03:11:58.755Z",
"generatedAt": "2026-11-13T03:22:53.181Z",
"url": "http://127.0.0.1:5190/manual.html",
"viewports": [
{
@@ -12,13 +12,13 @@
"errors": [],
"failed": [],
"searchHits": 4,
"chapters": 1,
"sections": 10,
"images": 6,
"chapters": 2,
"sections": 19,
"images": 10,
"brokenImages": [],
"commandRows": 1602,
"overflow": 0,
"searchSize": 1613
"searchSize": 1623
},
{
"viewport": {
@@ -29,13 +29,13 @@
"errors": [],
"failed": [],
"searchHits": 4,
"chapters": 1,
"sections": 10,
"images": 6,
"chapters": 2,
"sections": 19,
"images": 10,
"brokenImages": [],
"commandRows": 1602,
"overflow": 0,
"searchSize": 1613
"searchSize": 1623
}
],
"ok": true

Binary file not shown.

View File

@@ -0,0 +1,82 @@
{
"schema": "freecad-web-manual/scenario/v1",
"chapter": "ch02",
"workflow": "part-primitives-boolean",
"title": "Part 图元、布尔与检查",
"actions": [
{ "type": "goto", "url": "/project.html?workbench=Part" },
{ "type": "waitFor", "selector": "select[aria-label=\"Workbench\"]" },
{ "type": "wait", "ms": 1000 },
{ "type": "click", "selector": "nav[aria-label=\"Application menus\"] details", "hasText": "File", "target": ":scope > summary" },
{ "type": "click", "role": "button", "name": "新建 Document", "exact": true },
{ "type": "wait", "ms": 2000 },
{ "type": "eval", "script": "for (const d of document.querySelectorAll('nav[aria-label=\"Application menus\"] details[open]')) d.open = false" },
{ "type": "click", "selector": ".part-menu > summary" },
{ "type": "wait", "ms": 250 },
{ "type": "click", "selector": "details.part-submenu", "hasText": "Primitives", "target": ":scope > summary" },
{ "type": "wait", "ms": 250 },
{ "type": "click", "selector": "button[data-command=\"Part_Box\"]" },
{ "type": "wait", "ms": 900 },
{ "type": "click", "selector": ".fc-tree-text", "hasText": "Cube" },
{ "type": "fill", "selector": "input[aria-label=\"Length\"]", "value": 80 },
{ "type": "fill", "selector": "input[aria-label=\"Width\"]", "value": 60 },
{ "type": "fill", "selector": "input[aria-label=\"Height\"]", "value": 20 },
{ "type": "click", "role": "button", "name": "应用尺寸并重算", "exact": true },
{ "type": "wait", "ms": 1200 },
{ "type": "click", "role": "button", "name": "Close task / Cancel", "exact": true },
{ "type": "click", "selector": ".fc-tree-text", "hasText": "Cube" },
{ "type": "fill", "selector": "input[aria-label=\"Object Label\"]", "value": "PartBase" },
{ "type": "press", "key": "Enter" },
{ "type": "wait", "ms": 600 },
{ "type": "click", "selector": ".part-menu > summary" },
{ "type": "wait", "ms": 250 },
{ "type": "click", "selector": "details.part-submenu", "hasText": "Primitives", "target": ":scope > summary" },
{ "type": "wait", "ms": 250 },
{ "type": "click", "selector": "button[data-command=\"Part_Cylinder\"]" },
{ "type": "wait", "ms": 1400 },
{ "type": "click", "selector": ".fc-tree-text", "hasText": "Cylinder" },
{ "type": "wait", "ms": 400 },
{ "type": "fill", "selector": "input[aria-label=\"Property Radius\"]", "value": 15 },
{ "type": "press", "key": "Tab" },
{ "type": "wait", "ms": 900 },
{ "type": "fill", "selector": "input[aria-label=\"Property Height\"]", "value": 40 },
{ "type": "press", "key": "Tab" },
{ "type": "wait", "ms": 1200 },
{ "type": "assertValue", "selector": "input[aria-label=\"Property Radius\"]", "value": 15 },
{ "type": "assertValue", "selector": "input[aria-label=\"Property Height\"]", "value": 40 },
{ "type": "click", "role": "button", "name": "Close task / Cancel", "exact": true, "optional": true },
{ "type": "fill", "selector": "input[aria-label=\"Object Label\"]", "value": "PartHole" },
{ "type": "press", "key": "Enter" },
{ "type": "wait", "ms": 500 },
{ "type": "click", "role": "button", "name": "Position", "exact": true },
{ "type": "fill", "selector": "input[aria-label=\"Position X\"]", "value": 40 },
{ "type": "fill", "selector": "input[aria-label=\"Position Y\"]", "value": 30 },
{ "type": "fill", "selector": "input[aria-label=\"Position Z\"]", "value": -10 },
{ "type": "click", "role": "button", "name": "应用位置与旋转", "exact": true },
{ "type": "wait", "ms": 1000 },
{ "type": "click", "role": "button", "name": "Close task / Cancel", "exact": true },
{ "type": "shot", "name": "01-primitives", "fullPage": true },
{ "type": "click", "selector": ".part-menu > summary" },
{ "type": "wait", "ms": 250 },
{ "type": "click", "selector": "details.part-submenu", "hasText": "Boolean", "target": ":scope > summary" },
{ "type": "wait", "ms": 250 },
{ "type": "click", "selector": "button[data-command=\"Part_Cut\"]" },
{ "type": "wait", "ms": 2200 },
{ "type": "click", "role": "button", "name": "Close task / Cancel", "exact": true, "optional": true },
{ "type": "assertVisible", "selector": ".fc-tree-text:has-text(\"Cut\")" },
{ "type": "shot", "name": "02-boolean-cut", "fullPage": true },
{ "type": "click", "selector": ".fc-tree-text", "hasText": "Cut" },
{ "type": "eval", "script": "const m=document.querySelector('.part-menu'); if(m) m.open=true; for(const d of document.querySelectorAll('details.part-submenu')) d.open=true" },
{ "type": "wait", "ms": 400 },
{ "type": "click", "selector": "button[data-command=\"Part_CheckGeometry\"]", "optional": true },
{ "type": "wait", "ms": 1000 },
{ "type": "shot", "name": "03-check-geometry", "fullPage": true },
{ "type": "click", "role": "button", "name": "Close task / Cancel", "exact": true },
{ "type": "shot", "name": "04-result", "fullPage": true },
{ "type": "save" }
]
}