otaf.constants package

Module contents

Constants, regex patterns, and utilities for surface and gap modeling.

This module defines base surface types, directions, contact types, and regular expressions for validating naming patterns of surfaces and parts. It also includes mappings for constraints and degrees of freedom (DOFs).

Examples

>>> from otaf.constants import BASE_SURFACE_TYPES
>>> print(BASE_SURFACE_TYPES)
['plane', 'cylinder', 'cone', 'sphere']
otaf.constants.BASE_PART_SURF_PATTERN = re.compile('^P(\\d+)([a-z]+)$')

Regex pattern verifying structural part-surface tokens.

Matches naming schemes such as P1a, capturing the target part index and the surface identifier string.

otaf.constants.BASE_SURFACE_TYPES = ['plane', 'cylinder', 'cone', 'sphere']

List of supported surface types for geometric modeling.

Accepted types include 'plane', 'cylinder', 'cone', and 'sphere'. Only 'plane' and 'cylinder' are currently supported for interactions.

otaf.constants.BASIS_DICT

Matrix generators forming the mathematical $SE(3)$ displacement basis.

Provides projections, axes, and symbolic variable associations mapping minor variational transformations under small-displacement hypotheses.

Structure

dict of str to dict

Indexed by coordinate transformation entry tags ('1' through '6'). Inner components hold:

  • 'MATRIX' : list of list of int The coordinate translation or rotation generator step layout block.

  • 'AXIS' : str The target axis identifier symbol ('x', 'y', or 'z').

  • 'VARIABLE_D' : str The designated notation for tracking positional part deviation metrics.

  • 'VARIABLE_G' : str The designated notation for tracking feature clearance gap metrics.

meta hide-value:

otaf.constants.CONTACT_TYPES = ['FIXED', 'SLIDING', 'FLOATING']

List of cinematic contact interaction types between mating parts.

otaf.constants.CONTACT_TYPE_TO_GAP_DOF

Mapping from local interface boundary conditions to locked clearance DOFs.

Structure

dict of str to dict of str to str

Maps localized contact pairs (e.g., 'plane-plane-sliding') to locked directional components.

meta hide-value:

otaf.constants.D_MATRIX_MSTRING_PATTERN = re.compile('^D(\\d+)([a-z]+)$')

Regex for deviation matrix simplified naming, e.g., D1a.

otaf.constants.D_MATRIX_PATTERN1 = re.compile('^D(i*)(\\d+)([a-z]+)$')

Regex for deviation matrix type 1, e.g., D1a or Di1a.

otaf.constants.D_MATRIX_PATTERN2 = re.compile('^D(i*)(\\d+)([a-z]+)([A-Z]+\\d+)$')

Regex for deviation matrix type 2, e.g., D1aA5.

otaf.constants.D_MATRIX_PATTERN3 = re.compile('^D(i*)(\\d+)([a-z]+)(\\d+)([a-z]+)$')

Regex for deviation matrix type 3, e.g., D1a5b.

otaf.constants.GAP_TYPE_TO_NULLIFIED_NOMINAL_COMPONENTS

Mapping from gap topology variants to inactive perfect matrix items.

Structure

dict of str to dict of str to bool

Determines whether individual translational tracking axes must be nullified within nominal configuration models.

meta hide-value:

otaf.constants.GLOBAL_CONSTRAINTS_TO_DEVIATION_DOF

Mapping from dimensional constraints to dropped deviation DOFs.

Structure

dict of str to dict of str to str

Maps dimensional constraints (e.g., '2D_NX') to target strings identifying coordinate axes removed from calculations.

meta hide-value:

otaf.constants.GLOBAL_CONSTRAINTS_TO_GAP_DOF

Mapping from system spatial limits to constrained clearance gap DOFs.

Structure

dict of str to dict of str to str

Maps systemic dimensions to coordinate strings specifying blocked linear and rotational components.

meta hide-value:

otaf.constants.G_MATRIX_MSTRING_PATTERN = re.compile('^GP(\\d+)([a-z]+)([A-Z]+\\d+)P(\\d+)([a-z]+)([A-Z]+\\d+)$')

Regex for gap matrix simplified naming, e.g., GP1aA0P2aA0.

otaf.constants.G_MATRIX_PATTERN1 = re.compile('^GP(i*)(\\d+)([a-z]+)([A-Z]+\\d+)P(\\d+)([a-z]+)([A-Z]+\\d+)$')

Regex for gap matrix type 1, e.g., GPi1aA0P2aA0.

otaf.constants.G_MATRIX_PATTERN2 = re.compile('^GP(i*)(\\d+)([a-z]+)P(\\d+)([a-z]+)$')

Regex for gap matrix type 2, e.g., GPi1aP2a.

otaf.constants.LOC_STAMP_PATTERN = re.compile('^P(\\d+)([a-z]+)([A-Z]+\\d+)$')

Regex to validate positioning location stamp tokens (e.g., P1aA5).

otaf.constants.LOOP_ELEMENT_PATTERN = re.compile('^P\\d+[a-z]+[A-Z]+\\d+$')

Regex to validate kinematic loop element identifiers (e.g., P1aA5).

otaf.constants.SURFACE_DICT_VALUE_CHECKS

Validation lambdas checking individual parameter values for surfaces.

Structure

dict of str to callable

Maps metadata validation tokens ('TYPE', 'FRAME', 'ORIGIN', 'INTERACTIONS') to diagnostic execution rules checking conformance.

meta hide-value:

otaf.constants.SURFACE_DIRECTIONS = ['centripetal', 'centrifugal']

List of valid surface orientation vectors for revolutionary surfaces.

otaf.constants.SURF_ORIGIN_PATTERN = re.compile('[A-Z]+0+$')

Regex to validate surface origin names, e.g., AA0000.

otaf.constants.SURF_POINT_PATTERN = re.compile('[A-Z]+[0-9]+$')

Regex to validate surface point names, e.g., AA01.

otaf.constants.SURF_TYPE_TO_DEVIATION_DOF

Mapping from feature topology combinations to active deviation DOFs.

Structure

dict of str to dict of str to str

Maps joint feature configurations (e.g., 'plane-none') to active 'translations' and 'rotations' coordinate axis symbols.

meta hide-value:

otaf.constants.T_MATRIX_PATTERN = re.compile('^TP(\\d+)([a-z]+)([A-Z]+\\d+)([a-z]+)([A-Z]+\\d+)$')

Regex for coordinate transformation matrix matching (e.g., TP1aA0bB99).