Files
Aislo/B06_Section/B06_Section_UI_Cross_Berm_Info.ts

46 lines
2.2 KiB
TypeScript

/* =============================================================================
* B06_Section_UI_Cross_Berm_Info.ts
* 사면길이 3m 초과 — 소단 **검토 대상 정보** 판정(2026-09-15 브레인 ③) — 값만 가리고 그리지 않는다.
*
* 근거 — 산림자원법 시행규칙 별표2 Ⅰ.2.차.(5) 「절토·성토한 경사면이 붕괴 또는 밀려 내려갈 우려가
* 있는 지역에는 사면길이 2~3미터마다 폭 50~100센티미터로 … 소단을 설치한다」.
* ⚠ **경고가 아님** — 「우려가 있는 지역」을 우리가 판정 못 함(성토사면 5m 는 「초과하는 경우」라 또렷해
* 경고). 소단이 선 쪽은 길이가 소단 사이 가장 긴 도막으로 재져 저절로 빠진다.
* 벽이 선 쪽은 뺀다 — 성토사면 경고와 같은 규칙(`wallSides`).
* ========================================================================== */
import type { CrossSection } from "./B06_Section_Api_Fetch";
import {
wallSides,
type FillSlopeSideLength,
type FillSlopeSideName,
type FillSlopeWarning,
} from "./B06_Section_UI_Cross_FillSlope_Warn";
/** 브레인 문구 그대로(2026-09-15) — 고치면 다시 받을 것. */
export const BERM_INFO_TEXT =
"사면길이 3m 초과 — 소단 검토 대상(별표2 차.(5) · 붕괴 우려 지역 조건)";
/** 별표2 「사면길이 2~3미터마다」의 위 끝. */
export const BERM_REVIEW_LENGTH_M = 3;
/** 3m 를 **넘는** 사면(절·성토 · 벽 선 쪽 뺌)이 있는 측점만 — 측점 순서 그대로. */
export function bermReviewStations(
sections: ReadonlyArray<CrossSection>,
lengthsOf: (section: CrossSection) => Record<FillSlopeSideName, FillSlopeSideLength | null>,
): FillSlopeWarning[] {
const rows: FillSlopeWarning[] = [];
for (const section of sections) {
const lengths = lengthsOf(section);
const walls = wallSides(section);
const sides = (["left", "right"] as const)
.filter((side) => !walls.has(side))
.flatMap((side) => {
const length = lengths[side];
return length && length.lengthM > BERM_REVIEW_LENGTH_M + 1e-6 ? [{ side, ...length }] : [];
});
if (sides.length) rows.push({ section, sides });
}
return rows;
}