rayoptics.mpl.interactivelayout module

Interactive layout figure with paraxial editing

class InteractiveLayout(opt_model, refresh_gui=None, offset_factor=0.05, do_draw_rays=True, do_draw_beams=True, do_draw_edge_rays=True, do_draw_ray_fans=False, num_rays_in_fan=11, do_paraxial_layout=False, entity_factory_list=None, **kwargs)[source]

Bases: InteractiveFigure

Editable version of optical system layout, aka Live Layout

opt_model

parent optical model

refresh_gui

function to be called on refresh_gui event

offset_factor

how much to draw rays before first surface

do_draw_rays

if True, draw edge rays

do_paraxial_layout

if True, draw editable paraxial axial and chief ray

entity_factory_list

list of drawable entity factories. Allows new drawables to be added to the layout.

set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, canvas=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, constrained_layout=<UNSET>, constrained_layout_pads=<UNSET>, dpi=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, figheight=<UNSET>, figwidth=<UNSET>, frameon=<UNSET>, gid=<UNSET>, in_layout=<UNSET>, label=<UNSET>, layout_engine=<UNSET>, linewidth=<UNSET>, mouseover=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, rasterized=<UNSET>, size_inches=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, tight_layout=<UNSET>, transform=<UNSET>, url=<UNSET>, view_bbox=<UNSET>, visible=<UNSET>, zorder=<UNSET>)

Set multiple properties at once.

Supported properties are

Properties:

agg_filter: a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image alpha: scalar or None animated: bool canvas: FigureCanvas clip_box: .Bbox clip_on: bool clip_path: Patch or (Path, Transform) or None constrained_layout: unknown constrained_layout_pads: unknown dpi: float edgecolor: color facecolor: color figheight: float figure: .Figure figwidth: float frameon: bool gid: str in_layout: bool label: object layout_engine: unknown linewidth: number mouseover: bool path_effects: .AbstractPathEffect picker: None or bool or float or callable rasterized: bool size_inches: (float, float) or float sketch_params: (scale: float, length: float, randomness: float) snap: bool or None tight_layout: unknown transform: .Transform url: str view_bbox: unknown visible: bool zorder: float

sync_light_or_dark(is_dark, **kwargs)[source]
update_data(**kwargs)[source]
action_complete()[source]
fit_axis_limits()[source]

returns a numpy bounding box that fits the current data