Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Tile = Tile {}
- data TileType
- twin :: Tile -> Tile
- flipTile :: [Tile] -> [Tile]
- asPolygon :: Tile -> Polygon
- inscribedPentagons :: Tile -> [Polygon]
- subdivide :: Tile -> [Tile]
- phi :: Double
- alpha :: Angle
- thinTileBase :: [Tile]
- thickTileBase :: [Tile]
- star1 :: Vec2 -> Double -> [Tile]
- star2 :: Vec2 -> Double -> [Tile]
- decagonRose :: Vec2 -> Double -> [Tile]
- asymmetricDecagon :: Vec2 -> Double -> [Tile]
Types
A rhombic Penrose tile. Strictly speaking, this is half a tile,
because subdividing a full tile will result in half tiles protruding from
the original tile. Subdividing half a tile however will produce half tiles
that exactly cover the original tile. See subdivide
.
There are two Penrose rhombs: A thick rhomb with an angle of 72°, and a thin rhomb with an angle of 36°.
Instances
flipTile :: [Tile] -> [Tile] Source #
Flips a tile: Keeps the same shape, but reverses the orientation. Note that flipping a tile in place will turn a legal configuration to an illegal configuration.
Graphical representations
asPolygon :: Tile -> Polygon Source #
Convert the half tile to a polygon. Note that this should be rendered as
an open polygon (i.e., don't use closePath
).
inscribedPentagons :: Tile -> [Polygon] Source #
Recursive construction
subdivide :: Tile -> [Tile] Source #
Subdivide a Penrose tile into smaller tiles. While it's possible to generate a Penrose tiling iteratively by adding more tiles to the side, the possible configurations are non-local, i.e. adding a particular tile somewhere can prevent adding tiles (while following the tiling rules) somewhere else.
Constructing a Penrose tiling recursively via subdivision on the other hand is much easier, and guarantees to have a tiling that adheres to the tiling rules if you start with a correct tiling.
Penrose patterns
The golden ratio. It occurs quite frequently in Penrose tilings, e.g. the
ratio between the long diagonal and the edge of a thick tile is phi
.
Base tiles
thinTileBase :: [Tile] Source #
A thin tile with edge length 1 (two half tiles)
thickTileBase :: [Tile] Source #
A thick tile with edge length 1 (two half tiles)
Preconfigured tilings
star2 :: Vec2 -> Double -> [Tile] Source #
There are two star configurations, star1
and star2
. Depending on the
orientation of the thick tiles, the pattern grows differently.
star2
is the base for decagonRose
.