rayoptics.elem.elements module
Module for element modeling
- class GraphicsHandle(polydata, tfrm, polytype, color)
Bases:
tuple
- color
RGBA for the polydata or None for default
- polydata
poly data in local coordinates
- polytype
‘polygon’ (for filled) or ‘polyline’
- tfrm
global transformation for polydata
- create_mirror(c=0.0, r=None, cc=0.0, ec=None, power=None, profile=None, sd=None, **kwargs)[source]
Create a sequence and element for a mirror.
- Parameters:
c – vertex curvature
r – vertex radius of curvature
cc – conic constant
ec – = 1 + cc
power – optical power of the mirror
sd – semi-diameter
profile – Spherical or Conic type, or a profile instance
- create_lens(power=0.0, bending=0.0, th=None, sd=1.0, med=None, lens=None, **kwargs)[source]
Create a lens element chunk of sm, em, and pt tree
- Parameters:
kwargs –
keyword arguments including:
idx: insertion point in the sequential model
t: the thickness following a chunk when inserting
lens: tuple of cv1, cv2, th, glass_name_catalog, sd where:
cv1: front curvature
cv2: rear curvature
th: lens thickness
glass_input: a str, e.g. ‘N-BK7, Schott’ or index (+V-number)
sd: lens semi-diameter
- achromat(power, Va, Vb)[source]
Compute lens powers for a thin doublet achromat, given their V-numbers.
- create_cemented_doublet(power=0.0, bending=0.0, th=None, sd=1.0, glasses=('N-BK7,Schott', 'N-F2,Schott'), **kwargs)[source]
- full_profile(profile, is_flipped, edge_extent, flat_id=None, hole_id=None, dir=1, steps=6)[source]
Produce a 2d segmented approximation to the profile.
- Parameters:
profile – optical profile to be sampled
is_flipped – the flipped state of the profile
edge_extent – tuple with symmetric or asymetric bounds
flat_id – if not None, inside diameter of flat zone
hole_id – if not None, inside diameter of centered surface hole
dir – sampling direction, +1 for up, -1 for down
steps – number of profile curve samples
- class Part(*args, **kwargs)[source]
Bases:
Protocol
Abstract base class for all types of elements.
- abstract sync_to_seq(seq_model: SequentialModel)[source]
- abstract profile_list() List[SurfaceProfile] [source]
- abstract render_shape() List[GraphicsHandle] [source]
return a polyline that is representative of the cemented element.
- abstract render_handles(opt_model) Dict[str, GraphicsHandle] [source]
- do_flip_with_part_list(part_list: List[Part], flip_pt_tfrm) None [source]
Flip a list of parts around a flip_pt.
- class Element(s1, s2, g, tfrm=None, idx=0, idx2=1, sd=1.0, label=None)[source]
Bases:
Part
Lens element domain model. Manage rendering and selection/editing.
An Element consists of 2 Surfaces, 1 Gap, and edge_extent information.
- tfrm
global transform to element origin, (Rot3, trans3)
- medium_name
the material filling the gap
- flat1, flat2
semi-diameter of flat or None. Setting to None will result in re-evaluation of flat ID
- do_flat1, do_flat2
‘if concave’, ‘always’, ‘never’, ‘if convex’
- handles
dict of graphical entities
- actions
dict of actions associated with the graphical handles
- clut = <rayoptics.util.rgbtable.RGBTable object>
- serial_number = 0
- property sd
Semi-diameter
- class Mirror(ifc, tfrm=None, idx=0, sd=1.0, thi=None, z_dir=1.0, label=None)[source]
Bases:
Part
- serial_number = 0
- class CementedElement(ifc_list, label=None)[source]
Bases:
Part
Cemented element domain model. Manage rendering and selection/editing.
A CementedElement consists of 3 or more Surfaces, 2 or more Gaps, and edge_extent information.
- idxs
list of seq_model interface indices (depends on is_flipped)
- tfrm
global transform to element origin, (Rot3, trans3)
- medium_name
the material filling the gap
- flats
semi-diameter of flat if ifc is concave, or None
- handles
dict of graphical entities
- actions
dict of actions associated with the graphical handles
- clut = <rayoptics.util.rgbtable.RGBTable object>
- serial_number = 0
- property sd
Semi-diameter
- compute_inner_flat(idx, sd)[source]
compute flats, if needed, for the inner cemented surfaces.
- Parameters:
idx – index of inner surface in profile list
sd – the semi-diameter of the cemented element
This function is needed to handle the cases where one of the outer surfaces has a flat and the inner surface would intersect this flat. All inner cemented surfaces are assumed to be spherical. See model US007277232_Example04P.roa
- class ThinElement(ifc, tfrm=None, idx=0, sd=None, label=None)[source]
Bases:
Part
- serial_number = 0
- class DummyInterface(ifc, idx=0, sd=None, tfrm=None, label=None)[source]
Bases:
Part
- serial_number = 0
- class AirGap(g, idx=0, tfrm=None, label=None, z_dir=1, **kwargs)[source]
Bases:
Part
- serial_number = 0