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>
This commit is contained in:
commit
964a841de1
3978 files changed
+58013356
No files matched your search
@@ -0,0 +1,53 @@
|
||||
"""Colour rebar pipe solids by nominal diameter (run inside Rhino 8 via runner after the rebar stages).
|
||||
|
||||
Globals: PARAMS_PATH. Ported from Code/교각모델링/apply_rebar_colors.py (Ungok P1, model v0.1.09).
|
||||
|
||||
Rule (context-migration/디자인지침_경로.md, R8 criteria 2026-10-07): same diameter -> same colour
|
||||
regardless of steel grade (S = SD500, H = SD400). Centrelines keep their layer colour.
|
||||
Prints a check: per-diameter object count and colour, and any pipe whose colour does not match.
|
||||
"""
|
||||
import json
|
||||
from collections import Counter
|
||||
|
||||
from Rhino.DocObjects import ObjectColorSource
|
||||
from System.Drawing import Color
|
||||
|
||||
doc = __rhino_doc__
|
||||
P = json.load(open(PARAMS_PATH, encoding="utf-8"))
|
||||
PID = P["pier_id"]
|
||||
PALETTE = {int(k): tuple(v) for k, v in P["display"]["rebar_palette"].items()}
|
||||
|
||||
|
||||
def main():
|
||||
done, bad = Counter(), []
|
||||
for o in list(doc.Objects):
|
||||
oid = o.Attributes.GetUserString("id") or ""
|
||||
if not oid.startswith(f"{PID}-R-"):
|
||||
continue
|
||||
dia = int(o.Attributes.GetUserString("dia")[1:]) # 'S32' / 'H19' -> 32 / 19
|
||||
if dia not in PALETTE:
|
||||
bad.append((oid, "no palette entry"))
|
||||
continue
|
||||
attr = o.Attributes.Duplicate()
|
||||
attr.ObjectColor = Color.FromArgb(*PALETTE[dia])
|
||||
attr.ColorSource = ObjectColorSource.ColorFromObject
|
||||
doc.Objects.ModifyAttributes(o, attr, True)
|
||||
done[dia] += 1
|
||||
# check (re-read objects)
|
||||
seen = {}
|
||||
for o in doc.Objects:
|
||||
oid = o.Attributes.GetUserString("id") or ""
|
||||
if oid.startswith(f"{PID}-R-"):
|
||||
dia = int(o.Attributes.GetUserString("dia")[1:])
|
||||
c = o.Attributes.ObjectColor
|
||||
ok = o.Attributes.ColorSource == ObjectColorSource.ColorFromObject and (c.R, c.G, c.B) == PALETTE[dia]
|
||||
if not ok:
|
||||
bad.append((oid, "colour mismatch"))
|
||||
seen.setdefault(dia, set()).add((c.R, c.G, c.B))
|
||||
doc.Views.Redraw()
|
||||
print(json.dumps(dict(coloured=dict(done), colours_per_dia={k: list(v) for k, v in seen.items()},
|
||||
distinct_colours=len({tuple(PALETTE[k]) for k in seen}), mismatches=bad[:10],
|
||||
mismatch_count=len(bad))))
|
||||
|
||||
|
||||
main()
|
||||
Reference in new issue
Block a user