Skip to content

fix: flag recovered Lines with coincident endpoints for repair in exports - #372

Merged
userfypp merged 1 commit into
mainfrom
fix/303-coincident-line-export-warning
Oct 27, 2026
Merged

userfypp merged 1 commit into
mainfrom
fix/303-coincident-line-export-warning

Conversation

@userfypp

@userfypp userfypp commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • A recovered Line or Polyline whose geometry needs repair, such as one with coincident endpoints, is no longer exported as zero. CSV and workbook exports refuse it with the 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.
  • measurementRows in src/services/csv.ts and formatMeasurement in src/utils/format.ts checked hasValidMeasurementPoints only for closed shapes (and counts, in CSV). Both now check every measurement type. The workbook export goes through buildMeasurementTable, so it gets the CSV check too.
  • areEffectivelyIdentical in src/utils/geometry.ts compared squared distances, which overflow to Infinity for very distant points, so Infinity <= Infinity treated 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

Related Issue

Closes #303

Opened from a branch in this repository because CodeQL did not run on the fork pull request #371.

…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
@userfypp
userfypp merged commit 9a2bca7 into main Oct 27, 2026
23 checks passed
@userfypp
userfypp deleted the fix/303-coincident-line-export-warning branch October 27, 2026 20:12
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.

Recovered invalid Lines are exported as zero

2 participants