Star construction using straight lines.
import Diagrams.Backend.SVG.CmdLine
{-# LANGUAGE NoMonomorphismRestriction, TupleSections #-}
import Diagrams.Prelude hiding (connect)
import Data.Colour.SRGB (sRGB24read)
= map sRGB24read ["#5E0042", "#00856A"] colors
To create one quarter of the diagram, we connect the corresponding points with headless arrows and alternate the line colors.
= mconcat [arrowBetween'
quarter n & arrowHead .~ noHead
(with & shaftStyle %~ lw thin . lc (colors !! ((xCoord1 p) `mod` 2)))
fst p) (snd p) | p <- ps]
(where
= round . fst . unp2 . fst
xCoord1 = zip xs (reverse ys)
ps = pts n (xs, ys)
The final diagram is created by assembling four copies of the above.
= half === rotateBy (1/2) half
d n where
= (rotateBy (1/4) q ||| q) # centerX
half = quarter n q
= (map (p2 . (,0)) [0..n], map (p2 . (0,)) [0..n]) pts n
= pad 1.1 $ d 20 # centerXY `atop` square 50 # fc whitesmoke example
= mainWith (example :: Diagram B) main