diff --git a/docs/feedback/VDE-446.md b/docs/feedback/VDE-446.md index 3678d1863..582839a37 100644 --- a/docs/feedback/VDE-446.md +++ b/docs/feedback/VDE-446.md @@ -6,7 +6,7 @@ | **日期** | 2026-08-04 | | **模块** | vde_brep — BrepModel | | **严重度** | 高 | -| **状态** | 待实现 | +| **状态** | 已修复 | ## 现象 diff --git a/include/vde/brep/brep.h b/include/vde/brep/brep.h index 147281794..2593f4af4 100644 --- a/include/vde/brep/brep.h +++ b/include/vde/brep/brep.h @@ -543,6 +543,65 @@ public: /** @brief 获取所有面的只读引用 */ [[nodiscard]] const std::vector& all_faces() const { return faces_; } + // ── VDE-446: 便捷查询 API(替代旧 label/shell/surf 接口) ── + + /** + * @brief 获取面的几何曲面(NURBS) + * + * 便捷方法,等价于 `surface(face(face_id).surface_id)`。 + * 替代旧的 `TopoFace::surf()` 接口。 + * + * @param face_id 面 ID(数组索引) + * @return 该面关联的 NURBS 曲面引用 + */ + [[nodiscard]] const curves::NurbsSurface& face_surface(int face_id) const { + return surfaces_[faces_[face_id].surface_id]; + } + + /** + * @brief 获取体的名称(标签) + * + * 替代旧的 `BrepModel::label()` 接口。 + * + * @param body_id 体 ID(默认 0 = 第一个体) + * @return 体名称字符串 + */ + [[nodiscard]] const std::string& body_name(int body_id = 0) const { + return bodies_[body_id].name; + } + + /** + * @brief 设置体的名称(标签) + * + * @param body_id 体 ID + * @param name 新名称 + */ + void set_body_name(int body_id, const std::string& name) { + bodies_[body_id].name = name; + } + + /** + * @brief 获取体包含的壳 ID 列表 + * + * 替代旧的 `BrepModel::shell()` 接口。 + * + * @param body_id 体 ID(默认 0 = 第一个体) + * @return 壳 ID 列表 + */ + [[nodiscard]] const std::vector& body_shell_ids(int body_id = 0) const { + return bodies_[body_id].shells; + } + + /** + * @brief 获取壳包含的面 ID 列表 + * + * @param shell_id 壳 ID(数组索引) + * @return 面 ID 列表 + */ + [[nodiscard]] const std::vector& shell_face_ids(int shell_id) const { + return shells_[shell_id].faces; + } + // ── 几何/拓扑查询 ── /**