rayoptics.elem.layout module

Interactive 2D lens picture

The Lens Layout capability provides a 2D display of the optical model represented by shapes. Shapes contain dict attributes to manage the graphical rendering and editing actions associated with their parent objects. These attributes must include:

handles: named graphic handles for different aspects of the parent object

actions: functions for press, drag, and release actions

light_or_dark(is_dark=True)[source]
create_optical_element(opt_model, e)[source]
class OpticalElement(opt_model, e)[source]

Bases: object

mediator class for rendering and editing optical elements

listobj_str()[source]
update_shape(view)[source]
render_color()[source]
get_label()[source]
edit_shape_actions()[source]
class RayBundle(opt_model, fld, fld_label, wvl, start_offset, ray_table_callback=None)[source]

Bases: object

class for ray bundle from a single field point

listobj_str()[source]
get_label()[source]
render_ray(ray, tfrms)[source]
render_shape(rayset, tfrms)[source]
update_shape(view)[source]
edit_ray_bundle_actions()[source]
class RayFanBundle(opt_model, ray_fan, start_offset, label='ray fan')[source]

Bases: object

class for a RayFan from a single field point

listobj_str()[source]
get_label()[source]
render_ray(ray_pkg, tfrms)[source]
update_shape(view)[source]
class SingleRay(opt_model, ray, start_offset, label='single ray')[source]

Bases: object

class for a Ray from a single field point

listobj_str()[source]
get_label()[source]
render_ray(ray_pkg, tfrms)[source]
update_shape(view)[source]
class ParaxialRay(opt_model, ray, color, seq_start=1, label='paraxial')[source]

Bases: object

class for paraxial ray rendering/editing

listobj_str()[source]
get_label()[source]
render_ray(ray, tfrms)[source]
update_shape(view)[source]
apply_data(vertex, lcl_pt)[source]
edit_paraxial_layout_actions()[source]
class LensLayout(opt_model, is_dark=True, **kwargs)[source]

Bases: object

manager for live layout graphics entities

sync_light_or_dark(is_dark)[source]
system_length(ele_bbox, offset_factor=0.05)[source]

returns system length and ray start offset

renderable_pt_nodes(part_filter='')[source]
create_element_entities(view, part_filter='')[source]
create_oe(e)[source]

opaque wrapper for create_optical_element()

create_ray_entities(view, start_offset)[source]
create_ray_fan_entities(view, start_offset, num_rays=21)[source]
create_paraxial_ray_entities(view)[source]
get_ray_table()[source]
register_commands(*args, **kwargs)[source]
add_element_cmd_actions(**kwargs)[source]
split_gap(opt_model, idx, lcl_pt)[source]

split g=gap[idx] into t_old = t_0 + t_k using t_0 = lcl_pt.x

add_elements(opt_model, idx, lcl_pt, create, **kwargs)[source]
add_reflector(opt_model, idx, lcl_pt, create, **kwargs)[source]
add_thinlens(opt_model, idx, lcl_pt, **kwargs)[source]
add_lens(opt_model, idx, lcl_pt, **kwargs)[source]
add_mirror(opt_model, idx, lcl_pt, **kwargs)[source]
add_conic(opt_model, idx, lcl_pt, **kwargs)[source]
add_doublet(opt_model, idx, lcl_pt, **kwargs)[source]
class GlassDropAction[source]

Bases: object

dragEnterEvent(canvas_fig, event)[source]
dragMoveEvent(canvas_fig, event)[source]
dragLeaveEvent(canvas_fig, event)[source]
dropEvent(canvas_fig, event)[source]