TriangularLattice: A 2D triangulation of a plane

class simplicial.TriangularLattice(r, c)

A triangular simplicial tiling of a plane. Triangular lattices have simplices of order 0, 1, and 2, connecting the 0-simplices very regularly.

Parameters
  • r (int) – the number of rows

  • c (int) – the number of columns

TriangularLattice.rows()

Return the number of rows in the lattice.

Return type

int

Returns

the number of rows

TriangularLattice.columns()

Return the number of columns in the lattice.

Return type

int

Returns

the number of columns

Embedding the lattice

class simplicial.TriangularLatticeEmbedding(c, h=1.0, w=1.0)

A regular embedding of a triangular lattice into a plane. The default is to embed into a unit plane, but this can be scaled as required. The lattice can be distorted by providing explicit positions for 0-simplices as required.

Parameters
  • c (SimplicialComplex) – the complex

  • h (float) – height of the plane (defaults to 1.0)

  • w (float) – width of the plane (defaults to 1.0)

TriangularLatticeEmbedding.height()

Return the height of the lattice.

Return type

float

Returns

the height of the lattice

TriangularLatticeEmbedding.width()

Return the width of the lattice.

Return type

float

Returns

the width of the lattice

The actual embedding divides the plane containing to lattice into roiws and colums, indenting the position of each odd row to form even triangles.

TriangularLatticeEmbedding.computePositionOf(s)

Compute the position of the given simplex.

Parameters

s (Any) – the simplex

Return type

List[float]

Returns

the position of the simplex