tolerance-calculator
v1.0.1
Published
A utility library for calculating geometric dimensioning and tolerancing (GD&T) based on industry standards. This tool is designed to assist engineers in determining the deviations and limits of mechanical fits between shafts and holes, ensuring precise a
Readme
Tolerance Calculator
A utility library for calculating geometric dimensioning and tolerancing (GD&T) based on industry standards. This tool is designed to assist engineers in determining the deviations and limits of mechanical fits between shafts and holes, ensuring precise and accurate tolerances.
Current Features
- Calculate Upper and Lower Tolerances: Functions to calculate the upper and lower tolerance limits for a given nominal dimension.
- Calculate Fit: Function to calculate the clearance or interference between a shaft and a hole.
Future Features
- Calculate Upper and Lower Deviations: Determine the upper and lower deviations for both shafts and holes based on tolerance grades.
- Determine Maximum and Minimum Limits: Calculate the maximum and minimum sizes for shafts and holes.
- Support for Standard Fits: Built-in support for commonly used mechanical fits (e.g.,
H7,g6).
Installation
You can install this package via npm:
npm install tolerance-calculator
```js
import { calculateUpperTolerance, calculateLowerTolerance, calculateFit } from 'tolerance-calculator';import {
calculateUpperTolerance,
calculateLowerTolerance,
calculateFit,
} from "tolerance-calculator";
const nominal = 25;
const tolerance = 0.015;
const upperTolerance = calculateUpperTolerance(nominal, tolerance);
const lowerTolerance = calculateLowerTolerance(nominal, tolerance);
const fit = calculateFit(25, 24.985);
console.log("Upper Tolerance:", upperTolerance); // 25.015
console.log("Lower Tolerance:", lowerTolerance); // 24.985
console.log("Fit (clearance or interference):", fit); // 0.01