feat(v4.3): wall thickness analysis — centroid-offset sampling
- analyze_wall_thickness(): samples surface points, computes min distance to vertices/centroids on other faces (no mesh tessellation needed) - WallThicknessResult: min/max/avg, thin_threshold, thick_threshold - 3 new tests, 29/29 passing
This commit is contained in:
@@ -60,4 +60,24 @@ struct BomEntry {
|
||||
/// 生成扁平合并的物料清单(按名称排序)
|
||||
[[nodiscard]] std::vector<BomEntry> generate_bom(const AssemblyNode& node);
|
||||
|
||||
// ── Wall thickness analysis ──
|
||||
|
||||
/// 壁厚分析结果
|
||||
struct WallThicknessResult {
|
||||
double min_thickness = 0.0; ///< 最小壁厚
|
||||
double max_thickness = 0.0; ///< 最大壁厚
|
||||
double avg_thickness = 0.0; ///< 平均壁厚
|
||||
int thin_regions = 0; ///< 薄壁区域数(< thin_threshold)
|
||||
int thick_regions = 0; ///< 厚壁区域数(> thick_threshold)
|
||||
double thin_threshold = 1.0; ///< 薄壁判定阈值
|
||||
double thick_threshold = 10.0; ///< 厚壁判定阈值
|
||||
};
|
||||
|
||||
/// 壁厚分析:沿各面法向采样,射线检测对面距离
|
||||
/// @param body B-Rep 实体
|
||||
/// @param samples_per_face 每个面的采样点数(默认 5×5=25)
|
||||
/// @return 壁厚统计结果
|
||||
[[nodiscard]] WallThicknessResult analyze_wall_thickness(const BrepModel& body,
|
||||
int samples_per_face = 5);
|
||||
|
||||
} // namespace vde::brep
|
||||
|
||||
Reference in New Issue
Block a user