{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}
module TgraphExamples
(
padBorder
, chunks
, arrangeRowsGap
, arrangeRows
, labelAt
, sunGraph
, jackGraph
, kingGraph
, queenGraph
, aceGraph
, deuceGraph
, starGraph
, kiteGraph
, dartGraph
, fool
, foolD
, foolDminus
, foolDs
, sunDs
, kiteDs
, dartDs
, dartD4
, sun3Dart
, foolFig
, foolAndFoolD
, figSunD3D2
, vertexTypesFig
, forceVFigures
, pCompFig1
, pCompFig2
, pCompFig
, forceFoolDminus
, forceDartD5Fig
, forceKiteD5Fig
, forceSunD5Fig
, forceFig
, brokenDart
, badlyBrokenDart
, brokenDartFig
, badlyBrokenDartFig
, removeIncompletesFig
, mistake
, mistake1
, superForceFig
, superForceRocketsFig
, boundaryFDart4
, boundaryFDart5
, boundaryFDart4Fig
, boundaryFDart5Fig
, boundaryGapFDart4
, boundaryGapFDart5
, boundaryGap4Fig
, boundaryGap5Fig
, boundaryVCoveringFigs
, boundaryECoveringFigs
, kingECoveringFig
, kingVCoveringFig
, kingEmpiresFig
, kingEmpire1Fig
, kingEmpire2Fig
, emplaceChoices
, emplaceChoicesFig
) where
import Diagrams.Prelude
import PKD
import Tgraph.Prelude as NoWarn (makeUncheckedTgraph)
import Data.List (intersect,find)
padBorder :: OKBackend b =>
Diagram b -> Diagram b
padBorder :: forall b. OKBackend b => Diagram b -> Diagram b
padBorder = Double -> QDiagram b V2 Double Any -> QDiagram b V2 Double Any
forall (v :: * -> *) n m b.
(Metric v, OrderedField n, Monoid' m) =>
n -> QDiagram b v n m -> QDiagram b v n m
pad Double
1.2 (QDiagram b V2 Double Any -> QDiagram b V2 Double Any)
-> (QDiagram b V2 Double Any -> QDiagram b V2 Double Any)
-> QDiagram b V2 Double Any
-> QDiagram b V2 Double Any
forall b c a. (b -> c) -> (a -> b) -> a -> c
. QDiagram b V2 Double Any -> QDiagram b V2 Double Any
forall (v :: * -> *) n a.
(InSpace v n a, R2 v, Fractional n, Alignable a, HasOrigin a) =>
a -> a
centerXY
chunks::Int -> [a] -> [[a]]
chunks :: forall a. Vertex -> [a] -> [[a]]
chunks Vertex
n
| Vertex
n Vertex -> Vertex -> Bool
forall a. Ord a => a -> a -> Bool
< Vertex
1 = [Char] -> [a] -> [[a]]
forall a. HasCallStack => [Char] -> a
error [Char]
"chunks: argument <1\n"
| Bool
otherwise = [a] -> [[a]]
ch where
ch :: [a] -> [[a]]
ch [] = []
ch [a]
as = Vertex -> [a] -> [a]
forall a. Vertex -> [a] -> [a]
take Vertex
n [a]
as [a] -> [[a]] -> [[a]]
forall a. a -> [a] -> [a]
: [a] -> [[a]]
ch (Vertex -> [a] -> [a]
forall a. Vertex -> [a] -> [a]
drop Vertex
n [a]
as)
arrangeRowsGap :: OKBackend b =>
Double -> Int -> [Diagram b] -> Diagram b
arrangeRowsGap :: forall b.
OKBackend b =>
Double -> Vertex -> [Diagram b] -> Diagram b
arrangeRowsGap Double
s Vertex
n = QDiagram b V2 Double Any -> QDiagram b V2 Double Any
forall (v :: * -> *) n a.
(InSpace v n a, R2 v, Fractional n, Alignable a, HasOrigin a) =>
a -> a
centerY (QDiagram b V2 Double Any -> QDiagram b V2 Double Any)
-> ([QDiagram b V2 Double Any] -> QDiagram b V2 Double Any)
-> [QDiagram b V2 Double Any]
-> QDiagram b V2 Double Any
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Double -> [QDiagram b V2 Double Any] -> QDiagram b V2 Double Any
forall n a.
(InSpace V2 n a, Floating n, Juxtaposable a, HasOrigin a,
Monoid' a) =>
n -> [a] -> a
vsep Double
s ([QDiagram b V2 Double Any] -> QDiagram b V2 Double Any)
-> ([QDiagram b V2 Double Any] -> [QDiagram b V2 Double Any])
-> [QDiagram b V2 Double Any]
-> QDiagram b V2 Double Any
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([QDiagram b V2 Double Any] -> QDiagram b V2 Double Any)
-> [[QDiagram b V2 Double Any]] -> [QDiagram b V2 Double Any]
forall a b. (a -> b) -> [a] -> [b]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (QDiagram b V2 Double Any -> QDiagram b V2 Double Any
forall (v :: * -> *) n a.
(InSpace v n a, R1 v, Fractional n, Alignable a, HasOrigin a) =>
a -> a
centerX (QDiagram b V2 Double Any -> QDiagram b V2 Double Any)
-> ([QDiagram b V2 Double Any] -> QDiagram b V2 Double Any)
-> [QDiagram b V2 Double Any]
-> QDiagram b V2 Double Any
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Double -> [QDiagram b V2 Double Any] -> QDiagram b V2 Double Any
forall n a.
(InSpace V2 n a, Floating n, Juxtaposable a, HasOrigin a,
Monoid' a) =>
n -> [a] -> a
hsep Double
s) ([[QDiagram b V2 Double Any]] -> [QDiagram b V2 Double Any])
-> ([QDiagram b V2 Double Any] -> [[QDiagram b V2 Double Any]])
-> [QDiagram b V2 Double Any]
-> [QDiagram b V2 Double Any]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Vertex
-> [QDiagram b V2 Double Any] -> [[QDiagram b V2 Double Any]]
forall a. Vertex -> [a] -> [[a]]
chunks Vertex
n
arrangeRows :: OKBackend b =>
Int -> [Diagram b] -> Diagram b
arrangeRows :: forall b. OKBackend b => Vertex -> [Diagram b] -> Diagram b
arrangeRows = Double
-> Vertex
-> [QDiagram b (V b) (N b) Any]
-> QDiagram b (V b) (N b) Any
forall b.
OKBackend b =>
Double -> Vertex -> [Diagram b] -> Diagram b
arrangeRowsGap Double
1.0
labelAt :: OKBackend b =>
Point V2 Double -> String -> Diagram b -> Diagram b
labelAt :: forall b.
OKBackend b =>
Point V2 Double -> [Char] -> Diagram b -> Diagram b
labelAt Point V2 Double
p [Char]
l Diagram b
d = [Char] -> QDiagram b V2 Double Any
forall n b.
(TypeableFloat n, Renderable (Text n) b) =>
[Char] -> QDiagram b V2 n Any
baselineText [Char]
l QDiagram b V2 Double Any
-> (QDiagram b V2 Double Any -> QDiagram b V2 Double Any)
-> QDiagram b V2 Double Any
forall a b. a -> (a -> b) -> b
# Measure Double
-> QDiagram b V2 Double Any -> QDiagram b V2 Double Any
forall a n.
(N a ~ n, Typeable n, HasStyle a) =>
Measure n -> a -> a
fontSize (Double -> Measure Double
forall n. n -> Measure n
output Double
15) QDiagram b V2 Double Any
-> (QDiagram b V2 Double Any -> QDiagram b V2 Double Any)
-> QDiagram b V2 Double Any
forall a b. a -> (a -> b) -> b
# Point V2 Double
-> QDiagram b V2 Double Any -> QDiagram b V2 Double Any
forall (v :: * -> *) n t.
(InSpace v n t, HasOrigin t) =>
Point v n -> t -> t
moveTo Point V2 Double
p QDiagram b V2 Double Any
-> QDiagram b V2 Double Any -> QDiagram b V2 Double Any
forall a. Semigroup a => a -> a -> a
<> Diagram b
QDiagram b V2 Double Any
d
fool, foolD, foolDminus:: Tgraph
fool :: Tgraph
fool = [TileFace] -> Tgraph
makeTgraph [(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RK (Vertex
5,Vertex
2,Vertex
7),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LK (Vertex
5,Vertex
6,Vertex
4),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RK (Vertex
5,Vertex
4,Vertex
3),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LK (Vertex
5,Vertex
3,Vertex
2),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RD (Vertex
1,Vertex
2,Vertex
3),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LD (Vertex
1,Vertex
3,Vertex
4)]
foolD :: Tgraph
foolD = Tgraph -> Tgraph
decompose Tgraph
fool
foolDminus :: Tgraph
foolDminus = [TileFace] -> Tgraph -> Tgraph
removeFaces [(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RD (Vertex
5,Vertex
15,Vertex
13), (Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LD (Vertex
5,Vertex
16,Vertex
15), (Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RK (Vertex
7,Vertex
11,Vertex
2)] Tgraph
foolD
foolDs :: [Tgraph]
foolDs :: [Tgraph]
foolDs = Tgraph -> [Tgraph]
decompositions Tgraph
fool
foolFig :: OKBackend b => Diagram b
foolFig :: forall b. OKBackend b => Diagram b
foolFig = QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any
forall b. OKBackend b => Diagram b -> Diagram b
padBorder (QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any)
-> QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any
forall a b. (a -> b) -> a -> b
$ Measure Double
-> (Patch -> QDiagram b (V b) (N b) Any)
-> Tgraph
-> QDiagram b (V b) (N b) Any
forall b a.
(OKBackend b, DrawableLabelled a) =>
Measure Double -> (Patch -> Diagram b) -> a -> Diagram b
labelSize Measure Double
forall n. OrderedField n => Measure n
normal Patch -> QDiagram b (V b) (N b) Any
forall a b. (Drawable a, OKBackend b) => a -> Diagram b
drawj Tgraph
fool
foolAndFoolD :: OKBackend b => Diagram b
foolAndFoolD :: forall b. OKBackend b => Diagram b
foolAndFoolD = QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any
forall b. OKBackend b => Diagram b -> Diagram b
padBorder (QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any)
-> QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any
forall a b. (a -> b) -> a -> b
$ Double -> [QDiagram b V2 Double Any] -> QDiagram b V2 Double Any
forall n a.
(InSpace V2 n a, Floating n, Juxtaposable a, HasOrigin a,
Monoid' a) =>
n -> [a] -> a
hsep Double
1 [Double -> QDiagram b V2 Double Any -> QDiagram b V2 Double Any
forall (v :: * -> *) n a.
(InSpace v n a, Eq n, Fractional n, Transformable a) =>
n -> a -> a
scale Double
phi (QDiagram b V2 Double Any -> QDiagram b V2 Double Any)
-> QDiagram b V2 Double Any -> QDiagram b V2 Double Any
forall a b. (a -> b) -> a -> b
$ (Patch -> QDiagram b (V b) (N b) Any)
-> Tgraph -> QDiagram b (V b) (N b) Any
forall b a.
(OKBackend b, DrawableLabelled a) =>
(Patch -> Diagram b) -> a -> Diagram b
labelled Patch -> QDiagram b (V b) (N b) Any
forall a b. (Drawable a, OKBackend b) => a -> Diagram b
drawj Tgraph
fool, (Patch -> QDiagram b (V b) (N b) Any)
-> Tgraph -> QDiagram b (V b) (N b) Any
forall b a.
(OKBackend b, DrawableLabelled a) =>
(Patch -> Diagram b) -> a -> Diagram b
labelled Patch -> QDiagram b (V b) (N b) Any
forall a b. (Drawable a, OKBackend b) => a -> Diagram b
drawj Tgraph
foolD]
sunGraph :: Tgraph
sunGraph :: Tgraph
sunGraph = [TileFace] -> Tgraph
makeTgraph
[ (Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RK (Vertex
1,Vertex
2,Vertex
11), (Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LK (Vertex
1,Vertex
3,Vertex
2)
, (Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RK (Vertex
1,Vertex
4,Vertex
3) , (Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LK (Vertex
1,Vertex
5,Vertex
4)
, (Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RK (Vertex
1,Vertex
6,Vertex
5) , (Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LK (Vertex
1,Vertex
7,Vertex
6)
, (Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RK (Vertex
1,Vertex
8,Vertex
7) , (Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LK (Vertex
1,Vertex
9,Vertex
8)
, (Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RK (Vertex
1,Vertex
10,Vertex
9), (Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LK (Vertex
1,Vertex
11,Vertex
10)
]
sunDs :: [Tgraph]
sunDs :: [Tgraph]
sunDs = Tgraph -> [Tgraph]
decompositions Tgraph
sunGraph
figSunD3D2 :: OKBackend b => Diagram b
figSunD3D2 :: forall b. OKBackend b => Diagram b
figSunD3D2 = QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any
forall b. OKBackend b => Diagram b -> Diagram b
padBorder (QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any)
-> QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any
forall a b. (a -> b) -> a -> b
$ Double -> [QDiagram b V2 Double Any] -> QDiagram b V2 Double Any
forall n a.
(InSpace V2 n a, Floating n, Juxtaposable a, HasOrigin a,
Monoid' a) =>
n -> [a] -> a
hsep Double
1 [(Patch -> QDiagram b (V b) (N b) Any)
-> Tgraph -> QDiagram b (V b) (N b) Any
forall b a.
(OKBackend b, DrawableLabelled a) =>
(Patch -> Diagram b) -> a -> Diagram b
labelled Patch -> QDiagram b (V b) (N b) Any
forall a b. (Drawable a, OKBackend b) => a -> Diagram b
drawj (Tgraph -> QDiagram b (V b) (N b) Any)
-> Tgraph -> QDiagram b (V b) (N b) Any
forall a b. (a -> b) -> a -> b
$ [Tgraph]
sunDs [Tgraph] -> Vertex -> Tgraph
forall a. HasCallStack => [a] -> Vertex -> a
!! Vertex
3, Double -> QDiagram b V2 Double Any -> QDiagram b V2 Double Any
forall (v :: * -> *) n a.
(InSpace v n a, Eq n, Fractional n, Transformable a) =>
n -> a -> a
scale Double
phi (QDiagram b V2 Double Any -> QDiagram b V2 Double Any)
-> QDiagram b V2 Double Any -> QDiagram b V2 Double Any
forall a b. (a -> b) -> a -> b
$ (Patch -> QDiagram b (V b) (N b) Any)
-> Tgraph -> QDiagram b (V b) (N b) Any
forall b a.
(OKBackend b, DrawableLabelled a) =>
(Patch -> Diagram b) -> a -> Diagram b
labelled Patch -> QDiagram b (V b) (N b) Any
forall a b. (Drawable a, OKBackend b) => a -> Diagram b
drawj (Tgraph -> QDiagram b (V b) (N b) Any)
-> Tgraph -> QDiagram b (V b) (N b) Any
forall a b. (a -> b) -> a -> b
$ [Tgraph]
sunDs [Tgraph] -> Vertex -> Tgraph
forall a. HasCallStack => [a] -> Vertex -> a
!! Vertex
2]
kiteGraph :: Tgraph
kiteGraph :: Tgraph
kiteGraph = [TileFace] -> Tgraph
makeTgraph [ (Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RK (Vertex
1,Vertex
2,Vertex
4), (Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LK (Vertex
1,Vertex
3,Vertex
2)]
kiteDs :: [Tgraph]
kiteDs :: [Tgraph]
kiteDs = Tgraph -> [Tgraph]
decompositions Tgraph
kiteGraph
dartGraph :: Tgraph
dartGraph :: Tgraph
dartGraph = [TileFace] -> Tgraph
makeTgraph [ (Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RD (Vertex
1,Vertex
2,Vertex
3), (Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LD (Vertex
1,Vertex
3,Vertex
4)]
dartDs :: [Tgraph]
dartDs :: [Tgraph]
dartDs = Tgraph -> [Tgraph]
decompositions Tgraph
dartGraph
dartD4 :: Tgraph
dartD4 :: Tgraph
dartD4 = [Tgraph]
dartDs[Tgraph] -> Vertex -> Tgraph
forall a. HasCallStack => [a] -> Vertex -> a
!!Vertex
4
pCompFig1,pCompFig2,pCompFig :: OKBackend b => Diagram b
pCompFig1 :: forall b. OKBackend b => Diagram b
pCompFig1 = Measure Double -> Diagram b -> Diagram b
forall a n.
(N a ~ n, HasStyle a, Typeable n) =>
Measure n -> a -> a
lw Measure Double
forall n. OrderedField n => Measure n
veryThin (Diagram b -> Diagram b) -> Diagram b -> Diagram b
forall a b. (a -> b) -> a -> b
$ Double -> [Diagram b] -> Diagram b
forall n a.
(InSpace V2 n a, Floating n, Juxtaposable a, HasOrigin a,
Monoid' a) =>
n -> [a] -> a
hsep Double
5 ([Diagram b] -> Diagram b) -> [Diagram b] -> Diagram b
forall a b. (a -> b) -> a -> b
$ [Vertex]
-> [QDiagram b V2 Double Any] -> [QDiagram b V2 Double Any]
forall a.
(Transformable a, V a ~ V2, N a ~ Double) =>
[Vertex] -> [a] -> [a]
rotations [Vertex
1,Vertex
1] [Tgraph -> Diagram b
forall a b. (Drawable a, OKBackend b) => a -> Diagram b
draw Tgraph
fd3, Tgraph -> Diagram b
forall b. OKBackend b => Tgraph -> Diagram b
drawPCompose Tgraph
fd3]
where fd3 :: Tgraph
fd3 = Tgraph -> Tgraph
forall a. Forcible a => a -> a
force (Tgraph -> Tgraph) -> Tgraph -> Tgraph
forall a b. (a -> b) -> a -> b
$ [Tgraph]
dartDs[Tgraph] -> Vertex -> Tgraph
forall a. HasCallStack => [a] -> Vertex -> a
!!Vertex
3
pCompFig2 :: forall b. OKBackend b => Diagram b
pCompFig2 = Measure Double -> Diagram b -> Diagram b
forall a n.
(N a ~ n, HasStyle a, Typeable n) =>
Measure n -> a -> a
lw Measure Double
forall n. OrderedField n => Measure n
veryThin (Diagram b -> Diagram b) -> Diagram b -> Diagram b
forall a b. (a -> b) -> a -> b
$ Double -> [QDiagram b V2 Double Any] -> QDiagram b V2 Double Any
forall n a.
(InSpace V2 n a, Floating n, Juxtaposable a, HasOrigin a,
Monoid' a) =>
n -> [a] -> a
hsep Double
5 [Tgraph -> Diagram b
forall a b. (Drawable a, OKBackend b) => a -> Diagram b
draw Tgraph
fk3, Tgraph -> Diagram b
forall b. OKBackend b => Tgraph -> Diagram b
drawPCompose Tgraph
fk3]
where fk3 :: Tgraph
fk3 = Tgraph -> Tgraph
forall a. Forcible a => a -> a
force (Tgraph -> Tgraph) -> Tgraph -> Tgraph
forall a b. (a -> b) -> a -> b
$ [Tgraph]
kiteDs[Tgraph] -> Vertex -> Tgraph
forall a. HasCallStack => [a] -> Vertex -> a
!!Vertex
3
pCompFig :: forall b. OKBackend b => Diagram b
pCompFig = QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any
forall b. OKBackend b => Diagram b -> Diagram b
padBorder (QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any)
-> QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any
forall a b. (a -> b) -> a -> b
$ Double -> [QDiagram b V2 Double Any] -> QDiagram b V2 Double Any
forall n a.
(InSpace V2 n a, Floating n, Juxtaposable a, HasOrigin a,
Monoid' a) =>
n -> [a] -> a
vsep Double
3 [QDiagram b V2 Double Any -> QDiagram b V2 Double Any
forall (v :: * -> *) n a.
(InSpace v n a, Fractional n, Traversable v, Alignable a,
HasOrigin a) =>
a -> a
center QDiagram b (V b) (N b) Any
QDiagram b V2 Double Any
forall b. OKBackend b => Diagram b
pCompFig1, QDiagram b V2 Double Any -> QDiagram b V2 Double Any
forall (v :: * -> *) n a.
(InSpace v n a, Fractional n, Traversable v, Alignable a,
HasOrigin a) =>
a -> a
center QDiagram b (V b) (N b) Any
QDiagram b V2 Double Any
forall b. OKBackend b => Diagram b
pCompFig2]
forceFoolDminus :: OKBackend b => Diagram b
forceFoolDminus :: forall b. OKBackend b => Diagram b
forceFoolDminus = Diagram b -> Diagram b
forall b. OKBackend b => Diagram b -> Diagram b
padBorder (Diagram b -> Diagram b) -> Diagram b -> Diagram b
forall a b. (a -> b) -> a -> b
$ Double -> [Diagram b] -> Diagram b
forall n a.
(InSpace V2 n a, Floating n, Juxtaposable a, HasOrigin a,
Monoid' a) =>
n -> [a] -> a
hsep Double
1 ([Diagram b] -> Diagram b) -> [Diagram b] -> Diagram b
forall a b. (a -> b) -> a -> b
$ (Tgraph -> QDiagram b V2 Double Any)
-> [Tgraph] -> [QDiagram b V2 Double Any]
forall a b. (a -> b) -> [a] -> [b]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Patch -> Diagram b) -> Tgraph -> Diagram b
forall b a.
(OKBackend b, DrawableLabelled a) =>
(Patch -> Diagram b) -> a -> Diagram b
labelled Patch -> Diagram b
forall a b. (Drawable a, OKBackend b) => a -> Diagram b
drawj) [Tgraph
foolDminus, Tgraph -> Tgraph
forall a. Forcible a => a -> a
force Tgraph
foolDminus]
forceDartD5Fig,forceKiteD5Fig,forceSunD5Fig,forceFig :: OKBackend b => Diagram b
forceDartD5Fig :: forall b. OKBackend b => Diagram b
forceDartD5Fig = Diagram b -> Diagram b
forall b. OKBackend b => Diagram b -> Diagram b
padBorder (Diagram b -> Diagram b) -> Diagram b -> Diagram b
forall a b. (a -> b) -> a -> b
$ Measure Double -> Diagram b -> Diagram b
forall a n.
(N a ~ n, HasStyle a, Typeable n) =>
Measure n -> a -> a
lw Measure Double
forall n. OrderedField n => Measure n
ultraThin (Diagram b -> Diagram b) -> Diagram b -> Diagram b
forall a b. (a -> b) -> a -> b
$ Tgraph -> Diagram b
forall b. OKBackend b => Tgraph -> Diagram b
drawForce (Tgraph -> Diagram b) -> Tgraph -> Diagram b
forall a b. (a -> b) -> a -> b
$ [Tgraph]
dartDs [Tgraph] -> Vertex -> Tgraph
forall a. HasCallStack => [a] -> Vertex -> a
!! Vertex
5
forceKiteD5Fig :: forall b. OKBackend b => Diagram b
forceKiteD5Fig = Diagram b -> Diagram b
forall b. OKBackend b => Diagram b -> Diagram b
padBorder (Diagram b -> Diagram b) -> Diagram b -> Diagram b
forall a b. (a -> b) -> a -> b
$ Measure Double -> Diagram b -> Diagram b
forall a n.
(N a ~ n, HasStyle a, Typeable n) =>
Measure n -> a -> a
lw Measure Double
forall n. OrderedField n => Measure n
ultraThin (Diagram b -> Diagram b) -> Diagram b -> Diagram b
forall a b. (a -> b) -> a -> b
$ Angle Double -> Diagram b -> Diagram b
forall n t.
(InSpace V2 n t, Transformable t, Floating n) =>
Angle n -> t -> t
rotate (Vertex -> Angle Double
ttangle Vertex
1) (Diagram b -> Diagram b) -> Diagram b -> Diagram b
forall a b. (a -> b) -> a -> b
$ Tgraph -> Diagram b
forall b. OKBackend b => Tgraph -> Diagram b
drawForce (Tgraph -> Diagram b) -> Tgraph -> Diagram b
forall a b. (a -> b) -> a -> b
$ [Tgraph]
kiteDs[Tgraph] -> Vertex -> Tgraph
forall a. HasCallStack => [a] -> Vertex -> a
!!Vertex
5
forceSunD5Fig :: forall b. OKBackend b => Diagram b
forceSunD5Fig = Diagram b -> Diagram b
forall b. OKBackend b => Diagram b -> Diagram b
padBorder (Diagram b -> Diagram b) -> Diagram b -> Diagram b
forall a b. (a -> b) -> a -> b
$ Measure Double -> Diagram b -> Diagram b
forall a n.
(N a ~ n, HasStyle a, Typeable n) =>
Measure n -> a -> a
lw Measure Double
forall n. OrderedField n => Measure n
ultraThin (Diagram b -> Diagram b) -> Diagram b -> Diagram b
forall a b. (a -> b) -> a -> b
$ Tgraph -> Diagram b
forall b. OKBackend b => Tgraph -> Diagram b
drawForce (Tgraph -> Diagram b) -> Tgraph -> Diagram b
forall a b. (a -> b) -> a -> b
$ [Tgraph]
sunDs [Tgraph] -> Vertex -> Tgraph
forall a. HasCallStack => [a] -> Vertex -> a
!! Vertex
5
forceFig :: forall b. OKBackend b => Diagram b
forceFig = Double -> [QDiagram b V2 Double Any] -> QDiagram b V2 Double Any
forall n a.
(InSpace V2 n a, Floating n, Juxtaposable a, HasOrigin a,
Monoid' a) =>
n -> [a] -> a
hsep Double
1 [QDiagram b (V b) (N b) Any
QDiagram b V2 Double Any
forall b. OKBackend b => Diagram b
forceDartD5Fig,QDiagram b (V b) (N b) Any
QDiagram b V2 Double Any
forall b. OKBackend b => Diagram b
forceKiteD5Fig]
brokenDart :: Tgraph
brokenDart :: Tgraph
brokenDart = [TileFace] -> Tgraph -> Tgraph
removeFaces [TileFace]
forall {a} {b} {c}. (Num a, Num b, Num c) => [HalfTile (a, b, c)]
deleted Tgraph
dartD4 where
deleted :: [HalfTile (a, b, c)]
deleted = [(a, b, c) -> HalfTile (a, b, c)
forall rep. rep -> HalfTile rep
RK (a
2,b
16,c
33),(a, b, c) -> HalfTile (a, b, c)
forall rep. rep -> HalfTile rep
LD (a
15,b
33,c
16),(a, b, c) -> HalfTile (a, b, c)
forall rep. rep -> HalfTile rep
RK (a
16,b
66,c
15),(a, b, c) -> HalfTile (a, b, c)
forall rep. rep -> HalfTile rep
LK (a
16,b
67,c
66),(a, b, c) -> HalfTile (a, b, c)
forall rep. rep -> HalfTile rep
LK (a
5,b
15,c
66)]
badlyBrokenDart :: Tgraph
badlyBrokenDart :: Tgraph
badlyBrokenDart = [TileFace] -> Tgraph -> Tgraph
removeFaces [TileFace]
forall {a} {b} {c}. (Num a, Num b, Num c) => [HalfTile (a, b, c)]
deleted Tgraph
bbd where
deleted :: [HalfTile (a, b, c)]
deleted = [(a, b, c) -> HalfTile (a, b, c)
forall rep. rep -> HalfTile rep
RK (a
6,b
28,c
54)]
bbd :: Tgraph
bbd = [Vertex] -> Tgraph -> Tgraph
removeVertices [Vertex
63,Vertex
37] Tgraph
brokenDart
brokenDartFig :: OKBackend b => Diagram b
brokenDartFig :: forall b. OKBackend b => Diagram b
brokenDartFig = Diagram b -> Diagram b
forall b. OKBackend b => Diagram b -> Diagram b
padBorder (Diagram b -> Diagram b) -> Diagram b -> Diagram b
forall a b. (a -> b) -> a -> b
$ Measure Double -> Diagram b -> Diagram b
forall a n.
(N a ~ n, HasStyle a, Typeable n) =>
Measure n -> a -> a
lw Measure Double
forall n. OrderedField n => Measure n
thin (Diagram b -> Diagram b) -> Diagram b -> Diagram b
forall a b. (a -> b) -> a -> b
$ Double -> [Diagram b] -> Diagram b
forall n a.
(InSpace V2 n a, Floating n, Juxtaposable a, HasOrigin a,
Monoid' a) =>
n -> [a] -> a
hsep Double
1 ([Diagram b] -> Diagram b) -> [Diagram b] -> Diagram b
forall a b. (a -> b) -> a -> b
$ (Tgraph -> QDiagram b V2 Double Any)
-> [Tgraph] -> [QDiagram b V2 Double Any]
forall a b. (a -> b) -> [a] -> [b]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Patch -> Diagram b) -> Tgraph -> Diagram b
forall b a.
(OKBackend b, DrawableLabelled a) =>
(Patch -> Diagram b) -> a -> Diagram b
labelled Patch -> Diagram b
forall a b. (Drawable a, OKBackend b) => a -> Diagram b
drawj) [Tgraph
dartD4, Tgraph
brokenDart, Tgraph
badlyBrokenDart]
badlyBrokenDartFig :: OKBackend b => Diagram b
badlyBrokenDartFig :: forall b. OKBackend b => Diagram b
badlyBrokenDartFig = Diagram b -> Diagram b
forall b. OKBackend b => Diagram b -> Diagram b
padBorder (Diagram b -> Diagram b) -> Diagram b -> Diagram b
forall a b. (a -> b) -> a -> b
$ Measure Double -> Diagram b -> Diagram b
forall a n.
(N a ~ n, HasStyle a, Typeable n) =>
Measure n -> a -> a
lw Measure Double
forall n. OrderedField n => Measure n
thin (Diagram b -> Diagram b) -> Diagram b -> Diagram b
forall a b. (a -> b) -> a -> b
$ Double -> [Diagram b] -> Diagram b
forall n a.
(InSpace V2 n a, Floating n, Juxtaposable a, HasOrigin a,
Monoid' a) =>
n -> [a] -> a
hsep Double
1 ([Diagram b] -> Diagram b) -> [Diagram b] -> Diagram b
forall a b. (a -> b) -> a -> b
$ (VPatch -> QDiagram b V2 Double Any)
-> [VPatch] -> [QDiagram b V2 Double Any]
forall a b. (a -> b) -> [a] -> [b]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Patch -> Diagram b) -> VPatch -> Diagram b
forall b a.
(OKBackend b, DrawableLabelled a) =>
(Patch -> Diagram b) -> a -> Diagram b
labelled Patch -> Diagram b
forall a b. (Drawable a, OKBackend b) => a -> Diagram b
drawj) [VPatch
vp, VPatch
vpComp, VPatch
vpFailed] where
vp :: VPatch
vp = Tgraph -> VPatch
makeVP Tgraph
badlyBrokenDart
comp :: Tgraph
comp = Tgraph -> Tgraph
compose Tgraph
badlyBrokenDart
vpComp :: VPatch
vpComp = VPatch -> [TileFace] -> VPatch
restrictVP VPatch
vp ([TileFace] -> VPatch) -> [TileFace] -> VPatch
forall a b. (a -> b) -> a -> b
$ Tgraph -> [TileFace]
forall a. HasFaces a => a -> [TileFace]
faces Tgraph
comp
vpFailed :: VPatch
vpFailed = VPatch -> [TileFace] -> VPatch
restrictVP VPatch
vp ([TileFace] -> VPatch) -> [TileFace] -> VPatch
forall a b. (a -> b) -> a -> b
$ (([TileFace], [TileFace]) -> [TileFace]
forall a b. (a, b) -> b
snd (([TileFace], [TileFace]) -> [TileFace])
-> (Tgraph -> ([TileFace], [TileFace])) -> Tgraph -> [TileFace]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Tgraph -> ([TileFace], [TileFace])
partComposeFaces) Tgraph
comp
removeIncompletesFig :: OKBackend b => Diagram b
removeIncompletesFig :: forall b. OKBackend b => Diagram b
removeIncompletesFig = QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any
forall b. OKBackend b => Diagram b -> Diagram b
padBorder (QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any)
-> QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any
forall a b. (a -> b) -> a -> b
$ Tgraph -> QDiagram b (V b) (N b) Any
forall a b. (Drawable a, OKBackend b) => a -> Diagram b
drawj (Tgraph -> QDiagram b (V b) (N b) Any)
-> Tgraph -> QDiagram b (V b) (N b) Any
forall a b. (a -> b) -> a -> b
$ [TileFace] -> Tgraph -> Tgraph
removeFaces (Tgraph -> [TileFace]
boundaryJoinFaces Tgraph
g) Tgraph
g where
g :: Tgraph
g = [Tgraph]
sunDs [Tgraph] -> Vertex -> Tgraph
forall a. HasCallStack => [a] -> Vertex -> a
!! Vertex
3
mistake:: Tgraph
mistake :: Tgraph
mistake = [TileFace] -> Tgraph
makeTgraph [(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RK (Vertex
1,Vertex
2,Vertex
4), (Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LK (Vertex
1,Vertex
3,Vertex
2), (Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RD (Vertex
3,Vertex
1,Vertex
5), (Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LD (Vertex
4,Vertex
6,Vertex
1), (Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LD (Vertex
3,Vertex
5,Vertex
7), (Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RD (Vertex
4,Vertex
8,Vertex
6)]
mistake1:: Tgraph
mistake1 :: Tgraph
mistake1 = [TileFace] -> Tgraph
makeTgraph [(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RK (Vertex
1,Vertex
2,Vertex
4), (Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LK (Vertex
1,Vertex
3,Vertex
2), (Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RD (Vertex
3,Vertex
1,Vertex
5), (Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LD (Vertex
4,Vertex
6,Vertex
1)]
vertexTypesFig :: OKBackend b => Diagram b
vertexTypesFig :: forall b. OKBackend b => Diagram b
vertexTypesFig = QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any
forall b. OKBackend b => Diagram b -> Diagram b
padBorder (QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any)
-> QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any
forall a b. (a -> b) -> a -> b
$ Double -> [QDiagram b V2 Double Any] -> QDiagram b V2 Double Any
forall n a.
(InSpace V2 n a, Floating n, Juxtaposable a, HasOrigin a,
Monoid' a) =>
n -> [a] -> a
hsep Double
1 [QDiagram b V2 Double Any]
forall {b}.
(N b ~ Double, V b ~ V2, Renderable (Path V2 Double) b,
Renderable (Text Double) b) =>
[QDiagram b V2 Double Any]
lTypeFigs
where
lTypeFigs :: [QDiagram b V2 Double Any]
lTypeFigs = ([Char] -> QDiagram b V2 Double Any -> QDiagram b V2 Double Any)
-> [[Char]]
-> [QDiagram b V2 Double Any]
-> [QDiagram b V2 Double Any]
forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith (Point V2 Double -> [Char] -> Diagram b -> Diagram b
forall b.
OKBackend b =>
Point V2 Double -> [Char] -> Diagram b -> Diagram b
labelAt ((Double, Double) -> Point V2 Double
forall n. (n, n) -> P2 n
p2 (Double
0,-Double
2.2))) [[Char]
"sun",[Char]
"star",[Char]
"jack",[Char]
"queen",[Char]
"king",[Char]
"ace",[Char]
"deuce"] [QDiagram b V2 Double Any]
forall {b}.
(N b ~ Double, V b ~ V2, Renderable (Path V2 Double) b,
Renderable (Text Double) b) =>
[QDiagram b V2 Double Any]
vTypeFigs
vTypeFigs :: [QDiagram b V2 Double Any]
vTypeFigs = (Tgraph -> (Vertex, Vertex) -> QDiagram b V2 Double Any)
-> [Tgraph] -> [(Vertex, Vertex)] -> [QDiagram b V2 Double Any]
forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith Tgraph -> (Vertex, Vertex) -> QDiagram b V2 Double Any
Tgraph -> (Vertex, Vertex) -> QDiagram b V2 (N b) Any
forall {b}.
(V b ~ V2, N b ~ Double, Renderable (Path V2 Double) b,
Renderable (Text Double) b) =>
Tgraph -> (Vertex, Vertex) -> QDiagram b V2 (N b) Any
drawVertex
[Tgraph
sunGraph, Tgraph
starGraph, Tgraph
jackGraph, Tgraph
queenGraph, Tgraph
kingGraph, Tgraph
aceGraph, Tgraph
deuceGraph]
[(Vertex
1,Vertex
2), (Vertex
1,Vertex
2), (Vertex
1,Vertex
2), (Vertex
1,Vertex
2), (Vertex
1,Vertex
2), (Vertex
3,Vertex
6), (Vertex
2,Vertex
6)]
drawVertex :: Tgraph -> (Vertex, Vertex) -> QDiagram b V2 (N b) Any
drawVertex Tgraph
g (Vertex, Vertex)
alm = (VPatch -> QDiagram b V2 (N b) Any)
-> (Vertex, Vertex) -> Tgraph -> QDiagram b V2 (N b) Any
forall a. (VPatch -> a) -> (Vertex, Vertex) -> Tgraph -> a
alignBefore (Measure (N b) -> QDiagram b V2 (N b) Any -> QDiagram b V2 (N b) Any
forall a n.
(N a ~ n, HasStyle a, Typeable n) =>
Measure n -> a -> a
lw Measure (N b)
forall n. OrderedField n => Measure n
thin (QDiagram b V2 (N b) Any -> QDiagram b V2 (N b) Any)
-> (VPatch -> QDiagram b V2 (N b) Any)
-> VPatch
-> QDiagram b V2 (N b) Any
forall b c a. (b -> c) -> (a -> b) -> a -> c
. QDiagram b V2 (N b) Any -> QDiagram b V2 (N b) Any
forall n b m.
(TypeableFloat n, Renderable (Path V2 n) b, Monoid' m) =>
QDiagram b V2 n m -> QDiagram b V2 n m
showOrigin (QDiagram b V2 (N b) Any -> QDiagram b V2 (N b) Any)
-> (VPatch -> QDiagram b V2 (N b) Any)
-> VPatch
-> QDiagram b V2 (N b) Any
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VPatch -> Diagram b
VPatch -> QDiagram b V2 (N b) Any
forall a b. (Drawable a, OKBackend b) => a -> Diagram b
drawj) (Vertex, Vertex)
alm Tgraph
g
jackGraph,kingGraph,queenGraph,aceGraph,deuceGraph,starGraph::Tgraph
jackGraph :: Tgraph
jackGraph = [TileFace] -> Tgraph
makeTgraph
[(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LK (Vertex
7,Vertex
8,Vertex
1),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RK (Vertex
7,Vertex
1,Vertex
5),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LD (Vertex
9,Vertex
8,Vertex
10),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RD (Vertex
9,Vertex
1,Vertex
8),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LK (Vertex
1,Vertex
9,Vertex
11)
,(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RK (Vertex
1,Vertex
11,Vertex
2),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RD (Vertex
4,Vertex
6,Vertex
5),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LD (Vertex
4,Vertex
5,Vertex
1),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RK (Vertex
1,Vertex
3,Vertex
4),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LK (Vertex
1,Vertex
2,Vertex
3)
]
kingGraph :: Tgraph
kingGraph = [TileFace] -> Tgraph
makeTgraph
[(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LD (Vertex
1,Vertex
10,Vertex
11),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RD (Vertex
1,Vertex
9,Vertex
10),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RK (Vertex
9,Vertex
7,Vertex
8),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LK (Vertex
9,Vertex
1,Vertex
7),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LK (Vertex
5,Vertex
6,Vertex
7)
,(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RK (Vertex
5,Vertex
7,Vertex
1),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LD (Vertex
1,Vertex
4,Vertex
5),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RD (Vertex
1,Vertex
3,Vertex
4),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RD (Vertex
1,Vertex
11,Vertex
2),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LD (Vertex
1,Vertex
2,Vertex
3)
]
queenGraph :: Tgraph
queenGraph = [TileFace] -> Tgraph
makeTgraph
[(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RK (Vertex
11,Vertex
9,Vertex
10),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LK (Vertex
11,Vertex
1,Vertex
9),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LK (Vertex
7,Vertex
8,Vertex
9),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RK (Vertex
7,Vertex
9,Vertex
1),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RK (Vertex
7,Vertex
5,Vertex
6)
,(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LK (Vertex
7,Vertex
1,Vertex
5),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LK (Vertex
3,Vertex
4,Vertex
5),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RK (Vertex
3,Vertex
5,Vertex
1),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RD (Vertex
1,Vertex
11,Vertex
2),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LD (Vertex
1,Vertex
2,Vertex
3)
]
aceGraph :: Tgraph
aceGraph = Tgraph
fool
deuceGraph :: Tgraph
deuceGraph = [TileFace] -> Tgraph
makeTgraph
[(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LK (Vertex
7,Vertex
8,Vertex
2),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RK (Vertex
7,Vertex
2,Vertex
6),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LK (Vertex
5,Vertex
6,Vertex
2),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RK (Vertex
5,Vertex
2,Vertex
4)
,(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LD (Vertex
1,Vertex
8,Vertex
9),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RD (Vertex
1,Vertex
2,Vertex
8),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RD (Vertex
1,Vertex
3,Vertex
4),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LD (Vertex
1,Vertex
4,Vertex
2)
]
starGraph :: Tgraph
starGraph = [TileFace] -> Tgraph
makeTgraph
[(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LD (Vertex
1,Vertex
2,Vertex
3),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RD (Vertex
1,Vertex
11,Vertex
2),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LD (Vertex
1,Vertex
10,Vertex
11),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RD (Vertex
1,Vertex
9,Vertex
10),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LD (Vertex
1,Vertex
8,Vertex
9)
,(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RD (Vertex
1,Vertex
7,Vertex
8),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LD (Vertex
1,Vertex
6,Vertex
7),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RD (Vertex
1,Vertex
5,Vertex
6),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
LD (Vertex
1,Vertex
4,Vertex
5),(Vertex, Vertex, Vertex) -> TileFace
forall rep. rep -> HalfTile rep
RD (Vertex
1,Vertex
3,Vertex
4)
]
forceVFigures :: OKBackend b => [Diagram b]
forceVFigures :: forall b. OKBackend b => [Diagram b]
forceVFigures = [Vertex] -> [Diagram b] -> [Diagram b]
forall a.
(Transformable a, V a ~ V2, N a ~ Double) =>
[Vertex] -> [a] -> [a]
rotations [Vertex
0,Vertex
0,Vertex
9,Vertex
5,Vertex
0,Vertex
0,Vertex
1] ([Diagram b] -> [Diagram b]) -> [Diagram b] -> [Diagram b]
forall a b. (a -> b) -> a -> b
$
(Tgraph -> QDiagram b V2 Double Any)
-> [Tgraph] -> [QDiagram b V2 Double Any]
forall a b. (a -> b) -> [a] -> [b]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (QDiagram b V2 Double Any -> QDiagram b V2 Double Any
forall (v :: * -> *) n a.
(InSpace v n a, Fractional n, Traversable v, Alignable a,
HasOrigin a) =>
a -> a
center (QDiagram b V2 Double Any -> QDiagram b V2 Double Any)
-> (Tgraph -> QDiagram b V2 Double Any)
-> Tgraph
-> QDiagram b V2 Double Any
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Tgraph -> Diagram b
Tgraph -> QDiagram b V2 Double Any
forall b. OKBackend b => Tgraph -> Diagram b
drawForce) [Tgraph
sunGraph,Tgraph
starGraph,Tgraph
jackGraph,Tgraph
queenGraph,Tgraph
kingGraph,Tgraph
aceGraph,Tgraph
deuceGraph]
sun3Dart :: Tgraph
sun3Dart :: Tgraph
sun3Dart = (Vertex, Vertex) -> Tgraph -> Tgraph
forall a. Forcible a => (Vertex, Vertex) -> a -> a
addHalfDart (Vertex
9,Vertex
10) (Tgraph -> Tgraph) -> Tgraph -> Tgraph
forall a b. (a -> b) -> a -> b
$ (Vertex, Vertex) -> Tgraph -> Tgraph
forall a. Forcible a => (Vertex, Vertex) -> a -> a
addHalfDart (Vertex
8,Vertex
9) (Tgraph -> Tgraph) -> Tgraph -> Tgraph
forall a b. (a -> b) -> a -> b
$ (Vertex, Vertex) -> Tgraph -> Tgraph
forall a. Forcible a => (Vertex, Vertex) -> a -> a
addHalfDart (Vertex
5,Vertex
6) (Tgraph -> Tgraph) -> Tgraph -> Tgraph
forall a b. (a -> b) -> a -> b
$ (Vertex, Vertex) -> Tgraph -> Tgraph
forall a. Forcible a => (Vertex, Vertex) -> a -> a
addHalfDart (Vertex
4,Vertex
5) (Tgraph -> Tgraph) -> Tgraph -> Tgraph
forall a b. (a -> b) -> a -> b
$ (Vertex, Vertex) -> Tgraph -> Tgraph
forall a. Forcible a => (Vertex, Vertex) -> a -> a
addHalfDart (Vertex
3,Vertex
4) (Tgraph -> Tgraph) -> Tgraph -> Tgraph
forall a b. (a -> b) -> a -> b
$ (Vertex, Vertex) -> Tgraph -> Tgraph
forall a. Forcible a => (Vertex, Vertex) -> a -> a
addHalfDart (Vertex
2,Vertex
3) Tgraph
sunGraph
superForceFig :: OKBackend b => Diagram b
superForceFig :: forall b. OKBackend b => Diagram b
superForceFig = Diagram b -> Diagram b
forall b. OKBackend b => Diagram b -> Diagram b
padBorder (Diagram b -> Diagram b) -> Diagram b -> Diagram b
forall a b. (a -> b) -> a -> b
$ Measure Double -> Diagram b -> Diagram b
forall a n.
(N a ~ n, HasStyle a, Typeable n) =>
Measure n -> a -> a
lw Measure Double
forall n. OrderedField n => Measure n
thin (Diagram b -> Diagram b) -> Diagram b -> Diagram b
forall a b. (a -> b) -> a -> b
$ Angle Double -> Diagram b -> Diagram b
forall n t.
(InSpace V2 n t, Transformable t, Floating n) =>
Angle n -> t -> t
rotate (Vertex -> Angle Double
ttangle Vertex
1) (Diagram b -> Diagram b) -> Diagram b -> Diagram b
forall a b. (a -> b) -> a -> b
$ Tgraph -> Diagram b
forall b. OKBackend b => Tgraph -> Diagram b
drawSuperForce Tgraph
g where
g :: Tgraph
g = (Vertex, Vertex) -> Tgraph -> Tgraph
forall a. Forcible a => (Vertex, Vertex) -> a -> a
addHalfDart (Vertex
220,Vertex
221) (Tgraph -> Tgraph) -> Tgraph -> Tgraph
forall a b. (a -> b) -> a -> b
$ Tgraph -> Tgraph
forall a. Forcible a => a -> a
force (Tgraph -> Tgraph) -> Tgraph -> Tgraph
forall a b. (a -> b) -> a -> b
$ Tgraph -> [Tgraph]
decompositions Tgraph
fool [Tgraph] -> Vertex -> Tgraph
forall a. HasCallStack => [a] -> Vertex -> a
!!Vertex
3
superForceRocketsFig :: OKBackend b => Diagram b
superForceRocketsFig :: forall b. OKBackend b => Diagram b
superForceRocketsFig = Diagram b -> Diagram b
forall b. OKBackend b => Diagram b -> Diagram b
padBorder (Diagram b -> Diagram b) -> Diagram b -> Diagram b
forall a b. (a -> b) -> a -> b
$ Measure Double -> Diagram b -> Diagram b
forall a n.
(N a ~ n, HasStyle a, Typeable n) =>
Measure n -> a -> a
lw Measure Double
forall n. OrderedField n => Measure n
veryThin (Diagram b -> Diagram b) -> Diagram b -> Diagram b
forall a b. (a -> b) -> a -> b
$ Double -> [Diagram b] -> Diagram b
forall n a.
(InSpace V2 n a, Floating n, Juxtaposable a, HasOrigin a,
Monoid' a) =>
n -> [a] -> a
vsep Double
1 ([Diagram b] -> Diagram b) -> [Diagram b] -> Diagram b
forall a b. (a -> b) -> a -> b
$ [Vertex] -> [Diagram b] -> [Diagram b]
forall a.
(Transformable a, V a ~ V2, N a ~ Double) =>
[Vertex] -> [a] -> [a]
rotations [Vertex
8,Vertex
9,Vertex
9,Vertex
8] ([Diagram b] -> [Diagram b]) -> [Diagram b] -> [Diagram b]
forall a b. (a -> b) -> a -> b
$
(Tgraph -> QDiagram b V2 Double Any)
-> [Tgraph] -> [QDiagram b V2 Double Any]
forall a b. (a -> b) -> [a] -> [b]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Tgraph -> Diagram b
Tgraph -> QDiagram b V2 Double Any
forall b. OKBackend b => Tgraph -> Diagram b
drawSuperForce [Tgraph]
decomps where
decomps :: [Tgraph]
decomps = Vertex -> [Tgraph] -> [Tgraph]
forall a. Vertex -> [a] -> [a]
take Vertex
4 ([Tgraph] -> [Tgraph]) -> [Tgraph] -> [Tgraph]
forall a b. (a -> b) -> a -> b
$ Tgraph -> [Tgraph]
decompositions Tgraph
sun3Dart
boundaryFDart4, boundaryFDart5 :: Tgraph
boundaryFDart4 :: Tgraph
boundaryFDart4 = [TileFace] -> Tgraph
NoWarn.makeUncheckedTgraph ([TileFace] -> Tgraph) -> [TileFace] -> Tgraph
forall a b. (a -> b) -> a -> b
$ BoundaryState -> [TileFace]
boundaryFaces (BoundaryState -> [TileFace]) -> BoundaryState -> [TileFace]
forall a b. (a -> b) -> a -> b
$ BoundaryState -> BoundaryState
forall a. Forcible a => a -> a
force (BoundaryState -> BoundaryState) -> BoundaryState -> BoundaryState
forall a b. (a -> b) -> a -> b
$ Tgraph -> BoundaryState
makeBoundaryState Tgraph
dartD4
boundaryFDart5 :: Tgraph
boundaryFDart5 = [TileFace] -> Tgraph
NoWarn.makeUncheckedTgraph ([TileFace] -> Tgraph) -> [TileFace] -> Tgraph
forall a b. (a -> b) -> a -> b
$ BoundaryState -> [TileFace]
boundaryFaces (BoundaryState -> [TileFace]) -> BoundaryState -> [TileFace]
forall a b. (a -> b) -> a -> b
$ BoundaryState -> BoundaryState
forall a. Forcible a => a -> a
force (BoundaryState -> BoundaryState) -> BoundaryState -> BoundaryState
forall a b. (a -> b) -> a -> b
$ Tgraph -> BoundaryState
makeBoundaryState ([Tgraph]
dartDs[Tgraph] -> Vertex -> Tgraph
forall a. HasCallStack => [a] -> Vertex -> a
!!Vertex
5)
boundaryFDart4Fig,boundaryFDart5Fig :: OKBackend b => Diagram b
boundaryFDart4Fig :: forall b. OKBackend b => Diagram b
boundaryFDart4Fig = Diagram b -> Diagram b
forall b. OKBackend b => Diagram b -> Diagram b
padBorder (Diagram b -> Diagram b) -> Diagram b -> Diagram b
forall a b. (a -> b) -> a -> b
$ Measure Double -> Diagram b -> Diagram b
forall a n.
(N a ~ n, HasStyle a, Typeable n) =>
Measure n -> a -> a
lw Measure Double
forall n. OrderedField n => Measure n
ultraThin (Diagram b -> Diagram b) -> Diagram b -> Diagram b
forall a b. (a -> b) -> a -> b
$ Measure Double -> (Patch -> Diagram b) -> Tgraph -> Diagram b
forall b a.
(OKBackend b, DrawableLabelled a) =>
Measure Double -> (Patch -> Diagram b) -> a -> Diagram b
labelSize Measure Double
forall n. OrderedField n => Measure n
tiny Patch -> Diagram b
forall a b. (Drawable a, OKBackend b) => a -> Diagram b
drawj Tgraph
boundaryFDart4
boundaryFDart5Fig :: forall b. OKBackend b => Diagram b
boundaryFDart5Fig = Diagram b -> Diagram b
forall b. OKBackend b => Diagram b -> Diagram b
padBorder (Diagram b -> Diagram b) -> Diagram b -> Diagram b
forall a b. (a -> b) -> a -> b
$ Measure Double -> Diagram b -> Diagram b
forall a n.
(N a ~ n, HasStyle a, Typeable n) =>
Measure n -> a -> a
lw Measure Double
forall n. OrderedField n => Measure n
ultraThin (Diagram b -> Diagram b) -> Diagram b -> Diagram b
forall a b. (a -> b) -> a -> b
$ Measure Double -> (Patch -> Diagram b) -> Tgraph -> Diagram b
forall b a.
(OKBackend b, DrawableLabelled a) =>
Measure Double -> (Patch -> Diagram b) -> a -> Diagram b
labelSize (Double -> Measure Double
forall n. Num n => n -> Measure n
normalized Double
0.006) Patch -> Diagram b
forall a b. (Drawable a, OKBackend b) => a -> Diagram b
drawj Tgraph
boundaryFDart5
boundaryGapFDart4, boundaryGapFDart5 :: Tgraph
boundaryGapFDart4 :: Tgraph
boundaryGapFDart4 = [Vertex] -> Tgraph -> Tgraph
removeVertices [Vertex
354] Tgraph
boundaryFDart4
boundaryGapFDart5 :: Tgraph
boundaryGapFDart5 = [Vertex] -> Tgraph -> Tgraph
removeVertices [Vertex
1467] Tgraph
boundaryFDart5
boundaryGap4Fig, boundaryGap5Fig :: OKBackend b => Diagram b
boundaryGap4Fig :: forall b. OKBackend b => Diagram b
boundaryGap4Fig = Diagram b -> Diagram b
forall b. OKBackend b => Diagram b -> Diagram b
padBorder (Diagram b -> Diagram b) -> Diagram b -> Diagram b
forall a b. (a -> b) -> a -> b
$ Measure Double -> Diagram b -> Diagram b
forall a n.
(N a ~ n, HasStyle a, Typeable n) =>
Measure n -> a -> a
lw Measure Double
forall n. OrderedField n => Measure n
ultraThin (Diagram b -> Diagram b) -> Diagram b -> Diagram b
forall a b. (a -> b) -> a -> b
$ Measure Double -> (Patch -> Diagram b) -> Tgraph -> Diagram b
forall b a.
(OKBackend b, DrawableLabelled a) =>
Measure Double -> (Patch -> Diagram b) -> a -> Diagram b
labelSize Measure Double
forall n. OrderedField n => Measure n
tiny Patch -> Diagram b
forall a b. (Drawable a, OKBackend b) => a -> Diagram b
drawj Tgraph
boundaryGapFDart4
boundaryGap5Fig :: forall b. OKBackend b => Diagram b
boundaryGap5Fig = Diagram b -> Diagram b
forall b. OKBackend b => Diagram b -> Diagram b
padBorder (Diagram b -> Diagram b) -> Diagram b -> Diagram b
forall a b. (a -> b) -> a -> b
$ Measure Double -> Diagram b -> Diagram b
forall a n.
(N a ~ n, HasStyle a, Typeable n) =>
Measure n -> a -> a
lw Measure Double
forall n. OrderedField n => Measure n
ultraThin (Diagram b -> Diagram b) -> Diagram b -> Diagram b
forall a b. (a -> b) -> a -> b
$ Measure Double -> (Patch -> Diagram b) -> Tgraph -> Diagram b
forall b a.
(OKBackend b, DrawableLabelled a) =>
Measure Double -> (Patch -> Diagram b) -> a -> Diagram b
labelSize (Double -> Measure Double
forall n. Num n => n -> Measure n
normalized Double
0.006) Patch -> Diagram b
forall a b. (Drawable a, OKBackend b) => a -> Diagram b
drawj Tgraph
boundaryGapFDart5
boundaryVCoveringFigs :: OKBackend b =>
Forced BoundaryState -> [Diagram b]
boundaryVCoveringFigs :: forall b. OKBackend b => Forced BoundaryState -> [Diagram b]
boundaryVCoveringFigs Forced BoundaryState
bd =
Measure Double
-> QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any
forall a n.
(N a ~ n, HasStyle a, Typeable n) =>
Measure n -> a -> a
lw Measure Double
forall n. OrderedField n => Measure n
ultraThin (QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any)
-> (Forced BoundaryState -> QDiagram b (V b) (N b) Any)
-> Forced BoundaryState
-> QDiagram b (V b) (N b) Any
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (QDiagram b (V b) (N b) Any
redg <>) (QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any)
-> (Forced BoundaryState -> QDiagram b (V b) (N b) Any)
-> Forced BoundaryState
-> QDiagram b (V b) (N b) Any
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (VPatch -> QDiagram b (V b) (N b) Any)
-> (Vertex, Vertex) -> Tgraph -> QDiagram b (V b) (N b) Any
forall a. (VPatch -> a) -> (Vertex, Vertex) -> Tgraph -> a
alignBefore VPatch -> QDiagram b (V b) (N b) Any
forall a b. (Drawable a, OKBackend b) => a -> Diagram b
draw (Vertex, Vertex)
alig (Tgraph -> QDiagram b (V b) (N b) Any)
-> (Forced BoundaryState -> Tgraph)
-> Forced BoundaryState
-> QDiagram b (V b) (N b) Any
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (BoundaryState -> Tgraph
recoverGraph (BoundaryState -> Tgraph)
-> (Forced BoundaryState -> BoundaryState)
-> Forced BoundaryState
-> Tgraph
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Forced BoundaryState -> BoundaryState
forall a. Forced a -> a
forgetF) (Forced BoundaryState -> QDiagram b (V b) (N b) Any)
-> [Forced BoundaryState] -> [QDiagram b (V b) (N b) Any]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Forced BoundaryState -> [Forced BoundaryState]
boundaryVCovering Forced BoundaryState
bd
where redg :: QDiagram b (V b) (N b) Any
redg = Colour Double
-> QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any
forall n a.
(InSpace V2 n a, Typeable n, Floating n, HasStyle a) =>
Colour Double -> a -> a
lc Colour Double
forall a. (Ord a, Floating a) => Colour a
red (QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any)
-> QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any
forall a b. (a -> b) -> a -> b
$ Tgraph -> QDiagram b (V b) (N b) Any
forall a b. (Drawable a, OKBackend b) => a -> Diagram b
draw Tgraph
g
alig :: (Vertex, Vertex)
alig = Tgraph -> (Vertex, Vertex)
forall a. HasFaces a => a -> (Vertex, Vertex)
defaultAlignment Tgraph
g
g :: Tgraph
g = BoundaryState -> Tgraph
recoverGraph (BoundaryState -> Tgraph) -> BoundaryState -> Tgraph
forall a b. (a -> b) -> a -> b
$ Forced BoundaryState -> BoundaryState
forall a. Forced a -> a
forgetF Forced BoundaryState
bd
boundaryECoveringFigs :: OKBackend b =>
Forced BoundaryState -> [Diagram b]
boundaryECoveringFigs :: forall b. OKBackend b => Forced BoundaryState -> [Diagram b]
boundaryECoveringFigs Forced BoundaryState
bd =
Measure Double
-> QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any
forall a n.
(N a ~ n, HasStyle a, Typeable n) =>
Measure n -> a -> a
lw Measure Double
forall n. OrderedField n => Measure n
ultraThin (QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any)
-> (Forced BoundaryState -> QDiagram b (V b) (N b) Any)
-> Forced BoundaryState
-> QDiagram b (V b) (N b) Any
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (QDiagram b (V b) (N b) Any
redg <>) (QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any)
-> (Forced BoundaryState -> QDiagram b (V b) (N b) Any)
-> Forced BoundaryState
-> QDiagram b (V b) (N b) Any
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (VPatch -> QDiagram b (V b) (N b) Any)
-> (Vertex, Vertex) -> Tgraph -> QDiagram b (V b) (N b) Any
forall a. (VPatch -> a) -> (Vertex, Vertex) -> Tgraph -> a
alignBefore VPatch -> QDiagram b (V b) (N b) Any
forall a b. (Drawable a, OKBackend b) => a -> Diagram b
draw (Vertex, Vertex)
alig (Tgraph -> QDiagram b (V b) (N b) Any)
-> (Forced BoundaryState -> Tgraph)
-> Forced BoundaryState
-> QDiagram b (V b) (N b) Any
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BoundaryState -> Tgraph
recoverGraph (BoundaryState -> Tgraph)
-> (Forced BoundaryState -> BoundaryState)
-> Forced BoundaryState
-> Tgraph
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Forced BoundaryState -> BoundaryState
forall a. Forced a -> a
forgetF (Forced BoundaryState -> QDiagram b (V b) (N b) Any)
-> [Forced BoundaryState] -> [QDiagram b (V b) (N b) Any]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Forced BoundaryState -> [Forced BoundaryState]
boundaryECovering Forced BoundaryState
bd
where redg :: QDiagram b (V b) (N b) Any
redg = Colour Double
-> QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any
forall n a.
(InSpace V2 n a, Typeable n, Floating n, HasStyle a) =>
Colour Double -> a -> a
lc Colour Double
forall a. (Ord a, Floating a) => Colour a
red (QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any)
-> QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any
forall a b. (a -> b) -> a -> b
$ Tgraph -> QDiagram b (V b) (N b) Any
forall a b. (Drawable a, OKBackend b) => a -> Diagram b
draw Tgraph
g
alig :: (Vertex, Vertex)
alig = Tgraph -> (Vertex, Vertex)
forall a. HasFaces a => a -> (Vertex, Vertex)
defaultAlignment Tgraph
g
g :: Tgraph
g = BoundaryState -> Tgraph
recoverGraph (BoundaryState -> Tgraph) -> BoundaryState -> Tgraph
forall a b. (a -> b) -> a -> b
$ Forced BoundaryState -> BoundaryState
forall a. Forced a -> a
forgetF Forced BoundaryState
bd
kingECoveringFig,kingVCoveringFig :: OKBackend b => Diagram b
kingECoveringFig :: forall b. OKBackend b => Diagram b
kingECoveringFig = QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any
forall b. OKBackend b => Diagram b -> Diagram b
padBorder (QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any)
-> QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any
forall a b. (a -> b) -> a -> b
$ Vertex
-> [QDiagram b (V b) (N b) Any] -> QDiagram b (V b) (N b) Any
forall b. OKBackend b => Vertex -> [Diagram b] -> Diagram b
arrangeRows Vertex
3 ([QDiagram b (V b) (N b) Any] -> QDiagram b (V b) (N b) Any)
-> [QDiagram b (V b) (N b) Any] -> QDiagram b (V b) (N b) Any
forall a b. (a -> b) -> a -> b
$ Forced BoundaryState -> [QDiagram b (V b) (N b) Any]
forall b. OKBackend b => Forced BoundaryState -> [Diagram b]
boundaryECoveringFigs (Forced BoundaryState -> [QDiagram b (V b) (N b) Any])
-> Forced BoundaryState -> [QDiagram b (V b) (N b) Any]
forall a b. (a -> b) -> a -> b
$ BoundaryState -> Forced BoundaryState
forall a. Forcible a => a -> Forced a
forceF (BoundaryState -> Forced BoundaryState)
-> BoundaryState -> Forced BoundaryState
forall a b. (a -> b) -> a -> b
$ Tgraph -> BoundaryState
makeBoundaryState Tgraph
kingGraph
kingVCoveringFig :: forall b. OKBackend b => Diagram b
kingVCoveringFig = QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any
forall b. OKBackend b => Diagram b -> Diagram b
padBorder (QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any)
-> QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any
forall a b. (a -> b) -> a -> b
$ Vertex
-> [QDiagram b (V b) (N b) Any] -> QDiagram b (V b) (N b) Any
forall b. OKBackend b => Vertex -> [Diagram b] -> Diagram b
arrangeRows Vertex
3 ([QDiagram b (V b) (N b) Any] -> QDiagram b (V b) (N b) Any)
-> [QDiagram b (V b) (N b) Any] -> QDiagram b (V b) (N b) Any
forall a b. (a -> b) -> a -> b
$ Forced BoundaryState -> [QDiagram b (V b) (N b) Any]
forall b. OKBackend b => Forced BoundaryState -> [Diagram b]
boundaryVCoveringFigs (Forced BoundaryState -> [QDiagram b (V b) (N b) Any])
-> Forced BoundaryState -> [QDiagram b (V b) (N b) Any]
forall a b. (a -> b) -> a -> b
$ BoundaryState -> Forced BoundaryState
forall a. Forcible a => a -> Forced a
forceF (BoundaryState -> Forced BoundaryState)
-> BoundaryState -> Forced BoundaryState
forall a b. (a -> b) -> a -> b
$ Tgraph -> BoundaryState
makeBoundaryState Tgraph
kingGraph
kingEmpiresFig, kingEmpire1Fig, kingEmpire2Fig :: OKBackend b => Diagram b
kingEmpiresFig :: forall b. OKBackend b => Diagram b
kingEmpiresFig = QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any
forall b. OKBackend b => Diagram b -> Diagram b
padBorder (QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any)
-> QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any
forall a b. (a -> b) -> a -> b
$ Double -> [QDiagram b V2 Double Any] -> QDiagram b V2 Double Any
forall n a.
(InSpace V2 n a, Floating n, Juxtaposable a, HasOrigin a,
Monoid' a) =>
n -> [a] -> a
hsep Double
10 [QDiagram b (V b) (N b) Any
QDiagram b V2 Double Any
forall b. OKBackend b => Diagram b
kingEmpire1Fig, QDiagram b (V b) (N b) Any
QDiagram b V2 Double Any
forall b. OKBackend b => Diagram b
kingEmpire2Fig]
kingEmpire1Fig :: forall b. OKBackend b => Diagram b
kingEmpire1Fig = Tgraph -> QDiagram b (V b) (N b) Any
forall b. OKBackend b => Tgraph -> Diagram b
showEmpire1 Tgraph
kingGraph
kingEmpire2Fig :: forall b. OKBackend b => Diagram b
kingEmpire2Fig = Tgraph -> QDiagram b (V b) (N b) Any
forall b. OKBackend b => Tgraph -> Diagram b
showEmpire2 Tgraph
kingGraph
emplaceChoices:: Tgraph -> [Tgraph]
emplaceChoices :: Tgraph -> [Tgraph]
emplaceChoices = Forced Tgraph -> [Tgraph]
emplaceChoicesForced (Forced Tgraph -> [Tgraph])
-> (Tgraph -> Forced Tgraph) -> Tgraph -> [Tgraph]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Tgraph -> Forced Tgraph
forall a. Forcible a => a -> Forced a
forceF where
emplaceChoicesForced:: Forced Tgraph -> [Tgraph]
emplaceChoicesForced :: Forced Tgraph -> [Tgraph]
emplaceChoicesForced Forced Tgraph
fg | Tgraph -> Bool
forall a. HasFaces a => a -> Bool
nullFaces Tgraph
g' = [([Vertex], Tgraph)] -> [Tgraph]
chooseUnknowns [(DartWingInfo -> [Vertex]
unknowns (DartWingInfo -> [Vertex]) -> DartWingInfo -> [Vertex]
forall a b. (a -> b) -> a -> b
$ Tgraph -> DartWingInfo
getDartWingInfo Tgraph
g0, Tgraph
g0)]
| Bool
otherwise = Tgraph -> Tgraph
forall a. Forcible a => a -> a
force (Tgraph -> Tgraph) -> (Tgraph -> Tgraph) -> Tgraph -> Tgraph
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Tgraph -> Tgraph
decompose (Tgraph -> Tgraph) -> [Tgraph] -> [Tgraph]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Forced Tgraph -> [Tgraph]
emplaceChoicesForced Forced Tgraph
fg'
where g0 :: Tgraph
g0 = Forced Tgraph -> Tgraph
forall a. Forced a -> a
forgetF Forced Tgraph
fg
fg' :: Forced Tgraph
fg' = Forced Tgraph -> Forced Tgraph
composeF Forced Tgraph
fg
g' :: Tgraph
g' = Forced Tgraph -> Tgraph
forall a. Forced a -> a
forgetF Forced Tgraph
fg'
chooseUnknowns :: [([Vertex],Tgraph)] -> [Tgraph]
chooseUnknowns :: [([Vertex], Tgraph)] -> [Tgraph]
chooseUnknowns [] = []
chooseUnknowns (([],Tgraph
g0):[([Vertex], Tgraph)]
more) = Tgraph
g0Tgraph -> [Tgraph] -> [Tgraph]
forall a. a -> [a] -> [a]
:[([Vertex], Tgraph)] -> [Tgraph]
chooseUnknowns [([Vertex], Tgraph)]
more
chooseUnknowns ((Vertex
u:[Vertex]
unks,Tgraph
g0): [([Vertex], Tgraph)]
more)
= [([Vertex], Tgraph)] -> [Tgraph]
chooseUnknowns ((Tgraph -> ([Vertex], Tgraph)) -> [Tgraph] -> [([Vertex], Tgraph)]
forall a b. (a -> b) -> [a] -> [b]
map ([Vertex] -> Tgraph -> ([Vertex], Tgraph)
forall {b}. HasFaces b => [Vertex] -> b -> ([Vertex], b)
remainingunks [Vertex]
unks) [Tgraph]
newgs [([Vertex], Tgraph)]
-> [([Vertex], Tgraph)] -> [([Vertex], Tgraph)]
forall a. [a] -> [a] -> [a]
++ [([Vertex], Tgraph)]
more)
where newgs :: [Tgraph]
newgs = (BoundaryState -> Tgraph) -> [BoundaryState] -> [Tgraph]
forall a b. (a -> b) -> [a] -> [b]
map BoundaryState -> Tgraph
recoverGraph ([BoundaryState] -> [Tgraph]) -> [BoundaryState] -> [Tgraph]
forall a b. (a -> b) -> a -> b
$ [Try BoundaryState] -> [BoundaryState]
forall a. [Try a] -> [a]
atLeastOne ([Try BoundaryState] -> [BoundaryState])
-> [Try BoundaryState] -> [BoundaryState]
forall a b. (a -> b) -> a -> b
$ (Forced BoundaryState -> BoundaryState)
-> Either ShowS (Forced BoundaryState) -> Try BoundaryState
forall a b. (a -> b) -> Either ShowS a -> Either ShowS b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Forced BoundaryState -> BoundaryState
forall a. Forced a -> a
forgetF (Either ShowS (Forced BoundaryState) -> Try BoundaryState)
-> [Either ShowS (Forced BoundaryState)] -> [Try BoundaryState]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Vertex, Vertex)
-> BoundaryState -> [Either ShowS (Forced BoundaryState)]
forall a. Forcible a => (Vertex, Vertex) -> a -> [Try (Forced a)]
tryDartAndKiteF (Vertex -> BoundaryState -> (Vertex, Vertex)
findDartLongForWing Vertex
u BoundaryState
bd) BoundaryState
bd
bd :: BoundaryState
bd = Tgraph -> BoundaryState
makeBoundaryState Tgraph
g0
remainingunks :: [Vertex] -> b -> ([Vertex], b)
remainingunks [Vertex]
startunks b
g' = ([Vertex]
startunks [Vertex] -> [Vertex] -> [Vertex]
forall a. Eq a => [a] -> [a] -> [a]
`intersect` b -> [Vertex]
forall a. HasFaces a => a -> [Vertex]
boundaryVs b
g', b
g')
findDartLongForWing :: Vertex -> BoundaryState -> Dedge
findDartLongForWing :: Vertex -> BoundaryState -> (Vertex, Vertex)
findDartLongForWing Vertex
v BoundaryState
bd
= case (TileFace -> Bool) -> [TileFace] -> Maybe TileFace
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Maybe a
find TileFace -> Bool
forall rep. HalfTile rep -> Bool
isDart (BoundaryState -> Vertex -> [TileFace]
facesAtBV BoundaryState
bd Vertex
v) of
Just TileFace
d -> TileFace -> (Vertex, Vertex)
longE TileFace
d
Maybe TileFace
Nothing -> [Char] -> (Vertex, Vertex)
forall a. HasCallStack => [Char] -> a
error ([Char] -> (Vertex, Vertex)) -> [Char] -> (Vertex, Vertex)
forall a b. (a -> b) -> a -> b
$ [Char]
"findDartLongForWing: dart not found for dart wing vertex " [Char] -> ShowS
forall a. [a] -> [a] -> [a]
++ Vertex -> [Char]
forall a. Show a => a -> [Char]
show Vertex
v
emplaceChoicesFig :: OKBackend b => Diagram b
emplaceChoicesFig :: forall b. OKBackend b => Diagram b
emplaceChoicesFig = Measure Double -> Diagram b -> Diagram b
forall a n.
(N a ~ n, HasStyle a, Typeable n) =>
Measure n -> a -> a
lw Measure Double
forall n. OrderedField n => Measure n
thin (Diagram b -> Diagram b) -> Diagram b -> Diagram b
forall a b. (a -> b) -> a -> b
$ Double -> [Diagram b] -> Diagram b
forall n a.
(InSpace V2 n a, Floating n, Juxtaposable a, HasOrigin a,
Monoid' a) =>
n -> [a] -> a
hsep Double
1 ([Diagram b] -> Diagram b) -> [Diagram b] -> Diagram b
forall a b. (a -> b) -> a -> b
$ (Tgraph -> Diagram b) -> [Tgraph] -> [Diagram b]
forall a b. (a -> b) -> [a] -> [b]
map Tgraph -> Diagram b
forall {b}.
(N b ~ Double, V b ~ V2, Renderable (Path V2 Double) b,
Renderable (Text Double) b) =>
Tgraph -> QDiagram b (V b) (N b) Any
overlayg ([Tgraph] -> [Diagram b]) -> [Tgraph] -> [Diagram b]
forall a b. (a -> b) -> a -> b
$ Tgraph -> [Tgraph]
emplaceChoices Tgraph
g
where g :: Tgraph
g = Tgraph
foolD
overlayg :: Tgraph -> QDiagram b (V b) (N b) Any
overlayg Tgraph
g' = (VPatch -> QDiagram b (V b) (N b) Any)
-> (Vertex, Vertex) -> Tgraph -> QDiagram b (V b) (N b) Any
forall b.
OKBackend b =>
(VPatch -> Diagram b) -> (Vertex, Vertex) -> Tgraph -> Diagram b
smartAlignBefore VPatch -> QDiagram b (V b) (N b) Any
forall a b. (Drawable a, OKBackend b) => a -> Diagram b
draw (Vertex, Vertex)
algmnt Tgraph
g QDiagram b (V b) (N b) Any
-> (QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any)
-> QDiagram b (V b) (N b) Any
forall a b. a -> (a -> b) -> b
# Colour Double
-> QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any
forall n a.
(InSpace V2 n a, Typeable n, Floating n, HasStyle a) =>
Colour Double -> a -> a
lc Colour Double
forall a. (Ord a, Floating a) => Colour a
red QDiagram b (V b) (N b) Any
-> QDiagram b (V b) (N b) Any -> QDiagram b (V b) (N b) Any
forall a. Semigroup a => a -> a -> a
<> (VPatch -> QDiagram b (V b) (N b) Any)
-> (Vertex, Vertex) -> Tgraph -> QDiagram b (V b) (N b) Any
forall a. (VPatch -> a) -> (Vertex, Vertex) -> Tgraph -> a
alignBefore VPatch -> QDiagram b (V b) (N b) Any
forall a b. (Drawable a, OKBackend b) => a -> Diagram b
draw (Vertex, Vertex)
algmnt Tgraph
g'
algmnt :: (Vertex, Vertex)
algmnt = Tgraph -> (Vertex, Vertex)
forall a. HasFaces a => a -> (Vertex, Vertex)
defaultAlignment Tgraph
g