From abf8b84b6b822910b7336e35449385d3790ac371 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Thu, 8 Oct 2026 13:18:19 +0900 Subject: [PATCH] =?UTF-8?q?fix(B07):=20CAD=20=EB=AC=B4=EB=8A=AC=20?= =?UTF-8?q?=EC=B9=B8=20px=20=E2=86=92=20=EC=A2=85=EC=9D=B4=20mm=20?= =?UTF-8?q?=E2=80=94=20=ED=99=94=EB=A9=B4=EA=B3=BC=20=EA=B0=99=EC=9D=80=20?= =?UTF-8?q?=EC=B4=98=EC=B4=98=ED=95=A8(88-4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016PSXsvyDxjNmufteN5bqmt --- .../B07_DesignDetail_Cross_Overlay.ts | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/B07_DesignDetail/B07_DesignDetail_Cross_Overlay.ts b/B07_DesignDetail/B07_DesignDetail_Cross_Overlay.ts index 10fba7455..af12f03b6 100644 --- a/B07_DesignDetail/B07_DesignDetail_Cross_Overlay.ts +++ b/B07_DesignDetail/B07_DesignDetail_Cross_Overlay.ts @@ -325,6 +325,8 @@ export interface PatternTile { rings: Array<{ cx: number; cy: number; rx: number; ry: number }>; } +/** 무늬 칸은 화면 px 로 그린 것 — 도면(종이 mm)에선 같은 촘촘함이 되게 px → mm. */ +const PATTERN_MM_PER_PX = 25.4 / 96; /** 무늬 칸 수 상한 — 넘으면 무늬를 버리고 외곽선만(ponytail: 큰 다각형이면 칸 크기를 키울 것). */ const PATTERN_TILE_LIMIT = 20000; @@ -386,9 +388,10 @@ function patternTileOf(element: SVGElement, root: SVGElement): PatternTile | nul (node) => node.getAttribute("id") === id, ); if (!pattern) return null; + const k = PATTERN_MM_PER_PX; const tile: PatternTile = { - width: attr(pattern, "width"), - height: attr(pattern, "height"), + width: attr(pattern, "width") * k, + height: attr(pattern, "height") * k, paths: [], rings: [], }; @@ -400,19 +403,19 @@ function patternTileOf(element: SVGElement, root: SVGElement): PatternTile | nul const numbers = run.match(/-?[\d.]+/g)?.map(Number) ?? []; const points: XY[] = []; for (let index = 0; index + 1 < numbers.length; index += 2) { - points.push([numbers[index], numbers[index + 1]]); + points.push([numbers[index] * k, numbers[index + 1] * k]); } if (points.length > 1) tile.paths.push(points); } } else if (tag === "circle") { - const r = attr(child, "r"); - tile.rings.push({ cx: attr(child, "cx"), cy: attr(child, "cy"), rx: r, ry: r }); + const r = attr(child, "r") * k; + tile.rings.push({ cx: attr(child, "cx") * k, cy: attr(child, "cy") * k, rx: r, ry: r }); } else if (tag === "ellipse") { tile.rings.push({ - cx: attr(child, "cx"), - cy: attr(child, "cy"), - rx: attr(child, "rx"), - ry: attr(child, "ry"), + cx: attr(child, "cx") * k, + cy: attr(child, "cy") * k, + rx: attr(child, "rx") * k, + ry: attr(child, "ry") * k, }); } }