- 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>
31 lines
1.4 KiB
Python
31 lines
1.4 KiB
Python
# step script: summarise a model (runs inside Rhino, python3). Globals: OUT
|
|
import json, collections
|
|
import Rhino
|
|
doc = __rhino_doc__
|
|
lay = {}
|
|
for l in doc.Layers:
|
|
lay[str(l.Index)] = l.FullPath
|
|
cnt = collections.Counter()
|
|
samples = {}
|
|
st = Rhino.DocObjects.ObjectEnumeratorSettings()
|
|
st.HiddenObjects = True
|
|
st.LockedObjects = True
|
|
st.NormalObjects = True
|
|
st.ReferenceObjects = True
|
|
for o in doc.Objects.GetObjectList(st):
|
|
a = o.Attributes
|
|
key = (lay.get(str(a.LayerIndex), "?"), str(o.Geometry.ObjectType))
|
|
cnt[key] += 1
|
|
if key not in samples:
|
|
us = {k: a.GetUserString(k) for k in a.GetUserStrings().AllKeys} if a.GetUserStrings() else {}
|
|
s = {"name": a.Name, "userstrings": us}
|
|
g = o.Geometry
|
|
if isinstance(g, Rhino.Geometry.Curve):
|
|
s["curve"] = {"len": g.GetLength(), "type": type(g).__name__, "closed": g.IsClosed}
|
|
if isinstance(g, Rhino.Geometry.PolyCurve):
|
|
s["curve"]["segs"] = [type(g.SegmentCurve(i)).__name__ for i in range(g.SegmentCount)]
|
|
samples[key] = s
|
|
res = {"enum_count": sum(cnt.values()), "units": str(doc.ModelUnitSystem), "total": doc.Objects.Count,
|
|
"layers": [{"layer": k[0], "type": k[1], "count": v, "sample": samples[k]} for k, v in sorted(cnt.items())]}
|
|
json.dump(res, open(OUT, "w", encoding="utf-8"), ensure_ascii=False, indent=1)
|