@code3d/screws 0.0.1-alpha.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/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Code3D 暂行社区许可
2
+
3
+ Copyright (c) 2026 vilicvane
4
+
5
+ 允许任何人免费获取、阅读、构建、运行、复制、修改和分发本软件及随附文档,
6
+ 但须遵守以下条件。
7
+
8
+ 未经著作权人书面授权,不得利用本软件、其修改版或组成部分,开发、提供或运营
9
+ 在核心功能上替代本软件或其组件的商业产品或服务。商业目的包括直接收费,
10
+ 以及广告、商业获客等间接变现;个人和社区的非商业使用、修改与分享不受此限制。
11
+
12
+ 使用本软件完成商业设计、出售用户自行创作的模型或实物是允许的。用户自己的
13
+ 设计脚本、模型和输出不因使用本软件而必须公开或采用本许可。
14
+
15
+ 本软件的副本及包含其实质内容的修改版须保留版权声明和本许可,不得移除上述
16
+ 商业竞争限制。第三方材料仍适用各自的许可。
17
+
18
+ 在遵守本许可的前提下,已取得版本的授权持续有效;后续放宽以著作权人明确发布的
19
+ 许可为准,不设自动转换期限。
20
+
21
+ 在适用法律允许的范围内,本软件按现状提供,不附带任何明示或默示担保;
22
+ 作者及著作权人不对使用本软件所产生的索赔、损失或其他责任负责。
package/README.md ADDED
@@ -0,0 +1,46 @@
1
+ # `@code3d/screws`
2
+
3
+ Reusable standard screw models and matching Boolean hole tools for code3d.
4
+
5
+ ```ts
6
+ import {ISO4762} from '@code3d/screws';
7
+
8
+ const screw = ISO4762.screw('M6', 18);
9
+ const hole = ISO4762.clearanceHole('M6', 10);
10
+ ```
11
+
12
+ Clearance holes use the ISO 273 normal clearance and include the matching
13
+ socket-head counterbore by default, for both the numeric overload and an
14
+ options object. Pass `counterbore: false` explicitly to create a plain
15
+ clearance hole; the options object also supports another fit or custom
16
+ dimensions.
17
+
18
+ ## Specification queries
19
+
20
+ `ISO4762.resolveSpecification(input)` accepts a size such as `'M6'` or a
21
+ custom `ISO4762.Specification`. A size resolves to its entry in
22
+ `ISO4762.specifications`; a specification object is returned unchanged.
23
+
24
+ `ISO4762.threadLength(spec, length)` returns the nominal thread length used
25
+ by the screw builder, in millimeters. `length` is the screw length below the
26
+ head. This query does not clamp the result to the available shank length;
27
+ `screw()` applies that limit after allowing for the under-head transition.
28
+
29
+ ```ts
30
+ const spec = ISO4762.resolveSpecification('M6');
31
+ const nominalThreadLength = ISO4762.threadLength(spec, 30); // 24 mm
32
+ ```
33
+
34
+ The `ISO4762` namespace also exports the types used by these APIs, including
35
+ `Specification`, `ScrewInput`, `SocketCapScrewElements`,
36
+ `SocketCapHoleElements`, and `CounterboredSocketCapHoleElements`.
37
+
38
+ The package currently implements ISO 4762 socket-head cap screws. Its source
39
+ is organized by standard so additional screw families can be added without
40
+ mixing their dimensional tables or model-specific elements.
41
+
42
+ Named mounting references such as `headBottom`, `shaftBottom`, and
43
+ `counterboreBottom` are finite `Bound` values. For example,
44
+ `tool.shaftBottom.on(plate.down.flip())` aligns the shaft's lower boundary with
45
+ the plate's lower boundary without rotating the hole tool. `flip()` reverses
46
+ facing while preserving the offset coordinate frame.
@@ -0,0 +1,2 @@
1
+ export * as ISO4762 from './iso-4762.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/library/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,eAAe,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * as ISO4762 from './iso-4762.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/library/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,eAAe,CAAC"}
@@ -0,0 +1,184 @@
1
+ import { type CanonicalElements, type Bound, type LineAnchor, type SolidModel } from '@code3d/core';
2
+ export type ClearanceFit = 'close' | 'normal' | 'loose';
3
+ export type Specification = Readonly<{
4
+ designation: string;
5
+ nominalDiameter: number;
6
+ pitch: number;
7
+ headDiameter: number;
8
+ headHeight: number;
9
+ hexSocketWidth: number;
10
+ hexSocketDepth: number;
11
+ underHeadRadius: number;
12
+ clearance: Readonly<Record<ClearanceFit, number>>;
13
+ counterboreDiameter: number;
14
+ }>;
15
+ export declare const specifications: {
16
+ readonly M3: {
17
+ readonly designation: 'M3';
18
+ readonly nominalDiameter: 3;
19
+ readonly pitch: 0.5;
20
+ readonly headDiameter: 5.5;
21
+ readonly headHeight: 3;
22
+ readonly hexSocketWidth: 2.5;
23
+ readonly hexSocketDepth: 1.3;
24
+ readonly underHeadRadius: 0.1;
25
+ readonly clearance: {
26
+ readonly close: 3.2;
27
+ readonly normal: 3.4;
28
+ readonly loose: 3.6;
29
+ };
30
+ readonly counterboreDiameter: 6;
31
+ };
32
+ readonly M4: {
33
+ readonly designation: 'M4';
34
+ readonly nominalDiameter: 4;
35
+ readonly pitch: 0.7;
36
+ readonly headDiameter: 7;
37
+ readonly headHeight: 4;
38
+ readonly hexSocketWidth: 3;
39
+ readonly hexSocketDepth: 2;
40
+ readonly underHeadRadius: 0.2;
41
+ readonly clearance: {
42
+ readonly close: 4.3;
43
+ readonly normal: 4.5;
44
+ readonly loose: 4.8;
45
+ };
46
+ readonly counterboreDiameter: 8;
47
+ };
48
+ readonly M5: {
49
+ readonly designation: 'M5';
50
+ readonly nominalDiameter: 5;
51
+ readonly pitch: 0.8;
52
+ readonly headDiameter: 8.5;
53
+ readonly headHeight: 5;
54
+ readonly hexSocketWidth: 4;
55
+ readonly hexSocketDepth: 2.5;
56
+ readonly underHeadRadius: 0.2;
57
+ readonly clearance: {
58
+ readonly close: 5.3;
59
+ readonly normal: 5.5;
60
+ readonly loose: 5.8;
61
+ };
62
+ readonly counterboreDiameter: 10;
63
+ };
64
+ readonly M6: {
65
+ readonly designation: 'M6';
66
+ readonly nominalDiameter: 6;
67
+ readonly pitch: 1;
68
+ readonly headDiameter: 10;
69
+ readonly headHeight: 6;
70
+ readonly hexSocketWidth: 5;
71
+ readonly hexSocketDepth: 3;
72
+ readonly underHeadRadius: 0.25;
73
+ readonly clearance: {
74
+ readonly close: 6.4;
75
+ readonly normal: 6.6;
76
+ readonly loose: 7;
77
+ };
78
+ readonly counterboreDiameter: 11;
79
+ };
80
+ readonly M8: {
81
+ readonly designation: 'M8';
82
+ readonly nominalDiameter: 8;
83
+ readonly pitch: 1.25;
84
+ readonly headDiameter: 13;
85
+ readonly headHeight: 8;
86
+ readonly hexSocketWidth: 6;
87
+ readonly hexSocketDepth: 4;
88
+ readonly underHeadRadius: 0.4;
89
+ readonly clearance: {
90
+ readonly close: 8.4;
91
+ readonly normal: 9;
92
+ readonly loose: 10;
93
+ };
94
+ readonly counterboreDiameter: 15;
95
+ };
96
+ readonly M10: {
97
+ readonly designation: 'M10';
98
+ readonly nominalDiameter: 10;
99
+ readonly pitch: 1.5;
100
+ readonly headDiameter: 16;
101
+ readonly headHeight: 10;
102
+ readonly hexSocketWidth: 8;
103
+ readonly hexSocketDepth: 5;
104
+ readonly underHeadRadius: 0.4;
105
+ readonly clearance: {
106
+ readonly close: 10.5;
107
+ readonly normal: 11;
108
+ readonly loose: 12;
109
+ };
110
+ readonly counterboreDiameter: 18;
111
+ };
112
+ readonly M12: {
113
+ readonly designation: 'M12';
114
+ readonly nominalDiameter: 12;
115
+ readonly pitch: 1.75;
116
+ readonly headDiameter: 18;
117
+ readonly headHeight: 12;
118
+ readonly hexSocketWidth: 10;
119
+ readonly hexSocketDepth: 6;
120
+ readonly underHeadRadius: 0.6;
121
+ readonly clearance: {
122
+ readonly close: 13;
123
+ readonly normal: 13.5;
124
+ readonly loose: 14.5;
125
+ };
126
+ readonly counterboreDiameter: 20;
127
+ };
128
+ };
129
+ export type Size = keyof typeof specifications;
130
+ export type ScrewInput = Size | Specification;
131
+ export type CounterboreOptions = Readonly<{
132
+ diameter?: number;
133
+ depth?: number;
134
+ axialClearance?: number;
135
+ }>;
136
+ export type ClearanceHoleOptions = Readonly<{
137
+ depth: number;
138
+ fit?: ClearanceFit;
139
+ diameter?: number;
140
+ counterbore?: boolean | CounterboreOptions;
141
+ }>;
142
+ export type PlainClearanceHoleOptions = ClearanceHoleOptions & Readonly<{
143
+ counterbore: false;
144
+ }>;
145
+ export type CounterboredHoleOptions = Omit<ClearanceHoleOptions, 'counterbore'> & Readonly<{
146
+ counterbore?: true | CounterboreOptions;
147
+ }>;
148
+ export type SocketCapScrewElements = CanonicalElements & Readonly<{
149
+ headTop: Bound;
150
+ headBottom: Bound;
151
+ shankTop: Bound;
152
+ shankBottom: Bound;
153
+ shankAxis: LineAnchor;
154
+ }>;
155
+ export type SocketCapHoleElements = CanonicalElements & Readonly<{
156
+ shaftTop: Bound;
157
+ shaftBottom: Bound;
158
+ shaftAxis: LineAnchor;
159
+ }>;
160
+ export type CounterboredSocketCapHoleElements = SocketCapHoleElements & Readonly<{
161
+ counterboreTop: Bound;
162
+ counterboreBottom: Bound;
163
+ }>;
164
+ export type Screw = SolidModel<SocketCapScrewElements>;
165
+ export type ClearanceHole = SolidModel<SocketCapHoleElements>;
166
+ export type CounterboredHole = SolidModel<CounterboredSocketCapHoleElements>;
167
+ /**
168
+ * @code3d.arguments ['M6', 18]
169
+ * @code3d.arguments ['M8', 30]
170
+ * @code3d.param length {kind: 'length'}
171
+ */
172
+ export declare function screw(input: ScrewInput, length: number): Screw;
173
+ /**
174
+ * @code3d.arguments ['M6', 10]
175
+ * @code3d.arguments ['M6', {depth: 10, counterbore: false}]
176
+ * @code3d.param depth {kind: 'length', constraints: {exclusiveMin: 0}}
177
+ */
178
+ export declare function clearanceHole(input: ScrewInput, depth: number): CounterboredHole;
179
+ export declare function clearanceHole(input: ScrewInput, options: PlainClearanceHoleOptions): ClearanceHole;
180
+ export declare function clearanceHole(input: ScrewInput, options: CounterboredHoleOptions): CounterboredHole;
181
+ export declare function clearanceHole(input: ScrewInput, options: ClearanceHoleOptions): ClearanceHole | CounterboredHole;
182
+ export declare function resolveSpecification(input: ScrewInput): Specification;
183
+ export declare function threadLength(spec: Specification, length: number): number;
184
+ //# sourceMappingURL=iso-4762.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iso-4762.d.ts","sourceRoot":"","sources":["../../src/library/iso-4762.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,iBAAiB,EACtB,KAAK,KAAK,EACV,KAAK,UAAU,EACf,KAAK,UAAU,EAChB,MAAM,cAAc,CAAC;AAGtB,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAExD,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;IAClD,mBAAmB,EAAE,MAAM,CAAC;CAC7B,CAAC,CAAC;AAIH,eAAO,MAAM,cAAc;;iBAEvB,WAAW,EAAE,IAAI;iBACjB,eAAe,EAAE,CAAC;iBAClB,KAAK,EAAE,GAAG;iBACV,YAAY,EAAE,GAAG;iBACjB,UAAU,EAAE,CAAC;iBACb,cAAc,EAAE,GAAG;iBACnB,cAAc,EAAE,GAAG;iBACnB,eAAe,EAAE,GAAG;iBACpB,SAAS;qBAAG,KAAK,EAAE,GAAG;qBAAE,MAAM,EAAE,GAAG;qBAAE,KAAK,EAAE,GAAG;;iBAC/C,mBAAmB,EAAE,CAAC;;;iBAGtB,WAAW,EAAE,IAAI;iBACjB,eAAe,EAAE,CAAC;iBAClB,KAAK,EAAE,GAAG;iBACV,YAAY,EAAE,CAAC;iB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,uBAAuB,GAC/B,gBAAgB,CAAC;AACpB,wBAAgB,aAAa,CAC3B,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,oBAAoB,GAC5B,aAAa,GAAG,gBAAgB,CAAC;AAgEpC,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,UAAU,GAAG,aAAa,CAErE;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAIxE"}
@@ -0,0 +1,219 @@
1
+ import { cylinder, cut, frustum, regularPrism, union, } from '@code3d/core';
2
+ import { helicalThread } from './thread.js';
3
+ // ISO 4762 coarse-thread socket-head cap screws; millimetres.
4
+ // Clearance series follow ISO 273. Counterbores follow DIN 974-1 normal series.
5
+ export const specifications = {
6
+ M3: {
7
+ designation: 'M3',
8
+ nominalDiameter: 3,
9
+ pitch: 0.5,
10
+ headDiameter: 5.5,
11
+ headHeight: 3,
12
+ hexSocketWidth: 2.5,
13
+ hexSocketDepth: 1.3,
14
+ underHeadRadius: 0.1,
15
+ clearance: { close: 3.2, normal: 3.4, loose: 3.6 },
16
+ counterboreDiameter: 6,
17
+ },
18
+ M4: {
19
+ designation: 'M4',
20
+ nominalDiameter: 4,
21
+ pitch: 0.7,
22
+ headDiameter: 7,
23
+ headHeight: 4,
24
+ hexSocketWidth: 3,
25
+ hexSocketDepth: 2,
26
+ underHeadRadius: 0.2,
27
+ clearance: { close: 4.3, normal: 4.5, loose: 4.8 },
28
+ counterboreDiameter: 8,
29
+ },
30
+ M5: {
31
+ designation: 'M5',
32
+ nominalDiameter: 5,
33
+ pitch: 0.8,
34
+ headDiameter: 8.5,
35
+ headHeight: 5,
36
+ hexSocketWidth: 4,
37
+ hexSocketDepth: 2.5,
38
+ underHeadRadius: 0.2,
39
+ clearance: { close: 5.3, normal: 5.5, loose: 5.8 },
40
+ counterboreDiameter: 10,
41
+ },
42
+ M6: {
43
+ designation: 'M6',
44
+ nominalDiameter: 6,
45
+ pitch: 1,
46
+ headDiameter: 10,
47
+ headHeight: 6,
48
+ hexSocketWidth: 5,
49
+ hexSocketDepth: 3,
50
+ underHeadRadius: 0.25,
51
+ clearance: { close: 6.4, normal: 6.6, loose: 7 },
52
+ counterboreDiameter: 11,
53
+ },
54
+ M8: {
55
+ designation: 'M8',
56
+ nominalDiameter: 8,
57
+ pitch: 1.25,
58
+ headDiameter: 13,
59
+ headHeight: 8,
60
+ hexSocketWidth: 6,
61
+ hexSocketDepth: 4,
62
+ underHeadRadius: 0.4,
63
+ clearance: { close: 8.4, normal: 9, loose: 10 },
64
+ counterboreDiameter: 15,
65
+ },
66
+ M10: {
67
+ designation: 'M10',
68
+ nominalDiameter: 10,
69
+ pitch: 1.5,
70
+ headDiameter: 16,
71
+ headHeight: 10,
72
+ hexSocketWidth: 8,
73
+ hexSocketDepth: 5,
74
+ underHeadRadius: 0.4,
75
+ clearance: { close: 10.5, normal: 11, loose: 12 },
76
+ counterboreDiameter: 18,
77
+ },
78
+ M12: {
79
+ designation: 'M12',
80
+ nominalDiameter: 12,
81
+ pitch: 1.75,
82
+ headDiameter: 18,
83
+ headHeight: 12,
84
+ hexSocketWidth: 10,
85
+ hexSocketDepth: 6,
86
+ underHeadRadius: 0.6,
87
+ clearance: { close: 13, normal: 13.5, loose: 14.5 },
88
+ counterboreDiameter: 20,
89
+ },
90
+ };
91
+ /**
92
+ * @code3d.arguments ['M6', 18]
93
+ * @code3d.arguments ['M8', 30]
94
+ * @code3d.param length {kind: 'length'}
95
+ */
96
+ export function screw(input, length) {
97
+ const spec = resolveSpecification(input);
98
+ validateSpec(spec);
99
+ if (!Number.isFinite(length) || length <= spec.pitch + spec.underHeadRadius) {
100
+ throw new Error('Screw length must leave room for at least one full thread pitch.');
101
+ }
102
+ const headChamfer = Math.min(spec.pitch / 2, spec.headHeight * 0.12);
103
+ const headBarrel = cylinder(spec.headDiameter / 2, spec.headHeight - headChamfer);
104
+ const headTop = frustum(spec.headDiameter / 2, spec.headDiameter / 2 - headChamfer, headChamfer).relate(top => top.on(headBarrel.up));
105
+ const headBlank = union([headBarrel, headTop]);
106
+ const socketToolY = spec.hexSocketDepth + 0.2;
107
+ const socketTool = regularPrism(spec.hexSocketWidth / Math.sqrt(3), socketToolY, 6, 30).relate(tool => tool.center.on(headBlank.up).offset(0, -spec.hexSocketDepth / 2 + 0.1, 0));
108
+ const head = cut(headBlank, [socketTool]);
109
+ const transition = frustum(spec.nominalDiameter / 2, spec.nominalDiameter / 2 + spec.underHeadRadius, spec.underHeadRadius).relate(part => part.on(head.down));
110
+ const bodyLength = length - spec.underHeadRadius;
111
+ const threadedLength = Math.min(bodyLength, threadLength(spec, length));
112
+ const plainLength = bodyLength - threadedLength;
113
+ const overlap = Math.min(0.08, spec.pitch / 10);
114
+ const parts = [head, transition];
115
+ let previous = transition;
116
+ if (plainLength > overlap) {
117
+ const shank = cylinder(spec.nominalDiameter / 2, plainLength + overlap).relate(part => part.on(previous.down).offset(0, -overlap, 0));
118
+ parts.push(shank);
119
+ previous = shank;
120
+ }
121
+ const fundamentalHeight = (Math.sqrt(3) / 2) * spec.pitch;
122
+ const minorDiameter = spec.nominalDiameter - 2 * ((5 / 8) * fundamentalHeight);
123
+ const thread = helicalThread({
124
+ pitch: spec.pitch,
125
+ y: threadedLength + overlap,
126
+ majorDiameter: spec.nominalDiameter,
127
+ minorDiameter,
128
+ rootWidth: (3 / 4) * spec.pitch,
129
+ crestWidth: (1 / 8) * spec.pitch,
130
+ }).relate(part => part.on(previous.down).offset(0, -overlap, 0));
131
+ parts.push(thread);
132
+ return union(parts).expose({
133
+ headTop: head.up,
134
+ headBottom: head.down,
135
+ shankTop: transition.up,
136
+ shankBottom: thread.down,
137
+ shankAxis: thread.axis,
138
+ });
139
+ }
140
+ export function clearanceHole(input, optionsOrDepth) {
141
+ const options = typeof optionsOrDepth === 'number'
142
+ ? { depth: optionsOrDepth }
143
+ : optionsOrDepth;
144
+ const spec = resolveSpecification(input);
145
+ validateSpec(spec);
146
+ if (!Number.isFinite(options.depth) || options.depth <= 0) {
147
+ throw new Error('Hole depth must be a positive finite number.');
148
+ }
149
+ const fit = options.fit ?? 'normal';
150
+ const diameter = options.diameter ?? spec.clearance[fit];
151
+ if (!Number.isFinite(diameter) || diameter <= spec.nominalDiameter) {
152
+ throw new Error('Clearance-hole diameter must exceed the nominal screw diameter.');
153
+ }
154
+ const shaft = cylinder(diameter / 2, options.depth);
155
+ const counterboreOption = options.counterbore ?? true;
156
+ if (counterboreOption === false) {
157
+ return shaft.expose({
158
+ shaftTop: shaft.up,
159
+ shaftBottom: shaft.down,
160
+ shaftAxis: shaft.axis,
161
+ });
162
+ }
163
+ const counterbore = counterboreOption === true ? {} : counterboreOption;
164
+ const axialClearance = counterbore.axialClearance ?? 0.5;
165
+ const counterboreDepth = counterbore.depth ?? spec.headHeight + axialClearance;
166
+ const counterboreDiameter = counterbore.diameter ?? spec.counterboreDiameter;
167
+ if (!Number.isFinite(counterboreDepth) ||
168
+ counterboreDepth <= 0 ||
169
+ counterboreDepth > options.depth) {
170
+ throw new Error('Counterbore depth must be within the total hole depth.');
171
+ }
172
+ if (!Number.isFinite(counterboreDiameter) ||
173
+ counterboreDiameter < spec.headDiameter) {
174
+ throw new Error('Counterbore diameter must accommodate the screw head.');
175
+ }
176
+ const recess = cylinder(counterboreDiameter / 2, counterboreDepth + 0.2).relate(tool => tool.center.on(shaft.up).offset(0, -counterboreDepth / 2 + 0.1, 0));
177
+ return union([shaft, recess]).expose({
178
+ shaftTop: shaft.up,
179
+ shaftBottom: shaft.down,
180
+ shaftAxis: shaft.axis,
181
+ counterboreTop: recess.up,
182
+ counterboreBottom: recess.down,
183
+ });
184
+ }
185
+ export function resolveSpecification(input) {
186
+ return typeof input === 'string' ? specifications[input] : input;
187
+ }
188
+ export function threadLength(spec, length) {
189
+ if (length <= 125)
190
+ return 2 * spec.nominalDiameter + 12;
191
+ if (length <= 200)
192
+ return 2 * spec.nominalDiameter + 18;
193
+ return 2 * spec.nominalDiameter + 31;
194
+ }
195
+ function validateSpec(spec) {
196
+ const values = [
197
+ spec.nominalDiameter,
198
+ spec.pitch,
199
+ spec.headDiameter,
200
+ spec.headHeight,
201
+ spec.hexSocketWidth,
202
+ spec.hexSocketDepth,
203
+ spec.underHeadRadius,
204
+ spec.clearance.close,
205
+ spec.clearance.normal,
206
+ spec.clearance.loose,
207
+ spec.counterboreDiameter,
208
+ ];
209
+ if (values.some(value => !Number.isFinite(value) || value <= 0)) {
210
+ throw new Error('Fastener specifications must contain positive finite dimensions.');
211
+ }
212
+ if (spec.headDiameter <= spec.nominalDiameter) {
213
+ throw new Error('Head diameter must exceed the nominal thread diameter.');
214
+ }
215
+ if (spec.hexSocketDepth >= spec.headHeight) {
216
+ throw new Error('Hex socket depth must be smaller than the head height.');
217
+ }
218
+ }
219
+ //# sourceMappingURL=iso-4762.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iso-4762.js","sourceRoot":"","sources":["../../src/library/iso-4762.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,GAAG,EACH,OAAO,EACP,YAAY,EACZ,KAAK,GAKN,MAAM,cAAc,CAAC;AACtB,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAC;AAiB1C,8DAA8D;AAC9D,gFAAgF;AAChF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,EAAE,EAAE;QACF,WAAW,EAAE,IAAI;QACjB,eAAe,EAAE,CAAC;QAClB,KAAK,EAAE,GAAG;QACV,YAAY,EAAE,GAAG;QACjB,UAAU,EAAE,CAAC;QACb,cAAc,EAAE,GAAG;QACnB,cAAc,EAAE,GAAG;QACnB,eAAe,EAAE,GAAG;QACpB,SAAS,EAAE,EAAC,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAC;QAChD,mBAAmB,EAAE,CAAC;KACvB;IACD,EAAE,EAAE;QACF,WAAW,EAAE,IAAI;QACjB,eAAe,EAAE,CAAC;QAClB,KAA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,CAAC,SAAS,CAAC,KAAK;QACpB,IAAI,CAAC,mBAAmB;KACzB,CAAC;IACF,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,EAAE,CAAC;QAChE,MAAM,IAAI,KAAK,CACb,kEAAkE,CACnE,CAAC;IACJ,CAAC;IACD,IAAI,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;QAC9C,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;IAC5E,CAAC;IACD,IAAI,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;QAC3C,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;IAC5E,CAAC;AACH,CAAC"}
@@ -0,0 +1,10 @@
1
+ export declare const helicalThread: (options: Readonly<{
2
+ pitch: number;
3
+ y: number;
4
+ majorDiameter: number;
5
+ minorDiameter: number;
6
+ rootWidth: number;
7
+ crestWidth: number;
8
+ leftHanded?: boolean;
9
+ }>) => import("@code3d/core").SolidModel;
10
+ //# sourceMappingURL=thread.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"thread.d.ts","sourceRoot":"","sources":["../../src/library/thread.ts"],"names":[],"mappings":"AA2BA,eAAO,MAAM,aAAa;WAdjB,MAAM;OACV,MAAM;mBACM,MAAM;mBACN,MAAM;eACV,MAAM;gBACL,MAAM;iBACL,OAAO;wCAwBrB,CAAC"}