Skip to content

Instantly share code, notes, and snippets.

@ambuc
Created July 15, 2017 20:58
Embed
What would you like to do?
Successive Rows of Horizontal, Straight Lines from Top to Bottom, and Vertical, Straight Lines from Left to Right, 1972
import Codec.Picture( PixelRGBA8( .. ), writePng )
import Graphics.Rasterific
import Graphics.Rasterific.Texture
import Graphics.Rasterific.Transformations
import Data.List
refl = transform $ applyTransformation
Transformation { _transformA = 0.0, _transformC = 1.0, _transformE = 0.0,
_transformB = 1.0, _transformD = 0.0, _transformF = 0.0
}
main = writePng "yourimage.png"
$ renderDrawing 750 750 (PixelRGBA8 255 255 255 255)
$ withTexture (uniformTexture (PixelRGBA8 0 0 0 255))
$ stroke 1 JoinRound (CapRound, CapRound)
$ transform (applyTransformation $ translate (V2 47.5 47.5))
$ (\xs -> xs ++ map refl xs) $ map (\(x,_) -> line (V2 0 x) (V2 655 x))
$ filter snd $ zip [0,5..]
$ concatMap (\x -> take 12 $ drop x $ replicate 12 True ++ repeat False)
[10,9..0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment