All compile errors fixed, but now there's a weird NaN. The wonders never cease

This commit is contained in:
2023-01-30 21:40:58 +01:00
parent e45fab1389
commit cf300f3f88
7 changed files with 179 additions and 37 deletions

View File

@@ -90,9 +90,9 @@ specialize :: (Material mat) => Double -> [Element mat a] -> [Element ConstMat a
specialize wavelength = (each.material) %~ (ConstMat . iorAtWavelength wavelength)
-- | Annotate each material with the incoming index of refraction
bake :: (Material mat) => Double -> [Element mat a] -> [Element BakedIOR a]
bake wavelength mat =
bake wavelength system =
snd $
mapAccumLOf (each.material) (\n1 (ConstMat n2) -> (n2, BakedIOR n1 n2)) 1 $
specialize wavelength mat
specialize wavelength system