ply2splat
A Rust crate and CLI tool for converting Gaussian Splatting .ply files to the .splat format.
Features
- High Performance: Utilizes parallel processing (via
rayon) for conversion and sorting. - Fast I/O: Uses zero-copy serialization and large buffers for maximum throughput.
- Correctness: Implements the standard conversion logic including Spherical Harmonics (SH) to color conversion and geometric transformations.
- Python Bindings: Use the library directly from Python via PyO3.
Installation
CLI (From Source)
The binary will be available at target/release/ply2splat.
Python Package
Install from source using maturin:
Or build a wheel:
Usage
CLI
Python
# Convert a PLY file to SPLAT format
=
# Convert without sorting (faster, but may affect rendering quality)
=
# Load PLY file and access individual splats
=
# Access splats by index
=
=
# Load existing SPLAT file
=
# Get raw bytes for custom processing
=
# Load and convert to bytes (for in-memory processing)
, =
Development
Requirements
- Rust (latest stable)
- Nix (optional, for reproducible environment)
Running Tests
Fuzzing
The crate includes fuzzing targets to ensure stability against malformed inputs.
# Install cargo-fuzz
# Run fuzzing target
Development Environment
This project supports both Nix and Devcontainers for a reproducible development environment.
- Nix:
nix developwill enter a shell with Rust and dependencies configured. - Devcontainer: Open the folder in VS Code and accept the prompt to reopen in container.
License
MIT