From 82c643153f70c7467d53ef9353a880abcacd7d5e Mon Sep 17 00:00:00 2001 From: sladro Date: Fri, 19 Sep 2025 19:12:43 +0800 Subject: [PATCH] feat: implement occlusion tolerance for shell analysis MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add SHELL_ANALYSIS_OCCLUSION_TOLERANCE constant (0.5 units) - Modify occlusion detection to allow minor overlap between components - Restore original visibility thresholds (0.05, 0.08, 0.25) - Prevents shell components from being incorrectly marked as occluded This approach directly addresses the overly strict occlusion detection while maintaining clear algorithm logic and physical reasoning. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- CreoManager.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CreoManager.cpp b/CreoManager.cpp index 113f08c..a9110d6 100644 --- a/CreoManager.cpp +++ b/CreoManager.cpp @@ -35,6 +35,7 @@ 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; #include #include #include @@ -2830,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, it's visible - if (proj.minProj > occlusionBoundary) { + // If component's nearest point is beyond occlusion boundary (with tolerance), it's visible + if (proj.minProj > occlusionBoundary - SHELL_ANALYSIS_OCCLUSION_TOLERANCE) { result.visibilityVotes[proj.featureId]++; // Update occlusion boundary to this component's farthest point occlusionBoundary = std::max(occlusionBoundary, proj.maxProj);