generative-art-0.1.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Geometry.Processes.Penrose

Synopsis

Types

data Tile Source #

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.

Constructors

Tile 

Instances

Instances details
Show Tile Source # 
Instance details

Defined in Geometry.Processes.Penrose

Methods

showsPrec :: Int -> Tile -> ShowS #

show :: Tile -> String #

showList :: [Tile] -> ShowS #

Transform Tile Source # 
Instance details

Defined in Geometry.Processes.Penrose

data TileType Source #

There are two Penrose rhombs: A thick rhomb with an angle of 72°, and a thin rhomb with an angle of 36°.

Constructors

Thin 
Thick 

Instances

Instances details
Show TileType Source # 
Instance details

Defined in Geometry.Processes.Penrose

Eq TileType Source # 
Instance details

Defined in Geometry.Processes.Penrose

twin :: Tile -> Tile Source #

The other half of a half tile.

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 #

A different graphical representation of a tile. The first-generation Penrose tiling (P1) uses four shapes: Pentagon, Star, Boat, and Diamond.

Note that like asPolygon, the resulting polygons are open, so don't use closePath.

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

phi :: Double Source #

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.

alpha :: Angle Source #

36° is the base angle of Penrose tilings.

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

star1 :: 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 :: 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.

decagonRose :: Vec2 -> Double -> [Tile] Source #

A basic Penrose fragment consisting of a star2 and some thin tiles around, forming a decagon.

asymmetricDecagon :: Vec2 -> Double -> [Tile] Source #

Another Penrose fragment.