feat(shape): 교좌면 EL로 받침별 코핑 상면 계단을 만든다 (W10은 정보)

입력 교좌면 EL이 있으면 그 받침 구간의 코핑 상면 = 교좌면 EL (없으면 z − h1 / z − h2).
받침블럭 바닥과 코핑 상면이 항상 맞아 블럭이 뜨거나 묻히지 않는다. seatCalc는 기울기 계산값으로 남겨
W10 비교 기준으로 쓰고, W10은 경고(W)에서 정보(I)로 바꾼다.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
ypshimandClaude Haiku 5.5 committed 2026-11-10 15:07:19 +09:00
1 parent 4ef8412d89
commit 8aedc9b969
4 files changed
+35 -7

No files matched your search

+6 -4
View File
@@ -337,13 +337,15 @@ export function buildPier(input: PierInput, ctx: PierContext = {}): PierModel {
bounds.push((frontPlaced[k].g + frontPlaced[k + 1].g) / 2); bounds.push((frontPlaced[k].g + frontPlaced[k + 1].g) / 2);
} }
bounds.push(L); bounds.push(L);
const segments: Segment[] = frontPlaced.map((b, k) => ({ s0: bounds[k], s1: bounds[k + 1], top: b.z - h1 })); // 교좌면 EL per bearing (2026-11-10): when given, it is the coping top of that bearing's step; otherwise z − h1 (z − h2 behind).
const seatOf = new Map(input.bearings.map((r) => [r.no, r.seatEl]));
const segments: Segment[] = frontPlaced.map((b, k) => ({ s0: bounds[k], s1: bounds[k + 1], top: seatOf.get(b.no) ?? b.z - h1 }));
// Lateral step (spec §4.3, Q1·Q2 추천안): front and back tops differ by 5 mm or more in some segment. // Lateral step (spec §4.3, Q1·Q2 추천안): front and back tops differ by 5 mm or more in some segment.
const backSegments: Segment[] = backPlaced.map((b,k) => ({ const backSegments: Segment[] = backPlaced.map((b,k) => ({
s0: unequalRows ? (k === 0 ? 0 : (backPlaced[k-1].g+b.g)/2) : segments[k].s0, s0: unequalRows ? (k === 0 ? 0 : (backPlaced[k-1].g+b.g)/2) : segments[k].s0,
s1: unequalRows ? (k === backPlaced.length-1 ? L : (b.g+backPlaced[k+1].g)/2) : segments[k].s1, s1: unequalRows ? (k === backPlaced.length-1 ? L : (b.g+backPlaced[k+1].g)/2) : segments[k].s1,
top: b.z-h2, top: seatOf.get(b.no) ?? b.z-h2,
})); }));
const stepBounds = [...new Set([0,L,...segments.slice(1).map(s=>s.s0),...backSegments.slice(1).map(s=>s.s0)])].sort((a,b)=>a-b); const stepBounds = [...new Set([0,L,...segments.slice(1).map(s=>s.s0),...backSegments.slice(1).map(s=>s.s0)])].sort((a,b)=>a-b);
const stepSamples = stepBounds.slice(1).map((end,k)=>(stepBounds[k]+end)/2); const stepSamples = stepBounds.slice(1).map((end,k)=>(stepBounds[k]+end)/2);
@@ -478,9 +480,9 @@ export function buildPier(input: PierInput, ctx: PierContext = {}): PierModel {
}; };
const dropOf = (no: number) => soles.get(no)!.dropMm / 1000; const dropOf = (no: number) => soles.get(no)!.dropMm / 1000;
// 교좌면 EL (2026-11-03): when the input gives it, the block bottom is that EL; otherwise the 두부보 상면 slope. // 교좌면 EL (2026-11-03): when the input gives it, the block bottom is that EL; otherwise the 두부보 상면 slope.
const seatOf = new Map(input.bearings.map((r) => [r.no, r.seatEl])); // seatCalc stays the slope value (z − h1, z − h2) as the W10 reference.
frontPlaced.forEach((b) => { frontPlaced.forEach((b) => {
const seatCalc = segmentTop(segments, b.g); const seatCalc = b.z - h1;
const bottom = seatOf.get(b.no) ?? seatCalc; const bottom = seatOf.get(b.no) ?? seatCalc;
const skew = skewOf(b.no, b.k), drop = dropOf(b.no); const skew = skewOf(b.no, b.k), drop = dropOf(b.no);
blocks.push({ no: b.no, row: '전열', k: b.k, s: b.s, g: b.g, n: b.n, bottom, top: b.z - DIM.padThickness - drop, padTop: b.z - drop, rowSkewDeg: skew, plan: planOf(b.no, b.k, skew), seatCalc }); blocks.push({ no: b.no, row: '전열', k: b.k, s: b.s, g: b.g, n: b.n, bottom, top: b.z - DIM.padThickness - drop, padTop: b.z - drop, rowSkewDeg: skew, plan: planOf(b.no, b.k, skew), seatCalc });
+3 -2
View File
@@ -48,6 +48,7 @@ export function validateInput(input: PierInput, issues: Issue[]): boolean {
/** Geometry-level checks (spec §10 W01–W05, W07, I01) on a built model. */ /** Geometry-level checks (spec §10 W01–W05, W07, I01) on a built model. */
export function validatePier(input: PierInput, model: PierModel, issues: Issue[]): void { export function validatePier(input: PierInput, model: PierModel, issues: Issue[]): void {
// W10 (2026-11-03): the input 교좌면 EL should match the 두부보 상면 slope within 5 mm; the input wins. // W10 (2026-11-03): the input 교좌면 EL should match the 두부보 상면 slope within 5 mm; the input wins.
// Since 2026-11-10 the input also sets the coping top of that step, so this is information (I), not a warning.
for (const b of model.blocks) { for (const b of model.blocks) {
const seat = input.bearings.find((r) => r.no === b.no)?.seatEl; const seat = input.bearings.find((r) => r.no === b.no)?.seatEl;
if (seat === undefined) continue; if (seat === undefined) continue;
@@ -55,9 +56,9 @@ export function validatePier(input: PierInput, model: PierModel, issues: Issue[]
if (Math.abs(diffMm) > 5) { if (Math.abs(diffMm) > 5) {
issues.push({ issues.push({
code: 'W10', code: 'W10',
level: 'W', level: 'I',
pier: input.name, pier: input.name,
message: `${b.row} 받침 ${b.no}번 교좌면 EL ${seat.toFixed(3)}은(는) 두부보 상면 계산값 ${b.seatCalc.toFixed(3)}과 ${diffMm.toFixed(1)} mm 차이가 납니다 (허용 5 mm). 입력값을 씁니다.`, message: `${b.row} 받침 ${b.no}번 교좌면 EL ${seat.toFixed(3)}은(는) 두부보 상면 계산값 ${b.seatCalc.toFixed(3)}과 ${diffMm.toFixed(1)} mm 차이가 납니다 (허용 5 mm). 입력값으로 받침블럭 바닥과 코핑 상면을 만듭니다.`,
}); });
} }
} }
+18
View File
@@ -55,4 +55,22 @@ describe('교좌면 EL 입력 (2026-11-03)', () => {
validatePier(input, m, issues); validatePier(input, m, issues);
expect(issues.filter((i) => i.code === 'W10')).toEqual([]); expect(issues.filter((i) => i.code === 'W10')).toEqual([]);
}); });
it('an input 교좌면 EL also sets the coping top of that step, so the block sits on the coping (2026-11-10)', () => {
const m = buildPier(withSeat(loadP1(), [43.4, ...SEAT.slice(1)]), P1CTX);
const b1 = m.blocks.find((x) => x.no === 1 && x.row === '전열')!;
const seg = m.segments.find((s) => b1.g >= s.s0 && b1.g < s.s1)!;
expect(seg.top).toBeCloseTo(43.4, 6);
expect(b1.bottom).toBeCloseTo(seg.top, 9);
// seatCalc keeps the slope value (z − h1) as the W10 reference.
expect(b1.seatCalc).toBeCloseTo(43.411, 3);
});
it('W10 is information (I), not a warning, since the input builds the geometry', () => {
const input = withSeat(loadP1(), [43.5, ...SEAT.slice(1)]);
const m = buildPier(input, P1CTX);
const issues: Issue[] = [];
validatePier(input, m, issues);
expect(issues.filter((i) => i.code === 'W10').map((i) => i.level)).toEqual(['I']);
});
}); });
+8 -1
View File
@@ -214,7 +214,8 @@ describe('횡방향 단차 (spec §4.3, Q1·Q2 추천안)', () => {
it('a 20 mm step in one segment splits the coping into two parts at the bearing-row midline', () => { it('a 20 mm step in one segment splits the coping into two parts at the bearing-row midline', () => {
const p1 = loadP1(); const p1 = loadP1();
const bearings = p1.bearings.map((b) => (b.row === '후열' && b.no === 7 ? { ...b, z: b.z + 0.02 } : b)); // The P1 sheet gives 교좌면 EL, which sets the step top (2026-11-10), so it is raised with z.
const bearings = p1.bearings.map((b) => (b.row === '후열' && b.no === 7 ? { ...b, z: b.z + 0.02, seatEl: b.seatEl! + 0.02 } : b));
const m = buildPier({ ...p1, bearings }); const m = buildPier({ ...p1, bearings });
expect(m.copingParts).toHaveLength(2); expect(m.copingParts).toHaveLength(2);
const [front, back] = m.copingParts; const [front, back] = m.copingParts;
@@ -228,6 +229,12 @@ describe('횡방향 단차 (spec §4.3, Q1·Q2 추천안)', () => {
expect(topAt(back, s2) - topAt(front, s2)).toBeCloseTo(0.02, 6); expect(topAt(back, s2) - topAt(front, s2)).toBeCloseTo(0.02, 6);
}); });
it('a 20 mm higher 교좌면 EL alone (z unchanged) also makes the step (2026-11-10)', () => {
const p1 = loadP1();
const bearings = p1.bearings.map((b) => (b.row === '후열' && b.no === 7 ? { ...b, seatEl: b.seatEl! + 0.02 } : b));
expect(buildPier({ ...p1, bearings }).copingParts).toHaveLength(2);
});
it('a 3 mm difference is below the 5 mm tolerance: no step', () => { it('a 3 mm difference is below the 5 mm tolerance: no step', () => {
const p1 = loadP1(); const p1 = loadP1();
const bearings = p1.bearings.map((b) => (b.row === '후열' && b.no === 7 ? { ...b, z: b.z + 0.003 } : b)); const bearings = p1.bearings.map((b) => (b.row === '후열' && b.no === 7 ? { ...b, z: b.z + 0.003 } : b));