feat(v1.0.1): Parasolid + ACIS boolean robustness improvements
P0 — Boolean Robustness (Parasolid): - 7-class degenerate taxonomy: surface_overlap, curve_overlap, high_order, boundary_contact, vertex_contact, non_manifold_contact - Multi-point sampling: N=sqrt(area/tol²) points, >75% voting, exact_orient3d fallback on boundary cases - PrecisionTracker: accumulated loss, threshold warning P0 — Auto-Heal Pipeline (ACIS): - 5-step pipeline: Stitch→Simplify→Regularize→Orient→Check - AutoHealReport with per-step status, element counts, overall score P1 — Direct Modeling (ACIS): - fill_hole: edge loop → plane fit → NURBS insert - pull_up_to_face: push_pull to target face alignment Total: +~1500 lines across 6 files
This commit is contained in:
@@ -85,6 +85,80 @@ int heal_orientation(BrepModel& body);
|
||||
*/
|
||||
bool heal_topology(BrepModel& body, double tolerance = 1e-6);
|
||||
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
// AutoHealReport — 五步流水线修复报告
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
|
||||
/**
|
||||
* @brief 单步修复结果
|
||||
*/
|
||||
struct StepResult {
|
||||
bool success = false; ///< 本步是否成功执行
|
||||
std::string step_name; ///< 步骤名称
|
||||
int items_fixed = 0; ///< 修复的元素数量
|
||||
std::vector<std::string> warnings; ///< 本步产生的警告
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief ACIS风格五步自动修复流水线报告
|
||||
*
|
||||
* 包含每一步的详细结果、总体评分和剩余警告。
|
||||
*/
|
||||
struct AutoHealReport {
|
||||
StepResult stitch; ///< Step 1: 缝合
|
||||
StepResult simplify; ///< Step 2: 简化
|
||||
StepResult regularize; ///< Step 3: 正则化
|
||||
StepResult orient; ///< Step 4: 定向
|
||||
StepResult check; ///< Step 5: 验证
|
||||
|
||||
/** @brief 总体评分 (0-100),基于每步成功率和修复量 */
|
||||
int overall_score = 0;
|
||||
|
||||
/** @brief 剩余警告列表(跨步骤汇总) */
|
||||
std::vector<std::string> warnings;
|
||||
|
||||
/** @brief 总修复元素数 */
|
||||
[[nodiscard]] int total_fixed() const {
|
||||
return stitch.items_fixed + simplify.items_fixed +
|
||||
regularize.items_fixed + orient.items_fixed +
|
||||
check.items_fixed;
|
||||
}
|
||||
|
||||
/** @brief 成功步数 */
|
||||
[[nodiscard]] int successful_steps() const {
|
||||
return (stitch.success ? 1 : 0) +
|
||||
(simplify.success ? 1 : 0) +
|
||||
(regularize.success ? 1 : 0) +
|
||||
(orient.success ? 1 : 0) +
|
||||
(check.success ? 1 : 0);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief ACIS风格五步自动修复流水线
|
||||
*
|
||||
* 按顺序执行以下五个独立步骤,前一步失败不影响后一步:
|
||||
*
|
||||
* | 步骤 | 名称 | 操作 |
|
||||
* |------|-------------|----------------------------------------------------------|
|
||||
* | 1 | Stitch | 检测距离<tol的边→缝合(合并重合边) |
|
||||
* | 2 | Simplify | 移除退化边(长度<tol)+合并共线边+合并共面小面 |
|
||||
* | 3 | Regularize | 移除孤立顶点/边、修复翻转面、确保每边恰好属于2面 |
|
||||
* | 4 | Orient | 统一面法线向外指向 |
|
||||
* | 5 | Check | 欧拉-庞加莱公式验证+边面关联验证 |
|
||||
*
|
||||
* @param body 待修复的 B-Rep 模型(原地修改)
|
||||
* @param tolerance 缝合/简化容差,默认 1e-6
|
||||
* @return AutoHealReport 包含每步详细结果、修复数量和总体评分
|
||||
*
|
||||
* @note 每一步捕获异常,失败后继续执行后续步骤。
|
||||
* 最终评分 (0-100): 基础分=每步成功20分,警告扣分。
|
||||
*/
|
||||
[[nodiscard]] AutoHealReport auto_heal_pipeline(
|
||||
BrepModel& body, double tolerance = 1e-6);
|
||||
|
||||
// ── 旧版兼容 ──
|
||||
|
||||
/**
|
||||
* @brief STEP 导入后自动修复
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user