Repository navigation
fix(entities): read MESH's trailing BL and decode MESH on every release (#71) - #252
Merged
Merged
Conversation
…se (#71) MESH's last two bits, 10, were left unread because they are the zero code of BS, BL and BD alike. AutoCAD's DXF export of the same drawing ends each AcDbSubDMesh group with one more group 90 equal to 0 after the creases, the group it writes for every other BL in the record, so they are a BL 0. A non-zero value is refused rather than guessed. AutoCAD writes the same MESH record into R14, R2000, R2004 and R2007 saves, not a proxy, and the decoder refused all of them. Without that gate the field list closes on all 14 MESH records of the public corpus, R14 to R2018, and on the 12 with a DXF twin every value equals the DXF (926 and 904 per record). The test that pinned the pre-R2010 refusal is removed; the roundtrip helper writes the trailing BL. examples/probe_mesh.rs reproduces it; ARCHITECTURE.md §7m records it.
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. |
10 tasks done
# Conflicts: # ARCHITECTURE.md
DrunkOnJava
enabled auto-merge (squash)
October 26, 2026 12:48
DrunkOnJava
disabled auto-merge
October 26, 2026 12:51
This was referenced Oct 26, 2026
# Conflicts: # ARCHITECTURE.md # tools/corpus/baseline.tsv
# 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
Read MESH's trailing field as a
BL(AutoCAD's DXF export names it: a group 90 equal to 0 after the creases) and stop refusing MESH before R2010. All 14 MESH records of the public corpus now close, R14 to R2018. On the 12 that have a DXF twin, every value equals the DXF, group by group. With #247 (VIEWPORT) and #249 (LEADER) this finishes #71.Closes #71 (once #247 and #249 are merged; this PR is queued after them).
Spec reference
ODA spec v5.4.1 has no section for MESH (the
MESHcustom class, DXF subclassAcDbSubDMesh); the field list was already measured (§7i of ARCHITECTURE.md). Two changes:BL0. §7i left them unread:10is the zero code ofBS,BLandBDalike, and both records encode zero, so both errored atdelta -2. The DXF twin settles it. EachAcDbSubDMeshgroup ends95(crease count),140× crease count, then one more90=0. Every otherBLof the record is a group 90 (face-list entries, edge endpoints), written in the record's own order. The decoder now reads theBLand returnsUnsupportedfor a non-zero value, whose contents nothing in the corpus shows, rather than closing on a guess.0x343on R2000, R2004 and R2010), not a proxy. The decoder returnedUnsupportedfor every pre-R2010 MESH, so 8 of the 14 corpus errors were that gate.Still undetermined: whether version, subdivision level and vertex count are
BSorBL. Every value is below 256, where the two spend the same bits.Records it was measured on
examples/probe_mesh.rs(new) walks the twin'sAcDbSubDMeshgroup in order and compares every value. That is version, blend crease, subdivision level, every vertex coordinate, every face-list entry, every edge endpoint, every crease and the trailing count.No other file of either corpus holds a MESH. These are two meshes saved seven times. The record is pinned across releases, but the trailing count has only ever been 0.
Coverage,
../../samplescargo run --release --example coverage_report -- ../../samples, base240f376:The error histogram loses
MESH (custom class) → 2.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 will be regenerated in the serial rebase after #249.Class census and reference closure
probe_class_censusandprobe_reference_closureon all 19 files of../../samplesgive output identical to the run before the change.Docs
src/entities/mesh.rs: the module doc drops the "§19.4.66" citation (the spec has no MESH section) and the "pre-R2010 files never emit this entity" claim, and records the measurement.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-featureswrite_meshnow writes the trailingBL0, so the two roundtrip tests still build a whole record.rejects_pre_r2010is removed. It asserted that an R2007 MESH is refused, and the corpus shows AutoCAD writing, and this decoder closing, MESH on R14 to R2007 (8 records, 6 of them matching their DXF twin value for value). Flagging it here because it removes an existing test.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 the corpus bytes and on AutoCAD's DXF exports of the same drawings, read as data files (ACadSharp
samples/atc30a97ce, MIT, pinned by #225). The trailing field is identified from the position and group code the DXF writes there; it is left unnamed, and no outside vocabulary was used. 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.