]> gitweb.michael.orlitzky.com - spline3.git/blob - src/Face.hs
Move some dead code out of Face and add it to Cube where it now belongs.
[spline3.git] / src / Face.hs
1 module Face
2 where
3
4 import Point
5 import ThreeDimensional
6
7 data Face = Face { v0 :: Point,
8 v1 :: Point,
9 v2 :: Point,
10 v3 :: Point }
11 deriving (Eq)
12
13 instance Show Face where
14 show f = "Face:\n" ++
15 " v0: " ++ (show (v0 f)) ++ "\n" ++
16 " v1: " ++ (show (v1 f)) ++ "\n" ++
17 " v2: " ++ (show (v2 f)) ++ "\n" ++
18 " v3: " ++ (show (v3 f)) ++ "\n"
19
20 instance ThreeDimensional Face where
21 center f = ((v0 f) + (v1 f) + (v2 f) + (v3 f)) `scale` (1/4)
22 -- Too lazy to implement this right now.
23 contains_point _ _ = False