Files
Pier_v1/Code/review_pipeline/dots_method/okcol4.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

16 lines
1.1 KiB
Python

import sys; sys.path.insert(0,"."); sys.path.insert(0,"pylib")
import pickle, collections, swdots, math, numpy as np, io
segs,texts=pickle.load(open('cache_옥성교P1.dxf.pkl','rb')); swdots.segs=segs
o=io.open('okcol4.txt','w',encoding='utf-8')
def fit(pts):
A=np.array([[2*x,2*y,1] for x,y in pts]); b=np.array([x*x+y*y for x,y in pts])
s=np.linalg.lstsq(A,b,rcond=None)[0]; cx,cy=s[0],s[1]; return cx,cy,math.sqrt(s[2]+cx*cx+cy*cy)
for nm,(cx0,cy0) in {'C-C':(624030,335430),'D-D':(631600,335430),'E-E':(639490,335430),'F-F':(608700,322950)}.items():
D=swdots.dots(cx0-1700,cx0+1700,cy0-1700,cy0+1700,maxlen=60)
sz=collections.Counter((d[2],d[3]) for d in D); o.write(u'%s dots %s\n'%(nm,sz.most_common(6)))
P=[(d[0],d[1]) for d in D if d[2]==22.5 and d[3]==22.5]
if len(P)>10:
cx,cy,r=fit(P); rr=[math.hypot(x-cx,y-cy) for x,y in P]
o.write(u' 22.5점 %d개 중심 (%.1f,%.1f) r %.1f (min %.1f max %.1f)\n'%(len(P),cx,cy,r,min(rr),max(rr)))
c=collections.Counter(round(v/10)*10 for v in rr); o.write(u' 군집 %s\n'%sorted(c.items()))