feat(viewer2d): 2.5D view, viewport fill transform and Z-aware fit box

- 2.5D view: a toolbar toggle (plus an options-panel checkbox) re-aims the
  orthographic camera at an SE-isometric angle and unlocks orbit, so the
  CAD elevation already in the vertex buffers (contours, TIN, 3D
  polylines) becomes visible. Nothing is re-tessellated; switching back
  restores the locked top view. A Z exaggeration slider (persisted in the
  options store) makes kilometre-wide sheets with metres of relief
  legible; picking and the X/Y readout intersect the Z=0 plane.
- Viewport fills: SOLID/HATCH fills and dimension arrowheads drawn
  through a paper-space VIEWPORT now get the model-to-paper transform
  (_fillXf / _bakeFillXf), as lines already did via pushSeg.
- The trimmed content box keeps the drawing's real Z range instead of
  collapsing to z=0, so the 2.5D fit and clip slab cover the relief.
- src/topProgress.ts: driver for the existing #progress loading bar. It
  is not imported from main.ts yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
minsungandClaude Opus 5.5 committed 2026-10-19 19:48:19 +09:00
1 parent e51114dbfd
commit aa27945d61
5 files changed
+477 -4

No files matched your search

+24
View File
@@ -65,6 +65,9 @@
button:hover, label.btn:hover { border-color: var(--accent); }
button.primary { background: #238636; border-color: #2ea043; }
button.wasm { border-color: var(--wasm); color: var(--wasm); }
/* 켜져 있는 토글 버튼 (2.5D 보기 등) */
#toolbar > button.on { background: #1f6feb; border-color: #58a6ff; color: #fff; }
.opt-row.disabled { opacity: .45; pointer-events: none; }
label.btn input { display: none; }
/* 옵션 패널 — 값은 IndexedDB(hmw-viewer/options)에 저장된다 */
#optBody { padding: 12px 14px; overflow: auto; font-size: 12px; color: var(--ink); }
@@ -232,6 +235,7 @@
<button id="sampleDxf" class="primary" type="button" title="dxf-parser">Sample DXF</button>
<div id="spaces" title="Model Space / Paper Space (Layout)"></div>
<button id="fit" type="button">Fit (F)</button>
<button id="view25Btn" type="button" title="2.5D 보기 — Top 뷰를 풀고 기울여서 등고선 등의 높낮이(Z)를 본다. 왼쪽 드래그=회전, 가운데/오른쪽 드래그=이동">2.5D 보기</button>
<button id="theme" type="button">Theme</button>
<button id="optionsBtn" type="button" title="표시 옵션 (선가중치 · 그리드 · 줌)">옵션</button>
<button id="layersBtn" type="button">Layers</button>
@@ -311,6 +315,26 @@
<input id="optZoomSpeedNum" type="number" min="0.1" max="5" step="0.1" value="1" />
</div>
</div>
<div class="opt-sec">
<h4>2.5D 보기</h4>
<div class="opt-row">
<label for="opt25D">기울여 보기 (Top 해제)</label>
<input id="opt25D" type="checkbox" />
</div>
<div id="optZRow" class="opt-row disabled">
<label for="optZScale">높이 과장 (Z)</label>
<input id="optZScale" type="range" min="1" max="50" step="0.5" value="1" />
<input id="optZScaleNum" type="number" min="1" max="200" step="0.5" value="1" />
<span class="opt-unit">×</span>
</div>
<p class="opt-help">
도면은 이미 CAD 표고(Z)를 그대로 갖고 있다. 2.5D 는 같은 직교 카메라를
남동 등각(SE Isometric)으로 돌려 그 높낮이를 보여준다 — 재파싱 없음.
부지가 넓고 기복이 작아 평평하게 보이면 Z 과장을 올린다.
<b>왼쪽 드래그 = 회전, 가운데·오른쪽 드래그 = 이동.</b>
</p>
</div>
</div>
</div>