Repository navigation
fix(entities): read §20.4.47 LEADER's end point projection and tails on every release (#71) - #249
Merged
Merged
Conversation
…on every release (#71) The decoder read four 3BDs after the points where §20.4.47 has five, so the field it called the end projection was the origin, and it stopped before the box and the flags: delta -282 on R14, -144 on R2000-R2007, -12 on R2010+. With the R14+ end point projection read and the section's R13-R14 and R2000+ tails, the one LEADER of each of seven saves of a drawing closes at delta 0, R14 to R2018. One departure is measured: from R2010 the box height and width are not written. The R2010+ record is exactly two non-default BDs shorter than the R2007 one, and the six bits after the end point projection equal the six after the box width on R2000-R2007. Values equal the DXF twin on R2000 to R2018; on R14 dimgap and dimasz equal the ISO-25 DIMSTYLE's DIMGAP and DIMASZ. examples/probe_leader.rs reproduces it; ARCHITECTURE.md §7l records it. §20.4.47 moves to 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. |
This was referenced Oct 26, 2026
# Conflicts: # ARCHITECTURE.md # docs/data/spec-coverage.tsv # docs/spec-coverage.md # src/entities/dispatch.rs
# Conflicts: # ARCHITECTURE.md
# Conflicts: # ARCHITECTURE.md
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 the whole §20.4.47 LEADER record on every release. The decoder read four
3BDs after the points where the section has five, then stopped. With the fifth one (the R14+ end point projection) and the section's own R13-R14 and R2000+ branches read, all 7 LEADER records of the public corpus close atdelta 0, R14 to R2018. There is one measured departure from the spec: from R2010 the record does not write the box height and width. Part of #71; VIEWPORT is #247 and MESH follows.Spec reference
§20.4.47 LEADER (45): unknown
B,BSannotation type,BSpath type,BLnumpts, the points, then origin, extrusion, x direction and offset to block insertion point as3BDs, R14+3BDend point projection, R13-R14BDdimgap, box height and box widthBDs, hook line and arrowheadBs, then the R13-R14 tail (BSarrowhead type,BDdimasz,B,B,BS,BSbyblock colour,B,B) or the R2000+ tail (BS,B,B).What the old list called the end projection was the origin. It equals the first point, which is the default §20.4.47 gives the origin.
Measured departure: no box from R2010
On R2010+ the record is exactly 132 bits shorter than on R2007, which is two non-default
BDs. The six bits after the end point projection are011000, the same six bits that follow the box width on R2000-R2007: hook line on x0(DXF 74 = 0), arrowhead on1,BS0,B0,B0. The R2010+ DXF exports still carry 40/41, so AutoCAD stores them elsewhere, not in this record. On R14 the creation-time values are the drawing's ISO-25 DIMSTYLE: dimgap0.625= DIMGAP (147) and dimasz2.5= DIMASZ (41).Records it was measured on
examples/probe_leader.rs(new) prints each LEADER and compares it with its DXF twin by handle. AutoCAD's export inserts a hook-line vertex before the last point (75 = 1). The probe states that rule and compares the remaining vertices; groups the DXF omits (71, 72) are listed as omitted, not compared against assumed defaults.(R14 has no twin, so it is checked by close only. No other file of either corpus holds a LEADER. This is one leader saved seven times: the field order is pinned across releases, but the box departure rests on one drawing.)
Coverage,
../../samplescargo run --release --example coverage_report -- ../../samples, base240f376:The error histogram loses
LEADER (0x002D) → 1.Coverage, public corpus (
acadsharp/;nextgis/unchanged at 7343 / 1100 / 0)sample_AC1014.dwgsample_AC1015.dwgsample_AC1018.dwgsample_AC1021.dwgsample_AC1024.dwgsample_AC1027.dwgsample_AC1032.dwgThese are the decoded/skipped/errored columns of
tools/corpus/baseline.tsv. The file is not in this PR because #225 is not onmain; it will be regenerated in the serial rebase after #247.Class census and reference closure
probe_class_censusandprobe_reference_closureon all 19 files of../../samplesgive output identical to the run before the change: every census reaches its declared counts, every walk is closed, and the reference counts are unchanged.Docs
docs/data/spec-coverage.tsv§20.4.47partial→closes, with the departure in the note;docs/spec-coverage.mdregenerated.Leaderfields are renamed to the spec's vocabulary (origin,x_direction,end_point_projection) and gain the box, flags and both tails.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-featuresroundtrip_3pt_leadernow also writes the fields the corrected R2010+ list reads after its four3BDs, so that it still builds a whole record.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).My contribution is based on §20.4.47 of the ODA's freely-redistributable Open Design Specification for .dwg files (v5.4.1). Every field name comes from it, including the DXF codes 40, 41, 210, 211 and 212. It also uses the corpus bytes and AutoCAD's DXF exports of the same drawing, read as data files (ACadSharp
samples/atc30a97ce, MIT, pinned by #225). The R2010+ absence of the box is measured, not taken from any source. 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.