tolerancing.presets#
Tolerance Presets Module
This module fills a tolerancing problem from a table of default tolerances, in the way a shop’s standard tolerances are applied to every surface, gap, element and glass of a design.
Optiland ships no built-in grade tables: published “commercial / precision / high precision” values differ between vendors and none is a standard (ISO 10110 defines the notation, not the values). Pass the table of your shop or vendor.
Kramer Harrison, 2026
Module Attributes
Where each built-in tolerance type is applied by |
Functions
|
Add the tolerances of a table to every matching part of the design. |
- SCOPES: dict[str, str] = {'abbe': 'glass', 'conic': 'surface', 'element_decenter': 'element', 'element_roll': 'element', 'element_tilt': 'element', 'fringes': 'surface', 'index': 'glass', 'irregularity': 'surface', 'radius': 'surface', 'surface_decenter': 'surface', 'surface_tilt': 'surface', 'thickness': 'gap'}#
Where each built-in tolerance type is applied by
add_default_tolerances.
- add_default_tolerances(tolerancing: Tolerancing, table: Mapping[str, Any], surfaces: Iterable[int] | None = None) list[Tolerance][source]#
Add the tolerances of a table to every matching part of the design.
Each entry of
tablemaps a tolerance type to its size: a number (a symmetriclimit) or a dict ofadd_tolerancearguments (limit, orminusandplus, and optionallydistribution). Types are placed by scope:surface types (
radius,fringes,conic,irregularity,surface_decenter,surface_tilt): every refracting or reflecting surface;radiusandconiconly on curved ones;thickness: every gap next to such a surface, except the gap in front of the image, which is usually the focus compensator;element types (
element_decenter,element_tilt,element_roll): every run of surfaces with glass between them;indexandabbe: every surface followed by glass.
Decenters and tilts are added once for x and once for y.
- Parameters:
tolerancing – The tolerancing problem to add to.
table – Tolerance type to size, e.g.
{"fringes": 2, "thickness": 0.05, "surface_tilt": 0.02}.surfaces – Restrict to these surface numbers. An element is kept when its first surface is listed. Defaults to all.
- Returns:
The added tolerances, in the order they were added.
- Raises:
ValueError – If a type has no known scope or an entry is malformed.
TypeError – If an entry is neither a number nor a dict.