module Diagrams.ThreeD.Deform where
import Control.Lens
import Diagrams.Deform
import Diagrams.Coordinates
import Diagrams.ThreeD.Types
parallelX0 :: Deformation R3
parallelX0 = Deformation (& _x .~ 0)
perspectiveX1 :: Deformation R3
perspectiveX1 = Deformation (\p -> let x = p^._x in
p & _x .~ 1 & _y //~ x & _z //~ x )
parallelY0 :: Deformation R3
parallelY0 = Deformation (& _y .~ 0)
perspectiveY1 :: Deformation R3
perspectiveY1 = Deformation (\p -> let y = p^._y in
p & _x //~ y & _y .~ 1 & _z //~ y )
parallelZ0 :: Deformation R3
parallelZ0 = Deformation (& _z .~ 0)
perspectiveZ1 :: Deformation R3
perspectiveZ1 = Deformation (\p -> let z = p^._z in
p & _x //~ z & _y //~ z & _z .~ 1 )
facingX :: Deformation R3
facingX = Deformation (\v -> v & _y //~ (v^._x) & _z //~ (v^._x))
facingY :: Deformation R3
facingY = Deformation (\v -> v & _x //~ (v^._y) & _z //~ (v^._y))
facingZ :: Deformation R3
facingZ = Deformation (\v -> v & _x //~ (v^._z) & _y //~ (v^._z))