@ooopearls/cad-simple-viewer
v1.0.0
Published
Public fork of @mlightcad/cad-simple-viewer with enhanced large-DWG parsing and bundled LibreDWG Worker/WASM assets.
Maintainers
Readme
@oopearls/cad-simple-viewer
This package is a public fork of
@mlightcad/cad-simple-viewer.
It adds a locally built LibreDWG parser with improved handling for large R2007
DWG files and validates parser output before accepting a drawing.
Installation
npm install @ooopearls/cad-simple-viewerThe public API and peer dependency contract follow the upstream
@mlightcad/cad-simple-viewer package.
Worker And WASM Deployment
The npm package contains these browser assets in dist:
dxf-parser-worker.jslibredwg-parser-worker.jslibredwg-web.wasmmtext-renderer-worker.js
Copy them into a public directory in your application. The LibreDWG worker
loads libredwg-web.wasm relative to the worker script, so those two files
must remain in the same deployed directory.
const manager = AcApDocManager.createInstance({
webworkerFileUrls: {
dxfParser: '/cad-workers/dxf-parser-worker.js',
dwgParser: '/cad-workers/libredwg-parser-worker.js',
mtextRender: '/cad-workers/mtext-renderer-worker.js'
}
})Use AcApDocManager.checkWebworkerReadiness() or manager.areWorkersReady()
before opening a drawing when the assets may be served from a separate CDN or
deployment path.
Fork Changes
- Builds LibreDWG WebAssembly from pinned source commit
4d3fc98d7767c0881c5f24a801506819f2ab38eb. - Applies the R2007 value-bound and EED allocation patch included in the public source repository.
- Bundles the matching LibreDWG Worker and WASM files in the npm tarball.
- Rejects empty or unusable parser results instead of treating them as a successfully opened drawing.
Source And License
This distribution includes GPL-covered parser Worker/WASM artifacts. See
LICENSE, LICENSES/GPL-3.0-or-later.txt, THIRD_PARTY_NOTICES.md, and
SOURCE.md in the package for license terms and corresponding-source access.
The complete fork source is available at github.com/tangsh0708/cad-viewer.
