Repository navigation
fix: flag recovered Lines with coincident endpoints for repair in exports - #371
Closed
AnushreeKasturi wants to merge 1 commit into
Closed
AnushreeKasturi wants to merge 1 commit into
AnushreeKasturi wants to merge 1 commit into
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 userfypp#303
Owner
|
Thanks a lot for helping with Plan Measure! Your fix is merged (#372). I had to push it from a branch in the main repo because CodeQL wasn't running on your PR, and GitHub squashed it under my name, so you don't show up as author in the history. Sorry about that. By the way, there's now a |
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
npm run lint,npm run buildandgit diff --checkpass.csv.test.ts: a Line with coincident endpoints is refused bybuildCsvandbuildMeasurementTable.format.test.ts:formatMeasurementreturns Repair required for that Line.annotatedPdf.test.ts: the annotated PDF label for that Line is Repair required.geometry.test.ts: points at ±1e200 are not identical, and that Line is valid.npm test: 2289 passed and 2 failed. The two failures aresrc/performance/annotationLayerProps.test.tsxand the 5,000-row test inTakeoffWorkspace.test.tsx. They fail the same way on unchangedmainon my machine (Windows, one assertion and one 5 s timeout), and they pass in CI onmain, so they look environment-specific rather than related to this change.Related Issue
Closes #303