| Crates.io | ply2splat |
| lib.rs | ply2splat |
| version | 0.6.0 |
| created_at | 2025-11-25 21:06:04.855811+00 |
| updated_at | 2026-01-06 18:59:47.020298+00 |
| description | A Rust crate for processing Gaussian Splatting PLY and SPLAT files |
| homepage | |
| repository | https://github.com/bastikohn/ply2splat |
| max_upload_size | |
| id | 1950443 |
| size | 94,950 |
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).
🌐 Try the Web Converter - Convert files directly in your browser!

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)
└── www/
└── ply2splat/ # Web application (React + WASM)
rayon) for conversion and sorting.@ply2splat/native.The easiest way to convert files is using the web application:
🌐 https://bastikohn.github.io/ply2splat/
Features:
Add ply2splat to your Cargo.toml:
[dependencies]
ply2splat = "0.6"
Install the CLI tool directly from crates.io:
cargo install ply2splat
Or build from source:
git clone https://github.com/bastikohn/ply2splat.git
cd ply2splat
cargo build --release
The binary will be available at target/release/ply2splat.
Install from PyPI using uv:
uv pip install ply2splat
Or install from source:
git clone https://github.com/bastikohn/ply2splat.git
cd ply2splat
uv pip install .
Install @ply2splat/native from npm:
npm install @ply2splat/native
This package provides high-performance native bindings for Node.js and falls back to WASM/WASI for supported environments.
ply2splat --input input.ply --output output.splat
If you have uv installed, you can run the CLI directly without explicit installation:
uvx ply2splat --input input.ply --output output.splat
If you have Nix installed:
nix run github:bastikohn/ply2splat -- --input input.ply --output output.splat
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
npx @ply2splat/native --input input.ply --output output.splat
import ply2splat
# Convert a PLY file to SPLAT format
count = ply2splat.convert("input.ply", "output.splat")
print(f"Converted {count} splats")
# Convert without sorting (faster, but may affect rendering quality)
count = ply2splat.convert("input.ply", "output.splat", sort=False)
# Load PLY file and access individual splats
data = ply2splat.load_ply_file("input.ply")
print(f"Loaded {len(data)} splats")
for splat in data:
print(f"Position: {splat.position}")
print(f"Scale: {splat.scale}")
print(f"Color (RGBA): {splat.color}")
print(f"Rotation: {splat.rotation}")
# Access splats by index
first_splat = data[0]
# Load existing SPLAT file
data = ply2splat.load_splat_file("output.splat")
print(f"Loaded {len(data)} splats from SPLAT file")
# Get raw bytes for custom processing
raw_bytes = data.to_bytes()
# Load and convert to bytes (for in-memory processing)
data, count = ply2splat.load_and_convert("input.ply")
print(f"Loaded {count} splats, {len(data)} bytes")
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);
# Test the entire workspace
cargo test --workspace
The crate includes fuzzing targets to ensure stability against malformed inputs.
# Install cargo-fuzz
cargo install cargo-fuzz
# Run fuzzing target
cargo fuzz run fuzz_conversion
This project supports both Nix and Devcontainers for a reproducible development environment.
nix develop will enter a shell with Rust and dependencies configured.MIT