diff --git a/CreoManager.cpp b/CreoManager.cpp index a9110d6..1d31e96 100644 --- a/CreoManager.cpp +++ b/CreoManager.cpp @@ -30,12 +30,12 @@ #include // Shell Analysis Algorithm Constants -const int SHELL_ANALYSIS_NUM_DIRECTIONS = 96; -const double SHELL_ANALYSIS_MIN_VISIBILITY_RATIO = 0.05; -const int SHELL_ANALYSIS_MIN_VOTES = 2; -const double SHELL_ANALYSIS_HIGH_VISIBILITY_THRESHOLD = 0.25; -const double SHELL_ANALYSIS_MEDIUM_VISIBILITY_THRESHOLD = 0.08; -const double SHELL_ANALYSIS_OCCLUSION_TOLERANCE = 0.5; +const int SHELL_ANALYSIS_NUM_DIRECTIONS = 96; // 多方向投影采样数量 +const double SHELL_ANALYSIS_MIN_VISIBILITY_RATIO = 0.04; // 最小可见率:4%方向可见即为外壳候选 +const int SHELL_ANALYSIS_MIN_VOTES = 2; // 最少得票数:至少2个方向可见 +const double SHELL_ANALYSIS_HIGH_VISIBILITY_THRESHOLD = 0.20; // 高可见度阈值:20%以上强制保留 +const double SHELL_ANALYSIS_MEDIUM_VISIBILITY_THRESHOLD = 0.06; // 中等可见度阈值:6-20%需要审查 +const double SHELL_ANALYSIS_OCCLUSION_TOLERANCE = 0.5; // 遮挡容差(当前未使用) #include #include #include @@ -2831,8 +2831,8 @@ CreoManager::ProjectionAnalysisData CreoManager::PerformMultiDirectionalProjecti double occlusionBoundary = -std::numeric_limits::max(); for (const auto& proj : projections) { - // If component's nearest point is beyond occlusion boundary (with tolerance), it's visible - if (proj.minProj > occlusionBoundary - SHELL_ANALYSIS_OCCLUSION_TOLERANCE) { + // Strict occlusion: component visible only if completely unoccluded + if (proj.minProj > occlusionBoundary) { result.visibilityVotes[proj.featureId]++; // Update occlusion boundary to this component's farthest point occlusionBoundary = std::max(occlusionBoundary, proj.maxProj);