From 0b3087e7521ffd0c72959002ab5634d76a9a6ea5 Mon Sep 17 00:00:00 2001 From: ypshim Date: Tue, 10 Nov 2026 16:55:22 +0900 Subject: [PATCH] =?UTF-8?q?fix(shape):=20=EB=B0=9B=EC=B9=A8=20=EB=B2=88?= =?UTF-8?q?=ED=98=B8=EA=B0=80=20=EC=B6=95=20=EB=B0=98=EB=8C=80=20=EB=B0=A9?= =?UTF-8?q?=ED=96=A5=EC=9D=B4=EC=96=B4=EB=8F=84=20=EA=B3=84=EB=8B=A8?= =?UTF-8?q?=EC=9D=84=20g=20=EC=88=9C=EC=84=9C=EB=A1=9C=20=EB=A7=8C?= =?UTF-8?q?=EB=93=A0=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 전·후열 받침 수가 같으면 받침을 번호 순서로 두어, 번호가 IP1 → IP3 반대로 매겨진 교각(산외교 P9: ① g 12.1, ③ g 1.3)에서 계단 경계가 거꾸로(9.42 → 4.02) 놓이고 코핑 상면이 틀렸다. 받침을 늘 g 순서로 정렬한다. Co-Authored-By: Claude Haiku 5.5 --- src/core/geometry.ts | 4 +++- tests/kink-steps.test.ts | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/core/geometry.ts b/src/core/geometry.ts index 792f566..9f1ed5e 100644 --- a/src/core/geometry.ts +++ b/src/core/geometry.ts @@ -331,7 +331,9 @@ export function buildPier(input: PierInput, ctx: PierContext = {}): PierModel { }; const frontPlaced = front.map((b) => ({ no: b.no, row: '전열' as Row, z: b.z, ...place(b) })); const backPlaced = back.map((b) => ({ no: b.no, row: '후열' as Row, z: b.z, ...place(b) })); - if (unequalRows) { frontPlaced.sort((a,b)=>a.g-b.g); backPlaced.sort((a,b)=>a.g-b.g); } + // Rows run along the coping (2026-11-10): bearing numbers may run against IP1 → IP3 (산외교 P9 ① at g 12.1, ③ at 1.3), + // so the steps are always built in g order, not number order. + frontPlaced.sort((a,b)=>a.g-b.g); backPlaced.sort((a,b)=>a.g-b.g); // Step boundaries sit midway between consecutive front bearings in coping coordinates (spec §4.3). // A step boundary less than half a block from the kink moves onto it (2026-11-10), so the step face is the mitre diff --git a/tests/kink-steps.test.ts b/tests/kink-steps.test.ts index b72dd1a..9e25fcd 100644 --- a/tests/kink-steps.test.ts +++ b/tests/kink-steps.test.ts @@ -115,3 +115,19 @@ describe('꺾임점 계단면 = 미터면 (2026-11-10)', () => { expect(topAt(m, backPart(0).profile, kink + DIM.blockSize / 2 + 0.1)).toBeCloseTo(after, 9); }); }); + +describe('받침 번호가 축 반대 방향인 교각 (2026-11-10)', () => { + it('steps are built in g order: bounds rise and each step top is its own bearing seat', () => { + // P1 with the bearing numbers reversed in each row (⑤ … ① along IP1 → IP3). + const p1 = (() => { + const wb = XLSX.read(readFileSync(fileURLToPath(new URL('../도면추출/samples/운곡교P1입력.xlsx', import.meta.url))), { type: 'buffer' }); + return parseWorkbook(wb).piers.find((p) => p.name === 'P1')!; + })(); + const renumber = (no: number) => (no <= 5 ? 6 - no : 16 - no); + const reversed = { ...p1, bearings: p1.bearings.map((b) => ({ ...b, no: renumber(b.no) })) }; + const a = buildPier(p1), b = buildPier(reversed); + for (const m of [a, b]) m.segments.forEach((s) => expect(s.s1).toBeGreaterThan(s.s0)); + expect(b.segments.map((s) => s.top)).toEqual(a.segments.map((s) => s.top)); + expect(b.segments.map((s) => s.s0)).toEqual(a.segments.map((s) => s.s0)); + }); +});