Roadmap 0.11, Fixes

FX.391 CadCraft: Save as "DXF 2000 (CBOR)", a drawing as one CBOR file that CadCraft opens again

  • Feature
  • Built · in the lab
  • CadCraft

Asked on Discord #a Discord member-chat (2026-11-14: "Could do CBOR instead of JSON"; "map binary DXF and DWG to CBOR"). Owner 2026-11-19: an option in Save as, not the standard way to save, and one we can read as well. Built in the lab: Save as lists a fifth format, DXF 2000 (CBOR), file name .cbor. The file holds the same groups as a DXF 2000 save as typed values (reals as floats, integers, true/false, text, binary chunks as bytes) in one CBOR map: format cadcraft-dxf-cbor, version 1, the DXF version, the groups. Open, Insert from file, History and a dropped file read .cbor; a drawing opened from CBOR saves as CBOR. Another CBOR file is refused in plain words. Why someone would use it: CBOR (RFC 8949) is read by a standard library in most programming languages, so a script can load a drawing without a DXF parser. No other CAD program opens it. New files cbor.js (our own reader and writer, from the RFC) and dxf-cbor.js; dxf-open.js stays the one door for reading. Checked: bin/test-dxf-cbor.mjs 161 of 161 (the RFC examples both ways, the three ezdxf drawings group for group, refusals, and Python cbor2 reading the file as the same typed groups); tools/cadcraft-test/browser-dxf-cbor.mjs 14 of 14 in /lab (save, decode, reopen, save again). Measured: about 10 percent smaller than binary DXF and 25 percent smaller than text (100,000 objects: 12.7 MB text, 10.4 MB binary, 9.3 MB CBOR). Limits: numbers carry the 15 digits the DXF writer writes; RECOVER does not read a cut-short CBOR file; sheet sets, WBLOCK and the assistant tools do not offer it; the help topic and the other languages are not written. Related: DC.129 (a compact native format, not decided) is a different question and stays open.

From: Discord community

Add a comment

Community comments

No comments yet

Add detail as we go: how you would use it, files or steps that show the problem, what other programs do. The team reads every comment.

Sign in or create a free account to add a comment.