fix(bearing): show only the outer block margins as C4 and C5
- A 일체 pair's inner sides face the other bearing, so they are not C4 or C5: they are null and shown as "—" in the 배치 규칙 table. - The table headings now describe the 교축 margins (bearing to the outer block edge). Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9b79083d50
commit
0708aa1354
4 files changed
+24
-12
No files matched your search
@@ -12,10 +12,10 @@ export const PAIR_ECCENTRICITY_LIMIT_MM = 100;
|
||||
export interface EdgeDistance {
|
||||
no: number;
|
||||
row: BlockModel['row'];
|
||||
/** 교축 방향: 받침 중심에서 블록의 낮은 쪽(−n) 연단까지 (mm) = C4. */
|
||||
leftMm: number;
|
||||
/** 교축 방향: 받침 중심에서 블록의 높은 쪽(+n) 연단까지 (mm) = C5. */
|
||||
rightMm: number;
|
||||
/** 교축 방향: 받침 중심에서 블록의 낮은 쪽(−n) 연단까지 (mm) = C4. null = 쌍 안쪽 (C4·C5 아님). */
|
||||
leftMm: number | null;
|
||||
/** 교축 방향: 받침 중심에서 블록의 높은 쪽(+n) 연단까지 (mm) = C5. null = 쌍 안쪽 (C4·C5 아님). */
|
||||
rightMm: number | null;
|
||||
}
|
||||
|
||||
export interface PairEccentricity {
|
||||
@@ -37,10 +37,18 @@ export function bearingEdgeDistances(m: PierModel): EdgeDistance[] {
|
||||
const HALF_INTEGRATED = 1.25; // 2500 / 2, m
|
||||
return m.blocks.map((b) => {
|
||||
const host = m.integratedBlocks.find((x) => (b.row === '전열' ? x.frontNo : x.backNo) === b.no);
|
||||
const half = host ? HALF_INTEGRATED : HALF_SEPARATE;
|
||||
const low = host ? host.n - half : b.n - half;
|
||||
const high = host ? host.n + half : b.n + half;
|
||||
return { no: b.no, row: b.row, leftMm: (b.n - low) * 1000, rightMm: (high - b.n) * 1000 };
|
||||
if (!host) {
|
||||
return { no: b.no, row: b.row, leftMm: (HALF_SEPARATE) * 1000, rightMm: HALF_SEPARATE * 1000 };
|
||||
}
|
||||
// 일체: only the outer edges are C4 (front, low side) and C5 (back, high side); the inner side faces the other bearing.
|
||||
const low = host.n - HALF_INTEGRATED;
|
||||
const high = host.n + HALF_INTEGRATED;
|
||||
return {
|
||||
no: b.no,
|
||||
row: b.row,
|
||||
leftMm: b.row === '전열' ? (b.n - low) * 1000 : null,
|
||||
rightMm: b.row === '후열' ? (high - b.n) * 1000 : null,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -1576,13 +1576,14 @@ function renderBearingLayout(wrap: HTMLDivElement, pier: Pier): void {
|
||||
const table = el('table', undefined, 'grid-table rebar-table');
|
||||
const head = el('thead');
|
||||
const hr = el('tr');
|
||||
for (const h of ['받침', '열', 'C4 (코핑 시작 ↔ 받침, mm)', 'C5 (받침 ↔ 코핑 끝, mm)']) hr.appendChild(el('th', h));
|
||||
for (const h of ['받침', '열', 'C4 (교축 · 받침 ↔ 블록 바깥 연단, mm)', 'C5 (교축 · 받침 ↔ 블록 바깥 연단, mm)']) hr.appendChild(el('th', h));
|
||||
head.appendChild(hr);
|
||||
table.appendChild(head);
|
||||
const body = el('tbody');
|
||||
for (const e of edges) {
|
||||
const tr = el('tr');
|
||||
for (const v of [String(e.no), e.row, e.leftMm.toFixed(0), e.rightMm.toFixed(0)]) tr.appendChild(el('td', v));
|
||||
const fmt = (v: number | null) => (v === null ? '—' : v.toFixed(0));
|
||||
for (const v of [String(e.no), e.row, fmt(e.leftMm), fmt(e.rightMm)]) tr.appendChild(el('td', v));
|
||||
body.appendChild(tr);
|
||||
}
|
||||
table.appendChild(body);
|
||||
|
||||
@@ -61,8 +61,8 @@ export function bearingPlanSvg(m: PierModel, pairIndex: number, overlay?: Bearin
|
||||
const dist = bearingEdgeDistances(m);
|
||||
const d = (no: number) => dist.find((x) => x.no === no)!;
|
||||
parts.push(`<text x="${(X(f.n) + X(k.n)) / 2}" y="${Y(f.s) + 180}" text-anchor="middle" font-size="90" fill="#18212B">C2 ${Math.round(Math.abs(k.n - f.n) * 1000)}</text>`);
|
||||
parts.push(`<text x="${X(f.n) - 760}" y="${Y(f.s)}" text-anchor="end" font-size="90" fill="#18212B">C4 ${Math.round(d(f.no).leftMm)}</text>`);
|
||||
parts.push(`<text x="${X(k.n) + 760}" y="${Y(k.s)}" font-size="90" fill="#18212B">C5 ${Math.round(d(k.no).rightMm)}</text>`);
|
||||
parts.push(`<text x="${X(f.n) - 760}" y="${Y(f.s)}" text-anchor="end" font-size="90" fill="#18212B">C4 ${Math.round(d(f.no).leftMm ?? 0)}</text>`);
|
||||
parts.push(`<text x="${X(k.n) + 760}" y="${Y(k.s)}" font-size="90" fill="#18212B">C5 ${Math.round(d(k.no).rightMm ?? 0)}</text>`);
|
||||
|
||||
return `<svg viewBox="-1800 -1000 3600 2000" width="100%" style="max-width: 560px; height: auto" role="img" aria-label="교량받침 상세 평면: 쌍 ${pair.frontNo}·${pair.backNo}, 블록 윤곽, 솔플레이트, 도면값 겹쳐 보기">${parts.join('')}</svg>`;
|
||||
}
|
||||
@@ -28,6 +28,9 @@ describe('받침 배치 규칙 (승인 2026-10-26)', () => {
|
||||
// The 2500 block is centred on the pair midpoint, so the outer margins are 601 (within the 5 mm drawing tolerance of 600).
|
||||
expect(d.find((x) => x.no === 1 && x.row === '전열')!.leftMm).toBeCloseTo(600, -1);
|
||||
expect(d.find((x) => x.no === 6 && x.row === '후열')!.rightMm).toBeCloseTo(600, -1);
|
||||
// the inner sides face the other bearing of the pair: no C4 or C5 there
|
||||
expect(d.find((x) => x.no === 1 && x.row === '전열')!.rightMm).toBeNull();
|
||||
expect(d.find((x) => x.no === 6 && x.row === '후열')!.leftMm).toBeNull();
|
||||
});
|
||||
|
||||
it('the front and back bearings of one number are about 85 mm apart on P1, so 일체 is allowed', () => {
|
||||
|
||||
Reference in new issue
Block a user