Files
Pier_v1/Code/rebar_pipeline/rhino/01_section_profile.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

34 lines
1.3 KiB
Python

# execute_rhino_code (IronPython 2.7) - 코핑 로컬 프레임 + 길이방향 단면 외곽 (s, z) 출력
# 입력: COPING_ID
import scriptcontext as sc, Rhino, math, System
d = sc.doc
tol = d.ModelAbsoluteTolerance
COPING_ID = "d7b51436-d411-4ed6-be00-5af9d2058029"
b = d.Objects.FindId(System.Guid(COPING_ID)).Geometry
# 1) 길이방향 각도: 수평 edge 방향 히스토그램
angs = {}
for e in b.Edges:
v = e.PointAtEnd - e.PointAtStart
if abs(v.Z) < 1 and v.Length > 1000:
a = round(math.degrees(math.atan2(v.Y, v.X)) % 180.0, 3)
angs[a] = angs.get(a, 0) + v.Length
out = []
for k in sorted(angs.keys()):
out.append("ang %s total len %d" % (k, round(angs[k])))
# 길이방향 = bbox 범위와 맞는 쪽 선택 (대호지교 P1: 19.105)
ANG = 19.105
a = math.radians(ANG)
u = Rhino.Geometry.Vector3d(math.cos(a), math.sin(a), 0)
c = b.GetBoundingBox(True).Center
# 2) 단면
pl = Rhino.Geometry.Plane(c, u, Rhino.Geometry.Vector3d.ZAxis)
ok, crvs, pts = Rhino.Geometry.Intersect.Intersection.BrepPlane(b, pl, tol)
for sg in crvs[0].DuplicateSegments():
p0 = sg.PointAtStart; p1 = sg.PointAtEnd
out.append("%.1f,%.1f -> %.1f,%.1f" % ((p0 - c) * u, p0.Z, (p1 - c) * u, p1.Z))
sc.sticky["frame"] = (ANG, c)
result = "\n".join(out)
print(result)