@toolpath/tool-support 0.1.0 → 0.2.0
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/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/tool.d.ts +38 -0
- package/dist/tool.js +10 -0
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
|
@@ -48,7 +48,7 @@ export { MM_PER_INCH, UNIT_ABBREVIATION, UNIT_SYSTEMS, convertArea, convertLengt
|
|
|
48
48
|
export { PROVENANCE, type Provenance, type ProvenanceMap } from './provenance.js';
|
|
49
49
|
export { GEOMETRY_FIELDS, convertGeometry, geometryField, isLengthField, type Geometry, type GeometryCode, type GeometryField, type GeometryUnit, } from './geometry.js';
|
|
50
50
|
export { MILLING_FORMS, TOOL_FORMS, isToolForm, type ToolForm, type ToolFormEntry, } from './forms.js';
|
|
51
|
-
export { hasNeck, shankOf, type Shank, type Tool } from './tool.js';
|
|
51
|
+
export { THREAD_METHODS, hasNeck, isThreadMethod, shankOf, type Shank, type ThreadMethod, type Tool, } from './tool.js';
|
|
52
52
|
export { PROFILES_VERSION, belowGageLine, type HolderProfile, type ProfileDatum, type ProfilePoint, } from './profile.js';
|
|
53
53
|
export { canHold, colletFitsHolder, defaultStickout, gripRanges, gripsAnyShank, gripsShank, holdBand, holderTakesTool, isHolderProfile, maxStickout, stickoutLimits, type Assembly, type Clamping, type Collet, type GripRanges, type HoldBand, type Holder, } from './holding.js';
|
|
54
54
|
export { DEFAULT_CLAMPING, clampShortfall, clampWanted, headLength, heldDiameter, type ClampingRule, } from './clamping.js';
|
package/dist/index.js
CHANGED
|
@@ -48,7 +48,7 @@ export { MM_PER_INCH, UNIT_ABBREVIATION, UNIT_SYSTEMS, convertArea, convertLengt
|
|
|
48
48
|
export { PROVENANCE } from './provenance.js';
|
|
49
49
|
export { GEOMETRY_FIELDS, convertGeometry, geometryField, isLengthField, } from './geometry.js';
|
|
50
50
|
export { MILLING_FORMS, TOOL_FORMS, isToolForm, } from './forms.js';
|
|
51
|
-
export { hasNeck, shankOf } from './tool.js';
|
|
51
|
+
export { THREAD_METHODS, hasNeck, isThreadMethod, shankOf, } from './tool.js';
|
|
52
52
|
export { PROFILES_VERSION, belowGageLine, } from './profile.js';
|
|
53
53
|
export { canHold, colletFitsHolder, defaultStickout, gripRanges, gripsAnyShank, gripsShank, holdBand, holderTakesTool, isHolderProfile, maxStickout, stickoutLimits, } from './holding.js';
|
|
54
54
|
export { DEFAULT_CLAMPING, clampShortfall, clampWanted, headLength, heldDiameter, } from './clamping.js';
|
package/dist/tool.d.ts
CHANGED
|
@@ -24,11 +24,49 @@
|
|
|
24
24
|
*/
|
|
25
25
|
import type { Geometry } from './geometry.js';
|
|
26
26
|
import type { ProvenanceMap } from './provenance.js';
|
|
27
|
+
/**
|
|
28
|
+
* How a tap makes its thread: by cutting it away, or by displacing material
|
|
29
|
+
* into it.
|
|
30
|
+
*
|
|
31
|
+
* **A second axis beside {@link Tool.form}, not two more forms.**
|
|
32
|
+
* `forms.ts`'s vocabulary is Fusion's own, so that a tool exported there lands
|
|
33
|
+
* on the type it already has, and Fusion has no form-tap type — a form tap is a
|
|
34
|
+
* `tap right hand` there like any other. Adding `form tap right hand` would buy
|
|
35
|
+
* a filter chip and cost that guarantee. It is the same call
|
|
36
|
+
* `tool-scraper`'s `families/kennametal.ts` makes for keeping a holder's
|
|
37
|
+
* `contact` off its `taper`: two facts about one part are two fields.
|
|
38
|
+
*
|
|
39
|
+
* The two are genuinely different tools. A former needs a larger hole, evacuates
|
|
40
|
+
* no chip, and runs at its own feed; a cut tap does none of that. Nothing here
|
|
41
|
+
* branches on it yet — a tap goes in on the hole's axis either way, and
|
|
42
|
+
* `tool-drawing` has no publishable shape for either one's lead — but a
|
|
43
|
+
* consumer choosing or feeding a tool cannot ask the question at all until the
|
|
44
|
+
* fact is carried.
|
|
45
|
+
*/
|
|
46
|
+
export type ThreadMethod = 'cutting' | 'forming';
|
|
47
|
+
/**
|
|
48
|
+
* The methods, in the order a control offers them.
|
|
49
|
+
*
|
|
50
|
+
* A list beside the union for the reason `PROVENANCE` is one: `tool-scraper`
|
|
51
|
+
* validates a family's declared value against it rather than redeclaring the
|
|
52
|
+
* two strings, and a filter panel offers it. Cutting leads because it is what
|
|
53
|
+
* most of a catalog is.
|
|
54
|
+
*/
|
|
55
|
+
export declare const THREAD_METHODS: readonly ["cutting", "forming"];
|
|
56
|
+
export declare const isThreadMethod: (value: string) => value is ThreadMethod;
|
|
27
57
|
export interface Tool {
|
|
28
58
|
/** The CAM-library name for what the tool is: `flat end mill`, `drill`, `slot mill`. */
|
|
29
59
|
readonly form: string;
|
|
30
60
|
/** What a machinist calls this one tool — a catalog number, usually. */
|
|
31
61
|
readonly label?: string;
|
|
62
|
+
/**
|
|
63
|
+
* How this tap makes its thread, where it is a tap and somebody has said.
|
|
64
|
+
*
|
|
65
|
+
* Optional, and **absent is nobody having said** rather than a claim of
|
|
66
|
+
* cutting — the rule `holding.ts`'s `Clamping` keeps on a holder and `shankOf` keeps
|
|
67
|
+
* on a shank. A non-tap carries none, because the question does not apply.
|
|
68
|
+
*/
|
|
69
|
+
readonly threadMethod?: ThreadMethod;
|
|
32
70
|
readonly geometry: Geometry;
|
|
33
71
|
readonly provenance?: ProvenanceMap;
|
|
34
72
|
}
|
package/dist/tool.js
CHANGED
|
@@ -28,6 +28,16 @@
|
|
|
28
28
|
* 9.525 on the collet's sheet and 9.524999999999999 on the tool's.
|
|
29
29
|
*/
|
|
30
30
|
const EPSILON = 1e-6;
|
|
31
|
+
/**
|
|
32
|
+
* The methods, in the order a control offers them.
|
|
33
|
+
*
|
|
34
|
+
* A list beside the union for the reason `PROVENANCE` is one: `tool-scraper`
|
|
35
|
+
* validates a family's declared value against it rather than redeclaring the
|
|
36
|
+
* two strings, and a filter panel offers it. Cutting leads because it is what
|
|
37
|
+
* most of a catalog is.
|
|
38
|
+
*/
|
|
39
|
+
export const THREAD_METHODS = ['cutting', 'forming'];
|
|
40
|
+
export const isThreadMethod = (value) => THREAD_METHODS.some((method) => method === value);
|
|
31
41
|
/**
|
|
32
42
|
* Whether the section between the flutes and the shank is a neck: a stated
|
|
33
43
|
* shoulder past the flutes, narrower than the shank.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toolpath/tool-support",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "The cutting-tool domain: what a tool, holder, collet and assembly are",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -35,14 +35,14 @@
|
|
|
35
35
|
"README.md"
|
|
36
36
|
],
|
|
37
37
|
"sideEffects": false,
|
|
38
|
-
"scripts": {
|
|
39
|
-
"build": "tsc -p tsconfig.build.json",
|
|
40
|
-
"check-types": "tsc --noEmit",
|
|
41
|
-
"test": "vitest run"
|
|
42
|
-
},
|
|
43
38
|
"devDependencies": {
|
|
44
39
|
"@types/node": "24.10.1",
|
|
45
40
|
"typescript": "5.9.3",
|
|
46
41
|
"vitest": "4.1.10"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "tsc -p tsconfig.build.json",
|
|
45
|
+
"check-types": "tsc --noEmit",
|
|
46
|
+
"test": "vitest run"
|
|
47
47
|
}
|
|
48
|
-
}
|
|
48
|
+
}
|