Datum Reference Frames (cross-cutting/tolerancing/datum-reference-frames)
Use when the task is the datum system of a GD&T scheme: establishing
the datum reference frame from the datum precedence, the degrees of
freedom each datum constrains, the datum feature simulators, the
material condition modifiers on datum feature references, and the
feature control frame callout. This leaf defines the reference frame;
position tolerance zone math lives in position-tolerance-calc and
worst-case stackup lives in tolerance-stackup.
Domain quick reference
- A datum reference frame is the coordinate system established from
the datum features of a part, taken in precedence order: the
primary datum establishes the frame first, the secondary datum
locates the frame in the next direction, and the tertiary datum
finishes the location. The 3-2-1 rule is the common pattern: the
primary datum constrains three degrees of freedom, the secondary
two, the tertiary one.
- Six degrees of freedom exist: three translations (tx, ty, tz) and
three rotations (rx, ry, rz).
- Datum feature simulators: a planar surface is simulated by a plane
(three point contact), a cylindrical surface (hole, pin, shaft) by
its axis, a spherical surface by a point.
- A plane constrains one translation (along its normal) and two
rotations (tilting about the in-plane axes). An axis constrains two
translations (perpendicular to the axis) and two rotations. A point
constrains three translations.
- In a frame, each datum constrains only the degrees of freedom not
already constrained by the earlier datums, so swapping the primary
and secondary datums changes the constraint table.
- Material condition modifiers on datum feature references set the
simulator boundary: RMB (regardless of material boundary) fixes the
simulator with zero datum shift; MMB (maximum material boundary)
allows datum shift equal to the departure of the actual mating size
from the MMB size; LMB (least material boundary) allows datum shift
equal to the departure from the LMB size. For a hole the MMB size is
the smallest hole and the LMB size the largest; for a pin the MMB
size is the largest pin and the LMB size the smallest.
- The feature control frame is the drawing callout: the geometric
characteristic symbol, the tolerance value with an optional diameter
symbol and material condition modifier, then the datum feature
references with their modifiers, e.g. position symbol, diameter 0.5
at MMC, datums A, B at MMB, C.
Workflow
- Collect the datum feature references from the drawing callout in
precedence order: primary, secondary, tertiary. For each, record
the feature type (plane, axis, point), the orientation (x, y, z)
and any material condition modifier.
- Parse and validate the precedence with parse_datum_precedence.
- Build the reference frame with datum_reference_frame: read the
simulators and the constrained degrees of freedom table from the
result.
- Read the unconstrained degrees of freedom: a fully located frame
leaves none; a free rotation about a primary axis is a normal
result, not an error.
- Apply the material condition modifier with datum_shift to get the
datum shift available from each datum feature reference.
- Build the callout with feature_control_frame and report the frame
definition, the constraint table, the datum shifts, and the frame
string.
Datum system model
Degrees of freedom by simulator
| Feature type |
Simulator |
Constrains (orientation z shown) |
| plane |
plane |
tz, rx, ry (1 translation + 2 rotations) |
| axis |
axis (centerline) |
tx, ty, rx, ry (2 translations + 2 rotations) |
| point |
point |
tx, ty, tz (3 translations) |
Precedence arithmetic
Each datum contributes its own degree of freedom set minus everything
already constrained. Example, the 3-2-1 block:
- Primary plane with normal z: {tz, rx, ry}, three constrained.
- Secondary plane with normal x: own set {tx, ry, rz} minus the
primary leaves {tx, rz}, two constrained.
- Tertiary plane with normal y: own set {ty, rx, rz} minus both
leaves {ty}, one constrained.
Total six constrained, the frame is fully located. An axis primary
along z with two perpendicular planes leaves the rotation about the
axis free: that degree of freedom is reported unconstrained.
Material condition model
The modifier on a datum feature reference sets the simulator boundary
and the datum shift available:
| Modifier |
Boundary |
Datum shift |
| RMB |
fixed simulator |
0 |
| MMB (hole) |
MMB size = smallest hole |
actual mating size minus MMB size |
| MMB (pin) |
MMB size = largest pin |
MMB size minus actual mating size |
| LMB (hole) |
LMB size = largest hole |
LMB size minus actual mating size |
| LMB (pin) |
LMB size = smallest pin |
actual mating size minus LMB size |
Feature control frame string
Format: symbol | tolerance segment | datum references. The tolerance
segment is the optional diameter symbol, the tolerance value, and the
optional material condition modifier (M, L, S). Datum references are
uppercase letters with an optional MMB or LMB suffix. Example:
position symbol, diameter 0.5 at MMC, datum A, datum B at MMB, datum
C renders as the symbol, the segment diameter-0.5-M, then A, B-M, C.
Worked example
Mounting bracket: datum A is the base face (plane, normal z), datum B
is the side face (plane, normal x), datum C is the locating hole
(axis, z, referenced at MMB). The hole pattern uses a position
tolerance of 0.5 diameter at MMC.
- parse_datum_precedence returns A (plane, z, rmb), B (plane, x,
rmb), C (axis, z, mmb).
- datum_reference_frame: A constrains tz, rx, ry (3); B constrains
tx, rz (2); C constrains ty (1). Total six, nothing unconstrained.
- The locating hole measures 10.2 actual mating size against the
10.0 MMB size: datum_shift("mmb", "hole", 10.0, 10.2) gives 0.2
datum shift for datum C.
- feature_control_frame("position", 0.5, ("A", "B", {"letter": "C",
"modifier": "mmb"}), "mmc") renders the frame string: position
symbol, diameter 0.5 at MMC, datums A, B, C at MMB.
Pitfalls
- Confusing the datum system with the tolerance zone: the reference
frame defines where the coordinate system is and what each datum
locks; the position zone diameter and the stackup are separate
leaves (position-tolerance-calc, tolerance-stackup).
- Ignoring precedence: the secondary datum constrains only what the
primary left free; reporting its full own set double counts
degrees of freedom.
- Treating an unconstrained rotation as an error: an axis primary
legitimately leaves the rotation about the axis free until a
tertiary feature locks it.
- Reversing the MMB direction: a hole gains datum shift as it grows
past the MMB size, a pin as it shrinks below it.
- Forgetting the material condition modifier on the datum feature
reference: RMB is the default, MMB and LMB change both the boundary
and the available shift.
- Writing the callout without the diameter symbol for cylindrical
zones: position, concentricity, symmetry, and cylindricity zones
are diameters.
Behavior contract (gate 3)
The precedence parsing, simulator mapping, degree of freedom table,
material condition shift, and feature control frame string logic is
exercised by the gate 3 contract test:
scripts/test_datum_reference_frames.py against
scripts/datum_reference_frames_logic.py (stdlib unittest, offline).
Run:
python3 scripts/test_datum_reference_frames.py
Compliance
- Standards referenced, not reproduced: ASME Y14.5 is proprietary and
sold (ASME); the datum precedence method, the degree of freedom
model, the material condition boundary rules, and the feature
control frame format are common GD&T methodology, name and
paraphrase only per standards-map.yaml.
- compliance: STANDARDS-REF, gated: false (reference-only listing).
1---2name: datum-reference-frames3description: Use when you must establish the datum reference frame for a part per ASME Y14.5: parse the primary, secondary, and tertiary datum precedence from the drawing callout, compute the datum feature simulators (plane, axis, point), determine the degrees of freedom each datum constrains (translation and rotation), apply the material condition modifiers (MMB, LMB, RMB) to the datum feature references, and build the feature control frame string. Produces the datum reference frame definition, the constrained degrees of freedom table, the datum shift from the material condition modifier, and the feature control frame string that gates the GD&T scheme. Trigger: datum reference frame, datum precedence, primary secondary tertiary, degrees of freedom, datum shift, MMB LMB RMB, feature control frame.4license: Apache-2.05---6# Datum Reference Frames (cross-cutting/tolerancing/datum-reference-frames)78Use when the task is the datum system of a GD&T scheme: establishing9the datum reference frame from the datum precedence, the degrees of10freedom each datum constrains, the datum feature simulators, the11material condition modifiers on datum feature references, and the12feature control frame callout. This leaf defines the reference frame;13position tolerance zone math lives in position-tolerance-calc and14worst-case stackup lives in tolerance-stackup.1516## Domain quick reference1718- A datum reference frame is the coordinate system established from19 the datum features of a part, taken in precedence order: the20 primary datum establishes the frame first, the secondary datum21 locates the frame in the next direction, and the tertiary datum22 finishes the location. The 3-2-1 rule is the common pattern: the23 primary datum constrains three degrees of freedom, the secondary24 two, the tertiary one.25- Six degrees of freedom exist: three translations (tx, ty, tz) and26 three rotations (rx, ry, rz).27- Datum feature simulators: a planar surface is simulated by a plane28 (three point contact), a cylindrical surface (hole, pin, shaft) by29 its axis, a spherical surface by a point.30- A plane constrains one translation (along its normal) and two31 rotations (tilting about the in-plane axes). An axis constrains two32 translations (perpendicular to the axis) and two rotations. A point33 constrains three translations.34- In a frame, each datum constrains only the degrees of freedom not35 already constrained by the earlier datums, so swapping the primary36 and secondary datums changes the constraint table.37- Material condition modifiers on datum feature references set the38 simulator boundary: RMB (regardless of material boundary) fixes the39 simulator with zero datum shift; MMB (maximum material boundary)40 allows datum shift equal to the departure of the actual mating size41 from the MMB size; LMB (least material boundary) allows datum shift42 equal to the departure from the LMB size. For a hole the MMB size is43 the smallest hole and the LMB size the largest; for a pin the MMB44 size is the largest pin and the LMB size the smallest.45- The feature control frame is the drawing callout: the geometric46 characteristic symbol, the tolerance value with an optional diameter47 symbol and material condition modifier, then the datum feature48 references with their modifiers, e.g. position symbol, diameter 0.549 at MMC, datums A, B at MMB, C.5051## Workflow52531. Collect the datum feature references from the drawing callout in54 precedence order: primary, secondary, tertiary. For each, record55 the feature type (plane, axis, point), the orientation (x, y, z)56 and any material condition modifier.572. Parse and validate the precedence with parse_datum_precedence.583. Build the reference frame with datum_reference_frame: read the59 simulators and the constrained degrees of freedom table from the60 result.614. Read the unconstrained degrees of freedom: a fully located frame62 leaves none; a free rotation about a primary axis is a normal63 result, not an error.645. Apply the material condition modifier with datum_shift to get the65 datum shift available from each datum feature reference.666. Build the callout with feature_control_frame and report the frame67 definition, the constraint table, the datum shifts, and the frame68 string.6970## Datum system model7172### Degrees of freedom by simulator7374| Feature type | Simulator | Constrains (orientation z shown) |75|---|---|---|76| plane | plane | tz, rx, ry (1 translation + 2 rotations) |77| axis | axis (centerline) | tx, ty, rx, ry (2 translations + 2 rotations) |78| point | point | tx, ty, tz (3 translations) |7980### Precedence arithmetic8182Each datum contributes its own degree of freedom set minus everything83already constrained. Example, the 3-2-1 block:84851. Primary plane with normal z: {tz, rx, ry}, three constrained.862. Secondary plane with normal x: own set {tx, ry, rz} minus the87 primary leaves {tx, rz}, two constrained.883. Tertiary plane with normal y: own set {ty, rx, rz} minus both89 leaves {ty}, one constrained.9091Total six constrained, the frame is fully located. An axis primary92along z with two perpendicular planes leaves the rotation about the93axis free: that degree of freedom is reported unconstrained.9495### Material condition model9697The modifier on a datum feature reference sets the simulator boundary98and the datum shift available:99100| Modifier | Boundary | Datum shift |101|---|---|---|102| RMB | fixed simulator | 0 |103| MMB (hole) | MMB size = smallest hole | actual mating size minus MMB size |104| MMB (pin) | MMB size = largest pin | MMB size minus actual mating size |105| LMB (hole) | LMB size = largest hole | LMB size minus actual mating size |106| LMB (pin) | LMB size = smallest pin | actual mating size minus LMB size |107108### Feature control frame string109110Format: symbol | tolerance segment | datum references. The tolerance111segment is the optional diameter symbol, the tolerance value, and the112optional material condition modifier (M, L, S). Datum references are113uppercase letters with an optional MMB or LMB suffix. Example:114position symbol, diameter 0.5 at MMC, datum A, datum B at MMB, datum115C renders as the symbol, the segment diameter-0.5-M, then A, B-M, C.116117## Worked example118119Mounting bracket: datum A is the base face (plane, normal z), datum B120is the side face (plane, normal x), datum C is the locating hole121(axis, z, referenced at MMB). The hole pattern uses a position122tolerance of 0.5 diameter at MMC.1231241. parse_datum_precedence returns A (plane, z, rmb), B (plane, x,125 rmb), C (axis, z, mmb).1262. datum_reference_frame: A constrains tz, rx, ry (3); B constrains127 tx, rz (2); C constrains ty (1). Total six, nothing unconstrained.1283. The locating hole measures 10.2 actual mating size against the129 10.0 MMB size: datum_shift("mmb", "hole", 10.0, 10.2) gives 0.2130 datum shift for datum C.1314. feature_control_frame("position", 0.5, ("A", "B", {"letter": "C",132 "modifier": "mmb"}), "mmc") renders the frame string: position133 symbol, diameter 0.5 at MMC, datums A, B, C at MMB.134135## Pitfalls136137- Confusing the datum system with the tolerance zone: the reference138 frame defines where the coordinate system is and what each datum139 locks; the position zone diameter and the stackup are separate140 leaves (position-tolerance-calc, tolerance-stackup).141- Ignoring precedence: the secondary datum constrains only what the142 primary left free; reporting its full own set double counts143 degrees of freedom.144- Treating an unconstrained rotation as an error: an axis primary145 legitimately leaves the rotation about the axis free until a146 tertiary feature locks it.147- Reversing the MMB direction: a hole gains datum shift as it grows148 past the MMB size, a pin as it shrinks below it.149- Forgetting the material condition modifier on the datum feature150 reference: RMB is the default, MMB and LMB change both the boundary151 and the available shift.152- Writing the callout without the diameter symbol for cylindrical153 zones: position, concentricity, symmetry, and cylindricity zones154 are diameters.155156## Behavior contract (gate 3)157158The precedence parsing, simulator mapping, degree of freedom table,159material condition shift, and feature control frame string logic is160exercised by the gate 3 contract test:161scripts/test_datum_reference_frames.py against162scripts/datum_reference_frames_logic.py (stdlib unittest, offline).163Run:164python3 scripts/test_datum_reference_frames.py165166## Compliance167168- Standards referenced, not reproduced: ASME Y14.5 is proprietary and169 sold (ASME); the datum precedence method, the degree of freedom170 model, the material condition boundary rules, and the feature171 control frame format are common GD&T methodology, name and172 paraphrase only per standards-map.yaml.173- compliance: STANDARDS-REF, gated: false (reference-only listing).