Refactoring and linting

This commit is contained in:
2021-04-30 17:50:28 +02:00
parent 83c2220813
commit 9c0e4425da
18 changed files with 531 additions and 523 deletions
+31
View File
@@ -0,0 +1,31 @@
{- |
Compound, universal pictures.
Creates uniform sizes and commands for the Dodge modules. -}
module Dodge.Picture
where
import Geometry
import Picture
-- {- |
-- Current thickness: 2 -}
-- thickLine :: [Point2] -> Picture
-- thickLine = lineOfThickness 2
{- |
Current thickness: 3 -}
vThickLine :: [Point2] -> Picture
vThickLine = lineOfThickness 3
{- |
Current thickness: 6 -}
vvThickLine :: [Point2] -> Picture
vvThickLine = lineOfThickness 6
-- shit this is ugly
lineOfThickness :: Float -> [Point2] -> Picture
lineOfThickness t = pictures . f
where f (x:y:ys)
| x == y = f (x:ys)
| otherwise
= polygon [x +.+ n x y, x -.- n x y, y -.- n x y, y +.+ n x y] : f (y:ys)
f _ = []
n a b = (t*0.5) *.* errorNormalizeV 42 (vNormal (a -.- b))