feat(view): read the bearing ELEVATION TABLE from a DXF drawing (교각도(2) P1) by position

The reader takes TEXT and MTEXT entities (x, y, text). The EL.X header row names the columns; the No column holds the
bearing numbers; each value is the nearest entry under its header on the same row. On the 운곡교 교각도(2) drawing all ten
bearings read back the reference values (EL.X, h1, h2). The 도면 불러오기 button accepts .dxf as well as sheets. The test
fixture holds only the table's text entries.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
ypshimandClaude Haiku 5.5 committed 2026-10-23 14:34:33 +09:00
1 parent 6f32bd96c4
commit 4048c326e3
4 files changed
+813 -10

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
import { describe, expect, it } from 'vitest';
import { readFileSync } from 'node:fs';
import { BEARING_ELEVATION_REF } from '../src/core/bearing-ref';
import { parseBearingElevationTable, readDxfTexts, type DxfText } from '../src/core/dxf-table';
const texts = JSON.parse(readFileSync(new URL('./fixtures/bearing-table-texts.json', import.meta.url), 'utf-8')) as DxfText[];
describe('도면 받침 ELEVATION TABLE 읽기 (DXF 텍스트, 승인 2026-10-23)', () => {
it('reads all ten bearings from the 운곡교 교각도(2) table', () => {
const r = parseBearingElevationTable(texts);
expect(r.errors).toEqual([]);
expect(r.drawing.map((d) => d.no)).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
});
it('the values equal the reference table used for the 도면 비교 (EL.X, h1, h2 on every bearing)', () => {
const r = parseBearingElevationTable(texts);
for (const ref of BEARING_ELEVATION_REF) {
const got = r.drawing.find((d) => d.no === ref.no)!;
expect(got.elx, `No ${ref.no} EL.X`).toBeCloseTo(ref.elx, 3);
expect(got.h1, `No ${ref.no} h1`).toBe(ref.h1);
expect(got.h2, `No ${ref.no} h2`).toBe(ref.h2);
}
});
it('reads TEXT entities from DXF text (x, y, string)', () => {
const dxf = ['0', 'SECTION', '2', 'ENTITIES', '0', 'TEXT', '10', '100.5', '20', '200.25', '1', 'EL. "X"', '0', 'ENDSEC'].join('\n');
expect(readDxfTexts(dxf)).toEqual([{ x: 100.5, y: 200.25, text: 'EL. "X"' }]);
});
});
+667
View File
@@ -0,0 +1,667 @@
[
{
"x": 26178.57784142365,
"y": 9341.774999716086,
"text": "교량받침 ELEVATION TABLE"
},
{
"x": 21491.64556026707,
"y": 8694.549697067356,
"text": "NO."
},
{
"x": 23035.9864390953,
"y": 8694.549697067356,
"text": "교량받침"
},
{
"x": 24938.250087564,
"y": 8694.549697067356,
"text": "EL.'X'"
},
{
"x": 26192.77738450142,
"y": 8694.549697067356,
"text": "h1"
},
{
"x": 27092.77738450142,
"y": 8694.549697067356,
"text": "h2"
},
{
"x": 27992.77738450142,
"y": 8694.549697067356,
"text": "h3"
},
{
"x": 28892.77738450142,
"y": 8694.549697067356,
"text": "h4"
},
{
"x": 29843.90920873577,
"y": 8694.549697067356,
"text": "A"
},
{
"x": 30743.90920873577,
"y": 8694.549697067356,
"text": "B"
},
{
"x": 31592.77738450142,
"y": 8694.549697067356,
"text": "C1"
},
{
"x": 32492.77738450142,
"y": 8694.549697067356,
"text": "C2"
},
{
"x": 33392.77738450142,
"y": 8694.549697067356,
"text": "C3"
},
{
"x": 21593.90920873577,
"y": 8214.549697067356,
"text": "1"
},
{
"x": 22729.19549368917,
"y": 8214.549697067356,
"text": "3500 kN 양방향"
},
{
"x": 24938.250087564,
"y": 8214.549697067356,
"text": "43.625"
},
{
"x": 26141.64556026707,
"y": 8214.549697067356,
"text": "164"
},
{
"x": 27092.77738450142,
"y": 8214.549697067356,
"text": "50"
},
{
"x": 27941.64556026707,
"y": 8214.549697067356,
"text": "181"
},
{
"x": 28892.77738450142,
"y": 8214.549697067356,
"text": "30"
},
{
"x": 29741.64556026707,
"y": 8214.549697067356,
"text": "700"
},
{
"x": 30641.64556026707,
"y": 8214.549697067356,
"text": "640"
},
{
"x": 31541.64556026707,
"y": 8214.549697067356,
"text": "600"
},
{
"x": 32390.51373603271,
"y": 8214.549697067356,
"text": "1298"
},
{
"x": 33290.51373603271,
"y": 8214.549697067356,
"text": "2500"
},
{
"x": 21593.90920873577,
"y": 7734.549697067356,
"text": "2"
},
{
"x": 22729.19549368917,
"y": 7734.549697067356,
"text": "3500 kN 양방향"
},
{
"x": 24938.250087564,
"y": 7734.549697067356,
"text": "43.697"
},
{
"x": 26141.64556026707,
"y": 7734.549697067356,
"text": "164"
},
{
"x": 27092.77738450142,
"y": 7734.549697067356,
"text": "50"
},
{
"x": 27941.64556026707,
"y": 7734.549697067356,
"text": "181"
},
{
"x": 28892.77738450142,
"y": 7734.549697067356,
"text": "30"
},
{
"x": 29741.64556026707,
"y": 7734.549697067356,
"text": "700"
},
{
"x": 30641.64556026707,
"y": 7734.549697067356,
"text": "640"
},
{
"x": 31541.64556026707,
"y": 7734.549697067356,
"text": "600"
},
{
"x": 32390.51373603271,
"y": 7734.549697067356,
"text": "1298"
},
{
"x": 33290.51373603271,
"y": 7734.549697067356,
"text": "2500"
},
{
"x": 21593.90920873577,
"y": 7254.549697067356,
"text": "3"
},
{
"x": 22626.93184522046,
"y": 7254.549697067356,
"text": "3500 kN 교축방향"
},
{
"x": 24938.250087564,
"y": 7254.549697067356,
"text": "43.768"
},
{
"x": 26141.64556026707,
"y": 7254.549697067356,
"text": "164"
},
{
"x": 27092.77738450142,
"y": 7254.549697067356,
"text": "50"
},
{
"x": 27941.64556026707,
"y": 7254.549697067356,
"text": "181"
},
{
"x": 28892.77738450142,
"y": 7254.549697067356,
"text": "30"
},
{
"x": 29741.64556026707,
"y": 7254.549697067356,
"text": "700"
},
{
"x": 30641.64556026707,
"y": 7254.549697067356,
"text": "790"
},
{
"x": 31541.64556026707,
"y": 7254.549697067356,
"text": "600"
},
{
"x": 32390.51373603271,
"y": 7254.549697067356,
"text": "1298"
},
{
"x": 33290.51373603271,
"y": 7254.549697067356,
"text": "2500"
},
{
"x": 21593.90920873577,
"y": 6774.549697067356,
"text": "4"
},
{
"x": 22729.19549368917,
"y": 6774.549697067356,
"text": "3500 kN 양방향"
},
{
"x": 24938.250087564,
"y": 6774.549697067356,
"text": "43.840"
},
{
"x": 26141.64556026707,
"y": 6774.549697067356,
"text": "164"
},
{
"x": 27092.77738450142,
"y": 6774.549697067356,
"text": "50"
},
{
"x": 27941.64556026707,
"y": 6774.549697067356,
"text": "181"
},
{
"x": 28892.77738450142,
"y": 6774.549697067356,
"text": "30"
},
{
"x": 29741.64556026707,
"y": 6774.549697067356,
"text": "700"
},
{
"x": 30641.64556026707,
"y": 6774.549697067356,
"text": "640"
},
{
"x": 31541.64556026707,
"y": 6774.549697067356,
"text": "600"
},
{
"x": 32390.51373603271,
"y": 6774.549697067356,
"text": "1298"
},
{
"x": 33290.51373603271,
"y": 6774.549697067356,
"text": "2500"
},
{
"x": 21593.90920873577,
"y": 6294.549697067356,
"text": "5"
},
{
"x": 22729.19549368917,
"y": 6294.549697067356,
"text": "3500 kN 양방향"
},
{
"x": 24938.250087564,
"y": 6294.549697067356,
"text": "43.912"
},
{
"x": 26141.64556026707,
"y": 6294.549697067356,
"text": "164"
},
{
"x": 27092.77738450142,
"y": 6294.549697067356,
"text": "50"
},
{
"x": 27941.64556026707,
"y": 6294.549697067356,
"text": "181"
},
{
"x": 28892.77738450142,
"y": 6294.549697067356,
"text": "30"
},
{
"x": 29741.64556026707,
"y": 6294.549697067356,
"text": "700"
},
{
"x": 30641.64556026707,
"y": 6294.549697067356,
"text": "640"
},
{
"x": 31541.64556026707,
"y": 6294.549697067356,
"text": "600"
},
{
"x": 32390.51373603271,
"y": 6294.549697067356,
"text": "1298"
},
{
"x": 33290.51373603271,
"y": 6294.549697067356,
"text": "2500"
},
{
"x": 21593.90920873577,
"y": 5814.549697067356,
"text": "6"
},
{
"x": 22729.19549368917,
"y": 5814.549697067356,
"text": "2800 kN 양방향"
},
{
"x": 24938.250087564,
"y": 5814.549697067356,
"text": "43.600"
},
{
"x": 26141.64556026707,
"y": 5814.549697067356,
"text": "139"
},
{
"x": 27092.77738450142,
"y": 5814.549697067356,
"text": "50"
},
{
"x": 27941.64556026707,
"y": 5814.549697067356,
"text": "181"
},
{
"x": 28892.77738450142,
"y": 5814.549697067356,
"text": "30"
},
{
"x": 29741.64556026707,
"y": 5814.549697067356,
"text": "700"
},
{
"x": 30641.64556026707,
"y": 5814.549697067356,
"text": "540"
},
{
"x": 31541.64556026707,
"y": 5814.549697067356,
"text": "602"
},
{
"x": 32543.90920873577,
"y": 5814.549697067356,
"text": "-"
},
{
"x": 33443.90920873577,
"y": 5814.549697067356,
"text": "-"
},
{
"x": 21593.90920873577,
"y": 5334.549697067356,
"text": "7"
},
{
"x": 22729.19549368917,
"y": 5334.549697067356,
"text": "2800 kN 양방향"
},
{
"x": 24938.250087564,
"y": 5334.549697067356,
"text": "43.672"
},
{
"x": 26141.64556026707,
"y": 5334.549697067356,
"text": "139"
},
{
"x": 27092.77738450142,
"y": 5334.549697067356,
"text": "50"
},
{
"x": 27941.64556026707,
"y": 5334.549697067356,
"text": "181"
},
{
"x": 28892.77738450142,
"y": 5334.549697067356,
"text": "30"
},
{
"x": 29741.64556026707,
"y": 5334.549697067356,
"text": "700"
},
{
"x": 30641.64556026707,
"y": 5334.549697067356,
"text": "540"
},
{
"x": 31541.64556026707,
"y": 5334.549697067356,
"text": "602"
},
{
"x": 32543.90920873577,
"y": 5334.549697067356,
"text": "-"
},
{
"x": 33443.90920873577,
"y": 5334.549697067356,
"text": "-"
},
{
"x": 21593.90920873577,
"y": 4854.549697067356,
"text": "8"
},
{
"x": 22626.93184522046,
"y": 4854.549697067356,
"text": "2800 kN 교축방향"
},
{
"x": 24938.250087564,
"y": 4854.549697067356,
"text": "43.744"
},
{
"x": 26141.64556026707,
"y": 4854.549697067356,
"text": "139"
},
{
"x": 27092.77738450142,
"y": 4854.549697067356,
"text": "50"
},
{
"x": 27941.64556026707,
"y": 4854.549697067356,
"text": "181"
},
{
"x": 28892.77738450142,
"y": 4854.549697067356,
"text": "30"
},
{
"x": 29741.64556026707,
"y": 4854.549697067356,
"text": "700"
},
{
"x": 30641.64556026707,
"y": 4854.549697067356,
"text": "650"
},
{
"x": 31541.64556026707,
"y": 4854.549697067356,
"text": "602"
},
{
"x": 32543.90920873577,
"y": 4854.549697067356,
"text": "-"
},
{
"x": 33443.90920873577,
"y": 4854.549697067356,
"text": "-"
},
{
"x": 21593.90920873577,
"y": 4374.549697067356,
"text": "9"
},
{
"x": 22729.19549368917,
"y": 4374.549697067356,
"text": "2800 kN 양방향"
},
{
"x": 24938.250087564,
"y": 4374.549697067356,
"text": "43.816"
},
{
"x": 26141.64556026707,
"y": 4374.549697067356,
"text": "139"
},
{
"x": 27092.77738450142,
"y": 4374.549697067356,
"text": "50"
},
{
"x": 27941.64556026707,
"y": 4374.549697067356,
"text": "181"
},
{
"x": 28892.77738450142,
"y": 4374.549697067356,
"text": "30"
},
{
"x": 29741.64556026707,
"y": 4374.549697067356,
"text": "700"
},
{
"x": 30641.64556026707,
"y": 4374.549697067356,
"text": "540"
},
{
"x": 31541.64556026707,
"y": 4374.549697067356,
"text": "602"
},
{
"x": 32543.90920873577,
"y": 4374.549697067356,
"text": "-"
},
{
"x": 33443.90920873577,
"y": 4374.549697067356,
"text": "-"
},
{
"x": 21542.77738450142,
"y": 3894.549697067356,
"text": "10"
},
{
"x": 22729.19549368917,
"y": 3894.549697067356,
"text": "2800 kN 양방향"
},
{
"x": 24938.250087564,
"y": 3894.549697067356,
"text": "43.887"
},
{
"x": 26141.64556026707,
"y": 3894.549697067356,
"text": "139"
},
{
"x": 27092.77738450142,
"y": 3894.549697067356,
"text": "50"
},
{
"x": 27941.64556026707,
"y": 3894.549697067356,
"text": "181"
},
{
"x": 28892.77738450142,
"y": 3894.549697067356,
"text": "30"
},
{
"x": 29741.64556026707,
"y": 3894.549697067356,
"text": "700"
},
{
"x": 30641.64556026707,
"y": 3894.549697067356,
"text": "540"
},
{
"x": 31541.64556026707,
"y": 3894.549697067356,
"text": "602"
},
{
"x": 32543.90920873577,
"y": 3894.549697067356,
"text": "-"
},
{
"x": 33443.90920873577,
"y": 3894.549697067356,
"text": "-"
}
]