rayoptics.elem.transform module
Useful transforms for processing sequential models
- compute_global_coords(seq_model, glo=1, origin=None)[source]
Return global surface coordinates (rot, t) wrt surface glo.
- Parameters:
seq_model – sequential model
glo – global reference surface index
origin – None | (r_origin, t_origin)
The tuple (r_origin, t_origin) is the transform from the desired global origin to the global surface glo.
- compute_local_transforms(seq_model, seq, step)[source]
Return forward surface coordinates (r.T, t) for each interface.
- forward_transform(s1, zdist, s2)[source]
generate transform rotation and translation from s1 coords to s2 coords
- reverse_transform(s2, zdist, s1)[source]
generate transform rotation and translation from s2 coords to s1 coords, applying transforms in the reverse order
- cascade_transform(r_prev, t_prev, r_seg, t_seg)[source]
take the seg transform and cascade it with the prev transform
- transfer_coords(r_seg, t_seg, pt_s1, dir_s1)[source]
take p and d in s1 coords of seg and transfer them to s2 coords
- transform_before_surface(interface, ray_seg)[source]
Transform ray_seg from interface to previous seg.
- Parameters:
interface – the
Interface
for the path sequenceray_seg – ray segment exiting from interface
- Returns:
(b4_pt, b4_dir)
b4_pt - ray intersection pt wrt following seg
b4_dir - ray direction cosine wrt following seg
- transform_after_surface(interface, ray_seg)[source]
Transform ray_seg from interface to following seg.
- Parameters:
interface – the
Interface
for the path sequenceray_seg – ray segment exiting from interface
- Returns:
(b4_pt, b4_dir)
b4_pt - ray intersection pt wrt following seg
b4_dir - ray direction cosine wrt following seg