feat(rebar): 상면 주철근(C1–C6) 이음 무시/반영, 위치 기둥 중심/단부

- 기본 '이음 무시' (사양 결정). '반영'이면 정척(12000) 초과 철근을 l_s 겹침 2조각으로 나눔
- 위치: 기둥 중심 = 전체의 절반, 단부 = 정척 안에서 가장 끝 쪽 (짧은 조각 = 전체 + l_s − 12000, 긴 조각 = 12000)
- 철근표 조각 목록과 비고, 3D 두 조각(l_s 겹침)에 반영
- STANDARD_BAR를 common.ts로 옮겨 순환 import 방지

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
ypshimandClaude Haiku 5.5 committed 2026-10-26 16:14:23 +09:00
1 parent 72053be420
commit 496e0ea4e5
10 files changed
+130 -16

No files matched your search

+34 -4
View File
@@ -27,7 +27,7 @@ import { blockRebarPlanSvg } from './view/block-rebar-plan-svg';
import { copingEndStation, copingFrontSvg, copingSectionSvg } from './view/coping-rebar-svg';
import { BLOCK_REBAR_RANGES } from './core/rebar/block-check';
import { DEFAULT_BLOCK_REBAR, type BlockRebarSettings } from './core/rebar/bearing-block';
import { COPING_REBAR_RANGES, copingSettingsIssues, type CopingRebarSettings, DEFAULT_COPING_REBAR } from './core/rebar/coping-settings';
import { COPING_REBAR_RANGES, copingSettingsIssues, type CopingRebarSettings, DEFAULT_COPING_REBAR, DEFAULT_TOP_SPLICE, type TopSpliceSettings } from './core/rebar/coping-settings';
import { groundSectionSvg } from './view/ground-svg';
import { parseBearingElevationTable, parseSolplateTable, readDxfTexts } from './core/dxf-table';
import { columnDiameterIssues } from './core/column-check';
@@ -1091,13 +1091,26 @@ const COPING_REBAR_FIELDS: { key: keyof CopingRebarSettings; label: string }[] =
];
/** 적용: the values go to the draft and the model is rebuilt only when every check passes (CP01·CP02). */
function applyCopingRebar(name: string, next: CopingRebarSettings): void {
function applyCopingRebar(name: string, next: CopingRebarSettings, splice: TopSpliceSettings): void {
const p = state.piers.find((q) => q.input.name === name);
if (!p) return;
p.draft = { ...p.draft, copingRebar: next };
p.draft = { ...p.draft, copingRebar: next, topSplice: splice };
regenerateOne(name);
}
/** A row of toggle buttons (aria-pressed), as on the 배치 chips of ②. */
function toggleRow<T extends string>(options: [T, string][], current: T, onPick: (v: T) => void): HTMLDivElement {
const row = el('div', undefined, 'opts');
for (const [v, label] of options) {
const b = el('button', label, 'btn small');
b.type = 'button';
b.setAttribute('aria-pressed', String(v === current));
b.addEventListener('click', () => onPick(v));
row.appendChild(b);
}
return row;
}
function renderCopingSettings(box: HTMLDivElement, pier: Pier): void {
if (!pier.model) return;
const wrap = el('div', undefined, 'bearing-ref');
@@ -1135,6 +1148,23 @@ function renderCopingSettings(box: HTMLDivElement, pier: Pier): void {
grid.appendChild(row);
}
wrap.appendChild(grid);
// 상면 주철근(C1–C6) 이음 (승인 2026-10-26): 무시 (사양 기본) / 반영, and the 위치 when 반영.
let splice: TopSpliceSettings = { ...DEFAULT_TOP_SPLICE, ...pier.draft.topSplice };
const spliceBox = el('div', undefined, 'bearing-ref');
const drawSplice = (): void => {
spliceBox.replaceChildren(el('p', '상면 주철근(C1–C6) 이음', 'muted small'), toggleRow([['ignore', '이음 무시'], ['apply', '반영']] as const, splice.mode, (v) => {
splice = { ...splice, mode: v };
drawSplice();
}));
if (splice.mode === 'apply') {
spliceBox.appendChild(toggleRow([['center', '기둥 중심'], ['end', '단부']] as const, splice.at, (v) => {
splice = { ...splice, at: v };
drawSplice();
}));
}
};
drawSplice();
wrap.appendChild(spliceBox);
const msg = el('p', undefined, 'muted small');
const apply = el('button', '적용', 'btn small');
apply.type = 'button';
@@ -1147,7 +1177,7 @@ function renderCopingSettings(box: HTMLDivElement, pier: Pier): void {
setError('코핑 배근 입력을 확인하세요. 값은 반영되지 않았습니다.');
return;
}
applyCopingRebar(pier.input.name, next);
applyCopingRebar(pier.input.name, next, splice);
});
wrap.append(msg, apply);
box.appendChild(wrap);