From 5961c3d08f8d7e2df4e2c0804437057bbd90acd9 Mon Sep 17 00:00:00 2001 From: SZCJW <792430652@qq.com> Date: Sun, 8 Mar 2026 04:06:35 +0800 Subject: [PATCH] x --- src/services/verification_service.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/services/verification_service.py b/src/services/verification_service.py index d3afdfb..1391453 100644 --- a/src/services/verification_service.py +++ b/src/services/verification_service.py @@ -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