tiles_export – 3D Tiles Writer

3D Tiles (OGC) writer.

save_tileset() accepts:

  • an in-memory GaussianCloud — spatially chunked,

  • a path / URL to an existing tileset.json — streamed and re-chunked,

  • a list[Tile3DContent] — written as-is (one GLB per tile) with each tile’s bounding_volume preserved.

class 3dgs_io.tiles_export.TilesetSaveOptions(chunk_size=10.0, geometric_error=100.0, save_options=<factory>, max_workers=None)

Bases: object

Options for exporting a GaussianCloud as a 3D Tiles tileset.

chunk_size: float = 10.0

Side length of each cubic grid cell. The bounding box is divided into a regular 3D grid where each cell has this edge length. Points that fall into the same cell are written as a single GLB tile.

geometric_error: float = 100.0

Root geometricError written to the tileset. Controls at what screen-space error the viewer decides to load tiles.

save_options: GltfSaveOptions

Options forwarded to save_gltf() for each chunk GLB (e.g. SPZ compression, metadata).

max_workers: int | None = None

Maximum number of threads used to write GLB tiles in parallel. None (the default) lets ThreadPoolExecutor choose automatically based on available CPUs.

3dgs_io.tiles_export.compute_bounding_volume(camera_positions)

Compute an axis-aligned BoundingVolumeBox from camera positions.

Parameters:

camera_positions (ndarray) – (N, 3) array of camera positions used during training.

Return type:

BoundingVolumeBox

Returns:

  • A BoundingVolumeBox whose center is the midpoint and

  • half_axes is a diagonal matrix of per-axis half-extents.

3dgs_io.tiles_export.save_tileset(source, output_dir, options=None, *, root_transform=None, ext_attributes=None)

Write a 3D Tiles tileset from one of several source types.

Parameters:
  • source (GaussianCloud | str | Path | list[Tile3DContent]) –

    • GaussianCloud — split into spatial chunks.

    • str / Path — path or URL to an existing tileset.json to re-chunk (memory-efficient streaming).

    • list[Tile3DContent] — each tile is saved as-is (one GLB per entry) with its bounding_volume written into the child node.

  • output_dir (str | Path) – Directory where tileset.json and GLB files are written. Created if it does not exist.

  • options (Optional[TilesetSaveOptions]) – Export options. See TilesetSaveOptions.

  • root_transform (Optional[ndarray]) – Optional 4×4 column-major ECEF transform written to the root tile. Defaults to identity (omitted from JSON).

Return type:

Path to the generated tileset.json.