Skip to content

Releases

CAD Viewer 0.8.4

Choose a tag to compare

@wybaby168 wybaby168 released this 18 Nov 16:00

CAD Viewer 0.8.4 preserves authored MTEXT box width and line spacing, handles CAD text escapes, and renders supported embedded HATCH line and dot patterns. It includes DXF text-decoding and layer-table fixes and requires DWF Viewer 0.6.8 for complete loading of the drawing reported in #2.

v0.8.3

Choose a tag to compare

@wybaby168 wybaby168 released this 10 Oct 13:02
6366d2f

Fix CAD declarations for strict NodeNext and Bundler consumers by using explicit ESM import paths. A separate browser entry retains the stylesheet while the public declaration entry remains compatible with TypeScript consumers.

Validation passed: both pull request and main-branch CI checks, 44 regression tests, 10 publishing guard tests, WASM checks, and normal npm pack validation.

v0.8.2

Choose a tag to compare

@wybaby168 wybaby168 released this 08 Sep 14:51

Fix DXF LINE endpoints and native CAD capture. Require dwf-viewer 0.6.7 so installations receive the DWF/DWFx contrast fixes. All 42 CAD regressions pass; the published npm tarball was downloaded and verified byte-for-byte.

v0.8.1

Choose a tag to compare

@wybaby168 wybaby168 released this 05 Sep 08:43

Engine-level CAD source/monochrome render color policy. Preserves source geometry, alpha, line styles, fills, text, and ByBlock inheritance; forwards native DWF/DWFx/XPS rendering to dwf-viewer 0.6.6.

v0.8.0 - CAD BOM extraction

Choose a tag to compare

@wybaby168 wybaby168 released this 22 Jul 06:33

Highlights

  • Extract typed BOM data from DWG and DXF block attributes, MINSERT quantities, cached CAD tables, DataTable, optional XDATA/XRECORD sources, and high-confidence text grids.
  • Use CadViewer.getBom() or extractCadBom(), then export spreadsheet-safe CSV or JSON.
  • Inspect and export BOM tables directly from the demo.
  • Upgrade LibreDWG WebAssembly to 0.7.9 and keep valid drawings loading when complex linetypes contain a null STYLE reference.
  • Restore handleless R12 DXF attribute ownership and bound malformed table, metadata, and recursive-quantity workloads.

DWF, DWFx, and XPS preview remains supported, but those native render paths do not expose normalized BOM metadata yet.

npm install @flyfish-dev/cad-viewer@0.8.0

v0.7.0 - External SHX references

Choose a tag to compare

@wybaby168 wybaby168 released this 16 Jul 01:55

Highlights

  • Added complete external SHX reference handling for complex DWG linetypes, with missing/incompatible state reporting, browser-local parsing, required-glyph validation and cached shape/text outline rendering.
  • Added onReferenceStateChange, addReferenceFile(), addReferenceBuffer() and the reference lifecycle/query APIs. The demo now exposes a contextual SHX upload control.
  • Corrected block-contained geometry after PLAN/UCS transforms, including text and INSERT angles, closed and wide polylines, linetype scale inheritance, dash phase and SHX glyph placement.
  • Canvas2D and retained WebGL rebuild supplied reference geometry without resetting the current view.

Verification

  • GitHub CI passed on Node.js 22.
  • TypeScript checks, production library/demo builds and all 13 regression tests passed.
  • LibreDWG and DWF WASM assets were verified.
  • The 65-file npm package was inspected and production dependencies report 0 known vulnerabilities.
  • The supplied DWG was exercised in both WebGL and Canvas2D with missing-reference fallback and post-upload redraw.

Install

npm install @flyfish-dev/cad-viewer@0.7.0

Exact complex-linetype symbols require the original SHX file referenced by the drawing; unavailable or incompatible files retain the safe marker fallback.

v0.6.6 - Smarter DWG initial fit

Choose a tag to compare

@wybaby168 wybaby168 released this 15 Jul 06:55

Highlights

  • Fixed DWG files whose valid geometry is split across widely separated coordinate clusters. The default initial view now focuses on meaningful content inside a valid active VPORT instead of shrinking the main sheet into a dot.
  • Added fitMode: 'auto' | 'saved-view' | 'extents' and viewer.fit(mode) for automatic content fitting, exact saved-view restoration, or complete drawing extents.
  • Unified bounds and fit behavior across the retained WebGL renderer and Canvas2D fallback.

Verification

  • TypeScript typecheck and production library/demo builds passed.
  • All 9 DWG normalization and rendering regressions passed.
  • Runtime WASM assets and the 63-file npm package were verified.

Install

npm install @flyfish-dev/cad-viewer@0.6.6

v0.6.5 - DWG saved views and linetypes

Choose a tag to compare

@wybaby168 wybaby168 released this 15 Jul 06:19

Highlights

  • Preserves active DWG VPORT/header UCS saved views and applies safe planar scene transforms exactly once.
  • Adds LTYPE normalization and rendering for dashed, dotted, BYLAYER, and BYBLOCK patterns in Canvas2D and WebGL.
  • Preserves converter-specific closed-polyline flags and stable linetype scaling.
  • Adds getSourceDocument() plus public line-pattern and scene helpers.
  • Adds eight DWG normalization regression tests and a stricter prepublish gate.

Compatibility and safety

  • Invalid, non-finite, missing, or tilted VIEWDIR values retain WCS coordinates and emit a warning.
  • Complex SHX linetype glyphs use a marker approximation.
  • Microscopic or corrupt patterns fall back to visible source edges.

Verification

  • npm test
  • npm run build
  • npm run check:wasm
  • npm run pack:dry
  • Production browser smoke test and runtime asset checks

See CHANGELOG.md for the full change list.

v0.6.4 - Stable DWG worker asset

Choose a tag to compare

@wybaby168 wybaby168 released this 15 Jun 03:39

Highlights

  • Added the package export @flyfish-dev/cad-viewer/wasm/dwg-worker.js for copying runtime assets from npm packages.
  • Changed default DWG worker loading to the page-relative runtime asset wasm/dwg-worker.js, avoiding bundler-generated worker chunk assumptions.
  • Updated dev, demo, npm package and Cloudflare Pages build flows to build and copy the same DWG worker runtime asset.
  • Prevented stale public worker files from overwriting the freshly built package worker during library asset copying.

Verification

  • npm run build
  • npm run check:wasm
  • npm run pack:dry
  • Local Vite preview smoke test for /, /wasm/dwg-worker.js, /wasm/libredwg-web.js, /wasm/libredwg-web.wasm and /wasm/dwfv-render.wasm
  • Published npm package: @flyfish-dev/cad-viewer@0.6.4
  • Published Cloudflare Pages demo: https://cad-viewer-iys.pages.dev

v0.6.3 - DXF codepage decoding

Choose a tag to compare

@wybaby168 wybaby168 released this 15 Jun 01:44

Highlights

  • Added dxfEncoding to CadLoadOptions for explicit legacy DXF text decoding.
  • Made DXF loading codepage-aware: explicit encoding, BOM and $DWGCODEPAGE are honored before legacy fallback candidates.
  • Fixed Chinese DXF decoding cases that previously fell through to lossy ISO-8859-1-style text.
  • Normalized common CAD text escapes in DXF text entities: \U+XXXX, %%c, %%d, %%p and \P.

Published Artifacts

Verification

  • npm run typecheck
  • npm run build
  • Built-package DXF smoke test for ANSI_936 / GB18030 text plus CAD escapes
  • npm run check:wasm
  • npm run pack:dry
  • npm audit --omit=dev --audit-level=moderate reports 0 runtime vulnerabilities
  • npm registry verification for latest 0.6.3
  • Cloudflare Pages deployment verification

npm audit --audit-level=moderate still reports esbuild advisories through dev-only Vite/Wrangler tooling. The available automatic fix requires a breaking Vite major upgrade, so this patch release keeps the current toolchain and ships with clean runtime dependency audit results.