Repository navigation
fix(objects): LAYOUT has no data-store block; those 16 bits are plot_layout_flags - #236
Merged
Merged
Conversation
…layout_flags On the R2013 and R2018 LAYOUT records that set the common object data's has AcDs binary data bit, objects::acad_layout read 16 bits after it as a data-store block and then plot_layout_flags as a 2-bit BS of 0. Both that reading and reading nothing close on the boundary: a BS whose value needs 16 bits is the code 00 and an RS, the same 18 bits. AutoCAD's DXF export of the same drawings settles it. Group 70 of the plot settings is 688 (0x02B0) on every paper layout and 11952 (0x2EB0) on Model, which is what the full-form BS decodes to; the old reading gave 0 on all nine records the DXF value oracle pairs. The bytes match bit for bit: 00 + B0 02 is 0x2C, 0x00 and a 10 code; 00 + B0 2E is 0x2C, 0x0B, 10. The flag is followed by no bits on objects, as on the ACIS entities that set it. AcadLayout::ds_block and ObjectStream::has_ds_binary_data are removed; the module docs, ARCHITECTURE.md (dated section with the evidence table) and STATUS.md say what changed. Coverage is unchanged. Refs #99
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
3 tasks done
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.
Summary
LAYOUT has no "R2013+ data-store block": the 16 bits
objects::acad_layoutread after the common object data'shas AcDs binary databit are the first 16 ofplot_layout_flagsin its fullBSform. Reading nothing there gives the plot-layout flags AutoCAD exports, on all nine records the DXF value oracle pairs.Spec reference
§20.4.84 LAYOUT (plot-settings block:
BS plot layout flags 70first) and §2.2BS(code00+RS); §20.1 common object data (B has_ds_binary_data, R2013+).Both readings close on the data-stream boundary, because a
BSof 256 or more is00+ 16 bits = 18 bits, exactly the old 16-bit "block" plus a10(value 0)BS. The boundary cannot separate them; AutoCAD's DXF export of the same drawing can:BSplot_layout_flagsModel, handle 22 (sample_AC1032,sample_AC1027,geoloc)0x2EB000B0 2ERC 0x2C,RC 0x0B,BS 100x02B000B0 02RC 0x2C,RC 0x00,BS 10The
0x2C/0x0B/0x00bytes the module docs recorded as the block are exactly these bits. The flag is followed by no bits on objects, as on the three ACIS entities that set it (#61).AcadLayout::ds_blockand the crate-internalObjectStream::has_ds_binary_dataare removed; module docs, a dated ARCHITECTURE.md section with the table above, and STATUS.md say what changed.Test plan
cargo fmt --all -- --check,cargo clippy --all-targets --all-features -- -D warnings,RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-featurescargo test --release --all-featureswith the 19-file../../samplescorpus present: all pass, no test addedcargo run --release --example coverage_report -- <dir>givesTOTAL 3911 525 9 88.0on the 19-file corpus and6438 885 308 84.4on the ACadSharp samples, before and afterexamples/dxf_oracle, the pairing/scorer example that follows feat(dxf): an ASCII DXF reader keyed by handle, for the value oracle #223) over nextgisff05d5a8and ACadSharpsamples/c30a97ce(the pinned set of ci(corpus): measure the reader on public drawings fetched by pinned hash #225):Before (
main), the LAYOUT table's row:After (this branch):
plot_layout_flags 70 = = = = 82/0/0/0, and every other LAYOUT field stays=on every release (82 records). R2000 and R2007 LAYOUTs are not decoded (custom class, unchanged).Source-provenance declaration
By submitting this PR I certify that my contribution does not incorporate executable code from any source whose license is incompatible with Apache-2.0. Specifically:
CLEANROOM.md).Based on ODA spec v5.4.1 §2.2, §20.1 and §20.4.84, and AutoCAD's own DXF exports in
nextgis/dwg_samplesand the ACadSharpsamples/directory, read as data. No permissively-licensed project's code or comments were read.Developer Certificate of Origin
By submitting this PR, I certify that the contribution complies with the Developer Certificate of Origin 1.1.
Refs #99