This commit is contained in:
2026-03-08 15:27:02 +08:00
parent 190a80f7ef
commit 22496d2b5e
+12 -3
View File
@@ -157,9 +157,18 @@ class GeometryVerificationService:
if stderr_text:
logger.warning(f"验证脚本 stderr: {stderr_text[:500]}")
# 检查是否有 FreeCAD 权限错误
if 'Cannot read STEP file' in stderr_text or 'Cannot read STEP file' in stdout_text:
logger.warning("FreeCAD 无法读取文件(可能是 snap 沙盒限制),使用 PythonOCC 验证")
# 检查是否有 FreeCAD 错误
has_error = (
'Cannot read STEP file' in stderr_text or
'Cannot read STEP file' in stdout_text or
'Exception while processing file' in stderr_text or
'Exception while processing file' in stdout_text or
'所有导入方法都失败' in stdout_text or
process.returncode != 0
)
if has_error:
logger.warning("FreeCAD 验证失败,使用 PythonOCC 验证")
return self._verify_with_pythonocc_only(stp_path_str)
if process.returncode == 0: