Skip to content

ArthurBrussee/serde_ply

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

serde-ply

Crates.io Documentation

Flexible and fast PLY parser and writer using serde. While PLY is an older format, it's still used in various geometry processing applications and research. PLY files act as simple key-value tables, and can be decoded in a streaming manner.

Installation

Add this to your Cargo.toml:

[dependencies]
serde-ply = "0.1"
serde = { version = "1.0", features = ["derive"] }

Features

  • Supports serializing and deserializing PLY files
  • Supports full PLY specification including list properties
  • Supports binary and ASCII formats
  • Supports deserializing PLY files in chunks, for streaming data processing
  • High performance (1 GB/s+ deserialization)

Quick Start

use serde::{Deserialize, Serialize};

#[derive(Deserialize, Serialize)]
struct Vertex {
    x: f32,
    y: f32,
    z: f32,
}

#[derive(Deserialize, Serialize)]
struct Mesh {
    vertex: Vec<Vertex>,
}

// Read PLY file
let mesh: Mesh = serde_ply::from_reader(reader)?;

// Write PLY file
let bytes = serde_ply::to_bytes(&mesh, serde_ply::SerializeOptions::binary_le())?;

Examples

Please see the examples/ folder for usage examples.

Contributions

Contributions are welcome! Please open an issue or submit a pull request. Please run the tests to check if everything still works, and cargo bench to check if performance is still acceptable.

About

Serde (de)serialization for ply files

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages