Repository navigation
fix(tables): decode R14 DIMSTYLE with §20.4.68's R13/R14 block (#74) - #297
Merged
Merged
Conversation
The dispatcher reported every R14 DIMSTYLE as unhandled because the R13/R14 layout had never been measured. Read the block §20.4.68 prints (flags, RC settings, BS units, BD reals, five T strings, three BS colours) and the common trailing B. All 20 R14 records of the public corpus close on their RL boundary, their values equal the R2000 saves of the same drawings handle for handle, and the spec's own §20.4.68.1 example now closes.
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. |
# Conflicts: # ARCHITECTURE.md # docs/data/spec-coverage.tsv # docs/spec-coverage.md # tools/corpus/baseline.tsv
Owner
Author
|
Merge-train note for fbc1115: main had changed these docs/data/spec-coverage.tsv notes since this PR's base, and this PR rewrote them too. The PR's free text was kept and main's was dropped. Tool-written sentences (DXF oracle, spec examples) were kept and regenerated. Check that nothing below still needs saying:
|
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
Decode R14 DIMSTYLE with the "R13 & R14 Only" block that §20.4.68 prints. The dispatcher reported every R14 DIMSTYLE as unhandled because the order had never been measured. All 20 R14 DIMSTYLE records of the public corpus now close on their
RLboundary. Their values equal the R2000 saves of the same drawings, handle for handle, and the spec's own §20.4.68.1 example closes as well. With #293 this leaves no table entry of the 52-file corpus skipped or erroring.Closes #74.
Spec reference
§20.4.68 DIMSTYLE, R13 & R14 Only. After the common entry header come:
Bs: DIMTOL, DIMLIM, DIMTIH, DIMTOH, DIMSE1, DIMSE2, DIMALT, DIMTOFL, DIMSAH, DIMTIX, DIMSOXD.RCDIMALTD andRCDIMZIN, thenBDIMSD1 andBDIMSD2.RCDIMTOLJ, DIMJUST and DIMFIT,BDIMUPT, thenRCDIMTZIN, DIMALTZ, DIMALTTZ and DIMTAD.BSunit and precision fields.BDs, DIMSCALE through DIMGAP.Tstrings: DIMPOST, DIMAPOST, DIMBLK, DIMBLK1 and DIMBLK2.BScolours: DIMCLRD, DIMCLRE and DIMCLRT.The
Bthat §20.4.68 lists as common after DIMLWE ("Seems to set the 0-bit (1) of the 70-group") follows.decode_r2000_inlineand the R2007+ reader already read that bit on their releases.Measured
RLboundary of the common object datasample_AC1014.dwg(0x27,0xE1,0x39A,0x994,0xB06,0xC88), and 2 in each of the 7 nextgis R14 drawingsB0x27ends at bit 848 against a boundary of 849STANDARD,ANNOTATIVEandCUSTOM_DIM_STYLEwhere R2000 hasStandard,Annotativeandcustom_dim_styleSTANDARD, handle1D)spec_examples --updateflipsr14-objects.tsvfromunhandledtoclosesFor example,
BESCHRIFTUNG0xB06decodes on R14 to dimscale 0, dimasz 2.5, dimexo 0.625, dimexe 1.25, dimtxt 2.5, dimcen 2.5, dimtad 1 and dimaltf 1/25.4. Those are the same values asBeschriftungon R2000, and the same as the overrides AutoCAD's DXF export of the R2007 save writes for0xB06(groups40,41,42,44,77,140,141,143).DIMALTRNDhas no slot in the R13/R14 block, soDimStyleEntry::dimaltrndis 0 there.examples/probe_dimstyle_r14.rs(new) matches each R14 DIMSTYLE by handle to the R2000 save's record. It compares the fifteen surfaced fields, with names compared case-insensitively, and exits non-zero on a difference, an unpaired handle or an undecoded record. All eight pairs endRESULT: every R14 DIMSTYLE equals its R2000 save.Coverage,
../../samplesTOTAL 4256 / 180 / 9 → 4262 / 174 / 9. The three nextgis R14 drawings among the 19 files each gain their 2 DIMSTYLE records.
Public corpus:
tools/corpus/baseline.tsv(regenerated, committed)52-file total: 14938 / 831 / 305 → 14958 / 811 / 305, measured against main at f44d92d.
measure.py checkpasses.Docs
examples/probe_dimstyle_r14.rs: new, the cross-release comparison above.docs/data/spec-coverage.tsv§20.4.68: the R14 DIMSTYLE block order (§20.4.68) unmeasured — 6 records #74 clause is replaced. The row stayspartialhere only for the R2007/R2010 errors that fix(tables): read the BL reactor count in the R2007+ table-entry prefix (#40) #293 fixes; whichever lands second can mark itcloses.spec_examples --updaterewrote the example's note andr14-objects.tsv.Test plan
cargo fmt --all -- --checkcargo clippy --all-targets --all-features -- -D warningsRUSTFLAGS="-D warnings" cargo test --release --all-features(real-file tests ran against../../samples)RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-featurestools/corpus/measure.py checkpasses against the committed baselinecargo run --release --example spec_examples -- --update: one cell, §20.4.68unhandled→closesSource-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).My contribution is based on §20.4.68 of the ODA's freely-redistributable Open Design Specification for .dwg files (v5.4.1), including its worked example, and on the corpus bytes (ACadSharp
samples/atc30a97ce, MIT, and nextgis/dwg_samples, pinned by #225). No third-party 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.