Skip to content

fix(entities): VERTEX (2D) stores its tangent on every vertex (§20.4.11, #272) - #287

Merged
DrunkOnJava merged 2 commits into
mainfrom
fix/272-vertex2d-tangent
Oct 26, 2026
Merged

DrunkOnJava merged 2 commits into
mainfrom
fix/272-vertex2d-tangent

Conversation

@DrunkOnJava

Copy link
Copy Markdown
Owner

Summary

VERTEX (2D) reads its tangent direction on every vertex, as §20.4.11 prints it, instead of only when flag 0x02 is set, and reads no end width after a negative start width. Closes #272.

Spec reference

ODA spec v5.4.1 §20.4.11 VERTEX (2D) (10), p114: Flags EC, Point 3BD, Start width BD (negative means both widths, with no end width stored), End width BD, Bulge BD, R2010+ Vertex ID BL, then Tangent dir BD on every release.

Evidence

  • The spec's own example, §20.4.11.1 (p115, flags 0), now closes on its RL boundary. Before: VERTEX_2D data fields ended at bit 221, data stream ends at 223 (delta -2). cargo run --release --example spec_examples gives OK: 417 checks; --update moved its row from error #272 to closes and rewrote its coverage note.
  • No pinned corpus drawing holds a VERTEX (2D) record: tools/corpus/measure.py over all 52 pinned drawings matches every row of tools/corpus/baseline.tsv unchanged.
  • The conditional tangent dates from the first implementation (April), before any boundary measurement; nothing measured backs it.

The existing unit test roundtrip_simple_vertex_r2000 wrote a vertex without a tangent and asserted None, pinning the old reading; it now writes the tangent and expects Some(0.0). No test is added.

Test plan

  • cargo fmt --all -- --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test --release --all-features
  • cargo run --release --example spec_examples (OK, 417 checks)
  • Corpus ratchet: 52 / 52 baseline rows unchanged

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:

  • No Autodesk DWG SDK source (RealDWG, ObjectARX, ObjectDBX) or NDA-protected Autodesk documentation was consulted or imported.
  • No Open Design Alliance Teigha / Drawings SDK source was consulted or imported. The ODA's public Open Design Specification for .dwg files PDF is explicitly allowed (see CLEANROOM.md).
  • No GPL-licensed DWG implementation source (LibreDWG, etc.) was consulted or imported. This matters because dwg-rs is Apache-2.0 and must remain compatible.

My contribution is based on the ODA's freely-redistributable Open Design Specification for .dwg files (v5.4.1), §20.4.11 and its example. No other source was read.

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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T12:07:47.920316Z 7d8a0ae PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) October 26, 2026 12:12
@DrunkOnJava
DrunkOnJava merged commit 8a94cf5 into main Oct 26, 2026
25 checks passed
@DrunkOnJava
DrunkOnJava deleted the fix/272-vertex2d-tangent branch October 26, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VERTEX (2D) reads its tangent only when flag 0x02 is set; §20.4.11's own R14 example needs it unconditionally

1 participant