- Drawing check (spec §6.3): an integrated 2500 × 1200 block gives 18@125 = 2250
along (ends 50 + 75) and 7@125 = 875 across (ends 162.5).
- C3 coping rebar, from RAG/코핑철근.md (2026-10-22 final):
- C10: 9 bars @300 at 4800–7200 (k_max 4, beyond the Level edge).
- C9 / C11: 18 bars each @250 outward, ends at 300 and 11700 (end gap 300).
- Refuses a coping too short for C9 (RB-K01).
- Side bars C12 5 rows / C13 2 rows at the 42.538 break; C14 38 bars;
C15 11 bars, C16 22 bars.
- spec §6.4 is older than 코핑철근.md (C10/C9/C11 layout, C12 row count, C14
dimensions). This follows the final document; spec §6.4 needs an update.
- Not yet: C1–C8 main bars (shape and lengths), the C12/C13 bar lengths and
shapes, the drawing check of the coping sheet, and the ③ screen.
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
78 lines
2.8 KiB
TypeScript
78 lines
2.8 KiB
TypeScript
import type { PierModel } from '../geometry';
|
||
|
||
/**
|
||
* 받침블럭 철근 (spec §6.3 · plan C2), 배치 분리: one block per bearing, 1200 × 1200.
|
||
* S2 is the upper bar (cover 50 from the block top); S1 is the lower bar (69.1 below the top).
|
||
* Both have the same layout: 7@125 = 875 with ends of 162.5 in a 1200 mm block, and legs of 700 below the bar.
|
||
*/
|
||
export const BLOCK_REBAR = {
|
||
dim: 1200,
|
||
cover: 50,
|
||
firstBarGap: 75,
|
||
spacing: 125,
|
||
/** Straight part of the bar for the 1200 block (spec table: 1100 + 700 × 2). */
|
||
straight: 1100,
|
||
legLength: 700,
|
||
/** Depth of each bar centre below the block top (mm). */
|
||
depthS2: 50,
|
||
depthS1: 69.1,
|
||
} as const;
|
||
|
||
export interface BarRow {
|
||
name: 'S1' | 'S2';
|
||
/** Bars along one block side. */
|
||
count: number;
|
||
spacing: number;
|
||
/** Position of the first bar from the block edge. */
|
||
firstEnd: number;
|
||
/** Straight length plus two legs (mm). */
|
||
length: number;
|
||
/** Coping embedment of the legs (mm): 700 − (block height − bar depth). */
|
||
embedment: number;
|
||
}
|
||
|
||
/** Bars along one 1200 mm side: available = dim − 2·(cover + first gap); gaps = floor(available / spacing). */
|
||
export function barsAcross(dim: number = BLOCK_REBAR.dim): { count: number; spacing: number; firstEnd: number } {
|
||
const available = dim - 2 * (BLOCK_REBAR.cover + BLOCK_REBAR.firstBarGap);
|
||
const gaps = Math.floor(available / BLOCK_REBAR.spacing);
|
||
const span = gaps * BLOCK_REBAR.spacing;
|
||
const leftover = available - span;
|
||
return { count: gaps + 1, spacing: BLOCK_REBAR.spacing, firstEnd: BLOCK_REBAR.cover + BLOCK_REBAR.firstBarGap + leftover / 2 };
|
||
}
|
||
|
||
/** Rebar of one block; blockHeight is the bearing block height in mm (h1 front or h2 back, pad included). */
|
||
export function blockBars(blockHeight: number, dim: number = BLOCK_REBAR.dim): BarRow[] {
|
||
const across = barsAcross(dim);
|
||
const length = BLOCK_REBAR.straight + 2 * BLOCK_REBAR.legLength;
|
||
return [
|
||
{ name: 'S1', ...across, length, embedment: BLOCK_REBAR.legLength - (blockHeight - BLOCK_REBAR.depthS1) },
|
||
{ name: 'S2', ...across, length, embedment: BLOCK_REBAR.legLength - (blockHeight - BLOCK_REBAR.depthS2) },
|
||
];
|
||
}
|
||
|
||
export interface BlockRebar {
|
||
no: number;
|
||
row: '전열' | '후열';
|
||
bars: BarRow[];
|
||
}
|
||
|
||
/** Rebar of every block of a pier, using the model's block heights (h1 front, h2 back; pad included, Q16 결정). */
|
||
export function bearingBlockRebar(model: PierModel): BlockRebar[] {
|
||
return model.blocks.map((b) => ({
|
||
no: b.no,
|
||
row: b.row,
|
||
bars: blockBars(b.row === '전열' ? model.h1 * 1000 : model.h2 * 1000),
|
||
}));
|
||
}
|
||
|
||
/** Total bars of one pier: bars per block × blocks, for S1 and S2 separately. */
|
||
export function totals(rebar: BlockRebar[]): { S1: number; S2: number } {
|
||
return rebar.reduce(
|
||
(sum, blk) => {
|
||
for (const bar of blk.bars) sum[bar.name] += bar.count;
|
||
return sum;
|
||
},
|
||
{ S1: 0, S2: 0 },
|
||
);
|
||
}
|