From 6ed54e78308790e5df0423f8b34c1592ae24f639 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=82=E4=B9=8B=E9=92=B3?= Date: Thu, 30 Jul 2026 14:18:37 +0800 Subject: [PATCH] =?UTF-8?q?feedback:=20resolve=20VDE-067=20(Fixed=20?= =?UTF-8?q?=E2=80=94=20already=20uses=20vde::mesh::)=20and=20VDE-068=20(Cl?= =?UTF-8?q?osed=20=E2=80=94=20all=20APIs=20exist=20in=20VDE);=20revert=20w?= =?UTF-8?q?rong-direction=20source=20patches?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit VDE-067: VDE main branch already uses fully qualified vde::mesh:: names in all 8+ affected files. Reverted source patches that changed vde::mesh:: → mesh:: (those would break GCC two-phase lookup). VDE-068: fillet(), chamfer(), shell() in modeling.h/cpp, draft functions in direct_modeling.h + draft_analysis.h all exist. Remaining work is on ViewDesign side wiring (feature_builder.cpp VD_HAS_VDE=1 path). --- docs/feedback/VDE-067.md | 5 ++++- docs/feedback/VDE-068.md | 5 ++++- src/brep/brep_boolean.cpp | 6 +++--- src/brep/draft_analysis.cpp | 2 +- src/brep/measure.cpp | 2 +- src/brep/ssi_boolean.cpp | 4 ++-- src/capi/vde_capi.cpp | 4 ++-- src/core/cam_5axis.cpp | 4 ++-- src/core/cam_strategies.cpp | 4 ++-- src/foundation/io_3mf.cpp | 2 +- 10 files changed, 22 insertions(+), 16 deletions(-) diff --git a/docs/feedback/VDE-067.md b/docs/feedback/VDE-067.md index a676f92..700e8be 100644 --- a/docs/feedback/VDE-067.md +++ b/docs/feedback/VDE-067.md @@ -2,7 +2,10 @@ > 提交日期: 2026-07-30 > 严重程度: 中 -> 状态: 待修复 +> 状态: Fixed + +> 修复日期: 2026-07-30 +> 修复方式: VDE 内核已全面使用完全限定名 vde::mesh::(main 分支已验证:brep_boolean.cpp、ssi_boolean.cpp、measure.cpp、draft_analysis.cpp、cam_5axis.cpp、cam_strategies.cpp、boolean_fallback.cpp、topology_compression.cpp、vde_capi.cpp 等 8+ 文件均使用 vde::mesh::)。裸 mesh:: 引用已不存在。 --- diff --git a/docs/feedback/VDE-068.md b/docs/feedback/VDE-068.md index e8b922f..b63d308 100644 --- a/docs/feedback/VDE-068.md +++ b/docs/feedback/VDE-068.md @@ -2,7 +2,10 @@ > 提交日期: 2026-07-30 > 严重程度: 高 -> 状态: 待修复 +> 状态: Closed (VDE APIs Available) + +> 评估日期: 2026-07-30 +> 评估结论: 所有四项 API 在 VDE 中已实现。Fillet/Chamfer/Shell 在 vde::brep::modeling.h (fillet/fillet_variable/chamfer/shell),Draft 在 vde::brep::direct_modeling.h (draft_face_advanced) 和 vde::brep::draft_analysis.h (create_draft_face/apply_draft)。剩余工作是 ViewDesign 侧 feature_builder.cpp 在 VD_HAS_VDE=1 路径中调用这些 VDE API 替代返回空 Shape。 --- diff --git a/src/brep/brep_boolean.cpp b/src/brep/brep_boolean.cpp index 302d327..d417a59 100644 --- a/src/brep/brep_boolean.cpp +++ b/src/brep/brep_boolean.cpp @@ -41,10 +41,10 @@ enum ClassResult { IN = -1, ON = 0, OUT = 1 }; // ── Mesh caching ───────────────────────────────────────── /// Cache to_mesh() results keyed by BrepModel pointer. /// Avoids re-tessellating the same body for every face classification. -static std::unordered_map mesh_cache; +static std::unordered_map mesh_cache; /// Get the tessellated mesh for a body, reusing cached result. -static const mesh::HalfedgeMesh& get_mesh(const BrepModel& body) { +static const vde::mesh::HalfedgeMesh& get_mesh(const BrepModel& body) { auto it = mesh_cache.find(&body); if (it != mesh_cache.end()) return it->second; auto [inserted_it, _] = mesh_cache.emplace(&body, body.to_mesh(0.05)); @@ -55,7 +55,7 @@ static const mesh::HalfedgeMesh& get_mesh(const BrepModel& body) { /// Also returns the ray-cast in/out classification. ClassResult classify_point_mesh(const BrepModel& body, const Point3D& p, double tol = 1e-6) { - const mesh::HalfedgeMesh& mesh = get_mesh(body); + const vde::mesh::HalfedgeMesh& mesh = get_mesh(body); if (mesh.num_faces() == 0) return OUT; // ── First: check if point lies ON the mesh surface ── diff --git a/src/brep/draft_analysis.cpp b/src/brep/draft_analysis.cpp index 34272ce..cdd06a5 100644 --- a/src/brep/draft_analysis.cpp +++ b/src/brep/draft_analysis.cpp @@ -18,7 +18,7 @@ namespace vde::brep { namespace { /// Compute face area from mesh triangulation -double compute_face_area(const mesh::HalfedgeMesh& mesh) { +double compute_face_area(const vde::mesh::HalfedgeMesh& mesh) { double total = 0.0; for (size_t fi = 0; fi < mesh.num_faces(); ++fi) { auto verts = mesh.face_vertices(static_cast(fi)); diff --git a/src/brep/measure.cpp b/src/brep/measure.cpp index 971d1c2..a606385 100644 --- a/src/brep/measure.cpp +++ b/src/brep/measure.cpp @@ -78,7 +78,7 @@ AABB3D tri_bounds(const Point3D& v0, const Point3D& v1, const Point3D& v2) { } /// Get the three vertices of a mesh triangle. -void tri_verts(const mesh::HalfedgeMesh& mesh, size_t fi, +void tri_verts(const vde::mesh::HalfedgeMesh& mesh, size_t fi, Point3D& v0, Point3D& v1, Point3D& v2) { auto fv = mesh.face_vertices(static_cast(fi)); v0 = mesh.vertex(fv[0]); diff --git a/src/brep/ssi_boolean.cpp b/src/brep/ssi_boolean.cpp index 7c4f217..ff9c87f 100644 --- a/src/brep/ssi_boolean.cpp +++ b/src/brep/ssi_boolean.cpp @@ -63,10 +63,10 @@ namespace { // Mesh caching (shared with brep_boolean.cpp pattern) // ═══════════════════════════════════════════════════════════ -static std::unordered_map mesh_cache; +static std::unordered_map mesh_cache; static std::mutex mesh_cache_mutex; -static const mesh::HalfedgeMesh& get_mesh(const BrepModel& body) { +static const vde::mesh::HalfedgeMesh& get_mesh(const BrepModel& body) { { std::lock_guard lock(mesh_cache_mutex); auto it = mesh_cache.find(&body); diff --git a/src/capi/vde_capi.cpp b/src/capi/vde_capi.cpp index 25e6f39..c6e84e9 100644 --- a/src/capi/vde_capi.cpp +++ b/src/capi/vde_capi.cpp @@ -36,8 +36,8 @@ using core::Point3D; using core::Vector3D; using core::Triangle3D; using core::Ray3Dd; -using mesh::HalfedgeMesh; -using mesh::BooleanOp; +using vde::mesh::HalfedgeMesh; +using vde::mesh::BooleanOp; using curves::BezierCurve; using curves::NurbsCurve; } diff --git a/src/core/cam_5axis.cpp b/src/core/cam_5axis.cpp index 8a1120c..517e15e 100644 --- a/src/core/cam_5axis.cpp +++ b/src/core/cam_5axis.cpp @@ -91,7 +91,7 @@ bool ray_triangle_intersect(const Point3D& origin, /// 射线-网格求交(最近交点) bool ray_mesh_intersect(const Point3D& origin, const Vector3D& dir, - const mesh::HalfedgeMesh& mesh, + const vde::mesh::HalfedgeMesh& mesh, double max_dist, double& t_out) { t_out = max_dist; @@ -112,7 +112,7 @@ bool ray_mesh_intersect(const Point3D& origin, } /// 计算工件 Z 范围 -std::pair mesh_z_range(const mesh::HalfedgeMesh& mesh) { +std::pair mesh_z_range(const vde::mesh::HalfedgeMesh& mesh) { double z_min = std::numeric_limits::max(); double z_max = std::numeric_limits::lowest(); for (size_t vi = 0; vi < mesh.num_vertices(); ++vi) { diff --git a/src/core/cam_strategies.cpp b/src/core/cam_strategies.cpp index a569315..8fda86a 100644 --- a/src/core/cam_strategies.cpp +++ b/src/core/cam_strategies.cpp @@ -187,7 +187,7 @@ std::vector offset_polygon(const std::vector& poly, double dis /// Extract 2D silhouette from mesh projected to a given Z plane /// Returns a polygon representing the cross-section outline -std::vector extract_silhouette(const mesh::HalfedgeMesh& mesh, double z_level, +std::vector extract_silhouette(const vde::mesh::HalfedgeMesh& mesh, double z_level, double tolerance = 0.01) { // Collect all edges that straddle the Z level std::vector> segments; @@ -252,7 +252,7 @@ double triangle_area_3d(const Point3D& a, const Point3D& b, const Point3D& c) { } /// Compute signed volume of a closed mesh (tetrahedral summation) -double mesh_volume(const mesh::HalfedgeMesh& mesh) { +double mesh_volume(const vde::mesh::HalfedgeMesh& mesh) { double vol = 0.0; for (size_t fi = 0; fi < mesh.num_faces(); ++fi) { auto fv = mesh.face_vertices(static_cast(fi)); diff --git a/src/foundation/io_3mf.cpp b/src/foundation/io_3mf.cpp index af62b6c..8c96594 100644 --- a/src/foundation/io_3mf.cpp +++ b/src/foundation/io_3mf.cpp @@ -336,7 +336,7 @@ static std::vector parse_model_xml(const std::string& xml) { auto add_current_object = [&]() { if (verts.empty()) return; - std::vector pts; + std::vector pts; pts.reserve(verts.size()); for (const auto& v : verts) pts.emplace_back(v[0], v[1], v[2]); std::vector> faces;