Repository navigation
fix(entities): CAMERA, SUN, LIGHT and GEODATA have no fixed type code; their numbers come from the class map (#476) - #489
Merged
Conversation
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
CAMERA, SUN, LIGHT and GEODATA are custom classes: their type numbers come from
AcDb:Classes, like every class numbered 500 or above.ObjectTypestill gave them fixed codes 0x4F8 to 0x4FB, and the dispatcher decoded 0x4FA as LIGHT and routed 0x4FB to GEODATA. In a drawing that declares that many classes, a real class at one of those numbers was therefore labelled, or for LIGHT decoded, as the wrong class (#476).ObjectType::{Camera, Sun, Light, GeoData}and their code mappings are removed; those codes now read asObjectType::Custom.OBJECT_TYPE_LIGHT/OBJECT_TYPE_GEODATAare removed.DecodedEntity::type_code()gives 0 for LIGHT and GEODATA, as it does for other custom classes.probe_geodataand the DXF oracle (examples/dxf_oracle/corpus.rs) match the class-map path only, andtools/ci/dispatch_arms.pydrops the GEODATA exemption it no longer needs.light::decodeandlight::decode_modern_split_stream, two wrappers overread_bodywhose only callers were the fixed-code arms, are removed, and so isgeodata::decode, an inline wrapper nothing called. None of the three checked where the record ends; the class-name path reads the same field lists throughread_bodyand does.The crate is unreleased, so removing the four variants breaks no published API.
Closes #476.
Testing
dispatch_arms.py --check(41 decoded codes, all labelled),spec_coverage.py --check,changelog.py checkand rustfmt pass. CI builds and runs the corpus.24bc1c43merged intomain, confirms it: 495,272 records decoded on both sides, 40 skipped, 0 errored, with no per-file or per-type change.Source provenance
No format work: the fixed codes are removed, and the classes keep their class-map decoders.