PenroseKiteDart-1.0.0: Library to explore Penrose's Kite and Dart Tilings.
Copyright(c) Chris Reade 2021
LicenseBSD-style
Maintainerchrisreade@mac.com
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

Tgraph.Compose

Description

This module includes the main composition operations compose, partCompose, tryPartCompose but also exposes getDartWingInfo (and type DartWingInfo) and composedFaceGroups for debugging and experimenting.

Synopsis

Documentation

compose :: Tgraph -> Tgraph Source #

The main compose function which simply drops the remainder faces from partCompose to return just the composed Tgraph. It will raise an error if the result is not a valid Tgraph (i.e. if it fails the connectedness, no crossing boundary check)

partCompose :: Tgraph -> ([TileFace], Tgraph) Source #

partCompose g produces a pair consisting of remainder faces (faces from g which will not compose) and a composed Tgraph. It checks the composed Tgraph for connectedness and no crossing boundaries raising an error if this check fails.

tryPartCompose :: Tgraph -> Try ([TileFace], Tgraph) Source #

tryPartCompose g tries to produce a Tgraph by composing faces which uniquely compose in g, It checks the resulting new faces for connectedness and no crossing boundaries. If the check is OK it produces Right (remainder, g') where g' is the composed Tgraph and remainder is a list of faces from g which will not compose. If the check fails it produces Left s where s is a failure report.

uncheckedCompose :: Tgraph -> Tgraph Source #

This does the same as compose but without checks for connectedness and no crossing boundaries in the result. It is intended for use on forced Tgraphs where we have a proof that the checks are not needed.

uncheckedPartCompose :: Tgraph -> ([TileFace], Tgraph) Source #

uncheckedPartCompose g produces a pair of the remainder faces (faces from g which will not compose) and a Tgraph made from the composed faces without checking that the Tgraph is valid. I.e. it does NOT check the composition Tgraph for connectedness and no crossing boundaries. This is intended for use when we know the check is not needed (e.g. when g is forced).

partComposeFaces :: Tgraph -> ([TileFace], [TileFace]) Source #

partComposeFaces produces a pair of the remainder faces (faces from the original which will not compose) and the composed faces (which may or may not constitute faces of a valid Tgraph).

composedFaces :: Tgraph -> [TileFace] Source #

composedFaces g produces the composed faces of g (which may or may not constitute faces of a valid Tgraph).

data DartWingInfo Source #

DartWingInfo is a record type for the result of classifying dart wings in a Tgraph. It includes a faceMap from dart wings to faces at that vertex.

Instances

Instances details
Show DartWingInfo Source # 
Instance details

Defined in Tgraph.Compose

getDartWingInfo :: Tgraph -> DartWingInfo Source #

getDartWingInfo g, classifies the dart wings in g and calculates a faceMap for each dart wing, returning as DartWingInfo.

composedFaceGroups :: DartWingInfo -> [(TileFace, [TileFace])] Source #

Auxiliary function for uncheckedPartCompose. Creates a list of new composed faces, each paired with a list of old faces (components of the new face) using dart wing information.