serde-ply

Crates.ioserde-ply
lib.rsserde-ply
version0.2.1
created_at2025-08-12 22:25:05.48888+00
updated_at2025-08-13 23:17:49.198355+00
descriptionA Serde-based PLY (Polygon File Format) serializer and deserializer
homepage
repositoryhttps://github.com/ArthurBrussee/serde_ply
max_upload_size
id1792987
size229,111
Arthur Brussee (ArthurBrussee)

documentation

https://docs.rs/serde-ply

README

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.

Commit count: 0

cargo fmt