feat(bearing): show each bearing's 방위 in the plan and turn the overlays with it
- Blocks, solplates, and the dashed drawing outlines are turned by the bearing's 방위 (rowSkewDeg), the same turn as the 3D block; each bearing is labelled with its 방위 in degrees. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9b3b465bfa
commit
c4d4957dd2
1 file changed
+13
-5
@@ -16,6 +16,14 @@ export const PAIR_CHIP_LABELS = ['①', '②', '③', '④', '⑤', '⑥', '⑦'
|
||||
* dashed. 일체 draws one 2500 × 1200 outline; 분리 draws two 1200 × 1200 outlines. Dimensions: C1 (bearing to block edge),
|
||||
* C2 (between the bearings), C3 (block span). C4 and C5 are the outer margins along the 교축.
|
||||
*/
|
||||
/**
|
||||
* A rectangle centred on (cx, cy), turned by the bearing's 방위 (승인 2026-10-26). The angle is −rowSkewDeg, the same
|
||||
* turn as the 3D block (rotateY(−skew)): the block's sides follow the bearing row.
|
||||
*/
|
||||
function rect(cx: number, cy: number, w: number, h: number, skewDeg: number, attrs: string): string {
|
||||
return `<rect x="${cx - w / 2}" y="${cy - h / 2}" width="${w}" height="${h}" transform="rotate(${-skewDeg} ${cx} ${cy})" ${attrs}></rect>`;
|
||||
}
|
||||
|
||||
export function bearingPlanSvg(m: PierModel, pairIndex: number, overlay?: BearingPlanOverlay): string {
|
||||
const pair = pairEccentricities(m.blocks)[pairIndex];
|
||||
if (!pair) return '';
|
||||
@@ -40,10 +48,10 @@ export function bearingPlanSvg(m: PierModel, pairIndex: number, overlay?: Bearin
|
||||
// Block outline(s): one row.
|
||||
const ib = m.integratedBlocks.find((x) => x.frontNo === pair.frontNo);
|
||||
if (ib) {
|
||||
parts.push(`<rect x="${X(ib.n - 1.25)}" y="${Y(ib.s) - 600}" width="2500" height="1200" fill="none" stroke="#6E8496" stroke-width="12"></rect>`);
|
||||
parts.push(rect(X(ib.n), Y(ib.s), 2500, 1200, ib.rowSkewDeg, `fill="none" stroke="#6E8496" stroke-width="12"`));
|
||||
} else {
|
||||
for (const b of [f, k]) {
|
||||
parts.push(`<rect x="${X(b.n) - 600}" y="${Y(b.s) - 600}" width="1200" height="1200" fill="none" stroke="#6E8496" stroke-width="12"></rect>`);
|
||||
parts.push(rect(X(b.n), Y(b.s), 1200, 1200, b.rowSkewDeg, `fill="none" stroke="#6E8496" stroke-width="12"`));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,20 +59,20 @@ export function bearingPlanSvg(m: PierModel, pairIndex: number, overlay?: Bearin
|
||||
for (const b of [f, k]) {
|
||||
if (b.plan) {
|
||||
const { A, B } = b.plan;
|
||||
parts.push(`<rect x="${X(b.n) - A / 2}" y="${Y(b.s) - B / 2}" width="${A}" height="${B}" fill="#EEF3F7" stroke="#2F6DB5" stroke-width="10"></rect>`);
|
||||
parts.push(rect(X(b.n), Y(b.s), A, B, b.rowSkewDeg, `fill="#EEF3F7" stroke="#2F6DB5" stroke-width="10"`));
|
||||
}
|
||||
}
|
||||
// Drawing values overlaid (dashed) on the same bearings (#1 겹쳐 보이게).
|
||||
if (overlay) {
|
||||
for (const [b, v] of [[f, overlay.front], [k, overlay.back]] as const) {
|
||||
parts.push(`<rect x="${X(b.n) - v.A / 2}" y="${Y(b.s) - v.B / 2}" width="${v.A}" height="${v.B}" fill="none" stroke="#B4531F" stroke-width="10" stroke-dasharray="40 25"></rect>`);
|
||||
parts.push(rect(X(b.n), Y(b.s), v.A, v.B, b.rowSkewDeg, `fill="none" stroke="#B4531F" stroke-width="10" stroke-dasharray="40 25"`));
|
||||
}
|
||||
}
|
||||
|
||||
// Bearing centres and numbers.
|
||||
for (const b of [f, k]) {
|
||||
parts.push(`<circle cx="${X(b.n)}" cy="${Y(b.s)}" r="40" fill="#18212B"></circle>`);
|
||||
parts.push(`<text x="${X(b.n) + 70}" y="${Y(b.s) - 60}" font-size="90" fill="#18212B">${b.no}</text>`);
|
||||
parts.push(`<text x="${X(b.n) + 70}" y="${Y(b.s) - 60}" font-size="90" fill="#18212B">${b.no} · 방위 ${b.rowSkewDeg.toFixed(2)}°</text>`);
|
||||
}
|
||||
if (eccentricity > 0.5) {
|
||||
parts.push(`<text x="0" y="${-700}" text-anchor="middle" font-size="80" fill="#55606E">편심 ${eccentricity.toFixed(0)} mm (교각축 방향, 위치 그대로)</text>`);
|
||||
|
||||
Reference in new issue
Block a user