import Cube (Cube(Cube), find_containing_tetrahedra)
import FunctionValues
import Point (Point)
+import ScaleFactor
import Tetrahedron (polynomial)
import Values (Values3D, dims, empty3d, zoom_shape)
{-# INLINE zoom_lookup #-}
-zoom_lookup :: Grid -> Int -> a -> (R.DIM3 -> Double)
+zoom_lookup :: Grid -> ScaleFactor -> a -> (R.DIM3 -> Double)
zoom_lookup g scale_factor _ = zoom_result g scale_factor
{-# INLINE zoom_result #-}
-zoom_result :: Grid -> Int -> R.DIM3 -> Double
-zoom_result g scale_factor (R.Z R.:. i R.:. j R.:. k) =
+zoom_result :: Grid -> ScaleFactor -> R.DIM3 -> Double
+zoom_result g (sfx, sfy, sfz) (R.Z R.:. i R.:. j R.:. k) =
f p
where
- sf = fromIntegral scale_factor
- i' = fromIntegral i / sf
- j' = fromIntegral j / sf
- k' = fromIntegral k / sf
+ i' = (fromIntegral i) / (fromIntegral sfx)
+ j' = (fromIntegral j) / (fromIntegral sfy)
+ k' = (fromIntegral k) / (fromIntegral sfz)
p = (i', j', k') :: Point
c = find_containing_cube g p
t = head (find_containing_tetrahedra c p)
f = polynomial t
-zoom :: Grid -> Int -> Values3D
+zoom :: Grid -> ScaleFactor -> Values3D
zoom g scale_factor
| xsize == 0 || ysize == 0 || zsize == 0 = empty3d
| otherwise =