The earlier synthetic bend (IP3 at (6, 2)) put IP4 ahead of IP3 on the turned line, so the axis folded back on itself. buildPier now refuses a kink behind IP1 along IP1→IP2 or an IP3 behind the kink along the turned direction. Tests use IP3 (9, −3.464), a valid 60° right turn with kink (7, 0). Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
490 lines
18 KiB
TypeScript
490 lines
18 KiB
TypeScript
import { buildAxis, copingSpan, fromAxis, kinkArc, nearKink, toAxis } from './axis';
|
||
import type { PierInput, Row } from './types';
|
||
|
||
/** Dimensions in m. Sources: intent.PR sheet (P1 rules) and spec.md §3 defaults. */
|
||
export const DIM = {
|
||
columnDiameter: 2.0,
|
||
copingH1: 1.0,
|
||
copingH2: 1.5,
|
||
levelWidth: 2.1,
|
||
/** Multi-column coping: underside between columns sits this far below Level, with 45° haunches of the same size (spec §4.5, Q3 추천안). */
|
||
haunch: 0.3,
|
||
padThickness: 0.05,
|
||
padSize: 1.0,
|
||
blockSize: 1.2,
|
||
footingL: 10.4,
|
||
footingW: 8.15,
|
||
footingH: 2.0,
|
||
blindingMargin: 0.2,
|
||
blindingT: 0.1,
|
||
/** 강관 609.6 × 12 (spec §4.5 강관 type, Q5 추천안 적용). */
|
||
pileDiameter: 0.6096,
|
||
pileEnd: 0.7,
|
||
pileSpacing: 2.25,
|
||
/** Front/back EL difference below this is treated as no lateral step (spec §4.3, Q2). */
|
||
lateralTolerance: 0.005,
|
||
} as const;
|
||
|
||
export interface Vec2 {
|
||
e: number;
|
||
n: number;
|
||
}
|
||
|
||
export interface Segment {
|
||
s0: number;
|
||
s1: number;
|
||
top: number;
|
||
}
|
||
|
||
/** Stretch k, local s from that stretch's base, g = coping-relative arc length, n = lateral offset. */
|
||
export interface BearingLocal {
|
||
no: number;
|
||
row: Row;
|
||
k: number;
|
||
s: number;
|
||
g: number;
|
||
n: number;
|
||
z: number;
|
||
}
|
||
|
||
export interface Stretch {
|
||
origin: Vec2;
|
||
u: Vec2;
|
||
nrm: Vec2;
|
||
/** Coping-relative arc length where this stretch starts (0 for k = 0, the kink for k = 1). */
|
||
base: number;
|
||
}
|
||
|
||
export interface BlockModel {
|
||
no: number;
|
||
row: Row;
|
||
k: number;
|
||
s: number;
|
||
g: number;
|
||
n: number;
|
||
bottom: number;
|
||
top: number;
|
||
padTop: number;
|
||
}
|
||
|
||
export interface ColumnModel {
|
||
s: number;
|
||
k: number;
|
||
top: number;
|
||
bottom: number;
|
||
diameter: number;
|
||
}
|
||
|
||
export interface FootingModel {
|
||
s: number;
|
||
top: number;
|
||
bottom: number;
|
||
length: number;
|
||
width: number;
|
||
}
|
||
|
||
export interface BlindingModel {
|
||
s: number;
|
||
top: number;
|
||
length: number;
|
||
width: number;
|
||
thickness: number;
|
||
}
|
||
|
||
export interface PileModel {
|
||
s: number;
|
||
k: number;
|
||
n: number;
|
||
top: number;
|
||
bottom: number;
|
||
diameter: number;
|
||
}
|
||
|
||
/** One coping slab across [nFrom, nTo]; profile is its (s, EL) outline, closed. */
|
||
export interface CopingPart {
|
||
k: number;
|
||
nFrom: number;
|
||
nTo: number;
|
||
profile: [number, number][];
|
||
}
|
||
|
||
export interface PierModel {
|
||
name: string;
|
||
lengthIp: number;
|
||
azimuthDeg: number;
|
||
/** Unit vector along the pier axis (east, north). */
|
||
u: Vec2;
|
||
/** Unit vector across the axis: (u.n, -u.e). Front row is negative, back row positive. */
|
||
nrm: Vec2;
|
||
ip1: Vec2;
|
||
ip2Input: Vec2;
|
||
ip2Calc: Vec2;
|
||
dIp2: number;
|
||
bp1: Vec2;
|
||
bp2: Vec2;
|
||
/** Horizontal centre of the drawing frame: the centre of the first column. */
|
||
pivot: Vec2;
|
||
copingL: number;
|
||
copingB: number;
|
||
copingRefTop: number;
|
||
h1: number;
|
||
h2: number;
|
||
segments: Segment[];
|
||
/** Coping parts per stretch, split across the width by the lateral step line (one part per stretch without a step). */
|
||
copingParts: CopingPart[];
|
||
stretches: Stretch[];
|
||
/** Bend point IP4, or null for a straight axis. */
|
||
kink: Vec2 | null;
|
||
/** Mitre normal at the kink (unit). A point is on stretch 0 when (p − kink)·mitre ≤ 0. */
|
||
mitre: Vec2 | null;
|
||
levelBottom: number;
|
||
endBottom: number;
|
||
bearings: BearingLocal[];
|
||
blocks: BlockModel[];
|
||
columns: ColumnModel[];
|
||
footings: FootingModel[];
|
||
blindings: BlindingModel[];
|
||
piles: PileModel[];
|
||
groundEl: number;
|
||
derived: {
|
||
columnHeight: number;
|
||
soilCover: number;
|
||
pileCount: number;
|
||
pileLayout: string | null;
|
||
pileTipEl: number | null;
|
||
blockHeightFront: number;
|
||
blockHeightBack: number;
|
||
frontBackDiffSpread: number;
|
||
};
|
||
}
|
||
|
||
/**
|
||
* Bend point IP4 (spec §4.1-2): the point where the IP1→IP2 line meets the line through IP3 whose
|
||
* direction is IP1→IP2 turned by the bend angle. Positive angle = right (clockwise) turn when travelling IP1→IP2.
|
||
* Returns null for a zero angle, where IP4 is not defined.
|
||
*/
|
||
export function solveIp4(ip1: Vec2, ip2: Vec2, ip3: Vec2, angleDeg: number): Vec2 | null {
|
||
if (angleDeg === 0) return null;
|
||
const cross = (a: Vec2, b: Vec2) => a.e * b.n - a.n * b.e;
|
||
const len = Math.hypot(ip2.e - ip1.e, ip2.n - ip1.n);
|
||
const d1: Vec2 = { e: (ip2.e - ip1.e) / len, n: (ip2.n - ip1.n) / len };
|
||
const rad = (-angleDeg * Math.PI) / 180; // clockwise is positive, so the counter-clockwise rotation uses −θ
|
||
const d2: Vec2 = { e: d1.e * Math.cos(rad) - d1.n * Math.sin(rad), n: d1.e * Math.sin(rad) + d1.n * Math.cos(rad) };
|
||
const t = cross({ e: ip3.e - ip1.e, n: ip3.n - ip1.n }, d2) / cross(d1, d2);
|
||
return { e: ip1.e + t * d1.e, n: ip1.n + t * d1.n };
|
||
}
|
||
|
||
/**
|
||
* Builds the first-stage model of a T-type pier from one input record. Pure function.
|
||
* Coordinates: g = arc length from the coping start (BP1), so g = 0 at BP1 and g = L at BP2.
|
||
* Each object carries its stretch k and a local s measured from that stretch's base (k = 0: BP1, k = 1: IP4).
|
||
* A bent coping (IP4 angle ≠ 0) is supported for 현장타설말뚝 only; footings and piles on a bent axis are stage 3.
|
||
*/
|
||
export function buildPier(input: PierInput): PierModel {
|
||
const ip = (name: string) => {
|
||
const p = input.ips.find((q) => q.name === name);
|
||
if (!p) throw new Error(`IP 누락: ${name}`);
|
||
return p;
|
||
};
|
||
const ip1 = ip('IP1');
|
||
const ip2 = ip('IP2');
|
||
const ip3 = ip('IP3');
|
||
const ip4 = ip('IP4');
|
||
const bent = ip4.angleDeg !== 0;
|
||
if (bent && input.foundationType !== '현장타설말뚝') {
|
||
throw new Error('미실시: 꺾인 코핑의 확대기초·말뚝은 3단계에서 구현합니다. 현재는 현장타설말뚝만 지원합니다.');
|
||
}
|
||
|
||
const L = input.copingLengthMm / 1000;
|
||
const B = input.copingWidthMm / 1000;
|
||
const planHalfB = B / 2;
|
||
const ip1v: Vec2 = { e: ip1.x, n: ip1.y };
|
||
const ip2v: Vec2 = { e: ip2.x, n: ip2.y };
|
||
const ip3v: Vec2 = { e: ip3.x, n: ip3.y };
|
||
const kink = bent ? solveIp4(ip1v, ip2v, ip3v, ip4.angleDeg) : null;
|
||
const axis = buildAxis(ip1v, ip3v, kink);
|
||
if (kink) {
|
||
// The bend must move the axis forward: the kink ahead of IP1 along IP1→IP2, and IP3 ahead of the kink along the turned direction.
|
||
const d1 = { e: ip2v.e - ip1v.e, n: ip2v.n - ip1v.n };
|
||
const len1 = Math.hypot(d1.e, d1.n);
|
||
const rad = (-ip4.angleDeg * Math.PI) / 180;
|
||
const d2 = { e: (d1.e * Math.cos(rad) - d1.n * Math.sin(rad)) / len1, n: (d1.e * Math.sin(rad) + d1.n * Math.cos(rad)) / len1 };
|
||
const kinkAhead = (kink.e - ip1v.e) * d1.e + (kink.n - ip1v.n) * d1.n > 0;
|
||
const ip3Ahead = (ip3v.e - kink.e) * d2.e + (ip3v.n - kink.n) * d2.n > 0;
|
||
if (!kinkAhead || !ip3Ahead) {
|
||
throw new Error('꺾임각과 IP 배치가 맞지 않습니다. IP4가 축 뒤로 넘어갑니다. IP3이 꺾인 방향의 앞쪽에 있는지 확인하세요.');
|
||
}
|
||
}
|
||
const lengthIp = axis.length;
|
||
const sStart = copingSpan(axis, L).sStart;
|
||
const arcA = kinkArc(axis);
|
||
const kinkG = arcA === null ? null : arcA - sStart;
|
||
if (kinkG !== null && (kinkG <= 0 || kinkG >= L)) {
|
||
throw new Error('꺾임점이 코핑 범위 밖에 있습니다. 코핑 길이를 확인하세요.');
|
||
}
|
||
const base = [0, kinkG ?? 0];
|
||
const { u, nrm } = axis.segments[0];
|
||
const azimuthDeg = (((Math.atan2(u.e, u.n) * 180) / Math.PI) + 360) % 360;
|
||
|
||
// IP2 is a 1:9 reference point on a straight axis (intent.PR, spec §2.2). On a bent axis IP2 is on the first stretch, so no check.
|
||
const ip2Calc: Vec2 = kink ? ip2v : { e: ip1.x + 0.1 * (ip3.x - ip1.x), n: ip1.y + 0.1 * (ip3.y - ip1.y) };
|
||
const ip2Input: Vec2 = ip2v;
|
||
|
||
const pointAt = (g: number, n: number): Vec2 => {
|
||
const arc = sStart + g;
|
||
const k = kinkG !== null && g > kinkG ? 1 : 0;
|
||
return fromAxis(axis, { k, s: arc, n });
|
||
};
|
||
const bp1 = pointAt(0, 0);
|
||
const bp2 = pointAt(L, 0);
|
||
const pivot = pointAt(L / 2, 0);
|
||
|
||
const front = input.bearings.filter((b) => b.row === '전열').sort((a, b) => a.no - b.no);
|
||
const back = input.bearings.filter((b) => b.row === '후열').sort((a, b) => a.no - b.no);
|
||
if (front.length !== back.length) throw new Error('E02: 전열·후열 받침 수가 다릅니다.');
|
||
if (front.length < 2) throw new Error('받침이 2개 미만입니다.');
|
||
|
||
// Bearing block heights (spec §4.3 h1OshoeBlock / h2, pad 50 included). Not the coping end heights (DIM.copingH1/H2).
|
||
const h1 = front[0].z - input.copingTopEl;
|
||
const h2 = h1 + (back[0].z - front[0].z);
|
||
|
||
const place = (b: { x: number; y: number }) => {
|
||
const q = toAxis(axis, { e: b.x, n: b.y });
|
||
const g = q.s - sStart;
|
||
return { k: q.k, g, s: g - base[q.k], n: q.n };
|
||
};
|
||
const frontPlaced = front.map((b) => ({ no: b.no, row: '전열' as Row, z: b.z, ...place(b) }));
|
||
const backPlaced = back.map((b) => ({ no: b.no, row: '후열' as Row, z: b.z, ...place(b) }));
|
||
|
||
// Step boundaries sit midway between consecutive front bearings in coping coordinates (spec §4.3).
|
||
const bounds = [0];
|
||
for (let k = 0; k < frontPlaced.length - 1; k++) {
|
||
bounds.push((frontPlaced[k].g + frontPlaced[k + 1].g) / 2);
|
||
}
|
||
bounds.push(L);
|
||
const segments: Segment[] = frontPlaced.map((b, k) => ({ s0: bounds[k], s1: bounds[k + 1], top: b.z - h1 }));
|
||
|
||
// Lateral step (spec §4.3, Q1·Q2 추천안): front and back tops differ by 5 mm or more in some segment.
|
||
const backTops = backPlaced.map((b) => b.z - h2);
|
||
const lateralStep = backTops.some((top, k) => Math.abs(segments[k].top - top) >= DIM.lateralTolerance);
|
||
|
||
// Columns (spec §4.5). Positions are coping coordinates; a column must stay a Level half-width away from the kink.
|
||
const colG = columnPositions(input.type, L);
|
||
if (kinkG !== null) {
|
||
const near = nearKink(axis, colG.map((g) => sStart + g), DIM.levelWidth / 2);
|
||
if (near.length) throw new Error('미실시: 꺾임점 근처(Level 반폭 이내)에 기둥이 있습니다. 기둥 위치를 확인하세요.');
|
||
}
|
||
const colK = colG.map((g) => (kinkG !== null && g > kinkG ? 1 : 0));
|
||
// Coping underside: ends at (top − end height h1 = 1000), Level zone at (top − h1 − h2 taper height = 1500).
|
||
const levelBottom = input.copingTopEl - DIM.copingH1 - DIM.copingH2;
|
||
const endBottom = input.copingTopEl - DIM.copingH1;
|
||
const levelStart = Math.min(...colG) - DIM.levelWidth / 2;
|
||
const levelEnd = Math.max(...colG) + DIM.levelWidth / 2;
|
||
if (levelStart < 0 || levelEnd > L) throw new Error('코핑 길이가 Level 구간보다 짧습니다.');
|
||
|
||
// Underside from the right end to the left end. Between columns (2·3주형) it drops 300 below Level with 300 × 300 haunches (spec §4.5, Q3).
|
||
const underside: [number, number][] = [[L, endBottom]];
|
||
const levelZones = [...colG].sort((a, b) => b - a).map((s) => [s - DIM.levelWidth / 2, s + DIM.levelWidth / 2] as const);
|
||
levelZones.forEach(([zoneStart, zoneEnd], k) => {
|
||
underside.push([zoneEnd, levelBottom], [zoneStart, levelBottom]);
|
||
const next = levelZones[k + 1];
|
||
if (!next) return;
|
||
const gap = zoneStart - next[1];
|
||
if (gap <= 2 * DIM.haunch) throw new Error('기둥 사이 간격이 헌치(300 × 2)보다 좁아 코핑 하면을 만들 수 없습니다.');
|
||
const lowerEl = levelBottom - DIM.haunch;
|
||
underside.push([zoneStart - DIM.haunch, lowerEl], [next[1] + DIM.haunch, lowerEl], [next[1], levelBottom]);
|
||
});
|
||
|
||
// Elevation outline in coping coordinates for one row of tops, closed by the shared underside.
|
||
const outline = (tops: number[]): [number, number][] => {
|
||
const pts: [number, number][] = [[0, endBottom]];
|
||
segments.forEach((seg, k) => pts.push([seg.s0, tops[k]], [seg.s1, tops[k]]));
|
||
pts.push(...underside);
|
||
return pts;
|
||
};
|
||
// Each stretch uses the same outline shifted to its own base; the mitre plane trims the overlap at the kink.
|
||
const shifted = (pts: [number, number][], b: number): [number, number][] => pts.map(([s, z]) => [s - b, z]);
|
||
|
||
const meanN = (rows: { n: number }[]) => rows.reduce((sum, r) => sum + r.n, 0) / rows.length;
|
||
const frontTops = segments.map((seg) => seg.top);
|
||
const copingParts: CopingPart[] = [];
|
||
const stretchCount = kinkG === null ? 1 : 2;
|
||
for (let k = 0; k < stretchCount; k++) {
|
||
const fRows = frontPlaced.filter((b) => b.k === k);
|
||
const bRows = backPlaced.filter((b) => b.k === k);
|
||
const nStep = fRows.length && bRows.length
|
||
? (meanN(fRows) + meanN(bRows)) / 2
|
||
: (meanN(frontPlaced) + meanN(backPlaced)) / 2;
|
||
if (lateralStep) {
|
||
copingParts.push(
|
||
{ k, nFrom: -planHalfB, nTo: nStep, profile: shifted(outline(frontTops), base[k]) },
|
||
{ k, nFrom: nStep, nTo: planHalfB, profile: shifted(outline(backTops), base[k]) },
|
||
);
|
||
} else {
|
||
copingParts.push({ k, nFrom: -planHalfB, nTo: planHalfB, profile: shifted(outline(frontTops), base[k]) });
|
||
}
|
||
}
|
||
|
||
const footingTop = input.foundationType === '현장타설말뚝' ? input.footingBottomEl : input.footingBottomEl + DIM.footingH;
|
||
const columns: ColumnModel[] = colG.map((g, i) => ({
|
||
s: g - base[colK[i]],
|
||
k: colK[i],
|
||
top: levelBottom,
|
||
bottom: footingTop,
|
||
diameter: DIM.columnDiameter,
|
||
}));
|
||
|
||
const footings: FootingModel[] = [];
|
||
const blindings: BlindingModel[] = [];
|
||
const piles: PileModel[] = [];
|
||
const pileLength = input.pileLengthMm / 1000;
|
||
const pileTip = input.footingBottomEl - pileLength;
|
||
|
||
if (input.foundationType === '현장타설말뚝') {
|
||
columns.forEach((c) => {
|
||
piles.push({ s: c.s, k: c.k, n: 0, top: input.footingBottomEl, bottom: pileTip, diameter: DIM.columnDiameter });
|
||
});
|
||
} else {
|
||
for (const g of footingGroups(colG)) {
|
||
footings.push({ s: g.s, top: footingTop, bottom: input.footingBottomEl, length: g.length, width: DIM.footingW });
|
||
blindings.push({
|
||
s: g.s,
|
||
top: input.footingBottomEl,
|
||
length: g.length + DIM.blindingMargin,
|
||
width: DIM.footingW + DIM.blindingMargin,
|
||
thickness: DIM.blindingT,
|
||
});
|
||
if (input.foundationType === '말뚝기초') {
|
||
piles.push(...pilesFor(g.s, input.footingBottomEl, pileLength, g.length));
|
||
}
|
||
}
|
||
}
|
||
|
||
const blocks: BlockModel[] = [];
|
||
frontPlaced.forEach((b) => {
|
||
const bottom = segmentTop(segments, b.g);
|
||
blocks.push({ no: b.no, row: '전열', k: b.k, s: b.s, g: b.g, n: b.n, bottom, top: b.z - DIM.padThickness, padTop: b.z });
|
||
});
|
||
backPlaced.forEach((b) => {
|
||
const bottom = b.z - h2;
|
||
blocks.push({ no: b.no, row: '후열', k: b.k, s: b.s, g: b.g, n: b.n, bottom, top: b.z - DIM.padThickness, padTop: b.z });
|
||
});
|
||
|
||
const blockHeightFront = blocks.find((b) => b.row === '전열')!.top - blocks.find((b) => b.row === '전열')!.bottom;
|
||
const blockHeightBack = blocks.find((b) => b.row === '후열')!.top - blocks.find((b) => b.row === '후열')!.bottom;
|
||
const diffs = frontPlaced.map((f, k) => f.z - backPlaced[k].z);
|
||
const frontBackDiffSpread = Math.max(...diffs) - Math.min(...diffs);
|
||
|
||
return {
|
||
name: input.name,
|
||
lengthIp,
|
||
azimuthDeg,
|
||
u,
|
||
nrm,
|
||
ip1: ip1v,
|
||
ip2Input,
|
||
ip2Calc,
|
||
dIp2: (ip2Calc.e - bp1.e) * u.e + (ip2Calc.n - bp1.n) * u.n,
|
||
bp1,
|
||
bp2,
|
||
pivot,
|
||
copingL: L,
|
||
copingB: B,
|
||
copingRefTop: input.copingTopEl,
|
||
h1,
|
||
h2,
|
||
segments,
|
||
copingParts,
|
||
stretches: axis.segments.map((seg, k) => ({ origin: k === 0 ? bp1 : seg.start, u: seg.u, nrm: seg.nrm, base: base[k] })),
|
||
kink,
|
||
mitre: axis.mitre,
|
||
levelBottom,
|
||
endBottom,
|
||
bearings: [...frontPlaced, ...backPlaced].map((b) => ({ no: b.no, row: b.row, k: b.k, s: b.s, g: b.g, n: b.n, z: b.z })),
|
||
blocks,
|
||
columns,
|
||
footings,
|
||
blindings,
|
||
piles,
|
||
groundEl: input.groundEl,
|
||
derived: {
|
||
columnHeight: levelBottom - columns[0].bottom,
|
||
soilCover: input.groundEl - (input.foundationType === '현장타설말뚝' ? input.footingBottomEl : footingTop),
|
||
pileCount: piles.length,
|
||
pileLayout: input.foundationType === '말뚝기초' ? pileLayoutText(footings[0].length) : null,
|
||
pileTipEl: piles.length ? pileTip : null,
|
||
blockHeightFront,
|
||
blockHeightBack,
|
||
frontBackDiffSpread,
|
||
},
|
||
};
|
||
}
|
||
|
||
export function columnPositions(type: PierInput['type'], L: number): number[] {
|
||
if (type === 'T형') return [L / 2];
|
||
if (type === '2주형') return [L / 5, L - L / 5];
|
||
return [L / 5, L / 2, L - L / 5];
|
||
}
|
||
|
||
function segmentTop(segments: Segment[], s: number): number {
|
||
const hit = segments.find((seg) => s >= seg.s0 && s < seg.s1) ?? segments[segments.length - 1];
|
||
return hit.top;
|
||
}
|
||
|
||
/**
|
||
* Footings (spec §4.6). Adjacent columns closer than one footing length share a 일체기초 whose length is
|
||
* the distance between its outer columns + DIM.footingL, centred between them. Other columns get their own footing.
|
||
*/
|
||
export function footingGroups(colS: number[]): { s: number; length: number }[] {
|
||
const groups: number[][] = [];
|
||
for (const s of [...colS].sort((a, b) => a - b)) {
|
||
const last = groups[groups.length - 1];
|
||
if (last && s - last[last.length - 1] < DIM.footingL) last.push(s);
|
||
else groups.push([s]);
|
||
}
|
||
return groups.map((g) => ({
|
||
s: (g[0] + g[g.length - 1]) / 2,
|
||
length: g[g.length - 1] - g[0] + DIM.footingL,
|
||
}));
|
||
}
|
||
|
||
/**
|
||
* Piles under one footing (spec §4.6): rows across the footing width, piles along the length,
|
||
* both with an end distance of 0.7 m and an even spacing that never exceeds 2.25 m.
|
||
*/
|
||
export function pileGrid(footingLength: number = DIM.footingL): { countS: number; countN: number; spacingS: number; spacingN: number } {
|
||
const span = (size: number) => Math.floor((size - 2 * DIM.pileEnd) / DIM.pileSpacing) + 1;
|
||
const countS = span(footingLength);
|
||
const countN = span(DIM.footingW);
|
||
return {
|
||
countS,
|
||
countN,
|
||
spacingS: (footingLength - 2 * DIM.pileEnd) / (countS - 1),
|
||
spacingN: (DIM.footingW - 2 * DIM.pileEnd) / (countN - 1),
|
||
};
|
||
}
|
||
|
||
/** Display string such as "4@2250 × 3@2250 = 20본" (gaps along the length × gaps across the width). */
|
||
export function pileLayoutText(footingLength: number = DIM.footingL): string {
|
||
const g = pileGrid(footingLength);
|
||
return `${g.countS - 1}@${Math.round(g.spacingS * 1000)} × ${g.countN - 1}@${Math.round(g.spacingN * 1000)} = ${g.countS * g.countN}본`;
|
||
}
|
||
|
||
export function pilesFor(s: number, topEl: number, length: number, footingLength: number = DIM.footingL): PileModel[] {
|
||
const { countS, countN, spacingS, spacingN } = pileGrid(footingLength);
|
||
const out: PileModel[] = [];
|
||
for (let i = 0; i < countS; i++) {
|
||
for (let j = 0; j < countN; j++) {
|
||
out.push({
|
||
s: s + (i - (countS - 1) / 2) * spacingS,
|
||
k: 0,
|
||
n: (j - (countN - 1) / 2) * spacingN,
|
||
top: topEl,
|
||
bottom: topEl - length,
|
||
diameter: DIM.pileDiameter,
|
||
});
|
||
}
|
||
}
|
||
return out;
|
||
}
|