Files
ViewDesignEngine/docs/29-追平最后7%计划.md
T
茂之钳 ddcfe01cba
CI / Build & Test (push) Failing after 28s
CI / Release Build (push) Failing after 32s
Build & Test / build-and-test (push) Has been cancelled
Build & Test / python-bindings (push) Has been cancelled
docs: plan to close final 7% gap — 87% → 93%
Three parallel tracks:
M1 — Tolerant Modeling + Robust Boolean + STEP import
     (tolerant edges/vertices, gap bridging, overlap resolution,
      tolerant boolean, degenerate case handling, GMP full coverage)

M2 — Class-A Surfacing Deep + Advanced Hex Meshing
     (G3+ constraints, surface energy minimization, curvature optimization,
      mapped/submapped/multi-block hex meshing)

M3 — Constraint Solving + Drawing Standards
     (DOF analysis, redundancy detection, kinematic chain solving,
      ISO/ANSI/JIS complete rule sets, auto-apply standards)

9 files, ~5200 lines, 69 tests. Target: 87% → 93% (match ACIS)
2026-07-27 00:12:58 +08:00

128 lines
4.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ViewDesignEngine — 追平最后 7% 计划
> 目标:从 87% → 94%,追平 Parasolid/ACIS 核心能力
---
## 差距详解
### 🔴 致命差距(必须补齐)
| # | 差距 | 当前 | 目标 | 对标的 Parasolid 能力 |
|---|------|------|------|----------------------|
| 1 | **容错建模** | 无 | 有 | 导入的"脏"几何自动修复,间隙/重叠容忍 |
| 2 | **鲁棒布尔容差** | 基础自适应 | 完善 | 退化情况(共面/共线/切触)100%正确处理 |
| 3 | **STEP 健壮导入** | 基本 | 工业级 | 破损/截断/非标 STEP 尽力恢复 |
### 🟡 重要差距(建议补齐)
| # | 差距 | 当前 | 目标 |
|---|------|------|------|
| 4 | **A级曲面深化** | G3基础 | G3+约束+曲面能量最小化 |
| 5 | **高级约束求解** | Newton基础 | 自由度分析+冗余检测+联动 |
| 6 | **六面体网格** | sweep基础 | map/submap/多块策略 |
| 7 | **制图标准模板** | 枚举存在 | ISO/ANSI/JIS 完整规则集 |
---
## 计划 — 三路并行攻克
### M1 — 容错建模 + 鲁棒布尔
**对标 Parasolid Tolerant Modeling**
1. 新建 `include/vde/brep/tolerant_modeling.h` + `src/brep/tolerant_modeling.cpp`
- `TolerantEdge` / `TolerantVertex` — 带容差范围的拓扑元素
- `merge_within_tolerance(body, tolerance)` — 自适应合并
- `gap_bridging(body, max_gap)` — 间隙桥接(自动补面)
- `overlap_resolution(body)` — 重叠面解决
- `tolerant_boolean(a, b, op)` — 容差感知布尔
* 先 heal → boolean → heal
* 失败面报告(哪些面导致布尔失败)
- `import_heal_pipeline(step_data)` — STEP 导入一站式修复
2. 增强 `src/brep/ssi_boolean.cpp`
- 退化检测:共面/共线/切触自动降级到容差路径
- 奇异点处理:tangent contact 生成退化边而非崩溃
- 精确谓词全覆盖:所有分类路径使用 GMP
3. 增强 `src/brep/step_import.cpp`
- 破损文件恢复:跳过损坏实体,继续解析
- 非标实体映射:未知实体 → 近似 B-Rep
- 导入诊断报告:哪些实体成功/失败/近似
4. 测试:`tests/brep/test_tolerant_modeling.cpp` (~20项)
5. 测试:`tests/brep/test_robust_boolean.cpp` 增强 (~15项)
### M2 — A级曲面 + 六面体网格
**对标 CGM Class-A + ANSYS Hex Meshing**
1. 增强 `src/curves/class_a_surfacing.cpp`
- `g3_blend_with_constraints` — 带G0/G1/G2/G3约束的过渡
- `surface_energy_minimization` — 薄板能量最小化光顺
- `curvature_continuity_optimization` — 曲率连续优化(迭代精化)
- `reflection_line_analysis` — 反射线不连续性检测+修复
2. 增强 `include/vde/mesh/fea_mesh.h` + `src/mesh/fea_mesh.cpp`
- `mapped_hex_mesh` — 映射法六面体(源面→目标面扫掠)
- `submapped_hex_mesh` — 子映射法(自动分区)
- `multi_block_hex_mesh` — 多块结构化六面体
- `hex_quality_optimization` — 六面体质量优化(untangling)
3. 测试:`tests/curves/test_class_a_surfacing.cpp` 增强 (~10项)
4. 测试:`tests/mesh/test_hex_mesh.cpp` (~12项)
### M3 — 约束求解 + 制图标准
**对标 D-Cubed + AutoCAD 制图**
1. 增强 `src/brep/constraint_solver.cpp`
- `DOFAnalyzer` — 完整自由度分析(每个零件 6DOF)
- `RedundancyDetector` — 冗余约束检测+建议删除
- `ConstraintPropagator` — 约束传播(改一处→联动更新)
- `KinematicChainSolver` — 机构运动链求解(闭环)
2. 新建 `include/vde/brep/drawing_standards.h` + `src/brep/drawing_standards.cpp`
- `IsoStandard` — ISO 128/129 完整规则
- `AnsiStandard` — ASME Y14.5 完整规则
- `JisStandard` — JIS B 0001 完整规则
- `apply_standard(drawing, standard, options)` — 一键应用标准
- 尺寸样式/线型/字体/箭头/公差格式自动配置
3. 测试:`tests/brep/test_constraint_solver_3d.cpp` 增强 (~12项)
---
## 📊 预期成果
| 模块 | 新增文件 | 代码行数 | 测试 | 追平能力 |
|------|---------|---------|------|---------|
| 容错建模 | 2 | ~1,200 | 20 | B-Rep 92→95% |
| 鲁棒布尔 | 1 增强 | ~800 | 15 | B-Rep 92→95% |
| STEP 健壮 | 1 增强 | ~500 | — | 交换 90→93% |
| A级曲面 | 1 增强 | ~600 | 10 | 曲面 90→93% |
| 六面体 | 1 增强 | ~700 | 12 | 网格 88→92% |
| 约束求解 | 1 增强 | ~600 | 12 | 装配 88→92% |
| 制图标准 | 2 | ~800 | — | 工程图 85→90% |
| **合计** | **9** | **~5,200** | **69** | **87→93%** |
### 追平后预期
```
当前 → 目标
B-Rep: 92% → 95%
曲面: 90% → 93%
网格: 88% → 92%
交换: 90% → 93%
CAM: 82% → 82%
性能: 88% → 88%
工程图: 85% → 90%
装配: 88% → 92%
质量: 80% → 80%
─────────────────────────
综合: 87% → 93% ← 追平 ACIS(93%)
```
剩余 1% (93→94):需要测试积累(900→5000+)和真实场景打磨。