X
This commit is contained in:
@@ -157,9 +157,18 @@ class GeometryVerificationService:
|
|||||||
if stderr_text:
|
if stderr_text:
|
||||||
logger.warning(f"验证脚本 stderr: {stderr_text[:500]}")
|
logger.warning(f"验证脚本 stderr: {stderr_text[:500]}")
|
||||||
|
|
||||||
# 检查是否有 FreeCAD 权限错误
|
# 检查是否有 FreeCAD 错误
|
||||||
if 'Cannot read STEP file' in stderr_text or 'Cannot read STEP file' in stdout_text:
|
has_error = (
|
||||||
logger.warning("FreeCAD 无法读取文件(可能是 snap 沙盒限制),使用 PythonOCC 验证")
|
'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)
|
return self._verify_with_pythonocc_only(stp_path_str)
|
||||||
|
|
||||||
if process.returncode == 0:
|
if process.returncode == 0:
|
||||||
|
|||||||
Reference in New Issue
Block a user