Redo shape vertices as a list, should allow for mirroring

This commit is contained in:
2022-07-04 23:17:53 +01:00
parent 914c452afb
commit 22ac8feb37
6 changed files with 35 additions and 43 deletions
+8 -9
View File
@@ -18,6 +18,8 @@ import Picture
import Geometry
import Data.Bifunctor
import Control.Lens
import qualified Streaming.Prelude as S
type SPic = (Shape, Picture)
@@ -49,14 +51,11 @@ rotateSP :: Float -> SPic -> SPic
rotateSP a = bimap (rotateSH a) (rotate a)
mirrorSPxz :: SPic -> SPic
mirrorSPxz = bimap id mirrorxz
--mirrorSPxz = bimap (reverse . overPosSH flipy) mirrorxz
-- where
-- flipy (V3 x y z) = V3 x (negate y) z
mirrorSPxz = bimap (S.map (over shVs reverse) . overPosSH flipy) mirrorxz
where
flipy (V3 x y z) = V3 x (negate y) z
mirrorSPyz :: SPic -> SPic
mirrorSPyz = bimap id mirroryz
-- this can be done by creating a reverse topprism ShapeObj
--mirrorSPyz = bimap (reverse . overPosSH flipx) mirroryz
-- where
-- flipx (V3 x y z) = V3 (negate x) y z
mirrorSPyz = bimap (S.map (over shVs reverse) . overPosSH flipx) mirroryz
where
flipx (V3 x y z) = V3 (negate x) y z