diff --git a/CreoManager.cpp b/CreoManager.cpp index c3c783c..988a76c 100644 --- a/CreoManager.cpp +++ b/CreoManager.cpp @@ -1562,20 +1562,7 @@ CreoManager::HierarchyDeleteResult CreoManager::DeleteHierarchyComponents(const CreoManager::ShellAnalysisResult CreoManager::AnalyzeShellFeaturesEnhanced(const ShellAnalysisRequest& request) { ShellAnalysisResult result; - // Create analysis log file immediately - try { - SessionInfo sessionInfo = GetSessionInfo(); - if (sessionInfo.is_valid) { - xstring workdir = sessionInfo.session->GetCurrentDirectory(); - std::string workingDir = XStringToString(workdir); - std::string logPath = workingDir + "\\shell_analysis_start.txt"; - std::ofstream logFile(logPath); - logFile << "Shell Analysis Started" << std::endl; - logFile << "Time: " << GetCurrentTimeString() << std::endl; - logFile << "Working Directory: " << workingDir << std::endl; - logFile.close(); - } - } catch (...) {} + // Removed shell_analysis_start.txt creation try { // Get session @@ -3559,12 +3546,12 @@ bool CreoManager::IsComponentBlockedFromCenter(const Vector3D& globalCenter, // We only care about intersections beyond this distance (outward extension) double distToComponentCenter = (componentCenter - globalCenter).length(); - // Debug for 12V4000G03 - bool isTarget12v = (component.name.find("12v4000g03") != std::string::npos || - component.name.find("12V4000G03") != std::string::npos); + // Debug for ID 7 (12V4000G03) + bool isTarget12v = (component.featureId == 7); int checkedCount = 0; int intersectionCount = 0; + int beyondCount = 0; // Count intersections beyond component center std::string nearestBlocker; double nearestDistance = 1e9; @@ -3617,10 +3604,22 @@ bool CreoManager::IsComponentBlockedFromCenter(const Vector3D& globalCenter, } } - // Check if intersection exists and is beyond the component center (outward extension) - if (tMin <= tMax && tMin >= 0) { + // Check if intersection exists + if (tMin <= tMax) { // Calculate the actual distance of the intersection point - double intersectionDistance = tMin; + double intersectionDistance; + + if (tMin >= 0) { + // Ray starts outside AABB, use entry point + intersectionDistance = tMin; + } else if (tMax >= 0) { + // Ray starts inside AABB, use exit point + intersectionDistance = tMax; + } else { + // AABB is completely behind ray, no forward intersection + continue; + } + intersectionCount++; // Track nearest potential blocker for debugging @@ -3632,11 +3631,55 @@ bool CreoManager::IsComponentBlockedFromCenter(const Vector3D& globalCenter, // Only consider it blocked if intersection is beyond the component center if (intersectionDistance > distToComponentCenter) { + beyondCount++; + if (isTarget12v && beyondCount == 1) { // Log first blocker found + try { + SessionInfo sessionInfo = GetSessionInfo(); + if (sessionInfo.is_valid) { + xstring workdir = sessionInfo.session->GetCurrentDirectory(); + std::string workingDir = XStringToString(workdir); + std::string logPath = workingDir + "\\12v4000g03_visibility.txt"; + std::ofstream logFile(logPath, std::ios::app); + if (logFile.is_open()) { + logFile << " BLOCKED BY: " << otherComp.name + << " at distance " << intersectionDistance + << " (center at " << distToComponentCenter << ")" << std::endl; + logFile.close(); + } + } + } catch (...) {} + } return true; // Component is blocked by something in the outward direction } } } + // Log ray test summary for ID 7 + if (isTarget12v) { + static int rayDirCount = 0; + rayDirCount++; + if (rayDirCount <= 6) { + try { + SessionInfo sessionInfo = GetSessionInfo(); + if (sessionInfo.is_valid) { + xstring workdir = sessionInfo.session->GetCurrentDirectory(); + std::string workingDir = XStringToString(workdir); + std::string logPath = workingDir + "\\12v4000g03_visibility.txt"; + std::ofstream logFile(logPath, std::ios::app); + if (logFile.is_open()) { + logFile << " Ray stats: checked=" << checkedCount + << ", intersections=" << intersectionCount + << ", beyond_center=" << beyondCount; + if (!nearestBlocker.empty()) { + logFile << " (nearest: " << nearestBlocker << ")"; + } + logFile << std::endl; + logFile.close(); + } + } + } catch (...) {} + } + } return false; // Component is not blocked (is outer shell) } diff --git a/MFCCreoDll/x64/Debug/AuthManager.obj b/MFCCreoDll/x64/Debug/AuthManager.obj index 69692d5..68e3d42 100644 Binary files a/MFCCreoDll/x64/Debug/AuthManager.obj and b/MFCCreoDll/x64/Debug/AuthManager.obj differ diff --git a/MFCCreoDll/x64/Debug/CreoManager.obj b/MFCCreoDll/x64/Debug/CreoManager.obj index f6200f4..2d80ee6 100644 Binary files a/MFCCreoDll/x64/Debug/CreoManager.obj and b/MFCCreoDll/x64/Debug/CreoManager.obj differ diff --git a/MFCCreoDll/x64/Debug/GeometryAnalyzer.obj b/MFCCreoDll/x64/Debug/GeometryAnalyzer.obj index 50249d7..d23fc0e 100644 Binary files a/MFCCreoDll/x64/Debug/GeometryAnalyzer.obj and b/MFCCreoDll/x64/Debug/GeometryAnalyzer.obj differ diff --git a/MFCCreoDll/x64/Debug/HierarchyStatisticsAnalyzer.obj b/MFCCreoDll/x64/Debug/HierarchyStatisticsAnalyzer.obj index 1ac490f..f7d1ad9 100644 Binary files a/MFCCreoDll/x64/Debug/HierarchyStatisticsAnalyzer.obj and b/MFCCreoDll/x64/Debug/HierarchyStatisticsAnalyzer.obj differ diff --git a/MFCCreoDll/x64/Debug/HttpRouter.obj b/MFCCreoDll/x64/Debug/HttpRouter.obj index d640ff5..e0e6bc9 100644 Binary files a/MFCCreoDll/x64/Debug/HttpRouter.obj and b/MFCCreoDll/x64/Debug/HttpRouter.obj differ diff --git a/MFCCreoDll/x64/Debug/HttpServer.obj b/MFCCreoDll/x64/Debug/HttpServer.obj index f7ce1fd..508976c 100644 Binary files a/MFCCreoDll/x64/Debug/HttpServer.obj and b/MFCCreoDll/x64/Debug/HttpServer.obj differ diff --git a/MFCCreoDll/x64/Debug/JsonHelper.obj b/MFCCreoDll/x64/Debug/JsonHelper.obj index 0098db5..83833b4 100644 Binary files a/MFCCreoDll/x64/Debug/JsonHelper.obj and b/MFCCreoDll/x64/Debug/JsonHelper.obj differ diff --git a/MFCCreoDll/x64/Debug/Logger.obj b/MFCCreoDll/x64/Debug/Logger.obj index 9f993c4..9632f62 100644 Binary files a/MFCCreoDll/x64/Debug/Logger.obj and b/MFCCreoDll/x64/Debug/Logger.obj differ diff --git a/MFCCreoDll/x64/Debug/MFCCreoDll.obj b/MFCCreoDll/x64/Debug/MFCCreoDll.obj index ba1eee2..2d54b3e 100644 Binary files a/MFCCreoDll/x64/Debug/MFCCreoDll.obj and b/MFCCreoDll/x64/Debug/MFCCreoDll.obj differ diff --git a/MFCCreoDll/x64/Debug/MFCCreoDll.pch b/MFCCreoDll/x64/Debug/MFCCreoDll.pch index 18e6da0..b3061cc 100644 Binary files a/MFCCreoDll/x64/Debug/MFCCreoDll.pch and b/MFCCreoDll/x64/Debug/MFCCreoDll.pch differ diff --git a/MFCCreoDll/x64/Debug/ModelAnalyzer.obj b/MFCCreoDll/x64/Debug/ModelAnalyzer.obj index fab5a2b..c072c3e 100644 Binary files a/MFCCreoDll/x64/Debug/ModelAnalyzer.obj and b/MFCCreoDll/x64/Debug/ModelAnalyzer.obj differ diff --git a/MFCCreoDll/x64/Debug/ModelSearchEngine.obj b/MFCCreoDll/x64/Debug/ModelSearchEngine.obj index e10677d..7f8ceaf 100644 Binary files a/MFCCreoDll/x64/Debug/ModelSearchEngine.obj and b/MFCCreoDll/x64/Debug/ModelSearchEngine.obj differ diff --git a/MFCCreoDll/x64/Debug/ModelSearchHandler.obj b/MFCCreoDll/x64/Debug/ModelSearchHandler.obj index fd4b2c7..1328e90 100644 Binary files a/MFCCreoDll/x64/Debug/ModelSearchHandler.obj and b/MFCCreoDll/x64/Debug/ModelSearchHandler.obj differ diff --git a/MFCCreoDll/x64/Debug/PathDeleteManager.obj b/MFCCreoDll/x64/Debug/PathDeleteManager.obj index c179104..d1b012e 100644 Binary files a/MFCCreoDll/x64/Debug/PathDeleteManager.obj and b/MFCCreoDll/x64/Debug/PathDeleteManager.obj differ diff --git a/MFCCreoDll/x64/Debug/ServerManager.obj b/MFCCreoDll/x64/Debug/ServerManager.obj index 1b5fd28..1df72db 100644 Binary files a/MFCCreoDll/x64/Debug/ServerManager.obj and b/MFCCreoDll/x64/Debug/ServerManager.obj differ diff --git a/MFCCreoDll/x64/Debug/ShellExportHandler.obj b/MFCCreoDll/x64/Debug/ShellExportHandler.obj index df82bd8..f0d3ae4 100644 Binary files a/MFCCreoDll/x64/Debug/ShellExportHandler.obj and b/MFCCreoDll/x64/Debug/ShellExportHandler.obj differ diff --git a/MFCCreoDll/x64/Debug/ShrinkwrapManager.obj b/MFCCreoDll/x64/Debug/ShrinkwrapManager.obj index 6fa7a85..af81ce6 100644 Binary files a/MFCCreoDll/x64/Debug/ShrinkwrapManager.obj and b/MFCCreoDll/x64/Debug/ShrinkwrapManager.obj differ diff --git a/MFCCreoDll/x64/Debug/WebSocketServer.obj b/MFCCreoDll/x64/Debug/WebSocketServer.obj index e671a6d..4b8e4f6 100644 Binary files a/MFCCreoDll/x64/Debug/WebSocketServer.obj and b/MFCCreoDll/x64/Debug/WebSocketServer.obj differ diff --git a/MFCCreoDll/x64/Debug/pch.obj b/MFCCreoDll/x64/Debug/pch.obj index cebf6c5..6ddd515 100644 Binary files a/MFCCreoDll/x64/Debug/pch.obj and b/MFCCreoDll/x64/Debug/pch.obj differ diff --git a/MFCCreoDll/x64/Debug/vc143.idb b/MFCCreoDll/x64/Debug/vc143.idb index 6890758..78beb8a 100644 Binary files a/MFCCreoDll/x64/Debug/vc143.idb and b/MFCCreoDll/x64/Debug/vc143.idb differ diff --git a/MFCCreoDll/x64/Debug/vc143.pdb b/MFCCreoDll/x64/Debug/vc143.pdb index 3f5996f..4da6dd3 100644 Binary files a/MFCCreoDll/x64/Debug/vc143.pdb and b/MFCCreoDll/x64/Debug/vc143.pdb differ diff --git a/x64/Debug/MFCCreoDll.dll b/x64/Debug/MFCCreoDll.dll index c74e126..eba31fa 100644 Binary files a/x64/Debug/MFCCreoDll.dll and b/x64/Debug/MFCCreoDll.dll differ diff --git a/x64/Debug/MFCCreoDll.pdb b/x64/Debug/MFCCreoDll.pdb index 1c98f2d..9150ad6 100644 Binary files a/x64/Debug/MFCCreoDll.pdb and b/x64/Debug/MFCCreoDll.pdb differ