Classdesc

The Girih datastructure for generating patterns.

Requires

Vertex

Requires

GirihTile

Requires

GirihBowtie

Requires

GirihDecagon

Requires

GirihHexagon

Requires

GirihPenroseRhombus

Requires

GirihPentagon

Requires

GirihRhombus

Constructors

Properties

TILE_TEMPLATES: GirihTile[]

An array of all available Girih tiles. Use them as templates for copy-and-paste.

Member

Memberof

Girih

Instance

edgeLength: number

The edge length to use in this Girih pattern.

Member

Memberof

Girih

Instance

tiles: GirihTile[]

The actual set of Girih tiles used in this Girih pattern.

Member

Memberof

Girih

Instance

Methods

  • Add a new tile to this Girih pattern.

    Parameters

    • tile: GirihTile

      The tile to add (instance must not already be part of this pattern).

    Returns void

    Name

    addTile

    Memberof

    Girih

    Instance

  • Find all possible adjadent tiles and their locations (type, rotation and offset). The function will return an array of all possible tiles matching at the given tile and edge.

    Parameters

    • tileIndex: number

      The index of the tile to rotate.

    • edgeIndex: number

      The index of the tile's edge.

    Returns GirihTile[]

    • An array of possible adjecent tiles (already positioned and rotated).

    Name

    findPossibleAdjacentTiles

    Memberof

    Girih

    Instance

  • Private

    Initialize the TILE_TEMPLATES array.

    Parameters

    • edgeLength: number

      The edge length to use for the template tiles.

    Returns void

    Name

    initTemplates

    Memberof

    Girih

    Instance

  • Find that tile (index) which contains the given position. First match will be returned.

    Parameters

    Returns number

    The index of the containing tile or -1 if none was found.

    Name

    locateContainingTile

    Memberof

    Girih

    Instance

  • Move that tile the mouse is hovering over. The move amounts are abstract numbers, 1 indicating one unit along each axis.

    Parameters

    • tileIndex: number

      The index of the tile to rotate.

    • moveXAmount: number

      The amount to move along the x axis (in pixels).

    • moveYAmount: number

      The amount to move along the y axis (in pixels).

    Returns void

    Name

    moveTile

    Memberof

    Girih

    Instance

  • Remove the tile at given array position. The index must be inside valid bounds.

    Parameters

    • index: number

      The index in the tiles Array.

    Returns void

    Name

    removeTile

    Memberof

    Girih

    Instance

  • Turn the tile the mouse is hovering over. The turnCount is ab abstract number: -1 for one turn left, +1 for one turn right. The turning angle is defined by the tile with the lowest turn symmetry: the Decagon, so angle is 36°.

    Parameters

    • tileIndex: number

      The index of the tile to rotate.

    • turnCount: number

      A discrete number indicating the number of turn steps.

    Returns void

    Name

    turnTile

    Memberof

    Girih

    Instance

Generated using TypeDoc