Repository navigation
feat(dxf): write the VIEW table, with its associated UCS (#126) - #357
Merged
Merged
Conversation
tables::view now surfaces the associated UCS block and the R2007 camera-plottable flag its decoders read and dropped. dwg-to-dxf writes the VIEW table (name, flags, the view as VPORT's, 72 and the UCS groups, 73 and the visual style from R2007) and an empty one when the drawing has no view, as AutoCAD does. The tables probe pairs all 6 views of the corpus with AutoCAD's export: 190 groups agree, none disagree, the one omission per R2007+ view (the visual style handle) has its stated reason.
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. |
4 of 6 tasks
DrunkOnJava
enabled auto-merge (squash)
October 27, 2026 02:15
This was referenced Oct 27, 2026
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
dwg-to-dxfnow writes the VIEW table from the decoded records, and the tables probe pairs it with AutoCAD's export like the others. Follow-on to #347 (#126), one PR per section; it builds on #284's group 71 for a view's mode.The decoder read a view's associated UCS and the R2007 camera-plottable flag and dropped them;
tables::viewnow keeps both (ViewEntry::ucs,ViewEntry::camera_plottable). A drawing with no view gets AutoCAD's empty VIEW table.Spec reference
ODA v5.4.1 §20.4.60 VIEW:
BD 40,BD 41,2RD 10,3BD 12,3BD 11,BD 50,BD 42,BD 43,BD 44, the 4-bit view mode (71), R2000+RC 281, the paper-spaceB(70 bit 1), R2000+ the associated-UCSB(72) with its origin, axes, elevation and orthographic type (110 to 112, 146, 79), R2007+B 73, and the handle list (R2007+: background, visual style 348, sun, then the named and base UCS). Group codes and order are AutoCAD's: the corpus holds one view per release (view_custom), six in all.src/dxf_tables.rs:view_groups. A record from R13 or R14, which store neither a render mode nor an associated UCS, gets no 281 or 72 (the source release gates it, the target release gates 73 and 348).src/tables/view.rs: the two kept fields.Test plan
cargo fmt --all -- --check,cargo clippy --all-targets --all-features -- -D warnings,RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-featurescargo run --release --features dxf-reader --example probe_dxf_tables -- <dwg-corpus>(wired into the Corpus job) now pairs all 6 views with AutoCAD's export, group for group and in AutoCAD's order:The one omission per R2007+ view is group 348, the visual style, which OBJECTS still writes as an untyped record (the probe states that reason, as for VPORT and LAYER). The whole tables probe: exit 0, 0 disagree, 0 extra.
cargo test --release --all-featuresruns in CI; I did not run it locally on this head (every cargo job on this Mac is waiting on a governor lease).Existing tests and code changed
None of the existing tests changed.
ViewEntrygains two fields (nothing in the crate builds one but the two decoders).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:
The only other inputs are the public corpus and AutoCAD's own DXF exports of its drawings. No algorithm-description comments in other projects were read.
Developer Certificate of Origin
I affirm the contribution is my own work and may be distributed under the project's Apache-2.0 license.