tolerance-stackup
Skill16 starsChanged 16 days agoMITView on GitHub
Runs 1-D tolerance stack-ups (worst-case, RSS, Monte Carlo) on a dimension chain, ranks contributors, and estimates reject rate against a gap spec. Use when the user asks about tolerance stack-up, gap/interference analysis, clearance between parts, or how to allocate tolerances.
In this repository34 other files it gives its agents.
- skills/cadsmith-text-to-cad/references/agents.mdAGENTS.md
- agentscad-fdm-dfamSkill
- am-alloy-screeningSkill
- am-literature-ragSkill
- cadsmith-text-to-cadSkill
- cfd-simulation-setupSkill
- design-review-packageSkill
- dfm-reviewSkill
- drawing-gdt-reviewSkill
- engineering-calc-reportSkill
- equation-discoverySkill
- image2gcodeSkill
- lattice-inverse-designSkill
- linkage-synthesisSkill
- llm-3d-print-monitorSkill
- llm-mechanical-designerSkill
- lpbf-defect-predictionSkill
- lpbf-superresSkill
- machine-element-sizingSkill
- material-selectionSkill
- mechanical-teardownSkill
- mechanics-visualsSkill
- meltpool-geometrySkill
- parametric-part-cadSkill
- query2cad-freecadSkill
- quick-feaSkill
- rocketsmithSkill
- sketch-to-cadSkill
- sls-process-optimizationSkill
- stress-field-surrogateSkill
- thermal-fluids-calcSkill
- thermal-porositySkill
- worked-problem-generatorSkill
- my-new-skillSkill
The file
Files
Tolerance Stack-up
Workflow
- Define the gap. Name the gap being studied and its spec (LSL / USL). Draw the loop in text:
Housing face → bore bottom (+) → bearing (−) → spacer (−) → gear hub (−) → gap. - Build the chain CSV (
scripts/example_chain.csvshows the format). Rules:- Go around the loop in one direction; dimensions pointing the "positive" way are
+1, the rest-1. - Enter unequal tolerances as
plus/minus(both positive numbers). The script handles mean shift. dist:normalfor controlled processes (setcpk),uniformfor unknown processes or purchased parts with no data.- Convert GD&T to ± equivalents first: position Ø0.2 → ±0.1 radial; flatness/parallelism add as their own rows.
- Go around the loop in one direction; dimensions pointing the "positive" way are
- Run:
python scripts/stackup.py chain.csv --lsl 0.10 --usl 0.60 --out stack - Interpret
- Worst-case OK → done; tolerances can be loosened.
- Worst-case fails but RSS / MC passes → acceptable for high volume if the processes really are in control; state the predicted ppm.
- MC reject > 2700 ppm (beyond ±3σ) → redesign: tighten the top 1–2 contributors only, or add an adjustment (shim, slotted hole).
- Recommend tolerance reallocation: tighten the contributors with the largest
pct_rssfirst; loosen the ones under 5%.
Output format
- Loop diagram (text) and the chain table
- Results table: Nominal | Worst-case min/max | RSS min/max | MC ±3σ | Reject ppm
- Contributor chart (
stack_contrib.png) and histogram (stack_hist.png) - 2–3 concrete recommendations
Limits
1-D linear stacks only. For 2-D/3-D stacks (angular errors, chains with rotation), linearize with sensitivity coefficients: enter direction as the partial derivative ∂gap/∂xᵢ instead of ±1, and say so in the report.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

