Introduction
PTS is a plain text point cloud format associated with Leica Geosystems’ laser scanning software, Cyclone. Its simplicity made it a common export from scanners and a common import in survey, CAD and visualisation programs. Each point is a line of numbers, usually a position, an intensity and a colour.
Being text, PTS files are large and slow to read for big scans, and they carry no information about the scanner’s position or the coordinate system. Binary formats such as E57 and LAS are better for large or shared data.
Structure
A PTS file starts with a line giving the number of points. Each following line is
one point, with values separated by spaces: x y z, then usually an
intensity, then red, green and blue from 0 to 255. Some files have only the three
coordinates, or coordinates and intensity. One user reports that a very large
Cyclone file continued with further count lines and their points after the first
block (syntax page), though no
specification confirms this. There is no formal specification,
so readers usually guess the columns from the number of values on a line.
3
1.204 0.551 2.010 -1024 128 120 110
1.206 0.553 2.011 -980 131 122 112
1.209 0.552 2.013 -1012 129 121 111
In this reference
- Syntax – the count line, the 3, 4, 6 and 7 column layouts, the intensity range and how PDAL and Open3D read and write the format
Not described
Known, not yet covered
- Reference: the related PTX format, which lists several scans, each with a header and its points in scan-grid order (syntax page mentions it only).
- Unknown: the multi-block layout (a count line, its points, then another count line) rests on two user reports in the LAStools group (2016, 2018); tried and not found: any Leica Cyclone or REGISTER 360 document describing it, PDAL, Open3D and CloudCompare source (none handles blocks), four PDAL sample files (single block) and web searches for a sample. Whether a block is preceded by header lines (transformation, matrix) is unknown.
- Reference (variants, not blocking): files with no count line, intensity read as 0 to 255, −4096 to 4095, 0.0 to 1.0 or 0 to 65535, and the MicroSurvey layouts with normals are written by other programs or described by their documentation; no Leica text says that any of them is valid Leica PTS. The syntax page describes each as a variant with its source.
- Reference: the Cyclone layout: Leica’s only public text (REGISTER 360 export page) says a count then XYZ and intensity; the seven-value layout with colour and the meaning of the count (“total number of points” against “number of points following”) rest on reader code and user reports, so what Cyclone itself writes is not confirmed by any Leica document. Whether PDAL has a PTS writer was not checked beyond its
PtsWriter.cppnot existing in the source tree. - Reference: encoding: no source says what character encoding Cyclone writes, and none of the three readers checks it.
- Viewer: the explorer shows the count line, every point line (x y z, with intensity and colour for 4, 6 and 7 values), blocks, bounds, the intensity range seen and a 3D view (a regular sample above 1,000,000 points; every point stays in the table), and lists the problems the syntax page's rules give. Not covered: the units and coordinate system (not in the file), a header between blocks (Unknown, see below), and a choice of which intensity range a file uses (the file does not say).
- Viewer: what PDAL and Open3D do with a file is not written out sentence by sentence: the two readers are simulated (
explorer/formats/pts/sim.js, from PDALPtsReader.cppandUtils.hppand Open3DFilePTS.cpp,Helper.cppandFileSystem.cpp, with the C rules forsscanf), every line is fed to both, and every statement about them in the Problems tab, in the count message and in the “PDAL and Open3D” row of the Overview is generated from what the simulation did with that line. The simulation takes the layout from the file’s second line the way each reader does (PDAL splits thegetlinetext at spaces; Open3D splits thefgetstext, which keeps the line break, so a trailing space on that line is one more piece for Open3D), counts what each reader counts (PDAL only the points it keeps, until it reaches the count; Open3D the nextcountlines, failing at the first it cannot read), and models tabs, white-space-only and empty lines,nan,inf,12abc, values past the layout,%dcolour columns, a CR before the line break, a lone CR (neither reader ends a line there), a byte order mark and Open3D’s 1,024-byte line buffer. A tab, a blank line or any other line is a problem only when a reader does not take it as written; a line both readers read as written is no problem. The tests hold every statement to the simulators on 2,000 random files and on every probe of the earlier re-checks. A fractional intensity stays a note, a fractional colour a problem. - Viewer: the simulation takes the C and C++ library rules from the standards’ text, read in full: C11 (the n1570 draft) 7.21.6.2 (
sscanf) paragraph 9 (an input item is the longest sequence that is, or is a prefix of, a matching sequence; a zero-length item is a matching failure, so%don5.5reads5and the next%dfails on.5) and paragraph 12 (%dtakes the form of thestrtolsubject sequence, sonanandinffail;%lftakes thestrtodform: a sign,inf,infinity,nan,nan(…)and0xhexadecimal floats, with1ea prefix that is not a number, so it fails); 7.22.1.3 (strtod) paragraph 3 for those forms and paragraph 10 (HUGE_VALandERANGEon overflow, which is what1e400gives); 7.22.1.4 (strtoul) paragraph 5 (a minus sign negates in the unsigned type, so%zuof-1is 264 − 1) and paragraph 8 (ULONG_MAXfor a value out of range). C++[facet.num.get.virtuals](eel.is/c++draft,std::istream>>) stage 2 (only the characters0123456789abcdefpxABCDEFPX+-are collected, sonan,infand-nancollect nothing usable) and stage 3 (zero when the conversion does not take the whole field, the maximum plusfailbitfor an unsigned value that does not fit, which refuses a count above 264 − 1 and sets an out-of-range value to 0 in PDAL). - Viewer: not covered by any text the explorer could read, and said as such in the sentences: (a) the standard leaves an
sscanfresult that cannot be represented undefined (7.21.6.2 paragraph 10), so that glibc stores infinity for1e400andULONG_MAXfor a count above 264 − 1 is glibc’s behaviour, not the standard’s; (b)std::vector::resize: that libstdc++ throwsstd::length_errorabovemax_size()(the sentence uses 9223372036854775807 ÷ 24 = 384,307,168,202,282,325 forEigen::Vector3d, 24 bytes), thatoperator newthrowsstd::bad_allocbeyond the address space (the explorer takes 257 bytes, the largest user space of a mainstream 64-bit platform, as the bound), and that a smaller count can still fail for lack of memory (no count between the two bounds is judged); (c) the standard’s stage 2 text collects a hexadecimal float (0x1a.bp+07) for adouble, while the simulation, like libstdc++ as far as known, reads0x10as0and ignores the rest: libstdc++’s own source was not read; (d) a NUL byte in a line (not simulated: nothing is said about the line) and files in UTF-16 or UTF-32 (not simulated). The explorer has no way to run PDAL or Open3D itself.
Also used for
- Pro Tools session (versions 5 and 6) – An Avid Pro Tools session: an obfuscated binary file beside an Audio Files folder.
Links
Software
- CloudCompare – free open source point cloud and mesh tool (Windows, macOS, Linux)
- Autodesk ReCap – Autodesk’s reality capture program for laser scans (Windows)
- Leica Cyclone – Leica Geosystems’ laser scanning software, where the format comes from (Windows)
Developers
- PDAL readers.pts – the PDAL PTS reader (C++)
- Open3D FilePTS.cpp – Open3D’s PTS reader and writer (C++)
Reference
- Third-Party File Export – Leica Cyclone REGISTER 360 help, with its description of PTS
- pts – Laser scan plain data format – Paul Bourke’s description
- PTS syntax – this site’s page, with every source linked