path_points

Function
path_points(
    states: list[State],
    points: list[Point2D],
    alignment: ElementAlignment = <ElementAlignment.PRESERVE: 'preserve'>,
    element_rotation_offset: float = 0,
    element_rotation_offset_fn: Optional[Callable[[float], float]] = None,
    smooth: bool = True
) -> list[State]

Arrange states along an arbitrary path defined by points with uniform spacing.

Positions elements at equally spaced arc-length positions along a path that connects the given points, ensuring uniform spacing regardless of segment length. Pads the path with phantom points when smoothing to ensure the full path is used.

Parameters

states
List of states to arrange
points
List of (x, y) tuples defining the path
alignment
How to align each element relative to the path.
element_rotation_offset
Additional rotation in degrees added to the alignment base.
element_rotation_offset_fn
Function that takes position t (0-1) and returns rotation offset.
smooth
If True, use Catmull-Rom spline interpolation for smoother curves.

Returns

New list of states with positions along the path