Files

55 lines
2.5 KiB
Python

#!/usr/bin/env python3
"""프로젝트 소스와 검토 자료를 전달용 ZIP으로 묶는다."""
from pathlib import Path
from zipfile import ZIP_DEFLATED, ZipFile
ROOT = Path(__file__).resolve().parents[1]
OUTPUT = ROOT / "public/BLOCK8_소스코드_전달자료.zip"
ARCHIVE_ROOT = "광터지하차도_BLOCK8_전달자료"
EXCLUDED = {"BLOCK8_소스코드_전달자료.zip"}
GUIDE = """# 광터지하차도 BLOCK8 전달 자료 안내
이 압축 파일에는 웹 3D 모델의 전체 작성 코드와 결과물, 근거 자료가 들어 있습니다.
## 실행 방법
1. Node.js를 설치합니다.
2. 이 폴더에서 `npm install`을 실행합니다.
3. `npm run dev`를 실행하고 터미널에 나온 주소를 브라우저에서 엽니다.
## 주요 폴더
- `src/`: React 화면, 뷰어, 모델 JSON
- `scripts/`: DXF 모델 추출, SVG 미리보기 생성, 단독 HTML 생성, 전달 ZIP 생성 코드
- `public/`: 원본 DXF, 분석·작업·커밋 기록, 단독 HTML 결과물
- `docs/`: 상세 분석과 모델 미리보기
- `public/drawing-images/`: 도면 SVG 오버레이와 픽셀-CAD 연결 정보
## 포함하지 않은 항목
`node_modules/`, `dist/`, `.git/`은 포함하지 않았습니다. 의존성은 `npm install`로 설치하고, 빌드 결과는 `npm run build`로 다시 만들 수 있습니다. Git 커밋 목록은 `public/BLOCK8_커밋기록.md`에서 확인하세요.
현재 압축본에는 DXF에서 생성한 평면·상부평면·종단·A-A/B-B 오버레이 이미지가 포함되어 있습니다. 3D 기준면 배치는 참고 시각화이며, 도면 요소의 최종 치수 검증은 원본 CAD에서 수행하세요.
"""
def main():
files = [ROOT / "AGENTS.md", ROOT / "README.md", ROOT / "index.html", ROOT / "package.json", ROOT / "package-lock.json", ROOT / "vite.config.js"]
for folder in ("src", "scripts", "docs", "public"):
files.extend(path for path in (ROOT / folder).rglob("*") if path.is_file() and path.name not in EXCLUDED and "__pycache__" not in path.parts and path.suffix != ".pyc")
files = sorted(set(files))
OUTPUT.parent.mkdir(parents=True, exist_ok=True)
with ZipFile(OUTPUT, "w", compression=ZIP_DEFLATED, compresslevel=9) as archive:
archive.writestr(f"{ARCHIVE_ROOT}/전달자료_안내.md", GUIDE)
for path in files:
archive.write(path, f"{ARCHIVE_ROOT}/{path.relative_to(ROOT).as_posix()}")
print(f"{OUTPUT.relative_to(ROOT)} 생성 완료: {len(files) + 1}개 파일, {OUTPUT.stat().st_size:,} bytes")
if __name__ == "__main__":
main()