feat(abut): 접속슬래브 카드 — 매립형 / 노출형 형식, 경사, 치수 입력, 삽도 3개, 모따기 3D 반영

- 노출형 (삽도 기준, QA-8 가정): 상면 = 흉벽 상단, 끝은 브라켓 위(끝 두께 = 브라켓 높이), 헌치 길이 기본 2000
- 형식을 고르면 경사가 기본값으로 바뀜 (매립형 하향 4 %, 노출형 종단경사), 경사 타일로 변경 가능
- 길이 · 두께 · 흉벽과 간격 · 날개벽과 간격 입력이 3D, 폭, 날개벽 평면에 반영
- 슬래브 모따기 = 날개벽 헌치 (3D와 평면), 날개벽 없는 측은 skew 교좌면 끝선
- 3D 슬래브를 단면 기준 입체로 다시 만듦, 프로젝트 파일 저장 · 검증

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
ypshimandClaude Haiku 5.5 committed 2026-11-04 10:11:39 +09:00
1 parent fc0370883f
commit 4b8b80ae97
14 files changed
+854 -60

No files matched your search

+200
View File
@@ -0,0 +1,200 @@
/**
* 교대 접속슬래브 삽도 (2026-11-04, 시안 ② 접속슬래브 카드): 평면(날개벽 사이), 단면(교대축 직각, 매립형 / 노출형), 흉벽–슬래브 접합 상세.
* 순수 문자열 함수. 평면·단면은 생성본 값으로 그리고 가로·세로 축척이 같다. 접합 상세는 부속재를 보여 주는 모식도다(표시용).
*/
import type { AbutPlanOutline } from './abut-scene';
import type { SlabForm, SlabStation } from '../core/abut/slab';
import { dimLine } from './abut-wing-svg';
const INK = '#18212b';
const MUTED = '#55606e';
const WING = '#d6bb8c';
const WALL = '#b7c7d3';
const SLAB = '#f3eee4';
const SLAB_EDGE = '#b49a6b';
const text = (x: number, y: number, s: string, anchor = 'start', fill = INK) =>
`<text x="${x.toFixed(1)}" y="${y.toFixed(1)}" text-anchor="${anchor}" font-size="11" fill="${fill}" font-family="JetBrains Mono, monospace">${s}</text>`;
const poly = (pts: [number, number][], style: string) => `<polygon points="${pts.map(([x, y]) => `${x.toFixed(1)},${y.toFixed(1)}`).join(' ')}" ${style}/>`;
const line = (x1: number, y1: number, x2: number, y2: number, style = `stroke="${MUTED}"`) =>
`<line x1="${x1.toFixed(1)}" y1="${y1.toFixed(1)}" x2="${x2.toFixed(1)}" y2="${y2.toFixed(1)}" ${style}/>`;
const el = (v: number) => `EL.${v.toFixed(3)}`;
export interface AbutSlabPlanDrawing {
outline: AbutPlanOutline;
/** 좌 = ① 쪽 끝 (sEnd); 날개벽 평면과 같은 좌우. */
leftSEnd: number;
widthM: number;
lengthMm: number;
/** 측별 모따기 (mm, 0 = 없음). */
chamferMm: { left: number; right: number };
}
/** 평면: 벽체, 날개벽, 접속슬래브(모따기), 폭 · 길이 치수. 왼쪽이 ① 쪽(좌), 위가 전면. */
export function abutSlabPlanSvg(d: AbutSlabPlanDrawing): string {
const pts = [...d.outline.wall, ...d.outline.slab, ...d.outline.wings.flatMap((w) => w.poly)];
const flip = d.leftSEnd !== 0;
const xs = pts.map(([s]) => (flip ? -s : s));
const ts = pts.map(([, t]) => t);
const k = 30;
const xMin = Math.min(...xs) - 1.6;
const tMax = Math.max(...ts) + 0.4;
const X = (s: number) => 20 + ((flip ? -s : s) - xMin) * k;
const Y = (t: number) => 18 + (tMax - t) * k;
const W = 40 + (Math.max(...xs) - xMin + 0.6) * k;
const tMin = Math.min(...d.outline.slab.map(([, t]) => t));
const H = Y(tMin) + 46;
const map = (p: [number, number][]) => p.map(([s, t]) => [X(s), Y(t)] as [number, number]);
const slab = d.outline.slab;
const parts = [
poly(map(d.outline.wall), `fill="${WALL}" stroke="${MUTED}"`),
...d.outline.wings.map((w) => poly(map(w.poly), `fill="${WING}" stroke="#9c8763"`)),
poly(map(slab), `fill="${SLAB}" stroke="${SLAB_EDGE}" stroke-width="1.4"`),
];
// 폭: the far edge (the last two corners), below it. 길이: the left side, from the near edge to the far edge.
const farA = slab[slab.length - 1];
const farB = slab[slab.length - 2];
const [fl, fr] = X(farA[0]) < X(farB[0]) ? [farA, farB] : [farB, farA];
parts.push(dimLine([X(fl[0]), Y(fl[1])], [X(fr[0]), Y(fr[1])], Y(tMin) + 16, 'h', `폭 ${d.widthM.toFixed(3)} m`, true));
const tNear = Math.max(...slab.map(([, t]) => t));
const xLeft = Math.min(...slab.map(([s]) => X(s)));
const nearLeft = slab.filter(([, t]) => Math.abs(t - tNear) < 1e-9).map(([s]) => X(s)).sort((a, b) => a - b)[0];
parts.push(dimLine([nearLeft, Y(tNear)], [X(fl[0]), Y(fl[1])], xLeft - 12, 'v', `${d.lengthMm}`));
const c = slab.reduce((a, [s, t]) => [a[0] + s / slab.length, a[1] + t / slab.length], [0, 0]);
parts.push(text(X(c[0]), Y(c[1]), '접속슬래브', 'middle'));
for (const w of d.outline.wings) {
const mm = w.side === 'left' ? d.chamferMm.left : d.chamferMm.right;
if (!(mm > 0)) continue;
const x = X(w.sEnd) + (X(c[0]) > X(w.sEnd) ? 1 : -1) * 34;
parts.push(text(x, Y(tNear) + 26, `모따기 ${mm} × ${mm}`, X(c[0]) > X(w.sEnd) ? 'start' : 'end', MUTED));
}
parts.push(text((X(0) + X(Math.max(...d.outline.wall.map(([s]) => s)))) / 2, 12, '흉벽 · 벽체 (위 = 전면)', 'middle', MUTED));
return [
`<svg viewBox="0 0 ${W.toFixed(0)} ${H.toFixed(0)}" width="100%" role="img" aria-label="접속슬래브 평면: 폭 ${d.widthM.toFixed(3)} m, 길이 ${d.lengthMm}">`,
...parts,
'</svg>',
].join('');
}
export interface AbutSlabSectionDrawing {
form: SlabForm;
/** "하향 4 %" / "종단경사 +1.91 %". */
slopeLabel: string;
/** 단면 (t, 흉벽 상단에서 잰 상면 · 하면), core/abut/slab.ts slabSection. */
section: SlabStation[];
/** 이 단면 위치의 흉벽 상단 EL (m). */
parapetTopEl: number;
bracketHeightM: number;
parapetBackM: number;
wallBackM: number;
lengthMm: number;
thicknessMm: number;
parapetGapMm: number;
haunchLengthMm: number;
}
/** 단면: 날개벽 축 방향(교대축 직각), 왼쪽이 배면. 흉벽 · 브라켓 단차, 슬래브(매립형 일정 두께 / 노출형 헌치), 치수와 EL. */
export function abutSlabSectionSvg(d: AbutSlabSectionDrawing): string {
const k = 56;
const st = d.section;
const t0 = st[0].t;
const t1 = st[st.length - 1].t;
const low = -d.bracketHeightM - 0.9;
const hi = Math.max(0, ...st.map((p) => p.top)) + 0.5;
const minBottom = Math.min(...st.map((p) => p.bottom));
const left = t1 - 1.0;
const X = (t: number) => 20 + (t - left) * k;
const Y = (y: number) => 12 + (hi - y) * k;
const bH = d.bracketHeightM;
const parts = [
// 흉벽 (t 흉벽 배면 … 0) and the 브라켓 단차 (벽체 배면 … 흉벽 배면), cut below.
poly(
[[X(d.wallBackM), Y(low)], [X(0), Y(low)], [X(0), Y(0)], [X(d.parapetBackM), Y(0)], [X(d.parapetBackM), Y(-bH)], [X(d.wallBackM), Y(-bH)]],
`fill="${WALL}" stroke="${MUTED}"`,
),
poly([...st.map((p) => [X(p.t), Y(p.top)] as [number, number]), ...[...st].reverse().map((p) => [X(p.t), Y(p.bottom)] as [number, number])], `fill="${SLAB}" stroke="${SLAB_EDGE}" stroke-width="1.4"`),
];
// 다웰 D25 at the middle of the 브라켓 width.
const dowelT = (d.wallBackM + d.parapetBackM) / 2;
parts.push(line(X(dowelT), Y(-bH - 0.35), X(dowelT), Y(-bH + 0.2), `stroke="${INK}" stroke-width="1.6"`));
parts.push(text(X(d.wallBackM) - 6, Y(-bH - 0.45), '다웰 D25 @400', 'end', MUTED));
// 치수: 길이 (흉벽 · 벽체 아래), 끝 두께 (왼쪽 끝), 노출형은 흉벽 쪽 끝 두께와 헌치 길이.
const yDim = Math.max(Y(minBottom), Y(low)) + 18;
parts.push(dimLine([X(t1), Y(st[st.length - 1].bottom)], [X(t0), Y(st[0].bottom)], yDim, 'h', `${d.lengthMm}`, true));
const far = st[st.length - 1];
parts.push(dimLine([X(t1), Y(far.top)], [X(t1), Y(far.bottom)], X(t1) - 10, 'v', `${d.thicknessMm}`));
if (d.form === 'exposed') {
const he = d.wallBackM - d.haunchLengthMm / 1000;
const heP = st.find((p) => Math.abs(p.t - he) < 1e-6);
if (heP) parts.push(dimLine([X(he), Y(heP.bottom)], [X(d.wallBackM), Y(-bH)], yDim + 22, 'h', `헌치 ${d.haunchLengthMm}`, true));
parts.push(text(X(dowelT) - 6, Y((st[0].top + st[0].bottom) / 2) + 4, `끝 ${Math.round(bH * 1000)}`, 'end'));
}
// 경사 (상면 가운데 위), 간격, EL.
const mid = st[Math.floor((st.length - 1) / 2)];
parts.push(text((X(t1) + X(mid.t)) / 2, Y(Math.max(far.top, mid.top)) - 8, `경사 ${d.slopeLabel}`, 'middle'));
parts.push(text(X(t0), Y(st[0].top) - 8, `간격 ${d.parapetGapMm}`, 'middle', MUTED));
parts.push(text(X(0) + 6, Y(0) + 4, `흉벽 상단 ${el(d.parapetTopEl)}`, 'start'));
parts.push(text(X(0) + 6, Y(-bH) + 4, `브라켓 상면 ${el(d.parapetTopEl - bH)}`, 'start'));
parts.push(text(X(0) + 6, Y(low) - 4, '흉벽 · 벽체', 'start', MUTED));
const W = X(0) + 190;
const H = yDim + (d.form === 'exposed' ? 44 : 22);
return [
`<svg viewBox="0 0 ${W.toFixed(0)} ${H.toFixed(0)}" width="100%" role="img" aria-label="접속슬래브 단면 · ${d.form === 'exposed' ? '노출형' : '매립형'} · 경사 ${d.slopeLabel} · 길이 ${d.lengthMm} · 두께 ${d.thicknessMm}">`,
...parts,
'</svg>',
].join('');
}
export interface AbutSlabJointDrawing {
form: SlabForm;
/** 경사 (%, + = 배면 쪽으로 올라감). "S = 4.00 % (하향)"처럼 표시한다. */
gradePct: number;
parapetTopEl: number;
bracketHeightM: number;
parapetGapMm: number;
thicknessMm: number;
}
/** 흉벽–접속슬래브 접합 상세 (삽도 기준, 모식도): 간격 · 아스팔트 충진재 / 스티로폼, 고무판, 타르페이퍼, 다웰 · 강관. */
export function abutSlabJointSvg(d: AbutSlabJointDrawing): string {
// Fixed schematic (px): 흉벽 x 300–360 from y 20, 브라켓 상면 y 150 from x 260.
const bracketY = 150;
const padH = 4;
const slabEnd = 296;
const bottomY = bracketY - padH;
const exposed = d.form === 'exposed';
const topY = exposed ? 20 : 86;
const drop = d.gradePct < 0 ? 10 : -6; // left end lower for a fall, higher for a rise
const slab: [number, number][] = exposed
? [[20, topY + drop + 60], [20, topY + drop], [slabEnd, topY], [slabEnd, bottomY], [150, topY + drop * 0.5 + 60]]
: [[20, bottomY + drop], [20, topY + drop], [slabEnd, topY], [slabEnd, bottomY]];
const gapMid = topY + (bottomY - topY) * 0.3;
const parts = [
poly([[260, 262], [360, 262], [360, 20], [300, 20], [300, bracketY], [260, bracketY]], `fill="${WALL}" stroke="${MUTED}"`),
poly(slab, `fill="${SLAB}" stroke="${SLAB_EDGE}" stroke-width="1.4"`),
// 간격: 아스팔트 충진재 (위), 스티로폼 (아래).
`<rect x="${slabEnd}" y="${topY}" width="4" height="${(gapMid - topY).toFixed(1)}" fill="#3b3f45"/>`,
`<rect x="${slabEnd}" y="${gapMid.toFixed(1)}" width="4" height="${(bottomY - gapMid).toFixed(1)}" fill="#ffffff" stroke="${MUTED}" stroke-width="0.6"/>`,
// 고무판 150 × 150 × 15, 타르페이퍼 T15, 다웰 D25 in 강관 Φ60 L300.
`<rect x="268" y="${bottomY}" width="24" height="${padH}" fill="#2b2b2b"/>`,
line(260, bracketY, 300, bracketY, 'stroke="#8a5a2b" stroke-width="2.4"'),
`<rect x="276" y="${bottomY - 40}" width="8" height="40" fill="none" stroke="${INK}" stroke-width="0.9"/>`,
line(280, bottomY - 46, 280, bracketY + 48, `stroke="${INK}" stroke-width="1.8"`),
];
const lead = (x1: number, y1: number, x2: number, y2: number, s: string, anchor: 'start' | 'end') =>
line(x1, y1, x2, y2, `stroke="${MUTED}" stroke-width="0.7"`) + text(x2 + (anchor === 'start' ? 3 : -3), y2 + 4, s, anchor);
parts.push(lead(298, topY + 6, 372, 58, `간격 ${d.parapetGapMm} · 아스팔트 충진재`, 'start'));
parts.push(lead(298, gapMid + 12, 372, 100, '스티로폼', 'start'));
parts.push(lead(272, bottomY + 2, 190, 196, '고무판 150 × 150 × 15', 'end'));
parts.push(lead(264, bracketY + 1, 190, 214, '타르페이퍼 T = 15', 'end'));
parts.push(lead(280, bracketY + 40, 190, 232, '다웰 D25 · 강관 Φ60 L300', 'end'));
parts.push(text(130, exposed ? 120 : (topY + bottomY) / 2 + 4, exposed ? `노출형 · 끝 ${Math.round(d.bracketHeightM * 1000)}` : `접속슬래브 ${d.thicknessMm}`, 'middle'));
parts.push(text(40, topY + drop - 6, `S = ${Math.abs(d.gradePct).toFixed(2)} % (${d.gradePct < 0 ? '하향' : '상향'})`, 'start'));
parts.push(text(368, 24, `흉벽 상단 ${el(d.parapetTopEl)}`, 'start'));
parts.push(text(368, bracketY + 4, `브라켓 상면 ${el(d.parapetTopEl - d.bracketHeightM)}`, 'start'));
parts.push(text(330, 252, '흉벽 · 벽체', 'middle', MUTED));
return [
`<svg viewBox="0 -22 560 292" width="100%" role="img" aria-label="흉벽–접속슬래브 접합 상세 (모식도): 간격 ${d.parapetGapMm}, 고무판, 타르페이퍼, 다웰 D25">`,
...parts,
'</svg>',
].join('');
}