-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDiagram_8_8_8.hs
37 lines (26 loc) · 965 Bytes
/
Diagram_8_8_8.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{-# LANGUAGE NoMonomorphismRestriction,
FlexibleContexts, TypeFamilies #-}
{-# OPTIONS -W #-}
import Diagrams.Prelude
import Diagrams.Backend.SVG.CmdLine
main :: IO ()
main = mainWith (frame 0.1 diagram1)
--atPoints (trailVertices $ regPoly 8 1) (repeat node)
diagram :: Diagram SVG
diagram = atPoints (trailVertices $ regPoly 6 1) (repeat diagram1)
diagram1 :: Diagram SVG
diagram1 = atPoints (trailVertices $ regPoly 8 1) (repeat diagram2)
diagram2 :: Diagram SVG
diagram2 = atPoints (trailVertices $ regPoly 8 1) (repeat diagram3)
diagram3 :: Diagram SVG
diagram3 = atPoints (trailVertices $ regPoly 8 1) (repeat (strokeLine (f 40)))
f :: Int -> Trail' Line V2 Double
f 0 = mempty
f n = onLineSegments tail (circle 0.1)
`mappend` rotateBy 0.025 (f (n-1))
everyOther :: [a] -> [a]
everyOther (x:xs) = x : everyOther' xs
everyOther [] = []
everyOther' :: [a] -> [a]
everyOther' (_:x:xs) = x : everyOther' xs
everyOther' _ = []