spz_io – SPZ / PLY I/O

3dgs_io.spz_io.is_ngsp_stream(data)

True when data starts with the NGSP (SPZ v4+, zstd) magic.

Return type:

bool

3dgs_io.spz_io.append_spz_extension(data, ext_type, payload)

Return data with one extension record appended to its extension zone.

ext_type is the 32-bit SPZ extension type (vendor ID in the high 16 bits, extension ID in the low 16). The record is inserted at the end of the plaintext extension zone and the header’s tocByteOffset / has-extensions flag are updated accordingly.

Return type:

bytes

3dgs_io.spz_io.read_spz_extensions(data)

Parse the extension zone of an NGSP v4+ stream into {type: payload}.

Returns an empty dict when the file carries no extensions. Duplicate types keep the last record, mirroring spz’s own last-wins parsing.

Return type:

dict[int, bytes]

3dgs_io.spz_io.load_spz(path)

Load an SPZ file and return a GaussianCloud.

Coordinates are converted to glTF (RUB) coordinate system.

Return type:

GaussianCloud

3dgs_io.spz_io.save_spz(gc, path)

Save a GaussianCloud to an SPZ file.

Converts from internal glTF (RUB) coordinate system.

Return type:

None

3dgs_io.spz_io.load_spz_world(path)

Load an SPZ whose numeric axes already use the scene’s ENU world frame.

Return type:

GaussianCloud

3dgs_io.spz_io.save_spz_world(gc, path)

Save ENU world-frame values without applying an implicit axis conversion.

Return type:

None

3dgs_io.spz_io.load_spz_world_bytes(data)

Decode an in-memory SPZ stream whose axes are already the world frame.

Return type:

GaussianCloud

3dgs_io.spz_io.save_spz_world_bytes(gc)

Encode gc to an SPZ stream without an implicit axis conversion.

Return type:

bytes

3dgs_io.spz_io.load_ply(path)

Load a PLY file (3DGS training output) and return a GaussianCloud.

Coordinates are converted from COLMAP (RDF) to glTF (RUB) coordinate system.

Return type:

GaussianCloud

3dgs_io.spz_io.save_ply(gc, path)

Save a GaussianCloud to a PLY file.

Converts from internal glTF (RUB) to COLMAP (RDF) coordinate system.

Return type:

None