Table of Contents

Class PclPtsExporter

Namespace
PclIO.Export
Assembly
PclIO.dll

Exports point clouds to the ASCII PTS format: a first line with the point count, then one X Y Z Intensity R G B line per point.

public static class PclPtsExporter

Inheritance

Inherited Members

Remarks

Output is culture independent (invariant, '.' decimal separator) and every line ends with '\n'. The header must state the exact number of lines that follow, so the source is enumerated twice (PclIO.PclDocument.ReadAllPoints(PclIO.PclReadOptions) is re-enumerable): pass one counts, pass two writes. Memory use does not depend on the number of points. Coordinates have 4 decimals. Points with non-finite coordinates are skipped and are not counted in the header. Intensity is clamped to 0..1 and written as an integer 0..2047; a point without intensity gets 2047, a point without colour gets 255 255 255 (every line has all seven columns). Normals are not exported.

Methods

Export(PclDocument, TextWriter, PclReadOptions?)

Writes the document's points to writer and returns the number of points written.

public static long Export(PclDocument doc, TextWriter writer, PclReadOptions? options = null)

Parameters

doc PclDocument

Source document.

writer TextWriter

Destination text writer; the caller owns it and must flush or dispose it.

options PclReadOptions?

Read options (limit, subsampling, transform); null for defaults.

Returns

long

Number of point lines written.

Exceptions

InvalidOperationException

The source returned different points in the two passes.

Export(PclDocument, TextWriter, PclReadOptions?, out long)

Writes the document's points and also reports how many points were skipped.

public static long Export(PclDocument doc, TextWriter writer, PclReadOptions? options, out long skippedPoints)

Parameters

doc PclDocument

Source document.

writer TextWriter

Destination text writer; the caller owns it and must flush or dispose it.

options PclReadOptions?

Read options (limit, subsampling, transform); null for defaults.

skippedPoints long

Number of points skipped because a coordinate was NaN or infinite.

Returns

long

Number of point lines written.

Exceptions

InvalidOperationException

The source returned different points in the two passes.