Simplify facade shape coloring

This commit is contained in:
2025-12-07 20:19:27 +00:00
parent 79f86a3158
commit 9e98cdc34b
3 changed files with 23 additions and 29 deletions
+8 -9
View File
@@ -13,25 +13,24 @@ import Geometry
import Shape
tankSquareDec ::
(Float -> Float -> Float -> Color -> Shape) ->
(Float -> Float -> Float -> Shape) ->
Color ->
Color ->
Placement
--tankSquareDec dec = tankShape (reverse . orderPolygon $ square 20) (dec 20 20 31)
tankSquareDec dec = tankShape (orderPolygon $ square 20) (dec 20 20 31)
tankShape :: [Point2] -> (Color -> Shape) -> Color -> Color -> Placement
tankShape baseshape facade col col' = sps0 $ decoratedBlock (facade col') Metal col 31 baseshape
tankShape :: [Point2] -> Shape -> Color -> Color -> Placement
tankShape baseshape facade col col' = sps0 $ decoratedBlock (colorSH col' facade) Metal col 31 baseshape
roundTank :: Color -> Color -> Placement
roundTank = tankShape (polyCirc 4 20) $
\c' -> colorSH c' $ foldMap toprail (take 8 [0, pi / 4 ..])
roundTank c c' = tankShape (polyCirc 4 20)
(colorSH c' $ foldMap toprail (take 8 [0, pi / 4 ..])) c c'
where
toprail a = rotateSH a $ thinHighBar 31 (V2 0 20) (rotateV (pi / 4) $ V2 0 20)
roundTankCross :: Color -> Color -> Placement
roundTankCross = tankShape (polyCirc 4 20) $
\c ->
colorSH c $
roundTankCross c' c = tankShape (polyCirc 4 20)
(colorSH c $
thinHighBar 31 (V2 20 0) (V2 (-20) 0)
<> thinHighBar 31 (V2 0 20) (V2 0 (-20))
<> thinHighBar 31 (V2 0 20) (V2 0 (-20))) c' c