diff --git a/data/std_section_table_grid.csv b/data/std_section_table_grid.csv new file mode 100644 index 0000000..031c4f6 --- /dev/null +++ b/data/std_section_table_grid.csv @@ -0,0 +1,36 @@ +27400,표준 단면도 +24350,표준단면 적용구간 +23550,"대 산 1 , 2 터 널" +23000,구 분,편 경 사,적 용 구 간 ( 개 착 구 간 제 외 ) +22550,대산방향,-2%%%,STA.3+070.00 ~ 3+555.00 +22200,대산 1터널,-2%%% ~ +3%%%,STA.3+070.00 ~ 3+145.00 +22000,당진방향 +21850,+3%%%,STA.3+145.00 ~ 3+565.00 +21500,+2%%%,STA.4+740.85 ~ 5+075.00 +21150,대산방향,+2%%% ~ -2%%%,STA.5+075.00 ~ 5+135.00 +20800,-2%%%,STA.5+135.00 ~ 5+476.31 +20600,대산 2터널 +20450,-2%%%,STA.4+745.00 ~ 5+105.00 +20100,-2%%% ~ +2%%%,STA.5+105.00 ~ 5+165.00 +19900,당진방향 +19750,+2%%%,STA.5+165.00 ~ 5+480.00 +18650,"상세 ""A""","상세 ""B""" +11500,치 수 표 +10850,치 수 표 +10400,S +10300,a,b,c,d,e,f,R1,R2,R3,R2',R3',φ1,φ2,φ1',φ2' +10200,(%) +9850,NOTE +9750,+3,2.504,2.354,2.166,1.978,1.500,1.776,"6,982","3,712","4,454","3,910","4,699",59.2860°,67.9676°,52.1470°,60.6263° +9300,+2,2.504,2.354,2.166,1.978,1.524,1.759,"6,982","3,712","4,454","3,910","4,699",58.5355°,67.2997°,52.8374°,61.2268° +8800,0,2.504,2.354,2.166,1.978,1.570,1.722,"6,982","3,712","4,454","3,910","4,699",57.0441°,65.9756°,54.2241°,62.4352° +8300,-2,2.504,2.354,2.166,1.978,1.614,1.683,"6,982","3,712","4,454","3,910","4,699",55.5645°,64.6664°,55.6193°,63.6543° +7800,-3,2.504,2.354,2.166,1.978,1.635,1.662,"6,982","3,712","4,454","3,910","4,699",54.8288°,64.0169°,56.3204°,64.2681° +6700,S +6550,A,B,C,D,E,F,G,H,I,J,K,라이닝 두께 +6450,(%) +6050,+3,6.615,1.735,1.451,1.608,1.293,0.000,-0.430,0.509,0.785,-0.638,-0.362,300 +5550,+2,6.615,1.735,1.451,1.608,1.293,0.000,-0.430,0.555,0.739,-0.592,-0.408,300 +5050,0,6.615,1.735,1.451,1.608,1.293,0.000,-0.430,0.647,0.647,-0.500,-0.500,300 +4600,-2,6.615,1.735,1.451,1.608,1.293,0.000,-0.430,0.739,0.555,-0.408,-0.592,300 +4100,-3,6.615,1.735,1.451,1.608,1.293,0.000,-0.430,0.785,0.509,-0.362,-0.638,300 diff --git a/scripts/dump_std_table.py b/scripts/dump_std_table.py new file mode 100644 index 0000000..ff0cb26 --- /dev/null +++ b/scripts/dump_std_table.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python3 +"""Task 4: dump the variable table of the standard section (C0060303-001) as a +coordinate grid. Rows = cross slope (S, 편경사) per user answer 2026-10-21; the +first row = variable names. Every TEXT on the table layers is kept (no regex +filter), so that the S column and the header row can be checked.""" +import csv +import sys +from collections import defaultdict + +import ezdxf + +SRC, OUT = sys.argv[1], sys.argv[2] +msp = ezdxf.readfile(SRC).modelspace() +cells = [(round(e.dxf.insert.x, 1), round(e.dxf.insert.y, 1), e.dxf.text.strip()) + for e in msp.query("TEXT") if e.dxf.layer in ("CS-TABL-TEX1", "CS-TABL-TEX2")] +rows = defaultdict(list) +for x, y, s in cells: + rows[round(y / 50) * 50].append((x, s)) # bucket by ~50 mm +with open(OUT, "w", newline="", encoding="utf-8") as fh: + w = csv.writer(fh) + for y in sorted(rows, reverse=True): + line = [s for x, s in sorted(rows[y])] + w.writerow([y] + line) + print(f"Y{y:>7}: " + " | ".join(f"{x:.0f}:{s}" for x, s in sorted(rows[y])))