Home Tutorial Tolerance 3D Analysis GitHub

3D Tolerance Analysis with GD&T

Enter your GD&T callouts and let TDT compute 6-DOF tolerance stackups automatically.

Overview

TDT's 3D tolerance analysis lets you work with familiar GD&T symbols from your drawings. Enter your position, perpendicularity, runout, and other callouts, and TDT automatically converts them to a 6-DOF analysis.

The GD&T-First Approach

Most tolerance tools require you to understand torsor theory before specifying tolerances. TDT works the other way: enter your GD&T as it appears on the drawing, and we handle the math.

What You Get

  • Automatic DOF mapping - GD&T symbols map to the correct degrees of freedom based on geometry
  • Material condition bonuses - MMC/LMC bonus calculations are automatic
  • Datum reference frames - ASME Y14.5 3-2-1 rule is applied automatically
  • Validation - TDT warns if your GD&T changes but torsor bounds are stale

GD&T Symbol Reference

TDT supports these GD&T symbols. The table shows which degrees of freedom each symbol affects based on your geometry type.

Position and Location

SymbolGD&TGeometryAffects DOFFormula
position cylinder u, v ±(tol / 2)
position sphere, point u, v, w ±(tol / 2)
position plane w ±(tol / 2)
concentricity cylinder, sphere u, v ±(tol / 2)
symmetry plane u or v ±(tol / 2)

Orientation

SymbolGD&TGeometryAffects DOFFormula
perpendicularity cylinder, cone α, β ±(tol / length)
perpendicularity plane α or β ±(tol / extent)
parallelism cylinder α, β ±(tol / length)
parallelism plane α or β ±(tol / extent)
angularity any α, β ±(tol / length)

Form

SymbolGD&TGeometryAffects DOFFormula
flatness plane w ±(tol / 2)
cylindricity cylinder u, v ±(tol / 2)
circularity cylinder, sphere u, v ±(tol / 2)
straightness cylinder, line α, β ±(tol / length)

Runout

SymbolGD&TGeometryAffects DOFFormula
circular_runout cylinder u, v, α, β radial + angular
total_runout cylinder u, v, α, β radial + angular

Profile

SymbolGD&TGeometryAffects DOFFormula
profile_line any w (normal) ±(tol / 2)
profile_surface any w (normal) ±(tol / 2)

Material Condition Modifiers

ModifierCodeBonus Calculation
MMC (Ⓜ) mmc bonus = |actual_size - mmc_size|
LMC (Ⓛ) lmc bonus = |actual_size - lmc_size|
RFS rfs No bonus (default)

Quick Start Workflow

Here's the typical workflow for 3D tolerance analysis with GD&T:

1
Create Feature with GD&T

Create a feature and add your GD&T controls directly from the drawing.

bash
tdt feat new --title "Bore" --component CMP@1 --feature-type internal --no-edit

Then edit the feature file to add GD&T:

yaml
title: Bore
feature_type: internal
geometry_class: cylinder
geometry_3d:
  origin: [0.0, 0.0, 0.0]
  axis: [0.0, 0.0, 1.0]
  length: 25.0

dimensions:
  - name: diameter
    nominal: 20.0
    plus_tol: 0.021
    minus_tol: 0.0

# GD&T from drawing
gdt:
  - symbol: position
    value: 0.25
    datum_refs: [A, B]
    material_condition: mmc
  - symbol: perpendicularity
    value: 0.05
    datum_refs: [A]
2
Compute Torsor Bounds

Let TDT convert your GD&T to torsor bounds automatically.

bash
# Preview the computed bounds
tdt feat compute-bounds FEAT@1

# Compute and save to feature file
tdt feat compute-bounds FEAT@1 --update

# Include MMC bonus (if you know actual size)
tdt feat compute-bounds FEAT@1 --actual-size 20.015 --update
i Feature: Bore (FEAT-01ABC...) Geometry: cylinder (length: 25.0) GD&T Controls: position: 0.25 (MMC) -> u: ±0.125, v: ±0.125 perpendicularity: 0.05 -> α: ±0.002, β: ±0.002 Computed torsor_bounds: u: [-0.125, 0.125] v: [-0.125, 0.125] w: [0, 0] alpha: [-0.002, 0.002] beta: [-0.002, 0.002] gamma: [0, 0]
3
Create Stackup

Add features to a tolerance stackup and run 3D analysis.

bash
# Create stackup
tdt tol new --title "Shaft-Bore Fit" --target-name "Clearance" \
  --target-nominal 0.02 --target-upper 0.05 --target-lower 0.005 --no-edit

# Add contributors
tdt tol add TOL@1 +FEAT@1 ~FEAT@2

# Run 3D analysis
tdt tol analyze TOL@1 --3d
4
Keep Bounds Current

TDT validates that your torsor bounds match your GD&T.

bash
# Check for stale bounds
tdt validate

# Auto-fix stale bounds
tdt validate --fix
Tip: Validate After Changes

After modifying GD&T values, run tdt validate to ensure your torsor bounds are current. Use --fix to automatically update stale bounds.

Feature Setup

Features need geometry information for 3D analysis. This tells TDT what type of geometry and where it is in your assembly.

Required Fields

FieldDescriptionExample
geometry_class Type of geometry cylinder, plane, sphere, cone, point, line
geometry_3d.origin Position in assembly coordinates [0.0, 0.0, 50.0]
geometry_3d.axis Direction vector (normalized) [0.0, 0.0, 1.0]
geometry_3d.length Feature length (for angular tolerances) 25.0
geometry_3d.length_ref Optional: reference another feature's dimension "FEAT-01ABC:depth"
Tip: Reference Dimensions

Use length_ref to link a feature's length to another feature's dimension. This ensures values stay in sync. Format: "FEATURE_ID:dimension_name".

CLI command: tdt feat set-length FEAT@2 --from FEAT@1:depth sets the length and reference automatically.

Run tdt validate to check for stale values, or tdt validate --fix to update them.

Geometry Examples

Cylinder (Bore or Shaft)

yaml
geometry_class: cylinder
geometry_3d:
  origin: [0.0, 0.0, 0.0]    # Center at one end
  axis: [0.0, 0.0, 1.0]      # Along Z axis
  length: 25.0               # Depth of bore

Plane (Face or Datum Surface)

yaml
geometry_class: plane
geometry_3d:
  origin: [0.0, 0.0, 0.0]    # Point on surface
  axis: [0.0, 0.0, 1.0]      # Surface normal

Sphere (Ball or Locating Feature)

yaml
geometry_class: sphere
geometry_3d:
  origin: [50.0, 25.0, 10.0] # Center point
  axis: [0.0, 0.0, 1.0]      # Reference direction

Coordinate System

Use a consistent coordinate system for all features. A common convention:

Z (up) | | | +--------- Y / / X Right-hand rule: X x Y = Z

Datums

Add datum_label to features that serve as datums:

yaml
title: Mounting Face
geometry_class: plane
# ... geometry ...

# This feature is datum A
datum_label: A

TDT applies the ASME Y14.5 3-2-1 rule automatically:

  • Primary datum (A) - Constrains 3 DOF
  • Secondary datum (B) - Constrains 2 additional DOF
  • Tertiary datum (C) - Constrains final 1 DOF

When you specify datum_refs: [A, B] in your GD&T, TDT only applies tolerances to DOFs not already constrained by those datums.

Running Analysis

bash
tdt tol analyze TOL@1 --3d

Example Output

i Found datum features: A, B Analyzing stackup TOL@1 with 4 contributors... Analysis complete Target: Clearance = 0.02 (LSL: 0.005, USL: 0.05) Worst-Case Analysis: Range: -0.01 to 0.04 Result: marginal RSS (Statistical) Analysis: Mean: 0.015 ±3σ: 0.012 Capability: Cp=1.87, Cpk=1.46 Yield: 99.99% 6-DOF Torsor Results: Translations (mm): u: WC [-0.018, 0.018] RSS ±3σ=0.0102 v: WC [-0.018, 0.018] RSS ±3σ=0.0102 w: WC [0, 0] Rotations (mrad): α: WC [-0.50, 0.50] RSS ±3σ=0.28 β: WC [-0.50, 0.50] RSS ±3σ=0.28 γ: WC [0, 0] Functional Deviation (projected onto [1,0,0]): Worst Case: 0.018 RSS 3σ: 0.0102

How Bounds Are Used

The 3D analysis uses torsor bounds to determine geometric deviation for each contributor:

  • GD&T torsor_bounds - If a feature has torsor_bounds (computed from GD&T via compute-bounds), these are used directly
  • Derived bounds - If no torsor_bounds exist, bounds are derived from the contributor's dimensional tolerance

The analysis output shows which source was used:

Using GD&T torsor_bounds: Bore, Shaft Journal Using derived bounds (no torsor_bounds): Spacer Thickness
Best Practice

For accurate 3D analysis, always define GD&T controls on your features and run tdt feat compute-bounds --update to generate proper torsor bounds. This ensures your analysis uses the actual geometric tolerances from your drawing rather than approximations from dimensional tolerance.

Analysis Options

FlagDescription
--3dEnable 6-DOF SDT analysis
--visualizeShow ASCII chain diagram
--iterations NMonte Carlo iterations (default: 10000)
--no-gdtIgnore GD&T position tolerances

Understanding Results

  • WC [min, max] - Worst-case deviation range
  • RSS ±3σ - Statistical 3-sigma spread
  • Cp/Cpk - Process capability indices
  • Zero DOFs - Fully constrained by geometry or datums

Theory Deep Dive

This section explains the underlying math for those who want to understand how TDT works internally.

Small Displacement Torsor (SDT)

A torsor represents the small deviation of a feature from its nominal position using 6 parameters:

ComponentSymbolDescription
uuTranslation along local X
vvTranslation along local Y
wwTranslation along local Z
alphaαRotation about local X
betaβRotation about local Y
gammaγRotation about local Z

Geometry Class DOF Constraints

Different geometry types constrain different degrees of freedom:

GeometryConstrainedFree
planew, α, βu, v, γ
cylinderu, v, α, βw, γ
sphereu, v, wα, β, γ
coneu, v, w, α, βγ
lineu, vw, α, β, γ
pointu, v, wα, β, γ

Jacobian Propagation

TDT uses Jacobian matrices to propagate deviations through the tolerance chain. For each contributor, the deviation at position P is:

δP = δT + δR × (P - O) where: δT = [u, v, w] (translation deviation) δR = [α, β, γ] (rotation deviation) O = feature origin P = point of interest

GD&T to Torsor Mapping

The compute-bounds command applies these rules:

  1. Parse GD&T controls from feature
  2. For each control, determine affected DOFs based on geometry class
  3. Compute bounds: translation tolerances → ±(tol/2), angular tolerances → ±(tol/length)
  4. Apply material condition bonus if actual size provided
  5. Merge multiple controls (tightest bound wins for same DOF)

Reference

CLI Commands

CommandDescription
tdt feat compute-bounds FEAT@1Show computed torsor bounds from GD&T
tdt feat compute-bounds FEAT@1 --updateCompute and save to file
tdt feat compute-bounds FEAT@1 --actual-size 20.01Include MMC/LMC bonus
tdt tol analyze TOL@1 --3dRun 3D SDT analysis
tdt tol analyze TOL@1 --3d --visualizeWith chain visualization
tdt validateCheck for stale torsor bounds
tdt validate --fixAuto-fix stale bounds

GD&T Field Format

yaml
gdt:
  - symbol: position           # GD&T symbol name
    value: 0.25                # Tolerance value
    datum_refs: [A, B, C]      # Datum references (optional)
    material_condition: mmc    # mmc, lmc, or rfs (default)

Supported Symbols

position, concentricity, symmetry, perpendicularity, parallelism, angularity, flatness, cylindricity, circularity, straightness, circular_runout, total_runout, profile_line, profile_surface

Further Reading