Skip to content

YannisDC/SPZKit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SPZKit

A Swift package for loading and saving compressed 3D Gaussian splat files (.spz format).

About

SPZKit is a native Swift implementation of the SPZ file format for 3D Gaussian splats. SPZ files are typically 10x smaller than PLY equivalents with virtually no perceptible loss in visual quality.

Features

  • ✅ Load and save .spz files
  • ✅ Convert between .spz and .ply formats
  • ✅ Automatic coordinate system conversion
  • ✅ Native Swift implementation
  • ✅ iOS and macOS support

Installation

Add SPZKit to your Package.swift:

dependencies: [
    .package(url: "https://github.com/YannisDC/SPZKit.git", from: "1.0.0")
]

Or add it via Xcode: File → Add Package Dependencies...

Usage

Loading an SPZ file

import SPZKit

// Load from file
let gaussians = loadSpz(from: "path/to/file.spz")

// Or load from Data
let data = try Data(contentsOf: url)
let gaussians = loadSpz(data)

Saving an SPZ file

import SPZKit

// Save to file
try saveSpz(gaussians, to: "output.spz")

// Or get as Data
if let data = saveSpz(gaussians) {
    // Use data...
}

Converting to PLY

import SPZKit

// Load SPZ and convert to PLY
let gaussians = loadSpz(from: "input.spz")
try saveSplatToPly(gaussians, to: "output.ply")

Coordinate Systems

SPZKit supports automatic coordinate system conversion:

// Specify coordinate system when loading
let options = UnpackOptions(to: .rdf)  // PLY coordinate system
let gaussians = loadSpz(from: "file.spz", options: options)

// Specify coordinate system when saving
let packOptions = PackOptions(from: .rdf)
try saveSpz(gaussians, to: "output.spz", options: packOptions)

Requirements

  • iOS 13.0+ / macOS 10.15+
  • Swift 6.2+

License

MIT

References

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors