Repository navigation
DWG 2013 and 2018: solids and regions keep their geometry (data store section) - #19
Merged
Merged
Conversation
… section) From AutoCAD 2013 a 3DSOLID, REGION or BODY keeps its modeler description in the file's data store section (AcDb:AcDsPrototype_1b), not in the entity. DraftCraft now reads and writes that section, so these entities survive a DWG 2013/2018 save and open. - crates/dwg/src/datastore.rs: the section read to records (checked reader, capped counts and sizes, blob pages followed) and written as AutoCAD lays out a new store: segment index, data index, data segments, blob pages for records over 0x40000 bytes, schema index and data, search index. AutoCAD's empty sections come out byte for byte. - The writer puts the section after AcDb:XrefManifest when the drawing has solids, and writes the 2013+ modeler entity as AutoCAD does (wireframe block, group 290, GUID, history), with the "data store" bit of its common entity data set: without that bit AutoCAD reports "ASM body missing" for every solid. - The reader decodes the 2013+ entity and turns the section's records into the DXF's ACDSDATA groups, so a DWG read keeps what the DXF of the same drawing keeps. Checked in AutoCAD 2027: solids-2018 (four bodies, one of 2.9 MB in blob pages, with and without solid history) written as DWG 2013 and 2018 opens with every body drawn, AUDIT 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
From AutoCAD 2013, 3DSOLID, REGION and BODY keep their modeler description in the DWG's data store section (
AcDb:AcDsPrototype_1b). DraftCraft's DWG writer didn't write it, so these entities were left out of 2013/2018 saves, and the reader didn't read it. Now both do.crates/dwg/src/datastore.rs(new): the section read to records and written as AutoCAD lays out a new store (segment index, data index, data segments,blob01pages for records over 0x40000 bytes, schema index and data, search index). The reader is checked and capped against hostile bytes. AutoCAD's empty sections are written back byte for byte.AcDb:XrefManifestwhen the drawing has solids. The 2013+ modeler entity is written as AutoCAD writes it (wireframe block, group 290, GUID, history), with the "data store" bit of its common entity data set. Without that bit AutoCAD reports "ASM body missing" for every solid, even though the section holds them.Checked
datastoreunit tests: round trip, AutoCAD's layout, blob pages, several data segments, hostile bytes.acis_data_store::dwg_keeps_the_solids_geometry(no longer ignored).acis_data_store::dwg_solids_point_at_their_data_store_records(the bit).cargo test -p draftcraft-dwg -p draftcraft-io, clippy-D warnings,cargo xtask wasm.Not in this PR
ASM BinaryFile4(version 22300), and its DXF and 2013 files asACIS BinaryFile(21800). AutoCAD reads the DXF form in a 2018 file, so the writer keeps the form the drawing has.🤖 Generated with Claude Code