Reset Shapes to be list (not stream) of ShapeObj

This commit is contained in:
2022-07-10 09:42:24 +01:00
parent 21f814ede1
commit a5730014c8
5 changed files with 33 additions and 18 deletions
+4 -2
View File
@@ -23,6 +23,8 @@ import qualified Streaming.Prelude as S
type SPic = (Shape, Picture)
shMap = map
-- should all this be inlined/inlinable?
noPic :: Shape -> SPic
{-# INLINE noPic #-}
@@ -58,12 +60,12 @@ rotateSP a = bimap (rotateSH a) (rotate a)
mirrorSPxz :: SPic -> SPic
{-# INLINE mirrorSPxz #-}
mirrorSPxz = bimap (S.map (over shVs reverse) . overPosSH flipy) mirrorxz
mirrorSPxz = bimap (shMap (over shVs reverse) . overPosSH flipy) mirrorxz
where
flipy (V3 x y z) = V3 x (negate y) z
mirrorSPyz :: SPic -> SPic
{-# INLINE mirrorSPyz #-}
mirrorSPyz = bimap (S.map (over shVs reverse) . overPosSH flipx) mirroryz
mirrorSPyz = bimap (shMap (over shVs reverse) . overPosSH flipx) mirroryz
where
flipx (V3 x y z) = V3 (negate x) y z