feat(rebar): 조립 철근(B11·B12)을 격자 가운데에 배치 (양끝 여유 차이 ≤ 1칸)
- assemblyGridIndices: 단마다 k칸 간격, 엇갈림 2칸 유지, 짝수 단 시작칸을 가운데 정렬 - 개수는 그대로 (B11 30, B12 24), 3D와 단면 삽도가 같은 위치를 씀 - 테스트: 양끝 여유 차이 ≤ 1칸, 엇갈림 2칸 Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
20d8546b6f
commit
de20b84c00
4 files changed
+34
-16
No files matched your search
@@ -138,19 +138,28 @@ export function assemblyEndOffset(): number {
|
||||
}
|
||||
|
||||
/** B11 (along W, between the B10-2 levels) and B12 (along L), 4s apart with a 2s stagger per level (§8). */
|
||||
/**
|
||||
* Grid indices of the assembly bars (B11 or B12) on one level, centred in the grid (승인 2026-10-26, 추천안).
|
||||
* Bars every k steps; the level's 2-step stagger alternates (even levels start at e0, odd levels at e0 + 2), and e0 centres
|
||||
* the even group so the left and right gaps differ by at most one step. n = positions − 1; idx = level index (0, 1, …).
|
||||
*/
|
||||
export function assemblyGridIndices(n: number, k: number, idx: number): number[] {
|
||||
const cEven = Math.floor(n / k) + 1;
|
||||
const cOdd = Math.floor((n - 2) / k) + 1;
|
||||
const e0 = Math.max(0, Math.floor((n - (cEven - 1) * k - 2) / 2));
|
||||
const even = idx % 2 === 0;
|
||||
const start = even ? e0 : e0 + 2;
|
||||
const count = even ? cEven : cOdd;
|
||||
return Array.from({ length: count }, (_, m) => start + m * k).filter((i) => i <= n);
|
||||
}
|
||||
|
||||
export function assemblyBars(L: number, W: number, H: number, f: FootingRebarSettings = DEFAULT_FOOTING_REBAR): FootingBar[] {
|
||||
const levelsJ = assemblyJs(H, f);
|
||||
// Bars every k grid steps (승인 2026-10-26: k·s); the levels alternate a 2-step stagger (엇갈림 2s).
|
||||
const perLevel = (n: number, k: number) =>
|
||||
levelsJ.map((_, idx) => {
|
||||
const i0 = idx % 2 === 0 ? 0 : 2;
|
||||
return Math.floor((n - i0) / k) + 1;
|
||||
});
|
||||
// B11 is spread along L (교각축 직각 grid) and B12 along W (교각축 grid), per 확대기초철근 (1).md §8.
|
||||
const nW = grid(W, f, 'sAxis').positions - 1;
|
||||
const nL = grid(L, f, 'sPerp').positions - 1;
|
||||
const b11 = perLevel(nL, f.kB11).reduce((a, b) => a + b, 0);
|
||||
const b12 = perLevel(nW, f.kB12).reduce((a, b) => a + b, 0);
|
||||
const b11 = levelsJ.reduce((a, _, idx) => a + assemblyGridIndices(nL, f.kB11, idx).length, 0);
|
||||
const b12 = levelsJ.reduce((a, _, idx) => a + assemblyGridIndices(nW, f.kB12, idx).length, 0);
|
||||
const hook = Math.round(hookLength('main90', d('S16'))); // 246 mm, rounded as in the document (§8.3)
|
||||
const depth1 = sideDepth(NOMINAL_DIAMETER.S29, NOMINAL_DIAMETER.S19, f);
|
||||
const depth2 = sideDepth(NOMINAL_DIAMETER.S25, NOMINAL_DIAMETER.S19, f);
|
||||
|
||||
Reference in new issue
Block a user