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,64 @@
|
||||
"""Dump concrete outline geometry (CS-CONC*) and dimension texts inside a region.
|
||||
|
||||
usage: python extract_outline.py <drawing_index> <xmin> <ymin> <xmax> <ymax> <out_name>
|
||||
Writes 판독/<out_name>.json and prints a compact listing.
|
||||
"""
|
||||
import json
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import ezdxf
|
||||
|
||||
HERE = Path(__file__).resolve().parent
|
||||
|
||||
|
||||
def inside(pts, box):
|
||||
x0, y0, x1, y1 = box
|
||||
return all(x0 <= x <= x1 and y0 <= y <= y1 for x, y in pts)
|
||||
|
||||
|
||||
def main():
|
||||
idx = int(sys.argv[1])
|
||||
box = tuple(map(float, sys.argv[2:6]))
|
||||
path = sorted((HERE / "입력DXF").glob("*.dxf"))[idx - 1]
|
||||
msp = ezdxf.readfile(path).modelspace()
|
||||
items = []
|
||||
for e in msp:
|
||||
layer = e.dxf.layer
|
||||
t = e.dxftype()
|
||||
rec = None
|
||||
if t == "LINE":
|
||||
pts = [(e.dxf.start.x, e.dxf.start.y), (e.dxf.end.x, e.dxf.end.y)]
|
||||
rec = dict(type=t, pts=pts)
|
||||
elif t == "LWPOLYLINE":
|
||||
pts = [(p[0], p[1]) for p in e.get_points()]
|
||||
rec = dict(type=t, pts=pts, closed=e.closed, bulges=[p[4] for p in e.get_points()])
|
||||
elif t in ("ARC", "CIRCLE"):
|
||||
c = e.dxf.center
|
||||
rec = dict(type=t, pts=[(c.x, c.y)], r=e.dxf.radius)
|
||||
if t == "ARC":
|
||||
rec.update(a0=e.dxf.start_angle, a1=e.dxf.end_angle)
|
||||
elif t in ("TEXT", "MTEXT"):
|
||||
p = e.dxf.insert
|
||||
txt = e.plain_text() if t == "MTEXT" else e.dxf.text
|
||||
rec = dict(type=t, pts=[(p.x, p.y)], text=txt.strip(),
|
||||
rot=e.dxf.get("rotation", 0))
|
||||
if rec and inside(rec["pts"], box):
|
||||
rec["layer"], rec["h"] = layer, e.dxf.handle
|
||||
rec["pts"] = [[round(x, 1), round(y, 1)] for x, y in rec["pts"]]
|
||||
items.append(rec)
|
||||
out = HERE / "판독" / f"{sys.argv[6]}.json"
|
||||
out.write_text(json.dumps(items, ensure_ascii=False, indent=0), encoding="utf-8")
|
||||
for r in items:
|
||||
if r["layer"].startswith("CS-CONC") or r["layer"] in ("CS-CNTL", "CS-PATT"):
|
||||
extra = {k: (round(v, 1) if isinstance(v, float) else v) for k, v in r.items()
|
||||
if k in ("r", "a0", "a1", "closed", "bulges")}
|
||||
print(r["layer"], r["type"], r["h"], r["pts"], extra)
|
||||
print("--- dimension / label texts")
|
||||
for r in items:
|
||||
if r["type"] in ("TEXT", "MTEXT") and r["layer"] in ("CS-DIMT", "CS-TEXT", "CS-DIMS"):
|
||||
print(r["pts"][0], r["rot"], r["text"])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in new issue
Block a user