- Code\rebar_pipeline, review_pipeline, pier-program을 정션에서 실제 폴더로 전환 - Code\rhino_mcp 및 CLAUDE_rhino배경.md 추가, .mcp.json은 PYTHONPATH로 새 위치 사용 - pier-program 내부 .git 제거(이력은 backup\pier-program_20261028.bundle에 보관) - worktree 가이드 반영(CLAUDE.local.md, HANDOFF.md) - D:\Rhino-MCP 경로 참조를 새 위치로 치환 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
56 lines
3.1 KiB
Python
56 lines
3.1 KiB
Python
"""운곡교 마크별 대조 이미지: 재료표 형식 → 도면(DXF 3.dxf) 이형철근 상세 형식 그림 ↔ 모델 형상 ↔ 표 L/모델 L.
|
|
입력: 검토_운곡교P1/도면_이형철근상세_DXF렌더.png (render_dxf.py 로 3.dxf 영역 렌더, 4800x2586), jobs/c1_work/c1_shape_audit2.json. 출력: 수정후_캡처/도면대조_운곡_<부재>.png"""
|
|
import json
|
|
from pathlib import Path
|
|
import numpy as np
|
|
import matplotlib
|
|
matplotlib.use("Agg")
|
|
import matplotlib.pyplot as plt
|
|
from matplotlib import font_manager
|
|
from PIL import Image
|
|
font_manager.fontManager.addfont(r"C:\Windows\Fonts\malgun.ttf")
|
|
plt.rcParams["font.family"] = "Malgun Gothic"
|
|
ROOT = Path(r"D:\★Pier 자료\프로그램\Pier_T")
|
|
SRC = Image.open(ROOT / "검토파일" / "검토_운곡교P1" / "도면_이형철근상세_DXF렌더.png").convert("RGB")
|
|
D = json.load(open(r"C:\Users\User\AppData\Local\PierApp\jobs\c1_work\c1_shape_audit2.json", encoding="utf-8-sig"))["운곡"]
|
|
OUT = ROOT / "검토파일" / "수정후_캡처"
|
|
ROM = ["I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII", "XIII", "XIV", "XV", "XVI", "XVII"]
|
|
S = 2.4
|
|
XS = [20, 347, 674, 1001, 1327, 1653, 1980]
|
|
YS = [85, 410, 738, 1065]
|
|
|
|
|
|
def legend(shape):
|
|
i = ROM.index(shape)
|
|
r, c = (0, i) if i < 5 else ((1, i - 5) if i < 11 else (2, i - 11))
|
|
return (int(XS[c] * S), int(YS[r] * S), int(XS[c + 1] * S), int(YS[r + 1] * S))
|
|
|
|
|
|
made = []
|
|
for part, host in {"코핑": "P1-CP", "기초": "P1-FT", "기둥": "P1-CL"}.items():
|
|
its = sorted([x for x in D if x["host"] == host], key=lambda x: (x["mark"][0], int(x["mark"][1:])))
|
|
rows = (len(its) + 1) // 2
|
|
fig, axs = plt.subplots(rows, 4, figsize=(17, rows * 2.6)); axs = np.atleast_2d(axs)
|
|
for ax in axs.ravel():
|
|
ax.axis("off")
|
|
for i, x in enumerate(its):
|
|
r, c = divmod(i, 2)
|
|
a1, a2 = axs[r][c * 2], axs[r][c * 2 + 1]
|
|
a1.axis("on"); a1.set_xticks([]); a1.set_yticks([]); a1.imshow(SRC.crop(legend(x["shape"])))
|
|
a1.set_title("도면 형식 %s → %s" % (x["shape"], x["mark"]), fontsize=9.5, fontweight="bold", color="#8a5a00")
|
|
P = np.array(x["pts"]); C = P - P.mean(0)
|
|
_, _, vt = np.linalg.svd(C, full_matrices=False); Q = C @ vt[:2].T
|
|
a2.axis("on"); a2.set_xticks([]); a2.set_yticks([])
|
|
a2.plot(Q[:, 0], Q[:, 1], "-", color="#1f77b4", lw=2); a2.plot(*Q[0], "o", color="green", ms=5); a2.plot(*Q[-1], "s", color="red", ms=5)
|
|
w, h = np.ptp(Q[:, 0]), np.ptp(Q[:, 1])
|
|
if h < 0.2 * w or w < 0.2 * h:
|
|
a2.set_aspect("auto"); a2.margins(0.08)
|
|
else:
|
|
a2.set_aspect("equal")
|
|
a2.set_title("모델 %s %s N=%d" % (x["mark"], x["dia"], x["n_obj"]), fontsize=9.5, fontweight="bold")
|
|
a2.set_xlabel("표 L=%s / 모델 %s (가로세로 비율 왜곡 가능)" % ((x["design_len"] or "-").split(".")[0], x["len"]), fontsize=8)
|
|
fig.suptitle("운곡교 %s 철근 — 재료표 형식 ↔ 도면(DXF) 형식 그림 ↔ 모델 형상" % part, fontsize=15, fontweight="bold")
|
|
fig.tight_layout(rect=(0, 0, 1, 0.97))
|
|
p = OUT / ("도면대조_운곡_%s.png" % part); fig.savefig(p, dpi=75); plt.close(fig); made.append(p.name)
|
|
print(made)
|