docs: doxygen annotations for curves + mesh + sketch
CI / Build & Test (push) Failing after 29s
CI / Release Build (push) Failing after 38s

This commit is contained in:
茂之钳
2026-07-24 11:04:04 +00:00
parent b97b0415f5
commit 4c9ee4f760
53 changed files with 5307 additions and 506 deletions
+33 -6
View File
@@ -7,15 +7,42 @@ using core::Point2D;
using core::Point3D;
using core::Vector3D;
/**
* @brief 离散曲率计算结果
* @ingroup mesh
*/
struct CurvatureResult {
std::vector<double> gaussian; // per-vertex Gaussian curvature
std::vector<double> mean; // per-vertex mean curvature
std::vector<double> area; // per-vertex Voronoi area
std::vector<double> gaussian; ///< 每顶点高斯曲率 K = κ₁·κ₂
std::vector<double> mean; ///< 每顶点平均曲率 H = (κ₁+κ₂)/2
std::vector<double> area; ///< 每顶点 Voronoi 面积(曲率归一化权重)
};
/// Discrete curvature using Cotan formula (Meyer et al. 2003)
/// Gaussian: K(v) = (2π - Σθ_j) / A_v (interior vertices)
/// Mean: H(v) = ||Σ(cot α + cot β)·e|| / (2·A_v)
/**
* @brief 离散曲率计算(Cotan 公式,Meyer et al. 2003
*
* 对三角网格每个顶点计算离散高斯曲率和平均曲率。
*
* 高斯曲率(内点):
* K(v) = (2π - Σ_j θ_j) / A_v
* 其中 θ_j 是顶点 v 处面角的总和,A_v 是 Voronoi 面积
*
* 平均曲率:
* H(v) = || Σ_j (cot α_j + cot β_j) · e_j || / (2 · A_v)
* 其中 α_j,β_j 是与边 e_j 相对的两个角
*
* 边界顶点使用角度缺损公式修正。
*
* @param mesh 输入三角网格
* @return CurvatureResult 每顶点曲率
*
* @note 要求网格为流形;边界顶点曲率使用近似公式
* @code{.cpp}
* auto crv = compute_curvature(mesh);
* double max_curvature = *std::max_element(crv.gaussian.begin(), crv.gaussian.end());
* // 可用于特征检测、网格分割等
* @endcode
* @ingroup mesh
*/
CurvatureResult compute_curvature(const HalfedgeMesh& mesh);
} // namespace vde::mesh