Files
Pier_v1/Code/검토수정/스크립트/c1_b9_verify.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

42 lines
2.0 KiB
Python

#! python3
import os, json, math, collections, traceback
import Rhino
P = r"D:\★Pier 자료\프로그램\Pier_T\검토파일\철근 모델랑 운곡교P1_바이브코딩\운곡교p1_수정6_20261026.3dm"
OUT = r"C:\Users\User\AppData\Local\PierApp\jobs\c1_work\c1_b9_verify.json"
res = {}
try:
doc = Rhino.RhinoDoc.OpenHeadless(P)
st = Rhino.DocObjects.ObjectEnumeratorSettings()
st.HiddenObjects = True; st.LockedObjects = True; st.NormalObjects = True
lay = {l.Index: l for l in doc.Layers}
cnt = collections.Counter(); radii = collections.Counter(); tails = collections.Counter(); lens = collections.Counter()
vis = collections.Counter()
for o in doc.Objects.GetObjectList(st):
a = o.Attributes
if a.GetUserString("mark") != "B9":
continue
g = o.Geometry
L = lay[a.LayerIndex]
vis[(L.FullPath, "layer_on" if L.IsVisible else "layer_off")] += 1
cnt["fix_attr" if a.GetUserString("b9_hook_fix") else "no_fix_attr"] += 1
if isinstance(g, Rhino.Geometry.PolyCurve):
cnt["curve"] += 1
segs = [g.SegmentCurve(i) for i in range(g.SegmentCount)]
lens[round(g.GetLength(), 1)] += 1
arcs = []
for s in segs:
ok, arc = s.TryGetArc()
if ok and not s.IsLinear():
arcs.append((round(arc.Radius, 2), round(math.degrees(arc.Angle), 1)))
radii[str(arcs)] += 1
tails[str(round(segs[-1].GetLength(), 1)) + " nseg=" + str(len(segs))] += 1
res = {"counts": dict(cnt), "arcs": dict(radii), "last_segment": dict(tails), "lengths": dict(lens),
"layers": {k[0] + "|" + k[1]: v for k, v in vis.items()}, "strings": {"수정일": doc.Strings.GetValue("수정일"), "수정내용": doc.Strings.GetValue("수정내용")},
"objects": doc.Objects.Count}
doc.Dispose()
except Exception:
res["error"] = traceback.format_exc()
res["done"] = True
json.dump(res, open(OUT, "w", encoding="utf-8"), ensure_ascii=False, indent=1)