curvewalk.lawnmower
curvewalk.lawnmower
lawnmower(index: int, shape: Tuple[int, ...], order: Optional[Tuple[int, ...]] = None) -> Tuple[int, ...]
Returns a position in the lawnmower pattern, given a shape to traverse over. If order is specified, perform the iteration over a different ordering of the axes.
inverse_lawnmower(position: Tuple[int, ...], shape: Tuple[int, ...], order: Optional[Tuple[int, ...]] = None) -> int
Returns the inverse of the lawnmower function, given a position in the walk, returns the index along the walk.