feat: implement occlusion tolerance for shell analysis

- 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 <noreply@anthropic.com>
This commit is contained in:
sladro 2025-09-19 19:12:43 +08:00
parent 8ea0d9ce09
commit 82c643153f

View File

@ -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 <limits>
#include <map>
#include <unordered_map>
@ -2830,8 +2831,8 @@ CreoManager::ProjectionAnalysisData CreoManager::PerformMultiDirectionalProjecti
double occlusionBoundary = -std::numeric_limits<double>::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);