visualization.coloring.properties#
Component Property Module
This module contains value functions that read a glass property of each lens
element, for use with PropertyColorizer.
Kramer Harrison, 2026
Functions
|
Abbe number V_d of a lens element's glass. |
|
Build a value function giving each lens element's refractive index. |
- abbe_number(optic: Optic, ref: ComponentRef) float | None[source]#
Abbe number V_d of a lens element’s glass.
V_d is always computed from the glass’s indices at the Fraunhofer d, F and C lines, so materials defined by a stored Abbe number in another convention (e.g. V_e for
AbbeMaterialE) are colored on the same scale as catalog glasses.Example
>>> from optiland.visualization.coloring import ( ... ColorScale, PropertyColorizer, abbe_number) >>> optic.draw(component_colorizer=PropertyColorizer( ... abbe_number, ColorScale(cmap="coolwarm_r", label="Abbe number")))
- Parameters:
optic (Optic) – The system being drawn.
ref (ComponentRef) – The component to evaluate.
- Returns:
V_d, or None for components that are not lens elements and for materials without dispersion (e.g.
IdealMaterial), which keep the default color.- Return type:
float | None
- refractive_index(wavelength: float | None = None) Callable[[Optic, ComponentRef], float | None][source]#
Build a value function giving each lens element’s refractive index.
Example
>>> from optiland.visualization.coloring import ( ... ColorScale, PropertyColorizer, refractive_index) >>> optic.draw(component_colorizer=PropertyColorizer( ... refractive_index(0.5876), ColorScale(label="n_d")))
- Parameters:
wavelength (float | None) – Wavelength in microns. None means the optic’s primary wavelength at the time of drawing.
- Returns:
Value function for
PropertyColorizerthat returns the index, or None for components that are not lens elements.- Return type:
Callable[[Optic, ComponentRef], float | None]