fix(rebar): 정면 dimension labels larger and the lines spaced clear of the 코핑 길이 text
- The two chains are raised and their labels enlarged (220 mm). - 코핑 길이 sits above both chains; 기둥 중심 has its own line between them. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a18a15db7b
commit
a4ae6de485
2 files changed
+10
-10
No files matched your search
@@ -96,9 +96,9 @@ export function copingFrontSvg(records: BarRecord[], lengthMm: number, columnSm
|
||||
// First chain (the top line): the 전단·띠 positions of C9 (@250) and C10 (@300) along the coping, ends to the bar extents.
|
||||
const loops = bars.filter((r) => /^C(9|10|11)$/.test(r.name));
|
||||
const topChain = chainDims(positionsOf(loops), 0, lengthMm);
|
||||
const dimY = minY - 1100;
|
||||
const dimY = minY - 1500;
|
||||
for (const d of topChain) {
|
||||
parts.push(`<line x1="${d.from}" y1="${dimY}" x2="${d.to}" y2="${dimY}" stroke="#18212B" stroke-width="10"></line><text x="${(d.from + d.to) / 2}" y="${dimY - 80}" text-anchor="middle" font-size="150" fill="#18212B">${d.text}</text>`);
|
||||
parts.push(`<line x1="${d.from}" y1="${dimY}" x2="${d.to}" y2="${dimY}" stroke="#18212B" stroke-width="10"></line><text x="${(d.from + d.to) / 2}" y="${dimY - 110}" text-anchor="middle" font-size="220" fill="#18212B">${d.text}</text>`);
|
||||
}
|
||||
// Second chain (the lower line): the upper C14 bars, measured from the column centre (0).
|
||||
const c14 = bars.filter((r) => r.name === 'C14');
|
||||
@@ -106,12 +106,12 @@ export function copingFrontSvg(records: BarRecord[], lengthMm: number, columnSm
|
||||
const c14Upper = c14.filter((r) => r.pts.every((p) => p[1] >= c14Top - 0.3));
|
||||
const col = columnSm * 1000;
|
||||
const lowerChain = chainDims(positionsOf(c14Upper).map((v) => v - col), minX - col, maxX - col);
|
||||
const dimY2 = dimY - 600;
|
||||
const dimY2 = dimY - 900;
|
||||
for (const d of lowerChain) {
|
||||
parts.push(`<line x1="${d.from}" y1="${dimY2}" x2="${d.to}" y2="${dimY2}" stroke="#18212B" stroke-width="10"></line><text x="${(d.from + d.to) / 2}" y="${dimY2 - 80}" text-anchor="middle" font-size="150" fill="#18212B">${d.text}</text>`);
|
||||
parts.push(`<line x1="${d.from}" y1="${dimY2}" x2="${d.to}" y2="${dimY2}" stroke="#18212B" stroke-width="10"></line><text x="${(d.from + d.to) / 2}" y="${dimY2 - 110}" text-anchor="middle" font-size="220" fill="#18212B">${d.text}</text>`);
|
||||
}
|
||||
parts.push(`<line x1="0" y1="${dimY2 - 260}" x2="0" y2="${dimY2 + 120}" stroke="#B4531F" stroke-width="10"></line><text x="0" y="${dimY2 + 260}" text-anchor="middle" font-size="150" fill="#B4531F">기둥 중심</text>`);
|
||||
parts.push(`<text x="${midX}" y="${minY - 1500}" text-anchor="middle" font-size="200" fill="#18212B">코핑 길이 ${lengthMm}</text>`);
|
||||
parts.push(`<line x1="0" y1="${dimY2 - 200}" x2="0" y2="${dimY2 + 200}" stroke="#B4531F" stroke-width="12"></line><text x="60" y="${dimY2 + 320}" font-size="200" fill="#B4531F">기둥 중심 (0)</text>`);
|
||||
parts.push(`<text x="${midX}" y="${minY - 3000}" text-anchor="middle" font-size="260" fill="#18212B">코핑 길이 ${lengthMm}</text>`);
|
||||
|
||||
// Bubbles: one per bar group, a leader from the bubble to the middle of the group's bars.
|
||||
const at = (where: string): [number, number] => {
|
||||
@@ -158,9 +158,9 @@ export function copingFrontSvg(records: BarRecord[], lengthMm: number, columnSm
|
||||
}
|
||||
|
||||
const vx = minX - 1500;
|
||||
const vy = minY - 1900;
|
||||
const vy = minY - 3400;
|
||||
const vw = maxX - minX + 3000;
|
||||
const vh = legendY - minY + 1900 + 400;
|
||||
const vh = legendY - vy + 400;
|
||||
return `<svg viewBox="${vx} ${vy} ${vw} ${vh}" width="100%" style="max-width: 760px; height: auto" role="img" aria-label="코핑 배근 정면 · 번호 풍선 · 길이 치수">${parts.join('')}</svg>`;
|
||||
}
|
||||
|
||||
|
||||
@@ -69,8 +69,8 @@ describe('정면 두 번째 치수선과 범례 (승인 2026-10-26, 시안)', ()
|
||||
describe('정면 치수는 3D 철근 위치에서 계산 (승인 2026-10-26)', () => {
|
||||
it('the chains come from the bar positions and match the 시안 values', () => {
|
||||
const svg = copingFrontSvg(scene.records, model.copingL * 1000, model.columns[0].s);
|
||||
const texts = [...svg.matchAll(/font-size="150"[^>]*>([^<]*)</g)].map((x) => x[1]);
|
||||
expect(texts).toEqual(['300', '18@250=4500', '8@300=2400', '18@250=4500', '300', '900', '10@1000=10000', '900', '기둥 중심']);
|
||||
const texts = [...svg.matchAll(/font-size="220"[^>]*>([^<]*)</g)].map((x) => x[1]);
|
||||
expect(texts).toEqual(['300', '18@250=4500', '8@300=2400', '18@250=4500', '300', '900', '10@1000=10000', '900']);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user