- 433-4 갈아끼움이 curveMoves 거꾸로 맵으로 옛 MC 횡단을 이어 받음 — 설계 · 측점 id · moves 짝 남음 - 433-11 자리 · 축 같은 앞 단면은 지반 표본 · 상단측 · 중심고 그대로 — 덧 측점 넣기 · 빼기 뒤 누가토량 = 서버 - 433-19 Span_Control.update(culvertopt 큐) 걷음 — 구간 줄은 다단 벽만 - 433-20 표 위 CAD 요소 2000 넘음 = 초안에 안 씀 · 알림(서버 max_length 짝) - 시험 test_433_4 · test_433_11 · test_433_19_20 새로 · 346_2 단언 · 440 헬퍼 로더 맞춤 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
76 lines
2.5 KiB
Python
76 lines
2.5 KiB
Python
# -*- coding: utf-8 -*-
|
|
"""433-11 — 덧 측점 넣기 · 빼기 뒤 브라우저 누가토량 = 서버(0.1 ㎥ 안).
|
|
|
|
뿌리: 갈아끼움이 안 바뀐 측점까지 지반 표본 · 상단측 · 중심고를 브라우저 지형 값으로 갈음.
|
|
못박는 것
|
|
- 자리 · 축이 같은 앞 단면 = 서버 표본 · 중심고 그대로 · 새 측점만 브라우저 표본.
|
|
- 덧 측점 넣은 뒤 누가토량 = 서버 기준(저장 표본 + 새 측점) · 빼면 저장 값 그대로.
|
|
- 노선이 옮겨 간 측점(좌표 다름)은 새 지형 표본.
|
|
- 고치기 전 꼴(모든 측점 브라우저 표본)은 1 ㎥ 넘게 어긋남(시험이 차를 잼).
|
|
|
|
Node 헬퍼 `helper_433_swap.cjs` — 진짜 갈아끼움 · 횡단 엔진 · 유토.
|
|
"""
|
|
|
|
import json
|
|
import subprocess
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
HERE = Path(__file__).resolve().parent
|
|
ROOT = HERE.parents[1]
|
|
if str(ROOT) not in sys.path:
|
|
sys.path.insert(0, str(ROOT))
|
|
|
|
from config.config_system import STANDARD_CROSS_SECTION # noqa: E402
|
|
from config.config_system_design import EARTHWORK_CONVERSION_FACTORS # noqa: E402
|
|
|
|
TOL_M3 = 0.1
|
|
|
|
|
|
@pytest.fixture(scope="module")
|
|
def plus(tmp_path_factory):
|
|
work = tmp_path_factory.mktemp("b433_11")
|
|
standard = work / "standard.json"
|
|
conversion = work / "conversion.json"
|
|
standard.write_text(json.dumps(STANDARD_CROSS_SECTION), encoding="utf-8")
|
|
conversion.write_text(json.dumps(EARTHWORK_CONVERSION_FACTORS), encoding="utf-8")
|
|
proc = subprocess.run(
|
|
["node", str(HERE / "helper_433_swap.cjs"), str(standard), str(conversion)],
|
|
cwd=ROOT,
|
|
capture_output=True,
|
|
text=True,
|
|
encoding="utf-8",
|
|
timeout=120,
|
|
)
|
|
assert proc.returncode == 0, proc.stderr
|
|
return json.loads(proc.stdout)["plus"]
|
|
|
|
|
|
def _max_gap(a, b):
|
|
assert [p[0] for p in a] == [p[0] for p in b]
|
|
return max(abs(x[1] - y[1]) for x, y in zip(a, b))
|
|
|
|
|
|
def test_안_바뀐_측점은_서버_표본_중심고(plus):
|
|
assert plus["keptSamples"]
|
|
assert plus["keptCenterZ"] == plus["savedCenterZ"]
|
|
assert plus["newSamples"]
|
|
|
|
|
|
def test_덧_측점_넣은_뒤_누가토량_서버와_같음(plus):
|
|
assert _max_gap(plus["browser"], plus["server"]) < TOL_M3
|
|
|
|
|
|
def test_덧_측점_뺀_뒤_저장_값_그대로(plus):
|
|
assert _max_gap(plus["back"], plus["saved"]) < TOL_M3
|
|
|
|
|
|
def test_고치기_전_꼴은_어긋남(plus):
|
|
assert _max_gap(plus["allBrowser"], plus["server"]) > 1.0
|
|
|
|
|
|
def test_노선이_옮긴_측점은_새_지형(plus):
|
|
assert plus["shiftedFresh"]
|