Skip to content

Take the point count of a Leica scan from the container when it states one - #56

Open
mahach666 wants to merge 1 commit into
feature/issue-4-leica-poses-boundsfrom
feature/issue-5-leica-point-count
Open

mahach666 wants to merge 1 commit into
feature/issue-4-leica-poses-boundsfrom
feature/issue-5-leica-point-count

Conversation

@mahach666

Copy link
Copy Markdown
Contributor

Closes #5

Based on #55 (the branch feature/issue-4-leica-poses-bounds); merge the earlier pull requests first.

What changed

  • PclScan.PointCount of a Leica scan is now the number the container states: the header of the point data holds the number of points of the whole payload, and the record of a setup holds the number of points of that setup. Reading the count therefore no longer decodes the point data, which was the slow part (about 35 s for a container of 750 MB).
  • A container that states no count still needs the decoding; the decoded count is cached as before.
  • A count that the container states is used as it is. It is not checked against the point data, because that would need the decoding the change avoids.

Files changed

  • src/PclIO/Formats/Leica/LgsxDocument.cs: the count is read from the header of the point data and from the record of a setup, and LgsxScan.PointCount uses it when it is there.
  • tests/PclIO.Tests/SyntheticFixtures.cs: the synthetic container writes the number of points into the header of the point data and into the record of a setup; withPointCount: false leaves it out.
  • tests/PclIO.Tests/FormatTests.cs: new tests for the stored count, for the agreement of the stored and the decoded count and for a count that does not decode the points.
  • tests/PclIO.Tests/CliTests.cs: the test of a count that fails on its first access now uses a container that states no count.
  • README.md, docs/public-api.md, CHANGELOG.md: the new behaviour.

Tests

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

Limits

  • The number of points is read from the header of the point data (offset 0x28) and from the record of a setup. A container that stores it elsewhere keeps the old behaviour of counting the points by decoding them.
  • A count that the container states is not verified; a wrong count in the file is reported as such.

@mahach666
mahach666 force-pushed the feature/issue-4-leica-poses-bounds branch from fac5563 to c753073 Compare November 17, 2026 15:01
@mahach666
mahach666 force-pushed the feature/issue-5-leica-point-count branch from 285ad7e to ddb5617 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