Make pictures use Streaming

This commit is contained in:
2022-07-03 23:55:21 +01:00
parent f9a904d52b
commit 7fa391eb6c
8 changed files with 54 additions and 46 deletions
+3 -1
View File
@@ -16,6 +16,8 @@ import Polyhedra
import qualified IntMapHelp as IM
import LensHelp
import qualified Streaming.Prelude as S
colorLamp
:: Point3 -- color of lamp
-> Float -- height of lamp
@@ -39,7 +41,7 @@ lamp h = defaultInanimate
lampCrPic :: Float -> Picture
lampCrPic h = pictures
[ setLayer BloomLayer (setDepth h . color white $ circleSolid 3)
, concatMap (polyToTris . map f) $ boxXYZnobase 5 5 (h-1)
, foldMap (S.each . polyToTris . map f) $ boxXYZnobase 5 5 (h-1)
]
where
f pos = Verx (pos -.-.- V3 2.5 2.5 0) blue [] BottomLayer polyNum