mechanical-tolerance-calculator 1.0.0 โ 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Readme.md +91 -0
- package/package.json +1 -1
package/Readme.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
๐งฎ Mechanical Tolerance Calculator
|
|
2
|
+
|
|
3
|
+
Mechanical Tolerance Calculator is a lightweight JavaScript utility for calculating international standard specifications and tolerances for bores, round bars, and metallic mechanical units.
|
|
4
|
+
It supports common engineering fit and tolerance designations such as H7, H8, H9, h8, h9, and IT5โIT6 according to ISO/ANSI standards.
|
|
5
|
+
|
|
6
|
+
๐ Features
|
|
7
|
+
|
|
8
|
+
Calculates standard tolerances (IT grades) and shaft/hole deviations.
|
|
9
|
+
|
|
10
|
+
Supports ISO system of limits and fits (e.g., H7/h6, H8/f7).
|
|
11
|
+
|
|
12
|
+
Works for both bores (holes) and shafts (round bars).
|
|
13
|
+
|
|
14
|
+
Returns tolerance ranges, upper/lower deviations, and clearance/interference fit results.
|
|
15
|
+
|
|
16
|
+
Lightweight and dependency-free.
|
|
17
|
+
|
|
18
|
+
๐ฆ Installation
|
|
19
|
+
npm install mechanical-tolerance-calculator
|
|
20
|
+
|
|
21
|
+
or using yarn:
|
|
22
|
+
|
|
23
|
+
yarn add mechanical-tolerance-calculator
|
|
24
|
+
|
|
25
|
+
๐งฐ Usage
|
|
26
|
+
import { calculateTolerance } from "mechanical-tolerance-calculator";
|
|
27
|
+
|
|
28
|
+
// Example: Hole tolerance for H7, nominal size 50 mm
|
|
29
|
+
const hole = calculateTolerance("H7", 50);
|
|
30
|
+
console.log(hole);
|
|
31
|
+
/_
|
|
32
|
+
{
|
|
33
|
+
type: "hole",
|
|
34
|
+
nominal: 50,
|
|
35
|
+
designation: "H7",
|
|
36
|
+
upperDeviation: 0.025,
|
|
37
|
+
lowerDeviation: 0.000,
|
|
38
|
+
tolerance: 0.025,
|
|
39
|
+
ITGrade: 7
|
|
40
|
+
}
|
|
41
|
+
_/
|
|
42
|
+
|
|
43
|
+
// Example: Shaft tolerance for h6, nominal size 50 mm
|
|
44
|
+
const shaft = calculateTolerance("h6", 50);
|
|
45
|
+
console.log(shaft);
|
|
46
|
+
/_
|
|
47
|
+
{
|
|
48
|
+
type: "shaft",
|
|
49
|
+
nominal: 50,
|
|
50
|
+
designation: "h6",
|
|
51
|
+
upperDeviation: 0.000,
|
|
52
|
+
lowerDeviation: -0.016,
|
|
53
|
+
tolerance: 0.016,
|
|
54
|
+
ITGrade: 6
|
|
55
|
+
}
|
|
56
|
+
_/
|
|
57
|
+
|
|
58
|
+
โ๏ธ API Reference
|
|
59
|
+
calculateTolerance(designation, nominalSize)
|
|
60
|
+
Parameter Type Description
|
|
61
|
+
designation string ISO/ANSI tolerance designation (e.g. "H7", "h6", "IT6")
|
|
62
|
+
nominalSize number Nominal dimension in millimeters
|
|
63
|
+
|
|
64
|
+
Returns:
|
|
65
|
+
An object containing tolerance values and deviation limits.
|
|
66
|
+
|
|
67
|
+
๐ Standards Referenced
|
|
68
|
+
|
|
69
|
+
ISO 286-1: Geometrical Product Specifications (GPS) โ Limits and Fits
|
|
70
|
+
|
|
71
|
+
ANSI B4.2: Preferred Metric Limits and Fits
|
|
72
|
+
|
|
73
|
+
๐งช Example Applications
|
|
74
|
+
|
|
75
|
+
Mechanical part design and inspection tools
|
|
76
|
+
|
|
77
|
+
CAD/CAM automation scripts
|
|
78
|
+
|
|
79
|
+
Manufacturing tolerance checkers
|
|
80
|
+
|
|
81
|
+
Educational or research tools for mechanical engineering
|
|
82
|
+
|
|
83
|
+
๐งโ๐ป Contributing
|
|
84
|
+
|
|
85
|
+
Contributions, issues, and feature requests are welcome!
|
|
86
|
+
Feel free to open a GitHub issue
|
|
87
|
+
or submit a pull request.
|
|
88
|
+
|
|
89
|
+
๐ License
|
|
90
|
+
|
|
91
|
+
MIT ยฉ 2025 Ajay Ghimire
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mechanical-tolerance-calculator",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Calculates international standard specification and tolerances for bores, round bars and metals of mechanical units. For examples; H7, H8, H9, h8, h9 specifications and IT5/IT6 tolerances.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|