- 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>
46 lines
2.2 KiB
Python
46 lines
2.2 KiB
Python
#! python3
|
|
# read-only: geometry of coping stirrup / closed bars of Sanoe (C7-C13, P2, B8), first bar of each mark
|
|
import os, json, math, traceback, collections
|
|
import Rhino
|
|
|
|
P = r"D:\★Pier 자료\프로그램\Pier_T\검토파일\검토_산외교P1\산외교P1 G5_수정2_20261026.3dm"
|
|
OUT = r"C:\Users\User\AppData\Local\PierApp\jobs\c1_work\c1_stirrup_dump.json"
|
|
MARKS = ["C5", "C7", "C8", "C9", "C10", "C11", "C12", "C13", "C14", "C15", "P2"]
|
|
res = {}
|
|
try:
|
|
doc = Rhino.RhinoDoc.OpenHeadless(P)
|
|
st = Rhino.DocObjects.ObjectEnumeratorSettings()
|
|
st.HiddenObjects = True; st.LockedObjects = True; st.NormalObjects = True
|
|
lay = {l.Index: l.FullPath for l in doc.Layers}
|
|
seen = collections.defaultdict(list)
|
|
for o in doc.Objects.GetObjectList(st):
|
|
g = o.Geometry
|
|
if not (isinstance(g, Rhino.Geometry.Curve) and "중심선" in lay.get(o.Attributes.LayerIndex, "")):
|
|
continue
|
|
m = o.Attributes.GetUserString("mark")
|
|
if m in MARKS:
|
|
seen[m].append(o)
|
|
for m in MARKS:
|
|
lst = seen.get(m, [])
|
|
if not lst:
|
|
continue
|
|
o = lst[len(lst) // 2]
|
|
a = o.Attributes
|
|
g = o.Geometry
|
|
info = {"n": len(lst), "name": a.Name, "dia": a.GetUserString("dia"), "shape": a.GetUserString("shape"), "design_length": a.GetUserString("design_length"),
|
|
"src": (a.GetUserString("src") or "")[:240], "len": round(g.GetLength(), 1), "closed": g.IsClosed, "segs": []}
|
|
if isinstance(g, Rhino.Geometry.PolyCurve):
|
|
for i in range(g.SegmentCount):
|
|
s = g.SegmentCurve(i)
|
|
ok, arc = s.TryGetArc()
|
|
p0, p1 = s.PointAtStart, s.PointAtEnd
|
|
info["segs"].append([type(s).__name__[:4], round(s.GetLength(), 1), round(arc.Radius, 1) if ok and not s.IsLinear() else None,
|
|
round(math.degrees(arc.Angle), 1) if ok and not s.IsLinear() else None,
|
|
[round(p0.X), round(p0.Y), round(p0.Z)], [round(p1.X), round(p1.Y), round(p1.Z)]])
|
|
res[m] = info
|
|
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)
|