feat(B06): 횡단 카드 제목행에 성토사면 본래 경사길이 표기

사면 미교차 경고가 붙는 제목행 우측 끝에 성토사면 경사길이를 표기함.
값은 정본 설계선(`design_line`) 기준이라 기슭막이·집수정이 사면을 끊기 전
**본래 길이**이고, 양측 성토는 좌·우 두 값을 다 냄.

- `fillSlopeLengths()` 신설 — 기존 `protectedSpan`·`meetOffset` 재사용,
  성토측만 노견 끝(측구가 있으면 측구 바깥)에서 사면 끝까지 `run × √(1+1/n²)`.
- 미교차 측점은 `≥` 하한값 — 추세 외삽은 지반이 사면과 나란한 자리에서
  수십 m 씩 튀어(740m 측점 101.53m) 길이 표기에 못 씀.
- `meetOffset` 교차점을 두 걸음 사이 선형보간으로 냄 — 반폭 맞춤(1m 올림)에는
  영향이 없고 길이 표기가 탐색 간격만큼 튀는 것만 막음.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@
This commit is contained in:
2026-09-03 19:16:46 +09:00
parent 0f5b4e4df7
commit c21b68f2ce
4 changed files with 102 additions and 1 deletions
@@ -13,8 +13,36 @@ import {
buildRockBoundaryControl,
sectionModeLabel,
} from "./B06_Section_UI_Cross_Design";
import { type FillSlopeLength, fillSlopeLengths } from "./B06_Section_UI_Cross_Fit";
import { type DesignChangeHandler, L, stationLabel } from "./B06_Section_UI_Section_Common";
/**
* 성토사면 경사길이 표기 칸 — 성토측이 없으면 null.
*
* 값은 **구조물이 끊기 전 본래 사면**(정본 설계선 기준)이라, 기슭막이·집수정이 선 측점도
* 표준 횡단의 사면 길이를 그대로 보여 준다(2026-09-03 사용자 지시).
*/
function fillSlopeInfo(section: CrossSection): HTMLElement | null {
const lengths = fillSlopeLengths(section);
const sides = (["left", "right"] as const).filter((side) => lengths[side] !== null);
if (!sides.length) return null;
const both = sides.length > 1;
const info = document.createElement("span");
info.className = "b06-cross-card__fillslope";
info.textContent = `${L("B06_Cross_FillSlope")} ${sides
.map((side) => {
const length = lengths[side] as FillSlopeLength;
// 계산 반폭 안에서 원지반을 못 만난 사면은 거기까지만 잰 하한값이라 「≥」로 구분한다.
const value = `${length.open ? "≥" : ""}${length.lengthM.toFixed(2)}m`;
if (!both) return value;
const label = L(side === "left" ? "B06_Design_Ditch_Left" : "B06_Design_Ditch_Right");
return `${label} ${value}`;
})
.join(" · ")}`;
info.title = L("B06_Cross_FillSlope_Tip");
return info;
}
/**
* 카드 제목행을 만들어 카드에 붙인다(설계 조작이 있으면 조작 바까지).
*
@@ -67,6 +95,10 @@ export function appendCardHeader(
);
meta.append(kind);
}
// 성토사면 경사길이는 **행 우측 끝**(2026-09-03 사용자 지시) — meta 가 제목행의 오른쪽
// 끝이므로 그 마지막 칸에 붙인다.
const fillSlope = fillSlopeInfo(section);
if (fillSlope) meta.append(fillSlope);
// 단면유형 pill은 지반유형 우측·우측 맞춤으로 배치(1번). 좌측 구분선은 지반유형 세그먼트에 준다(3번).
modePill.classList.add("b06-cross-card__mode--right");