2026-07-28 17:08:03 +08:00
|
|
|
|
# VDE-023: Assembly 约束应用依赖 face/edge ID,mesh→BrepModel 转换后 ID 失配
|
|
|
|
|
|
|
|
|
|
|
|
- **ID**: VDE-023
|
|
|
|
|
|
- **Date**: 2026-07-28
|
2026-07-29 11:36:47 +08:00
|
|
|
|
- **Status**: Fixed
|
2026-07-28 17:08:03 +08:00
|
|
|
|
- **Severity**: High
|
|
|
|
|
|
- **Category**: API Design
|
|
|
|
|
|
- **Source**: ViewDesign feat/viewdesign-engine branch
|
|
|
|
|
|
|
|
|
|
|
|
## Issue
|
|
|
|
|
|
|
|
|
|
|
|
VDE 的装配约束 API (`vde::brep::apply_constraint`) 通过 `AssemblyNode*` 指针操作,
|
|
|
|
|
|
而 `AssemblyNode` 内部持有 `BrepModel`。ViewDesign 通过 mesh 数据构建 Shape,
|
|
|
|
|
|
mesh→BrepModel 转换后 edge/face ID 被重新分配,与原始 Shape 中的拓扑索引不一致。
|
|
|
|
|
|
|
|
|
|
|
|
这使得无法在 ViewDesign 侧为用户提供"选面 → 应用装配约束"的交互:
|
|
|
|
|
|
|
|
|
|
|
|
- 用户在 3D 视图中选中面 → 得到 Shape 中的面索引
|
|
|
|
|
|
- mesh→BrepModel 后该面 ID 可能已变化
|
|
|
|
|
|
- `apply_constraint` 操作的是错误的拓扑元素
|
|
|
|
|
|
|
|
|
|
|
|
## Impact
|
|
|
|
|
|
|
|
|
|
|
|
ViewDesign 的干涉检查使用简化方式:将 Shape mesh 转为 BrepModel 后加入 Assembly 树,
|
|
|
|
|
|
只做干涉检测不应用约束。装配约束系统暂未集成。
|
|
|
|
|
|
|
|
|
|
|
|
## Suggested Fix
|
|
|
|
|
|
|
|
|
|
|
|
与 VDE-022 方案相同:保持 B-Rep 拓扑身份一致性。
|
|
|
|
|
|
|
|
|
|
|
|
**方案一**:ViewDesign 直接存储 BrepModel(而非 mesh),保持拓扑 ID 稳定。
|
|
|
|
|
|
|
|
|
|
|
|
**方案二**:VDE 提供 edge/face ID 映射或位置查询 API(见 VDE-022)。
|
|
|
|
|
|
|
|
|
|
|
|
关联:VDE-022
|