MyNixOS website logo
Description

Library to explore Penrose's Kite and Dart Tilings.

Library to explore Penrose's Kite and Dart Tilings using Haskell Diagrams. Please see README.md

PenroseKiteDart

Author: Chris Reade

March 2021 - 2024

See LICENSE file

Penrose Kites and Darts

Penrose's kite and dart tiles have the property that they can tile the entire plane aperiodicly. There are rules to ensure legal tilings with the kites and darts. Tilings can still get stuck (so cannot be continued to cover the entire plane) - these are called incorrect.

This package is a Haskell library of tools to build, draw and explore finite tilings with kites and darts, making use of the Haskell Diagrams package.

Using the Package

You will need the Haskell Diagrams package to be installed as well as this package (PenroseKiteDart). (See Haskell Diagrams). Once installed, a Main.hs module to produce diagrams should import a chosen backend for Diagrams such as the default (SVG) along with Diagrams.Prelude

module Main (main) where

import Diagrams.Backend.SVG.CmdLine
import Diagrams.Prelude

plus (for Penrose Kite and Dart tilings)

import PKD

and optionally

import TgraphExamples

Then to ouput someExample figure

fig::Diagram B
fig = someExample

main :: IO ()
main = mainWith fig

When the code is executed it will generate an SVG file. (See the Haskell Diagrams package for more details on producing diagrams.)

Tgraphs to Describe Finite Tilings

Tile Graphs (Tgraphs) use a simple planar graph representation for finite patches of tiles. A Tgraph is made from a list of faces with type TileFace each of which is a half-dart or a half-kite. Each TileFace is thus a triangle with three positive Int vertices and a constructor LD (left dart), RD (right dart), LK (left kite), RK (right kite).

For example a fool consists of two kites and a dart (= 4 half kites and 2 half darts):

fool :: Tgraph
fool = makeTgraph [RD (1,2,3),LD (1,3,4)   -- right and left dart
                  ,LK (5,3,2),RK (5,2,7)   -- left and right kite
                  ,RK (5,4,3),LK (5,6,4)   -- right and left kite
                  ]

The function

makeTgraph :: [TileFace] -> Tgraph

performs checks to make sure the tiling is legal, raising an error if there is a problem. To produce a diagram, we simply draw the Tgraph

foolFigure :: Diagram B
foolFigure = labelled draw fool

Modules

Module PKD is the main module which imports and rexports Tgraphs and TileLib. Tgraphs imports and re-exports the contents of the other Tgraph modules, namely Tgraph.Compose, Tgraph.Decompose, Tgraph.Force, Tgraph.Relabelling, Tgraph.Prelude. TileLib contains underlying drawing tools for tiles. Tgraph.Try is imported and re-exported by Tgraph.Prelude - used for results of partial functions. HalfTile is imported and re-exported by Tgraph.Prelude - (with the constructors LD,RD,LK,RK).

Further Information

A more detailed User Guide for the PenroseKiteDart package can be found at

Metadata

Version

1.0.0

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows