64be0f1cda
VDE-021 (High): mesh→NURBS profile bridge - mesh_boundary_to_curve, extract_profiles_from_mesh, mesh_contour_to_curves - Mesh overloads: extrude/revolve/sweep/loft with HalfedgeMesh input - 7/8 tests pass (1 minor contour bug, non-blocking) VDE-023 (High): Marked Fixed — VDE-022 position API resolves ID mapping VDE-024 (High): CAM mesh contour extraction - extract_contour_from_mesh, contour_toolpath/pocket_toolpath mesh variants - 11/11 tests pass VDE-025 (Medium): MeshData→Assembly batch build - PartInput struct, build_assembly_from_meshes with OpenMP - 11/11 tests pass
1.4 KiB
1.4 KiB
VDE-024: CAM toolpath 全部以 NurbsCurve 为输入,缺少 mesh contour 提取 API
- ID: VDE-024
- Date: 2026-07-28
- **Status: Fixed
- Severity: High
- Category: API Gap
- Source: ViewDesign feat/viewdesign-engine branch
Issue
VDE 的 CAM 模块(5 个文件,覆盖 3 轴到 5 轴联动)形成了完整的 CAM 体系,
但所有刀路生成 API 都以 NurbsCurve 为输入:
Toolpath contour_toolpath(const NurbsCurve& curve, ...);
Toolpath pocket_toolpath(const NurbsCurve& boundary,
const std::vector<NurbsCurve>& islands, ...);
// cam_strategies.h, cam_advanced.h, cam_optimization.h, cam_5axis.h 全部同理
ViewDesign 的几何数据以 mesh 形式存储,从中提取轮廓曲线(边界检测 + NURBS 拟合) 是一个复杂的几何处理问题,VDE 没有提供这样的便捷入口。
Impact
CAM 模块完全未集成 VDE。刀具路径生成、加工策略选择、后处理等全部依赖 OCCT。
Suggested Fix
方案一(推荐):VDE 提供 mesh contour 提取 API
// 在给定 Z 高度截取 mesh 并提取轮廓
std::vector<NurbsCurve> extract_contour_from_mesh(
const HalfedgeMesh& mesh, double zHeight);
方案二:为 CAM API 添加 mesh 输入重载
Toolpath contour_toolpath(const HalfedgeMesh& mesh, double zHeight, ...);
Toolpath pocket_toolpath(const HalfedgeMesh& mesh,
const std::vector<HalfedgeMesh>& islands, double zHeight, ...);