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
+2 -1
View File
@@ -18,6 +18,7 @@ import Data.Maybe
import Data.List
import Data.Bifunctor
import Control.Lens
import qualified Streaming.Prelude as S
translateXY :: Float -> Float -> Polyhedra -> Polyhedra
translateXY x y = pyFaces %~ map (map $ first tran)
@@ -119,7 +120,7 @@ polyToPics :: Polyhedra -> [Picture]
polyToPics = map helpPoly3D . _pyFaces
helpPoly3D :: [(Point3, Point4)] -> Picture
helpPoly3D = map f . polyToTris
helpPoly3D = S.each . map f . polyToTris
where
f (pos,col) = Verx pos col [] BottomLayer polyNum