jscad-electronics 0.0.234 → 0.0.235
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 +116 -9
- package/dist/index.js +1926 -1508
- package/dist/index.js.map +1 -1
- package/dist/model-contracts.json +3 -3
- package/dist/vanilla.d.ts +116 -9
- package/dist/vanilla.js +861 -453
- package/dist/vanilla.js.map +1 -1
- package/package.json +1 -1
package/dist/vanilla.js
CHANGED
|
@@ -24,7 +24,7 @@ function h(type, props, ...restChildren) {
|
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
// .model-contracts/generations/
|
|
27
|
+
// .model-contracts/generations/344775224814556adaec789fbc570ee91a9e4064-v2/node_modules/zod/v3/external.js
|
|
28
28
|
var external_exports = {};
|
|
29
29
|
__export(external_exports, {
|
|
30
30
|
BRAND: () => BRAND,
|
|
@@ -136,7 +136,7 @@ __export(external_exports, {
|
|
|
136
136
|
void: () => voidType
|
|
137
137
|
});
|
|
138
138
|
|
|
139
|
-
// .model-contracts/generations/
|
|
139
|
+
// .model-contracts/generations/344775224814556adaec789fbc570ee91a9e4064-v2/node_modules/zod/v3/helpers/util.js
|
|
140
140
|
var util;
|
|
141
141
|
(function(util2) {
|
|
142
142
|
util2.assertEqual = (_) => {
|
|
@@ -270,7 +270,7 @@ var getParsedType = (data) => {
|
|
|
270
270
|
}
|
|
271
271
|
};
|
|
272
272
|
|
|
273
|
-
// .model-contracts/generations/
|
|
273
|
+
// .model-contracts/generations/344775224814556adaec789fbc570ee91a9e4064-v2/node_modules/zod/v3/ZodError.js
|
|
274
274
|
var ZodIssueCode = util.arrayToEnum([
|
|
275
275
|
"invalid_type",
|
|
276
276
|
"invalid_literal",
|
|
@@ -388,7 +388,7 @@ ZodError.create = (issues) => {
|
|
|
388
388
|
return error;
|
|
389
389
|
};
|
|
390
390
|
|
|
391
|
-
// .model-contracts/generations/
|
|
391
|
+
// .model-contracts/generations/344775224814556adaec789fbc570ee91a9e4064-v2/node_modules/zod/v3/locales/en.js
|
|
392
392
|
var errorMap = (issue, _ctx) => {
|
|
393
393
|
let message;
|
|
394
394
|
switch (issue.code) {
|
|
@@ -491,7 +491,7 @@ var errorMap = (issue, _ctx) => {
|
|
|
491
491
|
};
|
|
492
492
|
var en_default = errorMap;
|
|
493
493
|
|
|
494
|
-
// .model-contracts/generations/
|
|
494
|
+
// .model-contracts/generations/344775224814556adaec789fbc570ee91a9e4064-v2/node_modules/zod/v3/errors.js
|
|
495
495
|
var overrideErrorMap = en_default;
|
|
496
496
|
function setErrorMap(map) {
|
|
497
497
|
overrideErrorMap = map;
|
|
@@ -500,7 +500,7 @@ function getErrorMap() {
|
|
|
500
500
|
return overrideErrorMap;
|
|
501
501
|
}
|
|
502
502
|
|
|
503
|
-
// .model-contracts/generations/
|
|
503
|
+
// .model-contracts/generations/344775224814556adaec789fbc570ee91a9e4064-v2/node_modules/zod/v3/helpers/parseUtil.js
|
|
504
504
|
var makeIssue = (params) => {
|
|
505
505
|
const { data, path, errorMaps, issueData } = params;
|
|
506
506
|
const fullPath = [...path, ...issueData.path || []];
|
|
@@ -610,14 +610,14 @@ var isDirty = (x) => x.status === "dirty";
|
|
|
610
610
|
var isValid = (x) => x.status === "valid";
|
|
611
611
|
var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
612
612
|
|
|
613
|
-
// .model-contracts/generations/
|
|
613
|
+
// .model-contracts/generations/344775224814556adaec789fbc570ee91a9e4064-v2/node_modules/zod/v3/helpers/errorUtil.js
|
|
614
614
|
var errorUtil;
|
|
615
615
|
(function(errorUtil2) {
|
|
616
616
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
617
617
|
errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
|
|
618
618
|
})(errorUtil || (errorUtil = {}));
|
|
619
619
|
|
|
620
|
-
// .model-contracts/generations/
|
|
620
|
+
// .model-contracts/generations/344775224814556adaec789fbc570ee91a9e4064-v2/node_modules/zod/v3/types.js
|
|
621
621
|
var ParseInputLazyPath = class {
|
|
622
622
|
constructor(parent, value, path, key) {
|
|
623
623
|
this._cachedPath = [];
|
|
@@ -2402,9 +2402,9 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
2402
2402
|
_getCached() {
|
|
2403
2403
|
if (this._cached !== null)
|
|
2404
2404
|
return this._cached;
|
|
2405
|
-
const
|
|
2406
|
-
const keys = util.objectKeys(
|
|
2407
|
-
this._cached = { shape:
|
|
2405
|
+
const shape46 = this._def.shape();
|
|
2406
|
+
const keys = util.objectKeys(shape46);
|
|
2407
|
+
this._cached = { shape: shape46, keys };
|
|
2408
2408
|
return this._cached;
|
|
2409
2409
|
}
|
|
2410
2410
|
_parse(input) {
|
|
@@ -2419,7 +2419,7 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
2419
2419
|
return INVALID;
|
|
2420
2420
|
}
|
|
2421
2421
|
const { status, ctx } = this._processInputParams(input);
|
|
2422
|
-
const { shape:
|
|
2422
|
+
const { shape: shape46, keys: shapeKeys } = this._getCached();
|
|
2423
2423
|
const extraKeys = [];
|
|
2424
2424
|
if (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === "strip")) {
|
|
2425
2425
|
for (const key in ctx.data) {
|
|
@@ -2430,7 +2430,7 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
2430
2430
|
}
|
|
2431
2431
|
const pairs = [];
|
|
2432
2432
|
for (const key of shapeKeys) {
|
|
2433
|
-
const keyValidator =
|
|
2433
|
+
const keyValidator = shape46[key];
|
|
2434
2434
|
const value = ctx.data[key];
|
|
2435
2435
|
pairs.push({
|
|
2436
2436
|
key: { status: "valid", value: key },
|
|
@@ -2636,27 +2636,27 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
2636
2636
|
});
|
|
2637
2637
|
}
|
|
2638
2638
|
pick(mask) {
|
|
2639
|
-
const
|
|
2639
|
+
const shape46 = {};
|
|
2640
2640
|
for (const key of util.objectKeys(mask)) {
|
|
2641
2641
|
if (mask[key] && this.shape[key]) {
|
|
2642
|
-
|
|
2642
|
+
shape46[key] = this.shape[key];
|
|
2643
2643
|
}
|
|
2644
2644
|
}
|
|
2645
2645
|
return new _ZodObject({
|
|
2646
2646
|
...this._def,
|
|
2647
|
-
shape: () =>
|
|
2647
|
+
shape: () => shape46
|
|
2648
2648
|
});
|
|
2649
2649
|
}
|
|
2650
2650
|
omit(mask) {
|
|
2651
|
-
const
|
|
2651
|
+
const shape46 = {};
|
|
2652
2652
|
for (const key of util.objectKeys(this.shape)) {
|
|
2653
2653
|
if (!mask[key]) {
|
|
2654
|
-
|
|
2654
|
+
shape46[key] = this.shape[key];
|
|
2655
2655
|
}
|
|
2656
2656
|
}
|
|
2657
2657
|
return new _ZodObject({
|
|
2658
2658
|
...this._def,
|
|
2659
|
-
shape: () =>
|
|
2659
|
+
shape: () => shape46
|
|
2660
2660
|
});
|
|
2661
2661
|
}
|
|
2662
2662
|
/**
|
|
@@ -2703,27 +2703,27 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
2703
2703
|
return createZodEnum(util.objectKeys(this.shape));
|
|
2704
2704
|
}
|
|
2705
2705
|
};
|
|
2706
|
-
ZodObject.create = (
|
|
2706
|
+
ZodObject.create = (shape46, params) => {
|
|
2707
2707
|
return new ZodObject({
|
|
2708
|
-
shape: () =>
|
|
2708
|
+
shape: () => shape46,
|
|
2709
2709
|
unknownKeys: "strip",
|
|
2710
2710
|
catchall: ZodNever.create(),
|
|
2711
2711
|
typeName: ZodFirstPartyTypeKind.ZodObject,
|
|
2712
2712
|
...processCreateParams(params)
|
|
2713
2713
|
});
|
|
2714
2714
|
};
|
|
2715
|
-
ZodObject.strictCreate = (
|
|
2715
|
+
ZodObject.strictCreate = (shape46, params) => {
|
|
2716
2716
|
return new ZodObject({
|
|
2717
|
-
shape: () =>
|
|
2717
|
+
shape: () => shape46,
|
|
2718
2718
|
unknownKeys: "strict",
|
|
2719
2719
|
catchall: ZodNever.create(),
|
|
2720
2720
|
typeName: ZodFirstPartyTypeKind.ZodObject,
|
|
2721
2721
|
...processCreateParams(params)
|
|
2722
2722
|
});
|
|
2723
2723
|
};
|
|
2724
|
-
ZodObject.lazycreate = (
|
|
2724
|
+
ZodObject.lazycreate = (shape46, params) => {
|
|
2725
2725
|
return new ZodObject({
|
|
2726
|
-
shape:
|
|
2726
|
+
shape: shape46,
|
|
2727
2727
|
unknownKeys: "strip",
|
|
2728
2728
|
catchall: ZodNever.create(),
|
|
2729
2729
|
typeName: ZodFirstPartyTypeKind.ZodObject,
|
|
@@ -4065,7 +4065,7 @@ var coerce = {
|
|
|
4065
4065
|
};
|
|
4066
4066
|
var NEVER = INVALID;
|
|
4067
4067
|
|
|
4068
|
-
// .model-contracts/generations/
|
|
4068
|
+
// .model-contracts/generations/344775224814556adaec789fbc570ee91a9e4064-v2/node_modules/@tscircuit/mm/dist/index.js
|
|
4069
4069
|
var unitToMm = {
|
|
4070
4070
|
in: 25.4,
|
|
4071
4071
|
inch: 25.4,
|
|
@@ -4092,7 +4092,7 @@ var mm = (n) => {
|
|
|
4092
4092
|
throw new Error(`Unsupported unit: ${unit}`);
|
|
4093
4093
|
};
|
|
4094
4094
|
|
|
4095
|
-
// .model-contracts/generations/
|
|
4095
|
+
// .model-contracts/generations/344775224814556adaec789fbc570ee91a9e4064-v2/index.js
|
|
4096
4096
|
function normalizeNemaMotorModelString(value) {
|
|
4097
4097
|
if (!/^nema(?:8|17|23|34)(?:_|$)/i.test(value)) return value;
|
|
4098
4098
|
return value.replace(/(^|_)jst([0-9]+)_(ph|sh)(?=_|$)/gi, "$1jst$3$2").replace(/(^|_)jst[_-](ph|sh)[_-]([0-9]+)(?=_|$)/gi, "$1jst$2$3").replace(/(^|_)none(?=_|$)/gi, "$1nowires").replace(/(^|_)stubs(?=_|$)/gi, "$1wirestubs");
|
|
@@ -4178,55 +4178,55 @@ var stringFlags = {
|
|
|
4178
4178
|
male: "threadgender(male)"
|
|
4179
4179
|
};
|
|
4180
4180
|
var omittedStringFlags = ["righthanded", "male"];
|
|
4181
|
-
function defineModel(
|
|
4182
|
-
return
|
|
4181
|
+
function defineModel(model522) {
|
|
4182
|
+
return model522;
|
|
4183
4183
|
}
|
|
4184
4184
|
var ModelRegistry = class {
|
|
4185
4185
|
models = /* @__PURE__ */ new Map();
|
|
4186
|
-
register(
|
|
4187
|
-
if (typeof
|
|
4186
|
+
register(model522) {
|
|
4187
|
+
if (typeof model522.name !== "string" || !/^[a-z]+$/.test(model522.name)) {
|
|
4188
4188
|
throw new Error("Model names must contain only lowercase letters");
|
|
4189
4189
|
}
|
|
4190
|
-
if (this.models.has(
|
|
4190
|
+
if (this.models.has(model522.name)) {
|
|
4191
4191
|
throw new Error(
|
|
4192
|
-
`Modelprinter function "${
|
|
4192
|
+
`Modelprinter function "${model522.name}" is already registered`
|
|
4193
4193
|
);
|
|
4194
4194
|
}
|
|
4195
|
-
if (
|
|
4195
|
+
if (model522.normalizeString !== void 0 && typeof model522.normalizeString !== "function")
|
|
4196
4196
|
throw new Error("Model string normalizer must be a function");
|
|
4197
|
-
this.models.set(
|
|
4198
|
-
name:
|
|
4199
|
-
schema:
|
|
4200
|
-
parse:
|
|
4201
|
-
normalizeString:
|
|
4197
|
+
this.models.set(model522.name, {
|
|
4198
|
+
name: model522.name,
|
|
4199
|
+
schema: model522.schema,
|
|
4200
|
+
parse: model522.parse,
|
|
4201
|
+
normalizeString: model522.normalizeString
|
|
4202
4202
|
});
|
|
4203
4203
|
}
|
|
4204
4204
|
getModelNames() {
|
|
4205
4205
|
return [...this.models.keys()];
|
|
4206
4206
|
}
|
|
4207
4207
|
normalize(params) {
|
|
4208
|
-
const
|
|
4209
|
-
if (!
|
|
4210
|
-
const value =
|
|
4208
|
+
const model522 = this.models.get(params.fn);
|
|
4209
|
+
if (!model522?.normalizeString) return params;
|
|
4210
|
+
const value = model522.normalizeString(params.string);
|
|
4211
4211
|
if (typeof value !== "string")
|
|
4212
|
-
throw new Error(`Normalizer for "${
|
|
4212
|
+
throw new Error(`Normalizer for "${model522.name}" must return a string`);
|
|
4213
4213
|
if (value === params.string) return params;
|
|
4214
4214
|
const normalized = parseModelStringParams(value);
|
|
4215
|
-
if (normalized.fn !==
|
|
4215
|
+
if (normalized.fn !== model522.name)
|
|
4216
4216
|
throw new Error(
|
|
4217
|
-
`Normalizer for "${
|
|
4217
|
+
`Normalizer for "${model522.name}" must preserve the model name`
|
|
4218
4218
|
);
|
|
4219
4219
|
return normalized;
|
|
4220
4220
|
}
|
|
4221
4221
|
parse(params) {
|
|
4222
|
-
const
|
|
4223
|
-
if (!
|
|
4222
|
+
const model522 = this.models.get(params.fn);
|
|
4223
|
+
if (!model522) {
|
|
4224
4224
|
throw new Error(`Unsupported modelprinter function "${params.fn}"`);
|
|
4225
4225
|
}
|
|
4226
|
-
const definition =
|
|
4227
|
-
if (definition === null || typeof definition !== "object" || Array.isArray(definition) || definition.fn !==
|
|
4226
|
+
const definition = model522.parse(params);
|
|
4227
|
+
if (definition === null || typeof definition !== "object" || Array.isArray(definition) || definition.fn !== model522.name) {
|
|
4228
4228
|
throw new Error(
|
|
4229
|
-
`Parser for "${
|
|
4229
|
+
`Parser for "${model522.name}" must return a model with fn "${model522.name}"`
|
|
4230
4230
|
);
|
|
4231
4231
|
}
|
|
4232
4232
|
return definition;
|
|
@@ -5195,12 +5195,12 @@ function parseSheetMetalFeature(feature, profile6) {
|
|
|
5195
5195
|
}
|
|
5196
5196
|
if (!("l" in values) || !("w" in values))
|
|
5197
5197
|
throw new Error(`Slot requires l and w in ${feature}`);
|
|
5198
|
-
const
|
|
5199
|
-
if (
|
|
5198
|
+
const length30 = distance2("l"), width10 = distance2("w");
|
|
5199
|
+
if (length30 < width10) throw new Error("Slot length must be at least its width");
|
|
5200
5200
|
return sheetMetalHoleSchema.parse({
|
|
5201
5201
|
...position,
|
|
5202
5202
|
shape: "slot",
|
|
5203
|
-
length:
|
|
5203
|
+
length: length30,
|
|
5204
5204
|
width: width10,
|
|
5205
5205
|
axis: panel === "base" === !("vertical" in values) ? "u" : "v"
|
|
5206
5206
|
});
|
|
@@ -5403,9 +5403,9 @@ var flexScreenModelPropsSchema = external_exports.object(flexScreenModelPropsSha
|
|
|
5403
5403
|
var flexScreenModelDefinitionSchema = external_exports.object({
|
|
5404
5404
|
fn: external_exports.literal("flexscreen"),
|
|
5405
5405
|
...flexScreenModelPropsShape
|
|
5406
|
-
}).strict().superRefine((
|
|
5407
|
-
validateTailLengths(
|
|
5408
|
-
addOrientationShortcutIssue(
|
|
5406
|
+
}).strict().superRefine((model522, context) => {
|
|
5407
|
+
validateTailLengths(model522, context);
|
|
5408
|
+
addOrientationShortcutIssue(model522, (path) => {
|
|
5409
5409
|
context.addIssue({
|
|
5410
5410
|
code: "custom",
|
|
5411
5411
|
message: "Only one FlexScreen orientation shortcut can be true",
|
|
@@ -7034,8 +7034,8 @@ function getCompressionSpringCenterlinePoint(input, turn) {
|
|
|
7034
7034
|
const radius = (props.outerDiameter - props.wireDiameter) / 2;
|
|
7035
7035
|
const pitch = (props.freeLength - 2 * props.wireDiameter) / props.activeTurns;
|
|
7036
7036
|
const phase = (props.hand === "right" ? 1 : -1) * 2 * Math.PI * (turn % 1);
|
|
7037
|
-
const
|
|
7038
|
-
return { x: radius * Math.cos(phase), y: radius * Math.sin(phase), z:
|
|
7037
|
+
const z56 = turn <= 1 ? props.wireDiameter * turn : turn >= props.totalTurns - 1 ? props.freeLength - props.wireDiameter * (props.totalTurns - turn) : props.wireDiameter + pitch * (turn - 1);
|
|
7038
|
+
return { x: radius * Math.cos(phase), y: radius * Math.sin(phase), z: z56 };
|
|
7039
7039
|
}
|
|
7040
7040
|
function parseCompressionSpringModelParams(raw) {
|
|
7041
7041
|
const tokens = splitModelStringTokens(
|
|
@@ -9486,6 +9486,94 @@ var model29 = defineModel({
|
|
|
9486
9486
|
function register29(registry2) {
|
|
9487
9487
|
registry2.register(model29);
|
|
9488
9488
|
}
|
|
9489
|
+
var shape24 = {
|
|
9490
|
+
width: positiveGearLengthSchema,
|
|
9491
|
+
height: positiveGearLengthSchema,
|
|
9492
|
+
thickness: positiveGearLengthSchema,
|
|
9493
|
+
length: positiveGearLengthSchema,
|
|
9494
|
+
innerRadius: nonnegativeGearLengthSchema,
|
|
9495
|
+
holeCount: external_exports.number().finite().int().min(1).max(256),
|
|
9496
|
+
holeDiameter: positiveGearLengthSchema,
|
|
9497
|
+
pitch: positiveGearLengthSchema,
|
|
9498
|
+
endOffset: positiveGearLengthSchema,
|
|
9499
|
+
legOffset: positiveGearLengthSchema
|
|
9500
|
+
};
|
|
9501
|
+
function validate23(p, context) {
|
|
9502
|
+
const issue = (message, path) => context.addIssue({ code: "custom", message, path: [path] });
|
|
9503
|
+
const largestDimension = Math.max(
|
|
9504
|
+
...Object.values(p).filter(
|
|
9505
|
+
(value) => typeof value === "number"
|
|
9506
|
+
)
|
|
9507
|
+
);
|
|
9508
|
+
if (!Number.isFinite((4 * largestDimension) ** 3)) {
|
|
9509
|
+
issue(
|
|
9510
|
+
"Dimensions must permit finite derived coordinates and volume",
|
|
9511
|
+
"width"
|
|
9512
|
+
);
|
|
9513
|
+
return;
|
|
9514
|
+
}
|
|
9515
|
+
if (p.innerRadius + p.thickness >= Math.min(p.width, p.height))
|
|
9516
|
+
issue("The bend must leave a straight portion on both legs", "innerRadius");
|
|
9517
|
+
if (p.legOffset - p.holeDiameter / 2 <= p.innerRadius + p.thickness)
|
|
9518
|
+
issue("Leg holes must lie wholly beyond the bend tangents", "legOffset");
|
|
9519
|
+
if (p.legOffset + p.holeDiameter / 2 >= Math.min(p.width, p.height))
|
|
9520
|
+
issue("Leg holes must leave material at both free edges", "legOffset");
|
|
9521
|
+
if (p.pitch <= p.holeDiameter && p.holeCount > 1)
|
|
9522
|
+
issue("Hole pitch must leave material between consecutive holes", "pitch");
|
|
9523
|
+
if (p.endOffset <= p.holeDiameter / 2)
|
|
9524
|
+
issue(
|
|
9525
|
+
"The first hole must leave material at the first cut end",
|
|
9526
|
+
"endOffset"
|
|
9527
|
+
);
|
|
9528
|
+
if (p.endOffset + (p.holeCount - 1) * p.pitch + p.holeDiameter / 2 >= p.length)
|
|
9529
|
+
issue("The last hole must leave material at the far cut end", "length");
|
|
9530
|
+
}
|
|
9531
|
+
var perforatedAngleModelPropsSchema = external_exports.object(shape24).strict().superRefine(validate23);
|
|
9532
|
+
var perforatedAngleModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("perforatedangle"), ...shape24 }).strict().superRefine(validate23);
|
|
9533
|
+
var aliases8 = {
|
|
9534
|
+
w: "width",
|
|
9535
|
+
h: "height",
|
|
9536
|
+
t: "thickness",
|
|
9537
|
+
l: "length",
|
|
9538
|
+
innerr: "innerRadius",
|
|
9539
|
+
holes: "holeCount",
|
|
9540
|
+
hole: "holeDiameter",
|
|
9541
|
+
pitch: "pitch",
|
|
9542
|
+
end: "endOffset",
|
|
9543
|
+
legoffset: "legOffset",
|
|
9544
|
+
width: "width",
|
|
9545
|
+
height: "height",
|
|
9546
|
+
thickness: "thickness",
|
|
9547
|
+
length: "length",
|
|
9548
|
+
innerradius: "innerRadius",
|
|
9549
|
+
holecount: "holeCount",
|
|
9550
|
+
holediameter: "holeDiameter",
|
|
9551
|
+
endoffset: "endOffset"
|
|
9552
|
+
};
|
|
9553
|
+
function parsePerforatedAngleModelParams(raw) {
|
|
9554
|
+
const [name, ...tokens] = splitModelStringTokens(raw.string);
|
|
9555
|
+
if (raw.fn !== "perforatedangle" || name?.toLowerCase() !== "perforatedangle")
|
|
9556
|
+
throw new Error("Expected perforatedangle without inline values");
|
|
9557
|
+
const props = { fn: "perforatedangle" };
|
|
9558
|
+
for (const token of tokens) {
|
|
9559
|
+
const [key, value] = parseGearToken(token);
|
|
9560
|
+
if (!Object.hasOwn(aliases8, key) || !value)
|
|
9561
|
+
throw new Error(`Unknown or malformed perforatedangle token "${token}"`);
|
|
9562
|
+
const property = aliases8[key];
|
|
9563
|
+
if (Object.hasOwn(props, property))
|
|
9564
|
+
throw new Error(`Repeated perforatedangle property "${property}"`);
|
|
9565
|
+
props[property] = ["holeCount"].includes(property) ? parseGearInteger(value, property) : value;
|
|
9566
|
+
}
|
|
9567
|
+
return perforatedAngleModelDefinitionSchema.parse(props);
|
|
9568
|
+
}
|
|
9569
|
+
var model30 = defineModel({
|
|
9570
|
+
name: "perforatedangle",
|
|
9571
|
+
schema: perforatedAngleModelDefinitionSchema,
|
|
9572
|
+
parse: parsePerforatedAngleModelParams
|
|
9573
|
+
});
|
|
9574
|
+
function register30(registry2) {
|
|
9575
|
+
registry2.register(model30);
|
|
9576
|
+
}
|
|
9489
9577
|
var length15 = external_exports.union([
|
|
9490
9578
|
external_exports.number(),
|
|
9491
9579
|
external_exports.string().regex(/^[+]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i).transform((value) => value.toLowerCase())
|
|
@@ -9498,7 +9586,7 @@ var nonnegativeLength4 = length15.refine(
|
|
|
9498
9586
|
(value) => value >= 0,
|
|
9499
9587
|
"Length cannot be negative"
|
|
9500
9588
|
);
|
|
9501
|
-
var
|
|
9589
|
+
var shape25 = {
|
|
9502
9590
|
length: positiveLength10,
|
|
9503
9591
|
width: positiveLength10,
|
|
9504
9592
|
thickness: positiveLength10,
|
|
@@ -9509,7 +9597,7 @@ var shape24 = {
|
|
|
9509
9597
|
edgeY: positiveLength10,
|
|
9510
9598
|
stagger: nonnegativeLength4.default(0)
|
|
9511
9599
|
};
|
|
9512
|
-
function
|
|
9600
|
+
function validate24(p, context) {
|
|
9513
9601
|
if (p.holeDiameter >= Math.min(p.pitchX, p.pitchY))
|
|
9514
9602
|
context.addIssue({
|
|
9515
9603
|
code: "custom",
|
|
@@ -9536,9 +9624,9 @@ function validate23(p, context) {
|
|
|
9536
9624
|
message: "Invalid perforatedsheet dimensions: constraint 5"
|
|
9537
9625
|
});
|
|
9538
9626
|
}
|
|
9539
|
-
var perforatedSheetModelPropsSchema = external_exports.object(
|
|
9540
|
-
var perforatedSheetModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("perforatedsheet"), ...
|
|
9541
|
-
var
|
|
9627
|
+
var perforatedSheetModelPropsSchema = external_exports.object(shape25).strict().superRefine(validate24);
|
|
9628
|
+
var perforatedSheetModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("perforatedsheet"), ...shape25 }).strict().superRefine(validate24);
|
|
9629
|
+
var aliases9 = {
|
|
9542
9630
|
l: "length",
|
|
9543
9631
|
w: "width",
|
|
9544
9632
|
t: "thickness",
|
|
@@ -9562,22 +9650,22 @@ function parsePerforatedSheetModelParams(raw) {
|
|
|
9562
9650
|
const match = token.match(/^([a-z]+)(.*)$/i);
|
|
9563
9651
|
const key = match?.[1]?.toLowerCase();
|
|
9564
9652
|
const value = match?.[2];
|
|
9565
|
-
if (!key || !Object.hasOwn(
|
|
9653
|
+
if (!key || !Object.hasOwn(aliases9, key) || !value)
|
|
9566
9654
|
throw new Error(`Unknown or malformed perforatedsheet token "${token}"`);
|
|
9567
|
-
const property =
|
|
9655
|
+
const property = aliases9[key];
|
|
9568
9656
|
if (Object.hasOwn(props, property))
|
|
9569
9657
|
throw new Error(`Duplicate perforatedsheet property "${property}"`);
|
|
9570
9658
|
props[property] = value;
|
|
9571
9659
|
}
|
|
9572
9660
|
return perforatedSheetModelDefinitionSchema.parse(props);
|
|
9573
9661
|
}
|
|
9574
|
-
var
|
|
9662
|
+
var model31 = defineModel({
|
|
9575
9663
|
name: "perforatedsheet",
|
|
9576
9664
|
schema: perforatedSheetModelDefinitionSchema,
|
|
9577
9665
|
parse: parsePerforatedSheetModelParams
|
|
9578
9666
|
});
|
|
9579
|
-
function
|
|
9580
|
-
registry2.register(
|
|
9667
|
+
function register31(registry2) {
|
|
9668
|
+
registry2.register(model31);
|
|
9581
9669
|
}
|
|
9582
9670
|
var stringFlags10 = {
|
|
9583
9671
|
plainclosed: "style(plainclosed)"
|
|
@@ -9588,7 +9676,7 @@ var length16 = external_exports.union([
|
|
|
9588
9676
|
external_exports.string().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i).transform((value) => value.toLowerCase())
|
|
9589
9677
|
]).pipe(modelLengthSchema);
|
|
9590
9678
|
var positiveLength11 = length16.refine((value) => value > 0);
|
|
9591
|
-
var
|
|
9679
|
+
var shape26 = {
|
|
9592
9680
|
innerDiameter: positiveLength11,
|
|
9593
9681
|
outerDiameter: positiveLength11,
|
|
9594
9682
|
/** Overall end-plane distance, including the chamfers. */
|
|
@@ -9597,7 +9685,7 @@ var shape25 = {
|
|
|
9597
9685
|
/** Equal axial/radial setbacks of all four 45-degree bore/outside rim chamfers. */
|
|
9598
9686
|
edgeChamfer: length16.refine((value) => value >= 0).default(0)
|
|
9599
9687
|
};
|
|
9600
|
-
function
|
|
9688
|
+
function validate25(props, context) {
|
|
9601
9689
|
if (props.outerDiameter <= props.innerDiameter)
|
|
9602
9690
|
context.addIssue({
|
|
9603
9691
|
code: "custom",
|
|
@@ -9617,8 +9705,8 @@ function validate24(props, context) {
|
|
|
9617
9705
|
message: "The two end chamfers must leave positive straight bore length"
|
|
9618
9706
|
});
|
|
9619
9707
|
}
|
|
9620
|
-
var plainBushingModelPropsSchema = external_exports.object(
|
|
9621
|
-
var plainBushingModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("plainbushing"), ...
|
|
9708
|
+
var plainBushingModelPropsSchema = external_exports.object(shape26).strict().superRefine(validate25);
|
|
9709
|
+
var plainBushingModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("plainbushing"), ...shape26 }).strict().superRefine(validate25);
|
|
9622
9710
|
function getPlainBushingDimensions(input) {
|
|
9623
9711
|
const props = plainBushingModelPropsSchema.parse(input);
|
|
9624
9712
|
return {
|
|
@@ -9671,7 +9759,7 @@ function parsePlainBushingModelParams(raw) {
|
|
|
9671
9759
|
}
|
|
9672
9760
|
return plainBushingModelDefinitionSchema.parse(props);
|
|
9673
9761
|
}
|
|
9674
|
-
var
|
|
9762
|
+
var model32 = defineModel({
|
|
9675
9763
|
name: "plainbushing",
|
|
9676
9764
|
schema: plainBushingModelDefinitionSchema,
|
|
9677
9765
|
parse: parsePlainBushingModelParams,
|
|
@@ -9682,8 +9770,8 @@ var model31 = defineModel({
|
|
|
9682
9770
|
omittedStringFlags10
|
|
9683
9771
|
)
|
|
9684
9772
|
});
|
|
9685
|
-
function
|
|
9686
|
-
registry2.register(
|
|
9773
|
+
function register32(registry2) {
|
|
9774
|
+
registry2.register(model32);
|
|
9687
9775
|
}
|
|
9688
9776
|
var length17 = external_exports.union([
|
|
9689
9777
|
external_exports.number(),
|
|
@@ -9693,13 +9781,13 @@ var positiveLength12 = length17.refine(
|
|
|
9693
9781
|
(value) => value > 0,
|
|
9694
9782
|
"Length must be positive"
|
|
9695
9783
|
);
|
|
9696
|
-
var
|
|
9784
|
+
var shape27 = {
|
|
9697
9785
|
tubeDiameter: positiveLength12,
|
|
9698
9786
|
length: positiveLength12,
|
|
9699
9787
|
headDiameter: positiveLength12,
|
|
9700
9788
|
headThickness: positiveLength12
|
|
9701
9789
|
};
|
|
9702
|
-
function
|
|
9790
|
+
function validate26(p, context) {
|
|
9703
9791
|
if (p.headDiameter <= p.tubeDiameter)
|
|
9704
9792
|
context.addIssue({
|
|
9705
9793
|
code: "custom",
|
|
@@ -9711,9 +9799,9 @@ function validate25(p, context) {
|
|
|
9711
9799
|
message: "Invalid pushfitplug dimensions: constraint 2"
|
|
9712
9800
|
});
|
|
9713
9801
|
}
|
|
9714
|
-
var pushFitPlugModelPropsSchema = external_exports.object(
|
|
9715
|
-
var pushFitPlugModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("pushfitplug"), ...
|
|
9716
|
-
var
|
|
9802
|
+
var pushFitPlugModelPropsSchema = external_exports.object(shape27).strict().superRefine(validate26);
|
|
9803
|
+
var pushFitPlugModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("pushfitplug"), ...shape27 }).strict().superRefine(validate26);
|
|
9804
|
+
var aliases10 = {
|
|
9717
9805
|
tubeod: "tubeDiameter",
|
|
9718
9806
|
l: "length",
|
|
9719
9807
|
headod: "headDiameter",
|
|
@@ -9732,22 +9820,22 @@ function parsePushFitPlugModelParams(raw) {
|
|
|
9732
9820
|
const match = token.match(/^([a-z]+)(.*)$/i);
|
|
9733
9821
|
const key = match?.[1]?.toLowerCase();
|
|
9734
9822
|
const value = match?.[2];
|
|
9735
|
-
if (!key || !Object.hasOwn(
|
|
9823
|
+
if (!key || !Object.hasOwn(aliases10, key) || !value)
|
|
9736
9824
|
throw new Error(`Unknown or malformed pushfitplug token "${token}"`);
|
|
9737
|
-
const property =
|
|
9825
|
+
const property = aliases10[key];
|
|
9738
9826
|
if (Object.hasOwn(props, property))
|
|
9739
9827
|
throw new Error(`Duplicate pushfitplug property "${property}"`);
|
|
9740
9828
|
props[property] = value;
|
|
9741
9829
|
}
|
|
9742
9830
|
return pushFitPlugModelDefinitionSchema.parse(props);
|
|
9743
9831
|
}
|
|
9744
|
-
var
|
|
9832
|
+
var model33 = defineModel({
|
|
9745
9833
|
name: "pushfitplug",
|
|
9746
9834
|
schema: pushFitPlugModelDefinitionSchema,
|
|
9747
9835
|
parse: parsePushFitPlugModelParams
|
|
9748
9836
|
});
|
|
9749
|
-
function
|
|
9750
|
-
registry2.register(
|
|
9837
|
+
function register33(registry2) {
|
|
9838
|
+
registry2.register(model33);
|
|
9751
9839
|
}
|
|
9752
9840
|
var length18 = external_exports.union([
|
|
9753
9841
|
external_exports.number(),
|
|
@@ -9761,22 +9849,22 @@ var nonnegativeLength5 = length18.refine(
|
|
|
9761
9849
|
(value) => value >= 0,
|
|
9762
9850
|
"Length cannot be negative"
|
|
9763
9851
|
);
|
|
9764
|
-
var
|
|
9852
|
+
var shape28 = {
|
|
9765
9853
|
width: positiveLength13,
|
|
9766
9854
|
height: positiveLength13,
|
|
9767
9855
|
length: positiveLength13,
|
|
9768
9856
|
cornerRadius: nonnegativeLength5.default(0)
|
|
9769
9857
|
};
|
|
9770
|
-
function
|
|
9858
|
+
function validate27(p, context) {
|
|
9771
9859
|
if (p.cornerRadius * 2 >= Math.min(p.width, p.height))
|
|
9772
9860
|
context.addIssue({
|
|
9773
9861
|
code: "custom",
|
|
9774
9862
|
message: "Invalid rectangularbar dimensions: constraint 1"
|
|
9775
9863
|
});
|
|
9776
9864
|
}
|
|
9777
|
-
var rectangularBarModelPropsSchema = external_exports.object(
|
|
9778
|
-
var rectangularBarModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("rectangularbar"), ...
|
|
9779
|
-
var
|
|
9865
|
+
var rectangularBarModelPropsSchema = external_exports.object(shape28).strict().superRefine(validate27);
|
|
9866
|
+
var rectangularBarModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("rectangularbar"), ...shape28 }).strict().superRefine(validate27);
|
|
9867
|
+
var aliases11 = {
|
|
9780
9868
|
w: "width",
|
|
9781
9869
|
h: "height",
|
|
9782
9870
|
l: "length",
|
|
@@ -9795,22 +9883,22 @@ function parseRectangularBarModelParams(raw) {
|
|
|
9795
9883
|
const match = token.match(/^([a-z]+)(.*)$/i);
|
|
9796
9884
|
const key = match?.[1]?.toLowerCase();
|
|
9797
9885
|
const value = match?.[2];
|
|
9798
|
-
if (!key || !Object.hasOwn(
|
|
9886
|
+
if (!key || !Object.hasOwn(aliases11, key) || !value)
|
|
9799
9887
|
throw new Error(`Unknown or malformed rectangularbar token "${token}"`);
|
|
9800
|
-
const property =
|
|
9888
|
+
const property = aliases11[key];
|
|
9801
9889
|
if (Object.hasOwn(props, property))
|
|
9802
9890
|
throw new Error(`Duplicate rectangularbar property "${property}"`);
|
|
9803
9891
|
props[property] = value;
|
|
9804
9892
|
}
|
|
9805
9893
|
return rectangularBarModelDefinitionSchema.parse(props);
|
|
9806
9894
|
}
|
|
9807
|
-
var
|
|
9895
|
+
var model34 = defineModel({
|
|
9808
9896
|
name: "rectangularbar",
|
|
9809
9897
|
schema: rectangularBarModelDefinitionSchema,
|
|
9810
9898
|
parse: parseRectangularBarModelParams
|
|
9811
9899
|
});
|
|
9812
|
-
function
|
|
9813
|
-
registry2.register(
|
|
9900
|
+
function register34(registry2) {
|
|
9901
|
+
registry2.register(model34);
|
|
9814
9902
|
}
|
|
9815
9903
|
var length19 = external_exports.union([
|
|
9816
9904
|
external_exports.number(),
|
|
@@ -9827,7 +9915,7 @@ var nonnegativeLength6 = length19.refine(
|
|
|
9827
9915
|
(value) => value >= 0,
|
|
9828
9916
|
"Length cannot be negative"
|
|
9829
9917
|
);
|
|
9830
|
-
var
|
|
9918
|
+
var shape29 = {
|
|
9831
9919
|
width: positiveLength14,
|
|
9832
9920
|
height: positiveLength14,
|
|
9833
9921
|
border: positiveLength14,
|
|
@@ -9835,7 +9923,7 @@ var shape28 = {
|
|
|
9835
9923
|
cornerRadius: nonnegativeLength6.default(0),
|
|
9836
9924
|
flatFrame: external_exports.literal(true).default(true)
|
|
9837
9925
|
};
|
|
9838
|
-
function
|
|
9926
|
+
function validate28(p, context) {
|
|
9839
9927
|
const issue = (message, path) => context.addIssue({ code: "custom", message, path: [path] });
|
|
9840
9928
|
if (2 * p.border >= Math.min(p.width, p.height))
|
|
9841
9929
|
issue(
|
|
@@ -9852,8 +9940,8 @@ function validate27(p, context) {
|
|
|
9852
9940
|
))
|
|
9853
9941
|
issue("Dimensions exceed finite derived geometry limits", "width");
|
|
9854
9942
|
}
|
|
9855
|
-
var rectangularGasketModelPropsSchema = external_exports.object(
|
|
9856
|
-
var rectangularGasketModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("rectangulargasket"), ...
|
|
9943
|
+
var rectangularGasketModelPropsSchema = external_exports.object(shape29).strict().superRefine(validate28);
|
|
9944
|
+
var rectangularGasketModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("rectangulargasket"), ...shape29 }).strict().superRefine(validate28);
|
|
9857
9945
|
function getRectangularGasketDimensions(input) {
|
|
9858
9946
|
const p = rectangularGasketModelPropsSchema.parse(input);
|
|
9859
9947
|
return {
|
|
@@ -9915,13 +10003,13 @@ function parseRectangularGasketModelParams(raw) {
|
|
|
9915
10003
|
}
|
|
9916
10004
|
return rectangularGasketModelDefinitionSchema.parse(props);
|
|
9917
10005
|
}
|
|
9918
|
-
var
|
|
10006
|
+
var model35 = defineModel({
|
|
9919
10007
|
name: "rectangulargasket",
|
|
9920
10008
|
schema: rectangularGasketModelDefinitionSchema,
|
|
9921
10009
|
parse: parseRectangularGasketModelParams
|
|
9922
10010
|
});
|
|
9923
|
-
function
|
|
9924
|
-
registry2.register(
|
|
10011
|
+
function register35(registry2) {
|
|
10012
|
+
registry2.register(model35);
|
|
9925
10013
|
}
|
|
9926
10014
|
var length20 = external_exports.union([
|
|
9927
10015
|
external_exports.number(),
|
|
@@ -9935,7 +10023,7 @@ var nonnegativeLength7 = length20.refine(
|
|
|
9935
10023
|
(value) => value >= 0,
|
|
9936
10024
|
"Length cannot be negative"
|
|
9937
10025
|
);
|
|
9938
|
-
var
|
|
10026
|
+
var shape30 = {
|
|
9939
10027
|
width: positiveLength15,
|
|
9940
10028
|
height: positiveLength15,
|
|
9941
10029
|
wallThickness: positiveLength15,
|
|
@@ -9943,7 +10031,7 @@ var shape29 = {
|
|
|
9943
10031
|
outerRadius: nonnegativeLength7.default(0),
|
|
9944
10032
|
innerRadius: nonnegativeLength7.default(0)
|
|
9945
10033
|
};
|
|
9946
|
-
function
|
|
10034
|
+
function validate29(p, context) {
|
|
9947
10035
|
if (2 * p.wallThickness >= Math.min(p.width, p.height))
|
|
9948
10036
|
context.addIssue({
|
|
9949
10037
|
code: "custom",
|
|
@@ -9965,9 +10053,9 @@ function validate28(p, context) {
|
|
|
9965
10053
|
message: "Invalid rectangulartube dimensions: constraint 4"
|
|
9966
10054
|
});
|
|
9967
10055
|
}
|
|
9968
|
-
var rectangularTubeModelPropsSchema = external_exports.object(
|
|
9969
|
-
var rectangularTubeModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("rectangulartube"), ...
|
|
9970
|
-
var
|
|
10056
|
+
var rectangularTubeModelPropsSchema = external_exports.object(shape30).strict().superRefine(validate29);
|
|
10057
|
+
var rectangularTubeModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("rectangulartube"), ...shape30 }).strict().superRefine(validate29);
|
|
10058
|
+
var aliases12 = {
|
|
9971
10059
|
w: "width",
|
|
9972
10060
|
h: "height",
|
|
9973
10061
|
wall: "wallThickness",
|
|
@@ -9990,22 +10078,22 @@ function parseRectangularTubeModelParams(raw) {
|
|
|
9990
10078
|
const match = token.match(/^([a-z]+)(.*)$/i);
|
|
9991
10079
|
const key = match?.[1]?.toLowerCase();
|
|
9992
10080
|
const value = match?.[2];
|
|
9993
|
-
if (!key || !Object.hasOwn(
|
|
10081
|
+
if (!key || !Object.hasOwn(aliases12, key) || !value)
|
|
9994
10082
|
throw new Error(`Unknown or malformed rectangulartube token "${token}"`);
|
|
9995
|
-
const property =
|
|
10083
|
+
const property = aliases12[key];
|
|
9996
10084
|
if (Object.hasOwn(props, property))
|
|
9997
10085
|
throw new Error(`Duplicate rectangulartube property "${property}"`);
|
|
9998
10086
|
props[property] = value;
|
|
9999
10087
|
}
|
|
10000
10088
|
return rectangularTubeModelDefinitionSchema.parse(props);
|
|
10001
10089
|
}
|
|
10002
|
-
var
|
|
10090
|
+
var model36 = defineModel({
|
|
10003
10091
|
name: "rectangulartube",
|
|
10004
10092
|
schema: rectangularTubeModelDefinitionSchema,
|
|
10005
10093
|
parse: parseRectangularTubeModelParams
|
|
10006
10094
|
});
|
|
10007
|
-
function
|
|
10008
|
-
registry2.register(
|
|
10095
|
+
function register36(registry2) {
|
|
10096
|
+
registry2.register(model36);
|
|
10009
10097
|
}
|
|
10010
10098
|
var stringFlags11 = {
|
|
10011
10099
|
setscrew: "mount(setscrew)",
|
|
@@ -10025,7 +10113,7 @@ var nonnegative4 = length21.refine(
|
|
|
10025
10113
|
(value) => value >= 0,
|
|
10026
10114
|
"Length cannot be negative"
|
|
10027
10115
|
);
|
|
10028
|
-
var
|
|
10116
|
+
var shape31 = {
|
|
10029
10117
|
boreDiameter: positive5,
|
|
10030
10118
|
outerDiameter: positive5,
|
|
10031
10119
|
boreBDiameter: positive5.optional(),
|
|
@@ -10050,7 +10138,7 @@ function resolve6(props) {
|
|
|
10050
10138
|
screwAngle: (props.screwAngle % 360 + 360) % 360
|
|
10051
10139
|
};
|
|
10052
10140
|
}
|
|
10053
|
-
function
|
|
10141
|
+
function validate30(props, context) {
|
|
10054
10142
|
const p = resolve6(props);
|
|
10055
10143
|
const issue = (message) => context.addIssue({ code: "custom", message });
|
|
10056
10144
|
const diameter = hexSocketBoltDimensions[p.metricSize].diameter;
|
|
@@ -10074,8 +10162,8 @@ function validate29(props, context) {
|
|
|
10074
10162
|
if (p.length - 2 * p.screwEndOffset <= diameter)
|
|
10075
10163
|
issue("Each end must have a separate, nonintersecting screw-hole plane");
|
|
10076
10164
|
}
|
|
10077
|
-
var rigidCouplerModelPropsSchema = external_exports.object(
|
|
10078
|
-
var rigidCouplerModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("rigidcoupler"), ...
|
|
10165
|
+
var rigidCouplerModelPropsSchema = external_exports.object(shape31).strict().superRefine(validate30).transform(resolve6);
|
|
10166
|
+
var rigidCouplerModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("rigidcoupler"), ...shape31 }).strict().superRefine(validate30).transform((props) => ({ fn: props.fn, ...resolve6(props) }));
|
|
10079
10167
|
function getRigidCouplerDimensions(input) {
|
|
10080
10168
|
const p = rigidCouplerModelPropsSchema.parse(input);
|
|
10081
10169
|
const threadDiameter = hexSocketBoltDimensions[p.metricSize].diameter;
|
|
@@ -10175,7 +10263,7 @@ function parseRigidCouplerModelParams(raw) {
|
|
|
10175
10263
|
...props
|
|
10176
10264
|
});
|
|
10177
10265
|
}
|
|
10178
|
-
var
|
|
10266
|
+
var model37 = defineModel({
|
|
10179
10267
|
name: "rigidcoupler",
|
|
10180
10268
|
schema: rigidCouplerModelDefinitionSchema,
|
|
10181
10269
|
parse: parseRigidCouplerModelParams,
|
|
@@ -10186,8 +10274,8 @@ var model36 = defineModel({
|
|
|
10186
10274
|
omittedStringFlags11
|
|
10187
10275
|
)
|
|
10188
10276
|
});
|
|
10189
|
-
function
|
|
10190
|
-
registry2.register(
|
|
10277
|
+
function register37(registry2) {
|
|
10278
|
+
registry2.register(model37);
|
|
10191
10279
|
}
|
|
10192
10280
|
var positiveLength16 = external_exports.union([
|
|
10193
10281
|
external_exports.number(),
|
|
@@ -10244,7 +10332,7 @@ var setscrewDimensions = {
|
|
|
10244
10332
|
}
|
|
10245
10333
|
};
|
|
10246
10334
|
var setscrewMetricSizeSchema = external_exports.enum(["M3", "M4", "M5", "M6"]);
|
|
10247
|
-
var
|
|
10335
|
+
var shape32 = {
|
|
10248
10336
|
iso4029: external_exports.literal(true).default(true),
|
|
10249
10337
|
metricSize: setscrewMetricSizeSchema,
|
|
10250
10338
|
length: positiveLength16,
|
|
@@ -10263,7 +10351,7 @@ var shape31 = {
|
|
|
10263
10351
|
threadRootDiameter: positiveLength16.optional(),
|
|
10264
10352
|
threadPitchDiameter: positiveLength16.optional()
|
|
10265
10353
|
};
|
|
10266
|
-
var
|
|
10354
|
+
var validate31 = (props, context) => {
|
|
10267
10355
|
const dimensions5 = setscrewDimensions[props.metricSize];
|
|
10268
10356
|
for (const key of Object.keys(dimensions5)) {
|
|
10269
10357
|
if (props[key] !== void 0 && Math.abs(props[key] - dimensions5[key]) > 1e-9)
|
|
@@ -10280,9 +10368,9 @@ var validate30 = (props, context) => {
|
|
|
10280
10368
|
message: "Length must leave material between fixed end features"
|
|
10281
10369
|
});
|
|
10282
10370
|
};
|
|
10283
|
-
var setscrewModelPropsSchema = external_exports.object(
|
|
10284
|
-
var setscrewModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("setscrew"), ...
|
|
10285
|
-
var
|
|
10371
|
+
var setscrewModelPropsSchema = external_exports.object(shape32).strict().superRefine(validate31).transform((props) => ({ ...props, ...setscrewDimensions[props.metricSize] }));
|
|
10372
|
+
var setscrewModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("setscrew"), ...shape32 }).strict().superRefine(validate31).transform((props) => ({ ...props, ...setscrewDimensions[props.metricSize] }));
|
|
10373
|
+
var aliases13 = {
|
|
10286
10374
|
m: "metricSize",
|
|
10287
10375
|
metricsize: "metricSize",
|
|
10288
10376
|
l: "length",
|
|
@@ -10331,7 +10419,7 @@ function parseSetScrewModelParams(raw) {
|
|
|
10331
10419
|
property = flags6[key];
|
|
10332
10420
|
parsed = !["righthanded", "nothreads"].includes(key);
|
|
10333
10421
|
} else {
|
|
10334
|
-
property =
|
|
10422
|
+
property = aliases13[key] ?? "";
|
|
10335
10423
|
if (!property || !value)
|
|
10336
10424
|
throw new Error(`Unknown or missing setscrew token ${token}`);
|
|
10337
10425
|
if (property === "metricSize") {
|
|
@@ -10354,13 +10442,13 @@ function parseSetScrewModelParams(raw) {
|
|
|
10354
10442
|
}
|
|
10355
10443
|
return setscrewModelDefinitionSchema.parse({ fn: "setscrew", ...props });
|
|
10356
10444
|
}
|
|
10357
|
-
var
|
|
10445
|
+
var model38 = defineModel({
|
|
10358
10446
|
name: "setscrew",
|
|
10359
10447
|
schema: setscrewModelDefinitionSchema,
|
|
10360
10448
|
parse: parseSetScrewModelParams
|
|
10361
10449
|
});
|
|
10362
|
-
function
|
|
10363
|
-
registry2.register(
|
|
10450
|
+
function register38(registry2) {
|
|
10451
|
+
registry2.register(model38);
|
|
10364
10452
|
}
|
|
10365
10453
|
var stringFlags12 = {
|
|
10366
10454
|
setscrew: "mount(setscrew)",
|
|
@@ -10380,7 +10468,7 @@ var nonnegative5 = length22.refine(
|
|
|
10380
10468
|
(value) => value >= 0,
|
|
10381
10469
|
"Length cannot be negative"
|
|
10382
10470
|
);
|
|
10383
|
-
var
|
|
10471
|
+
var shape33 = {
|
|
10384
10472
|
boreDiameter: positive6,
|
|
10385
10473
|
outerDiameter: positive6,
|
|
10386
10474
|
width: positive6,
|
|
@@ -10402,7 +10490,7 @@ function resolve7(props) {
|
|
|
10402
10490
|
screwAngle: (props.screwAngle % 360 + 360) % 360
|
|
10403
10491
|
};
|
|
10404
10492
|
}
|
|
10405
|
-
function
|
|
10493
|
+
function validate32(props, context) {
|
|
10406
10494
|
const p = resolve7(props);
|
|
10407
10495
|
const issue = (message) => context.addIssue({ code: "custom", message });
|
|
10408
10496
|
const diameter = hexSocketBoltDimensions[p.metricSize].diameter;
|
|
@@ -10419,8 +10507,8 @@ function validate31(props, context) {
|
|
|
10419
10507
|
if (p.screwZ - diameter / 2 <= p.chamfer || p.screwZ + diameter / 2 >= p.width - p.chamfer)
|
|
10420
10508
|
issue("Screw hole must clear both end faces and chamfers");
|
|
10421
10509
|
}
|
|
10422
|
-
var shaftCollarModelPropsSchema = external_exports.object(
|
|
10423
|
-
var shaftCollarModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("shaftcollar"), ...
|
|
10510
|
+
var shaftCollarModelPropsSchema = external_exports.object(shape33).strict().superRefine(validate32).transform(resolve7);
|
|
10511
|
+
var shaftCollarModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("shaftcollar"), ...shape33 }).strict().superRefine(validate32).transform((props) => ({ fn: props.fn, ...resolve7(props) }));
|
|
10424
10512
|
function getShaftCollarDimensions(input) {
|
|
10425
10513
|
const p = shaftCollarModelPropsSchema.parse(input);
|
|
10426
10514
|
const threadDiameter = hexSocketBoltDimensions[p.metricSize].diameter;
|
|
@@ -10494,7 +10582,7 @@ function parseShaftCollarModelParams(raw) {
|
|
|
10494
10582
|
}
|
|
10495
10583
|
return shaftCollarModelDefinitionSchema.parse({ fn: "shaftcollar", ...props });
|
|
10496
10584
|
}
|
|
10497
|
-
var
|
|
10585
|
+
var model39 = defineModel({
|
|
10498
10586
|
name: "shaftcollar",
|
|
10499
10587
|
schema: shaftCollarModelDefinitionSchema,
|
|
10500
10588
|
parse: parseShaftCollarModelParams,
|
|
@@ -10505,10 +10593,10 @@ var model38 = defineModel({
|
|
|
10505
10593
|
omittedStringFlags12
|
|
10506
10594
|
)
|
|
10507
10595
|
});
|
|
10508
|
-
function
|
|
10509
|
-
registry2.register(
|
|
10596
|
+
function register39(registry2) {
|
|
10597
|
+
registry2.register(model39);
|
|
10510
10598
|
}
|
|
10511
|
-
var
|
|
10599
|
+
var shape34 = {
|
|
10512
10600
|
width: positiveGearLengthSchema,
|
|
10513
10601
|
height: positiveGearLengthSchema,
|
|
10514
10602
|
thickness: positiveGearLengthSchema,
|
|
@@ -10520,7 +10608,7 @@ var shape33 = {
|
|
|
10520
10608
|
pitch: positiveGearLengthSchema,
|
|
10521
10609
|
endOffset: positiveGearLengthSchema
|
|
10522
10610
|
};
|
|
10523
|
-
function
|
|
10611
|
+
function validate33(p, context) {
|
|
10524
10612
|
const issue = (message, path) => context.addIssue({ code: "custom", message, path: [path] });
|
|
10525
10613
|
const largestDimension = Math.max(
|
|
10526
10614
|
...Object.values(p).filter(
|
|
@@ -10552,9 +10640,9 @@ function validate32(p, context) {
|
|
|
10552
10640
|
if (p.endOffset + (p.slotCount - 1) * p.pitch + p.slotLength / 2 >= p.length)
|
|
10553
10641
|
issue("The last slot must leave material at the far cut end", "length");
|
|
10554
10642
|
}
|
|
10555
|
-
var slottedChannelModelPropsSchema = external_exports.object(
|
|
10556
|
-
var slottedChannelModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("slottedchannel"), ...
|
|
10557
|
-
var
|
|
10643
|
+
var slottedChannelModelPropsSchema = external_exports.object(shape34).strict().superRefine(validate33);
|
|
10644
|
+
var slottedChannelModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("slottedchannel"), ...shape34 }).strict().superRefine(validate33);
|
|
10645
|
+
var aliases14 = {
|
|
10558
10646
|
w: "width",
|
|
10559
10647
|
h: "height",
|
|
10560
10648
|
t: "thickness",
|
|
@@ -10582,22 +10670,22 @@ function parseSlottedChannelModelParams(raw) {
|
|
|
10582
10670
|
const props = { fn: "slottedchannel" };
|
|
10583
10671
|
for (const token of tokens) {
|
|
10584
10672
|
const [key, value] = parseGearToken(token);
|
|
10585
|
-
if (!Object.hasOwn(
|
|
10673
|
+
if (!Object.hasOwn(aliases14, key) || !value)
|
|
10586
10674
|
throw new Error(`Unknown or malformed slottedchannel token "${token}"`);
|
|
10587
|
-
const property =
|
|
10675
|
+
const property = aliases14[key];
|
|
10588
10676
|
if (Object.hasOwn(props, property))
|
|
10589
10677
|
throw new Error(`Repeated slottedchannel property "${property}"`);
|
|
10590
10678
|
props[property] = ["slotCount"].includes(property) ? parseGearInteger(value, property) : value;
|
|
10591
10679
|
}
|
|
10592
10680
|
return slottedChannelModelDefinitionSchema.parse(props);
|
|
10593
10681
|
}
|
|
10594
|
-
var
|
|
10682
|
+
var model40 = defineModel({
|
|
10595
10683
|
name: "slottedchannel",
|
|
10596
10684
|
schema: slottedChannelModelDefinitionSchema,
|
|
10597
10685
|
parse: parseSlottedChannelModelParams
|
|
10598
10686
|
});
|
|
10599
|
-
function
|
|
10600
|
-
registry2.register(
|
|
10687
|
+
function register40(registry2) {
|
|
10688
|
+
registry2.register(model40);
|
|
10601
10689
|
}
|
|
10602
10690
|
var length23 = external_exports.union([
|
|
10603
10691
|
external_exports.number(),
|
|
@@ -10607,7 +10695,7 @@ var positiveLength17 = length23.refine(
|
|
|
10607
10695
|
(value) => value > 0,
|
|
10608
10696
|
"Length must be positive"
|
|
10609
10697
|
);
|
|
10610
|
-
var
|
|
10698
|
+
var shape35 = {
|
|
10611
10699
|
innerDiameter: positiveLength17,
|
|
10612
10700
|
outerDiameter: positiveLength17,
|
|
10613
10701
|
/** End-plane distance, including the rim chamfers. */
|
|
@@ -10616,7 +10704,7 @@ var shape34 = {
|
|
|
10616
10704
|
/** Equal axial/radial setbacks at all four 45-degree rims. */
|
|
10617
10705
|
chamfer: length23.refine((value) => value >= 0, "Chamfer cannot be negative").default(0)
|
|
10618
10706
|
};
|
|
10619
|
-
function
|
|
10707
|
+
function validate34(props, context) {
|
|
10620
10708
|
if (props.outerDiameter <= props.innerDiameter)
|
|
10621
10709
|
context.addIssue({
|
|
10622
10710
|
code: "custom",
|
|
@@ -10636,9 +10724,9 @@ function validate33(props, context) {
|
|
|
10636
10724
|
message: "Chamfers must leave positive straight bore length"
|
|
10637
10725
|
});
|
|
10638
10726
|
}
|
|
10639
|
-
var spacerModelPropsSchema = external_exports.object(
|
|
10640
|
-
var spacerModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("spacer"), ...
|
|
10641
|
-
var
|
|
10727
|
+
var spacerModelPropsSchema = external_exports.object(shape35).strict().superRefine(validate34);
|
|
10728
|
+
var spacerModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("spacer"), ...shape35 }).strict().superRefine(validate34);
|
|
10729
|
+
var aliases15 = {
|
|
10642
10730
|
id: "innerDiameter",
|
|
10643
10731
|
innerdiameter: "innerDiameter",
|
|
10644
10732
|
od: "outerDiameter",
|
|
@@ -10662,8 +10750,8 @@ function parseSpacerModelParams(raw) {
|
|
|
10662
10750
|
if (key === "round" && value === "") {
|
|
10663
10751
|
property = "round";
|
|
10664
10752
|
parsed = true;
|
|
10665
|
-
} else if (key && Object.hasOwn(
|
|
10666
|
-
property =
|
|
10753
|
+
} else if (key && Object.hasOwn(aliases15, key) && value) {
|
|
10754
|
+
property = aliases15[key];
|
|
10667
10755
|
parsed = value;
|
|
10668
10756
|
} else throw new Error(`Unknown or malformed spacer token "${token}"`);
|
|
10669
10757
|
if (Object.hasOwn(props, property))
|
|
@@ -10672,13 +10760,13 @@ function parseSpacerModelParams(raw) {
|
|
|
10672
10760
|
}
|
|
10673
10761
|
return spacerModelDefinitionSchema.parse(props);
|
|
10674
10762
|
}
|
|
10675
|
-
var
|
|
10763
|
+
var model41 = defineModel({
|
|
10676
10764
|
name: "spacer",
|
|
10677
10765
|
schema: spacerModelDefinitionSchema,
|
|
10678
10766
|
parse: parseSpacerModelParams
|
|
10679
10767
|
});
|
|
10680
|
-
function
|
|
10681
|
-
registry2.register(
|
|
10768
|
+
function register41(registry2) {
|
|
10769
|
+
registry2.register(model41);
|
|
10682
10770
|
}
|
|
10683
10771
|
var length24 = external_exports.union([
|
|
10684
10772
|
external_exports.number(),
|
|
@@ -10695,7 +10783,7 @@ var nonnegativeLength8 = length24.refine(
|
|
|
10695
10783
|
(value) => value >= 0,
|
|
10696
10784
|
"Length cannot be negative"
|
|
10697
10785
|
);
|
|
10698
|
-
var
|
|
10786
|
+
var shape36 = {
|
|
10699
10787
|
panelHoleDiameter: positiveLength18,
|
|
10700
10788
|
innerDiameter: positiveLength18,
|
|
10701
10789
|
outerDiameter: positiveLength18,
|
|
@@ -10704,7 +10792,7 @@ var shape35 = {
|
|
|
10704
10792
|
grooveDepth: positiveLength18,
|
|
10705
10793
|
splitWidth: positiveLength18
|
|
10706
10794
|
};
|
|
10707
|
-
function
|
|
10795
|
+
function validate35(p, context) {
|
|
10708
10796
|
const issue = (message, path) => context.addIssue({ code: "custom", message, path: [path] });
|
|
10709
10797
|
if (p.innerDiameter >= p.panelHoleDiameter || p.panelHoleDiameter >= p.outerDiameter)
|
|
10710
10798
|
issue(
|
|
@@ -10739,8 +10827,8 @@ function validate34(p, context) {
|
|
|
10739
10827
|
"panelHoleDiameter"
|
|
10740
10828
|
);
|
|
10741
10829
|
}
|
|
10742
|
-
var splitGrommetModelPropsSchema = external_exports.object(
|
|
10743
|
-
var splitGrommetModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("splitgrommet"), ...
|
|
10830
|
+
var splitGrommetModelPropsSchema = external_exports.object(shape36).strict().superRefine(validate35);
|
|
10831
|
+
var splitGrommetModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("splitgrommet"), ...shape36 }).strict().superRefine(validate35);
|
|
10744
10832
|
function getSplitGrommetDimensions(input) {
|
|
10745
10833
|
const p = splitGrommetModelPropsSchema.parse(input);
|
|
10746
10834
|
return {
|
|
@@ -10807,13 +10895,13 @@ function parseSplitGrommetModelParams(raw) {
|
|
|
10807
10895
|
}
|
|
10808
10896
|
return splitGrommetModelDefinitionSchema.parse(props);
|
|
10809
10897
|
}
|
|
10810
|
-
var
|
|
10898
|
+
var model42 = defineModel({
|
|
10811
10899
|
name: "splitgrommet",
|
|
10812
10900
|
schema: splitGrommetModelDefinitionSchema,
|
|
10813
10901
|
parse: parseSplitGrommetModelParams
|
|
10814
10902
|
});
|
|
10815
|
-
function
|
|
10816
|
-
registry2.register(
|
|
10903
|
+
function register42(registry2) {
|
|
10904
|
+
registry2.register(model42);
|
|
10817
10905
|
}
|
|
10818
10906
|
var length25 = external_exports.union([
|
|
10819
10907
|
external_exports.number(),
|
|
@@ -10823,7 +10911,7 @@ var positiveLength19 = length25.refine(
|
|
|
10823
10911
|
(value) => value > 0,
|
|
10824
10912
|
"Length must be positive"
|
|
10825
10913
|
);
|
|
10826
|
-
var
|
|
10914
|
+
var shape37 = {
|
|
10827
10915
|
innerDiameter: positiveLength19,
|
|
10828
10916
|
outerDiameter: positiveLength19,
|
|
10829
10917
|
/** Axial thickness of the rectangular radial/vertical section. */
|
|
@@ -10834,7 +10922,7 @@ var shape36 = {
|
|
|
10834
10922
|
rectangular: external_exports.literal(true).default(true),
|
|
10835
10923
|
leftHanded: external_exports.boolean().default(false)
|
|
10836
10924
|
};
|
|
10837
|
-
function
|
|
10925
|
+
function validate36(p, context) {
|
|
10838
10926
|
if (p.innerDiameter >= p.outerDiameter)
|
|
10839
10927
|
context.addIssue({
|
|
10840
10928
|
code: "custom",
|
|
@@ -10847,8 +10935,8 @@ function validate35(p, context) {
|
|
|
10847
10935
|
message: "The washer envelope and volume must remain finite"
|
|
10848
10936
|
});
|
|
10849
10937
|
}
|
|
10850
|
-
var splitWasherModelPropsSchema = external_exports.object(
|
|
10851
|
-
var splitWasherModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("splitwasher"), ...
|
|
10938
|
+
var splitWasherModelPropsSchema = external_exports.object(shape37).strict().superRefine(validate36);
|
|
10939
|
+
var splitWasherModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("splitwasher"), ...shape37 }).strict().superRefine(validate36);
|
|
10852
10940
|
var lengths18 = {
|
|
10853
10941
|
id: "innerDiameter",
|
|
10854
10942
|
innerdiameter: "innerDiameter",
|
|
@@ -10893,13 +10981,13 @@ function parseSplitWasherModelParams(raw) {
|
|
|
10893
10981
|
}
|
|
10894
10982
|
return splitWasherModelDefinitionSchema.parse(props);
|
|
10895
10983
|
}
|
|
10896
|
-
var
|
|
10984
|
+
var model43 = defineModel({
|
|
10897
10985
|
name: "splitwasher",
|
|
10898
10986
|
schema: splitWasherModelDefinitionSchema,
|
|
10899
10987
|
parse: parseSplitWasherModelParams
|
|
10900
10988
|
});
|
|
10901
|
-
function
|
|
10902
|
-
registry2.register(
|
|
10989
|
+
function register43(registry2) {
|
|
10990
|
+
registry2.register(model43);
|
|
10903
10991
|
}
|
|
10904
10992
|
var length26 = external_exports.union([
|
|
10905
10993
|
external_exports.number(),
|
|
@@ -10933,7 +11021,7 @@ var threadedRodMetricSizeSchema = external_exports.enum([
|
|
|
10933
11021
|
"M16",
|
|
10934
11022
|
"M20"
|
|
10935
11023
|
]);
|
|
10936
|
-
var
|
|
11024
|
+
var shape38 = {
|
|
10937
11025
|
metricSize: threadedRodMetricSizeSchema,
|
|
10938
11026
|
/** Overall end-plane distance, including terminal chamfers. */
|
|
10939
11027
|
length: positiveLength20,
|
|
@@ -10948,7 +11036,7 @@ function resolve8(props) {
|
|
|
10948
11036
|
threadPitch: props.threadPitch ?? threadedRodCoarsePitches[props.metricSize]
|
|
10949
11037
|
};
|
|
10950
11038
|
}
|
|
10951
|
-
function
|
|
11039
|
+
function validate37(props, context) {
|
|
10952
11040
|
const diameter = Number(props.metricSize.slice(1));
|
|
10953
11041
|
const pitch = resolve8(props).threadPitch;
|
|
10954
11042
|
if (diameter - 1.226869 * pitch <= 0)
|
|
@@ -10964,8 +11052,8 @@ function validate36(props, context) {
|
|
|
10964
11052
|
message: "Chamfer must leave flat end faces and separate end chamfers"
|
|
10965
11053
|
});
|
|
10966
11054
|
}
|
|
10967
|
-
var threadedRodModelPropsSchema = external_exports.object(
|
|
10968
|
-
var threadedRodModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("threadedrod"), ...
|
|
11055
|
+
var threadedRodModelPropsSchema = external_exports.object(shape38).strict().superRefine(validate37).transform(resolve8);
|
|
11056
|
+
var threadedRodModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("threadedrod"), ...shape38 }).strict().superRefine(validate37).transform((model522) => ({ fn: model522.fn, ...resolve8(model522) }));
|
|
10969
11057
|
function getThreadedRodDimensions(input) {
|
|
10970
11058
|
const props = threadedRodModelPropsSchema.parse(input);
|
|
10971
11059
|
const diameter = Number(props.metricSize.slice(1));
|
|
@@ -11033,21 +11121,21 @@ function normalizeThreadedRodModelString(value) {
|
|
|
11033
11121
|
return [lower === "lefthanded" ? lower : token];
|
|
11034
11122
|
}).join("_");
|
|
11035
11123
|
}
|
|
11036
|
-
var
|
|
11124
|
+
var model44 = defineModel({
|
|
11037
11125
|
name: "threadedrod",
|
|
11038
11126
|
schema: threadedRodModelDefinitionSchema,
|
|
11039
11127
|
parse: parseThreadedRodModelParams,
|
|
11040
11128
|
normalizeString: normalizeThreadedRodModelString
|
|
11041
11129
|
});
|
|
11042
|
-
function
|
|
11043
|
-
registry2.register(
|
|
11130
|
+
function register44(registry2) {
|
|
11131
|
+
registry2.register(model44);
|
|
11044
11132
|
}
|
|
11045
11133
|
var length27 = external_exports.union([
|
|
11046
11134
|
external_exports.number(),
|
|
11047
11135
|
external_exports.string().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i).transform((value) => value.toLowerCase())
|
|
11048
11136
|
]).pipe(modelLengthSchema);
|
|
11049
11137
|
var positive7 = length27.refine((value) => value > 0, "Length must be positive");
|
|
11050
|
-
var
|
|
11138
|
+
var shape39 = {
|
|
11051
11139
|
outerDiameter: positive7.default(8),
|
|
11052
11140
|
wireDiameter: positive7.default(0.8),
|
|
11053
11141
|
/** Fractional turns set the relative leg direction. */
|
|
@@ -11061,7 +11149,7 @@ var shape38 = {
|
|
|
11061
11149
|
function normalize7(p) {
|
|
11062
11150
|
return { ...p, pitch: p.pitch ?? p.wireDiameter * 1.25 };
|
|
11063
11151
|
}
|
|
11064
|
-
function
|
|
11152
|
+
function validate38(p, context) {
|
|
11065
11153
|
if (p.outerDiameter < 3 * p.wireDiameter)
|
|
11066
11154
|
context.addIssue({
|
|
11067
11155
|
code: "custom",
|
|
@@ -11083,8 +11171,8 @@ function validate37(p, context) {
|
|
|
11083
11171
|
message: "Spring dimensions must remain finite"
|
|
11084
11172
|
});
|
|
11085
11173
|
}
|
|
11086
|
-
var torsionSpringModelPropsSchema = external_exports.object(
|
|
11087
|
-
var torsionSpringModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("torsionspring"), ...
|
|
11174
|
+
var torsionSpringModelPropsSchema = external_exports.object(shape39).strict().superRefine(validate38).transform(normalize7);
|
|
11175
|
+
var torsionSpringModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("torsionspring"), ...shape39 }).strict().superRefine(validate38).transform((p) => ({ ...normalize7(p), fn: p.fn }));
|
|
11088
11176
|
function getTorsionSpringDimensions(input) {
|
|
11089
11177
|
const p = torsionSpringModelPropsSchema.parse(input);
|
|
11090
11178
|
const meanRadius = (p.outerDiameter - p.wireDiameter) / 2;
|
|
@@ -11169,13 +11257,13 @@ function parseTorsionSpringModelParams(raw) {
|
|
|
11169
11257
|
}
|
|
11170
11258
|
return torsionSpringModelDefinitionSchema.parse(props);
|
|
11171
11259
|
}
|
|
11172
|
-
var
|
|
11260
|
+
var model45 = defineModel({
|
|
11173
11261
|
name: "torsionspring",
|
|
11174
11262
|
schema: torsionSpringModelDefinitionSchema,
|
|
11175
11263
|
parse: parseTorsionSpringModelParams
|
|
11176
11264
|
});
|
|
11177
|
-
function
|
|
11178
|
-
registry2.register(
|
|
11265
|
+
function register45(registry2) {
|
|
11266
|
+
registry2.register(model45);
|
|
11179
11267
|
}
|
|
11180
11268
|
var length28 = external_exports.union([
|
|
11181
11269
|
external_exports.number(),
|
|
@@ -11189,7 +11277,7 @@ var nonnegativeLength10 = length28.refine(
|
|
|
11189
11277
|
(value) => value >= 0,
|
|
11190
11278
|
"Length cannot be negative"
|
|
11191
11279
|
);
|
|
11192
|
-
var
|
|
11280
|
+
var shape40 = {
|
|
11193
11281
|
length: positiveLength21,
|
|
11194
11282
|
width: positiveLength21,
|
|
11195
11283
|
thickness: positiveLength21,
|
|
@@ -11199,7 +11287,7 @@ var shape39 = {
|
|
|
11199
11287
|
barbHeight: positiveLength21.default(0.5),
|
|
11200
11288
|
tee: external_exports.literal(true).default(true)
|
|
11201
11289
|
};
|
|
11202
|
-
function
|
|
11290
|
+
function validate39(p, context) {
|
|
11203
11291
|
const span = Math.max(p.width, p.length, p.thickness + p.stemHeight);
|
|
11204
11292
|
if (!Number.isFinite(span ** 3))
|
|
11205
11293
|
context.addIssue({
|
|
@@ -11225,9 +11313,9 @@ function validate38(p, context) {
|
|
|
11225
11313
|
message: "Retention bead height must leave a positive narrow stem section"
|
|
11226
11314
|
});
|
|
11227
11315
|
}
|
|
11228
|
-
var tSlotCoverStripModelPropsSchema = external_exports.object(
|
|
11229
|
-
var tSlotCoverStripModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("tslotcoverstrip"), ...
|
|
11230
|
-
var
|
|
11316
|
+
var tSlotCoverStripModelPropsSchema = external_exports.object(shape40).strict().superRefine(validate39);
|
|
11317
|
+
var tSlotCoverStripModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("tslotcoverstrip"), ...shape40 }).strict().superRefine(validate39);
|
|
11318
|
+
var aliases16 = {
|
|
11231
11319
|
l: "length",
|
|
11232
11320
|
length: "length",
|
|
11233
11321
|
w: "width",
|
|
@@ -11274,27 +11362,27 @@ function parseTSlotCoverStripModelParams(raw) {
|
|
|
11274
11362
|
if (value.toLowerCase() !== `(${literal})`)
|
|
11275
11363
|
throw new Error(`Expected tslotcoverstrip ${key}(${literal})`);
|
|
11276
11364
|
assign(property, true);
|
|
11277
|
-
} else if (Object.hasOwn(
|
|
11278
|
-
const property =
|
|
11365
|
+
} else if (Object.hasOwn(aliases16, key) && value) {
|
|
11366
|
+
const property = aliases16[key];
|
|
11279
11367
|
assign(property, property === "pinCount" ? Number(value) : value);
|
|
11280
11368
|
} else
|
|
11281
11369
|
throw new Error(`Unknown or malformed tslotcoverstrip token "${token}"`);
|
|
11282
11370
|
}
|
|
11283
11371
|
return tSlotCoverStripModelDefinitionSchema.parse(props);
|
|
11284
11372
|
}
|
|
11285
|
-
var
|
|
11373
|
+
var model46 = defineModel({
|
|
11286
11374
|
name: "tslotcoverstrip",
|
|
11287
11375
|
schema: tSlotCoverStripModelDefinitionSchema,
|
|
11288
11376
|
parse: parseTSlotCoverStripModelParams
|
|
11289
11377
|
});
|
|
11290
|
-
function
|
|
11291
|
-
registry2.register(
|
|
11378
|
+
function register46(registry2) {
|
|
11379
|
+
registry2.register(model46);
|
|
11292
11380
|
}
|
|
11293
11381
|
var stringFlags13 = {
|
|
11294
11382
|
fourtsolid: "profile(fourtsolid)"
|
|
11295
11383
|
};
|
|
11296
11384
|
var omittedStringFlags13 = [];
|
|
11297
|
-
var
|
|
11385
|
+
var shape41 = {
|
|
11298
11386
|
width: positiveGearLengthSchema.default(20),
|
|
11299
11387
|
height: positiveGearLengthSchema.default(20),
|
|
11300
11388
|
length: positiveGearLengthSchema.default(100),
|
|
@@ -11307,7 +11395,7 @@ var shape40 = {
|
|
|
11307
11395
|
boreDiameter: nonnegativeGearLengthSchema.default(0),
|
|
11308
11396
|
cornerRadius: nonnegativeGearLengthSchema.default(0)
|
|
11309
11397
|
};
|
|
11310
|
-
function
|
|
11398
|
+
function validate40(props, context) {
|
|
11311
11399
|
const issue = (message, path) => context.addIssue({ code: "custom", message, path: [path] });
|
|
11312
11400
|
const halfSize = Math.min(props.width, props.height) / 2;
|
|
11313
11401
|
const depth = props.lipThickness + props.pocketDepth;
|
|
@@ -11335,8 +11423,8 @@ function validate39(props, context) {
|
|
|
11335
11423
|
"boreDiameter"
|
|
11336
11424
|
);
|
|
11337
11425
|
}
|
|
11338
|
-
var tSlotExtrusionModelPropsSchema = external_exports.object(
|
|
11339
|
-
var tSlotExtrusionModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("tslotextrusion"), ...
|
|
11426
|
+
var tSlotExtrusionModelPropsSchema = external_exports.object(shape41).strict().superRefine(validate40);
|
|
11427
|
+
var tSlotExtrusionModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("tslotextrusion"), ...shape41 }).strict().superRefine(validate40);
|
|
11340
11428
|
var lengths21 = {
|
|
11341
11429
|
w: "width",
|
|
11342
11430
|
width: "width",
|
|
@@ -11381,7 +11469,7 @@ function parseTSlotExtrusionModelParams(raw) {
|
|
|
11381
11469
|
}
|
|
11382
11470
|
return tSlotExtrusionModelDefinitionSchema.parse(props);
|
|
11383
11471
|
}
|
|
11384
|
-
var
|
|
11472
|
+
var model47 = defineModel({
|
|
11385
11473
|
name: "tslotextrusion",
|
|
11386
11474
|
schema: tSlotExtrusionModelDefinitionSchema,
|
|
11387
11475
|
parse: parseTSlotExtrusionModelParams,
|
|
@@ -11392,14 +11480,14 @@ var model46 = defineModel({
|
|
|
11392
11480
|
omittedStringFlags13
|
|
11393
11481
|
)
|
|
11394
11482
|
});
|
|
11395
|
-
function
|
|
11396
|
-
registry2.register(
|
|
11483
|
+
function register47(registry2) {
|
|
11484
|
+
registry2.register(model47);
|
|
11397
11485
|
}
|
|
11398
11486
|
var stringFlags14 = {
|
|
11399
11487
|
righttriangle: "shape(righttriangle)"
|
|
11400
11488
|
};
|
|
11401
11489
|
var omittedStringFlags14 = [];
|
|
11402
|
-
var
|
|
11490
|
+
var shape42 = {
|
|
11403
11491
|
width: positiveGearLengthSchema.default(40),
|
|
11404
11492
|
height: positiveGearLengthSchema.default(40),
|
|
11405
11493
|
thickness: positiveGearLengthSchema.default(4),
|
|
@@ -11412,22 +11500,22 @@ var shape41 = {
|
|
|
11412
11500
|
/** Ligament between each slot and its parallel outer plate edge. */
|
|
11413
11501
|
edgeMargin: positiveGearLengthSchema.default(1)
|
|
11414
11502
|
};
|
|
11415
|
-
function
|
|
11503
|
+
function validate41(props, context) {
|
|
11416
11504
|
const issue = (message, path) => context.addIssue({ code: "custom", message, path: [path] });
|
|
11417
|
-
const [width10,
|
|
11418
|
-
if (
|
|
11505
|
+
const [width10, length30] = props.slot;
|
|
11506
|
+
if (length30 < width10) {
|
|
11419
11507
|
issue("Slot length must be at least its width", "slot");
|
|
11420
11508
|
return;
|
|
11421
11509
|
}
|
|
11422
11510
|
const radius = width10 / 2;
|
|
11423
|
-
const halfStraight = (
|
|
11511
|
+
const halfStraight = (length30 - width10) / 2;
|
|
11424
11512
|
const inset = props.edgeMargin + radius;
|
|
11425
11513
|
const [x, y] = props.centers;
|
|
11426
11514
|
if (!Number.isFinite(inset)) {
|
|
11427
11515
|
issue("Derived slot centers must be finite", "edgeMargin");
|
|
11428
11516
|
return;
|
|
11429
11517
|
}
|
|
11430
|
-
if (x <=
|
|
11518
|
+
if (x <= length30 / 2 || y <= length30 / 2)
|
|
11431
11519
|
issue("Slots must leave material at the right-angle corner", "centers");
|
|
11432
11520
|
const normalRatio = Math.min(props.width, props.height) / Math.max(props.width, props.height);
|
|
11433
11521
|
const capSupport = radius / Math.min(props.width, props.height) * Math.hypot(1, normalRatio);
|
|
@@ -11443,18 +11531,18 @@ function validate40(props, context) {
|
|
|
11443
11531
|
if (Math.hypot(dx, dy) <= width10)
|
|
11444
11532
|
issue("The two slots must retain a positive separating ligament", "centers");
|
|
11445
11533
|
}
|
|
11446
|
-
var tSlotGussetModelPropsSchema = external_exports.object(
|
|
11447
|
-
var tSlotGussetModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("tslotgusset"), ...
|
|
11534
|
+
var tSlotGussetModelPropsSchema = external_exports.object(shape42).strict().superRefine(validate41);
|
|
11535
|
+
var tSlotGussetModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("tslotgusset"), ...shape42 }).strict().superRefine(validate41);
|
|
11448
11536
|
function getTSlotGussetMountingSlots(input = {}) {
|
|
11449
11537
|
const props = tSlotGussetModelPropsSchema.parse(input);
|
|
11450
|
-
const [width10,
|
|
11538
|
+
const [width10, length30] = props.slot;
|
|
11451
11539
|
const inset = props.edgeMargin + width10 / 2;
|
|
11452
11540
|
return [
|
|
11453
11541
|
{
|
|
11454
11542
|
center: { x: props.centers[0], y: inset, z: 0 },
|
|
11455
11543
|
orientation: 0,
|
|
11456
11544
|
width: width10,
|
|
11457
|
-
length:
|
|
11545
|
+
length: length30,
|
|
11458
11546
|
depth: props.thickness,
|
|
11459
11547
|
direction: { x: 0, y: 0, z: 1 }
|
|
11460
11548
|
},
|
|
@@ -11462,7 +11550,7 @@ function getTSlotGussetMountingSlots(input = {}) {
|
|
|
11462
11550
|
center: { x: inset, y: props.centers[1], z: 0 },
|
|
11463
11551
|
orientation: 90,
|
|
11464
11552
|
width: width10,
|
|
11465
|
-
length:
|
|
11553
|
+
length: length30,
|
|
11466
11554
|
depth: props.thickness,
|
|
11467
11555
|
direction: { x: 0, y: 0, z: 1 }
|
|
11468
11556
|
}
|
|
@@ -11509,7 +11597,7 @@ function parseTSlotGussetModelParams(raw) {
|
|
|
11509
11597
|
}
|
|
11510
11598
|
return tSlotGussetModelDefinitionSchema.parse(props);
|
|
11511
11599
|
}
|
|
11512
|
-
var
|
|
11600
|
+
var model48 = defineModel({
|
|
11513
11601
|
name: "tslotgusset",
|
|
11514
11602
|
schema: tSlotGussetModelDefinitionSchema,
|
|
11515
11603
|
parse: parseTSlotGussetModelParams,
|
|
@@ -11520,10 +11608,10 @@ var model47 = defineModel({
|
|
|
11520
11608
|
omittedStringFlags14
|
|
11521
11609
|
)
|
|
11522
11610
|
});
|
|
11523
|
-
function
|
|
11524
|
-
registry2.register(
|
|
11611
|
+
function register48(registry2) {
|
|
11612
|
+
registry2.register(model48);
|
|
11525
11613
|
}
|
|
11526
|
-
var
|
|
11614
|
+
var shape43 = {
|
|
11527
11615
|
width: positiveGearLengthSchema.default(20),
|
|
11528
11616
|
/** Equal leg extents from the virtual intersection of the inside flats. */
|
|
11529
11617
|
legLength: positiveGearLengthSchema.default(40),
|
|
@@ -11535,7 +11623,7 @@ var shape42 = {
|
|
|
11535
11623
|
holeOffset: positiveGearLengthSchema.default(20),
|
|
11536
11624
|
bendRadius: nonnegativeGearLengthSchema.default(0)
|
|
11537
11625
|
};
|
|
11538
|
-
function
|
|
11626
|
+
function validate42(props, context) {
|
|
11539
11627
|
const issue = (message, path) => context.addIssue({ code: "custom", message, path: [path] });
|
|
11540
11628
|
if (!Number.isFinite(props.bendRadius + props.thickness)) {
|
|
11541
11629
|
issue("Outside bend radius must be finite", "bendRadius");
|
|
@@ -11553,8 +11641,8 @@ function validate41(props, context) {
|
|
|
11553
11641
|
if (props.holeOffset + radius >= props.legLength)
|
|
11554
11642
|
issue("Holes must leave material at the free leg ends", "holeOffset");
|
|
11555
11643
|
}
|
|
11556
|
-
var tSlotInsideCornerModelPropsSchema = external_exports.object(
|
|
11557
|
-
var tSlotInsideCornerModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("tslotinsidecorner"), ...
|
|
11644
|
+
var tSlotInsideCornerModelPropsSchema = external_exports.object(shape43).strict().superRefine(validate42);
|
|
11645
|
+
var tSlotInsideCornerModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("tslotinsidecorner"), ...shape43 }).strict().superRefine(validate42);
|
|
11558
11646
|
var lengths23 = {
|
|
11559
11647
|
w: "width",
|
|
11560
11648
|
width: "width",
|
|
@@ -11592,15 +11680,109 @@ function parseTSlotInsideCornerModelParams(raw) {
|
|
|
11592
11680
|
}
|
|
11593
11681
|
return tSlotInsideCornerModelDefinitionSchema.parse(props);
|
|
11594
11682
|
}
|
|
11595
|
-
var
|
|
11683
|
+
var model49 = defineModel({
|
|
11596
11684
|
name: "tslotinsidecorner",
|
|
11597
11685
|
schema: tSlotInsideCornerModelDefinitionSchema,
|
|
11598
11686
|
parse: parseTSlotInsideCornerModelParams
|
|
11599
11687
|
});
|
|
11600
|
-
function
|
|
11601
|
-
registry2.register(
|
|
11688
|
+
function register49(registry2) {
|
|
11689
|
+
registry2.register(model49);
|
|
11602
11690
|
}
|
|
11603
|
-
var
|
|
11691
|
+
var length29 = external_exports.union([
|
|
11692
|
+
external_exports.number().finite(),
|
|
11693
|
+
external_exports.string().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i)
|
|
11694
|
+
]).pipe(modelLengthSchema);
|
|
11695
|
+
var positiveLength22 = length29.refine(
|
|
11696
|
+
(value) => value > 0,
|
|
11697
|
+
"Length must be positive"
|
|
11698
|
+
);
|
|
11699
|
+
var shape44 = {
|
|
11700
|
+
groundPitch: positiveLength22.default(3),
|
|
11701
|
+
groundPadWidth: positiveLength22.default(2.2),
|
|
11702
|
+
groundPadHeight: positiveLength22.default(1.1),
|
|
11703
|
+
signalPadWidth: positiveLength22.default(1.5),
|
|
11704
|
+
signalPadHeight: positiveLength22.default(1.1),
|
|
11705
|
+
signalPadX: length29.refine((value) => value < 0, "Signal pad must lie on the -X side").default(-1.25)
|
|
11706
|
+
};
|
|
11707
|
+
var uflModelPropsSchema = external_exports.object(shape44).strict();
|
|
11708
|
+
var uflModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("ufl"), ...shape44 }).strict();
|
|
11709
|
+
function getUflDimensions(input = {}) {
|
|
11710
|
+
const p = uflModelPropsSchema.parse(input);
|
|
11711
|
+
const minX = Math.min(
|
|
11712
|
+
-p.groundPadWidth / 2,
|
|
11713
|
+
p.signalPadX - p.signalPadWidth / 2
|
|
11714
|
+
);
|
|
11715
|
+
const maxX = Math.max(
|
|
11716
|
+
p.groundPadWidth / 2,
|
|
11717
|
+
p.signalPadX + p.signalPadWidth / 2
|
|
11718
|
+
);
|
|
11719
|
+
const bodyCenterX = -(minX + maxX) / 2;
|
|
11720
|
+
const groundDepth = Math.min(p.groundPadHeight, 0.3);
|
|
11721
|
+
const signalDepth = Math.min(p.signalPadWidth, 0.3);
|
|
11722
|
+
return {
|
|
11723
|
+
...p,
|
|
11724
|
+
bodyCenterX,
|
|
11725
|
+
baseWidth: 2.6,
|
|
11726
|
+
baseLength: 2.6,
|
|
11727
|
+
baseHeight: 0.35,
|
|
11728
|
+
height: 1.25,
|
|
11729
|
+
shellOuterDiameter: 2,
|
|
11730
|
+
// The catalog calls out the envelope; internal contacts are simplified
|
|
11731
|
+
// visual geometry rather than additional mating-tolerance promises.
|
|
11732
|
+
shellInnerDiameter: 1.5,
|
|
11733
|
+
dielectricHeight: 0.85,
|
|
11734
|
+
centerPinDiameter: 0.5,
|
|
11735
|
+
centerPinHeight: 1.15,
|
|
11736
|
+
terminalThickness: 0.1,
|
|
11737
|
+
groundTerminalWidth: Math.min(p.groundPadWidth, 1.8),
|
|
11738
|
+
groundTerminalDepth: groundDepth,
|
|
11739
|
+
groundTerminalX: bodyCenterX,
|
|
11740
|
+
groundTerminalY: (p.groundPitch - groundDepth) / 2,
|
|
11741
|
+
signalTerminalWidth: signalDepth,
|
|
11742
|
+
signalTerminalHeight: Math.min(p.signalPadHeight, 0.6),
|
|
11743
|
+
signalTerminalX: p.signalPadX - signalDepth / 2 + bodyCenterX,
|
|
11744
|
+
rearTabX: 1.4 + bodyCenterX,
|
|
11745
|
+
rearTabWidth: 0.3,
|
|
11746
|
+
rearTabHeight: 0.6,
|
|
11747
|
+
bottomZ: 0,
|
|
11748
|
+
topZ: 1.25
|
|
11749
|
+
};
|
|
11750
|
+
}
|
|
11751
|
+
var aliases17 = {
|
|
11752
|
+
p: "groundPitch",
|
|
11753
|
+
pw: "groundPadWidth",
|
|
11754
|
+
ph: "groundPadHeight",
|
|
11755
|
+
signalw: "signalPadWidth",
|
|
11756
|
+
signalh: "signalPadHeight",
|
|
11757
|
+
signalx: "signalPadX"
|
|
11758
|
+
};
|
|
11759
|
+
function parseUflModelParams(raw) {
|
|
11760
|
+
const [name, ...tokens] = splitModelStringTokens(raw.string);
|
|
11761
|
+
if (raw.fn !== "ufl" || !/^ufl(?:3)?$/i.test(name ?? ""))
|
|
11762
|
+
throw new Error("Expected a three-terminal ufl receptacle");
|
|
11763
|
+
const props = { fn: "ufl" };
|
|
11764
|
+
for (const token of tokens) {
|
|
11765
|
+
const match = token.match(/^([a-z]+)(.*)$/i);
|
|
11766
|
+
const key = match?.[1]?.toLowerCase();
|
|
11767
|
+
const value = match?.[2];
|
|
11768
|
+
if (!key || !Object.hasOwn(aliases17, key) || !value)
|
|
11769
|
+
throw new Error(`Unknown or malformed ufl token "${token}"`);
|
|
11770
|
+
const property = aliases17[key];
|
|
11771
|
+
if (Object.hasOwn(props, property))
|
|
11772
|
+
throw new Error(`Duplicate ufl property "${property}"`);
|
|
11773
|
+
props[property] = value;
|
|
11774
|
+
}
|
|
11775
|
+
return uflModelDefinitionSchema.parse(props);
|
|
11776
|
+
}
|
|
11777
|
+
var model50 = defineModel({
|
|
11778
|
+
name: "ufl",
|
|
11779
|
+
schema: uflModelDefinitionSchema,
|
|
11780
|
+
parse: parseUflModelParams
|
|
11781
|
+
});
|
|
11782
|
+
function register50(registry2) {
|
|
11783
|
+
registry2.register(model50);
|
|
11784
|
+
}
|
|
11785
|
+
var shape45 = {
|
|
11604
11786
|
height: positiveGearLengthSchema,
|
|
11605
11787
|
upperWidth: positiveGearLengthSchema,
|
|
11606
11788
|
lowerWidth: positiveGearLengthSchema,
|
|
@@ -11608,7 +11790,7 @@ var shape43 = {
|
|
|
11608
11790
|
bendRadius: nonnegativeGearLengthSchema,
|
|
11609
11791
|
length: positiveGearLengthSchema
|
|
11610
11792
|
};
|
|
11611
|
-
function
|
|
11793
|
+
function validate43(p, context) {
|
|
11612
11794
|
const issue = (message, path) => context.addIssue({ code: "custom", message, path: [path] });
|
|
11613
11795
|
const largestDimension = Math.max(
|
|
11614
11796
|
...Object.values(p).filter(
|
|
@@ -11632,9 +11814,9 @@ function validate42(p, context) {
|
|
|
11632
11814
|
if (!Number.isFinite(p.upperWidth + p.lowerWidth - p.thickness))
|
|
11633
11815
|
issue("The combined section width must be finite", "upperWidth");
|
|
11634
11816
|
}
|
|
11635
|
-
var zeeBarModelPropsSchema = external_exports.object(
|
|
11636
|
-
var zeeBarModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("zeebar"), ...
|
|
11637
|
-
var
|
|
11817
|
+
var zeeBarModelPropsSchema = external_exports.object(shape45).strict().superRefine(validate43);
|
|
11818
|
+
var zeeBarModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("zeebar"), ...shape45 }).strict().superRefine(validate43);
|
|
11819
|
+
var aliases18 = {
|
|
11638
11820
|
h: "height",
|
|
11639
11821
|
upperw: "upperWidth",
|
|
11640
11822
|
lowerw: "lowerWidth",
|
|
@@ -11655,22 +11837,22 @@ function parseZeeBarModelParams(raw) {
|
|
|
11655
11837
|
const props = { fn: "zeebar" };
|
|
11656
11838
|
for (const token of tokens) {
|
|
11657
11839
|
const [key, value] = parseGearToken(token);
|
|
11658
|
-
if (!Object.hasOwn(
|
|
11840
|
+
if (!Object.hasOwn(aliases18, key) || !value)
|
|
11659
11841
|
throw new Error(`Unknown or malformed zeebar token "${token}"`);
|
|
11660
|
-
const property =
|
|
11842
|
+
const property = aliases18[key];
|
|
11661
11843
|
if (Object.hasOwn(props, property))
|
|
11662
11844
|
throw new Error(`Repeated zeebar property "${property}"`);
|
|
11663
11845
|
props[property] = value;
|
|
11664
11846
|
}
|
|
11665
11847
|
return zeeBarModelDefinitionSchema.parse(props);
|
|
11666
11848
|
}
|
|
11667
|
-
var
|
|
11849
|
+
var model51 = defineModel({
|
|
11668
11850
|
name: "zeebar",
|
|
11669
11851
|
schema: zeeBarModelDefinitionSchema,
|
|
11670
11852
|
parse: parseZeeBarModelParams
|
|
11671
11853
|
});
|
|
11672
|
-
function
|
|
11673
|
-
registry2.register(
|
|
11854
|
+
function register51(registry2) {
|
|
11855
|
+
registry2.register(model51);
|
|
11674
11856
|
}
|
|
11675
11857
|
function getNemaMotorReferencePoints(input) {
|
|
11676
11858
|
const p = nemaMotorModelPropsSchema.parse(input);
|
|
@@ -11787,7 +11969,9 @@ var modelDefinitionSchema = external_exports.union([
|
|
|
11787
11969
|
model46.schema,
|
|
11788
11970
|
model47.schema,
|
|
11789
11971
|
model48.schema,
|
|
11790
|
-
model49.schema
|
|
11972
|
+
model49.schema,
|
|
11973
|
+
model50.schema,
|
|
11974
|
+
model51.schema
|
|
11791
11975
|
]);
|
|
11792
11976
|
function registerAllModels(registry2) {
|
|
11793
11977
|
register(registry2);
|
|
@@ -11839,6 +12023,8 @@ function registerAllModels(registry2) {
|
|
|
11839
12023
|
register47(registry2);
|
|
11840
12024
|
register48(registry2);
|
|
11841
12025
|
register49(registry2);
|
|
12026
|
+
register50(registry2);
|
|
12027
|
+
register51(registry2);
|
|
11842
12028
|
}
|
|
11843
12029
|
var registry = new ModelRegistry();
|
|
11844
12030
|
registerAllModels(registry);
|
|
@@ -12021,24 +12207,24 @@ var FootprintPlatedHole = ({
|
|
|
12021
12207
|
};
|
|
12022
12208
|
|
|
12023
12209
|
// lib/model-registry.ts
|
|
12024
|
-
function defineModelRenderer(
|
|
12025
|
-
return
|
|
12210
|
+
function defineModelRenderer(model102) {
|
|
12211
|
+
return model102;
|
|
12026
12212
|
}
|
|
12027
12213
|
var ModelRendererRegistry = class {
|
|
12028
12214
|
models = /* @__PURE__ */ new Map();
|
|
12029
|
-
register(
|
|
12030
|
-
if (typeof
|
|
12215
|
+
register(model102) {
|
|
12216
|
+
if (typeof model102.name !== "string" || !/^[a-z]+$/.test(model102.name)) {
|
|
12031
12217
|
throw new Error(
|
|
12032
12218
|
"Model renderer names must contain only lowercase letters"
|
|
12033
12219
|
);
|
|
12034
12220
|
}
|
|
12035
|
-
if (this.models.has(
|
|
12036
|
-
throw new Error(`Model renderer "${
|
|
12221
|
+
if (this.models.has(model102.name)) {
|
|
12222
|
+
throw new Error(`Model renderer "${model102.name}" is already registered`);
|
|
12037
12223
|
}
|
|
12038
|
-
if (
|
|
12224
|
+
if (model102.pads !== "none" && model102.pads !== "footprinter") {
|
|
12039
12225
|
throw new Error('Model renderer pads must be "none" or "footprinter"');
|
|
12040
12226
|
}
|
|
12041
|
-
const { name, schema, render: render2, pads } =
|
|
12227
|
+
const { name, schema, render: render2, pads } = model102;
|
|
12042
12228
|
this.models.set(name, {
|
|
12043
12229
|
name,
|
|
12044
12230
|
schema,
|
|
@@ -12069,7 +12255,7 @@ import jscad from "@jscad/modeling";
|
|
|
12069
12255
|
var { primitives, extrusions, geometries, modifiers, measurements } = jscad;
|
|
12070
12256
|
var generalize = modifiers.generalize;
|
|
12071
12257
|
var { rectangle, roundedRectangle, polygon } = primitives;
|
|
12072
|
-
var profile = (
|
|
12258
|
+
var profile = (shape46, height10) => extrusions.extrudeLinear({ height: height10 }, shape46);
|
|
12073
12259
|
function filletProfile(points, radii, width10, height10) {
|
|
12074
12260
|
const outline = [];
|
|
12075
12261
|
for (let i = 0; i < points.length; i++) {
|
|
@@ -12164,14 +12350,14 @@ function AngleBar({ color = "#929da9", ...props }) {
|
|
|
12164
12350
|
}
|
|
12165
12351
|
|
|
12166
12352
|
// lib/models/anglebar/register.tsx
|
|
12167
|
-
var
|
|
12353
|
+
var model52 = defineModelRenderer({
|
|
12168
12354
|
name: "anglebar",
|
|
12169
12355
|
schema: angleBarModelDefinitionSchema,
|
|
12170
12356
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(AngleBar, { ...props }),
|
|
12171
12357
|
pads: "none"
|
|
12172
12358
|
});
|
|
12173
|
-
function
|
|
12174
|
-
registry2.register(
|
|
12359
|
+
function register52(registry2) {
|
|
12360
|
+
registry2.register(model52);
|
|
12175
12361
|
}
|
|
12176
12362
|
|
|
12177
12363
|
// lib/mechanical/indexedMeshToGeom3.ts
|
|
@@ -12302,7 +12488,7 @@ function createBallBearingMesh(input = {}, options = {}) {
|
|
|
12302
12488
|
if (face2 === "open") continue;
|
|
12303
12489
|
const t = d.closureThickness;
|
|
12304
12490
|
const ri = d.innerRaceOuterRadius, ro = d.outerRaceInnerRadius;
|
|
12305
|
-
const
|
|
12491
|
+
const shape46 = face2 === "shielded" ? [
|
|
12306
12492
|
[ro, 0],
|
|
12307
12493
|
[ro, t * 0.45],
|
|
12308
12494
|
[ri, t * 0.45],
|
|
@@ -12315,7 +12501,7 @@ function createBallBearingMesh(input = {}, options = {}) {
|
|
|
12315
12501
|
[ri + 0.15 * (ro - ri), 0.5 * t],
|
|
12316
12502
|
[ro - 0.15 * (ro - ri), 0.5 * t]
|
|
12317
12503
|
];
|
|
12318
|
-
const profile6 = sign === -1 ?
|
|
12504
|
+
const profile6 = sign === -1 ? shape46 : shape46.map(([r, z]) => [r, d.width - z]).reverse();
|
|
12319
12505
|
parts.push({
|
|
12320
12506
|
name: `${face2} ${sign < 0 ? "lower" : "upper"}`,
|
|
12321
12507
|
color: face2 === "sealed" ? "#252a30" : "#b5bbc3",
|
|
@@ -12439,14 +12625,14 @@ function BallBearing({ color, ...props }) {
|
|
|
12439
12625
|
}
|
|
12440
12626
|
|
|
12441
12627
|
// lib/models/ballbearing/register.tsx
|
|
12442
|
-
var
|
|
12628
|
+
var model53 = defineModelRenderer({
|
|
12443
12629
|
name: "ballbearing",
|
|
12444
12630
|
schema: ballBearingModelDefinitionSchema,
|
|
12445
12631
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(BallBearing, { ...props }),
|
|
12446
12632
|
pads: "none"
|
|
12447
12633
|
});
|
|
12448
|
-
function
|
|
12449
|
-
registry2.register(
|
|
12634
|
+
function register53(registry2) {
|
|
12635
|
+
registry2.register(model53);
|
|
12450
12636
|
}
|
|
12451
12637
|
|
|
12452
12638
|
// lib/models/balltransferunit/mesh.ts
|
|
@@ -12695,14 +12881,14 @@ function BallTransferUnit({ color, ...props }) {
|
|
|
12695
12881
|
}
|
|
12696
12882
|
|
|
12697
12883
|
// lib/models/balltransferunit/register.tsx
|
|
12698
|
-
var
|
|
12884
|
+
var model54 = defineModelRenderer({
|
|
12699
12885
|
name: "balltransferunit",
|
|
12700
12886
|
schema: ballTransferUnitModelDefinitionSchema,
|
|
12701
12887
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(BallTransferUnit, { ...props }),
|
|
12702
12888
|
pads: "none"
|
|
12703
12889
|
});
|
|
12704
|
-
function
|
|
12705
|
-
registry2.register(
|
|
12890
|
+
function register54(registry2) {
|
|
12891
|
+
registry2.register(model54);
|
|
12706
12892
|
}
|
|
12707
12893
|
|
|
12708
12894
|
// lib/models/buttonscrew/mesh.ts
|
|
@@ -12822,14 +13008,14 @@ function ButtonScrew({ color = "#737e8f", ...props }) {
|
|
|
12822
13008
|
}
|
|
12823
13009
|
|
|
12824
13010
|
// lib/models/buttonscrew/register.tsx
|
|
12825
|
-
var
|
|
13011
|
+
var model55 = defineModelRenderer({
|
|
12826
13012
|
name: "buttonscrew",
|
|
12827
13013
|
schema: buttonScrewModelDefinitionSchema,
|
|
12828
13014
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(ButtonScrew, { ...props }),
|
|
12829
13015
|
pads: "none"
|
|
12830
13016
|
});
|
|
12831
|
-
function
|
|
12832
|
-
registry2.register(
|
|
13017
|
+
function register55(registry2) {
|
|
13018
|
+
registry2.register(model55);
|
|
12833
13019
|
}
|
|
12834
13020
|
|
|
12835
13021
|
// lib/models/cablegrommet/mesh.ts
|
|
@@ -12897,14 +13083,14 @@ function CableGrommet({
|
|
|
12897
13083
|
}
|
|
12898
13084
|
|
|
12899
13085
|
// lib/models/cablegrommet/register.tsx
|
|
12900
|
-
var
|
|
13086
|
+
var model56 = defineModelRenderer({
|
|
12901
13087
|
name: "cablegrommet",
|
|
12902
13088
|
schema: cableGrommetModelDefinitionSchema,
|
|
12903
13089
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(CableGrommet, { ...props }),
|
|
12904
13090
|
pads: "none"
|
|
12905
13091
|
});
|
|
12906
|
-
function
|
|
12907
|
-
registry2.register(
|
|
13092
|
+
function register56(registry2) {
|
|
13093
|
+
registry2.register(model56);
|
|
12908
13094
|
}
|
|
12909
13095
|
|
|
12910
13096
|
// lib/models/channelbar/geometry.ts
|
|
@@ -12912,7 +13098,7 @@ import jscad3 from "@jscad/modeling";
|
|
|
12912
13098
|
var { primitives: primitives2, extrusions: extrusions2, geometries: geometries2, modifiers: modifiers2, measurements: measurements2 } = jscad3;
|
|
12913
13099
|
var generalize2 = modifiers2.generalize;
|
|
12914
13100
|
var { rectangle: rectangle2, roundedRectangle: roundedRectangle2, polygon: polygon2 } = primitives2;
|
|
12915
|
-
var profile2 = (
|
|
13101
|
+
var profile2 = (shape46, height10) => extrusions2.extrudeLinear({ height: height10 }, shape46);
|
|
12916
13102
|
function filletProfile2(points, radii, width10, height10) {
|
|
12917
13103
|
const outline = [];
|
|
12918
13104
|
for (let i = 0; i < points.length; i++) {
|
|
@@ -13018,14 +13204,14 @@ function ChannelBar({ color = "#929da9", ...props }) {
|
|
|
13018
13204
|
}
|
|
13019
13205
|
|
|
13020
13206
|
// lib/models/channelbar/register.tsx
|
|
13021
|
-
var
|
|
13207
|
+
var model57 = defineModelRenderer({
|
|
13022
13208
|
name: "channelbar",
|
|
13023
13209
|
schema: channelBarModelDefinitionSchema,
|
|
13024
13210
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(ChannelBar, { ...props }),
|
|
13025
13211
|
pads: "none"
|
|
13026
13212
|
});
|
|
13027
|
-
function
|
|
13028
|
-
registry2.register(
|
|
13213
|
+
function register57(registry2) {
|
|
13214
|
+
registry2.register(model57);
|
|
13029
13215
|
}
|
|
13030
13216
|
|
|
13031
13217
|
// lib/models/clampingshaftcollar/mesh.ts
|
|
@@ -13053,9 +13239,9 @@ function createAnnularSleeve({
|
|
|
13053
13239
|
outerRadius,
|
|
13054
13240
|
boreARadius,
|
|
13055
13241
|
boreBRadius = boreARadius,
|
|
13056
|
-
length:
|
|
13242
|
+
length: length30,
|
|
13057
13243
|
chamfer,
|
|
13058
|
-
stepZ =
|
|
13244
|
+
stepZ = length30 / 2
|
|
13059
13245
|
}) {
|
|
13060
13246
|
const halfAngle = Math.PI / bodySegments;
|
|
13061
13247
|
const cosine = Math.cos(halfAngle);
|
|
@@ -13066,10 +13252,10 @@ function createAnnularSleeve({
|
|
|
13066
13252
|
const raw = [
|
|
13067
13253
|
[0, outerRadius - chamfer, false],
|
|
13068
13254
|
[chamfer, outerRadius, false],
|
|
13069
|
-
[
|
|
13070
|
-
[
|
|
13071
|
-
[
|
|
13072
|
-
[
|
|
13255
|
+
[length30 - chamfer, outerRadius, false],
|
|
13256
|
+
[length30, outerRadius - chamfer, false],
|
|
13257
|
+
[length30, boreBRadius + chamfer, true],
|
|
13258
|
+
[length30 - chamfer, boreBRadius, true],
|
|
13073
13259
|
[stepZ, boreBRadius, true],
|
|
13074
13260
|
[stepZ, boreARadius, true],
|
|
13075
13261
|
[chamfer, boreARadius, true],
|
|
@@ -13319,14 +13505,14 @@ function ClampingShaftCollar({
|
|
|
13319
13505
|
}
|
|
13320
13506
|
|
|
13321
13507
|
// lib/models/clampingshaftcollar/register.tsx
|
|
13322
|
-
var
|
|
13508
|
+
var model58 = defineModelRenderer({
|
|
13323
13509
|
name: "clampingshaftcollar",
|
|
13324
13510
|
schema: clampingShaftCollarModelDefinitionSchema,
|
|
13325
13511
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(ClampingShaftCollar, { ...props }),
|
|
13326
13512
|
pads: "none"
|
|
13327
13513
|
});
|
|
13328
|
-
function
|
|
13329
|
-
registry2.register(
|
|
13514
|
+
function register58(registry2) {
|
|
13515
|
+
registry2.register(model58);
|
|
13330
13516
|
}
|
|
13331
13517
|
|
|
13332
13518
|
// lib/mechanical/clip-mesh-to-z-range.ts
|
|
@@ -13522,14 +13708,14 @@ function CompressionSpring({
|
|
|
13522
13708
|
}
|
|
13523
13709
|
|
|
13524
13710
|
// lib/models/compressionspring/register.tsx
|
|
13525
|
-
var
|
|
13711
|
+
var model59 = defineModelRenderer({
|
|
13526
13712
|
name: "compressionspring",
|
|
13527
13713
|
schema: compressionSpringModelDefinitionSchema,
|
|
13528
13714
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(CompressionSpring, { ...props }),
|
|
13529
13715
|
pads: "none"
|
|
13530
13716
|
});
|
|
13531
|
-
function
|
|
13532
|
-
registry2.register(
|
|
13717
|
+
function register59(registry2) {
|
|
13718
|
+
registry2.register(model59);
|
|
13533
13719
|
}
|
|
13534
13720
|
|
|
13535
13721
|
// lib/models/dowelpin/mesh.ts
|
|
@@ -13580,14 +13766,14 @@ function DowelPin({ color = "#929da9", ...props }) {
|
|
|
13580
13766
|
}
|
|
13581
13767
|
|
|
13582
13768
|
// lib/models/dowelpin/register.tsx
|
|
13583
|
-
var
|
|
13769
|
+
var model60 = defineModelRenderer({
|
|
13584
13770
|
name: "dowelpin",
|
|
13585
13771
|
schema: dowelPinModelDefinitionSchema,
|
|
13586
13772
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(DowelPin, { ...props }),
|
|
13587
13773
|
pads: "none"
|
|
13588
13774
|
});
|
|
13589
|
-
function
|
|
13590
|
-
registry2.register(
|
|
13775
|
+
function register60(registry2) {
|
|
13776
|
+
registry2.register(model60);
|
|
13591
13777
|
}
|
|
13592
13778
|
|
|
13593
13779
|
// lib/models/femalestandoff/mesh.ts
|
|
@@ -13689,14 +13875,14 @@ function FemaleStandoff({
|
|
|
13689
13875
|
}
|
|
13690
13876
|
|
|
13691
13877
|
// lib/models/femalestandoff/register.tsx
|
|
13692
|
-
var
|
|
13878
|
+
var model61 = defineModelRenderer({
|
|
13693
13879
|
name: "femalestandoff",
|
|
13694
13880
|
schema: femaleStandoffModelDefinitionSchema,
|
|
13695
13881
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(FemaleStandoff, { ...props }),
|
|
13696
13882
|
pads: "none"
|
|
13697
13883
|
});
|
|
13698
|
-
function
|
|
13699
|
-
registry2.register(
|
|
13884
|
+
function register61(registry2) {
|
|
13885
|
+
registry2.register(model61);
|
|
13700
13886
|
}
|
|
13701
13887
|
|
|
13702
13888
|
// lib/models/flangebolt/mesh.ts
|
|
@@ -13843,14 +14029,14 @@ function FlangeBolt({ color = "#737e8f", ...props }) {
|
|
|
13843
14029
|
}
|
|
13844
14030
|
|
|
13845
14031
|
// lib/models/flangebolt/register.tsx
|
|
13846
|
-
var
|
|
14032
|
+
var model62 = defineModelRenderer({
|
|
13847
14033
|
name: "flangebolt",
|
|
13848
14034
|
schema: flangeboltModelDefinitionSchema,
|
|
13849
14035
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(FlangeBolt, { ...props }),
|
|
13850
14036
|
pads: "none"
|
|
13851
14037
|
});
|
|
13852
|
-
function
|
|
13853
|
-
registry2.register(
|
|
14038
|
+
function register62(registry2) {
|
|
14039
|
+
registry2.register(model62);
|
|
13854
14040
|
}
|
|
13855
14041
|
|
|
13856
14042
|
// lib/models/flangedbushing/mesh.ts
|
|
@@ -13899,14 +14085,14 @@ function FlangedBushing({
|
|
|
13899
14085
|
}
|
|
13900
14086
|
|
|
13901
14087
|
// lib/models/flangedbushing/register.tsx
|
|
13902
|
-
var
|
|
14088
|
+
var model63 = defineModelRenderer({
|
|
13903
14089
|
name: "flangedbushing",
|
|
13904
14090
|
schema: flangedBushingModelDefinitionSchema,
|
|
13905
14091
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(FlangedBushing, { ...props }),
|
|
13906
14092
|
pads: "none"
|
|
13907
14093
|
});
|
|
13908
|
-
function
|
|
13909
|
-
registry2.register(
|
|
14094
|
+
function register63(registry2) {
|
|
14095
|
+
registry2.register(model63);
|
|
13910
14096
|
}
|
|
13911
14097
|
|
|
13912
14098
|
// lib/models/flangenut/mesh.ts
|
|
@@ -14012,14 +14198,14 @@ function FlangeNut({ color = "#737e8f", ...props }) {
|
|
|
14012
14198
|
}
|
|
14013
14199
|
|
|
14014
14200
|
// lib/models/flangenut/register.tsx
|
|
14015
|
-
var
|
|
14201
|
+
var model64 = defineModelRenderer({
|
|
14016
14202
|
name: "flangenut",
|
|
14017
14203
|
schema: flangeNutModelDefinitionSchema,
|
|
14018
14204
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(FlangeNut, { ...props }),
|
|
14019
14205
|
pads: "none"
|
|
14020
14206
|
});
|
|
14021
|
-
function
|
|
14022
|
-
registry2.register(
|
|
14207
|
+
function register64(registry2) {
|
|
14208
|
+
registry2.register(model64);
|
|
14023
14209
|
}
|
|
14024
14210
|
|
|
14025
14211
|
// lib/models/flatheadscrew/mesh.ts
|
|
@@ -14146,14 +14332,14 @@ function FlatHeadScrew({
|
|
|
14146
14332
|
}
|
|
14147
14333
|
|
|
14148
14334
|
// lib/models/flatheadscrew/register.tsx
|
|
14149
|
-
var
|
|
14335
|
+
var model65 = defineModelRenderer({
|
|
14150
14336
|
name: "flatheadscrew",
|
|
14151
14337
|
schema: flatHeadScrewModelDefinitionSchema,
|
|
14152
14338
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(FlatHeadScrew, { ...props }),
|
|
14153
14339
|
pads: "none"
|
|
14154
14340
|
});
|
|
14155
|
-
function
|
|
14156
|
-
registry2.register(
|
|
14341
|
+
function register65(registry2) {
|
|
14342
|
+
registry2.register(model65);
|
|
14157
14343
|
}
|
|
14158
14344
|
|
|
14159
14345
|
// lib/Screen.tsx
|
|
@@ -14828,14 +15014,14 @@ var FlexScreen = (props) => {
|
|
|
14828
15014
|
};
|
|
14829
15015
|
|
|
14830
15016
|
// lib/models/flexscreen/register.tsx
|
|
14831
|
-
var
|
|
15017
|
+
var model66 = defineModelRenderer({
|
|
14832
15018
|
name: "flexscreen",
|
|
14833
15019
|
schema: flexScreenModelDefinitionSchema,
|
|
14834
15020
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(FlexScreen, { ...props }),
|
|
14835
15021
|
pads: "footprinter"
|
|
14836
15022
|
});
|
|
14837
|
-
function
|
|
14838
|
-
registry2.register(
|
|
15023
|
+
function register66(registry2) {
|
|
15024
|
+
registry2.register(model66);
|
|
14839
15025
|
}
|
|
14840
15026
|
|
|
14841
15027
|
// lib/models/heatsetinsert/mesh.ts
|
|
@@ -14920,14 +15106,14 @@ function HeatSetInsert({
|
|
|
14920
15106
|
}
|
|
14921
15107
|
|
|
14922
15108
|
// lib/models/heatsetinsert/register.tsx
|
|
14923
|
-
var
|
|
15109
|
+
var model67 = defineModelRenderer({
|
|
14924
15110
|
name: "heatsetinsert",
|
|
14925
15111
|
schema: heatSetInsertModelDefinitionSchema,
|
|
14926
15112
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(HeatSetInsert, { ...props }),
|
|
14927
15113
|
pads: "none"
|
|
14928
15114
|
});
|
|
14929
|
-
function
|
|
14930
|
-
registry2.register(
|
|
15115
|
+
function register67(registry2) {
|
|
15116
|
+
registry2.register(model67);
|
|
14931
15117
|
}
|
|
14932
15118
|
|
|
14933
15119
|
// lib/mechanical/spur-gear-mesh.ts
|
|
@@ -15120,14 +15306,14 @@ function HelicalGear({ color = "#737e8f", ...props }) {
|
|
|
15120
15306
|
}
|
|
15121
15307
|
|
|
15122
15308
|
// lib/models/helicalgear/register.tsx
|
|
15123
|
-
var
|
|
15309
|
+
var model68 = defineModelRenderer({
|
|
15124
15310
|
name: "helicalgear",
|
|
15125
15311
|
schema: helicalGearModelDefinitionSchema,
|
|
15126
15312
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(HelicalGear, { ...props }),
|
|
15127
15313
|
pads: "none"
|
|
15128
15314
|
});
|
|
15129
|
-
function
|
|
15130
|
-
registry2.register(
|
|
15315
|
+
function register68(registry2) {
|
|
15316
|
+
registry2.register(model68);
|
|
15131
15317
|
}
|
|
15132
15318
|
|
|
15133
15319
|
// lib/models/hexbolt/mesh.ts
|
|
@@ -15262,14 +15448,14 @@ function HexBolt({ color = "#737e8f", ...props }) {
|
|
|
15262
15448
|
}
|
|
15263
15449
|
|
|
15264
15450
|
// lib/models/hexbolt/register.tsx
|
|
15265
|
-
var
|
|
15451
|
+
var model69 = defineModelRenderer({
|
|
15266
15452
|
name: "hexbolt",
|
|
15267
15453
|
schema: hexBoltModelDefinitionSchema,
|
|
15268
15454
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(HexBolt, { ...props }),
|
|
15269
15455
|
pads: "none"
|
|
15270
15456
|
});
|
|
15271
|
-
function
|
|
15272
|
-
registry2.register(
|
|
15457
|
+
function register69(registry2) {
|
|
15458
|
+
registry2.register(model69);
|
|
15273
15459
|
}
|
|
15274
15460
|
|
|
15275
15461
|
// lib/models/hexnut/mesh.ts
|
|
@@ -15388,14 +15574,14 @@ function HexNut({ color = "#737e8f", ...props }) {
|
|
|
15388
15574
|
}
|
|
15389
15575
|
|
|
15390
15576
|
// lib/models/hexnut/register.tsx
|
|
15391
|
-
var
|
|
15577
|
+
var model70 = defineModelRenderer({
|
|
15392
15578
|
name: "hexnut",
|
|
15393
15579
|
schema: hexNutModelDefinitionSchema,
|
|
15394
15580
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(HexNut, { ...props }),
|
|
15395
15581
|
pads: "none"
|
|
15396
15582
|
});
|
|
15397
|
-
function
|
|
15398
|
-
registry2.register(
|
|
15583
|
+
function register70(registry2) {
|
|
15584
|
+
registry2.register(model70);
|
|
15399
15585
|
}
|
|
15400
15586
|
|
|
15401
15587
|
// lib/mechanical/hex-socket-bolt-mesh.ts
|
|
@@ -15409,9 +15595,9 @@ var createHexSocketBoltMesh = (input) => {
|
|
|
15409
15595
|
socketWidth,
|
|
15410
15596
|
socketDepth
|
|
15411
15597
|
} = hexSocketBoltDimensions[props.metricSize];
|
|
15412
|
-
const { length:
|
|
15598
|
+
const { length: length30, showThreads } = props;
|
|
15413
15599
|
const segments = 96;
|
|
15414
|
-
const steps = showThreads ? Math.max(2, Math.ceil(
|
|
15600
|
+
const steps = showThreads ? Math.max(2, Math.ceil(length30 / pitch * 24)) : 2;
|
|
15415
15601
|
if (steps > 24e3)
|
|
15416
15602
|
throw new Error(
|
|
15417
15603
|
"Bolt length exceeds mesh resolution limit (1000 thread turns)"
|
|
@@ -15421,7 +15607,7 @@ var createHexSocketBoltMesh = (input) => {
|
|
|
15421
15607
|
const radius = diameter / 2;
|
|
15422
15608
|
const depth = pitch * 0.61343;
|
|
15423
15609
|
const bevel = Math.min(0.2, headHeight * 0.08);
|
|
15424
|
-
const tipBevel = Math.min(pitch * 0.6,
|
|
15610
|
+
const tipBevel = Math.min(pitch * 0.6, length30 / 3);
|
|
15425
15611
|
const ring = (z, radiusAt) => {
|
|
15426
15612
|
const start = positions.length / 3;
|
|
15427
15613
|
for (let i = 0; i < segments; i++) {
|
|
@@ -15449,8 +15635,8 @@ var createHexSocketBoltMesh = (input) => {
|
|
|
15449
15635
|
let previous = -1;
|
|
15450
15636
|
const shaftLevels = showThreads ? Array.from(
|
|
15451
15637
|
{ length: steps + 1 },
|
|
15452
|
-
(_, step) => -
|
|
15453
|
-
) : [-
|
|
15638
|
+
(_, step) => -length30 + length30 * step / steps
|
|
15639
|
+
) : [-length30, -length30 + tipBevel, 0];
|
|
15454
15640
|
for (const z of shaftLevels) {
|
|
15455
15641
|
const current = ring(z, (angle) => {
|
|
15456
15642
|
const phase = ((z / pitch - angle / (2 * Math.PI)) % 1 + 1) % 1;
|
|
@@ -15461,10 +15647,10 @@ var createHexSocketBoltMesh = (input) => {
|
|
|
15461
15647
|
);
|
|
15462
15648
|
const endRamp = Math.min(
|
|
15463
15649
|
1,
|
|
15464
|
-
(z +
|
|
15465
|
-
-z / Math.min(pitch / 2,
|
|
15650
|
+
(z + length30) / tipBevel,
|
|
15651
|
+
-z / Math.min(pitch / 2, length30 / 3)
|
|
15466
15652
|
);
|
|
15467
|
-
const tipCut = tipBevel * Math.max(0, 1 - (z +
|
|
15653
|
+
const tipCut = tipBevel * Math.max(0, 1 - (z + length30) / tipBevel);
|
|
15468
15654
|
return radius - (showThreads ? groove * endRamp : 0) - tipCut;
|
|
15469
15655
|
});
|
|
15470
15656
|
if (previous < 0) cap2(current, z, false);
|
|
@@ -15500,14 +15686,14 @@ function HexSocketBolt({
|
|
|
15500
15686
|
}
|
|
15501
15687
|
|
|
15502
15688
|
// lib/models/hexsocketbolt/register.tsx
|
|
15503
|
-
var
|
|
15689
|
+
var model71 = defineModelRenderer({
|
|
15504
15690
|
name: "hexsocketbolt",
|
|
15505
15691
|
schema: hexSocketBoltModelDefinitionSchema,
|
|
15506
15692
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(HexSocketBolt, { ...props }),
|
|
15507
15693
|
pads: "none"
|
|
15508
15694
|
});
|
|
15509
|
-
function
|
|
15510
|
-
registry2.register(
|
|
15695
|
+
function register71(registry2) {
|
|
15696
|
+
registry2.register(model71);
|
|
15511
15697
|
}
|
|
15512
15698
|
|
|
15513
15699
|
// lib/models/hollowpositioningarmtube/mesh.ts
|
|
@@ -15620,14 +15806,14 @@ function HollowPositioningArmTube({
|
|
|
15620
15806
|
}
|
|
15621
15807
|
|
|
15622
15808
|
// lib/models/hollowpositioningarmtube/register.tsx
|
|
15623
|
-
var
|
|
15809
|
+
var model72 = defineModelRenderer({
|
|
15624
15810
|
name: "hollowpositioningarmtube",
|
|
15625
15811
|
schema: hollowPositioningArmTubeModelDefinitionSchema,
|
|
15626
15812
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(HollowPositioningArmTube, { ...props }),
|
|
15627
15813
|
pads: "none"
|
|
15628
15814
|
});
|
|
15629
|
-
function
|
|
15630
|
-
registry2.register(
|
|
15815
|
+
function register72(registry2) {
|
|
15816
|
+
registry2.register(model72);
|
|
15631
15817
|
}
|
|
15632
15818
|
|
|
15633
15819
|
// lib/models/malefemalestandoff/mesh.ts
|
|
@@ -15759,14 +15945,14 @@ function MaleFemaleStandoff({
|
|
|
15759
15945
|
}
|
|
15760
15946
|
|
|
15761
15947
|
// lib/models/malefemalestandoff/register.tsx
|
|
15762
|
-
var
|
|
15948
|
+
var model73 = defineModelRenderer({
|
|
15763
15949
|
name: "malefemalestandoff",
|
|
15764
15950
|
schema: maleFemaleStandoffModelDefinitionSchema,
|
|
15765
15951
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(MaleFemaleStandoff, { ...props }),
|
|
15766
15952
|
pads: "none"
|
|
15767
15953
|
});
|
|
15768
|
-
function
|
|
15769
|
-
registry2.register(
|
|
15954
|
+
function register73(registry2) {
|
|
15955
|
+
registry2.register(model73);
|
|
15770
15956
|
}
|
|
15771
15957
|
|
|
15772
15958
|
// lib/utils/nemaMotorAssemblyGeometry.ts
|
|
@@ -16145,14 +16331,14 @@ var NEMA23 = (props) => /* @__PURE__ */ jsx(NemaMotor, { ...props, nemaSize: 23
|
|
|
16145
16331
|
var NEMA34 = (props) => /* @__PURE__ */ jsx(NemaMotor, { ...props, nemaSize: 34 });
|
|
16146
16332
|
|
|
16147
16333
|
// lib/models/nema/register.tsx
|
|
16148
|
-
var
|
|
16334
|
+
var model74 = defineModelRenderer({
|
|
16149
16335
|
name: "nema",
|
|
16150
16336
|
schema: nemaMotorModelDefinitionSchema,
|
|
16151
16337
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(NemaMotor, { ...props }),
|
|
16152
16338
|
pads: "none"
|
|
16153
16339
|
});
|
|
16154
|
-
function
|
|
16155
|
-
registry2.register(
|
|
16340
|
+
function register74(registry2) {
|
|
16341
|
+
registry2.register(model74);
|
|
16156
16342
|
}
|
|
16157
16343
|
|
|
16158
16344
|
// lib/models/nylonlocknut/mesh.ts
|
|
@@ -16288,14 +16474,14 @@ function NylonLockNut({
|
|
|
16288
16474
|
}
|
|
16289
16475
|
|
|
16290
16476
|
// lib/models/nylonlocknut/register.tsx
|
|
16291
|
-
var
|
|
16477
|
+
var model75 = defineModelRenderer({
|
|
16292
16478
|
name: "nylonlocknut",
|
|
16293
16479
|
schema: nylonLockNutModelDefinitionSchema,
|
|
16294
16480
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(NylonLockNut, { ...props }),
|
|
16295
16481
|
pads: "none"
|
|
16296
16482
|
});
|
|
16297
|
-
function
|
|
16298
|
-
registry2.register(
|
|
16483
|
+
function register75(registry2) {
|
|
16484
|
+
registry2.register(model75);
|
|
16299
16485
|
}
|
|
16300
16486
|
|
|
16301
16487
|
// lib/models/panscrew/mesh.ts
|
|
@@ -16501,14 +16687,119 @@ function PanScrew({ color = "#737e8f", ...props }) {
|
|
|
16501
16687
|
}
|
|
16502
16688
|
|
|
16503
16689
|
// lib/models/panscrew/register.tsx
|
|
16504
|
-
var
|
|
16690
|
+
var model76 = defineModelRenderer({
|
|
16505
16691
|
name: "panscrew",
|
|
16506
16692
|
schema: panScrewModelDefinitionSchema,
|
|
16507
16693
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(PanScrew, { ...props }),
|
|
16508
16694
|
pads: "none"
|
|
16509
16695
|
});
|
|
16510
|
-
function
|
|
16511
|
-
registry2.register(
|
|
16696
|
+
function register76(registry2) {
|
|
16697
|
+
registry2.register(model76);
|
|
16698
|
+
}
|
|
16699
|
+
|
|
16700
|
+
// lib/models/perforatedangle/mesh.ts
|
|
16701
|
+
function quarterBend(radius, thickness) {
|
|
16702
|
+
const outer = radius + thickness;
|
|
16703
|
+
const center = outer;
|
|
16704
|
+
const points = [];
|
|
16705
|
+
for (let step = 0; step <= 48; step++) {
|
|
16706
|
+
const angle = Math.PI + step * Math.PI / 96;
|
|
16707
|
+
points.push(
|
|
16708
|
+
step === 0 ? [0, center] : step === 48 ? [center, 0] : [
|
|
16709
|
+
center + outer * Math.cos(angle),
|
|
16710
|
+
center + outer * Math.sin(angle)
|
|
16711
|
+
]
|
|
16712
|
+
);
|
|
16713
|
+
}
|
|
16714
|
+
if (radius === 0) points.push([center, center]);
|
|
16715
|
+
else
|
|
16716
|
+
for (let step = 0; step <= 48; step++) {
|
|
16717
|
+
const angle = 3 * Math.PI / 2 - step * Math.PI / 96;
|
|
16718
|
+
points.push(
|
|
16719
|
+
step === 0 ? [center, thickness] : step === 48 ? [thickness, center] : [
|
|
16720
|
+
center + radius * Math.cos(angle),
|
|
16721
|
+
center + radius * Math.sin(angle)
|
|
16722
|
+
]
|
|
16723
|
+
);
|
|
16724
|
+
}
|
|
16725
|
+
return points;
|
|
16726
|
+
}
|
|
16727
|
+
function createPerforatedAngleMesh(input) {
|
|
16728
|
+
const p = perforatedAngleModelPropsSchema.parse(input);
|
|
16729
|
+
const {
|
|
16730
|
+
width: w,
|
|
16731
|
+
height: h2,
|
|
16732
|
+
thickness: t,
|
|
16733
|
+
length: l,
|
|
16734
|
+
innerRadius: r,
|
|
16735
|
+
holeCount,
|
|
16736
|
+
holeDiameter,
|
|
16737
|
+
pitch,
|
|
16738
|
+
endOffset,
|
|
16739
|
+
legOffset
|
|
16740
|
+
} = p;
|
|
16741
|
+
const tangent = r + t;
|
|
16742
|
+
const panel = (end) => [
|
|
16743
|
+
[tangent, 0],
|
|
16744
|
+
[end, 0],
|
|
16745
|
+
[end, l],
|
|
16746
|
+
[tangent, l]
|
|
16747
|
+
];
|
|
16748
|
+
const holes = Array.from(
|
|
16749
|
+
{ length: holeCount },
|
|
16750
|
+
(_, i) => circularProfile(legOffset, endOffset + i * pitch, holeDiameter / 2)
|
|
16751
|
+
);
|
|
16752
|
+
const mesh = joinProfileMeshes([
|
|
16753
|
+
extrudePlanarProfile({
|
|
16754
|
+
outer: panel(w),
|
|
16755
|
+
holes,
|
|
16756
|
+
start: 0,
|
|
16757
|
+
end: t,
|
|
16758
|
+
project: (u, v, d) => [u, d, v],
|
|
16759
|
+
reverse: true,
|
|
16760
|
+
skipWall: (a, b) => a[0] === tangent && b[0] === tangent
|
|
16761
|
+
}),
|
|
16762
|
+
extrudePlanarProfile({
|
|
16763
|
+
outer: panel(h2),
|
|
16764
|
+
holes,
|
|
16765
|
+
start: 0,
|
|
16766
|
+
end: t,
|
|
16767
|
+
project: (u, v, d) => [d, u, v],
|
|
16768
|
+
skipWall: (a, b) => a[0] === tangent && b[0] === tangent
|
|
16769
|
+
}),
|
|
16770
|
+
extrudePlanarProfile({
|
|
16771
|
+
outer: quarterBend(r, t),
|
|
16772
|
+
start: 0,
|
|
16773
|
+
end: l,
|
|
16774
|
+
skipWall: (a, b) => a[0] === tangent && b[0] === tangent || a[1] === tangent && b[1] === tangent
|
|
16775
|
+
})
|
|
16776
|
+
]);
|
|
16777
|
+
mesh.positions = mesh.positions.map(
|
|
16778
|
+
(value, index) => value - (index % 3 === 0 ? w / 2 : index % 3 === 1 ? h2 / 2 : 0)
|
|
16779
|
+
);
|
|
16780
|
+
return mesh;
|
|
16781
|
+
}
|
|
16782
|
+
|
|
16783
|
+
// lib/models/perforatedangle/PerforatedAngle.tsx
|
|
16784
|
+
function createPerforatedAngleGeom(input) {
|
|
16785
|
+
return indexedMeshToGeom3(createPerforatedAngleMesh(input));
|
|
16786
|
+
}
|
|
16787
|
+
function PerforatedAngle({
|
|
16788
|
+
color = "#8995a3",
|
|
16789
|
+
...props
|
|
16790
|
+
}) {
|
|
16791
|
+
return /* @__PURE__ */ jsx(Colorize, { color, children: /* @__PURE__ */ jsx(Custom, { geometry: createPerforatedAngleGeom(props) }) });
|
|
16792
|
+
}
|
|
16793
|
+
|
|
16794
|
+
// lib/models/perforatedangle/register.tsx
|
|
16795
|
+
var model77 = defineModelRenderer({
|
|
16796
|
+
name: "perforatedangle",
|
|
16797
|
+
schema: perforatedAngleModelDefinitionSchema,
|
|
16798
|
+
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(PerforatedAngle, { ...props }),
|
|
16799
|
+
pads: "none"
|
|
16800
|
+
});
|
|
16801
|
+
function register77(registry2) {
|
|
16802
|
+
registry2.register(model77);
|
|
16512
16803
|
}
|
|
16513
16804
|
|
|
16514
16805
|
// lib/models/perforatedsheet/geometry.ts
|
|
@@ -16524,7 +16815,7 @@ var {
|
|
|
16524
16815
|
var generalize4 = modifiers3.generalize;
|
|
16525
16816
|
var { subtract } = booleans;
|
|
16526
16817
|
var { rectangle: rectangle3, roundedRectangle: roundedRectangle3, circle: circle2 } = primitives3;
|
|
16527
|
-
var profile3 = (
|
|
16818
|
+
var profile3 = (shape46, height10) => extrusions3.extrudeLinear({ height: height10 }, shape46);
|
|
16528
16819
|
function perforated(p) {
|
|
16529
16820
|
const holes = [];
|
|
16530
16821
|
const rows = Math.floor((p.width - 2 * p.edgeY) / p.pitchY + 1 + 1e-10);
|
|
@@ -16594,14 +16885,14 @@ function PerforatedSheet({
|
|
|
16594
16885
|
}
|
|
16595
16886
|
|
|
16596
16887
|
// lib/models/perforatedsheet/register.tsx
|
|
16597
|
-
var
|
|
16888
|
+
var model78 = defineModelRenderer({
|
|
16598
16889
|
name: "perforatedsheet",
|
|
16599
16890
|
schema: perforatedSheetModelDefinitionSchema,
|
|
16600
16891
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(PerforatedSheet, { ...props }),
|
|
16601
16892
|
pads: "none"
|
|
16602
16893
|
});
|
|
16603
|
-
function
|
|
16604
|
-
registry2.register(
|
|
16894
|
+
function register78(registry2) {
|
|
16895
|
+
registry2.register(model78);
|
|
16605
16896
|
}
|
|
16606
16897
|
|
|
16607
16898
|
// lib/models/plainbushing/mesh.ts
|
|
@@ -16657,14 +16948,14 @@ function PlainBushing({
|
|
|
16657
16948
|
}
|
|
16658
16949
|
|
|
16659
16950
|
// lib/models/plainbushing/register.tsx
|
|
16660
|
-
var
|
|
16951
|
+
var model79 = defineModelRenderer({
|
|
16661
16952
|
name: "plainbushing",
|
|
16662
16953
|
schema: plainBushingModelDefinitionSchema,
|
|
16663
16954
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(PlainBushing, { ...props }),
|
|
16664
16955
|
pads: "none"
|
|
16665
16956
|
});
|
|
16666
|
-
function
|
|
16667
|
-
registry2.register(
|
|
16957
|
+
function register79(registry2) {
|
|
16958
|
+
registry2.register(model79);
|
|
16668
16959
|
}
|
|
16669
16960
|
|
|
16670
16961
|
// lib/models/pushfitplug/geometry.ts
|
|
@@ -16729,14 +17020,14 @@ function PushFitPlug({ color = "#929da9", ...props }) {
|
|
|
16729
17020
|
}
|
|
16730
17021
|
|
|
16731
17022
|
// lib/models/pushfitplug/register.tsx
|
|
16732
|
-
var
|
|
17023
|
+
var model80 = defineModelRenderer({
|
|
16733
17024
|
name: "pushfitplug",
|
|
16734
17025
|
schema: pushFitPlugModelDefinitionSchema,
|
|
16735
17026
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(PushFitPlug, { ...props }),
|
|
16736
17027
|
pads: "none"
|
|
16737
17028
|
});
|
|
16738
|
-
function
|
|
16739
|
-
registry2.register(
|
|
17029
|
+
function register80(registry2) {
|
|
17030
|
+
registry2.register(model80);
|
|
16740
17031
|
}
|
|
16741
17032
|
|
|
16742
17033
|
// lib/models/rectangularbar/geometry.ts
|
|
@@ -16744,7 +17035,7 @@ import jscad11 from "@jscad/modeling";
|
|
|
16744
17035
|
var { primitives: primitives5, extrusions: extrusions5, geometries: geometries5, modifiers: modifiers5, measurements: measurements5 } = jscad11;
|
|
16745
17036
|
var generalize6 = modifiers5.generalize;
|
|
16746
17037
|
var { rectangle: rectangle5, roundedRectangle: roundedRectangle5 } = primitives5;
|
|
16747
|
-
var profile4 = (
|
|
17038
|
+
var profile4 = (shape46, height10) => extrusions5.extrudeLinear({ height: height10 }, shape46);
|
|
16748
17039
|
var roundedRect = (width10, height10, radius) => radius ? roundedRectangle5({
|
|
16749
17040
|
size: [width10, height10],
|
|
16750
17041
|
roundRadius: radius,
|
|
@@ -16798,14 +17089,14 @@ function RectangularBar({
|
|
|
16798
17089
|
}
|
|
16799
17090
|
|
|
16800
17091
|
// lib/models/rectangularbar/register.tsx
|
|
16801
|
-
var
|
|
17092
|
+
var model81 = defineModelRenderer({
|
|
16802
17093
|
name: "rectangularbar",
|
|
16803
17094
|
schema: rectangularBarModelDefinitionSchema,
|
|
16804
17095
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(RectangularBar, { ...props }),
|
|
16805
17096
|
pads: "none"
|
|
16806
17097
|
});
|
|
16807
|
-
function
|
|
16808
|
-
registry2.register(
|
|
17098
|
+
function register81(registry2) {
|
|
17099
|
+
registry2.register(model81);
|
|
16809
17100
|
}
|
|
16810
17101
|
|
|
16811
17102
|
// lib/models/rectangulargasket/geometry.ts
|
|
@@ -16819,7 +17110,7 @@ function retainCapSeams(mesh, tolerance) {
|
|
|
16819
17110
|
const origin = positions.slice(a * 3, a * 3 + 3);
|
|
16820
17111
|
const delta = positions.slice(b * 3, b * 3 + 3).map((x, axis) => x - origin[axis]);
|
|
16821
17112
|
const lengthSquared = delta.reduce((sum, x) => sum + x * x, 0);
|
|
16822
|
-
const
|
|
17113
|
+
const length30 = Math.sqrt(lengthSquared);
|
|
16823
17114
|
const intermediate = [];
|
|
16824
17115
|
for (let id = 0; id < count; id++) {
|
|
16825
17116
|
if (id === a || id === b) continue;
|
|
@@ -16828,7 +17119,7 @@ function retainCapSeams(mesh, tolerance) {
|
|
|
16828
17119
|
(sum, x, axis) => sum + (x - origin[axis]) * delta[axis],
|
|
16829
17120
|
0
|
|
16830
17121
|
) / lengthSquared;
|
|
16831
|
-
if (t *
|
|
17122
|
+
if (t * length30 <= tolerance || (1 - t) * length30 <= tolerance) continue;
|
|
16832
17123
|
if (Math.hypot(
|
|
16833
17124
|
...point.map((x, axis) => x - origin[axis] - t * delta[axis])
|
|
16834
17125
|
) <= tolerance)
|
|
@@ -16907,14 +17198,14 @@ function RectangularGasket({
|
|
|
16907
17198
|
}
|
|
16908
17199
|
|
|
16909
17200
|
// lib/models/rectangulargasket/register.tsx
|
|
16910
|
-
var
|
|
17201
|
+
var model82 = defineModelRenderer({
|
|
16911
17202
|
name: "rectangulargasket",
|
|
16912
17203
|
schema: rectangularGasketModelDefinitionSchema,
|
|
16913
17204
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(RectangularGasket, { ...props }),
|
|
16914
17205
|
pads: "none"
|
|
16915
17206
|
});
|
|
16916
|
-
function
|
|
16917
|
-
registry2.register(
|
|
17207
|
+
function register82(registry2) {
|
|
17208
|
+
registry2.register(model82);
|
|
16918
17209
|
}
|
|
16919
17210
|
|
|
16920
17211
|
// lib/models/rectangulartube/geometry.ts
|
|
@@ -16930,7 +17221,7 @@ var {
|
|
|
16930
17221
|
var generalize7 = modifiers6.generalize;
|
|
16931
17222
|
var { subtract: subtract2 } = booleans2;
|
|
16932
17223
|
var { rectangle: rectangle6, roundedRectangle: roundedRectangle6 } = primitives6;
|
|
16933
|
-
var profile5 = (
|
|
17224
|
+
var profile5 = (shape46, height10) => extrusions6.extrudeLinear({ height: height10 }, shape46);
|
|
16934
17225
|
var roundedRect2 = (width10, height10, radius) => radius ? roundedRectangle6({
|
|
16935
17226
|
size: [width10, height10],
|
|
16936
17227
|
roundRadius: radius,
|
|
@@ -16994,14 +17285,14 @@ function RectangularTube({
|
|
|
16994
17285
|
}
|
|
16995
17286
|
|
|
16996
17287
|
// lib/models/rectangulartube/register.tsx
|
|
16997
|
-
var
|
|
17288
|
+
var model83 = defineModelRenderer({
|
|
16998
17289
|
name: "rectangulartube",
|
|
16999
17290
|
schema: rectangularTubeModelDefinitionSchema,
|
|
17000
17291
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(RectangularTube, { ...props }),
|
|
17001
17292
|
pads: "none"
|
|
17002
17293
|
});
|
|
17003
|
-
function
|
|
17004
|
-
registry2.register(
|
|
17294
|
+
function register83(registry2) {
|
|
17295
|
+
registry2.register(model83);
|
|
17005
17296
|
}
|
|
17006
17297
|
|
|
17007
17298
|
// lib/models/rigidcoupler/mesh.ts
|
|
@@ -17038,14 +17329,14 @@ function RigidCoupler({
|
|
|
17038
17329
|
}
|
|
17039
17330
|
|
|
17040
17331
|
// lib/models/rigidcoupler/register.tsx
|
|
17041
|
-
var
|
|
17332
|
+
var model84 = defineModelRenderer({
|
|
17042
17333
|
name: "rigidcoupler",
|
|
17043
17334
|
schema: rigidCouplerModelDefinitionSchema,
|
|
17044
17335
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(RigidCoupler, { ...props }),
|
|
17045
17336
|
pads: "none"
|
|
17046
17337
|
});
|
|
17047
|
-
function
|
|
17048
|
-
registry2.register(
|
|
17338
|
+
function register84(registry2) {
|
|
17339
|
+
registry2.register(model84);
|
|
17049
17340
|
}
|
|
17050
17341
|
|
|
17051
17342
|
// lib/models/setscrew/mesh.ts
|
|
@@ -17160,14 +17451,14 @@ function SetScrew({ color = "#737e8f", ...props }) {
|
|
|
17160
17451
|
}
|
|
17161
17452
|
|
|
17162
17453
|
// lib/models/setscrew/register.tsx
|
|
17163
|
-
var
|
|
17454
|
+
var model85 = defineModelRenderer({
|
|
17164
17455
|
name: "setscrew",
|
|
17165
17456
|
schema: setscrewModelDefinitionSchema,
|
|
17166
17457
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(SetScrew, { ...props }),
|
|
17167
17458
|
pads: "none"
|
|
17168
17459
|
});
|
|
17169
|
-
function
|
|
17170
|
-
registry2.register(
|
|
17460
|
+
function register85(registry2) {
|
|
17461
|
+
registry2.register(model85);
|
|
17171
17462
|
}
|
|
17172
17463
|
|
|
17173
17464
|
// lib/models/shaftcollar/mesh.ts
|
|
@@ -17199,14 +17490,14 @@ function ShaftCollar({ color = "#737e8f", ...props }) {
|
|
|
17199
17490
|
}
|
|
17200
17491
|
|
|
17201
17492
|
// lib/models/shaftcollar/register.tsx
|
|
17202
|
-
var
|
|
17493
|
+
var model86 = defineModelRenderer({
|
|
17203
17494
|
name: "shaftcollar",
|
|
17204
17495
|
schema: shaftCollarModelDefinitionSchema,
|
|
17205
17496
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(ShaftCollar, { ...props }),
|
|
17206
17497
|
pads: "none"
|
|
17207
17498
|
});
|
|
17208
|
-
function
|
|
17209
|
-
registry2.register(
|
|
17499
|
+
function register86(registry2) {
|
|
17500
|
+
registry2.register(model86);
|
|
17210
17501
|
}
|
|
17211
17502
|
|
|
17212
17503
|
// lib/mechanical/sheet-metal-mesh.ts
|
|
@@ -17251,7 +17542,7 @@ function createSheetMetalMesh(input) {
|
|
|
17251
17542
|
throw new Error(`No ${hole.panel} panel on ${profile6}`);
|
|
17252
17543
|
}
|
|
17253
17544
|
for (const panel of panels) {
|
|
17254
|
-
const
|
|
17545
|
+
const length30 = panel === "base" ? baseLength : flangeHeight;
|
|
17255
17546
|
const holes = props.holes.filter((hole) => hole.panel === panel).map(holeOutline);
|
|
17256
17547
|
const bounds = holes.map((outline2) => ({
|
|
17257
17548
|
minU: Math.min(...outline2.map((p) => p.u)),
|
|
@@ -17260,17 +17551,17 @@ function createSheetMetalMesh(input) {
|
|
|
17260
17551
|
maxV: Math.max(...outline2.map((p) => p.v))
|
|
17261
17552
|
}));
|
|
17262
17553
|
for (const [i, box] of bounds.entries()) {
|
|
17263
|
-
if (box.minU <= -
|
|
17554
|
+
if (box.minU <= -length30 / 2 || box.maxU >= length30 / 2 || box.minV <= -width10 / 2 || box.maxV >= width10 / 2)
|
|
17264
17555
|
throw new Error(`Hole crosses ${panel} panel edge or bend tangent`);
|
|
17265
17556
|
for (const previous of bounds.slice(0, i))
|
|
17266
17557
|
if (box.minU <= previous.maxU && box.maxU >= previous.minU && box.minV <= previous.maxV && box.maxV >= previous.minV)
|
|
17267
17558
|
throw new Error("Hole bounding boxes must not overlap");
|
|
17268
17559
|
}
|
|
17269
17560
|
const outline = [
|
|
17270
|
-
{ u: -
|
|
17271
|
-
{ u:
|
|
17272
|
-
{ u:
|
|
17273
|
-
{ u: -
|
|
17561
|
+
{ u: -length30 / 2, v: -width10 / 2 },
|
|
17562
|
+
{ u: length30 / 2, v: -width10 / 2 },
|
|
17563
|
+
{ u: length30 / 2, v: width10 / 2 },
|
|
17564
|
+
{ u: -length30 / 2, v: width10 / 2 }
|
|
17274
17565
|
];
|
|
17275
17566
|
const loops = [outline, ...holes.map((hole) => [...hole].reverse())];
|
|
17276
17567
|
const points = loops.flat();
|
|
@@ -17360,18 +17651,18 @@ function SheetMetal({ color = "#737e8f", ...props }) {
|
|
|
17360
17651
|
}
|
|
17361
17652
|
|
|
17362
17653
|
// lib/models/sheetmetal/register.tsx
|
|
17363
|
-
var
|
|
17654
|
+
var model87 = defineModelRenderer({
|
|
17364
17655
|
name: "sheetmetal",
|
|
17365
17656
|
schema: sheetMetalModelDefinitionSchema,
|
|
17366
17657
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(SheetMetal, { ...props }),
|
|
17367
17658
|
pads: "none"
|
|
17368
17659
|
});
|
|
17369
|
-
function
|
|
17370
|
-
registry2.register(
|
|
17660
|
+
function register87(registry2) {
|
|
17661
|
+
registry2.register(model87);
|
|
17371
17662
|
}
|
|
17372
17663
|
|
|
17373
17664
|
// lib/models/slottedchannel/mesh.ts
|
|
17374
|
-
function
|
|
17665
|
+
function quarterBend2(radius, thickness) {
|
|
17375
17666
|
const outer = radius + thickness;
|
|
17376
17667
|
const center = outer;
|
|
17377
17668
|
const points = [];
|
|
@@ -17397,9 +17688,9 @@ function quarterBend(radius, thickness) {
|
|
|
17397
17688
|
}
|
|
17398
17689
|
return points;
|
|
17399
17690
|
}
|
|
17400
|
-
function obround(center, width10,
|
|
17401
|
-
if (
|
|
17402
|
-
const r = width10 / 2, straight = (
|
|
17691
|
+
function obround(center, width10, length30) {
|
|
17692
|
+
if (length30 === width10) return circularProfile(0, center, width10 / 2);
|
|
17693
|
+
const r = width10 / 2, straight = (length30 - width10) / 2;
|
|
17403
17694
|
const points = [];
|
|
17404
17695
|
for (let step = 0; step <= 48; step++) {
|
|
17405
17696
|
const angle = step * Math.PI / 48;
|
|
@@ -17436,7 +17727,7 @@ function createSlottedChannelMesh(input) {
|
|
|
17436
17727
|
[h2, l],
|
|
17437
17728
|
[tangent, l]
|
|
17438
17729
|
];
|
|
17439
|
-
const bend =
|
|
17730
|
+
const bend = quarterBend2(r, t);
|
|
17440
17731
|
const mesh = joinProfileMeshes([
|
|
17441
17732
|
extrudePlanarProfile({
|
|
17442
17733
|
outer: [
|
|
@@ -17499,14 +17790,14 @@ function SlottedChannel({
|
|
|
17499
17790
|
}
|
|
17500
17791
|
|
|
17501
17792
|
// lib/models/slottedchannel/register.tsx
|
|
17502
|
-
var
|
|
17793
|
+
var model88 = defineModelRenderer({
|
|
17503
17794
|
name: "slottedchannel",
|
|
17504
17795
|
schema: slottedChannelModelDefinitionSchema,
|
|
17505
17796
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(SlottedChannel, { ...props }),
|
|
17506
17797
|
pads: "none"
|
|
17507
17798
|
});
|
|
17508
|
-
function
|
|
17509
|
-
registry2.register(
|
|
17799
|
+
function register88(registry2) {
|
|
17800
|
+
registry2.register(model88);
|
|
17510
17801
|
}
|
|
17511
17802
|
|
|
17512
17803
|
// lib/models/spacer/mesh.ts
|
|
@@ -17529,14 +17820,14 @@ function Spacer({ color = "#a18450", ...props }) {
|
|
|
17529
17820
|
}
|
|
17530
17821
|
|
|
17531
17822
|
// lib/models/spacer/register.tsx
|
|
17532
|
-
var
|
|
17823
|
+
var model89 = defineModelRenderer({
|
|
17533
17824
|
name: "spacer",
|
|
17534
17825
|
schema: spacerModelDefinitionSchema,
|
|
17535
17826
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(Spacer, { ...props }),
|
|
17536
17827
|
pads: "none"
|
|
17537
17828
|
});
|
|
17538
|
-
function
|
|
17539
|
-
registry2.register(
|
|
17829
|
+
function register89(registry2) {
|
|
17830
|
+
registry2.register(model89);
|
|
17540
17831
|
}
|
|
17541
17832
|
|
|
17542
17833
|
// lib/models/splitgrommet/geometry.ts
|
|
@@ -17618,14 +17909,14 @@ function SplitGrommet({
|
|
|
17618
17909
|
}
|
|
17619
17910
|
|
|
17620
17911
|
// lib/models/splitgrommet/register.tsx
|
|
17621
|
-
var
|
|
17912
|
+
var model90 = defineModelRenderer({
|
|
17622
17913
|
name: "splitgrommet",
|
|
17623
17914
|
schema: splitGrommetModelDefinitionSchema,
|
|
17624
17915
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(SplitGrommet, { ...props }),
|
|
17625
17916
|
pads: "none"
|
|
17626
17917
|
});
|
|
17627
|
-
function
|
|
17628
|
-
registry2.register(
|
|
17918
|
+
function register90(registry2) {
|
|
17919
|
+
registry2.register(model90);
|
|
17629
17920
|
}
|
|
17630
17921
|
|
|
17631
17922
|
// lib/models/splitwasher/mesh.ts
|
|
@@ -17688,14 +17979,14 @@ function SplitWasher({ color = "#929ba6", ...props }) {
|
|
|
17688
17979
|
}
|
|
17689
17980
|
|
|
17690
17981
|
// lib/models/splitwasher/register.tsx
|
|
17691
|
-
var
|
|
17982
|
+
var model91 = defineModelRenderer({
|
|
17692
17983
|
name: "splitwasher",
|
|
17693
17984
|
schema: splitWasherModelDefinitionSchema,
|
|
17694
17985
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(SplitWasher, { ...props }),
|
|
17695
17986
|
pads: "none"
|
|
17696
17987
|
});
|
|
17697
|
-
function
|
|
17698
|
-
registry2.register(
|
|
17988
|
+
function register91(registry2) {
|
|
17989
|
+
registry2.register(model91);
|
|
17699
17990
|
}
|
|
17700
17991
|
|
|
17701
17992
|
// lib/SpurGear.tsx
|
|
@@ -17707,14 +17998,14 @@ function SpurGear({ color = "#737e8f", ...props }) {
|
|
|
17707
17998
|
}
|
|
17708
17999
|
|
|
17709
18000
|
// lib/models/spurgear/register.tsx
|
|
17710
|
-
var
|
|
18001
|
+
var model92 = defineModelRenderer({
|
|
17711
18002
|
name: "spurgear",
|
|
17712
18003
|
schema: spurGearModelDefinitionSchema,
|
|
17713
18004
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(SpurGear, { ...props }),
|
|
17714
18005
|
pads: "none"
|
|
17715
18006
|
});
|
|
17716
|
-
function
|
|
17717
|
-
registry2.register(
|
|
18007
|
+
function register92(registry2) {
|
|
18008
|
+
registry2.register(model92);
|
|
17718
18009
|
}
|
|
17719
18010
|
|
|
17720
18011
|
// lib/models/threadedrod/mesh.ts
|
|
@@ -17804,14 +18095,14 @@ function ThreadedRod({ color = "#737e8f", ...props }) {
|
|
|
17804
18095
|
}
|
|
17805
18096
|
|
|
17806
18097
|
// lib/models/threadedrod/register.tsx
|
|
17807
|
-
var
|
|
18098
|
+
var model93 = defineModelRenderer({
|
|
17808
18099
|
name: "threadedrod",
|
|
17809
18100
|
schema: threadedRodModelDefinitionSchema,
|
|
17810
18101
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(ThreadedRod, { ...props }),
|
|
17811
18102
|
pads: "none"
|
|
17812
18103
|
});
|
|
17813
|
-
function
|
|
17814
|
-
registry2.register(
|
|
18104
|
+
function register93(registry2) {
|
|
18105
|
+
registry2.register(model93);
|
|
17815
18106
|
}
|
|
17816
18107
|
|
|
17817
18108
|
// lib/models/torsionspring/mesh.ts
|
|
@@ -17900,14 +18191,14 @@ function TorsionSpring({
|
|
|
17900
18191
|
}
|
|
17901
18192
|
|
|
17902
18193
|
// lib/models/torsionspring/register.tsx
|
|
17903
|
-
var
|
|
18194
|
+
var model94 = defineModelRenderer({
|
|
17904
18195
|
name: "torsionspring",
|
|
17905
18196
|
schema: torsionSpringModelDefinitionSchema,
|
|
17906
18197
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(TorsionSpring, { ...props }),
|
|
17907
18198
|
pads: "none"
|
|
17908
18199
|
});
|
|
17909
|
-
function
|
|
17910
|
-
registry2.register(
|
|
18200
|
+
function register94(registry2) {
|
|
18201
|
+
registry2.register(model94);
|
|
17911
18202
|
}
|
|
17912
18203
|
|
|
17913
18204
|
// lib/models/tslotcoverstrip/geometry.ts
|
|
@@ -17990,20 +18281,20 @@ function TSlotCoverStrip({
|
|
|
17990
18281
|
}
|
|
17991
18282
|
|
|
17992
18283
|
// lib/models/tslotcoverstrip/register.tsx
|
|
17993
|
-
var
|
|
18284
|
+
var model95 = defineModelRenderer({
|
|
17994
18285
|
name: "tslotcoverstrip",
|
|
17995
18286
|
schema: tSlotCoverStripModelDefinitionSchema,
|
|
17996
18287
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(TSlotCoverStrip, { ...props }),
|
|
17997
18288
|
pads: "none"
|
|
17998
18289
|
});
|
|
17999
|
-
function
|
|
18000
|
-
registry2.register(
|
|
18290
|
+
function register95(registry2) {
|
|
18291
|
+
registry2.register(model95);
|
|
18001
18292
|
}
|
|
18002
18293
|
|
|
18003
18294
|
// lib/models/tslotextrusion/mesh.ts
|
|
18004
18295
|
function createTSlotExtrusionMesh(input = {}) {
|
|
18005
18296
|
const props = tSlotExtrusionModelPropsSchema.parse(input);
|
|
18006
|
-
const { width: width10, height: height10, length:
|
|
18297
|
+
const { width: width10, height: height10, length: length30, cornerRadius, lipThickness, pocketDepth } = props;
|
|
18007
18298
|
const slot = props.slotWidth / 2;
|
|
18008
18299
|
const pocket = props.pocketWidth / 2;
|
|
18009
18300
|
const depth = lipThickness + pocketDepth;
|
|
@@ -18040,7 +18331,7 @@ function createTSlotExtrusionMesh(input = {}) {
|
|
|
18040
18331
|
outer,
|
|
18041
18332
|
holes: props.boreDiameter > 0 ? [circularProfile(0, 0, props.boreDiameter / 2)] : [],
|
|
18042
18333
|
start: 0,
|
|
18043
|
-
end:
|
|
18334
|
+
end: length30
|
|
18044
18335
|
});
|
|
18045
18336
|
}
|
|
18046
18337
|
|
|
@@ -18056,14 +18347,14 @@ function TSlotExtrusion({
|
|
|
18056
18347
|
}
|
|
18057
18348
|
|
|
18058
18349
|
// lib/models/tslotextrusion/register.tsx
|
|
18059
|
-
var
|
|
18350
|
+
var model96 = defineModelRenderer({
|
|
18060
18351
|
name: "tslotextrusion",
|
|
18061
18352
|
schema: tSlotExtrusionModelDefinitionSchema,
|
|
18062
18353
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(TSlotExtrusion, { ...props }),
|
|
18063
18354
|
pads: "none"
|
|
18064
18355
|
});
|
|
18065
|
-
function
|
|
18066
|
-
registry2.register(
|
|
18356
|
+
function register96(registry2) {
|
|
18357
|
+
registry2.register(model96);
|
|
18067
18358
|
}
|
|
18068
18359
|
|
|
18069
18360
|
// lib/models/tslotgusset/mesh.ts
|
|
@@ -18109,14 +18400,14 @@ function TSlotGusset({ color = "#8995a3", ...props }) {
|
|
|
18109
18400
|
}
|
|
18110
18401
|
|
|
18111
18402
|
// lib/models/tslotgusset/register.tsx
|
|
18112
|
-
var
|
|
18403
|
+
var model97 = defineModelRenderer({
|
|
18113
18404
|
name: "tslotgusset",
|
|
18114
18405
|
schema: tSlotGussetModelDefinitionSchema,
|
|
18115
18406
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(TSlotGusset, { ...props }),
|
|
18116
18407
|
pads: "none"
|
|
18117
18408
|
});
|
|
18118
|
-
function
|
|
18119
|
-
registry2.register(
|
|
18409
|
+
function register97(registry2) {
|
|
18410
|
+
registry2.register(model97);
|
|
18120
18411
|
}
|
|
18121
18412
|
|
|
18122
18413
|
// lib/models/tslotinsidecorner/mesh.ts
|
|
@@ -18190,14 +18481,124 @@ function TSlotInsideCorner({
|
|
|
18190
18481
|
}
|
|
18191
18482
|
|
|
18192
18483
|
// lib/models/tslotinsidecorner/register.tsx
|
|
18193
|
-
var
|
|
18484
|
+
var model98 = defineModelRenderer({
|
|
18194
18485
|
name: "tslotinsidecorner",
|
|
18195
18486
|
schema: tSlotInsideCornerModelDefinitionSchema,
|
|
18196
18487
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(TSlotInsideCorner, { ...props }),
|
|
18197
18488
|
pads: "none"
|
|
18198
18489
|
});
|
|
18199
|
-
function
|
|
18200
|
-
registry2.register(
|
|
18490
|
+
function register98(registry2) {
|
|
18491
|
+
registry2.register(model98);
|
|
18492
|
+
}
|
|
18493
|
+
|
|
18494
|
+
// lib/models/ufl/geometry.ts
|
|
18495
|
+
import jscad16 from "@jscad/modeling";
|
|
18496
|
+
function createUflGeometries(input = {}) {
|
|
18497
|
+
const d = getUflDimensions(input);
|
|
18498
|
+
const { booleans: booleans4, primitives: primitives8 } = jscad16;
|
|
18499
|
+
const silver = "#bcbfc3";
|
|
18500
|
+
const dielectric = "#eee9d5";
|
|
18501
|
+
const gold = "#d9b45b";
|
|
18502
|
+
const plateThickness = 0.05;
|
|
18503
|
+
const shellHeight = d.height - d.baseHeight;
|
|
18504
|
+
const cylinder = (diameter, bottom, top) => primitives8.cylinder({
|
|
18505
|
+
radius: diameter / 2,
|
|
18506
|
+
height: top - bottom,
|
|
18507
|
+
center: [d.bodyCenterX, 0, (bottom + top) / 2],
|
|
18508
|
+
segments: 48
|
|
18509
|
+
});
|
|
18510
|
+
const terminal = (size, x, y) => primitives8.cuboid({ size, center: [x, y, d.terminalThickness / 2] });
|
|
18511
|
+
return [
|
|
18512
|
+
{
|
|
18513
|
+
geom: primitives8.cuboid({
|
|
18514
|
+
size: [d.baseWidth, d.baseLength, d.baseHeight - plateThickness],
|
|
18515
|
+
center: [d.bodyCenterX, 0, (d.baseHeight - plateThickness) / 2]
|
|
18516
|
+
}),
|
|
18517
|
+
color: dielectric
|
|
18518
|
+
},
|
|
18519
|
+
{
|
|
18520
|
+
geom: booleans4.subtract(
|
|
18521
|
+
primitives8.cuboid({
|
|
18522
|
+
size: [d.baseWidth, d.baseLength, plateThickness],
|
|
18523
|
+
center: [d.bodyCenterX, 0, d.baseHeight - plateThickness / 2]
|
|
18524
|
+
}),
|
|
18525
|
+
cylinder(d.shellInnerDiameter, 0, d.baseHeight + plateThickness)
|
|
18526
|
+
),
|
|
18527
|
+
color: silver
|
|
18528
|
+
},
|
|
18529
|
+
{
|
|
18530
|
+
geom: booleans4.subtract(
|
|
18531
|
+
cylinder(
|
|
18532
|
+
d.shellOuterDiameter,
|
|
18533
|
+
d.baseHeight,
|
|
18534
|
+
d.baseHeight + shellHeight
|
|
18535
|
+
),
|
|
18536
|
+
cylinder(
|
|
18537
|
+
d.shellInnerDiameter,
|
|
18538
|
+
d.baseHeight - plateThickness,
|
|
18539
|
+
d.height + plateThickness
|
|
18540
|
+
)
|
|
18541
|
+
),
|
|
18542
|
+
color: silver
|
|
18543
|
+
},
|
|
18544
|
+
{
|
|
18545
|
+
geom: cylinder(d.shellInnerDiameter, d.baseHeight, d.dielectricHeight),
|
|
18546
|
+
color: dielectric
|
|
18547
|
+
},
|
|
18548
|
+
{
|
|
18549
|
+
geom: cylinder(d.centerPinDiameter, d.baseHeight, d.centerPinHeight),
|
|
18550
|
+
color: gold
|
|
18551
|
+
},
|
|
18552
|
+
{
|
|
18553
|
+
geom: terminal(
|
|
18554
|
+
[d.groundTerminalWidth, d.groundTerminalDepth, d.terminalThickness],
|
|
18555
|
+
d.groundTerminalX,
|
|
18556
|
+
d.groundTerminalY
|
|
18557
|
+
),
|
|
18558
|
+
color: silver
|
|
18559
|
+
},
|
|
18560
|
+
{
|
|
18561
|
+
geom: terminal(
|
|
18562
|
+
[d.signalTerminalWidth, d.signalTerminalHeight, d.terminalThickness],
|
|
18563
|
+
d.signalTerminalX,
|
|
18564
|
+
0
|
|
18565
|
+
),
|
|
18566
|
+
color: gold
|
|
18567
|
+
},
|
|
18568
|
+
{
|
|
18569
|
+
geom: terminal(
|
|
18570
|
+
[d.groundTerminalWidth, d.groundTerminalDepth, d.terminalThickness],
|
|
18571
|
+
d.groundTerminalX,
|
|
18572
|
+
-d.groundTerminalY
|
|
18573
|
+
),
|
|
18574
|
+
color: silver
|
|
18575
|
+
},
|
|
18576
|
+
{
|
|
18577
|
+
// Retention tab opposite the signal contact; not a fourth PCB terminal.
|
|
18578
|
+
geom: terminal(
|
|
18579
|
+
[d.rearTabWidth, d.rearTabHeight, d.terminalThickness],
|
|
18580
|
+
d.rearTabX,
|
|
18581
|
+
0
|
|
18582
|
+
),
|
|
18583
|
+
color: silver
|
|
18584
|
+
}
|
|
18585
|
+
];
|
|
18586
|
+
}
|
|
18587
|
+
|
|
18588
|
+
// lib/models/ufl/Ufl.tsx
|
|
18589
|
+
function Ufl(props) {
|
|
18590
|
+
return /* @__PURE__ */ jsx(Fragment2, { children: createUflGeometries(props).map(({ geom, color }, index) => /* @__PURE__ */ jsx(Colorize, { color, children: /* @__PURE__ */ jsx(Custom, { geometry: geom }) }, index)) });
|
|
18591
|
+
}
|
|
18592
|
+
|
|
18593
|
+
// lib/models/ufl/register.tsx
|
|
18594
|
+
var model99 = defineModelRenderer({
|
|
18595
|
+
name: "ufl",
|
|
18596
|
+
schema: uflModelDefinitionSchema,
|
|
18597
|
+
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(Ufl, { ...props }),
|
|
18598
|
+
pads: "footprinter"
|
|
18599
|
+
});
|
|
18600
|
+
function register99(registry2) {
|
|
18601
|
+
registry2.register(model99);
|
|
18201
18602
|
}
|
|
18202
18603
|
|
|
18203
18604
|
// lib/mechanical/worm-gear-mesh.ts
|
|
@@ -18382,14 +18783,14 @@ function WormGear({ color = "#737e8f", ...props }) {
|
|
|
18382
18783
|
}
|
|
18383
18784
|
|
|
18384
18785
|
// lib/models/wormgear/register.tsx
|
|
18385
|
-
var
|
|
18786
|
+
var model100 = defineModelRenderer({
|
|
18386
18787
|
name: "wormgear",
|
|
18387
18788
|
schema: wormGearModelDefinitionSchema,
|
|
18388
18789
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(WormGear, { ...props }),
|
|
18389
18790
|
pads: "none"
|
|
18390
18791
|
});
|
|
18391
|
-
function
|
|
18392
|
-
registry2.register(
|
|
18792
|
+
function register100(registry2) {
|
|
18793
|
+
registry2.register(model100);
|
|
18393
18794
|
}
|
|
18394
18795
|
|
|
18395
18796
|
// lib/models/zeebar/mesh.ts
|
|
@@ -18460,20 +18861,18 @@ function ZeeBar({ color = "#8995a3", ...props }) {
|
|
|
18460
18861
|
}
|
|
18461
18862
|
|
|
18462
18863
|
// lib/models/zeebar/register.tsx
|
|
18463
|
-
var
|
|
18864
|
+
var model101 = defineModelRenderer({
|
|
18464
18865
|
name: "zeebar",
|
|
18465
18866
|
schema: zeeBarModelDefinitionSchema,
|
|
18466
18867
|
render: ({ fn, ...props }) => /* @__PURE__ */ jsx(ZeeBar, { ...props }),
|
|
18467
18868
|
pads: "none"
|
|
18468
18869
|
});
|
|
18469
|
-
function
|
|
18470
|
-
registry2.register(
|
|
18870
|
+
function register101(registry2) {
|
|
18871
|
+
registry2.register(model101);
|
|
18471
18872
|
}
|
|
18472
18873
|
|
|
18473
18874
|
// lib/generated/model-renderers.ts
|
|
18474
18875
|
function registerAllModelRenderers(registry2) {
|
|
18475
|
-
register50(registry2);
|
|
18476
|
-
register51(registry2);
|
|
18477
18876
|
register52(registry2);
|
|
18478
18877
|
register53(registry2);
|
|
18479
18878
|
register54(registry2);
|
|
@@ -18520,6 +18919,10 @@ function registerAllModelRenderers(registry2) {
|
|
|
18520
18919
|
register95(registry2);
|
|
18521
18920
|
register96(registry2);
|
|
18522
18921
|
register97(registry2);
|
|
18922
|
+
register98(registry2);
|
|
18923
|
+
register99(registry2);
|
|
18924
|
+
register100(registry2);
|
|
18925
|
+
register101(registry2);
|
|
18523
18926
|
}
|
|
18524
18927
|
|
|
18525
18928
|
// lib/default-model-registry.ts
|
|
@@ -18861,7 +19264,7 @@ import { fp as fp10 } from "@tscircuit/footprinter";
|
|
|
18861
19264
|
var ChipBody = ({
|
|
18862
19265
|
center,
|
|
18863
19266
|
width: width10,
|
|
18864
|
-
length:
|
|
19267
|
+
length: length30,
|
|
18865
19268
|
height: height10,
|
|
18866
19269
|
heightAboveSurface: heightAboveSurface2 = 0.15,
|
|
18867
19270
|
color = "#555",
|
|
@@ -18878,24 +19281,24 @@ var ChipBody = ({
|
|
|
18878
19281
|
}) => {
|
|
18879
19282
|
const straightHeight = height10 * straightHeightRatio;
|
|
18880
19283
|
const taperHeight = height10 - straightHeight;
|
|
18881
|
-
const taperInset = Math.min(width10,
|
|
19284
|
+
const taperInset = Math.min(width10, length30) * taperRatio;
|
|
18882
19285
|
const faceWidth = Math.max(width10 - taperInset, width10 * faceRatio);
|
|
18883
|
-
const faceLength = Math.max(
|
|
18884
|
-
const defaultNotchRadius = Math.min(width10,
|
|
19286
|
+
const faceLength = Math.max(length30 - taperInset, length30 * faceRatio);
|
|
19287
|
+
const defaultNotchRadius = Math.min(width10, length30) * 0.12;
|
|
18885
19288
|
const actualNotchRadius = notchRadius ?? defaultNotchRadius;
|
|
18886
19289
|
const defaultNotchPosition = {
|
|
18887
19290
|
x: 0,
|
|
18888
|
-
y:
|
|
19291
|
+
y: length30 / 2 - actualNotchRadius * 0.25,
|
|
18889
19292
|
z: height10
|
|
18890
19293
|
};
|
|
18891
19294
|
const actualNotchPosition = notchPosition ?? defaultNotchPosition;
|
|
18892
19295
|
const body = /* @__PURE__ */ jsxs(Union, { children: [
|
|
18893
19296
|
/* @__PURE__ */ jsxs(Hull, { children: [
|
|
18894
19297
|
/* @__PURE__ */ jsx(Translate, { z: 5e-3, children: /* @__PURE__ */ jsx(Cuboid, { size: [faceWidth, faceLength, 0.01] }) }),
|
|
18895
|
-
/* @__PURE__ */ jsx(Translate, { z: straightHeight, children: /* @__PURE__ */ jsx(Cuboid, { size: [width10,
|
|
19298
|
+
/* @__PURE__ */ jsx(Translate, { z: straightHeight, children: /* @__PURE__ */ jsx(Cuboid, { size: [width10, length30, 0.01] }) })
|
|
18896
19299
|
] }),
|
|
18897
19300
|
/* @__PURE__ */ jsxs(Hull, { children: [
|
|
18898
|
-
/* @__PURE__ */ jsx(Translate, { z: straightHeight, children: /* @__PURE__ */ jsx(Cuboid, { size: [width10,
|
|
19301
|
+
/* @__PURE__ */ jsx(Translate, { z: straightHeight, children: /* @__PURE__ */ jsx(Cuboid, { size: [width10, length30, 0.01] }) }),
|
|
18899
19302
|
/* @__PURE__ */ jsx(Translate, { z: straightHeight + taperHeight, children: /* @__PURE__ */ jsx(Cuboid, { size: [faceWidth, faceLength, 0.01] }) })
|
|
18900
19303
|
] })
|
|
18901
19304
|
] });
|
|
@@ -18912,7 +19315,7 @@ var ChipBody = ({
|
|
|
18912
19315
|
let finalBody = body;
|
|
18913
19316
|
if (chamferSize > 0) {
|
|
18914
19317
|
const xOffset = width10 / 2;
|
|
18915
|
-
const yOffset =
|
|
19318
|
+
const yOffset = length30 / 2;
|
|
18916
19319
|
finalBody = /* @__PURE__ */ jsxs(Subtract, { children: [
|
|
18917
19320
|
body,
|
|
18918
19321
|
chamferCutout(xOffset, yOffset),
|
|
@@ -18942,8 +19345,8 @@ function getExpandedStroke(strokeInput, width10) {
|
|
|
18942
19345
|
function getNormal(p1, p2) {
|
|
18943
19346
|
const dx = p2.x - p1.x;
|
|
18944
19347
|
const dy = p2.y - p1.y;
|
|
18945
|
-
const
|
|
18946
|
-
return { x: -dy /
|
|
19348
|
+
const length30 = Math.sqrt(dx * dx + dy * dy);
|
|
19349
|
+
return { x: -dy / length30, y: dx / length30 };
|
|
18947
19350
|
}
|
|
18948
19351
|
function addPoint(point, normal, factor) {
|
|
18949
19352
|
const newPoint = {
|
|
@@ -20611,11 +21014,11 @@ var FemaleHeaderRow = ({
|
|
|
20611
21014
|
// lib/PushButton.tsx
|
|
20612
21015
|
var PushButton = ({
|
|
20613
21016
|
width: width10,
|
|
20614
|
-
length:
|
|
21017
|
+
length: length30,
|
|
20615
21018
|
innerDiameter = 1
|
|
20616
21019
|
}) => {
|
|
20617
21020
|
const bodyWidth = width10;
|
|
20618
|
-
const bodyLength10 =
|
|
21021
|
+
const bodyLength10 = length30;
|
|
20619
21022
|
const bodyHeight = width10 * 0.7;
|
|
20620
21023
|
const legWidth = innerDiameter / 2.5;
|
|
20621
21024
|
return /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
@@ -24549,12 +24952,12 @@ var JstSh = ({ footprint = "jst6_sh" }) => {
|
|
|
24549
24952
|
};
|
|
24550
24953
|
|
|
24551
24954
|
// lib/Crystal.tsx
|
|
24552
|
-
var getTerminalPoints = ([centerX, centerY], width10,
|
|
24955
|
+
var getTerminalPoints = ([centerX, centerY], width10, length30, chamfer, isPinOne) => {
|
|
24553
24956
|
const xDirection = Math.sign(centerX);
|
|
24554
24957
|
const yDirection = Math.sign(centerY);
|
|
24555
24958
|
const halfWidth = width10 / 2;
|
|
24556
|
-
const halfLength =
|
|
24557
|
-
const innerChamfer = isPinOne ? Math.min(0.32,
|
|
24959
|
+
const halfLength = length30 / 2;
|
|
24960
|
+
const innerChamfer = isPinOne ? Math.min(0.32, length30 * 0.36) : 0;
|
|
24558
24961
|
const outerChamfer = Math.min(chamfer, halfWidth, halfLength);
|
|
24559
24962
|
const points = [
|
|
24560
24963
|
[-halfWidth, -halfLength],
|
|
@@ -24574,13 +24977,13 @@ var getTerminalPoints = ([centerX, centerY], width10, length29, chamfer, isPinOn
|
|
|
24574
24977
|
};
|
|
24575
24978
|
var getRoundedRectProfile = ({
|
|
24576
24979
|
width: width10,
|
|
24577
|
-
length:
|
|
24980
|
+
length: length30,
|
|
24578
24981
|
radius,
|
|
24579
24982
|
height: height10,
|
|
24580
24983
|
z
|
|
24581
24984
|
}) => {
|
|
24582
24985
|
const x = width10 / 2 - radius;
|
|
24583
|
-
const y =
|
|
24986
|
+
const y = length30 / 2 - radius;
|
|
24584
24987
|
return [
|
|
24585
24988
|
[-x, -y],
|
|
24586
24989
|
[x, -y],
|
|
@@ -24724,12 +25127,12 @@ var FPC = ({
|
|
|
24724
25127
|
const contactRows = Array.from({ length: pinCount }, (_, index) => {
|
|
24725
25128
|
const isUpperRow = staggered && index % 2 === 1 !== reverse;
|
|
24726
25129
|
const y = staggered ? isUpperRow ? rowPitch / 2 : -rowPitch / 2 : 0;
|
|
24727
|
-
const
|
|
25130
|
+
const length30 = isUpperRow ? topPadLength : bottomPadLength;
|
|
24728
25131
|
return {
|
|
24729
25132
|
index,
|
|
24730
25133
|
x: contactStartX + index * pitch,
|
|
24731
25134
|
y,
|
|
24732
|
-
length:
|
|
25135
|
+
length: length30
|
|
24733
25136
|
};
|
|
24734
25137
|
});
|
|
24735
25138
|
const contactMaxY = Math.max(
|
|
@@ -25281,7 +25684,7 @@ var Led2835 = ({
|
|
|
25281
25684
|
};
|
|
25282
25685
|
|
|
25283
25686
|
// lib/RJ45.tsx
|
|
25284
|
-
var range2 = (
|
|
25687
|
+
var range2 = (length30) => Array.from({ length: length30 }, (_, index) => index);
|
|
25285
25688
|
var RJ45 = ({
|
|
25286
25689
|
bodyWidth = 16.26,
|
|
25287
25690
|
bodyDepth = 15.88,
|
|
@@ -26101,10 +26504,10 @@ var SOT143 = ({ footprint = "sot143" }) => {
|
|
|
26101
26504
|
var Footprinter3d = ({ footprint }) => {
|
|
26102
26505
|
const modelFn = mp.string(footprint.split("_", 1)[0]).params().fn;
|
|
26103
26506
|
if (mp.getModelNames().includes(modelFn)) {
|
|
26104
|
-
const
|
|
26105
|
-
const renderer = modelRendererRegistry.get(
|
|
26507
|
+
const model102 = mp.string(footprint).json();
|
|
26508
|
+
const renderer = modelRendererRegistry.get(model102.fn);
|
|
26106
26509
|
if (renderer) {
|
|
26107
|
-
return renderer.render(
|
|
26510
|
+
return renderer.render(model102);
|
|
26108
26511
|
}
|
|
26109
26512
|
}
|
|
26110
26513
|
let normalizedFootprint = footprint;
|
|
@@ -26937,8 +27340,8 @@ function renderNode(node, colorCtx, renderCtx) {
|
|
|
26937
27340
|
}
|
|
26938
27341
|
return (children ?? []).flatMap((c) => renderNode(c, colorCtx, renderCtx));
|
|
26939
27342
|
}
|
|
26940
|
-
function render(root,
|
|
26941
|
-
const geometries8 = renderNode(root, void 0, { jscad:
|
|
27343
|
+
function render(root, jscad17) {
|
|
27344
|
+
const geometries8 = renderNode(root, void 0, { jscad: jscad17 });
|
|
26942
27345
|
return {
|
|
26943
27346
|
geometries: geometries8.map(
|
|
26944
27347
|
(entry) => entry.material ? { ...entry, geom: { ...entry.geom, material: entry.material } } : entry
|
|
@@ -27030,24 +27433,24 @@ function convertCSGToThreeGeom(csg) {
|
|
|
27030
27433
|
}
|
|
27031
27434
|
|
|
27032
27435
|
// lib/vanilla/index.ts
|
|
27033
|
-
function getJscadModelForFootprint(footprint,
|
|
27436
|
+
function getJscadModelForFootprint(footprint, jscad17) {
|
|
27034
27437
|
const vnode = h(Footprinter3d, { footprint });
|
|
27035
|
-
return render(vnode,
|
|
27438
|
+
return render(vnode, jscad17);
|
|
27036
27439
|
}
|
|
27037
|
-
function getJscadModelForFootprintWithPads(footprint,
|
|
27440
|
+
function getJscadModelForFootprintWithPads(footprint, jscad17) {
|
|
27038
27441
|
const vnode = h(
|
|
27039
27442
|
Fragment,
|
|
27040
27443
|
{},
|
|
27041
27444
|
h(Footprinter3d, { footprint }),
|
|
27042
27445
|
h(ExtrudedPads, { footprint })
|
|
27043
27446
|
);
|
|
27044
|
-
return render(vnode,
|
|
27447
|
+
return render(vnode, jscad17);
|
|
27045
27448
|
}
|
|
27046
|
-
function createJSCADRenderer(
|
|
27449
|
+
function createJSCADRenderer(jscad17) {
|
|
27047
27450
|
function createJSCADRoot(container) {
|
|
27048
27451
|
return {
|
|
27049
27452
|
render(element) {
|
|
27050
|
-
const { geometries: geometries8 } = render(element,
|
|
27453
|
+
const { geometries: geometries8 } = render(element, jscad17);
|
|
27051
27454
|
container.splice(0, container.length, ...geometries8);
|
|
27052
27455
|
}
|
|
27053
27456
|
};
|
|
@@ -27084,6 +27487,7 @@ export {
|
|
|
27084
27487
|
NemaMotor,
|
|
27085
27488
|
NylonLockNut,
|
|
27086
27489
|
PanScrew,
|
|
27490
|
+
PerforatedAngle,
|
|
27087
27491
|
PerforatedSheet,
|
|
27088
27492
|
PlainBushing,
|
|
27089
27493
|
PushFitPlug,
|
|
@@ -27105,6 +27509,7 @@ export {
|
|
|
27105
27509
|
TSlotInsideCorner,
|
|
27106
27510
|
ThreadedRod,
|
|
27107
27511
|
TorsionSpring,
|
|
27512
|
+
Ufl,
|
|
27108
27513
|
WormGear,
|
|
27109
27514
|
ZeeBar,
|
|
27110
27515
|
convertCSGToThreeGeom,
|
|
@@ -27157,6 +27562,8 @@ export {
|
|
|
27157
27562
|
createNylonLockNutMeshes,
|
|
27158
27563
|
createPanScrewGeom,
|
|
27159
27564
|
createPanScrewMesh,
|
|
27565
|
+
createPerforatedAngleGeom,
|
|
27566
|
+
createPerforatedAngleMesh,
|
|
27160
27567
|
createPerforatedSheetGeom,
|
|
27161
27568
|
createPerforatedSheetMesh,
|
|
27162
27569
|
createPlainBushingGeom,
|
|
@@ -27199,6 +27606,7 @@ export {
|
|
|
27199
27606
|
createThreadedRodMesh,
|
|
27200
27607
|
createTorsionSpringGeom,
|
|
27201
27608
|
createTorsionSpringMesh,
|
|
27609
|
+
createUflGeometries,
|
|
27202
27610
|
createWormGearGeom,
|
|
27203
27611
|
createWormGearMesh,
|
|
27204
27612
|
createZeeBarGeom,
|