Skip to content

Read the channels of a ReCap scan from the file - #61

Open
mahach666 wants to merge 2 commits into
feature/issue-9-recap-node-layoutsfrom
feature/issue-10-recap-channels
Open

mahach666 wants to merge 2 commits into
feature/issue-9-recap-node-layoutsfrom
feature/issue-10-recap-channels

Conversation

@mahach666

Copy link
Copy Markdown
Contributor

Closes #10

Based on #60 (the branch feature/issue-9-recap-node-layouts); merge the earlier pull requests first.

What changed

  • HasColors, HasIntensities and HasNormals of a ReCap scan are no longer constants: they are read from the node
    table. The size of the payload of a node tells which channels its points hold — a record that holds the intensity and the
    colour is longer than one with the position only, and a node that holds more bytes per point also holds the plane of the
    normals.
  • The points of a node without colour and intensity get no colour and no intensity, instead of the values of bytes that the
    node does not hold.
  • RcsScanDocument.HasColorData, HasNormalData and HasIntensityData report the same as the scan.

Files changed

  • src/PclIO/Formats/Recap/RcsScanDocument.cs: the channels are detected from the node table, the points are read with the
    channels of their node, and the node payload check accepts the shorter record.
  • tests/PclIO.Tests/SyntheticFixtures.cs: the synthetic scan can hold records without colour and intensity.
  • tests/PclIO.Tests/FormatTests.cs: new tests for a scan without colour, with colour and normals and without normals.
  • README.md, docs/public-api.md, CHANGELOG.md: the new behaviour.

Tests

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

Limits

  • The channels are read from the node table, so they are known after that table has been read; the first access reads it.
  • A node that holds only the position of its points must use the shorter record of the supported layout; a file with another
    record size is rejected with NotSupportedException.
  • The scans of a ReCap project still report all three channels when the .rcs file was found, because the file is not opened
    when the project is read.

@mahach666
mahach666 force-pushed the feature/issue-9-recap-node-layouts branch from 91f8120 to 7fc2c2b Compare November 17, 2026 15:01
@mahach666
mahach666 force-pushed the feature/issue-10-recap-channels branch from ae5bbeb to 7d8cda8 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