Files
Pier_v1/src/core/rebar/coping-settings.ts
T
ypshimandClaude Haiku 5.5 496e0ea4e5 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>
2026-10-26 16:14:23 +09:00

99 lines
3.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* 코핑 배근 입력 (승인 2026-10-26, 제안 = RAG/코핑_입력범위_제안.md). The 12 numbers of the ③ 코핑 배근 입력 panel.
* Defaults are the 코핑철근.md values; the ranges are the proposal's, pending the design-standard check.
*/
export interface CopingRebarSettings {
/** 피복 (철근 중심, mm). */
cover: number;
/** 주철근 기본간격 (mm). */
mainSpacing: number;
/** 주철근 끝단 최소 여유 (mm). */
mainEndGap: number;
/** 상면 주철근 단 간격 · 세로 (mm). The horizontal step is fixed at d (H29, 28.6 mm). */
mainLayerGap: number;
/** 첫 전단철근 최소 여유 (피복 다음, mm). */
firstShearGap: number;
/** 전단철근 다리 수 (짝수). */
shearLegs: number;
/** 전단철근 간격 · 경사 (mm). */
spacingS: number;
/** 전단철근 간격 · Level (mm). */
spacingL: number;
/** 측면 수평 간격 (mm). */
sideSpacing: number;
/** 측면 위 끝 아래 최소 여유 (mm). */
sideEndGap: number;
/** C14 간격 위 2줄 (mm). */
c14UpperSpacing: number;
/** C14 간격 아래 줄 (mm). */
c14LowerSpacing: number;
}
export const DEFAULT_COPING_REBAR: CopingRebarSettings = {
cover: 100,
mainSpacing: 125,
mainEndGap: 80,
mainLayerGap: 100,
firstShearGap: 200,
shearLegs: 6,
spacingS: 250,
spacingL: 300,
sideSpacing: 250,
sideEndGap: 400,
c14UpperSpacing: 1000,
c14LowerSpacing: 2000,
};
/** Allowed range per input (inclusive, mm). The shear legs are checked for evenness separately (CP02). */
export const COPING_REBAR_RANGES: Record<keyof CopingRebarSettings, [number, number]> = {
cover: [80, 150],
mainSpacing: [100, 150],
mainEndGap: [60, 100],
mainLayerGap: [80, 120],
firstShearGap: [100, 300],
shearLegs: [4, 8],
spacingS: [200, 350],
spacingL: [200, 350],
sideSpacing: [200, 300],
sideEndGap: [300, 500],
c14UpperSpacing: [800, 1200],
c14LowerSpacing: [1500, 2500],
};
/** 상면 주철근(C1–C6) 이음 (승인 2026-10-26): ignore = 이음 무시 (사양 기본), apply = 정척 초과 시 2조각 겹침. */
export type TopSpliceMode = 'ignore' | 'apply';
/** 이음 위치: center = 기둥 중심, end = 단부 (정척 안에서 가장 끝 쪽). */
export type TopSpliceAt = 'center' | 'end';
export interface TopSpliceSettings {
mode: TopSpliceMode;
at: TopSpliceAt;
}
export const DEFAULT_TOP_SPLICE: TopSpliceSettings = { mode: 'ignore', at: 'center' };
export interface CopingSettingsIssue {
code: 'CP01' | 'CP02';
key: keyof CopingRebarSettings;
message: string;
}
/**
* Checks the settings against the ranges. CP01: a value is not a finite number or is out of range (W).
* CP02: the shear leg count is odd (the 폐합 bars come in pairs of legs).
*/
export function copingSettingsIssues(s: CopingRebarSettings): CopingSettingsIssue[] {
const out: CopingSettingsIssue[] = [];
for (const key of Object.keys(COPING_REBAR_RANGES) as (keyof CopingRebarSettings)[]) {
const v = s[key];
const [lo, hi] = COPING_REBAR_RANGES[key];
if (!Number.isFinite(v) || v < lo || v > hi) {
out.push({ code: 'CP01', key, message: `CP01 ${key} ${v} 범위 밖 (${lo}–${hi})` });
}
}
if (Number.isFinite(s.shearLegs) && s.shearLegs % 2 !== 0) {
out.push({ code: 'CP02', key: 'shearLegs', message: `CP02 전단철근 다리 수 ${s.shearLegs}는 홀수 (짝수만 허용)` });
}
return out;
}