Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- ReCap scans (`.rcs`) of container major version 3 are decoded. The points come from the leaves of the file and the blocks the
points section holds for them: a position on a 1 mm grid, counted from the cube of the leaf, an intensity, an 8-bit colour and
a normal packed as a code that names a cell on a cube face. The sections are taken from the table of the header whatever their
order, the other sections are skipped, and a leaf may hold more index words than its points need. A point has a normal only
when its record states a plain cell code. Before, a file whose leaf blocks were not a whole multiple of a record size was
rejected.
- A ReCap scan is checked as a whole before its first point is returned. A section table that does not fit in the file, a
missing or duplicated section, a leaf table that does not fit in its section, a leaf block that does not fit its points and
blocks that do not fill the points section are rejected with `InvalidDataException`, and nothing is returned. Before, the
records of a file were checked one at a time while its points were streamed.
- The point count of a ReCap scan is the number of points the file stores, which a full read returns. The count stated in the
header is not that number; it stays available as `RcsScanDocument.DeclaredPointCount`. A scan that states a count in its header
but holds no leaf reports 0 points.
- The channels of a ReCap scan (`HasColors`, `HasIntensities`, `HasNormals`) follow flags of the header, so they are known from
the header alone; before, they were derived from the size of a node payload. The bytes of a channel are read only when the
header states the channel.

## [0.1.1] - 2026-11-25

### Added
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ The library targets .NET 8 and .NET 10. It is managed code with no dependencies
| Format | Extensions | Support level |
| --- | --- | --- |
| ASTM E57 | `.e57` | Points decoded for a defined subset: uncompressed bit-packed streams with single or double precision Cartesian coordinates or scaled-integer coordinates (raw value times scale plus offset), or spherical range, azimuth and elevation converted to Cartesian points, with 8-bit colour and 8-bit intensity, or colour with a wider Integer range from zero and intensity as a wider Integer, a Float or a scaled integer. Pose translation and rotation are applied. Only plain bit-packing is decoded: a scan whose codecs vector names another codec lists normally and fails when its points are read, and the message names it. Per-point validity flags skip invalid points and clear invalid channels when their streams hold one flag byte per record; other shapes are not interpreted. Images are not read, so a scan with them still lists and reads its points. Page checksums are verified. |
| ReCap scan | `.rcs` | Experimental. The header is read; point decoding covers the node layouts that are described in the code, which is the one of major version 3. A file of another version is listed with its header, but reading its points fails with a message that names the version. A further layout is described only when the files of that version may be used for the tests, so that its offsets can be verified. The channels of the points follow from the size of the payload of the nodes: colour and intensity when the records are long enough, and normals when the node holds the plane of them. A node payload whose byte count is not a whole multiple of a known record size, as in BLK360 exports (container 3.2) whose records are variable-length, is rejected with a message that names the container version instead of being guessed. |
| ReCap scan | `.rcs` | Experimental; container major version 3. The points come from the leaves of the file: a position on a 1 mm grid, an intensity, an 8-bit colour and a packed normal for each. The channels that are read follow flags of the header. The file is checked as a whole before the first point is returned, and a section, a leaf or a block that does not fit the file is rejected with `InvalidDataException` instead of being read at a guess. A file of another major version is listed with its header, but reading its points fails with a message that names the version. A further version is decoded only when files of it may be used for the tests, so that
its layout can be verified. `PointCount` is the number of points the file stores; the count stated in the header is not, and it is available as `DeclaredPointCount`. Scale and translation of the header are applied when `ApplyTransform` is set; the rotation is not. |
| ReCap project | `.rcp` | Lists the scans of the project manifest and opens the `.rcs` files it finds next to the project. The transform of a scan node places the scan in the project and is applied to its points unless `ApplyTransform` is false; when the manifest states no transform, the transform of the scan file is used. |
| Leica scan container | `.lgsx`, `.lgs` | Experimental. Points are decoded from the compressed point blocks: position, and colour, intensity and normals when the block has them. When the container assigns its points to its setups, there is one scan per setup, named after the setup, with the pose and the bounds of the setup when its record holds them; the pose is applied unless `ApplyTransform` is false. When the container does not assign its points, all points of the container form one scan and a warning says so. The point count is taken from the container when it states one; otherwise it is found by decoding the data, which is slow on large files. `PclReadOptions.Blocks` reads only the blocks of the scan in that file-order range (per scan, so a setup scan ranges over its own blocks); `PclReadOptions.MaxDegreeOfParallelism` above 1 decodes those blocks in parallel and still yields the points in file order with consecutive `Index` values. |
| FARO scan | `.fls`, or a FARO scan folder | Experimental. The scan grid and angles are read from the stored parameters and points are projected from the range grid; a file without them fails to open. The point count is the number of valid returns, which is counted on the first access; `FaroScan.GridSize` is the size of the scan grid. For a scan folder the layout of the samples is derived from the size of the data stream and the size of the grid, and the scale of the intensity from the values that are stored; when the sizes do not fit, the layout is assumed and a warning says so. |
Expand Down Expand Up @@ -145,7 +146,7 @@ outside the file is fetched.
| --- | --- |
| E57 | XML section 32 MiB, nesting depth 64, 1,000,000 elements; declared record counts up to 2^40; at most 65535 fields in a point prototype; at most 4096 consecutive packets without points. |
| ReCap project | Manifest 64 MiB (declared and real size), nesting depth 64, 1,000,000 elements, 65,536 scan nodes. |
| ReCap scan | 500,000 nodes in the node table, which must fit in the file together with the node payloads. |
| ReCap scan | 64 sections in the table; 500,000 leaves, and the table of the leaves must fit in its section; every leaf block must fit its points and the points section, and the blocks must fill the points section. |
| Leica | 10,000 container entries; per point block at most 64 compressed streams, 10,000,000 compressed bytes per stream, 16 MiB per decompressed stream (checked before allocation) and 128 MiB decompressed in all; over all blocks of one read 1 GiB plus 64 times the file size decompressed. |
| FARO | Parameters 1 MiB; scan grid of at most 2^27 cells (134,217,728); a distance stream too small for the declared grid is refused; each compressed data stream is held in memory (see above) and is inflated in chunks, and must not inflate beyond its grid size plus 64 KiB. Compound file: 65,536 directory entries, depth 16. |
| PinPoint | Manifest 64 MiB and the default nesting depth of `System.Text.Json` (64); 100,000 scans. The parsed manifest needs memory of about 15 times its size, so a manifest at the limit needs about 1 GB. Sectioned data file: at most 16 sections, a property table of at most 1 MiB nested at most 8 levels, copies in a compressed stream at most 8 MiB back with a decoder window of at most 8 MiB per stream; the sections must be contiguous and fill the file, and the `Points`, `RGB8`, `Intensities8`, `Normals` and `FilterBits` streams must decode to exactly 12, 3, 1, 12 and 1 bytes per stored point. |
Expand Down
4 changes: 2 additions & 2 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ reading), `NotSupportedException` (unrecognised format or unsupported feature) o
| Format | Extensions | Support level |
| --- | --- | --- |
| ASTM E57 | `.e57` | Points decoded for a defined subset (uncompressed bit-packed streams, single or double precision Cartesian coordinates, 8-bit colour and intensity). Per-point validity flags and images are not read. |
| ReCap scan | `.rcs` | Experimental; layout of major version 3 only. |
| ReCap scan | `.rcs` | Experimental; layout of major version 3 only. Positions, intensity, colour and normals; rotation is not applied. |
| ReCap project | `.rcp` | Lists scans; opens the `.rcs` files it finds next to the project. Node transforms are not applied. |
| Leica scan container | `.lgsx`, `.lgs` | Experimental; poses and bounds are not read, and all points of a container form one scan. |
| FARO scan | `.fls`, or a FARO scan folder | Experimental; the scan grid comes from the stored parameters. A folder scan is read with an assumed layout, and a warning says so. |
Expand All @@ -101,7 +101,7 @@ are decided by extension alone, without a content check. A `.pcd` file is recogn
and a `.ply` file by its magic word and header structure. Anything else is `PclFileKind.Unknown`. The rules are in
[Public API](public-api.md#format-detection).
Anything a decoder does not support fails instead of being guessed, apart from the assumptions named in the README (the FARO folder
record layout, the EdgeWise position scale and the ReCap scan channel flags). The sizes and counts a reader accepts are limited; a
record layout and the EdgeWise position scale). The sizes and counts a reader accepts are limited; a
file that exceeds a limit is rejected with `InvalidDataException`, with the exceptions listed in the README.

## Limitations
Expand Down
8 changes: 4 additions & 4 deletions docs/public-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ drop points that fail a plausibility rule (see the README), so a scan can yield
| Reader | `PointCount` |
|---|---|
| E57 | Declared by the file. It is not checked against the point data until the points are read. Points that the validity flags mark as invalid are skipped, so a read can yield fewer points. |
| ReCap scan | Declared in the header. It is not checked against the node table. The node layout of major version 3 is decoded; a file of another version is listed but its points cannot be read (`RcsScanDocument.DecodedNodeLayoutVersions` names the decoded versions). |
| ReCap scan | The number of points the file stores, summed over its leaves; a full read returns exactly this many. The header states a count of its own, `RcsScanDocument.DeclaredPointCount`, which is not that number. The leaves are read and checked on the first access to the count or to the points, which throws `InvalidDataException` for a malformed file. The layout of major version 3 is decoded; a file of another version reports the count of the header, and its points cannot be read (`RcsScanDocument.DecodedNodeLayoutVersions` names the decoded versions). |
| ReCap project | Declared by the project manifest; 0 when the manifest states none. |
| Leica | The number of points the container states, when it states one; otherwise it is computed. The computed value needs the first access to decode all of the point data and caches the result, which can be slow on large files; the access throws `InvalidDataException` for corrupt data. A container that assigns its points to its setups has one scan per setup, each with the id and the name of its setup; otherwise the container is one scan with the id `unified-cloud`. The `Transform` and the `Bounds` of a setup are read from its record and are empty when the record does not hold them. `Blocks` applies per scan in file order; a truncated read (fewer points yielded than selected, via `MaxPoints`) reports no incomplete-data warning. |
| FARO | The number of valid returns, which is counted on the first access by reading the distance data of the scan; `FaroScan.GridSize` is the size of the scan grid (rows times columns). For a folder scan the grid size is limited by the size of the data stream, and `FaroScan.RecordSize` is the size of one sample in bytes. |
Expand All @@ -97,9 +97,9 @@ drop points that fail a plausibility rule (see the README), so a scan can yield
| CC BIN | The point count declared for the entity. The reader rejects files with a truncated XYZ block or a point count that exceeds the available XYZ data. Points with non-finite coordinates are skipped. Packed point normals are decoded in file versions 41, 42 and 50. A stored zero direction is returned as `PclVector3.Zero`. |

`HasColors`, `HasIntensities` and `HasNormals` follow what the file contains, except for the scans of a ReCap project, where all three
are true when the `.rcs` file was found and false otherwise, without the file being opened. A ReCap scan reads the channels
from the node table, so they are known after the node table has been read; a node whose points hold no colour gives its points
no colour.
are true when the `.rcs` file was found and false otherwise, without the file being opened. A ReCap scan reads them from the flags of
its header; the bytes of a channel are read only when the header states the channel. A point of a scan with normals has one only
when its record states a cell code.

## Format documents

Expand Down
Loading
Loading