Repository navigation
feat(dxf): score the DIMENSION family in the value oracle (§20.4.22 to §20.4.29) - #387
Merged
Merged
Conversation
…o §20.4.29) The seven DIMENSION decoders (§20.4.23 to §20.4.29, with the common dimension data of §20.4.22) are now compared with AutoCAD's export field by field. The record is scored as a whole, since every group code but 10 is written once: the common fields (the extrusion in 210, the text midpoint in 11 with the elevation as its z in 31, the text, rotations, insertion scale z and rotation, attachment, line spacing, measurement, flip arrows from R2007, version byte from R2010, the clone point in 12) and each subtype's points (10, 13, 14, 15, 16) and scalars (40, 50, 52). The DWG's flags byte is not group 70: the subtype's type, 32 for its bit 1, 128 for the absence of its bit 0 and 64 for an ordinate dimension's second flag byte make the group (§20.4.22, §20.4.23), and that derived value is the one compared. A group the export omits stands for the DXF Reference's default (line spacing style 1 and factor 1, rotations 0, empty text, insertion scale z 1). On the 49 drawing pairs: 66 records, R2000 to R2018 (11 per release: 3 linear, 2 aligned, 2 ordinate, 1 each of the two angular, radius and diameter), 1147 values equal the export, 702 by its default, none differ. 264 decoded values have no DXF group (the clone point, which the export omits, and the insertion scale x and y, which share codes 41 and 42 with the line spacing factor and the measurement). tools/oracle/baseline.tsv gains the 1343 new rows, and the seven rows of docs/spec-coverage.md say what the oracle measured. The oracle's section map files the seven types under §20.4.23 to §20.4.29. Refs #99, #102, #144
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
DrunkOnJava
enabled auto-merge (squash)
October 28, 2026 06:46
DrunkOnJava
added a commit
that referenced
this pull request
Oct 28, 2026
…till skipped (#424) CHANGELOG gains the table objects (#313, #316, #317, #319), the nineteen classes derived from AutoCAD's output (#326 to #341), the DIMENSION scorer (#387), the BLOCK fixtures (#407), the maintainer tools (#406, #383) and the merge train's stack handling (#421 to #423). README said every skipped type had a decoder in review; only SHAPE (#310) and the VIEWPORT entity header (#311) do, and the rest are twelve custom classes in the BookViewerApp3 drawings with no DXF export yet, now named. STATUS's pending section says its counts are the 2026-08-30 snapshot.
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
The value oracle scores the seven DIMENSION types (§20.4.23 to §20.4.29, with the common dimension data of §20.4.22) against AutoCAD's DXF export: 66 records, R2000 to R2018.
Every group code but 10 is written once per record, so the record is scored as a whole. The common fields: the extrusion (210), the text midpoint (11, 21) with the elevation as its z (31), the text (1), the text rotation and horizontal direction (53, 51), the insertion scale z and rotation (43, 54), the attachment (71), the line spacing (72, 41), the measurement (42), the flip arrows from R2007 (74, 75), the version byte from R2010 (280) and the clone point (12, 22). Each subtype adds its points (10, 13, 14, 15, 16) and scalars (40, 50, 52).
The DWG's flags byte is not group 70. §20.4.22 and §20.4.23 make the group from the subtype's type, 32 for the flags bit 1, 128 for the absence of its bit 0, and 64 for an ordinate dimension's second flag byte. That derived value is the one compared, and it equals the export on all 66 records. A group the export omits stands for the DXF Reference's default (line spacing style 1 and factor 1, rotations 0, empty text, insertion scale z 1) and counts as
default, neverequal.Spec reference
Spec §20.4.22 Common dimension data, §20.4.23 ORDINATE, §20.4.24 LINEAR, §20.4.25 ALIGNED, §20.4.26 ANGULAR 3-PT, §20.4.27 ANGULAR 2-LINE, §20.4.28 RADIUS and §20.4.29 DIAMETER. Before and after, on the 49 drawing pairs:
No field comes out different. The 264 DWG-only values are two groups of decoded fields the export has no group to compare: the clone point (12, 22), which the export omits on all 66 records, and the insertion scale x and y (§20.4.22 says they go to the anonymous block and cannot be read back; their codes 41 and 42 are the line spacing factor and the measurement). The not-decoded groups are the handles (the dimension style in 3, the anonymous block in 2, the owner in 330), the spec's unknown (73), the layer (8), the entity's colours and the extended data of a dimension with an overridden style.
tools/oracle/baseline.tsvgains the 1343 new rows; no existing row changes (the ratchet against main's baseline passes). The seven rows ofdocs/spec-coverage.mdsay what the oracle measured; their states staycloses.Test plan
cargo fmt --all -- --check,cargo clippy --all-targets --all-features -- -D warnings,cargo test --release --all-features,RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features,python3 tools/ci/spec_coverage.py --checkSource-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).dwg-rsis Apache-2.0 and must remain compatible.My contribution is based on:
CLEANROOM.md.No such reading was needed: the mapping is the spec's DXF column and the DXF Reference's AcDbDimension groups, read from AutoCAD's own exports as data.
See
CLEANROOM.mdfor the full allowed/forbidden source list and the honest scope of what "clean-room" means for this project.Developer Certificate of Origin
By submitting this PR, I certify that the contribution complies with the
Developer Certificate of Origin 1.1.
Specifically, I affirm that the contribution is my own work (or rightfully
licensed to me) and that it can be distributed under the project's Apache-2.0
license.
I will sign off commits with
git commit -swhen asked, which adds aSigned-off-bytrailer to the commit message asserting the DCO.Refs #99, #102, #144.