diff --git a/B06_Section/B06_Section_UI_Cross_Culvert_Solve.ts b/B06_Section/B06_Section_UI_Cross_Culvert_Solve.ts index 6ebc313a..500d1d40 100644 --- a/B06_Section/B06_Section_UI_Cross_Culvert_Solve.ts +++ b/B06_Section/B06_Section_UI_Cross_Culvert_Solve.ts @@ -561,7 +561,17 @@ export function pipeAxisSolver( Math.hypot(top.offset - fallback.top.offset, top.elevation - fallback.top.elevation) > STRAY_LIMIT_M; if (strayed) return fallback; - return { bottom: clampToFace(bottom, face), top: clampToFace(top, face) }; + const cutBottom = clampToFace(bottom, face); + const cutTop = clampToFace(top, face); + // 마감면을 비스듬히 자르면 끝단 길이는 관경 이상이다. 그보다 짧으면 선분 밖으로 + // 나간 교점이 한 끝점으로 접힌 것 — I형 벽이 원지반에 묻혀 관 시작점이 벽 상단에 + // 붙으면 두 꼭짓점이 한 점이 되어 관이 삼각형으로 그려진다. 그럴 땐 축 직각 마감으로. + const cutSpan = Math.hypot( + cutTop.offset - cutBottom.offset, + cutTop.elevation - cutBottom.elevation, + ); + if (cutSpan < diameter - 1e-6) return fallback; + return { bottom: cutBottom, top: cutTop }; }; solver.derive(); return solver;