diff --git a/B06_Section/B06_Section_UI_Cross_Ford.ts b/B06_Section/B06_Section_UI_Cross_Ford.ts index f21cc38ca..c3c4217a3 100644 --- a/B06_Section/B06_Section_UI_Cross_Ford.ts +++ b/B06_Section/B06_Section_UI_Cross_Ford.ts @@ -145,15 +145,30 @@ export function appendFordOverlay( // 관·채움이 벽 위에 겹쳐 클릭을 가로챈다 — 투명 겹면을 맨 위에 얹어 벽을 고른다 // (배수관 기슭막이 `culvert-revet-hit`와 같은 수법). if (onSelectWall) { - // 본체(바닥판 · 관) 판정면 — 벽 판정면보다 먼저 깔아 겹친 자리는 벽이 먹는다(66-1). - for (const points of [layout.slabBridge, layout.pipe.outer]) { - const hit = polygon(points, "b06-chart__culvert-revet-hit", "세월교 본체 선택"); - hit.addEventListener("click", (event) => { - event.stopPropagation(); - onSelectWall("body"); - }); - layer.append(hit); - } + // 본체 판정면 = 바닥판 밑 ~ 측벽 상단 최고 사각형 하나(관 위 성토 · 벽-관 사이 포함 · 89-2) — + // 측벽 판정면 · 흙막이(뒤에 그리는 배관 오버레이)가 위에 얹혀 겹친 자리는 그쪽이 먹는다(66-1). + const offsets = [ + ...layout.slabBridge, + ...layout.sides.flatMap((side) => side.parts.flatMap((part) => part.points)), + ].map((point) => point.offset); + const top = Math.max(...layout.sides.map((side) => side.top.elevation)); + const bottom = Math.min(...layout.slabBridge.map((point) => point.elevation)); + const [from, to] = [Math.min(...offsets), Math.max(...offsets)]; + const bodyHit = polygon( + [ + { offset: from, elevation: top }, + { offset: to, elevation: top }, + { offset: to, elevation: bottom }, + { offset: from, elevation: bottom }, + ], + "b06-chart__culvert-revet-hit", + "세월교 본체 선택", + ); + bodyHit.addEventListener("click", (event) => { + event.stopPropagation(); + onSelectWall("body"); + }); + layer.append(bodyHit); // 측벽 판정면 = ㄴ(벽 + 바닥판)을 감싸는 가상 사각형(79-6) — 얇은 벽만 잡던 것을 넓힘. for (const side of layout.sides) { const points = side.parts.flatMap((part) => part.points);