{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}
module Diagrams.ThreeD.Size
(
extentX, extentY, extentZ
, mkSizeSpec3D
, dims3D
) where
import Diagrams.Core
import Diagrams.Core.Envelope
import Diagrams.Size
import Diagrams.TwoD.Size
import Diagrams.ThreeD.Types
import Diagrams.ThreeD.Vector
extentZ :: (InSpace v n a, R3 v, Enveloped a) => a -> Maybe (n, n)
extentZ :: a -> Maybe (n, n)
extentZ = v n -> a -> Maybe (n, n)
forall a (v :: * -> *) n.
(V a ~ v, N a ~ n, Enveloped a) =>
v n -> a -> Maybe (n, n)
extent v n
forall (v :: * -> *) n. (R3 v, Additive v, Num n) => v n
unitZ
mkSizeSpec3D :: Num n => Maybe n -> Maybe n -> Maybe n -> SizeSpec V3 n
mkSizeSpec3D :: Maybe n -> Maybe n -> Maybe n -> SizeSpec V3 n
mkSizeSpec3D Maybe n
x Maybe n
y Maybe n
z = V3 (Maybe n) -> SizeSpec V3 n
forall (v :: * -> *) n.
(Functor v, Num n) =>
v (Maybe n) -> SizeSpec v n
mkSizeSpec (Maybe n -> Maybe n -> Maybe n -> V3 (Maybe n)
forall a. a -> a -> a -> V3 a
V3 Maybe n
x Maybe n
y Maybe n
z)
dims3D :: n -> n -> n -> SizeSpec V3 n
dims3D :: n -> n -> n -> SizeSpec V3 n
dims3D n
x n
y n
z = V3 n -> SizeSpec V3 n
forall (v :: * -> *) n. v n -> SizeSpec v n
dims (n -> n -> n -> V3 n
forall a. a -> a -> a -> V3 a
V3 n
x n
y n
z)