cube_properties,
find_containing_tetrahedron,
tetrahedra,
- tetrahedron
- )
+ tetrahedron )
where
-import Data.Maybe (fromJust)
+import Data.Maybe ( fromJust )
import qualified Data.Vector as V (
Vector,
findIndex,
minimum,
singleton,
snoc,
- unsafeIndex
- )
-
-import Prelude hiding (LT)
-import Test.Framework (Test, testGroup)
-import Test.Framework.Providers.QuickCheck2 (testProperty)
-import Test.QuickCheck (Arbitrary(..), Gen, Positive(..), choose)
-
-import Cardinal
-import Comparisons ((~=), (~~=))
-import qualified Face (Face(..), center)
-import FunctionValues (FunctionValues, eval, rotate)
-import Misc (all_equal, disjoint)
-import Point (Point(..), dot)
-import Tetrahedron (Tetrahedron(..), barycenter, c, volume)
+ unsafeIndex)
+import Prelude hiding ( LT )
+import Test.Framework ( Test, testGroup )
+import Test.Framework.Providers.QuickCheck2 ( testProperty )
+import Test.QuickCheck ( Arbitrary(..), Gen, Positive(..), choose )
+
+import Cardinal (
+ Cardinal(..),
+ ccwx,
+ ccwy,
+ ccwz,
+ cwx,
+ cwy,
+ cwz )
+import Comparisons ( (~=), (~~=) )
+import qualified Face ( Face(..), center )
+import FunctionValues ( FunctionValues, eval, rotate )
+import Misc ( all_equal, disjoint )
+import Point ( Point(..), dot )
+import Tetrahedron ( Tetrahedron(..), barycenter, c, volume )
data Cube = Cube { i :: !Int,
j :: !Int,
left_half = in_left_half cube p
candidates :: V.Vector Tetrahedron
- candidates =
- if front_half then
-
+ candidates
+ | front_half =
if left_half then
if top_half then
front_left_top_tetrahedra cube
else
front_right_down_tetrahedra cube
- else -- bottom half
-
+ | otherwise = -- back half
if left_half then
if top_half then
back_left_top_tetrahedra cube