pub fn read_xyz(
text: &str,
columns: Option<&[XyzColumn]>,
) -> OgeomResult<PointCloud>Expand description
Read an XYZ text cloud.
A row per point; blank lines and lines opening with # or // are
passed over, but for the first such line before the data when it names
the columns, x y z first: nx ny nz are a normal, r g b (or red green blue) a colour from 0 to 255, and any other word a scalar of
that name. columns, when given, names them instead. Unnamed, the
column count decides:
| columns | read as |
|---|---|
| 3 | x y z |
| 4 | x y z, then a scalar intensity |
| 6 | x y z, then a colour if every value of the last three is an integer from 0 to 255 and one is past 1, a normal otherwise |
| 7 | x y z, intensity, then a colour, as PTS lays them out |
| 9 | x y z, then a colour and a normal, the colour being whichever triple reads as one by the rule above |
Every other count is refused, as is a nine-column file where neither triple, or both, reads as colour.
ยงErrors
OgeomError::Construction for a
field that is not a finite number, rows of differing widths, a colour
channel outside 0 to 255, columns naming part of a point, normal or
colour, or a layout the rule above leaves open.