formulab 0.27.6 → 0.27.8
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/CHANGELOG.md +53 -0
- package/README.md +6 -6
- package/dist/automotive/chargingLoss.d.ts +9 -2
- package/dist/automotive/chargingLoss.d.ts.map +1 -1
- package/dist/automotive/chargingLoss.js +13 -3
- package/dist/automotive/chargingLoss.js.map +1 -1
- package/dist/energy/windOutput.d.ts +6 -0
- package/dist/energy/windOutput.d.ts.map +1 -1
- package/dist/energy/windOutput.js +6 -0
- package/dist/energy/windOutput.js.map +1 -1
- package/dist/machining/boringBarDeflection.d.ts +6 -2
- package/dist/machining/boringBarDeflection.d.ts.map +1 -1
- package/dist/machining/boringBarDeflection.js +14 -4
- package/dist/machining/boringBarDeflection.js.map +1 -1
- package/dist/machining/threadOverWires.d.ts +6 -1
- package/dist/machining/threadOverWires.d.ts.map +1 -1
- package/dist/machining/threadOverWires.js +6 -1
- package/dist/machining/threadOverWires.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,59 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.27.8] - 2026-08-16
|
|
9
|
+
|
|
10
|
+
`npm run audit:constant-provenance` (dev-only, not part of the published library surface)
|
|
11
|
+
fixes for two independent gaps that let a judgment-bearing constant go unclassified.
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- **A constant whose type annotation spans multiple lines and contains an object-literal
|
|
16
|
+
shape (`const T: Record<K, { a: number; b: number }> = {...}`) was silently skipped.**
|
|
17
|
+
The initializer scan counted braces from the declaration line onward, so the type
|
|
18
|
+
annotation's own `{...}` closed the scan before it ever reached the real value —
|
|
19
|
+
the constant was dropped for having "no digits" in what the scanner thought was its
|
|
20
|
+
body. Brace/bracket counting now starts only after the top-level `=`.
|
|
21
|
+
- **A table value threaded through a second rename before the comparison that reads it
|
|
22
|
+
(`const row = TABLE[key]; const limit = cond ? row.a : row.b; ... x > limit`) was not
|
|
23
|
+
followed.** Only the direct one-hop case (`row.field` compared in place) was tracked.
|
|
24
|
+
The scan now follows one further rename, reading the assignment's right-hand side as a
|
|
25
|
+
short multi-line window so a ternary split across lines is not missed either. Chains
|
|
26
|
+
beyond two hops remain unfollowed by design — see the script's own doc comment for why.
|
|
27
|
+
- Added a regression control (alongside the existing bend-constants control) so a future
|
|
28
|
+
change to either scan silently regressing is a hard failure, not a quiet drop.
|
|
29
|
+
|
|
30
|
+
## [0.27.7] - 2026-08-16
|
|
31
|
+
|
|
32
|
+
Golden reference test coverage expansion across six domains (Machining, Environmental, Energy,
|
|
33
|
+
Battery, Automotive, Food), plus one real defect fix found along the way.
|
|
34
|
+
|
|
35
|
+
### Fixed
|
|
36
|
+
|
|
37
|
+
- **`machining/boringBarDeflection` — the `heavyMetal` material option used an understated
|
|
38
|
+
Young's modulus.** 250 GPa was below the 276-365 GPa range published across manufacturer data
|
|
39
|
+
sheets for the tungsten heavy alloys (90-97wt% W) actually used in damped boring bar cores.
|
|
40
|
+
Corrected to 300 GPa, a documented representative value for that composition range.
|
|
41
|
+
`boringBarDeflection({ material: 'heavyMetal' })` previously overestimated deflection for this
|
|
42
|
+
material by roughly 20%.
|
|
43
|
+
|
|
44
|
+
### Added
|
|
45
|
+
|
|
46
|
+
- Golden reference tests credited or added across: `machining` (`boltCircle`, `sineBarHeight`,
|
|
47
|
+
`effectiveDiameter`, `radialChipThinning`, `cuspHeight`, `boringBarDeflection`,
|
|
48
|
+
`toolDeflection`, `cycleTimeEstimator`, `threadOverWires`, `triangleSolver` — the domain is now
|
|
49
|
+
fully covered), `environmental` (`gwpCalculator`), `energy` (`degreeDay`, `windOutput`),
|
|
50
|
+
`battery` (`stateOfHealth`, `thermalRunaway`), `automotive` (`chargingLoss`), `food`
|
|
51
|
+
(`waterActivity`, `stabilityStudy`).
|
|
52
|
+
- `threadOverWires()` now additionally cites ASME B1.2 for its three-wire thread-gaging method.
|
|
53
|
+
|
|
54
|
+
### Changed
|
|
55
|
+
|
|
56
|
+
- Clarified a few `@reference` citations that had attributed general engineering rules of thumb
|
|
57
|
+
(a boring-bar overhang/material selection guideline; default EV-charger efficiency and
|
|
58
|
+
temperature-derating values) to specific standards that do not actually publish those numbers.
|
|
59
|
+
The underlying values are unchanged — only the citation precision.
|
|
60
|
+
|
|
8
61
|
## [0.27.6] - 2026-08-16
|
|
9
62
|
|
|
10
63
|
Documentation-only release, same shape as 0.27.4/0.27.5.
|
package/README.md
CHANGED
|
@@ -30,13 +30,13 @@ A comprehensive collection of engineering formulas and calculations for manufact
|
|
|
30
30
|
| Chemical | 12 | pid, reliefValve | Darcy-Weisbach, Fourier, API 520, ISA |
|
|
31
31
|
| Electronics | 12 | awgProperties, resistorDecode | IPC-2221, IEC 60062 |
|
|
32
32
|
| Construction | 15 | momentOfInertia | AISC, Timoshenko, Roark's (momentOfInertia only — see note) |
|
|
33
|
-
| Automotive | 9 |
|
|
34
|
-
| Energy | 15 |
|
|
35
|
-
| Food | 7 |
|
|
33
|
+
| Automotive | 9 | chargingLoss | AASHTO, SAE J1772 |
|
|
34
|
+
| Energy | 15 | degreeDay, windOutput | NREL PVWatts, ISO 50001 |
|
|
35
|
+
| Food | 7 | waterActivity, stabilityStudy | HACCP, ICH Q1A |
|
|
36
36
|
| Utility | 18 | — | — |
|
|
37
|
-
| Battery | 10 |
|
|
38
|
-
| Environmental | 10 |
|
|
39
|
-
| Machining | 12 | truePosition, gaugeBlockStack | Machinery's Handbook, ASME Y14.5, Sandvik Coromant |
|
|
37
|
+
| Battery | 10 | stateOfHealth, thermalRunaway | IEEE 1188, IEC 62620, Battery University |
|
|
38
|
+
| Environmental | 10 | gwpCalculator | GHG Protocol, IPCC AR6, IEA 2023 |
|
|
39
|
+
| Machining | 12 | all 12 functions — truePosition, gaugeBlockStack, boltCircle, sineBarHeight, effectiveDiameter, radialChipThinning, cuspHeight, boringBarDeflection, toolDeflection, cycleTimeEstimator, threadOverWires, triangleSolver | Machinery's Handbook, ASME Y14.5/B1.2, Sandvik Coromant |
|
|
40
40
|
| IE | 5 | — | MTM/MOST, Wright's learning curve |
|
|
41
41
|
|
|
42
42
|
> Functions with golden reference tests have been verified against authoritative engineering sources.
|
|
@@ -8,8 +8,15 @@ import type { ChargingLossInput, ChargingLossResult } from './types.js';
|
|
|
8
8
|
* - totalLoss = energyConsumed − energyDelivered
|
|
9
9
|
* - chargingTime = energyConsumed / effectivePower
|
|
10
10
|
*
|
|
11
|
-
* @reference SAE J1772 — Electric Vehicle Charging
|
|
12
|
-
*
|
|
11
|
+
* @reference SAE J1772 — Electric Vehicle Charging (connector, voltage/current levels, and
|
|
12
|
+
* communication protocol — the source for the charging-level *categories* this function
|
|
13
|
+
* accepts, not for the default efficiency percentages below).
|
|
14
|
+
* @reference IEC 61851 — Electric vehicle conductive charging system (charging modes/safety).
|
|
15
|
+
*
|
|
16
|
+
* `DEFAULT_CHARGER_EFFICIENCY` and the ambient-temperature derating curve are this library's own
|
|
17
|
+
* typical-value defaults, not numbers specified by either standard — documented here rather than
|
|
18
|
+
* left implicitly "standard-verified"; the energy/loss/time arithmetic itself is exact closed-form
|
|
19
|
+
* and golden-tested against hand-computed values.
|
|
13
20
|
*/
|
|
14
21
|
export declare function chargingLoss(input: ChargingLossInput): ChargingLossResult;
|
|
15
22
|
//# sourceMappingURL=chargingLoss.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chargingLoss.d.ts","sourceRoot":"","sources":["../../src/automotive/chargingLoss.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"chargingLoss.d.ts","sourceRoot":"","sources":["../../src/automotive/chargingLoss.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAYxE;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,kBAAkB,CAiDzE"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { roundTo } from '../utils.js';
|
|
2
|
-
// Default charger efficiencies by type
|
|
2
|
+
// Default charger efficiencies by type — typical real-world AC-DC conversion efficiency for
|
|
3
|
+
// each charging level, not a value specified by SAE J1772/IEC 61851 themselves (those standards
|
|
4
|
+
// define connector, voltage/current, and protocol requirements, not a numeric efficiency table).
|
|
5
|
+
// Callers with measured hardware efficiency should pass `chargerEfficiency` explicitly.
|
|
3
6
|
const DEFAULT_CHARGER_EFFICIENCY = {
|
|
4
7
|
ac_l1: 0.85,
|
|
5
8
|
ac_l2: 0.90,
|
|
@@ -14,8 +17,15 @@ const DEFAULT_CHARGER_EFFICIENCY = {
|
|
|
14
17
|
* - totalLoss = energyConsumed − energyDelivered
|
|
15
18
|
* - chargingTime = energyConsumed / effectivePower
|
|
16
19
|
*
|
|
17
|
-
* @reference SAE J1772 — Electric Vehicle Charging
|
|
18
|
-
*
|
|
20
|
+
* @reference SAE J1772 — Electric Vehicle Charging (connector, voltage/current levels, and
|
|
21
|
+
* communication protocol — the source for the charging-level *categories* this function
|
|
22
|
+
* accepts, not for the default efficiency percentages below).
|
|
23
|
+
* @reference IEC 61851 — Electric vehicle conductive charging system (charging modes/safety).
|
|
24
|
+
*
|
|
25
|
+
* `DEFAULT_CHARGER_EFFICIENCY` and the ambient-temperature derating curve are this library's own
|
|
26
|
+
* typical-value defaults, not numbers specified by either standard — documented here rather than
|
|
27
|
+
* left implicitly "standard-verified"; the energy/loss/time arithmetic itself is exact closed-form
|
|
28
|
+
* and golden-tested against hand-computed values.
|
|
19
29
|
*/
|
|
20
30
|
export function chargingLoss(input) {
|
|
21
31
|
const { batteryCapacity, chargerPower, chargerType, batteryEfficiency = 0.95, soc, ambientTemp, } = input;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chargingLoss.js","sourceRoot":"","sources":["../../src/automotive/chargingLoss.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGtC,
|
|
1
|
+
{"version":3,"file":"chargingLoss.js","sourceRoot":"","sources":["../../src/automotive/chargingLoss.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGtC,4FAA4F;AAC5F,gGAAgG;AAChG,iGAAiG;AACjG,wFAAwF;AACxF,MAAM,0BAA0B,GAA2B;IACzD,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;IACX,OAAO,EAAE,IAAI;CACd,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,YAAY,CAAC,KAAwB;IACnD,MAAM,EACJ,eAAe,EAAE,YAAY,EAAE,WAAW,EAC1C,iBAAiB,GAAG,IAAI,EACxB,GAAG,EAAE,WAAW,GACjB,GAAG,KAAK,CAAC;IAEV,MAAM,iBAAiB,GAAG,KAAK,CAAC,iBAAiB,IAAI,0BAA0B,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC;IACrG,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,IAAI,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAE5E,uBAAuB;IACvB,IAAI,QAAQ,GAAG,GAAG,CAAC;IACnB,IAAI,WAAW,IAAI,IAAI,EAAE,CAAC;QACxB,IAAI,WAAW,GAAG,CAAC,EAAE,CAAC;YACpB,QAAQ,GAAG,IAAI,CAAC,CAAC,oCAAoC;QACvD,CAAC;aAAM,IAAI,WAAW,GAAG,EAAE,EAAE,CAAC;YAC5B,QAAQ,GAAG,IAAI,CAAC;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Y,EAAE,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;QACtC,cAAc,EAAE,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;KAC3C,CAAC;AACJ,CAAC"}
|
|
@@ -9,6 +9,12 @@ import type { WindOutputInput, WindOutputResult } from './types.js';
|
|
|
9
9
|
*
|
|
10
10
|
* @reference IEC 61400 — Wind energy generation systems
|
|
11
11
|
* @reference Manwell, J.F. "Wind Energy Explained", 2nd Ed. Wiley.
|
|
12
|
+
*
|
|
13
|
+
* `adjustedWindSpeed` (Hellmann power law) and `betzLimit` (Cp_max = 16/27) are exact closed-form
|
|
14
|
+
* physics and golden-tested. `capacityFactor` is this function's own numerical approximation of a
|
|
15
|
+
* Rayleigh-distribution power curve integral — no single published worked example exists to
|
|
16
|
+
* golden-test it against, so its tests are relational (bounds, monotonicity) rather than golden;
|
|
17
|
+
* documented here per this project's no-invented-golden-values rule rather than left unstated.
|
|
12
18
|
*/
|
|
13
19
|
export declare function windOutput(input: WindOutputInput): WindOutputResult;
|
|
14
20
|
//# sourceMappingURL=windOutput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"windOutput.d.ts","sourceRoot":"","sources":["../../src/energy/windOutput.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEpE
|
|
1
|
+
{"version":3,"file":"windOutput.d.ts","sourceRoot":"","sources":["../../src/energy/windOutput.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEpE;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,gBAAgB,CA8DnE"}
|
|
@@ -9,6 +9,12 @@ import { roundTo } from '../utils.js';
|
|
|
9
9
|
*
|
|
10
10
|
* @reference IEC 61400 — Wind energy generation systems
|
|
11
11
|
* @reference Manwell, J.F. "Wind Energy Explained", 2nd Ed. Wiley.
|
|
12
|
+
*
|
|
13
|
+
* `adjustedWindSpeed` (Hellmann power law) and `betzLimit` (Cp_max = 16/27) are exact closed-form
|
|
14
|
+
* physics and golden-tested. `capacityFactor` is this function's own numerical approximation of a
|
|
15
|
+
* Rayleigh-distribution power curve integral — no single published worked example exists to
|
|
16
|
+
* golden-test it against, so its tests are relational (bounds, monotonicity) rather than golden;
|
|
17
|
+
* documented here per this project's no-invented-golden-values rule rather than left unstated.
|
|
12
18
|
*/
|
|
13
19
|
export function windOutput(input) {
|
|
14
20
|
const { ratedPower, hubHeight, averageWindSpeed, referenceHeight = 10, cutInSpeed = 3, cutOutSpeed = 25, ratedSpeed = 12, rotorDiameter, terrainRoughness = 0.143, } = input;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"windOutput.js","sourceRoot":"","sources":["../../src/energy/windOutput.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGtC
|
|
1
|
+
{"version":3,"file":"windOutput.js","sourceRoot":"","sources":["../../src/energy/windOutput.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGtC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,UAAU,CAAC,KAAsB;IAC/C,MAAM,EACJ,UAAU,EAAE,SAAS,EAAE,gBAAgB,EACvC,eAAe,GAAG,EAAE,EACpB,UAAU,GAAG,CAAC,EACd,WAAW,GAAG,EAAE,EAChB,UAAU,GAAG,EAAE,EACf,aAAa,EACb,gBAAgB,GAAG,KAAK,GACzB,GAAG,KAAK,CAAC;IAEV,gDAAgD;IAChD,MAAM,iBAAiB,GAAG,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,GAAG,eAAe,EAAE,gBAAgB,CAAC,CAAC;IAErG,gFAAgF;IAChF,kEAAkE;IAClE,mDAAmD;IACnD,2DAA2D;IAC3D,MAAM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AAC,CAAC,CAAC;QACtE,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,EAAE,CAAC,CAAC,CAAC;QAC3C,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAClD,GAAG,IAAI,MAAM,GAAG,UAAU,GAAG,WAAW,CAAC;IAC3C,CAAC;IAED,OAAO,GAAG,GAAG,EAAE,CAAC;AAClB,CAAC"}
|
|
@@ -7,8 +7,12 @@ import type { BoringBarDeflectionInput, BoringBarDeflectionResult } from './type
|
|
|
7
7
|
* δ = F × L³ / (3 × E × I)
|
|
8
8
|
* L/D ratio determines stability recommendation
|
|
9
9
|
*
|
|
10
|
-
* @reference
|
|
11
|
-
* L/D < 4
|
|
10
|
+
* @reference Beam deflection: standard cantilever theory (Oberg, E. et al. "Machinery's
|
|
11
|
+
* Handbook", 31st Ed.). The L/D < 4 / 4-6 / 6-10 material-selection bands are a general
|
|
12
|
+
* shop-practice rule of thumb, not a numeric table published by a single named source —
|
|
13
|
+
* Sandvik Coromant's own published overhang limits are structured differently (by dampened
|
|
14
|
+
* vs. non-dampened adapter, not by bar material) and run higher, up to 10-18×D for its damped
|
|
15
|
+
* product lines. Treat the bands here as a starting-point heuristic, not a cited standard.
|
|
12
16
|
*
|
|
13
17
|
* @param input - Boring bar deflection parameters
|
|
14
18
|
* @returns BoringBarDeflectionResult with deflection, L/D ratio, and recommendation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boringBarDeflection.d.ts","sourceRoot":"","sources":["../../src/machining/boringBarDeflection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,yBAAyB,EAAqB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"boringBarDeflection.d.ts","sourceRoot":"","sources":["../../src/machining/boringBarDeflection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,yBAAyB,EAAqB,MAAM,YAAY,CAAC;AAiBzG;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,GAAG,yBAAyB,CAkC9F"}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { roundTo } from '../utils.js';
|
|
2
2
|
/**
|
|
3
|
-
* Young's modulus for boring bar materials (GPa)
|
|
3
|
+
* Young's modulus for boring bar materials (GPa).
|
|
4
|
+
*
|
|
5
|
+
* carbide/steel are cemented-carbide and alloy-steel textbook values. heavyMetal is a
|
|
6
|
+
* tungsten-nickel-iron/copper heavy alloy (the material used in damped boring bar cores, e.g.
|
|
7
|
+
* Densimet/Inermet-class 90-97wt% W grades) — manufacturer data sheets report 276-365 GPa across
|
|
8
|
+
* that composition range (Buffalo Tungsten MT-17/MT-18 series); 300 GPa is a representative
|
|
9
|
+
* mid-range value, not a single standard-specified constant.
|
|
4
10
|
*/
|
|
5
11
|
const BAR_MODULUS = {
|
|
6
12
|
carbide: 550,
|
|
7
13
|
steel: 200,
|
|
8
|
-
heavyMetal:
|
|
14
|
+
heavyMetal: 300,
|
|
9
15
|
};
|
|
10
16
|
/**
|
|
11
17
|
* Calculate boring bar deflection using cantilever beam theory.
|
|
@@ -15,8 +21,12 @@ const BAR_MODULUS = {
|
|
|
15
21
|
* δ = F × L³ / (3 × E × I)
|
|
16
22
|
* L/D ratio determines stability recommendation
|
|
17
23
|
*
|
|
18
|
-
* @reference
|
|
19
|
-
* L/D < 4
|
|
24
|
+
* @reference Beam deflection: standard cantilever theory (Oberg, E. et al. "Machinery's
|
|
25
|
+
* Handbook", 31st Ed.). The L/D < 4 / 4-6 / 6-10 material-selection bands are a general
|
|
26
|
+
* shop-practice rule of thumb, not a numeric table published by a single named source —
|
|
27
|
+
* Sandvik Coromant's own published overhang limits are structured differently (by dampened
|
|
28
|
+
* vs. non-dampened adapter, not by bar material) and run higher, up to 10-18×D for its damped
|
|
29
|
+
* product lines. Treat the bands here as a starting-point heuristic, not a cited standard.
|
|
20
30
|
*
|
|
21
31
|
* @param input - Boring bar deflection parameters
|
|
22
32
|
* @returns BoringBarDeflectionResult with deflection, L/D ratio, and recommendation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boringBarDeflection.js","sourceRoot":"","sources":["../../src/machining/boringBarDeflection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGtC
|
|
1
|
+
{"version":3,"file":"boringBarDeflection.js","sourceRoot":"","sources":["../../src/machining/boringBarDeflection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGtC;;;;;;;;GAQG;AACH,MAAM,WAAW,GAAsC;IACrD,OAAO,EAAE,GAAG;IACZ,KAAK,EAAE,GAAG;IACV,UAAU,EAAE,GAAG;CAChB,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAA+B;IACjE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,GAAG,OAAO,EAAE,GAAG,KAAK,CAAC;IAE1E,IAAI,WAAW,IAAI,CAAC;QAAE,MAAM,IAAI,UAAU,CAAC,8BAA8B,CAAC,CAAC;IAC3E,IAAI,QAAQ,IAAI,CAAC;QAAE,MAAM,IAAI,UAAU,CAAC,2BAA2B,CAAC,CAAC;IACrE,IAAI,YAAY,GAAG,CAAC;QAAE,MAAM,IAAI,UAAU,CAAC,mCAAmC,CAAC,CAAC;IAEhF,MAAM,CAAC,GAAG,KAAK,CAAC,aAAa,IAAI,WAAW,CAAC,QAAQ,CAAC,CAAC;IACvD,MAAM,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC,YAAY;IAEpC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;IACpD,MAAM,KAAK,GAAG,CAAC,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC;IACvE,MAAM,SAAS,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IAC1D,MAAM,OAAO,GAAG,QAAQ,GAAG,WAAW,CAAC;IAEvC,IAAI,cAAsB,CAAC;IAC3B,IAAI,OAAO,IAAI,CAAC,EAAE,CAAC;QACjB,cAAc,GAAG,oBAAoB,CAAC;IACxC,CAAC;SAAM,IAAI,OAAO,IAAI,CAAC,EAAE,CAAC;QACxB,cAAc,GAAG,yBAAyB,CAAC;IAC7C,CAAC;SAAM,IAAI,OAAO,IAAI,EAAE,EAAE,CAAC;QACzB,cAAc,GAAG,uCAAuC,CAAC;IAC3D,CAAC;SAAM,CAAC;QACN,cAAc,GAAG,+CAA+C,CAAC;IACnE,CAAC;IAED,OAAO;QACL,UAAU,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;QAC7B,eAAe,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;QAC9B,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;QAChC,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;QAC5B,aAAa,EAAE,CAAC;QAChB,cAAc;KACf,CAAC;AACJ,CAAC"}
|
|
@@ -12,7 +12,12 @@ import type { ThreadOverWiresInput, ThreadOverWiresResult } from './types.js';
|
|
|
12
12
|
* For 55° (Whitworth): bestWire = P / (2 × cos(27.5°))
|
|
13
13
|
* For 29° (Acme): bestWire = P / (2 × cos(14.5°))
|
|
14
14
|
*
|
|
15
|
-
* @reference Oberg, E. et al. "Machinery's Handbook", 31st Ed. — Thread measurement
|
|
15
|
+
* @reference Oberg, E. et al. "Machinery's Handbook", 31st Ed. — Thread measurement; ASME
|
|
16
|
+
* B1.2 — Gages and Gaging for Unified Inch Screw Threads (formalizes the 3-wire method this
|
|
17
|
+
* implements). The pitch-diameter-relative form used here (M = E + 3W − P·cot(α/2)/2) is
|
|
18
|
+
* algebraically identical to the more commonly quoted major-diameter-relative form for 60°
|
|
19
|
+
* threads (M = D − 1.5155P + 3W): substituting E = D − 0.6495P into the latter reduces to the
|
|
20
|
+
* former, since 0.6495 + 0.866025 ≈ 1.5155.
|
|
16
21
|
*
|
|
17
22
|
* @param input - Thread over wires parameters
|
|
18
23
|
* @returns ThreadOverWiresResult with measurement, best wire, and pitch diameter
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"threadOverWires.d.ts","sourceRoot":"","sources":["../../src/machining/threadOverWires.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAE9E
|
|
1
|
+
{"version":3,"file":"threadOverWires.d.ts","sourceRoot":"","sources":["../../src/machining/threadOverWires.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAE9E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,qBAAqB,CAmClF"}
|
|
@@ -12,7 +12,12 @@ import { roundTo } from '../utils.js';
|
|
|
12
12
|
* For 55° (Whitworth): bestWire = P / (2 × cos(27.5°))
|
|
13
13
|
* For 29° (Acme): bestWire = P / (2 × cos(14.5°))
|
|
14
14
|
*
|
|
15
|
-
* @reference Oberg, E. et al. "Machinery's Handbook", 31st Ed. — Thread measurement
|
|
15
|
+
* @reference Oberg, E. et al. "Machinery's Handbook", 31st Ed. — Thread measurement; ASME
|
|
16
|
+
* B1.2 — Gages and Gaging for Unified Inch Screw Threads (formalizes the 3-wire method this
|
|
17
|
+
* implements). The pitch-diameter-relative form used here (M = E + 3W − P·cot(α/2)/2) is
|
|
18
|
+
* algebraically identical to the more commonly quoted major-diameter-relative form for 60°
|
|
19
|
+
* threads (M = D − 1.5155P + 3W): substituting E = D − 0.6495P into the latter reduces to the
|
|
20
|
+
* former, since 0.6495 + 0.866025 ≈ 1.5155.
|
|
16
21
|
*
|
|
17
22
|
* @param input - Thread over wires parameters
|
|
18
23
|
* @returns ThreadOverWiresResult with measurement, best wire, and pitch diameter
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"threadOverWires.js","sourceRoot":"","sources":["../../src/machining/threadOverWires.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGtC
|
|
1
|
+
{"version":3,"file":"threadOverWires.js","sourceRoot":"","sources":["../../src/machining/threadOverWires.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGtC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,eAAe,CAAC,KAA2B;IACzD,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,GAAG,EAAE,EAAE,GAAG,KAAK,CAAC;IAEzD,MAAM,YAAY,GAAG,CAAC,CAAC,WAAW,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC;IACzD,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAE5C,iBAAiB;IACjB,MAAM,QAAQ,GAAG,KAAK,GAAG,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC;IAC5C,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,QAAQ,CAAC;IAE5C,iBAAiB;IACjB,IAAI,aAAqB,CAAC;IAC1B,IAAI,WAAW,KAAK,EAAE,EAAE,CAAC;QACvB,aAAa,GAAG,aAAa,GAAG,MAAM,GAAG,KAAK,CAAC;IACjD,CAAC;SAAM,IAAI,WAAW,KAAK,EAAE,EAAE,CAAC;QAC9B,aAAa,GAAG,aAAa,GAAG,MAAM,GAAG,KAAK,CAAC;IACjD,CAAC;SAAM,IAAI,WAAW,KAAK,EAAE,EAAE,CAAC;QAC9B,aAAa,GAAG,aAAa,GAAG,GAAG,GAAG,KAAK,CAAC;IAC9C,CAAC;SAAM,CAAC;QACN,oBAAoB;QACpB,aAAa,GAAG,aAAa,GAAG,GAAG,GAAG,KAAK,CAAC;IAC9C,CAAC;IAED,6BAA6B;IAC7B,4DAA4D;IAC5D,iCAAiC;IACjC,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAC5C,MAAM,CAAC,GAAG,aAAa,GAAG,QAAQ,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,GAAG,CAAC,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC;IAE1G,OAAO;QACL,oBAAoB,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;QACnC,YAAY,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;QAClC,aAAa,EAAE,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;QACxC,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;KAC/B,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "formulab",
|
|
3
|
-
"version": "0.27.
|
|
3
|
+
"version": "0.27.8",
|
|
4
4
|
"description": "Manufacturing & Engineering calculation formulas library - 211 industrial calculations across 15 domains for OEE, Cpk, SPC, FMEA, Nelson Rules, metal weight, CNC machining, GD&T, battery, environmental, pipe flow, logistics, IE time study, and more",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|