Skip to content

centers

centers #

splat_centers — the gaussian centres of trained splats.

So a scene's splat starts from its sessions'.

splat_centers(splats) #

Every gaussian centre and colour of splats.

Raises:

Type Description
ValueError

If every splat is missing.

Source code in capturegraph-recipes/capturegraph_recipes/splats/seeds/centers.py
@cg.pure_function("splats.splat_centers/1")
def splat_centers(splats: cg.Array[Splat]) -> cg.PointCloud:
    """Every gaussian centre and colour of ``splats``.

    Raises:
        ValueError: If every splat is missing.
    """
    present = [splat.centers() for splat in splats if not cg.is_missing(splat)]
    if not present:
        raise ValueError("every splat is missing")
    return cloud(
        "Seeded from splats",
        [positions for positions, _ in present],
        [colors for _, colors in present],
    )