ply2splat
A Rust crate and CLI tool for converting Gaussian Splatting .ply files to the .splat format.
Available on crates.io for Rust, PyPI for Python, and npm for JavaScript/TypeScript (Node.js & Web).

Workspace Architecture
This repository is organized as a Cargo workspace:
.
├── crates/
│ ├── ply2splat/ # Core library and CLI tool
│ ├── ply2splat-napi/ # Node.js/WASI bindings via NAPI-RS (@ply2splat/native)
│ ├── ply2splat-python/ # Python bindings via PyO3
│ └── ply2splat-wasm/ # Low-level WASM bindings (wasm-bindgen)
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.
- Node.js & Web Support: High-performance bindings for Node.js (Native) and Web (WASI) via
@ply2splat/native.
Installation
Rust Crate
Add ply2splat to your Cargo.toml:
[]
= "0.5"
CLI
Install the CLI tool directly from crates.io:
Or build from source:
The binary will be available at target/release/ply2splat.
Python Package
Install from PyPI using uv:
Or install from source:
npm Package (Node.js & Web)
Install @ply2splat/native from npm:
This package provides high-performance native bindings for Node.js and falls back to WASM/WASI for supported environments.
Usage
CLI
Standard Installation (Rust)
Run via uvx (Python)
If you have uv installed, you can run the CLI directly without explicit installation:
Run via Nix
If you have Nix installed:
Native CLI via Node.js
You can also run the high-performance Rust CLI directly via Node.js without installing Rust or compiling the binary manually.
# Run directly via npx
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)
, =
JavaScript/TypeScript (Node.js)
import { convert, getSplatCount } from "@ply2splat/native";
import { readFileSync } from "fs";
// Read PLY file into a buffer
const plyBuffer = readFileSync("input.ply");
// Convert to SPLAT format
// Returns { data: Buffer, count: number }
const result = convert(plyBuffer);
console.log(`Converted ${result.count} splats`);
console.log(`Output size: ${result.data.length} bytes`);
// Optionally disable sorting
// const result = convert(plyBuffer, false);
Development
Requirements
- Rust (latest stable)
- Node.js & pnpm (for JS bindings)
- Python & uv (for Python bindings)
Running Tests
# Test the entire workspace
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