- 단면 = B06 횡단 띠와 한 벌(Wall_Hatch chuteBandOutline 로 떼어 냄 · appendChuteBand 가 같이 씀) - 관 = 유출 벽 길이 · BOX = 구체 폭(축 고정) · 세월교 = 월류 폭 · 물넘이 포장(ford_chute) = 포장 폭 · 주인 측점 하나 - 구조물 종류 chute · 색 · 끝 마구리 = 마디마다 사다리꼴 · 해시 = 고른 때만 ch 키(안 고른 측점 저장본 그대로) - ③ structureTopLoops 가 chute 를 뺌 - 새 시험 test_135_3_chute_solid(+ 도우미) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QND7Co43B24zK2P937rdxt
60 lines
2.1 KiB
Python
60 lines
2.1 KiB
Python
# -*- coding: utf-8 -*-
|
|
"""PLAN 135-3 — B05 3D 도수로 · 돌붙임 띠 솔리드 검사.
|
|
|
|
도우미(helper_135_3_chute_solid.cjs)가 73-4 픽스처로 관 · BOX · 세월교 · 물넘이 포장 띠를 세워 결과(JSON)를 낸다.
|
|
단면 = B06 횡단 띠와 같은 계산 · 길이 = 유출 구조물 폭 · 해시 키 · ③ 구멍(structureTopLoops)이 띠를 안 뚫음.
|
|
"""
|
|
|
|
import json
|
|
import os
|
|
import subprocess
|
|
|
|
import pytest
|
|
|
|
HERE = os.path.dirname(os.path.abspath(__file__))
|
|
|
|
|
|
@pytest.fixture(scope="module")
|
|
def out():
|
|
proc = subprocess.run(
|
|
["node", os.path.join(HERE, "helper_135_3_chute_solid.cjs")],
|
|
capture_output=True,
|
|
text=True,
|
|
encoding="utf-8",
|
|
timeout=120,
|
|
)
|
|
assert proc.returncode == 0, proc.stderr
|
|
return json.loads(proc.stdout)
|
|
|
|
|
|
@pytest.mark.parametrize("name", ["pipe", "box", "ford", "pave"])
|
|
def test_band_solid_matches_b06_and_spans_outlet_width(out, name):
|
|
r = out[name]
|
|
assert r["count"] == r["expected"] >= 1, r # 유출 성토 조각마다 한 장
|
|
assert r["sameShape"] is True # 단면 = B06 chuteBandOutline 그대로
|
|
assert r["keys"] == ["chute"]
|
|
assert all(abs(length - r["expectedLength"]) < 1e-3 for length in r["lengths"]), r
|
|
assert r["otherSolidsSame"] is True # 다른 구조물 솔리드는 그대로
|
|
assert r["holesSame"] is True # ③ 구멍 수 그대로
|
|
|
|
|
|
def test_no_chute_no_band_and_hash(out):
|
|
assert out["box"]["noChuteNoSolid"] is True
|
|
assert out["hash"] == {
|
|
"changed": True,
|
|
"plainNoChute": True,
|
|
} # 고르면 만료 · 안 고르면 해시 그대로
|
|
assert out["pave"]["ownerOnly"] is True # 걸친 옆 측점은 안 냄
|
|
|
|
|
|
def test_hole_loops_skip_chute(out):
|
|
assert out["flatTop"]["asWall"] > 0 and out["flatTop"]["asChute"] == 0
|
|
|
|
|
|
def test_mesh_caps_follow_band(out):
|
|
r = out["mesh"]
|
|
assert r["found"] and r["colored"]
|
|
assert r["triangles"] == r["expected"]
|
|
# 앞 · 뒤 마구리 넓이 합 / (띠 넓이 × 2) = 1 — 꺾인 띠도 안 삐져나옴(부채꼴이면 약 4)
|
|
assert abs(r["capAreaRatio"] - 1) < 0.01
|