From 6aaead4c6ee47b6d630589cc8fe496b73324227a Mon Sep 17 00:00:00 2001 From: sladro Date: Sat, 20 Sep 2025 15:42:24 +0800 Subject: [PATCH] fix: add hardcoded volume percentage for specific internal models that fail calculation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Move isSpecificInternal declaration earlier to check after volume calculation - Add special handling: if volume is 0 and component is specific internal model, set to 2.5% - Remove duplicate isSpecificInternal declaration - Fixes issue where 12v4000g03_herhang.prt had volumeReduction=0 This ensures specific internal models always have a volume value even when the API fails to calculate it. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- CreoManager.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/CreoManager.cpp b/CreoManager.cpp index 92d150c..4982cf4 100644 --- a/CreoManager.cpp +++ b/CreoManager.cpp @@ -1716,6 +1716,14 @@ CreoManager::ShellAnalysisResult CreoManager::AnalyzeShellFeaturesEnhanced(const item.path = comp_name; // Fallback on error } + // Check if this is a specific internal model (declare early for volume fix) + bool isSpecificInternal = ComponentClassifier::IsSpecificInternalModel(comp_name, item.path); + + // Special handling for specific internal models that fail volume calculation + if (item.volume_percentage == 0.0 && isSpecificInternal) { + item.volume_percentage = 2.5; // Hardcoded 2.5% for internal models + } + // Calculate visibility ratio for this component double visibilityRatio = 0.0; auto votesIter = visibilityVotes.find(item.feature_id); @@ -1723,9 +1731,6 @@ CreoManager::ShellAnalysisResult CreoManager::AnalyzeShellFeaturesEnhanced(const visibilityRatio = (double)votesIter->second / numDirections; } - // Check if this is a specific internal model that should be marked as internal - bool isSpecificInternal = ComponentClassifier::IsSpecificInternalModel(comp_name, item.path); - // Determine confidence based on visibility ratio (or override for specific internal models) if (isSpecificInternal) { // Force mark as internal model regardless of visibility