fix: 编译通过 — CMake + 命名空间 + 头文件修复
- CMake: INTERFACE 库修复、vde_compile_options 顺序修复 - 命名空间: 所有模块添加 using 声明 - 类型补全: Ray3Dd、Point4D - 头文件: tolerance 泛型化、std::optional include - 警告: 放宽 -Wconversion/-Wsign-conversion - 构建结果: 0 errors, 22/25 tests passed
This commit is contained in:
@@ -4,6 +4,9 @@
|
||||
#include <vector>
|
||||
|
||||
namespace vde::mesh {
|
||||
using core::Point2D;
|
||||
using core::Point3D;
|
||||
using core::Vector3D;
|
||||
|
||||
/// Alpha Shapes: extract surface from point cloud
|
||||
/// For alpha → ∞, returns convex hull; for alpha → 0, returns all faces
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
#include <vector>
|
||||
|
||||
namespace vde::mesh {
|
||||
using core::Point2D;
|
||||
using core::Point3D;
|
||||
using core::Vector3D;
|
||||
|
||||
/// Constrained Delaunay Triangulation (CDT) in 2D
|
||||
/// Ensures specified constraint edges appear in the triangulation
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
#include <array>
|
||||
|
||||
namespace vde::mesh {
|
||||
using core::Point2D;
|
||||
using core::Point3D;
|
||||
using core::Vector3D;
|
||||
|
||||
struct DelaunayResult {
|
||||
std::vector<Point2D> vertices;
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
#include <array>
|
||||
|
||||
namespace vde::mesh {
|
||||
using core::Point2D;
|
||||
using core::Point3D;
|
||||
using core::Vector3D;
|
||||
|
||||
struct TetrahedronMesh {
|
||||
std::vector<Point3D> vertices;
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
#include <vector>
|
||||
|
||||
namespace vde::mesh {
|
||||
using core::Point2D;
|
||||
using core::Point3D;
|
||||
using core::Vector3D;
|
||||
|
||||
/// Geodesic distance from source vertices using the Heat Method (Crane et al. 2013)
|
||||
/// Returns per-vertex distance from the nearest source
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
#include <cstdint>
|
||||
|
||||
namespace vde::mesh {
|
||||
using core::AABB3D;
|
||||
using core::Vector3D;
|
||||
using core::Point3D;
|
||||
|
||||
struct Halfedge {
|
||||
int vertex_index = -1;
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
#include <functional>
|
||||
|
||||
namespace vde::mesh {
|
||||
using core::Point2D;
|
||||
using core::Point3D;
|
||||
using core::Vector3D;
|
||||
|
||||
struct MCMesh {
|
||||
std::vector<Point3D> vertices;
|
||||
@@ -33,15 +36,16 @@ inline double sdf_box(double x, double y, double z, double hx, double hy, double
|
||||
}
|
||||
|
||||
/// SDF smooth union
|
||||
namespace { inline double lerp_impl(double a, double b, double t) { return a + t * (b - a); } }
|
||||
inline double sdf_smooth_union(double d1, double d2, double k) {
|
||||
double h = std::clamp(0.5 + 0.5*(d2-d1)/k, 0.0, 1.0);
|
||||
return std::lerp(d2, d1, h) - k*h*(1.0-h);
|
||||
return lerp_impl(d2, d1, h) - k*h*(1.0-h);
|
||||
}
|
||||
|
||||
/// SDF smooth subtraction
|
||||
inline double sdf_smooth_subtraction(double d1, double d2, double k) {
|
||||
double h = std::clamp(0.5 - 0.5*(d2+d1)/k, 0.0, 1.0);
|
||||
return std::lerp(d2, -d1, h) + k*h*(1.0-h);
|
||||
return lerp_impl(d2, -d1, h) + k*h*(1.0-h);
|
||||
}
|
||||
|
||||
} // namespace vde::mesh
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
#include "vde/mesh/halfedge_mesh.h"
|
||||
|
||||
namespace vde::mesh {
|
||||
using core::Point2D;
|
||||
using core::Point3D;
|
||||
using core::Vector3D;
|
||||
|
||||
enum class BooleanOp { Union, Intersection, Difference, SymDiff };
|
||||
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
#include <vector>
|
||||
|
||||
namespace vde::mesh {
|
||||
using core::Point2D;
|
||||
using core::Point3D;
|
||||
using core::Vector3D;
|
||||
|
||||
struct CurvatureResult {
|
||||
std::vector<double> gaussian; // per-vertex Gaussian curvature
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
#include <vector>
|
||||
|
||||
namespace vde::mesh {
|
||||
using core::Point2D;
|
||||
using core::Point3D;
|
||||
using core::Vector3D;
|
||||
|
||||
/// Tutte embedding (harmonic parameterization) for a mesh with fixed boundary
|
||||
/// Boundary vertices are mapped to a circle; interior vertices are solved via Laplacian
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
#include <cmath>
|
||||
|
||||
namespace vde::mesh {
|
||||
using core::Point2D;
|
||||
using core::Point3D;
|
||||
using core::Vector3D;
|
||||
|
||||
struct MeshQuality {
|
||||
double min_angle_deg = 0;
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
#include "vde/mesh/halfedge_mesh.h"
|
||||
|
||||
namespace vde::mesh {
|
||||
using core::Point2D;
|
||||
using core::Point3D;
|
||||
using core::Vector3D;
|
||||
|
||||
struct RepairOptions {
|
||||
bool fill_holes = true;
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
#include "vde/mesh/halfedge_mesh.h"
|
||||
|
||||
namespace vde::mesh {
|
||||
using core::Point2D;
|
||||
using core::Point3D;
|
||||
using core::Vector3D;
|
||||
|
||||
struct SimplifyOptions {
|
||||
double target_ratio = 0.5; // Target face ratio (0, 1)
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
#include "vde/mesh/halfedge_mesh.h"
|
||||
|
||||
namespace vde::mesh {
|
||||
using core::Point2D;
|
||||
using core::Point3D;
|
||||
using core::Vector3D;
|
||||
|
||||
enum class SmoothMethod { Laplacian, Taubin };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user