-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
let N_coating_coefs = i64.i32 8 | ||
let N_coating_specs = i64.i32 26 | ||
type coating = #AntiReflective | ||
| #Mirror | ||
| #Absorbing | ||
| #PhaseGradient_IdealFocus {lam: f64, f: f64} | ||
| #PhaseGradient_RotSym_Dispersive {lam_d: f64, phi0: [N_coating_coefs]f64, GD: [N_coating_coefs]f64, GDD: [N_coating_coefs]f64} | ||
|
||
def parse_coatings (coating_list_array: [][N_coating_specs]f64): []coating = | ||
let parse (specs: [N_coating_specs]f64) : coating = | ||
let enum = i64.f64 specs[0] | ||
in match enum | ||
case 0 -> -- AntiReflective | ||
#AntiReflective | ||
case _ -> | ||
#AntiReflective | ||
in map parse coating_list_array | ||
|
||
entry RayTrace (coating_list_array: [][N_coating_specs]f64) : []coating = | ||
let coatings = parse_coatings coating_list_array | ||
in coatings |