#pragma once #include #include namespace internal { struct fillet_config_t { double segment_ratio = 0.05 ;// 圆角切除量占相邻两段中较短段弦长的比例 double min_turn_angle_deg = 0.5; // 低于此角度(度)的衔接处视为共线,跳过 bool is_axis = false; double max_fillet_turn_angle_deg = 135.0; // 超过此转角不做圆角 double min_fillet_radius = 1e-3; // 圆角半径下限 }; // 对 2D profile / axis 多段线的衔接顶点插入微小圆角弧,实现 G1 连续。 void insert_polyline_corner_fillets(const polyline_descriptor_t& profile, std::vector& out_points, std::vector& out_bulges, const fillet_config_t& cfg = {}); /** * @brief 检测并修复 polyline 中负 bulge 圆弧与相邻边的自相交。 * 将自相交段的 bulge 置 0(退化为直线),消除 PMC 歧义区域。 */ void sanitize_negative_bulge_self_intersections(const std::vector& pts_3d, std::vector& bulges, bool is_axis, bool closed); } // namespace internal