Repository navigation
feat(dxf): write the LAYOUT, GROUP and MLINESTYLE objects, paired with AutoCAD's export (#126) - #373
Conversation
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 662b6a5fbf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…up the block records once (#126)
# Conflicts: # .github/workflows/ci.yml # src/lib.rs
…ECORD string in a code page not decoded, compare the 330 groups of objects (#126)
# Conflicts: # ARCHITECTURE.md
…bjects # Conflicts: # Cargo.toml
…output defines them, and take the kinds by the drawing's release (#126)
…index each table's order once (#126)
…s and the 330 relation (#126)
# Conflicts: # .github/workflows/ci.yml # ARCHITECTURE.md # src/dxf_convert.rs
…RECORD's group 102 strings (#126)
# Conflicts: # src/dxf_objects.rs
# Conflicts: # ARCHITECTURE.md
…layouts # Conflicts: # ARCHITECTURE.md
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eea320af1e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Main's OBJECTS section text (7aw) and code stand word for word; the LAYOUT, GROUP and MLINESTYLE section is renumbered 7ax and the three files it changes sit on main's version of the OBJECTS writer and probe.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d00a65bae3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… that a layout name leaves ASCII (§3.2.5, #375, #126) The bytes-API check required convert_dwg_to_dxf_bytes to write exactly the bytes convert_dwg_to_dxf writes, which held only while no text of the corpus left ASCII. The ACAD_LAYOUT dictionary of the GBK drawings now writes its layout name as a key: the String writer spells it as the escape of each character, the page writer as the page's bytes (B2 BC BE D6 31), which are the bytes AutoCAD's own export holds. The check is now that the bytes read back under the drawing's page to the String writer's text once every character above ASCII is spelled as its escape again, and that at least one conversion writes page bytes, so it still fails if the page writer stops encoding.
# Conflicts: # ARCHITECTURE.md
…ts and plot settings already are (§20.4.84, #126) layout_groups checked the plot settings, the limits and the elevation for a NaN or an infinity but not the insertion point, the extents and the UCS origin and axes, which BitCursor::read_bd also returns as read; the record was written with NaN or inf, which the DXF reader rejects. The check is now layout_is_finite over all of them, and a synthetic check in probe_dxf_objects refuses all 63 cases (a NaN, an infinity and a negative infinity in each of the 18 coordinates of the six points and in one real of each other kind).
# Conflicts: # ARCHITECTURE.md
… and the double-byte round trip (#414) landed
#373 landed, so main holds the LAYOUT, GROUP and MLINESTYLE section as 7az and the OBJECTS and LAYOUT code with its later fixes; the VISUALSTYLE section follows as 7ba and the three files it changes sit on main's version of them.
…10-27 (#416) * docs: bring README, ROADMAP and CHANGELOG up to the landings of 2026-10-27 README's code-page and DXF writer text named work in review that has landed (#371, #380, #382, #384); jev_review.py prose ranked those sentences 0.72 to 0.96. ROADMAP's "where it stands" table was a 2026-10-21 snapshot whose numbers, CI row and release row were all out of date; it now points to the rendered numbers instead of repeating them. CHANGELOG gains #371, #380, #382, #384, #385 and #404. * docs(changelog): record the CI-only merge train (#408) * docs: OBJECTS landed (#372): README, ROADMAP and CHANGELOG * docs: LAYOUT, GROUP and MLINESTYLE (#373), the class map writer (#405) and the double-byte round trip (#414) landed * docs: VISUALSTYLE landed (#413) * docs(readme): name the skipped types still in review without per-type counts; MATERIAL landed (#325) * docs(readme): point to the open decoder PRs instead of a list that each landing makes stale
Summary
Stacked on #372 (OBJECTS) and #371 (BLOCKS): this branch contains their commits, so until they land the diff shows all three; this change is the last commit,
662b6a5.dxf_objectswrites three more kinds of the OBJECTS section: LAYOUT (its plot settings, then the layout proper and its handles), GROUP (description, flags and one340per member) and MLINESTYLE (name, flags, description, fill colour, angles and the per-line offset, colour and linetype), each from the decoder that already closed on the corpus, withprobe_dxf_objectspairing each with AutoCAD's own export. Follow-on to #372 (#126). With the layouts written, a BLOCK_RECORD's340and theACAD_LAYOUTdictionary's entries are written too.Spec reference
ODA v5.4.1 §20.4.84 LAYOUT (the plot settings it opens with, then its own fields, then the handles: from R2004 the plot view, from R2007 the visual style, the paperspace block record, the last active viewport, the base and named UCS), §20.4.72 GROUP, §20.4.73 MLINESTYLE.
src/dxf_objects.rs:layout_groups,mline_style_groups, the GROUP arm, andkinds(an MLINESTYLE of R2018 names its linetypes by handle, which is not resolved yet, so it is not written for that target).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-features: 921 passed, 0 failed on feat(dxf): write the OBJECTS section, paired with AutoCAD's export (#126) #372's head; the full run on this head is in progress and CI runs it (this PR adds no unit test).cargo run --release --features dxf-reader --example probe_dxf_objects -- <dwg-corpus>(42 drawings R2000 to R2018): exit 0, 0 disagree, 0 extra, in AutoCAD's order.The 126 groups a LAYOUT omits are extended data (the
ACAD_PSEXTapplication data, 1000 to 1070, 108), not decoded, and 18 last active viewport handles (331) that name a VIEWPORT, which is not written yet:layout_groupswrites 331, 345 and 346 only when the output defines the record, and the probe counts each omission with that reason. The probe also compares every 330 after the owner now, so a LAYOUT's block record is checked. The two MLINESTYLEs not written are the R2018 records. Five LAYOUTs carry an extension-dictionary bracket the export lacks; each names a dictionary the export leaves out (the same rule that applies to the tables), and the probe checks that before it accepts the omission. The export's group order puts70after143in the plot settings and the shade plot triple after147; both are followed. The other probes on this head still exit 0: tables (1,239 records, 8,893 groups, 0 disagree, 0 extra; the 340 of BLOCK_RECORD is written now), entities, BLOCKS, header, header variables, entity colour.python3 tools/maintainer/train/arch.py checkandpython3 tools/ci/spec_coverage.py --check: 0 problems.345,346), a plot view handle on R2004 and later (its name is6), a visual style handle (333), an MLINESTYLE whose linetype is neither sentinel (32767,32766), and R2018 MLINESTYLE.Existing tests and code changed
None.
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.