Skip to content

fix(dxf): a linear dimension without group 42 measures along its dimension line - #648

Merged
HakanSeven12 merged 2 commits into
hakanaktt:mainfrom
NeumannLukas93:fix/dxf-linear-dim-measurement
Nov 24, 2026
Merged

HakanSeven12 merged 2 commits into
hakanaktt:mainfrom
NeumannLukas93:fix/dxf-linear-dim-measurement

Conversation

@NeumannLukas93

Copy link
Copy Markdown

Closes #645

A linear dimension cached the direct distance between its extension-line origins as actual_measurement, and the DXF reader kept it when group 42 is missing. It now caches the projection that measurement() computes, and the DXF reader refreshes it once the normal is known.

Commits

  1. Test (#645): … (red, tests only): tests/issue_645_linear_dimension_measurement.rs.
    • 4 tests fail against main: constructors and DXF without group 42 for horizontal, vertical and OCS-rotated dims. They get 5 / 72.111 where 3 / 60 / 40 / 31.962 is expected.
    • dxf_dimension_keeps_a_stored_group_42 passes already. It guards that a stored group 42 stays authoritative.
  2. Fix (#645): … (pushed once CI has shown the red commit failing):
    • adds DimensionLinear::refresh_measurement(), and new/rotated call it (vertical now delegates to rotated);
    • the DXF reader refreshes a linear dimension when group 42 was absent.

Ran: cargo test, cargo test --no-default-features, cargo test --all-features and cargo check --all-targets --all-features, all on the fix commit locally. All passed; cargo check shows only the pre-existing warnings in src/classes/civil/.

  • Closes #645 is above
  • Bug: red-tests commit first, fix commit second, same PR
  • cargo test passes on the last commit (see "Ran"; ticked once the fix commit is pushed and CI is green)
  • No formatting-only or unrelated changes

@HakanSeven12
HakanSeven12 merged commit ad9789b into hakanaktt:main Nov 24, 2026
6 checks passed
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.

DXF: a linear dimension without group 42 reads back with the direct point distance as its measurement

2 participants