Skip to content
Merged
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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Read legacy Leica LGS octree points with source RGB and intensity.

### Changed

- Identify Leica LGS and LGSx from their container footer and report unsupported legacy point encoding explicitly.

## [0.1.2] - 2026-11-26

### Added
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ The library targets .NET 8 and .NET 10. It is managed code with no dependencies
| 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. Registered image blobs can be read explicitly through the format API. Page checksums are verified. |
| ReCap scan | `.rcs` | Experimental support for container version 3.2. The reader validates section and leaf ranges before returning points. Stored positions use a millimetre grid, with RGB, intensity and normals according to the header flags. `PointCount` reports stored points. The header count is available as `DeclaredPointCount`. When `ApplyTransform` is enabled, the reader applies scale and translation. Rotation values are metadata. |
| ReCap project | `.rcp` | Lists scan nodes and opens referenced `.rcs` files next to the project. Channel availability comes from the referenced scan header. With transforms enabled, the reader uses the node translation and scale when stated, and otherwise uses the scan file's transform. Rotation values are metadata. |
| Leica scan container | `.lgsx`, `.lgs` | Experimental. Version 22 point blocks decode differential Morton coordinates, RGB and intensity. Normals are unavailable for that block version. 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. |
| Leica scan container | `.lgsx` | Experimental. Version 22 point blocks decode differential Morton coordinates, RGB and intensity. Normals are unavailable for that block version. 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. |
| Leica legacy container | `.lgs` | Streams position, RGB and intensity from the supported octree layout as one scan in project coordinates. Convert unsupported variants to LGSx. |
| FARO scan | `.fls`, or a FARO scan folder | Experimental. Single-file containers with distance mode 26 decode both halves of the range grid and their optional RGB and intensity planes. 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. |
| PinPoint project | `.srf`, `.smf`, or a folder with `ScanProject.json` or `.smf`/`.srf` files | Experimental. The manifest (scan names, ids, poses, counts) is read. Points come from the referenced `.bin` files, in either of two layouts: a table of named channels, or numbered sections with a property table and Snappy-compressed channels, which PclIO decodes itself. Colour, intensity and normals are reported only when the file has that channel; in the second layout positions, colours, intensities, normals (`Normals`, three float32 components per point) and the per-point flags (`FilterBits`, one byte per point) are read, while the grid indices stored beside them are not interpreted, so by default every stored point that passes the plausibility rule below is returned. With `PclReadOptions.ExcludeFilteredPoints` the points with a non-zero flag are not returned. A manifest with a scan position list takes the point count from the manifest, else from the data file; a manifest with a data object list takes it from the data file the object refers to, and every location that shares one file reports its full count, because the shares are not recorded. A project shell whose data files are absent lists no scans, and a manifest whose referenced data files are missing reads no points; neither is a readable fixture. |
| EdgeWise | `.c3db`, `.c3ptx` | Experimental. A `.c3db` point database lists the scan clusters and a `.c3ptx` is one cluster file; the cluster files give positions only, as three 16-bit offsets from the cluster centre per point. The scale of the offsets is not stored in the files, so the reader assumes 32768 units = 0.128 m unless the caller states it with `PclReadOptions.EdgeWiseCoordinateScale`. |
Expand All @@ -70,8 +71,8 @@ The library targets .NET 8 and .NET 10. It is managed code with no dependencies
`PclFileKind.Unknown` for anything else; `PclFile.Open` then throws `NotSupportedException`. Extensions are compared without
regard to case.

- E57, ReCap scan and Leica files are recognised by their content and accepted with any extension; for Leica, `.lgs` selects the
older container and any other extension `.lgsx`. EdgeWise files are also recognised by content when the extension is none of its own.
- E57, ReCap scan and Leica files are recognised by content with any extension. The Leica footer distinguishes LGS from LGSx,
with the extension as a fallback when no recognised footer is present. EdgeWise can also be recognised by content.
A LAS file is recognised by the `LASF` signature with any extension except `.laz` and `.copc.laz`. A LAZ file is recognised by the `LASF` signature, a valid LASzip VLR and the `.laz` extension. A COPC file is recognised by the LAS 1.4 header and the `copc` info variable length record with `.copc.laz` or any extension. A PCD file is recognised by its header structure with any extension. A PLY file is recognised by its magic word and header structure with any extension. A PTS file is recognised by an integer point count header line followed by coordinate lines with any extension, or coordinate lines with the `.pts` extension. A PTX file is recognised by its 10-line header structure (grid dimensions, scanner pose, 4x4 matrix) with any extension. An XYZ / delimited text file is recognised by an explicit column header containing X, Y, Z in any extension, or by numeric coordinate lines with a recognised extension (`.xyz`, `.asc`, `.txt`, `.csv`). An SBF file is recognised by its companion `[SBF]` header structure with any extension, or by the binary signature `0x2A, 0x2A` (`**`) and record size formula (`.sbf`, `.sbf.data`, `.data`). A 3D Tiles `.pnts` tile is recognised by the `pnts` signature, version 1, and matching byte lengths. A glTF `.glb` point cloud is recognised by the `glTF` signature, version 2, and mesh primitive mode 0 (POINTS). A 3D Tiles tileset is recognised by JSON containing `asset` and `root` objects (`tileset.json`). A Potree dataset is recognised by `cloud.js` (with `octreeDir` and attribute descriptors) or `metadata.json` (version 2.x and point attributes) in `.js` or `.json`, by `.hrc` hierarchy files with 5-byte node records, or by ancestor `cloud.js`/`metadata.json` next to a `.bin` file. An EPT dataset is recognised by `ept.json` manifest structure (bounds, dataType, schema) or by companion `ept.json` next to octree tiles. A Leica PTG binary scan file is recognised by the `PTG\0` tag and magic number `0x928FA3C7` with any extension; a top-level ASCII index file is recognised by the `PTG index` header and the `.ptg` extension. A CC BIN file is recognised by the `CCB2` signature and entity header structure with any extension; a recognised Potree manifest in an ancestor directory takes precedence for `.bin` files.
- A FARO file must be an OLE2 compound file with the extension `.fls`. A ReCap project must be a ZIP archive with the extension
`.rcp`. A PinPoint file must be a JSON text file with the extension `.smf` or `.srf`.
Expand Down
3 changes: 2 additions & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ reading), `NotSupportedException` (unrecognised format or unsupported feature) o
| ASTM E57 | `.e57` | Points decoded for a defined subset (uncompressed bit-packed streams, single or double precision Cartesian coordinates, 8-bit colour and intensity). The format API also reads image blobs with checksum verification. |
| ReCap scan | `.rcs` | Experimental support for container version 3.2. Reads positions, intensity, colour and normals. Rotation values are metadata. |
| ReCap project | `.rcp` | Opens referenced `.rcs` files next to the project. With transforms enabled, uses the node's translation and scale when stated, and otherwise uses the scan file's transform. Rotation values are metadata. |
| Leica scan container | `.lgsx`, `.lgs` | Experimental. Version 22 blocks provide geometry, RGB and intensity. Containers without setup assignments open as one scan in container coordinates. |
| Leica scan container | `.lgsx` | Experimental. Version 22 blocks provide geometry, RGB and intensity. Containers without setup assignments open as one scan in container coordinates. |
| Leica legacy container | `.lgs` | Reads the supported octree layout as one scan with source RGB and intensity. Convert unrecognized variants to LGSx. |
| FARO scan | `.fls`, or a FARO scan folder | Experimental. Single-file distance mode 26 reconstructs both halves of the scan grid. A folder scan is read with an assumed layout and carries a warning. |
| PinPoint project | `.srf`, `.smf`, or a folder with `ScanProject.json` or `.smf`/`.srf` files | Experimental; manifest plus point data files in one of two layouts (named channels, or sections with Snappy-compressed channels); a data file in neither layout is not read. |
| EdgeWise | `.c3db`, `.c3ptx` | Experimental; positions only, with a coordinate scale that is an assumption of the reader. |
Expand Down
9 changes: 5 additions & 4 deletions docs/public-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ Detection finds the kind from the content of the file, its extension or the layo
`PclFileKind.Unknown` for anything else. Extensions are compared without regard to case; for the stream overload the extension
is the argument, which may also be a file name.

- `E57`, `RecapScan` and the Leica kinds are recognised by content and accepted with any extension; `LeicaLgs` is chosen for the
extension `.lgs` and `LeicaLgsx` for any other. `EdgeWise` is also recognised by content in a file with another extension.
- `E57`, `RecapScan` and the Leica kinds are recognised by content with any extension. A recognised Leica footer determines
`LeicaLgs` or `LeicaLgsx`, with the extension as a fallback. `EdgeWise` can also be recognised by content.
`Las` is recognised by the `LASF` signature with any extension except `.laz` and `.copc.laz`.
`Laz` is recognised by the `LASF` signature, a valid LASzip VLR and the `.laz` extension.
`Copc` is recognised by the LAS 1.4 header and the `copc` info VLR with `.copc.laz` or any extension.
Expand Down Expand Up @@ -102,8 +102,9 @@ request. An unresolved reference reports false for the channel properties. A res

## Format documents

For sampling plans, `LgsxDocument.GetEncodedPointCount` reads the declared counts in version 22 point block headers without
decompressing the point data. It returns null when the file uses another block layout or has no point blocks.
For sampling plans, `LgsxDocument.GetEncodedPointCount` reads the declared counts from native LGS point metadata or
version 22 LGSx point block headers without decoding the points. It returns null when the count is unavailable.
Legacy LGS returns one scan in project coordinates. Its dependent blocks are traversed together in spatial order.
`PclSceneOptions.PointObserver` receives retained points in scene geometry order, including their source attributes.
`PclSceneOptions.MaxDegreeOfParallelism` passes the requested concurrency to formats that support block decoding.

Expand Down
2 changes: 1 addition & 1 deletion src/PclIO.Cli/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Input formats (detected from the file signature, the extension or the folder lay
ASTM E57 by signature, any extension
ReCap scan by signature (.rcs)
ReCap project a ZIP archive with the extension .rcp
Leica scan by signature; .lgs selects the older container, any other extension .lgsx
Leica scan by signature and footer; extension used when the footer is unrecognised
FARO scan an OLE2 compound file with the extension .fls, or a folder with a FARO scan layout
PinPoint a JSON text file with the extension .smf or .srf, or a folder that holds
ScanProject.json, a .smf file or a .srf file
Expand Down
Loading
Loading