fix: merge feedback branch — VDE-067 Fixed, VDE-068 Acknowledged
VDE-067: GCC two-phase lookup — all unqualified mesh:: → vde::mesh:: (8 files, 11 refs) VDE-068: Fillet/Chamfer/Shell/Draft — architecture-level, Acknowledged (needs kernel API design)
This commit is contained in:
@@ -2,7 +2,10 @@
|
||||
|
||||
> 提交日期: 2026-07-30
|
||||
> 严重程度: 中
|
||||
> 状态: 待修复
|
||||
> 状态: Fixed
|
||||
|
||||
> 修复日期: 2026-07-30
|
||||
> 修复方式: 将匿名命名空间内所有非限定 mesh:: 引用替换为完全限定名 vde::mesh::,涵盖 8 个源文件 11 处引用。
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -2,7 +2,10 @@
|
||||
|
||||
> 提交日期: 2026-07-30
|
||||
> 严重程度: 高
|
||||
> 状态: 待修复
|
||||
> 状态: Acknowledged
|
||||
>
|
||||
> 评估日期: 2026-07-30
|
||||
> 评估结论: 架构级改动 — Fillet/Chamfer/Shell/Draft 需要实现新的 mesh 几何处理算法(blending、offset、hollowing、draft angle),涉及 BVH、局部变形、拓扑修改等底层模块,非 trivial 修复。需 VDE 内核团队规划 API 设计后再实施。
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -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