| Crates.io | spz |
| lib.rs | spz |
| version | 0.0.6 |
| created_at | 2025-12-20 21:57:32.271544+00 |
| updated_at | 2025-12-23 16:13:31.216233+00 |
| description | SPZ file format handling for Rust, and CLI tooling. |
| homepage | https://github.com/Jackneill/spz |
| repository | https://github.com/Jackneill/spz |
| max_upload_size | |
| id | 1997018 |
| size | 120,502 |
SPZ is a compressed file format for 3D Gaussian Splats, designed by Niantic. It provides efficient storage of Gaussian Splat data with configurable spherical harmonics degrees and coordinate system support.
See docs/SPZ.md for more information.
$ path/to/spz info assets/racoonfamily.spz
GaussianSplat={num_points=932560, sh_degree=3, antialiased=true, median_ellipsoid_volume=0.0000000046213082, bbox=[x=-281.779541 to 258.382568, y=-240.000000 to 240.000000, z=-240.000000 to 240.000000]}
spz = { version = "0.0.6", default-features = false, features = [] }
use spz::prelude::*;
cargo run --example load_spz
// SPDX-License-Identifier: Apache-2.0 OR MIT
use std::path::{Path, PathBuf};
use anyhow::Result;
use spz::{GaussianSplat, UnpackOptions};
fn main() -> Result<()> {
let mut sample_spz = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
sample_spz.push("assets/racoonfamily.spz");
let _gs = spz::GaussianSplat::builder()
.filepath(sample_spz)
.packed(true)?
.unpack_options(
UnpackOptions::builder()
.to_coord_system(spz::CoordinateSystem::default())
.build(),
)
.load()?;
Ok(())
}
#[allow(unused)]
async fn load_spz_async<P>(spz_file: P) -> Result<GaussianSplat>
where
P: AsRef<Path>,
{
let gs = spz::GaussianSplat::builder()
.filepath(spz_file)
.packed(true)?
.unpack_options(
UnpackOptions::builder()
.to_coord_system(spz::CoordinateSystem::default())
.build(),
)
.load_async()
.await?;
Ok(gs)
}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct GaussianSplat {
pub num_points: i32,
pub spherical_harmonics_degree: i32,
pub antialiased: bool,
pub positions: Vec<f32>,
pub scales: Vec<f32>,
pub rotations: Vec<f32>,
pub alphas: Vec<f32>,
pub colors: Vec<f32>,
pub spherical_harmonics: Vec<f32>,
}
gnuplot for html reports.nextest runner.just bench
target/criterion/report/index.html.mold linker: https://github.com/rui314/moldnextestTODO.
Further documentation is available under ./docs.
Licensed under either of
SPDX-License-Identifier: Apache-2.0SPDX-License-Identifier: MITUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.