| Crates.io | serde-ply |
| lib.rs | serde-ply |
| version | 0.2.1 |
| created_at | 2025-08-12 22:25:05.48888+00 |
| updated_at | 2025-08-13 23:17:49.198355+00 |
| description | A Serde-based PLY (Polygon File Format) serializer and deserializer |
| homepage | |
| repository | https://github.com/ArthurBrussee/serde_ply |
| max_upload_size | |
| id | 1792987 |
| size | 229,111 |
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.
Add this to your Cargo.toml:
[dependencies]
serde-ply = "0.1"
serde = { version = "1.0", features = ["derive"] }
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())?;
Please see the examples/ folder for usage examples.
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.