Skip to content

Utilities

rerun.utilities

ColorGrid module-attribute

ColorGrid = namedtuple("ColorGrid", ["positions", "colors"])

ColorSpiral module-attribute

ColorSpiral = namedtuple(
    "ColorSpiral", ["positions", "colors"]
)

color_grid module-attribute

color_grid = build_color_grid()

Default color grid

color_spiral module-attribute

color_spiral = build_color_spiral()

Default color spiral

bounce_lerp

def bounce_lerp(
    a: float, b: float, t: float | ndarray[Any, dtype[Any]]
) -> float | ndarray[Any, dtype[Any]]

A linear interpolator that bounces between a and b as t goes above 1.0.

PARAMETER DESCRIPTION
a

Start value (t == 0).

TYPE: float

b

End value (t == 1).

TYPE: float

t

Interpolation coefficient.

TYPE: float | ndarray[Any, dtype[Any]]

build_color_grid

def build_color_grid(
    x_count: int = 10,
    y_count: int = 10,
    z_count: int = 10,
    *,
    twist: float = 0,
) -> ColorGrid

Create a cube of points with colors.

The total point cloud will have x_count * y_count * z_count points.

PARAMETER DESCRIPTION
x_count

Number of points in each dimension.

TYPE: int DEFAULT: 10

y_count

Number of points in each dimension.

TYPE: int DEFAULT: 10

z_count

Number of points in each dimension.

TYPE: int DEFAULT: 10

twist

Angle to twist from bottom to top of the cube

TYPE: float DEFAULT: 0

build_color_spiral

def build_color_spiral(
    num_points: int = 100,
    *,
    radius: float = 2,
    angular_step: float = 0.02,
    angular_offset: float = 0,
    z_step: float = 0.1,
) -> ColorSpiral

Create a spiral of points with colors along the Z axis.

PARAMETER DESCRIPTION
num_points

Total number of points.

TYPE: int DEFAULT: 100

radius

The radius of the spiral.

TYPE: float DEFAULT: 2

angular_step

The factor applied between each step along the trigonometric circle.

TYPE: float DEFAULT: 0.02

angular_offset

Offsets the starting position on the trigonometric circle.

TYPE: float DEFAULT: 0

z_step

The factor applied between each step along the Z axis.

TYPE: float DEFAULT: 0.1