/* ============================================================================= * B06_Section_UI_Cross_Excavation.ts * 횡단도에 **벽 터파기 선**을 얹는다 — 관 터파기 선은 그리지 않음(사용자 10-7). * * 왜 있나 — 「터파기가 현재 횡단도에서 표현이 안 된다」가 사용자 지적이었다. 수량을 * 세기 전에 **도면에 그것이 보여야** 한다. * 자리 · 폭 · 깊이 = `logic/B06_Section_Cross_Excavation_Geom`(472-3). * * ⚠ 근거의 급이 다르므로 **노티스를 갈라 적는다** — 값은 `common_util_excavation` 한 곳에서 * 온다(파이썬 짝과 거울 시험으로 묶여 있다). 여기서는 **그리기만** 한다. * 관 : 법정 시방서 표(KCS 44 40 10 그림 3.2-1) * 벽 : 법정 근거 없음 — 실무 정본 식(구조도 기슭막이 xls) * ⚠ **비탈을 주지 않는다 — 수직으로 그린다.** 정본 식에 기울기 항이 없다. * ========================================================================== */ import { BASIS_WALL } from "@util/common_util_excavation"; import type { WallLayout } from "./logic/B06_Section_Cross_Culvert_Types"; import { wallTrench } from "./logic/B06_Section_Cross_Excavation_Geom"; const SVG_NS = "http://www.w3.org/2000/svg"; function trenchPath(layer: SVGElement, corners: Array<[number, number]>, tooltip: string): void { const line = document.createElementNS(SVG_NS, "polyline"); line.setAttribute("points", corners.map(([px, py]) => `${px},${py}`).join(" ")); line.setAttribute("class", "b06-chart__excavation"); const title = document.createElementNS(SVG_NS, "title"); title.textContent = tooltip; line.append(title); layer.append(line); } /** * 벽 터파기 — 벽 바닥선 아래로 **수직**(자리 = `wallTrench`). * `foundation` 이 비어 있으면 **그리지 않는다** — 사용자가 고르기 전에는 근거가 없다. */ export function appendWallTrench( layer: SVGElement, wall: WallLayout, foundation: "기초유" | "기초버림" | null, x: (offset: number) => number, toDisplayY: (elevation: number) => number, ): { widthM: number; depthM: number } | null { const trench = wallTrench(wall, foundation); if (!trench) return null; const { left, right, top, bottom, widthM, depthM } = trench; trenchPath( layer, [ [x(left), toDisplayY(top)], [x(left), toDisplayY(bottom)], [x(right), toDisplayY(bottom)], [x(right), toDisplayY(top)], ], `${foundation} 터파기 폭 ${widthM.toFixed(2)}m · 깊이 ${depthM.toFixed(2)}m (수직)\n` + `품셈에 규정이 없어 실무 관행으로 정한 값 — ${BASIS_WALL}`, ); return { widthM, depthM }; }