open Jog open Zone;; let topx = [[0; 1; 2]; [1; 0; 3]; [0; 2; 3]; [2; 1; 3]] in let (top, fx, tf) = mix (topx, (fun i j -> if i=j then 0. else 1.)) (rp 4) in let ini = ref {ray = (fun _ -> raise (OffTrack 3)); curl = (fun _ -> raise (OffTrack 4))} in let u = (fun t -> ini := t; t) and v = (fun x -> {x with ray = (fun fl fa -> print_float fl; if fl < 128. then x.ray fl fa else fa)}) in let bndry = Glue.morphgen (nz (fun i j -> if i=j then 0. else 1.)) top (tf [([0; 1], (nop, u)); ([1; 2], (v, v))]) in (bndry, (!ini).ray 0.0 ([|0.5|], [|0.5; (sqrt 3.) /. 2.|])) (* Should yield approx ([], ([|0.5; 0.|], [|-0.5; 0.866025403784438708|])) *);;