- 공용 벽 fillTop 칸 · 성토 사면선 · 트림 · 3D 실루엣 목표 topJoint → fillTop(무늬 이음선 그대로) - 0점 · 다단 자동 자리 · 최소 노견 자리 = 배면에서 1.5t − 0.1(노폭 연장 0 유지 · 관 길이 7.9 → 7.5 m) - 다단 사이 = 늘 윗단 발끝(원지반 무관) · 끝 구간 · 관 유출 벽 = 발끝이 지반 위에 뜬 벽만 발끝 - 시험 186_1 · 139_6 · 225_1 · 139_4 새 수치 · wall_shape_unified 이음 0.1 m 확인 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Se7ytqbohmBQnfYpwYFnYf
77 lines
3.2 KiB
Python
77 lines
3.2 KiB
Python
"""PLAN 139-4 · 139-5 — 묻힌 흙막이 유출 끝 = 3도 수평 절토선(보라 · 절토 면적) · 못 만나면 복합경사.
|
|
|
|
짝: `B06_Section/B06_Section_UI_Cross_Culvert_Extra.ts`(끝 구간 규칙) · `_Culvert_Tiers.ts`(채널 입력) ·
|
|
`_Culvert_Geom.ts`(유출 절토선 면적에 넣음) · `_Culvert.ts`(그림 · 툴팁). 실제 TS 를 `helper_139_4_buried_outlet.cjs` 가 돌린다.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import json
|
|
import os
|
|
import subprocess
|
|
|
|
import pytest
|
|
|
|
HERE = os.path.dirname(__file__)
|
|
ROOT = os.path.join(HERE, "..", "..")
|
|
|
|
pytestmark = pytest.mark.skipif(
|
|
not os.path.isdir(os.path.join(ROOT, "config", "node_modules")),
|
|
reason="프론트엔드 의존성 미설치",
|
|
)
|
|
|
|
|
|
@pytest.fixture(scope="module")
|
|
def out() -> dict:
|
|
proc = subprocess.run( # noqa: S603 — 고정 실행 파일
|
|
["node", os.path.join(HERE, "helper_139_4_buried_outlet.cjs")],
|
|
capture_output=True,
|
|
text=True,
|
|
encoding="utf-8",
|
|
timeout=60,
|
|
)
|
|
assert proc.returncode == 0, proc.stderr
|
|
return json.loads(proc.stdout)
|
|
|
|
|
|
def _src(rel: str) -> str:
|
|
with open(os.path.join(ROOT, rel), encoding="utf-8") as f:
|
|
return f.read()
|
|
|
|
|
|
@pytest.mark.parametrize("case", ["box", "pipeDown"])
|
|
def test_묻힌_유출_끝은_3도_절토선_면적에_듦(out: dict, case: str) -> None:
|
|
"""세월교 · 박스 흙막이도 배관 관보호공도 같은 3도 선 · 원지반 교점에서 끝 · 절토 면적 > 0."""
|
|
study = out[case]
|
|
assert study["cut"] == [{"points": 2, "grade": out["grade3"], "rises": False, "endGap": 0}]
|
|
assert study["inTrim"] is True
|
|
assert study["cutArea"] - study["cutAreaWithout"] > 0.1
|
|
|
|
|
|
def test_3도_선이_원지반을_못_만나면_복합경사(out: dict) -> None:
|
|
"""유출 바깥이 오르막 — 그때만 절토 경사(1:1.0)로 원지반까지."""
|
|
study = out["pipeUp"]
|
|
assert len(study["cut"]) == 1
|
|
tail = study["cut"][0]
|
|
assert tail["rises"] is True and tail["grade"] == -1 and tail["endGap"] == 0
|
|
# 371-1 — 벽 자리 0.35 m 도로 쪽 · 오르는 선 0.3 m 라 면적 차가 백엔드 설계선 끝에 묻힘 → 폐회로에 듦만 봄
|
|
assert study["inTrim"] is True
|
|
|
|
|
|
def test_성토_끝은_그대로(out: dict) -> None:
|
|
# 371-1 — 다단 사이 시작 = 윗단 발끝 · 단이 0.5 m 내려가 기본 자료 끝 벽이 0.3 m 묻힘 → 3도 선
|
|
assert out["pipeBase"] == ["fill", "cut"]
|
|
assert out["pipeOpen"]["cut"] == [] # 묻히지 않은 끝 = 성토부선 그대로
|
|
|
|
|
|
def test_유출_절토선은_그리고_면적에_넣음() -> None:
|
|
culvert = _src("B06_Section/B06_Section_UI_Cross_Culvert.ts")
|
|
assert 'if (segment.kind === "cut" && !culvert.body) continue;' not in culvert
|
|
assert 'planLine(segment.points, cutLineTip("유출부", segment));' in culvert
|
|
geom = _src("B06_Section/B06_Section_UI_Cross_Culvert_Geom.ts")
|
|
assert "extendTrimSlope(drawnFillPoints(extrasForArea, true), outletInfo.outward);" in geom
|
|
# 집수정 계류측 3도 선은 그림만(면적 밖) — 세월교 · 박스 계류측만 면적
|
|
assert (
|
|
"extendTrimSlope(drawnFillPoints(basinExtrasForArea, !!body), inletInfo.outward);" in geom
|
|
)
|