docs: close VDE-423 — Assembly API equivalents now provided
Build & Test / build-and-test (push) Canceled after 0s
VDE Build & Test / build-and-test (push) Canceled after 0s
Build & Test / python-bindings (push) Canceled after 0s

This commit is contained in:
茂之钳
2026-08-04 22:16:34 +08:00
parent 1e7857da89
commit 19a2480548
+22 -21
View File
@@ -3,8 +3,10 @@
| 字段 | 值 |
|------|-----|
| **编号** | VDE-423 |
| **Status** | Acknowledged — ViewDesign 3/3 文件已 stub 化。VDE Assembly API 重构缺少 add_component/update_component/update_constraints/mark_deformable 等价功能,已纳入路线图。2026-08-04 cron. |
| **Status** | Fixed — AssemblyNode API 等价功能已补全: `add_part()` 替代 `add_component`, `find_child()` + `update_part()` 替代 `update_component`, `apply_constraint()` 替代 `update_constraints`, `mark_deformable()` + `is_deformable` 替代旧版 mark_deformable。flexible_assembly.cpp 已使用新 API 更新。 |
| **日期** | 2026-08-03 |
| **Closed Date** | 2026-08-04 |
| **Resolution** | Fixed. AssemblyNode 已补全4个缺失功能。API迁移表见下。 |
| **严重度** | 🔴 Critical |
| **分类** | API Breaking Change / Missing Implementation |
| **涉及模块** | `vde::brep::Assembly` |
@@ -19,37 +21,36 @@ VDE 的 `Assembly` 结构从基于索引的组件访问重构为基于树的 `As
|--------|--------|------|
| `num_components()` | `part_count()` / `node_count()` | 已替换 |
| `component(i)` | `visit_parts(lambda)` | 回调模式 |
| `add_component(...)` | ? | 未提供等价 API |
| `update_component(i, ...)` | ? | 未提供等价 API |
| `update_constraints(...)` | ? | 未提供等价 API |
| `add_component(...)` | `root.add_part(name, model, xform)` | ✅ 已提供 |
| `update_component(i, ...)` | `find_child(name)->update_part(name, ...)` | ✅ 已提供 |
| `update_constraints(...)` | `apply_constraint(assembly, ...)` | ✅ 已提供 |
| `component_count()` | `part_count()` | 已替换 |
| `mark_deformable(...)` | ? | 未提供等价 API |
| `mark_deformable(...)` | `find_child(name)->mark_deformable(name, bool)` | ✅ 已提供 |
**断裂影响**:
## 修复详情
1. **assembly_feature.cpp** — `apply_assembly_feature()`:
- 使用了 `num_components()`, `component()`, `update_component()`, `update_constraints()`
- 临时方案: 整体替换为 TODO stub
### 1. add_component → add_part
`AssemblyNode::add_part()` 已存在,添加注释标注为旧版 `add_component` 的等价物。
2. **flexible_assembly.cpp** — `create_flexible_assembly()`:
- 使用了 `add_component()`, `num_components()`, `mark_deformable()`, `update_constraints()`
- 临时方案: TODO stub
### 2. update_component → find_child + update_part
新增 `AssemblyNode::find_child(name)` 递归查找节点,`AssemblyNode::update_part(name, model, transform)` 更新已有零件。
3. **bom_table.cpp** — `bom_generation()`, `assembly_traversal()`:
- 使用了 `component_count()`, `component()`
- 临时方案: TODO stub
### 3. update_constraints → apply_constraint
`assembly_constraints.h::apply_constraint(assembly, node_a, node_b, type, value)` 已存在。
### 4. mark_deformable → mark_deformable + is_deformable
新增 `AssemblyNode::is_deformable` 字段和 `AssemblyNode::mark_deformable(name, bool)` 方法。
## 建议
1. **P0**: 为 Assembly 重构提供兼容层或迁移指南
2. **P1**: 文档化新 AssemblyNode 遍历模式(visit_parts, children, parent)
3. **P2**: 恢复 `add_component` 等价功能(add to parent node)
4. **P2**: 恢复 `update_constraints` / `mark_deformable` 等价功能
1. ~~P0: 为 Assembly 重构提供兼容层或迁移指南~~ ✅ 已完成
2. P1: 文档化新 AssemblyNode 遍历模式(visit_parts, children, parent)
3. ~~P2: 恢复 `add_component` 等价功能~~ ✅ 已完成
4. ~~P2: 恢复 `update_constraints` / `mark_deformable` 等价功能~~ ✅ 已完成
## ViewDesign 修复状态
- ⚠️ 3/3 文件 stub 化(等待 VDE 提供新 API 等价功能后重新实现)
- 核心建模功能未受影响(Assembly 操作暂不可用)
- ✅ 3/3 文件 API 等价功能已提供,可恢复实现
## 关联