diff --git a/src/view/footing-svg.ts b/src/view/footing-svg.ts index 84b4674..7cbfa5e 100644 --- a/src/view/footing-svg.ts +++ b/src/view/footing-svg.ts @@ -13,6 +13,18 @@ const PILE_STUB = 4; const mm = (v: number) => Math.round(v * 1000); +/** Horizontal dimension line from x1 to x2 at height y, with 45° ticks and a centred label above it (승인 2026-10-23). */ +function dimH(x1: number, x2: number, y: number, label: string): string { + const t = 0.12; + return `${label}`; +} + +/** Vertical dimension line from y1 to y2 at x, with 45° ticks and the label to its right. */ +function dimV(x: number, y1: number, y2: number, label: string): string { + const t = 0.12; + return `${label}`; +} + /** A break mark (끊음): two short slanted strokes "//" centred on (x, y), so the member is shown as cut. */ function breakMark(x: number, y: number, halfWidth: number): string { const d = 0.12; @@ -29,7 +41,7 @@ function svgOf(x0: number, y0: number, w: number, h: number, label: string, body export function footingPlanSvg(model: PierModel): string { const f = model.footings[0]; if (!f) return ''; - const pad = 0.8; + const pad = 1.5; const x0 = f.s - f.length / 2 - pad; const y0 = -f.width / 2 - pad; const w = f.length + 2 * pad; @@ -56,7 +68,7 @@ export function footingSideSvg(model: PierModel): string { const piles = model.piles.filter((p) => Math.abs(p.s - f.s) <= f.length / 2 + 1e-6); const pileTop = piles.length ? Math.max(...piles.map((p) => p.top)) : f.bottom; const pileLen = piles.length ? piles[0].top - piles[0].bottom : 0; - const pad = 0.8; + const pad = 1.5; const x0 = f.s - f.length / 2 - pad; const w = f.length + 2 * pad; // Visible band in EL: from the column stub above the footing top, down to the pile stub below the footing bottom. @@ -81,10 +93,15 @@ export function footingSideSvg(model: PierModel): string { // Break mark across the pile group, in the lower stub (the pile label sits below it). parts.push(breakMark(f.s, -(botEl + 0.6), f.length / 2)); } - parts.push(`h1 ${mm(f.top - f.bottom)}`); if (piles.length) { parts.push(`말뚝 ${mm(pileLen)} (끊음)`); } + // Dimension lines (치수선): footing length above, footing height at the right, the visible pile length at the left. + parts.push(dimH(f.s - f.length / 2, f.s + f.length / 2, -(f.top + 0.8), `${mm(f.length)}`)); + parts.push(dimV(f.s + f.length / 2 + 0.5, -f.top, -f.bottom, `h1 ${mm(f.top - f.bottom)}`)); + if (piles.length) { + parts.push(dimV(f.s - f.length / 2 - 0.5, -f.bottom, -(botEl + 0.6), `${mm(pileLen)} (끊음)`)); + } void pileTop; return svgOf(x0, y0, w, h, '확대기초·말뚝 측면', parts.join('')); }