DWG and DXF Drawings Now Get a Browser-Native Diff Tool
CAD drawing review has lagged decades behind code review in tooling. A client-side diff component that runs without AutoCAD or server uploads removes the two biggest blockers — license cost and data egress — for embedding drawing comparison into CI, issue trackers, and SaaS platforms.
CAD teams still compare revisions by toggling between two AutoCAD windows or squinting at exported PDFs. A new MIT-licensed component, `@mlightcad/cad-diff-viewer`, brings a code-review-like diff experience to DWG and DXF files, running fully client-side. It parses drawings via LibreDWG compiled to WebAssembly, renders them on two WebGL canvases, and colors entities as unchanged, deleted, added, or modified.
The diff algorithm fingerprints each entity by DXF type and quantized geometry, then matches by handle and type — a model inspired by AutoCAD's COMPARE command. Nearby changes cluster into revision cloud annotations, and a results panel lets reviewers step through hits grouped by change type. Overlay mode stacks the new drawing on top of the old one, making displacements immediately visible.
Because parsing happens in a Web Worker and files never leave the browser tab, the tool fits privacy-sensitive workflows and SaaS embeds where uploading drawings to a server is a non-starter. The component ships with i18n support for English, Chinese, Turkish, and Czech, and exposes a headless `acapCompareDrawings` API for teams that want to build their own UI on top of the diff engine.
The decision to compare stored entity values rather than resolved ByLayer/ByBlock appearance is a deliberate trade-off: it avoids false positives when a layer color changes, but it also means some visually obvious differences won't be flagged.
Fingerprinting via quantized geometry plus DXF type is a pragmatic middle ground between exact-match hashing (too brittle with floating-point coordinates) and full geometric comparison (too expensive for a browser thread).
Running the diff engine headless opens a path for automated CAD change detection in CI pipelines — something that barely exists today outside of desktop AutoCAD.
Overlay mode folding modifications into red and green, with no separate 'modified' color, is a genuine UX limitation that integrators should account for when designing review workflows.