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

SCOPES

Where each built-in tolerance type is applied by add_default_tolerances.

Functions

add_default_tolerances(tolerancing, table[, ...])

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 table maps a tolerance type to its size: a number (a symmetric limit) or a dict of add_tolerance arguments (limit, or minus and plus, and optionally distribution). Types are placed by scope:

  • surface types (radius, fringes, conic, irregularity, surface_decenter, surface_tilt): every refracting or reflecting surface; radius and conic only 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;

  • index and abbe: 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.