feedback: resolve VDE-067 (Fixed — already uses vde::mesh::) and VDE-068 (Closed — all APIs exist in VDE); revert wrong-direction source patches
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).
This commit is contained in:
@@ -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:: 引用已不存在。
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -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。
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -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<const BrepModel*, mesh::HalfedgeMesh> mesh_cache;
|
||||
static std::unordered_map<const BrepModel*, vde::mesh::HalfedgeMesh> 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 ──
|
||||
|
||||
@@ -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<int>(fi));
|
||||
|
||||
@@ -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<int>(fi));
|
||||
v0 = mesh.vertex(fv[0]);
|
||||
|
||||
@@ -63,10 +63,10 @@ namespace {
|
||||
// Mesh caching (shared with brep_boolean.cpp pattern)
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
|
||||
static std::unordered_map<const BrepModel*, mesh::HalfedgeMesh> mesh_cache;
|
||||
static std::unordered_map<const BrepModel*, vde::mesh::HalfedgeMesh> 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<std::mutex> lock(mesh_cache_mutex);
|
||||
auto it = mesh_cache.find(&body);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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<double, double> mesh_z_range(const mesh::HalfedgeMesh& mesh) {
|
||||
std::pair<double, double> mesh_z_range(const vde::mesh::HalfedgeMesh& mesh) {
|
||||
double z_min = std::numeric_limits<double>::max();
|
||||
double z_max = std::numeric_limits<double>::lowest();
|
||||
for (size_t vi = 0; vi < mesh.num_vertices(); ++vi) {
|
||||
|
||||
@@ -187,7 +187,7 @@ std::vector<Point2D> offset_polygon(const std::vector<Point2D>& poly, double dis
|
||||
|
||||
/// Extract 2D silhouette from mesh projected to a given Z plane
|
||||
/// Returns a polygon representing the cross-section outline
|
||||
std::vector<Point2D> extract_silhouette(const mesh::HalfedgeMesh& mesh, double z_level,
|
||||
std::vector<Point2D> extract_silhouette(const vde::mesh::HalfedgeMesh& mesh, double z_level,
|
||||
double tolerance = 0.01) {
|
||||
// Collect all edges that straddle the Z level
|
||||
std::vector<std::pair<Point2D, Point2D>> 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<int>(fi));
|
||||
|
||||
@@ -336,7 +336,7 @@ static std::vector<ThreeMFMesh> parse_model_xml(const std::string& xml) {
|
||||
|
||||
auto add_current_object = [&]() {
|
||||
if (verts.empty()) return;
|
||||
std::vector<mesh::Point3D> pts;
|
||||
std::vector<vde::mesh::Point3D> pts;
|
||||
pts.reserve(verts.size());
|
||||
for (const auto& v : verts) pts.emplace_back(v[0], v[1], v[2]);
|
||||
std::vector<std::array<int, 3>> faces;
|
||||
|
||||
Reference in New Issue
Block a user