Skip to main content

read_ply_bytes

Function read_ply_bytes 

Source
pub fn read_ply_bytes(bytes: &[u8]) -> OgeomResult<PlyImport>
Expand description

Read a PLY, ASCII or binary of either byte order, mesh or point cloud.

Every element the header declares is read in its order. Of the vertex element: x, y and z (required), nx, ny and nz as a normal, red, green, blue and alpha as a colour (also spelled r, g, b, a or diffuse_red and so on; an integer channel scaled by its type’s largest value, a float one taken as it is), and every other scalar property as a Scalar of its name. Of the face element: the list named vertex_indices (or vertex_index, or else its first list), of any count and index type, fanned into triangles, and a colour as for vertices. Other elements and properties are passed over.

PLY declares no unit; coordinates come back as written.

§Errors

OgeomError::Construction if the bytes are not a PLY file, the header is malformed or names a type the format does not define, a count promises more than the file holds, the body ends early or carries a value that does not parse, the vertices lack a coordinate or are absent, or a face names a vertex that is not there.