fix(ground): WSL에서 지반 생성 Python·DWG 변환 실행 경로 해결

- 공통 resolvePython: Windows venv → .venv/bin/python → PIERZAINER_PYTHON → python3/python
- 지반 생성·수량산출 Excel·DWG 출력 서버가 같은 해석기 사용, ENOENT 안내 문구 보강
- WSL에서 번들 dwg2dxf.exe 호출 시 wslpath -w로 경로 변환, .exe 실행 권한 부여
- 실제 운곡교 DWG+Excel로 엔진/HTTP 경로 생성 확인(교각16·지형6,545점)

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
ypshimandClaude Haiku 5.5 committed 2026-11-09 14:03:16 +09:00
1 parent f51865c57b
commit d740406a8c
16 files changed
+67 -6

No files matched your search

+3 -2
View File
@@ -5,6 +5,7 @@ import { existsSync } from 'node:fs';
import { mkdir,readFile,writeFile } from 'node:fs/promises';
import { randomUUID } from 'node:crypto';
import path from 'node:path';
import { resolvePython } from '../pierzainer_ground/python-runtime.ts';
export const DWG_API='/__pierzainer/general-arrangement/dwg';
/** A narrow local export route; no project state or existing drawing-extractor endpoints are changed. */
@@ -21,8 +22,8 @@ export function generalArrangementDwgPlugin(root:string):Plugin{
for await(const chunk of req){const b=Buffer.from(chunk);size+=b.length;if(size>20*1024*1024)throw new Error('도면 크기가 20MB를 넘습니다.');chunks.push(b);}
const body=JSON.parse(Buffer.concat(chunks).toString('utf8')) as {dxf?:unknown};
if(typeof body.dxf!=='string'||!body.dxf.includes('SECTION')||!body.dxf.trim().endsWith('EOF'))throw new Error('유효한 DXF 도면 데이터가 필요합니다.');
const python=path.join(root,'pierzainer_ground','.venv','Scripts','python.exe'),script=path.join(root,'도면작성','dwg_export.py');
if(!existsSync(python))throw new Error('DWG 출력용 기존 Python 실행 환경을 찾을 수 없습니다.');
const python=resolvePython(root),script=path.join(root,'도면작성','dwg_export.py');
if(path.isAbsolute(python)&&!existsSync(python))throw new Error('DWG 출력용 기존 Python 실행 환경을 찾을 수 없습니다.');
const folder=path.join(root,'도면작성','output',randomUUID());await mkdir(folder,{recursive:true});
const source=path.join(folder,'source.dxf'),output=path.join(folder,'general.dwg');await writeFile(source,body.dxf,'utf8');
const result=await new Promise<{code:number;stdout:string;stderr:string}>((resolve,reject)=>{