Repository navigation
fix(entities): a HATCH spline edge without fit points stores no tangents (#228) - #294
Merged
Merged
Conversation
…nts (#228) §20.4.75 prints the R2010+ spline-edge tangents unconditionally after the fit points. The corpus's one spline edge, HATCH 0xAA8 of export_sample.dwg, has no fit points and closes on its string stream only without them; read with them its boundary-handle count decodes to 298,029,779. Read the tangents only when there are fit points, and bring the module's field list in line with §20.4.75 as the decoder reads 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. |
# Conflicts: # ARCHITECTURE.md # docs/data/spec-coverage.tsv # docs/spec-coverage.md # tools/corpus/baseline.tsv
Owner
Author
|
Merge-train note for ebb803f: 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
Read a HATCH spline edge's start and end tangents only when the edge has fit points. §20.4.75 prints them unconditionally after the R2010+ fit-point list. The one spline edge in the corpus has no fit points and stores no tangents, and that record, HATCH
0xAA8of ACadSharp'sexport_sample.dwg, now closes. With this, HATCH records error on no release. Part of #228; DIMSTYLE is #293, and VIEW belongs to the oracle lane.Spec reference
§20.4.75 HATCH, spline edge (
pathtypestatus == 4),R24:block:BL numfitpoints,2RDfit points,2RDstart tangent,2RDend tangent.decode_spline_edgenow reads the two tangents only whennumfitpoints > 0. That keeps the spec's order for the case with fit points, which no corpus record has.The record it was measured on
0xAA8(R2018) has one boundary path (flags 5: external, derived) with one spline edge: degree 3, 13 knots, 9 control points, 0 fit points. Read with the tangents, itsnum_boundary_handlesdecodes to 298,029,779 and the record errors. Read without them, every field after the edge is plausible:numfitpointsnumboundaryobjhandles"LINEAR"and"ANSI31"both consumedThe edge's control polygon is closed and starts and ends at (4.43, 2.59). That is the first and last of the 7 fit points of SPLINE
0xA7Fin the same drawing, and the seed point lies inside that curve.export_sample.dwghas no DXF twin, so this is the evidence available.No other HATCH record in the 52-file corpus or
../../sampleshas a spline edge, so no other record's reading changes.Coverage,
../../samplesUnchanged, TOTAL 4256 / 180 / 9 (no spline-edged HATCH among the 19 files).
Public corpus:
tools/corpus/baseline.tsv(regenerated, committed)52-file total: 14938 / 831 / 305 → 14939 / 831 / 304, measured against main at dcc29d7.
measure.py checkpasses. spec_examples are unchanged: §20.4.75.1 is a class-numbered record whose walk and CRC are all that run.Class census and reference closure
Unchanged on all 19 files of
../../samplesand in the baseline's census and closure columns.Docs
hatch.rs: the module's field list was stale (aBSgradient flag, aCMCper gradient colour, an unconditional pattern block, aBSpixel size). It now matches §20.4.75 as the decoder reads it, and section references read §20.4.75 instead of §19.4.75. The split-stream doc no longer claims a<=bound: the decoder checks for equality.docs/data/spec-coverage.tsv§20.4.75: the export_sample error is gone. The row stayspartialbecause the 8 R14 records are not routed yet (LAYOUT, MULTILEADER, LWPOLYLINE and HATCH are skipped on R14 to R2007: their decoders are not routed there #229, fix(entities): route the R14 LWPOLYLINE and HATCH classes and read LWPOLYLINE's R13-R14 vertices (#229) #264).docs/spec-coverage.mdregenerated.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 baselineSource-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.75 of the ODA's freely-redistributable Open Design Specification for .dwg files (v5.4.1) and on the corpus bytes (ACadSharp
samples/atc30a97ce, MIT, 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.