- 충돌 24 파일 = import 줄 다툼 — 518-2 새 경로(Cross_Culvert · Culvert_Geom · Extra · Wire · Types · Box_Geom · Ford_Geom · Ford_Pavement) + 518-3 새 경로(Cross_Body_Guard · Wall_Geom · Wall_Hatch_Geom · Excavation_Geom · Revetment_Geom · Structure_Layouts · Route_Carry_Patch)
- 518-2 logic 셋이 부르던 UI_Cross_Wall · Wall_Hatch · Body_Guard = 518-3 logic 경로로 · 518-3 새 logic 넷의 옛 Culvert_Types · Extra 경로 = 518-2 logic 으로
- test_472_3 GEOMETRY_PULLS 남은 3 줄(Design_Surface · Excavation · Wall_Hatch) 걷음 = 빈 목록
- Corridor_Structures prettier
- 확인 = 518-1 · 518-2 · 518-3 고친 시험 + golden_472 73 파일 444 통과 · typecheck 0 · design-calc · corridor 묶음 · 옛 판(1d5d63875) ↔ 합친 판 덧그림 대조 938 측점 같음
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
58 lines
2.3 KiB
TypeScript
58 lines
2.3 KiB
TypeScript
/* =============================================================================
|
|
* B06_Section_Cross_Excavation_Geom.ts
|
|
* 벽 터파기 **기하** — 값은 `common_util_excavation` 한 곳(파이썬 짝 · 거울 시험). 그리기는
|
|
* `../B06_Section_UI_Cross_Excavation`(472-3).
|
|
* ⚠ **비탈을 주지 않는다 — 수직.** 정본 식에 기울기 항이 없다.
|
|
* ========================================================================== */
|
|
|
|
import {
|
|
WALL_BLINDING_DEPTH_M,
|
|
WALL_BLINDING_WIDTH_M,
|
|
WALL_FOUNDATION_DEPTH_M,
|
|
WALL_FOUNDATION_WIDTH_M,
|
|
WALL_TRENCH_CLEARANCE_M,
|
|
} from "@util/common_util_excavation";
|
|
import type { WallLayout } from "./B06_Section_Cross_Culvert_Types";
|
|
|
|
/** 「기초유」인가 — 저장 제원 `foundation` 의 값. 비어 있으면 **그리지 않는다**(근거 없음). */
|
|
export function foundationChoice(value: unknown): "기초유" | "기초버림" | null {
|
|
const text = typeof value === "string" ? value.trim() : "";
|
|
if (text === "기초유") return "기초유";
|
|
if (text === "기초버림") return "기초버림";
|
|
return null;
|
|
}
|
|
|
|
/**
|
|
* 벽 터파기 — 벽 바닥선 아래로 **수직**. 폭은 바닥 폭 + 여유 0.2, 깊이는 기초 몫.
|
|
* `foundation` 이 비어 있으면 null — 사용자가 고르기 전에는 근거가 없다.
|
|
*/
|
|
export function wallTrench(
|
|
wall: WallLayout,
|
|
foundation: "기초유" | "기초버림" | null,
|
|
): {
|
|
widthM: number;
|
|
depthM: number;
|
|
left: number;
|
|
right: number;
|
|
top: number;
|
|
bottom: number;
|
|
} | null {
|
|
if (foundation === null) return null;
|
|
const hasFoundation = foundation === "기초유";
|
|
const depth = hasFoundation ? WALL_FOUNDATION_DEPTH_M : WALL_BLINDING_DEPTH_M;
|
|
// 폭: 기초 몫은 정본이 정한 값(0.9 / 0.7), 다만 벽 바닥이 그보다 넓으면 그 폭 + 여유.
|
|
const baseWidth = Math.abs(wall.bottomFront.offset - wall.bottomBack.offset);
|
|
const minWidth = hasFoundation ? WALL_FOUNDATION_WIDTH_M : WALL_BLINDING_WIDTH_M;
|
|
const width = Math.max(minWidth, baseWidth + (hasFoundation ? WALL_TRENCH_CLEARANCE_M : 0));
|
|
const center = (wall.bottomFront.offset + wall.bottomBack.offset) / 2;
|
|
const top = Math.max(wall.bottomFront.elevation, wall.bottomBack.elevation);
|
|
return {
|
|
widthM: width,
|
|
depthM: depth,
|
|
left: center - width / 2,
|
|
right: center + width / 2,
|
|
top,
|
|
bottom: top - depth,
|
|
};
|
|
}
|