Skip to content

Make the PinPoint coordinate plausibility rule an option - #65

Open
mahach666 wants to merge 2 commits into
feature/issue-13-pinpoint-normalsfrom
feature/issue-14-pinpoint-plausibility
Open

mahach666 wants to merge 2 commits into
feature/issue-13-pinpoint-normalsfrom
feature/issue-14-pinpoint-plausibility

Conversation

@mahach666

Copy link
Copy Markdown
Contributor

Closes #14

Based on #64 (the branch feature/issue-13-pinpoint-normals); merge the earlier pull requests first.

What changed

  • The PinPoint coordinate plausibility rule is now PclReadOptions.MaxCoordinateMagnitude (default 5000, in the file's own
    unit; null switches the magnitude limit off). Non-finite (NaN or infinite) coordinates are still never returned. Other
    readers ignore the option.
  • A full read reports how many points it dropped in the warnings of the document (The coordinate plausibility rule dropped N points (M with non-finite coordinates, K beyond the magnitude limit of ...).), instead of dropping them
    silently. With PclReadOptions.Strict the read fails with InvalidDataException instead, per the documented contract
    of Strict.

Files changed

  • src/PclIO/PclReadOptions.cs: the new MaxCoordinateMagnitude option (validated, negative rejected).
  • src/PclIO/Formats/PinPoint/PinPointDocument.cs: the rule uses the option, counts non-finite and out-of-range drops
    separately and reports them; PinPointScan holds the document for warnings; reader documentation updated.
  • tests/PclIO.Tests/FormatTests.cs: new tests for a raised limit, a switched-off limit, the warning count and strict mode.
  • tests/PclIO.Tests/OptionsAndPathTests.cs: the default value and the validation of the new option.
  • README.md, docs/getting-started.md, docs/public-api.md, CHANGELOG.md: the new behaviour.

Tests

  • dotnet build — 0 warnings, 0 errors.
  • dotnet test — 630 passed, 0 failed, 10 skipped (the tests that need private scan files) on .NET 8 and .NET 10.

Limits

  • The count describes the read that produced it: a read stopped early by MaxPoints counts only what it visited, and the
    warning is added only when the whole point data was read. Repeated identical reads do not repeat the warning.
  • The transform is applied after the rule, so the limit sees stored coordinates, not placed ones.

@mahach666
mahach666 force-pushed the feature/issue-13-pinpoint-normals branch from 0f35ff9 to ef58f14 Compare November 17, 2026 15:01
@mahach666
mahach666 force-pushed the feature/issue-14-pinpoint-plausibility branch from 03f4c22 to 4ca1bc1 Compare November 17, 2026 15:01

This branch has not been deployed

No deployments
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.

1 participant