Skip to content

Tolerance

Tolerance defines the permissible variation for a measurement. The model can represent bilateral, unilateral, limit, or geometric tolerances, capturing upper and lower bounds, statistical modifiers, datum dependencies, and notes about inspection methods. It links to the associated dimension or feature, ensuring the tolerance is applied in context and includes unit information for accurate calculations. Having tolerances structured enables automated stack-up analyses, quality planning, SPC monitoring, and comparison of revisions to catch tightened or relaxed limits before they impact production, while also giving teams a template for communicating acceptance criteria to suppliers and auditors. The data can be exported directly into inspection balloons or CMM plans.

Bases: BaseModel

Represents a tolerance specification for a part or feature.

PARAMETER DESCRIPTION
tolerance_grade

The grade of tolerance, such as 'IT7' for an 'H7' fit. Calcuated if not specified.

TYPE: str | None DEFAULT: None

deviation_lower

The lower deviation limit in the specified unit. Use None if unspecified.

TYPE: Decimal | None DEFAULT: None

deviation_upper

The upper deviation limit in the specified unit. Use None if unspecified.

TYPE: Decimal | None DEFAULT: None

fit

The fit specification, such as 'H7'. Optional if not applicable.

TYPE: str | None DEFAULT: None

is_theoretically_exact

Whether the tolerance is theoretically exact (e.g., basic dimensions).

TYPE: bool DEFAULT: False

is_reference

Whether the tolerance serves as a reference dimension.

TYPE: bool DEFAULT: False

is_general_tolerance

Whether the general tolerance was applied to this dimension.

TYPE: bool DEFAULT: False

is_approximation

Whether the tolerance is an approximation (e.g., 'approx. 5').

TYPE: bool DEFAULT: False

Source code in werk24/models/v2/models.py
class Tolerance(BaseModel):
    """
    Represents a tolerance specification for a part or feature.
    """

    tolerance_grade: Optional[str] = Field(
        None,
        description="The grade of tolerance, such as 'IT7' for an 'H7' fit. Calcuated if not specified.",
        examples=["IT7"],
    )

    deviation_lower: Optional[Decimal] = Field(
        None,
        description="The lower deviation limit in the specified unit. Use None if unspecified.",
        examples=[Decimal("-0.05")],
    )

    deviation_upper: Optional[Decimal] = Field(
        None,
        description="The upper deviation limit in the specified unit. Use None if unspecified.",
        examples=[Decimal("0.05")],
    )

    fit: Optional[str] = Field(
        None,
        description="The fit specification, such as 'H7'. Optional if not applicable.",
        examples=["H7"],
    )

    is_theoretically_exact: bool = Field(
        False,
        description="Whether the tolerance is theoretically exact (e.g., basic dimensions).",
    )

    is_reference: bool = Field(
        False,
        description="Whether the tolerance serves as a reference dimension.",
    )

    is_general_tolerance: bool = Field(
        False,
        description="Whether the general tolerance was applied to this dimension.",
    )

    is_approximation: bool = Field(
        False,
        description="Whether the tolerance is an approximation (e.g., 'approx. 5').",
    )