Files
Pier_v1/Code/교각모델링/extract_sole_plates.py
T
ahnyongjooandClaude Sonnet 5.5 964a841de1 chore(rebar): Pier_T_rebar 작업 폴더 초기 구성 및 외부 의존 파일 통합
- 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>
2026-10-28 11:20:18 +09:00

48 lines
2.3 KiB
Python

"""D2 sole plate TABLE -> params.json `sole_plates` (existing keys unchanged).
Rules (HITL 2026-10-08): bearing = (L-100) x (W-100) box, height h3, black; sole plate L x W, bottom flat on the
bearing, top sloped S(%) along the bridge axis (= h2 pad long axis), centre thickness T; thicker end T1 at the
front (-Y) side. L is along the pad's long axis, W across (L = A+100, W = B+100).
"""
import json
from collections import defaultdict
from pathlib import Path
HERE = Path(__file__).resolve().parent
COLS = {"NO": 2584, "S": 3378, "L": 4582, "W": 5482, "T": 6433, "T1": 7333, "T2": 8233}
def main():
texts = json.loads((HERE / "판독" / "2_survey.json").read_text(encoding="utf-8"))["texts"]
rows = defaultdict(dict)
for t in texts:
if 1000 < t["x"] < 9000 and 7000 < t["y"] < 12400:
col = min(COLS, key=lambda c: abs(COLS[c] - t["x"]))
if abs(COLS[col] - t["x"]) < 150:
rows[round(t["y"])][col] = t["text"]
table = []
for y in sorted(rows, reverse=True):
r = rows[y]
table.append(dict(no=int(r["NO"]), S=float(r["S"]), L=int(r["L"]), W=int(r["W"]), T=int(r["T"]),
T1=int(r["T1"]), T2=int(r["T2"]), src_y=y))
assert [r["no"] for r in table] == list(range(1, 11))
pp = HERE / "params.json"
params = json.loads(pp.read_text(encoding="utf-8"))
bear = {b["no"]: b for b in params["bearing_seats"]["bearings"]}
checks = []
for r in table:
b = bear[r["no"]]
e = r["T"] - r["S"] / 100 * r["L"] / 2 # thickness at the front (-along) end
checks.append(dict(no=r["no"], L_eq_A100=r["L"] == b["A"] + 100, W_eq_B100=r["W"] == b["B"] + 100,
end_thick=[round(e, 2), round(2 * r["T"] - e, 2)], T1T2=[r["T1"], r["T2"]]))
params["sole_plates"] = dict(
table=table, bearing_height="h3 (D2 ELEVATION TABLE, 181)", bearing_shrink=100, slope_dir="thicker at -along (front, -Y) [HITL]",
colours=dict(bearing=[0, 0, 0], sole_plate=[150, 150, 150]), checks=checks,
src="D2 솔플레이트 상세 TABLE (NO., S(%), L, W, T, T1, T2); ELEVATION TABLE h3; 사용자 지시 2026-10-08")
pp.write_text(json.dumps(params, ensure_ascii=False, indent=2), encoding="utf-8")
print(json.dumps(checks, ensure_ascii=False))
if __name__ == "__main__":
main()