This commit is contained in:
2026-03-08 04:06:35 +08:00
parent 21bd3acf73
commit 5961c3d08f
+4 -3
View File
@@ -73,7 +73,8 @@ class GeometryVerificationService:
try:
result = subprocess.run(['which', cmd_name], capture_output=True, text=True)
if result.returncode == 0 and result.stdout.strip():
cmd = [cmd_name, str(self.verification_script), stp_path_str]
# 使用绝对路径
cmd = [cmd_name, str(self.verification_script), str(Path(stp_path_str).absolute())]
logger.debug(f"找到 FreeCAD 命令: {cmd_name}")
break
except:
@@ -87,7 +88,7 @@ class GeometryVerificationService:
cmd = [
'env', 'QT_QPA_PLATFORM=offscreen',
'freecad', '-c',
str(self.verification_script), stp_path_str
str(self.verification_script), str(Path(stp_path_str).absolute())
]
except:
pass
@@ -97,7 +98,7 @@ class GeometryVerificationService:
try:
result = subprocess.run(['which', 'xvfb-run'], capture_output=True, text=True)
if result.returncode == 0:
cmd = ['xvfb-run', 'freecad', '-c', str(self.verification_script), stp_path_str]
cmd = ['xvfb-run', 'freecad', '-c', str(self.verification_script), str(Path(stp_path_str).absolute())]
except:
pass