PenroseKiteDart-1.2: 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, getDartWingInfoForced (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) It does not assume the given Tgraph is forced and is inefficient on large Tgraphs

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 does not assume the given Tgraph is forced and can be inefficient on large Tgraphs. 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. It does not assume the given Tgraph is forced and is inefficient on large Tgraphs.

uncheckedCompose :: Tgraph -> Tgraph Source #

This does the same as compose but more efficiently because it assumes the given Tgraph is forced. It uses getDartWingInfoForced and it does not perform checks for connectedness and no crossing boundaries in the result. This relies on a proof that the checks are not needed for forced Tgraphs. (The result is a forced Tgraph.)

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

uncheckedPartCompose g - assumes g is forced. It produces a pair of the remainder faces (faces from g which will not compose) and a Tgraph made from the composed faces without checking for connectedness and no crossing boundaries. This relies on a proof that the result of composing a forced Tgraph does not require these checks.

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

partComposeFaces g - produces a pair of the remainder faces (faces from g which will not compose) and the composed faces (which may or may not constitute faces of a valid Tgraph). It does not assume that g is forced.

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. It does not assume g is forced and is more expensive than getDartWingInfoForced

getDartWingInfoForced :: Tgraph -> DartWingInfo Source #

getDartWingInfoForced g, classifies the dart wings in g and calculates a faceMap for each dart wing, returning as DartWingInfo. It assume g is forced.

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

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