diff --git a/src/view/bearing-plan-svg.ts b/src/view/bearing-plan-svg.ts index 49ffe93..0dc4b62 100644 --- a/src/view/bearing-plan-svg.ts +++ b/src/view/bearing-plan-svg.ts @@ -11,9 +11,10 @@ export interface BearingPlanOverlay { export const PAIR_CHIP_LABELS = ['①', '②', '③', '④', '⑤', '⑥', '⑦', '⑧', '⑨', '⑩']; /** - * 교량받침 상세 · 평면 for one pair (승인 2026-10-26): the model's solplates and blocks, with the drawing values overlaid - * as dashed outlines when given. 일체 draws the pair's block as one outline (2500 across the 교축 × 1200 along the 교각축); - * 분리 draws two 1200 × 1200 outlines. x is the 교축 (n), y the 교각축 (s, downward); units mm. + * 교량받침 상세 · 평면 for one pair (승인 2026-10-26): the blocks and solplates are aligned in one row across the 교축 + * (x = n), with the actual 교각축 offset of the bearings written as text. The model's solplates are solid, the drawing values + * dashed. 일체 draws one 2500 × 1200 outline; 분리 draws two 1200 × 1200 outlines. Dimensions: C1 (bearing to block edge), + * C2 (between the bearings), C3 (block span). C4 and C5 are the outer margins along the 교축. */ export function bearingPlanSvg(m: PierModel, pairIndex: number, overlay?: BearingPlanOverlay): string { const pair = pairEccentricities(m.blocks)[pairIndex]; @@ -22,18 +23,27 @@ export function bearingPlanSvg(m: PierModel, pairIndex: number, overlay?: Bearin const k = m.blocks.find((b) => b.no === pair.backNo && b.row === '후열')!; const nc = (f.n + k.n) / 2; const sc = (f.s + k.s) / 2; + // The pair is drawn on one line: every block, solplate and bearing sits at the pair's mean 교각축 position. const X = (n: number) => (n - nc) * 1000; - const Y = (s: number) => (s - sc) * 1000; + const Y = (_s: number) => 0; + const eccentricity = Math.abs(f.s - k.s) * 1000; const parts: string[] = []; - // Block outline(s): 일체 = one 2500 × 1200 outline; 분리 = two 1200 × 1200 outlines. + // Axes: 교축 (horizontal, to the right) and 교각축 방향 (vertical, downward). + parts.push(``); + parts.push(``); + parts.push(`교축`); + parts.push(``); + parts.push(``); + parts.push(`교각축 방향`); + + // Block outline(s): one row. const ib = m.integratedBlocks.find((x) => x.frontNo === pair.frontNo); if (ib) { - parts.push(``); - parts.push(`C3 2500 (일체 블록 윤곽)`); + parts.push(``); } else { for (const b of [f, k]) { - parts.push(``); + parts.push(``); } } @@ -44,25 +54,39 @@ export function bearingPlanSvg(m: PierModel, pairIndex: number, overlay?: Bearin parts.push(``); } } - // Drawing values overlaid (dashed red) on the same bearings (#1 겹쳐 보이게). + // Drawing values overlaid (dashed) on the same bearings (#1 겹쳐 보이게). if (overlay) { for (const [b, v] of [[f, overlay.front], [k, overlay.back]] as const) { parts.push(``); } } - // Bearing centres and labels. + // Bearing centres and numbers. for (const b of [f, k]) { parts.push(``); parts.push(`${b.no}`); } + if (eccentricity > 0.5) { + parts.push(`편심 ${eccentricity.toFixed(0)} mm (교각축 방향, 블록은 한 줄로 맞춤)`); + } - // Dimensions: C2 between the bearing centres, C4 and C5 from the bearing to the block edges (교축). + // Dimensions along the bottom: C1 (bearing to block edge), C2 (between the bearings), C1, and C3 (block span). const dist = bearingEdgeDistances(m); const d = (no: number) => dist.find((x) => x.no === no)!; - parts.push(`C2 ${Math.round(Math.abs(k.n - f.n) * 1000)}`); - parts.push(`C4 ${Math.round(d(f.no).leftMm ?? 0)}`); - parts.push(`C5 ${Math.round(d(k.no).rightMm ?? 0)}`); + const xLeft = ib ? X(ib.n - 1.25) : X(f.n) - 600; + const xRight = ib ? X(ib.n + 1.25) : X(k.n) + 600; + const dimLine = (x1: number, x2: number, y: number, label: string) => + `${label}`; + const y1 = 760; + const y2 = 1000; + parts.push(dimLine(xLeft, X(f.n), y1, `C1 ${Math.round(d(f.no).leftMm ?? 600)}`)); + parts.push(dimLine(X(f.n), X(k.n), y1, `C2 ${Math.round(Math.abs(k.n - f.n) * 1000)}`)); + parts.push(dimLine(X(k.n), xRight, y1, `C1 ${Math.round(d(k.no).rightMm ?? 600)}`)); + parts.push(dimLine(xLeft, xRight, y2, `C3 ${Math.round((xRight - xLeft))}`)); - return `${parts.join('')}`; + // C4 and C5: the outer margins along the 교축, shown at the outer block edges. + parts.push(`C4 ${Math.round(d(f.no).leftMm ?? 0)}`); + parts.push(`C5 ${Math.round(d(k.no).rightMm ?? 0)}`); + + return `${parts.join('')}`; }