Skip to content

Report the valid returns of a FARO scan as its point count - #58

Open
mahach666 wants to merge 2 commits into
feature/issue-6-leica-incomplete-datafrom
feature/issue-7-faro-point-count
Open

mahach666 wants to merge 2 commits into
feature/issue-6-leica-incomplete-datafrom
feature/issue-7-faro-point-count

Conversation

@mahach666

Copy link
Copy Markdown
Contributor

Closes #7

Based on #57 (the branch feature/issue-6-leica-incomplete-data); merge the earlier pull requests first.

What changed

  • PclScan.PointCount of a FARO scan is now the number of valid returns, which is what a full read returns. The count is
    made on the first access, which reads the distance data of the scan, and is cached afterwards.
  • The size of the scan grid is available as the new FaroScan.GridSize, so that the difference between the grid and the
    valid returns stays visible.
  • The rule that decides whether a cell holds a usable return (the values 0 and 0xFFFF and the range of 0.1 m to 350 m) is now
    in one place and is used by the counter and by the reader, so the two cannot disagree.

Files changed

  • src/PclIO/Formats/Faro/FaroFlsDocument.cs: the valid returns are counted, PointCount reports them, GridSize is new and the
    rule for a usable distance is shared.
  • tests/PclIO.Tests/SyntheticFixtures.cs: the synthetic scan can hold cells without a return (invalidCells).
  • tests/PclIO.Tests/FormatTests.cs: new tests for a container and for a folder scan with cells without a return.
  • README.md, docs/public-api.md, CHANGELOG.md: the new behaviour.

Tests

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

Limits

  • The count needs the distance data of the scan, so the first access to it reads that data. A scan whose data is missing or damaged
    fails then with InvalidDataException.
  • The grid size of a folder scan is still limited by the size of its data stream, because the layout of that stream is assumed.

@mahach666
mahach666 force-pushed the feature/issue-6-leica-incomplete-data branch from cf0c5ae to 1fdf732 Compare November 17, 2026 15:01
@mahach666
mahach666 force-pushed the feature/issue-7-faro-point-count branch from ba421d1 to 3b6b1b9 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