Files
Pier_v1/src/core/abut/ground.ts
T
ypshimandClaude Haiku 5.5 59c2607418 feat(abut): 교대 지반·지층 카드 — 교각과 같은 위치 · 수위 · 지층 행 입력, 교대 단면 삽도, 검사
- 위치 (육상 · 하상 · 해상)와 위치별 수위 입력, 지층 행 표 (교각과 공용 strataRowsEditor), 지반 모델 지층 불러오기
- 검사: 교각과 같은 G01–G14, 말뚝 근입 G04, 지반고 < 저판 하면이면 정보 AI01
- 삽도: 지층 · 수위 띠를 교각과 공용으로 빼고, 교대축 직각 단면(저판 · 벽체 · 흉벽 · 말뚝 열)을 EL. 표기로 그림
- 자동 값: 지반고 (엑셀 입력), 연암층 상면 EL, 지층 수. 프로젝트 파일 저장 · 검증

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
2026-11-04 10:36:23 +09:00

68 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-11-04, 시안 ② 지반·지층 카드 = 교각과 같은 카드). 순수 함수.
*
* - 입력은 교각과 같은 이름이다: 위치(육상 · 하상 · 해상), 지하수위, 설계홍수위 · 세굴, 고조위 · 저조위, 지층 행.
* 지반고는 엑셀 입력(①에서 수정)이다. 표시만 하고 형상 계산에는 쓰지 않는다.
* - 검사는 교각과 같다(G01–G14, 말뚝 근입 G04). 지반고가 저판 하면보다 낮으면 흙덮개가 없다는 정보 AI01을 더한다.
*/
import { SUPPORT_STRATUM, validateGround, validatePileEmbedment, validateStrataNValues, type GroundCheckInput } from '../ground';
import type { Issue, PierInput } from '../types';
import type { AbutMembers } from './members';
import type { AbutRecord } from './parse';
export type AbutGround = Pick<PierInput, 'groundPosition' | 'groundWaterOn' | 'groundWaterEl' | 'floodLevelEl' | 'scourDepthM' | 'highWaterEl' | 'lowWaterEl' | 'strataRows'>;
/** 말뚝 두께 (mm): spec_abut 말뚝 Φ600 × 12T. Used only by the 해상 부식 여유 check. */
const ABUT_PILE_THICKNESS_MM = 12;
/** The check input of an abutment: its 지반 values, 지반고 and 저판 하면 (기초 하단 when the 저판 is not built). */
export function abutGroundCheckInput(rec: AbutRecord, members?: AbutMembers): GroundCheckInput {
return {
name: rec.name,
groundEl: rec.groundEl,
footingBottomEl: members?.footingBottomEl ?? rec.foundationBottomEl,
pileThicknessMm: ABUT_PILE_THICKNESS_MM,
...(rec.ground ?? {}),
};
}
/** 연암 상면 EL: the bottom of the row above the 연암 row (지반고 for the first row); undefined without a 연암 row. */
export function supportTopEl(groundEl: number, rows: { name: string; bottomEl: number }[] | undefined): number | undefined {
const list = rows ?? [];
const k = list.findIndex((r) => r.name === SUPPORT_STRATUM);
if (k < 0) return undefined;
return k === 0 ? groundEl : list[k - 1].bottomEl;
}
/** Issues of the 지반·지층 card: the pier checks plus AI01 (지반고 below the 저판 하면). */
export function abutGroundIssues(rec: AbutRecord, members?: AbutMembers): Issue[] {
const input = abutGroundCheckInput(rec, members);
const issues: Issue[] = [];
validateGround(input, issues);
validateStrataNValues(input, issues);
if (members && members.pileBottomEl !== undefined && members.piles.length > 0) {
validatePileEmbedment(input, { piles: [{ bottom: members.pileBottomEl, diameter: members.shape.pileDiameterM }] }, issues);
}
if (rec.groundEl < input.footingBottomEl) {
issues.push({
code: 'AI01',
level: 'I',
pier: rec.name,
message: `지반고 ${rec.groundEl.toFixed(3)}이 저판 하면 ${input.footingBottomEl.toFixed(3)}보다 ${(input.footingBottomEl - rec.groundEl).toFixed(3)} 낮아 흙덮개가 없습니다.`,
});
}
return issues;
}
/** True when any 지반 value differs from the default (육상, 지하수위 없음, 지층 행 없음). */
export function abutGroundChanged(ground: AbutGround | undefined): boolean {
if (!ground) return false;
return Object.entries(ground).some(([key, v]) => {
if (v === undefined) return false;
if (key === 'groundPosition') return v !== '육상';
if (key === 'groundWaterOn') return v === true;
if (key === 'strataRows') return (v as unknown[]).length > 0;
return true;
});
}