fix(viewer2d): show lineweight at AutoCAD's display scale (20 px/mm)

Hand test against an AutoCAD capture: the 0.50mm road edge is ~10px
there but only ~4px here. Lineweight is zoom-independent screen pixels,
so the two captures compare directly - the 8 px/mm mapping was 2.5x too
small. AutoCAD's default display scale is one pixel per 0.05mm, so use
20 px/mm (0.35mm = 7px, 0.50mm = 10px, 2.11mm = 42px) and raise the
clamp to 48px.

Add setLineweightScale()/getLineweightScale() so a host can retune it -
AutoCAD exposes the same thing as the Adjust Display Scale slider.

Re-measured headless: the 0.35mm road-gutter line now renders ~7px, so
both weight classes land on the same scale.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
minsung
2026-08-04 20:34:27 +09:00
co-authored by Claude Opus 5
parent ce3859c487
commit cf1298749b
5 changed files with 6051 additions and 11 deletions
+1 -1
View File
@@ -198,7 +198,7 @@
}
.layer-sub-btn:hover { color: var(--ink); border-color: var(--accent); background: rgba(63,185,80,.1); }
</style>
<script type="module" crossorigin src="/assets/index-D3FqDGwP.js"></script>
<script type="module" crossorigin src="/assets/index-BsOJ4upQ.js"></script>
</head>
<body>
<div id="app"></div>