Files
Aislo/B06_Section/logic/B06_Section_UI_Cross_Berm_Info.ts
T
eomsangdonandClaude Opus 5.5 281c71b55b refactor(logic): 348-1 순수 계산 TS 49 파일 <페이지>/logic/ 로 옮김 — 이름 앞머리 그대로 · 동작 고침 없음
- 옮김: B04 2 · B05 23 · B06 11 · A00_Common/design 13 (9,299 줄) · 이미 logic/ 에 있던 16 파일 그대로
- 안 옮김: 묶음 입구(package.json build:*) · 파이썬 · 순수지만 계산 아닌 8 (보기 결선 · 콜백 · API 타입 · 갈아끼움 알림판)
- import 266 줄(142 파일) · 시험 · 주석 · 짝 표시 문자열 경로 고침 · B05 · B06 CLAUDE.md 짝 줄 logic/
- 시험 도우미 새 경로: 가짜 require 열쇠 · B05()/B06() 부름 · 형제 import 자리 · tsc 묶어 돌리는 시험 · 정규식 · rglob
- design_view_cross 줄 한도 시험 685 → 688 (긴 import 경로 줄바꿈 3줄)
- 확인: typecheck 0 · 서버 묶음 넷(corridor · server-calc · b07-extent · b07-note) 다시 지어 코드 같음(//#region 경로 주석만 다름) · 관련 시험 270 파일 — 남은 실패 19 는 옮기기 전과 같음

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014utrjfoW831Vc5wJUd13kL
2026-10-16 13:44:50 +09:00

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;
}