Revert "Turn Shape into a stream"

This reverts commit c7e720248d.
This commit is contained in:
2022-06-27 18:41:43 +01:00
parent c7e720248d
commit 03b37c4e7b
11 changed files with 32 additions and 42 deletions
+13 -17
View File
@@ -1,5 +1,3 @@
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TupleSections #-}
module ShapePicture
( emptyBlank
@@ -12,25 +10,23 @@ module ShapePicture
, noShape
, _spShape
, _spPicture
-- , mirrorSPyz
-- , mirrorSPxz
, mirrorSPyz
, mirrorSPxz
) where
import Shape
import Picture
import Geometry
import qualified Data.Vector.Fusion.Stream.Monadic as VS
import Data.Bifunctor
--import Control.Lens
type SPic = (Shape, Picture)
type SPic = (Shape, Picture)
-- should all this be inlined/inlinable?
noPic :: Shape -> SPic
noPic = (,mempty)
noShape :: Picture -> SPic
noShape = (VS.empty,)
noShape = (mempty,)
_spShape :: SPic -> Shape
_spShape = fst
@@ -52,12 +48,12 @@ translateSP v = bimap (translateSH v) (translate3 v)
rotateSP :: Float -> SPic -> SPic
rotateSP a = bimap (rotateSH a) (rotate a)
--mirrorSPxz :: SPic -> SPic
--mirrorSPxz = bimap (reverse . overPosSH flipy) mirrorxz
-- where
-- flipy (V3 x y z) = V3 x (negate y) z
--
--mirrorSPyz :: SPic -> SPic
--mirrorSPyz = bimap (reverse . overPosSH flipx) mirroryz
-- where
-- flipx (V3 x y z) = V3 (negate x) y z
mirrorSPxz :: SPic -> SPic
mirrorSPxz = bimap (reverse . overPosSH flipy) mirrorxz
where
flipy (V3 x y z) = V3 x (negate y) z
mirrorSPyz :: SPic -> SPic
mirrorSPyz = bimap (reverse . overPosSH flipx) mirroryz
where
flipx (V3 x y z) = V3 (negate x) y z