pyre.geometry.Grid

Module Contents

class pyre.geometry.Grid.Grid(shape=(), packing=ROW_MAJOR, *args, **kwds)

Bases: list

A logically Cartesian grid implemented as a list with a custom indexing function

ROW_MAJOR = row-major
COLUMN_MAJOR = column-major
boundingBox(self)

Compute the bounding box of the grid

__getitem__(self, index)

Support structured access to the cells

columnMajor(self, index)

Convert the {index} into an offset using column-major format

rowMajor(self, index)

Convert the {index} into an offset using row-major format

verify(self)

Run some simple diagnostics

anchors(self)

Compute the grid index of the corner of each cell

describeCellAt(self, anchor)

Build a pair of indices for each coordinate that can be used to visit the corners of a grid cell in counter clockwise fashion

cornersOfCellAt(self, anchor)

Visit the corners of the cell at {anchor} in a counter clockwise fashion