fix(b06): 곡선부 확폭을 설계 곡선표 기준으로 바로잡고 횡단도에 노견 표시 추가
확폭을 측점마다 앞뒤 10m 세 점의 외접원 반경으로 다시 재던 것을 계획노선 곡선표 (시·종점·설계 반경)로 바꿈. 종전에는 같은 곡선 안에서도 측점마다 확폭이 갈리고, 곡선 밖 직선까지 확폭이 흘러나가며, 측점 간격보다 짧은 곡선은 통째로 빠졌음. 곡선 안은 설계 반경의 표값 한 값, 앞뒤 10m 는 0 으로 잇고, 그 밖은 확폭 없음. 곡선표가 없는 옛 프로젝트는 종전 방식으로 물러섬. 횡단도는 차도 끝에만 눈금이 있어 노면이 넓어져도 차도가 는 것인지 노견이 는 것인지 가릴 수 없었음. 노면 끝에도 옅은 눈금을 세우고 노폭 라벨에 노견 폭을 덧붙임. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fe1QWPTfw11PaKh2LjwXdR
This commit is contained in:
@@ -148,3 +148,64 @@ def test_widening_without_curve_stays_zero() -> None:
|
||||
widenings, sides = _curve_widenings(chainage, [None] * 3, [None] * 3)
|
||||
assert widenings == [0.0, 0.0, 0.0]
|
||||
assert sides == [None, None, None]
|
||||
|
||||
|
||||
def test_design_curve_spans_from_curve_table() -> None:
|
||||
"""설계 곡선표의 시·종점이 노선 누가거리로 바뀌고, 회전 방향으로 바깥쪽이 갈린다."""
|
||||
from B05_Profile.B05_Profile_Engine_Sections_Core import _design_curve_spans
|
||||
|
||||
# ㄱ자 노선 — (0,0) → (100,0) → (100,100). 교점 (100,0) 에서 좌회전.
|
||||
line = np.array([[0.0, 0.0, 0.0], [100.0, 0.0, 0.0], [100.0, 100.0, 0.0]])
|
||||
chainage = np.array([0.0, 100.0, 200.0])
|
||||
curves = [
|
||||
{
|
||||
"start": [90.0, 0.0],
|
||||
"apex": [100.0, 0.0],
|
||||
"end": [100.0, 10.0],
|
||||
"radius_m": 12.0,
|
||||
}
|
||||
]
|
||||
spans = _design_curve_spans(line, chainage, curves)
|
||||
assert len(spans) == 1
|
||||
start, end, radius, side = spans[0]
|
||||
assert abs(start - 90.0) < 1e-6 and abs(end - 110.0) < 1e-6
|
||||
assert radius == 12.0
|
||||
# 좌회전이면 안쪽이 좌측이라 바깥은 우측이다.
|
||||
assert side == "right"
|
||||
# 노선에서 멀리 떨어진 곡선은 버린다.
|
||||
assert _design_curve_spans(line, chainage, [{**curves[0], "start": [90.0, 500.0]}]) == []
|
||||
|
||||
|
||||
def test_design_curve_widening_is_one_value_inside_the_curve() -> None:
|
||||
"""같은 곡선 안 측점은 설계 반경의 표값 하나를 쓰고, 앞뒤 10m 만 이어 준다."""
|
||||
from B05_Profile.B05_Profile_Engine_Sections_Core import _design_curve_widenings
|
||||
|
||||
# 곡선 100~140m, 설계 반경 16m(표값 1.5m). 측점 5m 간격.
|
||||
spans = [(100.0, 140.0, 16.0, "left")]
|
||||
chainage = np.arange(80.0, 165.0, 5.0)
|
||||
radii, sides, widenings = _design_curve_widenings(chainage, spans)
|
||||
table = dict(zip(chainage.tolist(), widenings, strict=True))
|
||||
# 곡선 안은 어디서나 같은 값 — 종전에는 측점마다 반경을 다시 재 값이 갈렸다.
|
||||
for station in (100.0, 110.0, 120.0, 130.0, 140.0):
|
||||
assert table[station] == 1.5, station
|
||||
# 앞뒤 10m 는 0 으로 잇는다.
|
||||
assert table[95.0] == 0.75 and table[145.0] == 0.75
|
||||
assert table[90.0] == 0.0 and table[150.0] == 0.0
|
||||
# 반경은 곡선 안에서만 남고, 테이퍼·직선 자리는 비어 있다.
|
||||
by_index = dict(zip(chainage.tolist(), radii, strict=True))
|
||||
assert by_index[120.0] == 16.0
|
||||
assert by_index[95.0] is None and by_index[90.0] is None
|
||||
# 방향은 곡선 것을 따라간다.
|
||||
assert sides[chainage.tolist().index(95.0)] == "left"
|
||||
|
||||
|
||||
def test_design_curve_widening_takes_the_wider_of_overlapping_curves() -> None:
|
||||
"""곡선이 겹치거나 붙어 있으면 확폭이 큰 쪽을 따른다."""
|
||||
from B05_Profile.B05_Profile_Engine_Sections_Core import _design_curve_widenings
|
||||
|
||||
spans = [(100.0, 120.0, 35.0, "left"), (118.0, 140.0, 12.0, "right")]
|
||||
chainage = np.array([110.0, 119.0, 130.0])
|
||||
_, sides, widenings = _design_curve_widenings(chainage, spans)
|
||||
assert widenings[0] == 0.5 # R=35 → 0.5m
|
||||
assert widenings[1] == 2.25 and sides[1] == "right" # 겹친 자리는 급한 곡선 값
|
||||
assert widenings[2] == 2.25
|
||||
|
||||
Reference in New Issue
Block a user