"""세월교 월류 높이 → 노면 하강(계획고·절성토 면적) 확인 (2026-08-30 사용자 지시). `_ford_set`이 월류 높이를 스펙에 싣고, `compute_cross_design(surface_drop_m=)`이 계획고를 통째로 내려 절·성토 면적까지 따라가는지 본다. """ import sys from pathlib import Path ROOT = Path(__file__).resolve().parents[2] if str(ROOT) not in sys.path: sys.path.insert(0, str(ROOT)) from B06_Section.B06_Section_Engine_Culvert import _ford_set # noqa: E402 from B06_Section.B06_Section_Engine_Design import compute_cross_design # noqa: E402 DROP_M = 0.39 def _samples(): """V자 계류 — 중심이 낮고 바깥으로 갈수록 높아지는 지반.""" return [ {"offset_m": index / 2, "elevation_m": 100.0 + abs(index / 2) * 0.3, "valid": True} for index in range(-40, 41) ] def test_ford_set_carries_overflow_depth(): spec = _ford_set({"ford_width_m": 10, "ford_height_m": DROP_M, "pipe_count": 1}) assert spec["overflow_depth_m"] == DROP_M assert spec["span_m"] == 10 # 값이 없으면 내리지 않는다. assert _ford_set({"ford_width_m": 10})["overflow_depth_m"] == 0.0 def test_surface_drop_lowers_plan_and_moves_areas(): samples = _samples() common = dict(ground_type="soil", section_mode="left_cut") base = compute_cross_design(samples, 100.0, **common) drop = compute_cross_design(samples, 100.0, surface_drop_m=DROP_M, **common) # 계획고·노견이 정확히 월류 높이만큼 내려간다(전폭 평행 하강). assert round(base["design_elevation_m"] - drop["design_elevation_m"], 4) == DROP_M for side in ("left", "right"): gap = base["road_edges"][side]["elevation_m"] - drop["road_edges"][side]["elevation_m"] assert round(gap, 4) == DROP_M # 노면이 내려가면 절토가 늘고 성토가 준다. assert drop["cut_area_m2"] > base["cut_area_m2"] assert drop["fill_area_m2"] <= base["fill_area_m2"] # 프론트가 점선을 되그릴 수 있게 하강량을 echo한다. 하강이 없으면 키 자체가 없다. assert drop["surface_drop_m"] == DROP_M assert "surface_drop_m" not in base