Skip to content

feat(objects): decode SPATIAL_FILTER from §20.4.94 (#149) - #308

Merged
DrunkOnJava merged 7 commits into
mainfrom
obj/spatial-filter
Oct 26, 2026
Merged

DrunkOnJava merged 7 commits into
mainfrom
obj/spatial-filter

Conversation

@DrunkOnJava

Copy link
Copy Markdown
Owner

Summary

Decode SPATIAL_FILTER (§20.4.94), the clip boundary of an xref or block insert: BS numpts, 2RD points, an extrusion and an origin, three BS switches with their optional BD distances, and two matrices of 12 BD. The dispatcher had no class-name arm for it, so the one record of each release was skipped.

Spec reference

§20.4.94 SPATIAL_FILTER (tracking #149). The field list closes as printed. The spec calls each matrix "double [4][3], column major order"; the values arrive as three rows of four with the translation last (ARCHITECTURE.md §7x has the corpus values), and are kept in stream order, which is the order of the DXF's 24 groups 40.

Test plan

  • cargo fmt --all -- --check and cargo clippy --all-targets --all-features -- -D warnings pass on this branch. cargo test, cargo doc and the 1.85 MSRV check run once on a merge of this lane's open branches instead of per branch (the machine is at memory pressure red); the result goes in a comment.

  • Shown on real files, no new unit tests: cargo run --release --example probe_spatial_filter -- <corpus> over the 52 pinned drawings. It closes on the boundary and compares every decoded value with AutoCAD's DXF export by handle.

    Release Records Close Values compared with the DXF Differ
    R14 1 1 no twin (boundary only)
    R2000 to R2018 (6 releases) 6 6 234 (39 each) 0
  • Corpus baseline regenerated: decoded +7, skipped -7, errored unchanged (7 rows).

  • Tests touched: none. examples/probe_spatial_filter.rs and the shared harness examples/support/twin.rs are new examples, not tests.

  • The DXF oracle does not score SPATIAL_FILTER yet. Neither clip switch is on in the corpus, so the optional front and back distances are not exercised by a real 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:

  • 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 (v5.4.1, sha256 973628f3…f504b) is explicitly allowed (see CLEANROOM.md).
  • No GPL-licensed DWG implementation source (LibreDWG, etc.) was consulted or imported.

My contribution is based on:

  • The ODA's freely-redistributable Open Design Specification for .dwg files (v5.4.1);
  • The corpus bytes and AutoCAD's own DXF exports of the pinned drawings (the oracle);
  • No reading of comments or code in any other project.

Developer Certificate of Origin

By submitting this PR, I certify that the contribution complies with the Developer Certificate of Origin 1.1.

The clip boundary of an xref or block insert is a BS point count, 2RD points,
an extrusion and origin, three BS switches with their optional BD distances,
and two matrices of 12 BD. The dispatcher had no class-name arm for it, so
the one record of each release was skipped; all 7 close on their data-stream
boundary from R14 to R2018.

Against AutoCAD's DXF export (R2000 to R2018) all 234 values of the 6 records
with a twin equal it.
@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-26T21:39:34.956908Z 20244fc New commits
ℹ️ 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.

…n the list sits apart from its siblings' (rustfmt sorts the list)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 838138dec5

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread examples/probe_spatial_filter.rs Resolved
# Conflicts:
#	ARCHITECTURE.md
#	docs/data/spec-coverage.tsv
#	docs/spec-coverage.md
#	tools/corpus/baseline.tsv
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.

1 participant