feat(view): dimension lines on the 정면 — footing length above, h1 at the right, the visible pile length at the left
The side view has dimension lines with 45° ticks: the footing length (mm) above the footing, the footing height h1 at its right, and the visible pile length (끊음) at its left. The margins are wider (1.5 m) for the labels; the plan uses the same margin so the two views stay aligned. The old h1 label is replaced by the dimension label. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f76bfc9d5a
commit
6050435af1
1 file changed
+20
-3
+20
-3
@@ -13,6 +13,18 @@ const PILE_STUB = 4;
|
||||
|
||||
const mm = (v: number) => Math.round(v * 1000);
|
||||
|
||||
/** Horizontal dimension line from x1 to x2 at height y, with 45° ticks and a centred label above it (승인 2026-10-23). */
|
||||
function dimH(x1: number, x2: number, y: number, label: string): string {
|
||||
const t = 0.12;
|
||||
return `<g stroke="#2d3742" stroke-width="0.02" fill="#2d3742"><line x1="${x1}" y1="${y}" x2="${x2}" y2="${y}"/><line x1="${x1 - t}" y1="${y + t}" x2="${x1 + t}" y2="${y - t}"/><line x1="${x2 - t}" y1="${y + t}" x2="${x2 + t}" y2="${y - t}"/><text x="${(x1 + x2) / 2}" y="${y - 0.15}" font-size="0.5" text-anchor="middle" stroke="none">${label}</text></g>`;
|
||||
}
|
||||
|
||||
/** Vertical dimension line from y1 to y2 at x, with 45° ticks and the label to its right. */
|
||||
function dimV(x: number, y1: number, y2: number, label: string): string {
|
||||
const t = 0.12;
|
||||
return `<g stroke="#2d3742" stroke-width="0.02" fill="#2d3742"><line x1="${x}" y1="${y1}" x2="${x}" y2="${y2}"/><line x1="${x - t}" y1="${y1 + t}" x2="${x + t}" y2="${y1 - t}"/><line x1="${x - t}" y1="${y2 + t}" x2="${x + t}" y2="${y2 - t}"/><text x="${x + 0.15}" y="${(y1 + y2) / 2}" font-size="0.5" text-anchor="start" stroke="none">${label}</text></g>`;
|
||||
}
|
||||
|
||||
/** A break mark (끊음): two short slanted strokes "//" centred on (x, y), so the member is shown as cut. */
|
||||
function breakMark(x: number, y: number, halfWidth: number): string {
|
||||
const d = 0.12;
|
||||
@@ -29,7 +41,7 @@ function svgOf(x0: number, y0: number, w: number, h: number, label: string, body
|
||||
export function footingPlanSvg(model: PierModel): string {
|
||||
const f = model.footings[0];
|
||||
if (!f) return '';
|
||||
const pad = 0.8;
|
||||
const pad = 1.5;
|
||||
const x0 = f.s - f.length / 2 - pad;
|
||||
const y0 = -f.width / 2 - pad;
|
||||
const w = f.length + 2 * pad;
|
||||
@@ -56,7 +68,7 @@ export function footingSideSvg(model: PierModel): string {
|
||||
const piles = model.piles.filter((p) => Math.abs(p.s - f.s) <= f.length / 2 + 1e-6);
|
||||
const pileTop = piles.length ? Math.max(...piles.map((p) => p.top)) : f.bottom;
|
||||
const pileLen = piles.length ? piles[0].top - piles[0].bottom : 0;
|
||||
const pad = 0.8;
|
||||
const pad = 1.5;
|
||||
const x0 = f.s - f.length / 2 - pad;
|
||||
const w = f.length + 2 * pad;
|
||||
// Visible band in EL: from the column stub above the footing top, down to the pile stub below the footing bottom.
|
||||
@@ -81,10 +93,15 @@ export function footingSideSvg(model: PierModel): string {
|
||||
// Break mark across the pile group, in the lower stub (the pile label sits below it).
|
||||
parts.push(breakMark(f.s, -(botEl + 0.6), f.length / 2));
|
||||
}
|
||||
parts.push(`<text x="${f.s + f.length / 2 + 0.35}" y="${-(f.top + f.bottom) / 2}" font-size="0.5" text-anchor="start">h1 ${mm(f.top - f.bottom)}</text>`);
|
||||
if (piles.length) {
|
||||
parts.push(`<text x="${f.s}" y="${-(botEl + 1.3)}" font-size="0.5" text-anchor="middle">말뚝 ${mm(pileLen)} (끊음)</text>`);
|
||||
}
|
||||
// Dimension lines (치수선): footing length above, footing height at the right, the visible pile length at the left.
|
||||
parts.push(dimH(f.s - f.length / 2, f.s + f.length / 2, -(f.top + 0.8), `${mm(f.length)}`));
|
||||
parts.push(dimV(f.s + f.length / 2 + 0.5, -f.top, -f.bottom, `h1 ${mm(f.top - f.bottom)}`));
|
||||
if (piles.length) {
|
||||
parts.push(dimV(f.s - f.length / 2 - 0.5, -f.bottom, -(botEl + 0.6), `${mm(pileLen)} (끊음)`));
|
||||
}
|
||||
void pileTop;
|
||||
return svgOf(x0, y0, w, h, '확대기초·말뚝 측면', parts.join(''));
|
||||
}
|
||||
Reference in new issue
Block a user