Repository navigation
fix: flag recovered Lines with coincident endpoints for repair in exports - #372
Merged
Merged
Conversation
…orts A recovered Line or Polyline whose geometry needs repair was exported as zero. CSV and workbook exports now refuse it with the same repair message as other measurement types, and annotated PDF and panel labels show "Repair required", matching JSON and Takeoff. Point comparison no longer treats two distant points as identical when their squared distance overflows, so very long valid Lines still export. Closes #303
This was referenced Oct 27, 2026
2 of 12 tasks
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
Repair invalid Line measurements before exporting CSV.message that other types already get, and annotated PDF and panel labels show Repair required. This matches JSON, which rejects the geometry, and Takeoff, which excludes it.measurementRowsinsrc/services/csv.tsandformatMeasurementinsrc/utils/format.tscheckedhasValidMeasurementPointsonly for closed shapes (and counts, in CSV). Both now check every measurement type. The workbook export goes throughbuildMeasurementTable, so it gets the CSV check too.areEffectivelyIdenticalinsrc/utils/geometry.tscompared squared distances, which overflow toInfinityfor very distant points, soInfinity <= Infinitytreated them as identical. With Lines now validated on export, that would have refused a very long valid Line. It now uses the overflow-safe comparison that calibration points already used, and the duplicate helper is removed.Validation
verify,dependency-reviewandsizechecks passed there.csv.test.ts,format.test.ts,annotatedPdf.test.tsandgeometry.test.ts.Related Issue
Closes #303
Opened from a branch in this repository because CodeQL did not run on the fork pull request #371.