Files
ViewDesignEngine/docs/feedback/VDE-024.md
T
茂之钳 2a5a84670c
Build & Test / build-and-test (push) Waiting to run
Build & Test / python-bindings (push) Blocked by required conditions
CI / Build & Test (push) Failing after 37s
CI / Release Build (push) Failing after 31s
fix(feedback): properly close **Status** bold markdown in VDE-021/023/024/053/054
Commit 92f13b6 added trailing ** but left the opening ** unclosed after the
Status label, producing **Status**: Fixed** instead of **Status**: Fixed.
2026-07-29 11:36:47 +08:00

1.4 KiB
Raw Blame History

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, ...);