Hexagonal tiling: Difference between revisions

From LifeWiki
Jump to navigation Jump to search
Line 149: Line 149:
* Layers and depth<ref>https://www.conwaylife.com/forums/viewtopic.php?t=1622&p=81668#p81668</ref>
* Layers and depth<ref>https://www.conwaylife.com/forums/viewtopic.php?t=1622&p=81668#p81668</ref>
* Tilt<ref>https://www.conwaylife.com/forums/viewtopic.php?f=3&t=1622&start=2125#p140232</ref>
* Tilt<ref>https://www.conwaylife.com/forums/viewtopic.php?f=3&t=1622&start=2125#p140232</ref>
LifeViewer's hexagons are also slightly irregular, being taller than they are wide; making these hexagons as regular as possible may be done in a future update.<ref>https://www.conwaylife.com/forums/viewtopic.php?t=1622&p=128760#p128760<ref>
=== Hexagonal pattern editing ===
Pattern editing, being square-grid-based, does not translate perfectly to hexagons, as they only share 180-degree rotation. Horizontal and vertical flipping, while it would be expected to be possible on both grids due to them sharing symmetries, is also complicated by the usual emulation method, as only diagonal flipping is preserved with it (operations which are generally unsupported on their own by most programs and as such must be performed by composing other operations). While not explicitly forbidden, operations such as 90-degree rotations effectively scramble patterns into something different rather than rotate them in a useful way.
Square selections made on a square grid are functionally rhombic on a hexagonal grid. LifeViewer makes this very clear visually, as it does not support selection shapes more suited to a hexagonal grid (although is planned to)<ref name="LVHexRotAndSelect"/> and as such a rhombus shape can be clearly seen when making selections.
https://www.conwaylife.com/forums/viewtopic.php?f=3&t=1622&p=80331#p80331


=== Information below this point to be refactored ===
=== Information below this point to be refactored ===

Revision as of 15:27, 22 January 2022

The hexagonal tiling, hexagonal grid, hexagonal tessellation or hexagonal lattice (Schläfli symbol: {6,3}) is one of the three possible proper Euclidean tilings of 2D space, alongside the square tiling and triangular tiling. It is constructed with three hexagons being placed at each vertex.

While not nearly as heavily investigated as the square tiling, many general-purpose cellular automaton simulation programs support hexagonal tilings to an extent. However, since most of these have a primary focus on square tilings, such support is seldom without flaw.

Coordinates, directions and displacements

While Cartesian coordinates can be used to describe the positions of hexagons, this does not preserve symmetry well, as it effectively treats the hexagonal tiling as a square tiling and fails to consider its unique symmetries. While there exist many coordinate systems which can be used to describe the coordinates of hexagons in a symmetrical way, such as cube coordinates, none seem to be in use in cellular automaton simulation programs.

Orthogonal and diagonal directions

While the existence of distinct orthogonal and diagonal directions on a hexagonal grid is not immediately as obvious as on a square grid, they are distinct and have been defined.[1] The six cells which are directly adjacent to a central cell in the "hexagonal neighbourhood" (see the dedicated neighbourhoods section below) are considered to be orthogonally adjacent to said center cell. The six directions directly between these, which travel directly through hexagon edges, can be said to be the diagonal directions. These satisfy much of the equivalencies expected of diagonal directions.

Neighbourhoods on the hexagonal tiling

Range-1 cases

The most obvious neighbourhood to define on a hexagonal tiling would be the neighbourhood composed of the six cells orthogonally adjacent to a center cell. This neighbourhood, referred to as the hexagonal neighbourhood, is by far the most commonly investigated.

Another simple neighbourhood, called the tripod neighbourhood, can be defined by only considering every second cell adjacent to the central cell.[2] This neighbourhood has an essence of intrinsic chirality; having only half of the rotational symmetry of the usual hexagonal neighbourhood, as well as the fact that cells which are in one cell's tripod neighbourhood not including the original cell in their tripod neighbourhood (as the neighbourhood is only translated, and is never rotated or reflected),[3] imparts rather strange mechanics upon rules which use it.

hexagonal tripod

Higher ranges

It is entirely possible to extend the aforementioned hexagonal and tripod neighbourhoods to higher ranges, such that cells which are not immediately orthogonally or diagonally adjacent to the central cell are also included in the neighbourhood.

The tripod neighbourhood is usually extended simply by continuing in the direction in which each cell in the range-1 tripod neighbourhood points in by one more cell, yielding what is referred to as the tripod neighbourhood of range 2.

There are two immediately obvious ways in which the hexagonal neighbourhood can be extended to a range of 2:

  • by counting all of the cells in the hexagonal neighbourhood of the cells which are in turn already in the hexagonal neighbourhood of a designated central cell, or
  • by counting all of the cells which are at an orthogonal distance 1 or 2 from a central cell.

The former is usually referred to as the hexagonal neighbourhood of range 2. The latter is referred to as the asterisk neighbourhood of range 2,[4] giving a figure which resembles the typographic symbol.

These three methods can be used to generate neighbourhoods of any desired positive integer range, not just 1 or 2. Examples up to a range of 3 can be seen below.

Range \ Type hexagonal neighbourhood asterisk neighbourhood tripod neighbourhood
1
2
3

Symmetries

All of the static and kinetic symmetries which are present on the hexagonal tiling also apply to the triangular tiling.

Static

Isotropic rules on the hexagonal tiling will always confirm to one of 14 different static symmetries. Its sixfold rotational and reflectional symmetry permits asymmetry, twofold cyclic symmetry, threefold cyclic symmetry, sixfold cyclic symmetry, twofold mirror symmetry, fourfold mirror symmetry, sixfold mirror symmetry and twelvefold mirror symmetry, with further variants depending on the positioning of the center of rotation or the positioning and/or rotation of the planes of reflection.

Asymmetry Rotational symmetries
Onefold Twofold Threefold Sixfold
Cell-centered Vertex-centered Cell-centered Vertex-centered
C1 C2_1 C2_4 C3_1 C3_3 C6
Reflectional symmetries Rotational and reflectional symmetries
Twofold Fourfold Sixfold Twelvefold
Diagonal Orthogonal Cell-centered Edge-centered Cell-centered Vertex-centered
Diagonal Orthogonal
D2_x D2_xo D4_x1 D4_x4 D6_1 D6_1o D6_3 D12

Kinetic

In addition to these 14 static symmetries, periodic patterns can also conform to one of many possible distinct kinetic symmetries. 14 of these duplicate the static symmetries above, with the rest arising for periodic patterns which have a mod unequal to their period.

As of January 2022, it appears as though either not all static symmetries on hexagonal grid have been enumerated, or any such enumeration which has happened is not common knowledge.

Emulation on a square grid

As almost all known cellular automata simulation programs use a square grid and Cartesian coordinates, the hexagonal neighbourhood does not arise naturally like the von Neumann and Moore neighbourhoods do. As such, simulating hexagonal rules demands that the hexagonal grid be "emulated" on the square grid.

The following demonstration shows how the range-1 hexagonal neighbourhood can be represented on the square tiling. It resembles a Moore neighbourhood with two opposite diagonal corners removed, resulting in something which resembles a ship. This functionally works identically to a hexagonal neighbourhood, although at the cost of visual distortion and a loss of symmetry.

Emulated hexagonal neighbourhood How the hexagonal neighbourhood is usually emulated on a square tiling True hexagonal neighbourhood

Software support

While most of the commonly used general-purpose cellular automaton simulation programs extend support to hexagonal grids, such support is not perfect. As mentioned previously, since most programs are made to operate on square grids, hexagonal rules are emulated on a square grid, often with certain visual transformations after the fact as to make the hexagonal grid within more apparent. Editing capabilities are also generally of less use, since few programs currently support threefold rotations.

Making the grid appear hexagonal

Golly has two methods to allow for viewing hexagonal-grid patterns more clearly:

  • A specific icon is defined for use with hexagonal rules. When icons are active, each cell is rendered as a slanted hexagon;[5] these hexagons combine to form a distorted hexagonal grid, which makes the roles of each cell slightly clearer, although not perfectly.
  • Desktop distributions of Golly come with hexgrid.lua, a script which can be used to view patterns on a hexagonal grid clearly. However, due to the lack of script support in Golly's mobile versions, this script is not available.

LifeViewer renders the entire grid as a hexagonal grid when a hexagonal rule is in use. This is the default setting for hexagonal rules; it is also possible to switch to an "offset square" grid in which each cell is rendered as a square in a "brick wall" formation. The offset square grid is also used at zoom levels below 4.0, and is less computationally expensive to draw than hexagons. It is not possible to view hexagonal patterns on a square grid; this functionality was removed in 2019,[6] and as such viewing hexagonal patterns on a non-offset square grid requires a dedicated custom rule table or transition map string which emulates the desired hexagonal rule. There are also certain visual effects which are not available for hexagonal grids nor triangular grids:

  • Camera rotation (support is planned for a future build)[7]
  • Layers and depth[8]
  • Tilt[9]

LifeViewer's hexagons are also slightly irregular, being taller than they are wide; making these hexagons as regular as possible may be done in a future update.Cite error: Closing </ref> missing for <ref> tag </references>