Tweak picture layers

This commit is contained in:
2021-07-21 17:52:38 +02:00
parent 0aa437d035
commit 9f37ecb204
13 changed files with 134 additions and 80 deletions
+12 -12
View File
@@ -64,15 +64,15 @@ black = (0,0,0,1)
polygon :: [Point2] -> Picture
{-# INLINE polygon #-}
polygon = Polygon 0
polygon = Polygon
polygonZ :: [Point2] -> Float -> Picture
{-# INLINE polygonZ #-}
polygonZ = PolygonZ 0
polygonZ = PolygonZ
polygonCol :: [(Point2,RGBA)] -> Picture
{-# INLINE polygonCol #-}
polygonCol = PolygonCol 0
polygonCol = PolygonCol
poly3 :: [Point3] -> Picture
{-# INLINE poly3 #-}
@@ -80,14 +80,14 @@ poly3 = poly3Col . map (, black)
poly3Col :: [(Point3,RGBA)] -> Picture
{-# INLINE poly3Col #-}
poly3Col = Poly3D 0
poly3Col = Poly3D
-- note that much of work computing the width of the bezier curve is done here
bezierQuad :: Color -> Color -> Float -> Float -> Point2 -> Point2 -> Point2 -> Picture
bezierQuad cola colc ra rc a b c
| a == b && b == c = blank
| a == b || b == c = bezierQuad cola colc ra rc a (0.5 *.* (a +.+ c)) c
| otherwise = BezierQuad 0
| otherwise = BezierQuad
[-- ( (0,0) , cola, (0,0), (0,0) )
(aIn, cola, (fa aIn,fc aIn) , (1,0) )
,(aIn, cola, (fa aIn,fc aIn) , (1,0) )
@@ -177,11 +177,11 @@ makeArc rad (a,b) = map (`rotateV` (0,rad)) angles
circleSolid :: Float -> Picture
{-# INLINE circleSolid #-}
circleSolid = Circle 0 white white
circleSolid = Circle white white
circleSolidCol :: Color -> Color -> Float -> Picture
{-# INLINE circleSolidCol #-}
circleSolidCol = Circle 0
circleSolidCol = Circle
circle :: Float -> Picture
{-# INLINE circle #-}
@@ -189,15 +189,15 @@ circle rad = thickArc 0 (2*pi) rad 1
text :: String -> Picture
{-# INLINE text #-}
text = Text 1
text = Text
line :: [Point2] -> Picture
{-# INLINE line #-}
line = Line 0
line = Line
lineCol :: [(Point2,RGBA)] -> Picture
{-# INLINE lineCol #-}
lineCol = LineCol 0
lineCol = LineCol
thickLine :: [Point2] -> Float -> Picture
{-# INLINE thickLine #-}
@@ -234,9 +234,9 @@ thickArc :: Float -> Float -> Float -> Float -> Picture
thickArc startA endA rad wdth
| endA - startA > pi = pictures
[ thickArc (startA + pi) endA rad wdth
, ThickArc 0 startA (startA + pi) r w
, ThickArc startA (startA + pi) r w
]
| otherwise = ThickArc 0 startA endA r w
| otherwise = ThickArc startA endA r w
where
r = rad + 0.5 * wdth
w = 1 - wdth / r