jscad-electronics 0.0.219 → 0.0.220

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/vanilla.js CHANGED
@@ -24,7 +24,7 @@ function h(type, props, ...restChildren) {
24
24
  };
25
25
  }
26
26
 
27
- // .model-contracts/generations/566d9d61ce5b539f7bfc4aefda59e272a4b4d6ce-v2/node_modules/zod/v3/external.js
27
+ // .model-contracts/generations/ad10c7f4f5c1de0282fd5278804b9e224ac78151-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/566d9d61ce5b539f7bfc4aefda59e272a4b4d6ce-v2/node_modules/zod/v3/helpers/util.js
139
+ // .model-contracts/generations/ad10c7f4f5c1de0282fd5278804b9e224ac78151-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/566d9d61ce5b539f7bfc4aefda59e272a4b4d6ce-v2/node_modules/zod/v3/ZodError.js
273
+ // .model-contracts/generations/ad10c7f4f5c1de0282fd5278804b9e224ac78151-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/566d9d61ce5b539f7bfc4aefda59e272a4b4d6ce-v2/node_modules/zod/v3/locales/en.js
391
+ // .model-contracts/generations/ad10c7f4f5c1de0282fd5278804b9e224ac78151-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/566d9d61ce5b539f7bfc4aefda59e272a4b4d6ce-v2/node_modules/zod/v3/errors.js
494
+ // .model-contracts/generations/ad10c7f4f5c1de0282fd5278804b9e224ac78151-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/566d9d61ce5b539f7bfc4aefda59e272a4b4d6ce-v2/node_modules/zod/v3/helpers/parseUtil.js
503
+ // .model-contracts/generations/ad10c7f4f5c1de0282fd5278804b9e224ac78151-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/566d9d61ce5b539f7bfc4aefda59e272a4b4d6ce-v2/node_modules/zod/v3/helpers/errorUtil.js
613
+ // .model-contracts/generations/ad10c7f4f5c1de0282fd5278804b9e224ac78151-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/566d9d61ce5b539f7bfc4aefda59e272a4b4d6ce-v2/node_modules/zod/v3/types.js
620
+ // .model-contracts/generations/ad10c7f4f5c1de0282fd5278804b9e224ac78151-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 shape24 = this._def.shape();
2406
- const keys = util.objectKeys(shape24);
2407
- this._cached = { shape: shape24, keys };
2405
+ const shape26 = this._def.shape();
2406
+ const keys = util.objectKeys(shape26);
2407
+ this._cached = { shape: shape26, 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: shape24, keys: shapeKeys } = this._getCached();
2422
+ const { shape: shape26, 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 = shape24[key];
2433
+ const keyValidator = shape26[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 shape24 = {};
2639
+ const shape26 = {};
2640
2640
  for (const key of util.objectKeys(mask)) {
2641
2641
  if (mask[key] && this.shape[key]) {
2642
- shape24[key] = this.shape[key];
2642
+ shape26[key] = this.shape[key];
2643
2643
  }
2644
2644
  }
2645
2645
  return new _ZodObject({
2646
2646
  ...this._def,
2647
- shape: () => shape24
2647
+ shape: () => shape26
2648
2648
  });
2649
2649
  }
2650
2650
  omit(mask) {
2651
- const shape24 = {};
2651
+ const shape26 = {};
2652
2652
  for (const key of util.objectKeys(this.shape)) {
2653
2653
  if (!mask[key]) {
2654
- shape24[key] = this.shape[key];
2654
+ shape26[key] = this.shape[key];
2655
2655
  }
2656
2656
  }
2657
2657
  return new _ZodObject({
2658
2658
  ...this._def,
2659
- shape: () => shape24
2659
+ shape: () => shape26
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 = (shape24, params) => {
2706
+ ZodObject.create = (shape26, params) => {
2707
2707
  return new ZodObject({
2708
- shape: () => shape24,
2708
+ shape: () => shape26,
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 = (shape24, params) => {
2715
+ ZodObject.strictCreate = (shape26, params) => {
2716
2716
  return new ZodObject({
2717
- shape: () => shape24,
2717
+ shape: () => shape26,
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 = (shape24, params) => {
2724
+ ZodObject.lazycreate = (shape26, params) => {
2725
2725
  return new ZodObject({
2726
- shape: shape24,
2726
+ shape: shape26,
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/566d9d61ce5b539f7bfc4aefda59e272a4b4d6ce-v2/node_modules/@tscircuit/mm/dist/index.js
4068
+ // .model-contracts/generations/ad10c7f4f5c1de0282fd5278804b9e224ac78151-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/566d9d61ce5b539f7bfc4aefda59e272a4b4d6ce-v2/index.js
4095
+ // .model-contracts/generations/ad10c7f4f5c1de0282fd5278804b9e224ac78151-v2/index.js
4096
4096
  function normalizeNemaMotorModelString(value) {
4097
4097
  if (!/^nema(?:8|17|23)(?:_|$)/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");
@@ -4148,21 +4148,21 @@ var parseModelStringParams = (definition) => {
4148
4148
  params.string = normalizedDefinition;
4149
4149
  return params;
4150
4150
  };
4151
- function expandModelStringFlags(value, flags2) {
4151
+ function expandModelStringFlags(value, flags3) {
4152
4152
  return splitModelStringTokens(value).map(
4153
- (token, index) => index > 0 && Object.hasOwn(flags2, token.toLowerCase()) ? flags2[token.toLowerCase()] : token
4153
+ (token, index) => index > 0 && Object.hasOwn(flags3, token.toLowerCase()) ? flags3[token.toLowerCase()] : token
4154
4154
  ).join("_");
4155
4155
  }
4156
- function normalizeModelStringFlags(value, flags2, parse, omittedFlags) {
4156
+ function normalizeModelStringFlags(value, flags3, parse, omittedFlags) {
4157
4157
  const tokens = splitModelStringTokens(value);
4158
- if (!tokens.slice(1).some((token) => Object.hasOwn(flags2, token.toLowerCase())))
4158
+ if (!tokens.slice(1).some((token) => Object.hasOwn(flags3, token.toLowerCase())))
4159
4159
  return value;
4160
- const expanded = expandModelStringFlags(value, flags2);
4160
+ const expanded = expandModelStringFlags(value, flags3);
4161
4161
  parse(parseModelStringParams(expanded));
4162
4162
  const preferred = new Map(
4163
- Object.entries(flags2).map(([flag, selector]) => [selector, flag])
4163
+ Object.entries(flags3).map(([flag, selector]) => [selector, flag])
4164
4164
  );
4165
- const omitted = new Set(omittedFlags.map((flag) => flags2[flag]));
4165
+ const omitted = new Set(omittedFlags.map((flag) => flags3[flag]));
4166
4166
  return splitModelStringTokens(expanded).flatMap((token, index) => {
4167
4167
  if (index === 0) return [token.toLowerCase()];
4168
4168
  const lower = token.toLowerCase();
@@ -4178,55 +4178,55 @@ var stringFlags = {
4178
4178
  male: "threadgender(male)"
4179
4179
  };
4180
4180
  var omittedStringFlags = ["righthanded", "male"];
4181
- function defineModel(model302) {
4182
- return model302;
4181
+ function defineModel(model322) {
4182
+ return model322;
4183
4183
  }
4184
4184
  var ModelRegistry = class {
4185
4185
  models = /* @__PURE__ */ new Map();
4186
- register(model302) {
4187
- if (typeof model302.name !== "string" || !/^[a-z]+$/.test(model302.name)) {
4186
+ register(model322) {
4187
+ if (typeof model322.name !== "string" || !/^[a-z]+$/.test(model322.name)) {
4188
4188
  throw new Error("Model names must contain only lowercase letters");
4189
4189
  }
4190
- if (this.models.has(model302.name)) {
4190
+ if (this.models.has(model322.name)) {
4191
4191
  throw new Error(
4192
- `Modelprinter function "${model302.name}" is already registered`
4192
+ `Modelprinter function "${model322.name}" is already registered`
4193
4193
  );
4194
4194
  }
4195
- if (model302.normalizeString !== void 0 && typeof model302.normalizeString !== "function")
4195
+ if (model322.normalizeString !== void 0 && typeof model322.normalizeString !== "function")
4196
4196
  throw new Error("Model string normalizer must be a function");
4197
- this.models.set(model302.name, {
4198
- name: model302.name,
4199
- schema: model302.schema,
4200
- parse: model302.parse,
4201
- normalizeString: model302.normalizeString
4197
+ this.models.set(model322.name, {
4198
+ name: model322.name,
4199
+ schema: model322.schema,
4200
+ parse: model322.parse,
4201
+ normalizeString: model322.normalizeString
4202
4202
  });
4203
4203
  }
4204
4204
  getModelNames() {
4205
4205
  return [...this.models.keys()];
4206
4206
  }
4207
4207
  normalize(params) {
4208
- const model302 = this.models.get(params.fn);
4209
- if (!model302?.normalizeString) return params;
4210
- const value = model302.normalizeString(params.string);
4208
+ const model322 = this.models.get(params.fn);
4209
+ if (!model322?.normalizeString) return params;
4210
+ const value = model322.normalizeString(params.string);
4211
4211
  if (typeof value !== "string")
4212
- throw new Error(`Normalizer for "${model302.name}" must return a string`);
4212
+ throw new Error(`Normalizer for "${model322.name}" must return a string`);
4213
4213
  if (value === params.string) return params;
4214
4214
  const normalized = parseModelStringParams(value);
4215
- if (normalized.fn !== model302.name)
4215
+ if (normalized.fn !== model322.name)
4216
4216
  throw new Error(
4217
- `Normalizer for "${model302.name}" must preserve the model name`
4217
+ `Normalizer for "${model322.name}" must preserve the model name`
4218
4218
  );
4219
4219
  return normalized;
4220
4220
  }
4221
4221
  parse(params) {
4222
- const model302 = this.models.get(params.fn);
4223
- if (!model302) {
4222
+ const model322 = this.models.get(params.fn);
4223
+ if (!model322) {
4224
4224
  throw new Error(`Unsupported modelprinter function "${params.fn}"`);
4225
4225
  }
4226
- const definition = model302.parse(params);
4227
- if (definition === null || typeof definition !== "object" || Array.isArray(definition) || definition.fn !== model302.name) {
4226
+ const definition = model322.parse(params);
4227
+ if (definition === null || typeof definition !== "object" || Array.isArray(definition) || definition.fn !== model322.name) {
4228
4228
  throw new Error(
4229
- `Parser for "${model302.name}" must return a model with fn "${model302.name}"`
4229
+ `Parser for "${model322.name}" must return a model with fn "${model322.name}"`
4230
4230
  );
4231
4231
  }
4232
4232
  return definition;
@@ -4346,9 +4346,9 @@ var hexBoltModelPropsShape = {
4346
4346
  headChamferDiameter: positiveModelLengthSchema2.optional()
4347
4347
  };
4348
4348
  var validateHexBolt = (props, context) => {
4349
- const dimensions4 = hexBoltDimensions[props.metricSize];
4350
- for (const key of Object.keys(dimensions4)) {
4351
- if (props[key] !== void 0 && Math.abs(props[key] - dimensions4[key]) > 1e-9) {
4349
+ const dimensions5 = hexBoltDimensions[props.metricSize];
4350
+ for (const key of Object.keys(dimensions5)) {
4351
+ if (props[key] !== void 0 && Math.abs(props[key] - dimensions5[key]) > 1e-9) {
4352
4352
  context.addIssue({
4353
4353
  code: "custom",
4354
4354
  path: [key],
@@ -4356,7 +4356,7 @@ var validateHexBolt = (props, context) => {
4356
4356
  });
4357
4357
  }
4358
4358
  }
4359
- if (props.length <= dimensions4.underHeadRadius + dimensions4.tipChamfer) {
4359
+ if (props.length <= dimensions5.underHeadRadius + dimensions5.tipChamfer) {
4360
4360
  context.addIssue({
4361
4361
  code: "custom",
4362
4362
  path: ["length"],
@@ -5152,12 +5152,12 @@ function parseSheetMetalFeature(feature, profile) {
5152
5152
  }
5153
5153
  if (!("l" in values) || !("w" in values))
5154
5154
  throw new Error(`Slot requires l and w in ${feature}`);
5155
- const length15 = distance2("l"), width10 = distance2("w");
5156
- if (length15 < width10) throw new Error("Slot length must be at least its width");
5155
+ const length16 = distance2("l"), width10 = distance2("w");
5156
+ if (length16 < width10) throw new Error("Slot length must be at least its width");
5157
5157
  return sheetMetalHoleSchema.parse({
5158
5158
  ...position,
5159
5159
  shape: "slot",
5160
- length: length15,
5160
+ length: length16,
5161
5161
  width: width10,
5162
5162
  axis: panel === "base" === !("vertical" in values) ? "u" : "v"
5163
5163
  });
@@ -5360,9 +5360,9 @@ var flexScreenModelPropsSchema = external_exports.object(flexScreenModelPropsSha
5360
5360
  var flexScreenModelDefinitionSchema = external_exports.object({
5361
5361
  fn: external_exports.literal("flexscreen"),
5362
5362
  ...flexScreenModelPropsShape
5363
- }).strict().superRefine((model302, context) => {
5364
- validateTailLengths(model302, context);
5365
- addOrientationShortcutIssue(model302, (path) => {
5363
+ }).strict().superRefine((model322, context) => {
5364
+ validateTailLengths(model322, context);
5365
+ addOrientationShortcutIssue(model322, (path) => {
5366
5366
  context.addIssue({
5367
5367
  code: "custom",
5368
5368
  message: "Only one FlexScreen orientation shortcut can be true",
@@ -6331,20 +6331,20 @@ var shape8 = {
6331
6331
  showThreads: external_exports.boolean().default(true)
6332
6332
  };
6333
6333
  function validate7(props, context) {
6334
- const dimensions4 = buttonScrewDimensions[props.metricSize];
6335
- if (props.threadPitch !== void 0 && Math.abs(props.threadPitch - dimensions4.threadPitch) > 1e-9)
6334
+ const dimensions5 = buttonScrewDimensions[props.metricSize];
6335
+ if (props.threadPitch !== void 0 && Math.abs(props.threadPitch - dimensions5.threadPitch) > 1e-9)
6336
6336
  context.addIssue({
6337
6337
  code: "custom",
6338
6338
  path: ["threadPitch"],
6339
6339
  message: "ISO 7380-1 requires the tabulated coarse pitch"
6340
6340
  });
6341
- if (props.length > dimensions4.referenceThreadLength)
6341
+ if (props.length > dimensions5.referenceThreadLength)
6342
6342
  context.addIssue({
6343
6343
  code: "custom",
6344
6344
  path: ["length"],
6345
6345
  message: "This family supports only lengths at or below the reference full-thread length"
6346
6346
  });
6347
- if (props.length < 2 * dimensions4.threadPitch)
6347
+ if (props.length < 2 * dimensions5.threadPitch)
6348
6348
  context.addIssue({
6349
6349
  code: "custom",
6350
6350
  path: ["length"],
@@ -6388,7 +6388,7 @@ function parseButtonScrewModelParams(raw) {
6388
6388
  if (raw.fn !== "buttonscrew" || tokens[0]?.toLowerCase() !== "buttonscrew")
6389
6389
  throw new Error("Expected buttonscrew without an inline argument");
6390
6390
  const props = { fn: "buttonscrew" };
6391
- const lengths19 = {
6391
+ const lengths20 = {
6392
6392
  l: "length",
6393
6393
  length: "length",
6394
6394
  threadpitch: "threadPitch"
@@ -6410,7 +6410,7 @@ function parseButtonScrewModelParams(raw) {
6410
6410
  if (name === "m") {
6411
6411
  property = "metricSize";
6412
6412
  parsed = `M${value}`;
6413
- } else if (name in lengths19) property = lengths19[name];
6413
+ } else if (name in lengths20) property = lengths20[name];
6414
6414
  else if (name in selectors4) {
6415
6415
  property = selectors4[name];
6416
6416
  if (!/^\([^()]+\)$/.test(value))
@@ -6810,8 +6810,8 @@ function getCompressionSpringCenterlinePoint(input, turn) {
6810
6810
  const radius = (props.outerDiameter - props.wireDiameter) / 2;
6811
6811
  const pitch = (props.freeLength - 2 * props.wireDiameter) / props.activeTurns;
6812
6812
  const phase = (props.hand === "right" ? 1 : -1) * 2 * Math.PI * (turn % 1);
6813
- const z34 = turn <= 1 ? props.wireDiameter * turn : turn >= props.totalTurns - 1 ? props.freeLength - props.wireDiameter * (props.totalTurns - turn) : props.wireDiameter + pitch * (turn - 1);
6814
- return { x: radius * Math.cos(phase), y: radius * Math.sin(phase), z: z34 };
6813
+ const z36 = turn <= 1 ? props.wireDiameter * turn : turn >= props.totalTurns - 1 ? props.freeLength - props.wireDiameter * (props.totalTurns - turn) : props.wireDiameter + pitch * (turn - 1);
6814
+ return { x: radius * Math.cos(phase), y: radius * Math.sin(phase), z: z36 };
6815
6815
  }
6816
6816
  function parseCompressionSpringModelParams(raw) {
6817
6817
  const tokens = splitModelStringTokens(
@@ -6820,7 +6820,7 @@ function parseCompressionSpringModelParams(raw) {
6820
6820
  if (raw.fn !== "compressionspring" || tokens[0]?.toLowerCase() !== "compressionspring")
6821
6821
  throw new Error("Expected compressionspring without an inline argument");
6822
6822
  const props = { fn: "compressionspring" };
6823
- const lengths19 = {
6823
+ const lengths20 = {
6824
6824
  od: "outerDiameter",
6825
6825
  wire: "wireDiameter",
6826
6826
  l: "freeLength",
@@ -6840,7 +6840,7 @@ function parseCompressionSpringModelParams(raw) {
6840
6840
  const value = match[2];
6841
6841
  let property;
6842
6842
  let parsed = value;
6843
- if (name in lengths19) property = lengths19[name];
6843
+ if (name in lengths20) property = lengths20[name];
6844
6844
  else if (name === "turns" || name === "active") {
6845
6845
  property = name === "turns" ? "totalTurns" : "activeTurns";
6846
6846
  if (!/^\d+$/.test(value))
@@ -6872,6 +6872,162 @@ var model15 = defineModel({
6872
6872
  function register15(registry2) {
6873
6873
  registry2.register(model15);
6874
6874
  }
6875
+ var length7 = external_exports.union([
6876
+ external_exports.number(),
6877
+ external_exports.string().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i).transform((value) => value.toLowerCase())
6878
+ ]).pipe(modelLengthSchema).refine((value) => value > 0, "Length must be positive");
6879
+ var dowelPinEndLeadLengths = {
6880
+ "1": 0.2,
6881
+ "1.5": 0.3,
6882
+ "2": 0.35,
6883
+ "2.5": 0.4,
6884
+ "3": 0.5,
6885
+ "4": 0.63,
6886
+ "5": 0.8,
6887
+ "6": 1.2,
6888
+ "8": 1.6,
6889
+ "10": 2,
6890
+ "12": 2.5,
6891
+ "16": 3,
6892
+ "20": 3.5
6893
+ };
6894
+ var dowelPinNominalLengths = [
6895
+ 3,
6896
+ 4,
6897
+ 5,
6898
+ 6,
6899
+ 8,
6900
+ 10,
6901
+ 12,
6902
+ 14,
6903
+ 16,
6904
+ 20,
6905
+ 22,
6906
+ 24,
6907
+ 26,
6908
+ 28,
6909
+ 30,
6910
+ 32,
6911
+ 35,
6912
+ 40,
6913
+ 45,
6914
+ 50,
6915
+ 55,
6916
+ 60,
6917
+ 65,
6918
+ 70,
6919
+ 75,
6920
+ 80,
6921
+ 85,
6922
+ 90,
6923
+ 95,
6924
+ 100
6925
+ ];
6926
+ var diameterValues = Object.keys(dowelPinEndLeadLengths).map(Number);
6927
+ var near = (a, b) => Math.abs(a - b) <= 1e-9;
6928
+ function selectedDiameter(diameter) {
6929
+ return diameterValues.find((value) => near(value, diameter));
6930
+ }
6931
+ var shape12 = {
6932
+ standard: external_exports.enum(["iso8734", "iso8734:1997"]).default("iso8734").transform(() => "iso8734:1997"),
6933
+ diameter: length7,
6934
+ /** Overall distance between the two flat end planes, including leads. */
6935
+ length: length7,
6936
+ endLeadLength: length7.optional(),
6937
+ endLeadAngle: external_exports.number().finite().positive().optional()
6938
+ };
6939
+ function validate11(props, context) {
6940
+ const issue = (path, message) => context.addIssue({ code: "custom", path: [path], message });
6941
+ const diameter = selectedDiameter(props.diameter);
6942
+ if (diameter === void 0) {
6943
+ issue("diameter", "Diameter must be a supported ISO 8734 nominal value");
6944
+ return;
6945
+ }
6946
+ const c = dowelPinEndLeadLengths[String(diameter)];
6947
+ if (!dowelPinNominalLengths.some((value) => near(value, props.length)))
6948
+ issue(
6949
+ "length",
6950
+ "Length must be a tabulated nominal value from 3 through 100 mm"
6951
+ );
6952
+ if (props.length <= 2 * c)
6953
+ issue("length", "Length must separate the two fixed end leads");
6954
+ if (props.endLeadLength !== void 0 && !near(props.endLeadLength, c))
6955
+ issue(
6956
+ "endLeadLength",
6957
+ "End lead contradicts the selected ISO 8734 diameter"
6958
+ );
6959
+ if (props.endLeadAngle !== void 0 && !near(props.endLeadAngle, 15))
6960
+ issue(
6961
+ "endLeadAngle",
6962
+ "The visual ISO 8734 end lead uses the fixed approximate 15-degree angle"
6963
+ );
6964
+ }
6965
+ function resolve4(props) {
6966
+ const diameter = selectedDiameter(props.diameter);
6967
+ return {
6968
+ ...props,
6969
+ diameter,
6970
+ length: dowelPinNominalLengths.find((value) => near(value, props.length)),
6971
+ endLeadLength: dowelPinEndLeadLengths[String(diameter)],
6972
+ endLeadAngle: 15
6973
+ };
6974
+ }
6975
+ var dowelPinModelPropsSchema = external_exports.object(shape12).strict().superRefine(validate11).transform(resolve4);
6976
+ var dowelPinModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("dowelpin"), ...shape12 }).strict().superRefine(validate11).transform(resolve4);
6977
+ function getDowelPinDimensions(input) {
6978
+ const props = dowelPinModelPropsSchema.parse(input);
6979
+ return {
6980
+ ...props,
6981
+ endDiameter: props.diameter - 2 * props.endLeadLength * Math.tan(props.endLeadAngle * Math.PI / 180),
6982
+ bearingZ: 0,
6983
+ topZ: props.length
6984
+ };
6985
+ }
6986
+ var lengths10 = {
6987
+ d: "diameter",
6988
+ diameter: "diameter",
6989
+ l: "length",
6990
+ length: "length",
6991
+ c: "endLeadLength",
6992
+ endleadlength: "endLeadLength"
6993
+ };
6994
+ function parseDowelPinModelParams(raw) {
6995
+ const tokens = splitModelStringTokens(raw.string);
6996
+ if (raw.fn !== "dowelpin" || tokens[0]?.toLowerCase() !== "dowelpin")
6997
+ throw new Error("Expected dowelpin without an inline argument");
6998
+ const props = { fn: "dowelpin" };
6999
+ for (const token of tokens.slice(1)) {
7000
+ const match = token.match(/^([a-z]+)(.*)$/i);
7001
+ if (!match) throw new Error(`Invalid dowel pin token "${token}"`);
7002
+ const name = match[1].toLowerCase(), value = match[2];
7003
+ let property, parsed = value;
7004
+ if (Object.hasOwn(lengths10, name))
7005
+ property = lengths10[name];
7006
+ else if (name === "standard") {
7007
+ property = "standard";
7008
+ if (!/^\([^()]+\)$/.test(value))
7009
+ throw new Error("Expected a parenthesized standard designation");
7010
+ parsed = value.slice(1, -1).toLowerCase();
7011
+ } else if (name === "endleadangle") {
7012
+ property = "endLeadAngle";
7013
+ if (!/^\d+(?:\.\d+)?$/.test(value))
7014
+ throw new Error("End lead angle must be a unitless number");
7015
+ parsed = Number(value);
7016
+ } else throw new Error(`Unknown dowel pin token "${token}"`);
7017
+ if (Object.hasOwn(props, property))
7018
+ throw new Error(`Duplicate dowel pin property "${property}"`);
7019
+ props[property] = parsed;
7020
+ }
7021
+ return dowelPinModelDefinitionSchema.parse(props);
7022
+ }
7023
+ var model16 = defineModel({
7024
+ name: "dowelpin",
7025
+ schema: dowelPinModelDefinitionSchema,
7026
+ parse: parseDowelPinModelParams
7027
+ });
7028
+ function register16(registry2) {
7029
+ registry2.register(model16);
7030
+ }
6875
7031
  var stringFlags6 = {
6876
7032
  plainclosed: "style(plainclosed)"
6877
7033
  };
@@ -6880,7 +7036,7 @@ var positiveLength2 = external_exports.union([
6880
7036
  external_exports.number(),
6881
7037
  external_exports.string().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i).transform((value) => value.toLowerCase())
6882
7038
  ]).pipe(modelLengthSchema).refine((value) => value > 0);
6883
- var shape12 = {
7039
+ var shape13 = {
6884
7040
  innerDiameter: positiveLength2,
6885
7041
  outerDiameter: positiveLength2,
6886
7042
  flangeDiameter: positiveLength2,
@@ -6889,7 +7045,7 @@ var shape12 = {
6889
7045
  flangeThickness: positiveLength2,
6890
7046
  style: external_exports.literal("plainclosed").default("plainclosed")
6891
7047
  };
6892
- function validate11(props, context) {
7048
+ function validate12(props, context) {
6893
7049
  if (props.outerDiameter <= props.innerDiameter)
6894
7050
  context.addIssue({
6895
7051
  code: "custom",
@@ -6909,8 +7065,8 @@ function validate11(props, context) {
6909
7065
  message: "Flange thickness must leave a positive projecting sleeve length"
6910
7066
  });
6911
7067
  }
6912
- var flangedBushingModelPropsSchema = external_exports.object(shape12).strict().superRefine(validate11);
6913
- var flangedBushingModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("flangedbushing"), ...shape12 }).strict().superRefine(validate11);
7068
+ var flangedBushingModelPropsSchema = external_exports.object(shape13).strict().superRefine(validate12);
7069
+ var flangedBushingModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("flangedbushing"), ...shape13 }).strict().superRefine(validate12);
6914
7070
  function getFlangedBushingDimensions(input) {
6915
7071
  const props = flangedBushingModelPropsSchema.parse(input);
6916
7072
  return {
@@ -6925,7 +7081,7 @@ function getFlangedBushingDimensions(input) {
6925
7081
  shoulderZ: props.flangeThickness
6926
7082
  };
6927
7083
  }
6928
- var lengths10 = {
7084
+ var lengths11 = {
6929
7085
  id: "innerDiameter",
6930
7086
  innerdiameter: "innerDiameter",
6931
7087
  od: "outerDiameter",
@@ -6950,8 +7106,8 @@ function parseFlangedBushingModelParams(raw) {
6950
7106
  const value = match[2];
6951
7107
  let property;
6952
7108
  let parsed;
6953
- if (Object.hasOwn(lengths10, name)) {
6954
- property = lengths10[name];
7109
+ if (Object.hasOwn(lengths11, name)) {
7110
+ property = lengths11[name];
6955
7111
  parsed = value;
6956
7112
  } else if (name === "style") {
6957
7113
  property = "style";
@@ -6967,7 +7123,7 @@ function parseFlangedBushingModelParams(raw) {
6967
7123
  }
6968
7124
  return flangedBushingModelDefinitionSchema.parse(props);
6969
7125
  }
6970
- var model16 = defineModel({
7126
+ var model17 = defineModel({
6971
7127
  name: "flangedbushing",
6972
7128
  schema: flangedBushingModelDefinitionSchema,
6973
7129
  parse: parseFlangedBushingModelParams,
@@ -6978,8 +7134,8 @@ var model16 = defineModel({
6978
7134
  omittedStringFlags6
6979
7135
  )
6980
7136
  });
6981
- function register16(registry2) {
6982
- registry2.register(model16);
7137
+ function register17(registry2) {
7138
+ registry2.register(model17);
6983
7139
  }
6984
7140
  var stringFlags7 = {
6985
7141
  hexsocket: "drive(hexsocket)",
@@ -7087,9 +7243,9 @@ var flatHeadScrewModelPropsShape = {
7087
7243
  threadPitchDiameter: positiveModelLengthSchema3.optional()
7088
7244
  };
7089
7245
  var validateFlatHeadScrew = (props, context) => {
7090
- const dimensions4 = flatHeadScrewDimensions[props.metricSize];
7091
- for (const key of Object.keys(dimensions4)) {
7092
- if (props[key] !== void 0 && Math.abs(props[key] - dimensions4[key]) > 1e-9) {
7246
+ const dimensions5 = flatHeadScrewDimensions[props.metricSize];
7247
+ for (const key of Object.keys(dimensions5)) {
7248
+ if (props[key] !== void 0 && Math.abs(props[key] - dimensions5[key]) > 1e-9) {
7093
7249
  context.addIssue({
7094
7250
  code: "custom",
7095
7251
  path: [key],
@@ -7097,21 +7253,21 @@ var validateFlatHeadScrew = (props, context) => {
7097
7253
  });
7098
7254
  }
7099
7255
  }
7100
- if (props.length <= dimensions4.tipChamfer) {
7256
+ if (props.length <= dimensions5.tipChamfer) {
7101
7257
  context.addIssue({
7102
7258
  code: "custom",
7103
7259
  path: ["length"],
7104
7260
  message: "Length must exceed the fixed tip chamfer"
7105
7261
  });
7106
7262
  }
7107
- if (props.length <= dimensions4.headHeight + dimensions4.underHeadRadius + dimensions4.tipChamfer) {
7263
+ if (props.length <= dimensions5.headHeight + dimensions5.underHeadRadius + dimensions5.tipChamfer) {
7108
7264
  context.addIssue({
7109
7265
  code: "custom",
7110
7266
  path: ["length"],
7111
7267
  message: "Overall length must leave a shank beyond the countersunk head, under-head fillet and tip chamfer"
7112
7268
  });
7113
7269
  }
7114
- if (props.length - dimensions4.headHeight > dimensions4.maximumThreadLength + 1e-9) {
7270
+ if (props.length - dimensions5.headHeight > dimensions5.maximumThreadLength + 1e-9) {
7115
7271
  context.addIssue({
7116
7272
  code: "custom",
7117
7273
  path: ["length"],
@@ -7222,7 +7378,7 @@ var parseFlatHeadScrewModelParams = (raw) => {
7222
7378
  ...props
7223
7379
  });
7224
7380
  };
7225
- var model17 = defineModel({
7381
+ var model18 = defineModel({
7226
7382
  name: "flatheadscrew",
7227
7383
  schema: flatHeadScrewModelDefinitionSchema,
7228
7384
  parse: parseFlatHeadScrewModelParams,
@@ -7233,8 +7389,143 @@ var model17 = defineModel({
7233
7389
  omittedStringFlags7
7234
7390
  )
7235
7391
  });
7236
- function register17(registry2) {
7237
- registry2.register(model17);
7392
+ function register18(registry2) {
7393
+ registry2.register(model18);
7394
+ }
7395
+ var positiveLength3 = external_exports.union([
7396
+ external_exports.number(),
7397
+ external_exports.string().regex(/^(?:\d+(?:\.\d+)?|\.\d+)(?:mm|cm|m|in|inch)?$/i).transform((value) => value.toLowerCase())
7398
+ ]).pipe(modelLengthSchema).refine((value) => value > 0, "Length must be positive");
7399
+ var heatSetInsertCoarsePitches = {
7400
+ M3: 0.5,
7401
+ M4: 0.7,
7402
+ M5: 0.8,
7403
+ M6: 1
7404
+ };
7405
+ var heatSetInsertMetricSizeSchema = external_exports.enum(["M3", "M4", "M5", "M6"]);
7406
+ var shape14 = {
7407
+ metricSize: heatSetInsertMetricSizeSchema,
7408
+ outerDiameter: positiveLength3,
7409
+ length: positiveLength3,
7410
+ knurlDepth: positiveLength3,
7411
+ knurlPitch: positiveLength3,
7412
+ knurlTeeth: external_exports.number().int().min(3).max(96),
7413
+ diamondKnurl: external_exports.literal(true).default(true),
7414
+ leftHand: external_exports.boolean().default(false),
7415
+ showThreads: external_exports.boolean().default(true),
7416
+ diameter: positiveLength3.optional(),
7417
+ threadPitch: positiveLength3.optional(),
7418
+ threadMinorDiameter: positiveLength3.optional(),
7419
+ threadPitchDiameter: positiveLength3.optional(),
7420
+ rootOuterDiameter: positiveLength3.optional()
7421
+ };
7422
+ function dimensions4(p) {
7423
+ const diameter = Number(p.metricSize.slice(1)), threadPitch = heatSetInsertCoarsePitches[p.metricSize];
7424
+ const H = Math.sqrt(3) * threadPitch / 2;
7425
+ return {
7426
+ diameter,
7427
+ threadPitch,
7428
+ threadMinorDiameter: diameter - 5 * H / 4,
7429
+ threadPitchDiameter: diameter - 3 * H / 4,
7430
+ rootOuterDiameter: p.outerDiameter - 2 * p.knurlDepth
7431
+ };
7432
+ }
7433
+ function validate13(p, context) {
7434
+ const d = dimensions4(p);
7435
+ for (const key of Object.keys(d))
7436
+ if (p[key] !== void 0 && Math.abs(p[key] - d[key]) > 1e-9)
7437
+ context.addIssue({
7438
+ code: "custom",
7439
+ path: [key],
7440
+ message: `Dimension ${key} conflicts with the metric size or knurl envelope`
7441
+ });
7442
+ if (d.rootOuterDiameter - d.diameter <= 1e-6)
7443
+ context.addIssue({
7444
+ code: "custom",
7445
+ path: ["knurlDepth"],
7446
+ message: "Knurl roots must leave more than 0.000001 mm diametral material outside the thread major diameter"
7447
+ });
7448
+ if (p.length / Math.min(p.knurlPitch, d.threadPitch) > 1e3)
7449
+ context.addIssue({
7450
+ code: "custom",
7451
+ path: ["length"],
7452
+ message: "Insert exceeds the 1000-repeat contract limit"
7453
+ });
7454
+ }
7455
+ var heatSetInsertModelPropsSchema = external_exports.object(shape14).strict().superRefine(validate13).transform((p) => ({ ...p, ...dimensions4(p) }));
7456
+ var heatSetInsertModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("heatsetinsert"), ...shape14 }).strict().superRefine(validate13).transform((p) => ({ ...p, ...dimensions4(p) }));
7457
+ var aliases3 = {
7458
+ m: "metricSize",
7459
+ metricsize: "metricSize",
7460
+ od: "outerDiameter",
7461
+ outerdiameter: "outerDiameter",
7462
+ l: "length",
7463
+ length: "length",
7464
+ knurldepth: "knurlDepth",
7465
+ knurlp: "knurlPitch",
7466
+ knurlpitch: "knurlPitch",
7467
+ knurlteeth: "knurlTeeth",
7468
+ diameter: "diameter",
7469
+ threadpitch: "threadPitch",
7470
+ threadminordiameter: "threadMinorDiameter",
7471
+ threadpitchdiameter: "threadPitchDiameter",
7472
+ rootouterdiameter: "rootOuterDiameter"
7473
+ };
7474
+ var flags2 = {
7475
+ diamondknurl: "diamondKnurl",
7476
+ lefthanded: "leftHand",
7477
+ righthanded: "leftHand",
7478
+ threads: "showThreads",
7479
+ nothreads: "showThreads"
7480
+ };
7481
+ function parseHeatSetInsertModelParams(raw) {
7482
+ if (raw.fn !== "heatsetinsert")
7483
+ throw new Error("Expected heatsetinsert params");
7484
+ const [root, ...tokens] = splitModelStringTokens(raw.string);
7485
+ if (root?.toLowerCase() !== "heatsetinsert")
7486
+ throw new Error("heatsetinsert does not accept an inline value");
7487
+ const props = {};
7488
+ for (const token of tokens) {
7489
+ const match = token.match(/^([a-z]+)(.*)$/i), key = match?.[1]?.toLowerCase() ?? "", value = match?.[2] ?? "";
7490
+ let property, parsed;
7491
+ if (flags2[key]) {
7492
+ if (value) throw new Error("Flags do not accept values");
7493
+ property = flags2[key];
7494
+ parsed = !["righthanded", "nothreads"].includes(key);
7495
+ } else {
7496
+ property = aliases3[key] ?? "";
7497
+ if (!property || !value)
7498
+ throw new Error(`Unknown or missing heatsetinsert token ${token}`);
7499
+ if (property === "metricSize") {
7500
+ const size = key === "m" ? value : value.match(/^\((m\d+)\)$/i)?.[1]?.slice(1);
7501
+ if (!size || !/^\d+$/.test(size)) throw new Error("Invalid metric size");
7502
+ parsed = `M${size}`;
7503
+ } else if (property === "knurlTeeth") {
7504
+ if (!/^\d+$/.test(value))
7505
+ throw new Error("knurlteeth requires a unitless integer");
7506
+ parsed = Number(value);
7507
+ } else {
7508
+ if (!/^(?:\d+(?:\.\d+)?|\.\d+)(?:mm|cm|m|in|inch)?$/i.test(value))
7509
+ throw new Error(`Invalid length ${token}`);
7510
+ parsed = value;
7511
+ }
7512
+ }
7513
+ if (property in props)
7514
+ throw new Error(`Property ${property} is set more than once`);
7515
+ props[property] = parsed;
7516
+ }
7517
+ return heatSetInsertModelDefinitionSchema.parse({
7518
+ fn: "heatsetinsert",
7519
+ ...props
7520
+ });
7521
+ }
7522
+ var model19 = defineModel({
7523
+ name: "heatsetinsert",
7524
+ schema: heatSetInsertModelDefinitionSchema,
7525
+ parse: parseHeatSetInsertModelParams
7526
+ });
7527
+ function register19(registry2) {
7528
+ registry2.register(model19);
7238
7529
  }
7239
7530
  var stringFlags8 = {
7240
7531
  righthanded: "threadhand(right)"
@@ -7469,15 +7760,15 @@ var hexNutImperialSizeSchema = external_exports.enum([
7469
7760
  "7/8",
7470
7761
  "1"
7471
7762
  ]);
7472
- var length7 = external_exports.union([
7763
+ var length8 = external_exports.union([
7473
7764
  external_exports.number(),
7474
7765
  external_exports.string().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i).transform((value) => value.toLowerCase())
7475
7766
  ]).pipe(modelLengthSchema).refine((value) => value > 0, "Length must be positive");
7476
- var shape13 = {
7767
+ var shape15 = {
7477
7768
  standard: external_exports.enum(["iso4032", "iso4032:2023", "din934", "asmeb18.2.2"]).optional(),
7478
7769
  metricSize: hexNutMetricSizeSchema.optional(),
7479
7770
  imperialSize: hexNutImperialSizeSchema.optional(),
7480
- threadPitch: length7.optional(),
7771
+ threadPitch: length8.optional(),
7481
7772
  threadHand: external_exports.literal("right").default("right"),
7482
7773
  threadClass: external_exports.enum(["6H", "2B"]).optional(),
7483
7774
  showThreads: external_exports.boolean().default(true)
@@ -7493,7 +7784,7 @@ function selectedDimensions(props) {
7493
7784
  if (!props.metricSize) return void 0;
7494
7785
  return standard === "din934" ? hexNutDinDimensions[props.metricSize] : hexNutDimensions[props.metricSize];
7495
7786
  }
7496
- function validate12(props, context) {
7787
+ function validate14(props, context) {
7497
7788
  const issue = (path, message) => context.addIssue({ code: "custom", path: [path], message });
7498
7789
  if (!!props.metricSize === !!props.imperialSize)
7499
7790
  issue("metricSize", "Select exactly one metric or imperial size");
@@ -7514,8 +7805,8 @@ function normalize3(props) {
7514
7805
  threadClass: props.threadClass ?? (selectedStandard(props) === "asmeb18.2.2" ? "2B" : "6H")
7515
7806
  };
7516
7807
  }
7517
- var hexNutModelPropsSchema = external_exports.object(shape13).strict().superRefine(validate12).transform(normalize3);
7518
- var hexNutModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("hexnut"), ...shape13 }).strict().superRefine(validate12).transform(normalize3);
7808
+ var hexNutModelPropsSchema = external_exports.object(shape15).strict().superRefine(validate14).transform(normalize3);
7809
+ var hexNutModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("hexnut"), ...shape15 }).strict().superRefine(validate14).transform(normalize3);
7519
7810
  function getHexNutDimensions(input) {
7520
7811
  const props = hexNutModelPropsSchema.parse(input);
7521
7812
  const dims = selectedDimensions(props);
@@ -7590,7 +7881,7 @@ function parseHexNutModelParams(raw) {
7590
7881
  }
7591
7882
  return hexNutModelDefinitionSchema.parse(props);
7592
7883
  }
7593
- var model18 = defineModel({
7884
+ var model20 = defineModel({
7594
7885
  name: "hexnut",
7595
7886
  schema: hexNutModelDefinitionSchema,
7596
7887
  parse: parseHexNutModelParams,
@@ -7601,19 +7892,19 @@ var model18 = defineModel({
7601
7892
  omittedStringFlags8
7602
7893
  )
7603
7894
  });
7604
- function register18(registry2) {
7605
- registry2.register(model18);
7895
+ function register20(registry2) {
7896
+ registry2.register(model20);
7606
7897
  }
7607
- var length8 = external_exports.union([
7898
+ var length9 = external_exports.union([
7608
7899
  external_exports.number(),
7609
7900
  external_exports.string().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i).transform((value) => value.toLowerCase())
7610
7901
  ]).pipe(modelLengthSchema);
7611
- var positive4 = length8.refine((value) => value > 0, "Length must be positive");
7612
- var nonnegative3 = length8.refine(
7902
+ var positive4 = length9.refine((value) => value > 0, "Length must be positive");
7903
+ var nonnegative3 = length9.refine(
7613
7904
  (value) => value >= 0,
7614
7905
  "Length cannot be negative"
7615
7906
  );
7616
- var shape14 = {
7907
+ var shape16 = {
7617
7908
  /** Diameter at the rib crests. All lengths normalize to millimeters. */
7618
7909
  outerDiameter: positive4.default(6),
7619
7910
  innerDiameter: positive4.default(4),
@@ -7627,7 +7918,7 @@ var shape14 = {
7627
7918
  /** Radial distance from crest to root; zero produces a smooth tube. */
7628
7919
  ribDepth: nonnegative3.default(0.25)
7629
7920
  };
7630
- function validate13(props, context) {
7921
+ function validate15(props, context) {
7631
7922
  if (props.outerDiameter - 2 * props.ribDepth <= props.innerDiameter)
7632
7923
  context.addIssue({
7633
7924
  code: "custom",
@@ -7647,8 +7938,8 @@ function validate13(props, context) {
7647
7938
  message: "Centerline length must be finite and positive"
7648
7939
  });
7649
7940
  }
7650
- var hollowPositioningArmTubeModelPropsSchema = external_exports.object(shape14).strict().superRefine(validate13);
7651
- var hollowPositioningArmTubeModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("hollowpositioningarmtube"), ...shape14 }).strict().superRefine(validate13);
7941
+ var hollowPositioningArmTubeModelPropsSchema = external_exports.object(shape16).strict().superRefine(validate15);
7942
+ var hollowPositioningArmTubeModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("hollowpositioningarmtube"), ...shape16 }).strict().superRefine(validate15);
7652
7943
  function getHollowPositioningArmTubeDimensions(input) {
7653
7944
  const props = hollowPositioningArmTubeModelPropsSchema.parse(input);
7654
7945
  const bendLength = props.bendRadius * (props.bendAngle * Math.PI / 180);
@@ -7679,7 +7970,7 @@ function getHollowPositioningArmTubeFrame(input, s) {
7679
7970
  const normal = [cosine, 0, -sine];
7680
7971
  return { position, tangent, normal };
7681
7972
  }
7682
- var lengths11 = {
7973
+ var lengths12 = {
7683
7974
  od: "outerDiameter",
7684
7975
  id: "innerDiameter",
7685
7976
  start: "startLength",
@@ -7701,7 +7992,7 @@ function parseHollowPositioningArmTubeModelParams(raw) {
7701
7992
  throw new Error(`Invalid hollowpositioningarmtube token "${token}"`);
7702
7993
  let property;
7703
7994
  let parsed = value;
7704
- if (name in lengths11) property = lengths11[name];
7995
+ if (name in lengths12) property = lengths12[name];
7705
7996
  else if (name === "angle") {
7706
7997
  property = "bendAngle";
7707
7998
  if (!/^[+]?(?:\d+(?:\.\d*)?|\.\d+)$/.test(value))
@@ -7718,13 +8009,13 @@ function parseHollowPositioningArmTubeModelParams(raw) {
7718
8009
  }
7719
8010
  return hollowPositioningArmTubeModelDefinitionSchema.parse(props);
7720
8011
  }
7721
- var model19 = defineModel({
8012
+ var model21 = defineModel({
7722
8013
  name: "hollowpositioningarmtube",
7723
8014
  schema: hollowPositioningArmTubeModelDefinitionSchema,
7724
8015
  parse: parseHollowPositioningArmTubeModelParams
7725
8016
  });
7726
- function register19(registry2) {
7727
- registry2.register(model19);
8017
+ function register21(registry2) {
8018
+ registry2.register(model21);
7728
8019
  }
7729
8020
  var stringFlags9 = {
7730
8021
  phillips: "drive(phillips)",
@@ -7894,9 +8185,9 @@ var panScrewModelPropsShape = {
7894
8185
  recessReferencePlaneHeight: positiveModelLengthSchema4.optional()
7895
8186
  };
7896
8187
  var validatePanScrew = (props, context) => {
7897
- const dimensions4 = panScrewDimensions[props.metricSize];
7898
- for (const key of Object.keys(dimensions4)) {
7899
- if (props[key] !== void 0 && Math.abs(props[key] - dimensions4[key]) > 1e-9) {
8188
+ const dimensions5 = panScrewDimensions[props.metricSize];
8189
+ for (const key of Object.keys(dimensions5)) {
8190
+ if (props[key] !== void 0 && Math.abs(props[key] - dimensions5[key]) > 1e-9) {
7900
8191
  context.addIssue({
7901
8192
  code: "custom",
7902
8193
  path: [key],
@@ -7904,14 +8195,14 @@ var validatePanScrew = (props, context) => {
7904
8195
  });
7905
8196
  }
7906
8197
  }
7907
- if (props.length <= dimensions4.underHeadRadius + dimensions4.tipChamfer) {
8198
+ if (props.length <= dimensions5.underHeadRadius + dimensions5.tipChamfer) {
7908
8199
  context.addIssue({
7909
8200
  code: "custom",
7910
8201
  path: ["length"],
7911
8202
  message: "Length must separate the under-head fillet and fixed tip chamfer"
7912
8203
  });
7913
8204
  }
7914
- if (props.length > dimensions4.maximumThreadLength + 1e-9) {
8205
+ if (props.length > dimensions5.maximumThreadLength + 1e-9) {
7915
8206
  context.addIssue({
7916
8207
  code: "custom",
7917
8208
  path: ["length"],
@@ -7924,7 +8215,7 @@ var panScrewModelDefinitionSchema = external_exports.object({
7924
8215
  fn: external_exports.literal("panscrew"),
7925
8216
  ...panScrewModelPropsShape
7926
8217
  }).strict().superRefine(validatePanScrew).transform((props) => ({ ...props, ...panScrewDimensions[props.metricSize] }));
7927
- var aliases3 = {
8218
+ var aliases4 = {
7928
8219
  m: "metricSize",
7929
8220
  metricsize: "metricSize",
7930
8221
  l: "length",
@@ -7994,7 +8285,7 @@ var parsePanScrewModelParams = (raw) => {
7994
8285
  property = "showThreads";
7995
8286
  parsed = key === "threads";
7996
8287
  } else {
7997
- property = key ? aliases3[key] ?? "" : "";
8288
+ property = key ? aliases4[key] ?? "" : "";
7998
8289
  if (!property || !value)
7999
8290
  throw new Error(`Unknown or missing panscrew token "${token}"`);
8000
8291
  if (selectors3.has(property)) {
@@ -8027,7 +8318,7 @@ var parsePanScrewModelParams = (raw) => {
8027
8318
  }
8028
8319
  return panScrewModelDefinitionSchema.parse({ fn: "panscrew", ...props });
8029
8320
  };
8030
- var model20 = defineModel({
8321
+ var model22 = defineModel({
8031
8322
  name: "panscrew",
8032
8323
  schema: panScrewModelDefinitionSchema,
8033
8324
  parse: parsePanScrewModelParams,
@@ -8038,28 +8329,28 @@ var model20 = defineModel({
8038
8329
  omittedStringFlags9
8039
8330
  )
8040
8331
  });
8041
- function register20(registry2) {
8042
- registry2.register(model20);
8332
+ function register22(registry2) {
8333
+ registry2.register(model22);
8043
8334
  }
8044
8335
  var stringFlags10 = {
8045
8336
  plainclosed: "style(plainclosed)"
8046
8337
  };
8047
8338
  var omittedStringFlags10 = ["plainclosed"];
8048
- var length9 = external_exports.union([
8339
+ var length10 = external_exports.union([
8049
8340
  external_exports.number(),
8050
8341
  external_exports.string().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i).transform((value) => value.toLowerCase())
8051
8342
  ]).pipe(modelLengthSchema);
8052
- var positiveLength3 = length9.refine((value) => value > 0);
8053
- var shape15 = {
8054
- innerDiameter: positiveLength3,
8055
- outerDiameter: positiveLength3,
8343
+ var positiveLength4 = length10.refine((value) => value > 0);
8344
+ var shape17 = {
8345
+ innerDiameter: positiveLength4,
8346
+ outerDiameter: positiveLength4,
8056
8347
  /** Overall end-plane distance, including the chamfers. */
8057
- length: positiveLength3,
8348
+ length: positiveLength4,
8058
8349
  style: external_exports.literal("plainclosed").default("plainclosed"),
8059
8350
  /** Equal axial/radial setbacks of all four 45-degree bore/outside rim chamfers. */
8060
- edgeChamfer: length9.refine((value) => value >= 0).default(0)
8351
+ edgeChamfer: length10.refine((value) => value >= 0).default(0)
8061
8352
  };
8062
- function validate14(props, context) {
8353
+ function validate16(props, context) {
8063
8354
  if (props.outerDiameter <= props.innerDiameter)
8064
8355
  context.addIssue({
8065
8356
  code: "custom",
@@ -8079,8 +8370,8 @@ function validate14(props, context) {
8079
8370
  message: "The two end chamfers must leave positive straight bore length"
8080
8371
  });
8081
8372
  }
8082
- var plainBushingModelPropsSchema = external_exports.object(shape15).strict().superRefine(validate14);
8083
- var plainBushingModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("plainbushing"), ...shape15 }).strict().superRefine(validate14);
8373
+ var plainBushingModelPropsSchema = external_exports.object(shape17).strict().superRefine(validate16);
8374
+ var plainBushingModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("plainbushing"), ...shape17 }).strict().superRefine(validate16);
8084
8375
  function getPlainBushingDimensions(input) {
8085
8376
  const props = plainBushingModelPropsSchema.parse(input);
8086
8377
  return {
@@ -8093,7 +8384,7 @@ function getPlainBushingDimensions(input) {
8093
8384
  straightLength: props.length - 2 * props.edgeChamfer
8094
8385
  };
8095
8386
  }
8096
- var lengths12 = {
8387
+ var lengths13 = {
8097
8388
  id: "innerDiameter",
8098
8389
  innerdiameter: "innerDiameter",
8099
8390
  od: "outerDiameter",
@@ -8116,8 +8407,8 @@ function parsePlainBushingModelParams(raw) {
8116
8407
  const value = match[2];
8117
8408
  let property;
8118
8409
  let parsed;
8119
- if (Object.hasOwn(lengths12, name)) {
8120
- property = lengths12[name];
8410
+ if (Object.hasOwn(lengths13, name)) {
8411
+ property = lengths13[name];
8121
8412
  parsed = value;
8122
8413
  } else if (name === "style") {
8123
8414
  property = "style";
@@ -8133,7 +8424,7 @@ function parsePlainBushingModelParams(raw) {
8133
8424
  }
8134
8425
  return plainBushingModelDefinitionSchema.parse(props);
8135
8426
  }
8136
- var model21 = defineModel({
8427
+ var model23 = defineModel({
8137
8428
  name: "plainbushing",
8138
8429
  schema: plainBushingModelDefinitionSchema,
8139
8430
  parse: parsePlainBushingModelParams,
@@ -8144,8 +8435,8 @@ var model21 = defineModel({
8144
8435
  omittedStringFlags10
8145
8436
  )
8146
8437
  });
8147
- function register21(registry2) {
8148
- registry2.register(model21);
8438
+ function register23(registry2) {
8439
+ registry2.register(model23);
8149
8440
  }
8150
8441
  var stringFlags11 = {
8151
8442
  setscrew: "mount(setscrew)",
@@ -8153,19 +8444,19 @@ var stringFlags11 = {
8153
8444
  righthanded: "threadhand(right)"
8154
8445
  };
8155
8446
  var omittedStringFlags11 = ["righthanded"];
8156
- var length10 = external_exports.union([
8447
+ var length11 = external_exports.union([
8157
8448
  external_exports.number().finite(),
8158
8449
  external_exports.string().regex(
8159
8450
  /^[+]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i,
8160
8451
  "Expected a complete length with a supported unit"
8161
8452
  ).transform((value) => value.toLowerCase())
8162
8453
  ]).pipe(modelLengthSchema);
8163
- var positive5 = length10.refine((value) => value > 0, "Length must be positive");
8164
- var nonnegative4 = length10.refine(
8454
+ var positive5 = length11.refine((value) => value > 0, "Length must be positive");
8455
+ var nonnegative4 = length11.refine(
8165
8456
  (value) => value >= 0,
8166
8457
  "Length cannot be negative"
8167
8458
  );
8168
- var shape16 = {
8459
+ var shape18 = {
8169
8460
  boreDiameter: positive5,
8170
8461
  outerDiameter: positive5,
8171
8462
  boreBDiameter: positive5.optional(),
@@ -8180,7 +8471,7 @@ var shape16 = {
8180
8471
  threadClass: external_exports.literal("6H").default("6H"),
8181
8472
  chamfer: nonnegative4.default(0)
8182
8473
  };
8183
- function resolve4(props) {
8474
+ function resolve5(props) {
8184
8475
  const threadPitch = props.threadPitch ?? hexSocketBoltDimensions[props.metricSize].threadPitch;
8185
8476
  return {
8186
8477
  ...props,
@@ -8190,8 +8481,8 @@ function resolve4(props) {
8190
8481
  screwAngle: (props.screwAngle % 360 + 360) % 360
8191
8482
  };
8192
8483
  }
8193
- function validate15(props, context) {
8194
- const p = resolve4(props);
8484
+ function validate17(props, context) {
8485
+ const p = resolve5(props);
8195
8486
  const issue = (message) => context.addIssue({ code: "custom", message });
8196
8487
  const diameter = hexSocketBoltDimensions[p.metricSize].diameter;
8197
8488
  if (!Number.isFinite(p.outerDiameter ** 2))
@@ -8214,8 +8505,8 @@ function validate15(props, context) {
8214
8505
  if (p.length - 2 * p.screwEndOffset <= diameter)
8215
8506
  issue("Each end must have a separate, nonintersecting screw-hole plane");
8216
8507
  }
8217
- var rigidCouplerModelPropsSchema = external_exports.object(shape16).strict().superRefine(validate15).transform(resolve4);
8218
- var rigidCouplerModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("rigidcoupler"), ...shape16 }).strict().superRefine(validate15).transform((props) => ({ fn: props.fn, ...resolve4(props) }));
8508
+ var rigidCouplerModelPropsSchema = external_exports.object(shape18).strict().superRefine(validate17).transform(resolve5);
8509
+ var rigidCouplerModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("rigidcoupler"), ...shape18 }).strict().superRefine(validate17).transform((props) => ({ fn: props.fn, ...resolve5(props) }));
8219
8510
  function getRigidCouplerDimensions(input) {
8220
8511
  const p = rigidCouplerModelPropsSchema.parse(input);
8221
8512
  const threadDiameter = hexSocketBoltDimensions[p.metricSize].diameter;
@@ -8315,7 +8606,7 @@ function parseRigidCouplerModelParams(raw) {
8315
8606
  ...props
8316
8607
  });
8317
8608
  }
8318
- var model22 = defineModel({
8609
+ var model24 = defineModel({
8319
8610
  name: "rigidcoupler",
8320
8611
  schema: rigidCouplerModelDefinitionSchema,
8321
8612
  parse: parseRigidCouplerModelParams,
@@ -8326,8 +8617,8 @@ var model22 = defineModel({
8326
8617
  omittedStringFlags11
8327
8618
  )
8328
8619
  });
8329
- function register22(registry2) {
8330
- registry2.register(model22);
8620
+ function register24(registry2) {
8621
+ registry2.register(model24);
8331
8622
  }
8332
8623
  var stringFlags12 = {
8333
8624
  setscrew: "mount(setscrew)",
@@ -8335,19 +8626,19 @@ var stringFlags12 = {
8335
8626
  righthanded: "threadhand(right)"
8336
8627
  };
8337
8628
  var omittedStringFlags12 = ["righthanded"];
8338
- var length11 = external_exports.union([
8629
+ var length12 = external_exports.union([
8339
8630
  external_exports.number().finite(),
8340
8631
  external_exports.string().regex(
8341
8632
  /^[+]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i,
8342
8633
  "Expected a complete length with a supported unit"
8343
8634
  ).transform((value) => value.toLowerCase())
8344
8635
  ]).pipe(modelLengthSchema);
8345
- var positive6 = length11.refine((value) => value > 0, "Length must be positive");
8346
- var nonnegative5 = length11.refine(
8636
+ var positive6 = length12.refine((value) => value > 0, "Length must be positive");
8637
+ var nonnegative5 = length12.refine(
8347
8638
  (value) => value >= 0,
8348
8639
  "Length cannot be negative"
8349
8640
  );
8350
- var shape17 = {
8641
+ var shape19 = {
8351
8642
  boreDiameter: positive6,
8352
8643
  outerDiameter: positive6,
8353
8644
  width: positive6,
@@ -8360,7 +8651,7 @@ var shape17 = {
8360
8651
  threadClass: external_exports.literal("6H").default("6H"),
8361
8652
  chamfer: nonnegative5.default(0)
8362
8653
  };
8363
- function resolve5(props) {
8654
+ function resolve6(props) {
8364
8655
  const threadPitch = props.threadPitch ?? hexSocketBoltDimensions[props.metricSize].threadPitch;
8365
8656
  return {
8366
8657
  ...props,
@@ -8369,8 +8660,8 @@ function resolve5(props) {
8369
8660
  screwAngle: (props.screwAngle % 360 + 360) % 360
8370
8661
  };
8371
8662
  }
8372
- function validate16(props, context) {
8373
- const p = resolve5(props);
8663
+ function validate18(props, context) {
8664
+ const p = resolve6(props);
8374
8665
  const issue = (message) => context.addIssue({ code: "custom", message });
8375
8666
  const diameter = hexSocketBoltDimensions[p.metricSize].diameter;
8376
8667
  if (!Number.isFinite(p.outerDiameter ** 2))
@@ -8386,8 +8677,8 @@ function validate16(props, context) {
8386
8677
  if (p.screwZ - diameter / 2 <= p.chamfer || p.screwZ + diameter / 2 >= p.width - p.chamfer)
8387
8678
  issue("Screw hole must clear both end faces and chamfers");
8388
8679
  }
8389
- var shaftCollarModelPropsSchema = external_exports.object(shape17).strict().superRefine(validate16).transform(resolve5);
8390
- var shaftCollarModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("shaftcollar"), ...shape17 }).strict().superRefine(validate16).transform((props) => ({ fn: props.fn, ...resolve5(props) }));
8680
+ var shaftCollarModelPropsSchema = external_exports.object(shape19).strict().superRefine(validate18).transform(resolve6);
8681
+ var shaftCollarModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("shaftcollar"), ...shape19 }).strict().superRefine(validate18).transform((props) => ({ fn: props.fn, ...resolve6(props) }));
8391
8682
  function getShaftCollarDimensions(input) {
8392
8683
  const p = shaftCollarModelPropsSchema.parse(input);
8393
8684
  const threadDiameter = hexSocketBoltDimensions[p.metricSize].diameter;
@@ -8461,7 +8752,7 @@ function parseShaftCollarModelParams(raw) {
8461
8752
  }
8462
8753
  return shaftCollarModelDefinitionSchema.parse({ fn: "shaftcollar", ...props });
8463
8754
  }
8464
- var model23 = defineModel({
8755
+ var model25 = defineModel({
8465
8756
  name: "shaftcollar",
8466
8757
  schema: shaftCollarModelDefinitionSchema,
8467
8758
  parse: parseShaftCollarModelParams,
@@ -8472,29 +8763,29 @@ var model23 = defineModel({
8472
8763
  omittedStringFlags12
8473
8764
  )
8474
8765
  });
8475
- function register23(registry2) {
8476
- registry2.register(model23);
8766
+ function register25(registry2) {
8767
+ registry2.register(model25);
8477
8768
  }
8478
- var length12 = external_exports.union([
8769
+ var length13 = external_exports.union([
8479
8770
  external_exports.number(),
8480
8771
  external_exports.string().regex(/^(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i)
8481
8772
  ]).pipe(modelLengthSchema);
8482
- var positiveLength4 = length12.refine(
8773
+ var positiveLength5 = length13.refine(
8483
8774
  (value) => value > 0,
8484
8775
  "Length must be positive"
8485
8776
  );
8486
- var shape18 = {
8487
- innerDiameter: positiveLength4,
8488
- outerDiameter: positiveLength4,
8777
+ var shape20 = {
8778
+ innerDiameter: positiveLength5,
8779
+ outerDiameter: positiveLength5,
8489
8780
  /** Axial thickness of the rectangular radial/vertical section. */
8490
- thickness: positiveLength4,
8781
+ thickness: positiveLength5,
8491
8782
  /** End-to-end axial displacement, independent of section thickness. */
8492
- rise: length12.refine((value) => value >= 0, "Rise cannot be negative"),
8783
+ rise: length13.refine((value) => value >= 0, "Rise cannot be negative"),
8493
8784
  gapAngle: external_exports.number().finite().gt(0).lt(360),
8494
8785
  rectangular: external_exports.literal(true).default(true),
8495
8786
  leftHanded: external_exports.boolean().default(false)
8496
8787
  };
8497
- function validate17(p, context) {
8788
+ function validate19(p, context) {
8498
8789
  if (p.innerDiameter >= p.outerDiameter)
8499
8790
  context.addIssue({
8500
8791
  code: "custom",
@@ -8507,9 +8798,9 @@ function validate17(p, context) {
8507
8798
  message: "The washer envelope and volume must remain finite"
8508
8799
  });
8509
8800
  }
8510
- var splitWasherModelPropsSchema = external_exports.object(shape18).strict().superRefine(validate17);
8511
- var splitWasherModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("splitwasher"), ...shape18 }).strict().superRefine(validate17);
8512
- var lengths13 = {
8801
+ var splitWasherModelPropsSchema = external_exports.object(shape20).strict().superRefine(validate19);
8802
+ var splitWasherModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("splitwasher"), ...shape20 }).strict().superRefine(validate19);
8803
+ var lengths14 = {
8513
8804
  id: "innerDiameter",
8514
8805
  innerdiameter: "innerDiameter",
8515
8806
  od: "outerDiameter",
@@ -8537,8 +8828,8 @@ function parseSplitWasherModelParams(raw) {
8537
8828
  const name = match?.[1]?.toLowerCase(), suffix = match?.[2];
8538
8829
  if (!name || !suffix)
8539
8830
  throw new Error(`Invalid split washer token "${token}"`);
8540
- if (Object.hasOwn(lengths13, name)) {
8541
- property = lengths13[name];
8831
+ if (Object.hasOwn(lengths14, name)) {
8832
+ property = lengths14[name];
8542
8833
  value = suffix;
8543
8834
  } else if (name === "gapangle") {
8544
8835
  const angle = suffix.match(/^(\d+(?:\.\d*)?|\.\d+)(?:deg)?$/i);
@@ -8553,20 +8844,20 @@ function parseSplitWasherModelParams(raw) {
8553
8844
  }
8554
8845
  return splitWasherModelDefinitionSchema.parse(props);
8555
8846
  }
8556
- var model24 = defineModel({
8847
+ var model26 = defineModel({
8557
8848
  name: "splitwasher",
8558
8849
  schema: splitWasherModelDefinitionSchema,
8559
8850
  parse: parseSplitWasherModelParams
8560
8851
  });
8561
- function register24(registry2) {
8562
- registry2.register(model24);
8852
+ function register26(registry2) {
8853
+ registry2.register(model26);
8563
8854
  }
8564
- var length13 = external_exports.union([
8855
+ var length14 = external_exports.union([
8565
8856
  external_exports.number(),
8566
8857
  external_exports.string().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i).transform((value) => value.toLowerCase())
8567
8858
  ]).pipe(modelLengthSchema);
8568
- var positiveLength5 = length13.refine((value) => value > 0);
8569
- var nonnegativeLength = length13.refine((value) => value >= 0);
8859
+ var positiveLength6 = length14.refine((value) => value > 0);
8860
+ var nonnegativeLength = length14.refine((value) => value >= 0);
8570
8861
  var threadedRodCoarsePitches = {
8571
8862
  M2: 0.4,
8572
8863
  "M2.5": 0.45,
@@ -8593,24 +8884,24 @@ var threadedRodMetricSizeSchema = external_exports.enum([
8593
8884
  "M16",
8594
8885
  "M20"
8595
8886
  ]);
8596
- var shape19 = {
8887
+ var shape21 = {
8597
8888
  metricSize: threadedRodMetricSizeSchema,
8598
8889
  /** Overall end-plane distance, including terminal chamfers. */
8599
- length: positiveLength5,
8890
+ length: positiveLength6,
8600
8891
  /** Equal axial and radial setbacks of the two 45-degree outer chamfers. */
8601
8892
  chamfer: nonnegativeLength.default(0),
8602
- threadPitch: positiveLength5.optional(),
8893
+ threadPitch: positiveLength6.optional(),
8603
8894
  leftHand: external_exports.boolean().default(false)
8604
8895
  };
8605
- function resolve6(props) {
8896
+ function resolve7(props) {
8606
8897
  return {
8607
8898
  ...props,
8608
8899
  threadPitch: props.threadPitch ?? threadedRodCoarsePitches[props.metricSize]
8609
8900
  };
8610
8901
  }
8611
- function validate18(props, context) {
8902
+ function validate20(props, context) {
8612
8903
  const diameter = Number(props.metricSize.slice(1));
8613
- const pitch = resolve6(props).threadPitch;
8904
+ const pitch = resolve7(props).threadPitch;
8614
8905
  if (diameter - 1.226869 * pitch <= 0)
8615
8906
  context.addIssue({
8616
8907
  code: "custom",
@@ -8624,8 +8915,8 @@ function validate18(props, context) {
8624
8915
  message: "Chamfer must leave flat end faces and separate end chamfers"
8625
8916
  });
8626
8917
  }
8627
- var threadedRodModelPropsSchema = external_exports.object(shape19).strict().superRefine(validate18).transform(resolve6);
8628
- var threadedRodModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("threadedrod"), ...shape19 }).strict().superRefine(validate18).transform((model302) => ({ fn: model302.fn, ...resolve6(model302) }));
8918
+ var threadedRodModelPropsSchema = external_exports.object(shape21).strict().superRefine(validate20).transform(resolve7);
8919
+ var threadedRodModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("threadedrod"), ...shape21 }).strict().superRefine(validate20).transform((model322) => ({ fn: model322.fn, ...resolve7(model322) }));
8629
8920
  function getThreadedRodDimensions(input) {
8630
8921
  const props = threadedRodModelPropsSchema.parse(input);
8631
8922
  const diameter = Number(props.metricSize.slice(1));
@@ -8638,7 +8929,7 @@ function getThreadedRodDimensions(input) {
8638
8929
  endDiameter: diameter - 2 * props.chamfer
8639
8930
  };
8640
8931
  }
8641
- var lengths14 = {
8932
+ var lengths15 = {
8642
8933
  l: "length",
8643
8934
  length: "length",
8644
8935
  chamfer: "chamfer",
@@ -8670,8 +8961,8 @@ function parseThreadedRodModelParams(raw) {
8670
8961
  if (!/^\d+(?:\.\d+)?$/.test(value))
8671
8962
  throw new Error("Metric size must be a unitless diameter");
8672
8963
  parsed = `M${value}`;
8673
- } else if (Object.hasOwn(lengths14, name)) {
8674
- property = lengths14[name];
8964
+ } else if (Object.hasOwn(lengths15, name)) {
8965
+ property = lengths15[name];
8675
8966
  parsed = value;
8676
8967
  } else throw new Error(`Unknown threaded rod token "${token}"`);
8677
8968
  if (seen.has(property))
@@ -8693,21 +8984,21 @@ function normalizeThreadedRodModelString(value) {
8693
8984
  return [lower === "lefthanded" ? lower : token];
8694
8985
  }).join("_");
8695
8986
  }
8696
- var model25 = defineModel({
8987
+ var model27 = defineModel({
8697
8988
  name: "threadedrod",
8698
8989
  schema: threadedRodModelDefinitionSchema,
8699
8990
  parse: parseThreadedRodModelParams,
8700
8991
  normalizeString: normalizeThreadedRodModelString
8701
8992
  });
8702
- function register25(registry2) {
8703
- registry2.register(model25);
8993
+ function register27(registry2) {
8994
+ registry2.register(model27);
8704
8995
  }
8705
- var length14 = external_exports.union([
8996
+ var length15 = external_exports.union([
8706
8997
  external_exports.number(),
8707
8998
  external_exports.string().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i).transform((value) => value.toLowerCase())
8708
8999
  ]).pipe(modelLengthSchema);
8709
- var positive7 = length14.refine((value) => value > 0, "Length must be positive");
8710
- var shape20 = {
9000
+ var positive7 = length15.refine((value) => value > 0, "Length must be positive");
9001
+ var shape22 = {
8711
9002
  outerDiameter: positive7.default(8),
8712
9003
  wireDiameter: positive7.default(0.8),
8713
9004
  /** Fractional turns set the relative leg direction. */
@@ -8721,7 +9012,7 @@ var shape20 = {
8721
9012
  function normalize4(p) {
8722
9013
  return { ...p, pitch: p.pitch ?? p.wireDiameter * 1.25 };
8723
9014
  }
8724
- function validate19(p, context) {
9015
+ function validate21(p, context) {
8725
9016
  if (p.outerDiameter < 3 * p.wireDiameter)
8726
9017
  context.addIssue({
8727
9018
  code: "custom",
@@ -8743,8 +9034,8 @@ function validate19(p, context) {
8743
9034
  message: "Spring dimensions must remain finite"
8744
9035
  });
8745
9036
  }
8746
- var torsionSpringModelPropsSchema = external_exports.object(shape20).strict().superRefine(validate19).transform(normalize4);
8747
- var torsionSpringModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("torsionspring"), ...shape20 }).strict().superRefine(validate19).transform((p) => ({ ...normalize4(p), fn: p.fn }));
9037
+ var torsionSpringModelPropsSchema = external_exports.object(shape22).strict().superRefine(validate21).transform(normalize4);
9038
+ var torsionSpringModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("torsionspring"), ...shape22 }).strict().superRefine(validate21).transform((p) => ({ ...normalize4(p), fn: p.fn }));
8748
9039
  function getTorsionSpringDimensions(input) {
8749
9040
  const p = torsionSpringModelPropsSchema.parse(input);
8750
9041
  const meanRadius = (p.outerDiameter - p.wireDiameter) / 2;
@@ -8791,7 +9082,7 @@ function getTorsionSpringFrame(input, distance2) {
8791
9082
  ];
8792
9083
  return { position, tangent, normal, binormal };
8793
9084
  }
8794
- var lengths15 = {
9085
+ var lengths16 = {
8795
9086
  od: "outerDiameter",
8796
9087
  wire: "wireDiameter",
8797
9088
  pitch: "pitch",
@@ -8816,7 +9107,7 @@ function parseTorsionSpringModelParams(raw) {
8816
9107
  if (!name || !value)
8817
9108
  throw new Error(`Invalid torsion spring token "${token}"`);
8818
9109
  let property, parsed = value;
8819
- if (name in lengths15) property = lengths15[name];
9110
+ if (name in lengths16) property = lengths16[name];
8820
9111
  else if (name === "turns") {
8821
9112
  property = "turns";
8822
9113
  if (!/^[+]?(?:\d+(?:\.\d*)?|\.\d+)$/.test(value))
@@ -8829,19 +9120,19 @@ function parseTorsionSpringModelParams(raw) {
8829
9120
  }
8830
9121
  return torsionSpringModelDefinitionSchema.parse(props);
8831
9122
  }
8832
- var model26 = defineModel({
9123
+ var model28 = defineModel({
8833
9124
  name: "torsionspring",
8834
9125
  schema: torsionSpringModelDefinitionSchema,
8835
9126
  parse: parseTorsionSpringModelParams
8836
9127
  });
8837
- function register26(registry2) {
8838
- registry2.register(model26);
9128
+ function register28(registry2) {
9129
+ registry2.register(model28);
8839
9130
  }
8840
9131
  var stringFlags13 = {
8841
9132
  fourtsolid: "profile(fourtsolid)"
8842
9133
  };
8843
9134
  var omittedStringFlags13 = [];
8844
- var shape21 = {
9135
+ var shape23 = {
8845
9136
  width: positiveGearLengthSchema.default(20),
8846
9137
  height: positiveGearLengthSchema.default(20),
8847
9138
  length: positiveGearLengthSchema.default(100),
@@ -8854,7 +9145,7 @@ var shape21 = {
8854
9145
  boreDiameter: nonnegativeGearLengthSchema.default(0),
8855
9146
  cornerRadius: nonnegativeGearLengthSchema.default(0)
8856
9147
  };
8857
- function validate20(props, context) {
9148
+ function validate22(props, context) {
8858
9149
  const issue = (message, path) => context.addIssue({ code: "custom", message, path: [path] });
8859
9150
  const halfSize = Math.min(props.width, props.height) / 2;
8860
9151
  const depth = props.lipThickness + props.pocketDepth;
@@ -8882,9 +9173,9 @@ function validate20(props, context) {
8882
9173
  "boreDiameter"
8883
9174
  );
8884
9175
  }
8885
- var tSlotExtrusionModelPropsSchema = external_exports.object(shape21).strict().superRefine(validate20);
8886
- var tSlotExtrusionModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("tslotextrusion"), ...shape21 }).strict().superRefine(validate20);
8887
- var lengths16 = {
9176
+ var tSlotExtrusionModelPropsSchema = external_exports.object(shape23).strict().superRefine(validate22);
9177
+ var tSlotExtrusionModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("tslotextrusion"), ...shape23 }).strict().superRefine(validate22);
9178
+ var lengths17 = {
8888
9179
  w: "width",
8889
9180
  width: "width",
8890
9181
  h: "height",
@@ -8915,7 +9206,7 @@ function parseTSlotExtrusionModelParams(raw) {
8915
9206
  const [name, value] = parseGearToken(token);
8916
9207
  let property;
8917
9208
  let parsed = value;
8918
- if (name in lengths16) property = lengths16[name];
9209
+ if (name in lengths17) property = lengths17[name];
8919
9210
  else if (name === "profile") {
8920
9211
  property = "profile";
8921
9212
  const match = value.match(/^\(([a-z]+)\)$/i);
@@ -8928,7 +9219,7 @@ function parseTSlotExtrusionModelParams(raw) {
8928
9219
  }
8929
9220
  return tSlotExtrusionModelDefinitionSchema.parse(props);
8930
9221
  }
8931
- var model27 = defineModel({
9222
+ var model29 = defineModel({
8932
9223
  name: "tslotextrusion",
8933
9224
  schema: tSlotExtrusionModelDefinitionSchema,
8934
9225
  parse: parseTSlotExtrusionModelParams,
@@ -8939,14 +9230,14 @@ var model27 = defineModel({
8939
9230
  omittedStringFlags13
8940
9231
  )
8941
9232
  });
8942
- function register27(registry2) {
8943
- registry2.register(model27);
9233
+ function register29(registry2) {
9234
+ registry2.register(model29);
8944
9235
  }
8945
9236
  var stringFlags14 = {
8946
9237
  righttriangle: "shape(righttriangle)"
8947
9238
  };
8948
9239
  var omittedStringFlags14 = [];
8949
- var shape22 = {
9240
+ var shape24 = {
8950
9241
  width: positiveGearLengthSchema.default(40),
8951
9242
  height: positiveGearLengthSchema.default(40),
8952
9243
  thickness: positiveGearLengthSchema.default(4),
@@ -8959,22 +9250,22 @@ var shape22 = {
8959
9250
  /** Ligament between each slot and its parallel outer plate edge. */
8960
9251
  edgeMargin: positiveGearLengthSchema.default(1)
8961
9252
  };
8962
- function validate21(props, context) {
9253
+ function validate23(props, context) {
8963
9254
  const issue = (message, path) => context.addIssue({ code: "custom", message, path: [path] });
8964
- const [width10, length15] = props.slot;
8965
- if (length15 < width10) {
9255
+ const [width10, length16] = props.slot;
9256
+ if (length16 < width10) {
8966
9257
  issue("Slot length must be at least its width", "slot");
8967
9258
  return;
8968
9259
  }
8969
9260
  const radius = width10 / 2;
8970
- const halfStraight = (length15 - width10) / 2;
9261
+ const halfStraight = (length16 - width10) / 2;
8971
9262
  const inset = props.edgeMargin + radius;
8972
9263
  const [x, y] = props.centers;
8973
9264
  if (!Number.isFinite(inset)) {
8974
9265
  issue("Derived slot centers must be finite", "edgeMargin");
8975
9266
  return;
8976
9267
  }
8977
- if (x <= length15 / 2 || y <= length15 / 2)
9268
+ if (x <= length16 / 2 || y <= length16 / 2)
8978
9269
  issue("Slots must leave material at the right-angle corner", "centers");
8979
9270
  const normalRatio = Math.min(props.width, props.height) / Math.max(props.width, props.height);
8980
9271
  const capSupport = radius / Math.min(props.width, props.height) * Math.hypot(1, normalRatio);
@@ -8990,18 +9281,18 @@ function validate21(props, context) {
8990
9281
  if (Math.hypot(dx, dy) <= width10)
8991
9282
  issue("The two slots must retain a positive separating ligament", "centers");
8992
9283
  }
8993
- var tSlotGussetModelPropsSchema = external_exports.object(shape22).strict().superRefine(validate21);
8994
- var tSlotGussetModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("tslotgusset"), ...shape22 }).strict().superRefine(validate21);
9284
+ var tSlotGussetModelPropsSchema = external_exports.object(shape24).strict().superRefine(validate23);
9285
+ var tSlotGussetModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("tslotgusset"), ...shape24 }).strict().superRefine(validate23);
8995
9286
  function getTSlotGussetMountingSlots(input = {}) {
8996
9287
  const props = tSlotGussetModelPropsSchema.parse(input);
8997
- const [width10, length15] = props.slot;
9288
+ const [width10, length16] = props.slot;
8998
9289
  const inset = props.edgeMargin + width10 / 2;
8999
9290
  return [
9000
9291
  {
9001
9292
  center: { x: props.centers[0], y: inset, z: 0 },
9002
9293
  orientation: 0,
9003
9294
  width: width10,
9004
- length: length15,
9295
+ length: length16,
9005
9296
  depth: props.thickness,
9006
9297
  direction: { x: 0, y: 0, z: 1 }
9007
9298
  },
@@ -9009,13 +9300,13 @@ function getTSlotGussetMountingSlots(input = {}) {
9009
9300
  center: { x: inset, y: props.centers[1], z: 0 },
9010
9301
  orientation: 90,
9011
9302
  width: width10,
9012
- length: length15,
9303
+ length: length16,
9013
9304
  depth: props.thickness,
9014
9305
  direction: { x: 0, y: 0, z: 1 }
9015
9306
  }
9016
9307
  ];
9017
9308
  }
9018
- var lengths17 = {
9309
+ var lengths18 = {
9019
9310
  w: "width",
9020
9311
  width: "width",
9021
9312
  h: "height",
@@ -9035,7 +9326,7 @@ function parseTSlotGussetModelParams(raw) {
9035
9326
  const [name, value] = parseGearToken(token);
9036
9327
  let property;
9037
9328
  let parsed = value;
9038
- if (name in lengths17) property = lengths17[name];
9329
+ if (name in lengths18) property = lengths18[name];
9039
9330
  else if (name === "slots" || name === "slotcount") {
9040
9331
  property = "slotCount";
9041
9332
  parsed = parseGearInteger(value, "slotCount");
@@ -9056,7 +9347,7 @@ function parseTSlotGussetModelParams(raw) {
9056
9347
  }
9057
9348
  return tSlotGussetModelDefinitionSchema.parse(props);
9058
9349
  }
9059
- var model28 = defineModel({
9350
+ var model30 = defineModel({
9060
9351
  name: "tslotgusset",
9061
9352
  schema: tSlotGussetModelDefinitionSchema,
9062
9353
  parse: parseTSlotGussetModelParams,
@@ -9067,10 +9358,10 @@ var model28 = defineModel({
9067
9358
  omittedStringFlags14
9068
9359
  )
9069
9360
  });
9070
- function register28(registry2) {
9071
- registry2.register(model28);
9361
+ function register30(registry2) {
9362
+ registry2.register(model30);
9072
9363
  }
9073
- var shape23 = {
9364
+ var shape25 = {
9074
9365
  width: positiveGearLengthSchema.default(20),
9075
9366
  /** Equal leg extents from the virtual intersection of the inside flats. */
9076
9367
  legLength: positiveGearLengthSchema.default(40),
@@ -9082,7 +9373,7 @@ var shape23 = {
9082
9373
  holeOffset: positiveGearLengthSchema.default(20),
9083
9374
  bendRadius: nonnegativeGearLengthSchema.default(0)
9084
9375
  };
9085
- function validate22(props, context) {
9376
+ function validate24(props, context) {
9086
9377
  const issue = (message, path) => context.addIssue({ code: "custom", message, path: [path] });
9087
9378
  if (!Number.isFinite(props.bendRadius + props.thickness)) {
9088
9379
  issue("Outside bend radius must be finite", "bendRadius");
@@ -9100,9 +9391,9 @@ function validate22(props, context) {
9100
9391
  if (props.holeOffset + radius >= props.legLength)
9101
9392
  issue("Holes must leave material at the free leg ends", "holeOffset");
9102
9393
  }
9103
- var tSlotInsideCornerModelPropsSchema = external_exports.object(shape23).strict().superRefine(validate22);
9104
- var tSlotInsideCornerModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("tslotinsidecorner"), ...shape23 }).strict().superRefine(validate22);
9105
- var lengths18 = {
9394
+ var tSlotInsideCornerModelPropsSchema = external_exports.object(shape25).strict().superRefine(validate24);
9395
+ var tSlotInsideCornerModelDefinitionSchema = external_exports.object({ fn: external_exports.literal("tslotinsidecorner"), ...shape25 }).strict().superRefine(validate24);
9396
+ var lengths19 = {
9106
9397
  w: "width",
9107
9398
  width: "width",
9108
9399
  leg: "legLength",
@@ -9125,7 +9416,7 @@ function parseTSlotInsideCornerModelParams(raw) {
9125
9416
  const [name, value] = parseGearToken(token);
9126
9417
  let property;
9127
9418
  let parsed = value;
9128
- if (name in lengths18) property = lengths18[name];
9419
+ if (name in lengths19) property = lengths19[name];
9129
9420
  else if (name === "holes" || name === "holecount") {
9130
9421
  property = "holeCount";
9131
9422
  parsed = parseGearInteger(value, "holeCount");
@@ -9139,13 +9430,13 @@ function parseTSlotInsideCornerModelParams(raw) {
9139
9430
  }
9140
9431
  return tSlotInsideCornerModelDefinitionSchema.parse(props);
9141
9432
  }
9142
- var model29 = defineModel({
9433
+ var model31 = defineModel({
9143
9434
  name: "tslotinsidecorner",
9144
9435
  schema: tSlotInsideCornerModelDefinitionSchema,
9145
9436
  parse: parseTSlotInsideCornerModelParams
9146
9437
  });
9147
- function register29(registry2) {
9148
- registry2.register(model29);
9438
+ function register31(registry2) {
9439
+ registry2.register(model31);
9149
9440
  }
9150
9441
  function getNemaMotorReferencePoints(input) {
9151
9442
  const p = nemaMotorModelPropsSchema.parse(input);
@@ -9220,7 +9511,9 @@ var modelDefinitionSchema = external_exports.union([
9220
9511
  model26.schema,
9221
9512
  model27.schema,
9222
9513
  model28.schema,
9223
- model29.schema
9514
+ model29.schema,
9515
+ model30.schema,
9516
+ model31.schema
9224
9517
  ]);
9225
9518
  function registerAllModels(registry2) {
9226
9519
  register(registry2);
@@ -9252,6 +9545,8 @@ function registerAllModels(registry2) {
9252
9545
  register27(registry2);
9253
9546
  register28(registry2);
9254
9547
  register29(registry2);
9548
+ register30(registry2);
9549
+ register31(registry2);
9255
9550
  }
9256
9551
  var registry = new ModelRegistry();
9257
9552
  registerAllModels(registry);
@@ -9434,24 +9729,24 @@ var FootprintPlatedHole = ({
9434
9729
  };
9435
9730
 
9436
9731
  // lib/model-registry.ts
9437
- function defineModelRenderer(model58) {
9438
- return model58;
9732
+ function defineModelRenderer(model62) {
9733
+ return model62;
9439
9734
  }
9440
9735
  var ModelRendererRegistry = class {
9441
9736
  models = /* @__PURE__ */ new Map();
9442
- register(model58) {
9443
- if (typeof model58.name !== "string" || !/^[a-z]+$/.test(model58.name)) {
9737
+ register(model62) {
9738
+ if (typeof model62.name !== "string" || !/^[a-z]+$/.test(model62.name)) {
9444
9739
  throw new Error(
9445
9740
  "Model renderer names must contain only lowercase letters"
9446
9741
  );
9447
9742
  }
9448
- if (this.models.has(model58.name)) {
9449
- throw new Error(`Model renderer "${model58.name}" is already registered`);
9743
+ if (this.models.has(model62.name)) {
9744
+ throw new Error(`Model renderer "${model62.name}" is already registered`);
9450
9745
  }
9451
- if (model58.pads !== "none" && model58.pads !== "footprinter") {
9746
+ if (model62.pads !== "none" && model62.pads !== "footprinter") {
9452
9747
  throw new Error('Model renderer pads must be "none" or "footprinter"');
9453
9748
  }
9454
- const { name, schema, render: render2, pads } = model58;
9749
+ const { name, schema, render: render2, pads } = model62;
9455
9750
  this.models.set(name, {
9456
9751
  name,
9457
9752
  schema,
@@ -9605,7 +9900,7 @@ function createBallBearingMesh(input = {}, options = {}) {
9605
9900
  if (face2 === "open") continue;
9606
9901
  const t = d.closureThickness;
9607
9902
  const ri = d.innerRaceOuterRadius, ro = d.outerRaceInnerRadius;
9608
- const shape24 = face2 === "shielded" ? [
9903
+ const shape26 = face2 === "shielded" ? [
9609
9904
  [ro, 0],
9610
9905
  [ro, t * 0.45],
9611
9906
  [ri, t * 0.45],
@@ -9618,7 +9913,7 @@ function createBallBearingMesh(input = {}, options = {}) {
9618
9913
  [ri + 0.15 * (ro - ri), 0.5 * t],
9619
9914
  [ro - 0.15 * (ro - ri), 0.5 * t]
9620
9915
  ];
9621
- const profile = sign === -1 ? shape24 : shape24.map(([r, z]) => [r, d.width - z]).reverse();
9916
+ const profile = sign === -1 ? shape26 : shape26.map(([r, z]) => [r, d.width - z]).reverse();
9622
9917
  parts.push({
9623
9918
  name: `${face2} ${sign < 0 ? "lower" : "upper"}`,
9624
9919
  color: face2 === "sealed" ? "#252a30" : "#b5bbc3",
@@ -9632,9 +9927,9 @@ function segmentsFor(value = 96) {
9632
9927
  throw new Error("Segments must be a multiple of 24 from 96 to 192");
9633
9928
  return value;
9634
9929
  }
9635
- function checkPrecision(lengths19) {
9636
- const largest = Math.max(...lengths19);
9637
- if (!lengths19.every(Number.isFinite) || largest > 1e6 || Math.min(...lengths19) < Math.max(1e-5, largest * 1e-7))
9930
+ function checkPrecision(lengths20) {
9931
+ const largest = Math.max(...lengths20);
9932
+ if (!lengths20.every(Number.isFinite) || largest > 1e6 || Math.min(...lengths20) < Math.max(1e-5, largest * 1e-7))
9638
9933
  throw new Error(
9639
9934
  "Bearing dimensions exceed the renderer's numerical resolution"
9640
9935
  );
@@ -9742,14 +10037,14 @@ function BallBearing({ color, ...props }) {
9742
10037
  }
9743
10038
 
9744
10039
  // lib/models/ballbearing/register.tsx
9745
- var model30 = defineModelRenderer({
10040
+ var model32 = defineModelRenderer({
9746
10041
  name: "ballbearing",
9747
10042
  schema: ballBearingModelDefinitionSchema,
9748
10043
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(BallBearing, { ...props }),
9749
10044
  pads: "none"
9750
10045
  });
9751
- function register30(registry2) {
9752
- registry2.register(model30);
10046
+ function register32(registry2) {
10047
+ registry2.register(model32);
9753
10048
  }
9754
10049
 
9755
10050
  // lib/models/balltransferunit/mesh.ts
@@ -9841,7 +10136,7 @@ function circularProfile(x, y, radius, segments = 96) {
9841
10136
  // lib/models/balltransferunit/mesh.ts
9842
10137
  function createBallTransferUnitMesh(input = {}) {
9843
10138
  const d = getBallTransferUnitDimensions(input);
9844
- const lengths19 = [
10139
+ const lengths20 = [
9845
10140
  d.height,
9846
10141
  d.flangeDiameter,
9847
10142
  d.flangeThickness,
@@ -9855,9 +10150,9 @@ function createBallTransferUnitMesh(input = {}) {
9855
10150
  (d.pitchCircleDiameter - d.holeDiameter - d.bodyDiameter) / 2,
9856
10151
  (d.flangeDiameter - d.pitchCircleDiameter - d.holeDiameter) / 2
9857
10152
  ];
9858
- const largest = Math.max(...lengths19);
10153
+ const largest = Math.max(...lengths20);
9859
10154
  const resolution4 = Math.max(1e-5, largest * 1e-7);
9860
- if (!lengths19.every(Number.isFinite) || largest > 1e6 || Math.min(...lengths19) < resolution4)
10155
+ if (!lengths20.every(Number.isFinite) || largest > 1e6 || Math.min(...lengths20) < resolution4)
9861
10156
  throw new Error(
9862
10157
  "Ball transfer unit exceeds the renderer's numerical resolution"
9863
10158
  );
@@ -9998,14 +10293,14 @@ function BallTransferUnit({ color, ...props }) {
9998
10293
  }
9999
10294
 
10000
10295
  // lib/models/balltransferunit/register.tsx
10001
- var model31 = defineModelRenderer({
10296
+ var model33 = defineModelRenderer({
10002
10297
  name: "balltransferunit",
10003
10298
  schema: ballTransferUnitModelDefinitionSchema,
10004
10299
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(BallTransferUnit, { ...props }),
10005
10300
  pads: "none"
10006
10301
  });
10007
- function register31(registry2) {
10008
- registry2.register(model31);
10302
+ function register33(registry2) {
10303
+ registry2.register(model33);
10009
10304
  }
10010
10305
 
10011
10306
  // lib/models/buttonscrew/mesh.ts
@@ -10125,22 +10420,22 @@ function ButtonScrew({ color = "#737e8f", ...props }) {
10125
10420
  }
10126
10421
 
10127
10422
  // lib/models/buttonscrew/register.tsx
10128
- var model32 = defineModelRenderer({
10423
+ var model34 = defineModelRenderer({
10129
10424
  name: "buttonscrew",
10130
10425
  schema: buttonScrewModelDefinitionSchema,
10131
10426
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(ButtonScrew, { ...props }),
10132
10427
  pads: "none"
10133
10428
  });
10134
- function register32(registry2) {
10135
- registry2.register(model32);
10429
+ function register34(registry2) {
10430
+ registry2.register(model34);
10136
10431
  }
10137
10432
 
10138
10433
  // lib/models/cablegrommet/mesh.ts
10139
10434
  function createCableGrommetMesh(input, options = {}) {
10140
10435
  const props = cableGrommetModelPropsSchema.parse(input);
10141
- const dimensions4 = getCableGrommetDimensions(props);
10436
+ const dimensions5 = getCableGrommetDimensions(props);
10142
10437
  const inner = props.innerDiameter / 2;
10143
- const root = dimensions4.grooveRootDiameter / 2;
10438
+ const root = dimensions5.grooveRootDiameter / 2;
10144
10439
  const outer = props.outerDiameter / 2;
10145
10440
  const requested = options.radialSegments ?? 96;
10146
10441
  if (!Number.isInteger(requested) || requested < 12 || requested > 4096 || requested % 4 !== 0)
@@ -10156,10 +10451,10 @@ function createCableGrommetMesh(input, options = {}) {
10156
10451
  const section = [
10157
10452
  [inner, -props.height / 2],
10158
10453
  [outer, -props.height / 2],
10159
- [outer, dimensions4.grooveStartZ],
10160
- [root, dimensions4.grooveStartZ],
10161
- [root, dimensions4.grooveEndZ],
10162
- [outer, dimensions4.grooveEndZ],
10454
+ [outer, dimensions5.grooveStartZ],
10455
+ [root, dimensions5.grooveStartZ],
10456
+ [root, dimensions5.grooveEndZ],
10457
+ [outer, dimensions5.grooveEndZ],
10163
10458
  [outer, props.height / 2],
10164
10459
  [inner, props.height / 2]
10165
10460
  ];
@@ -10200,14 +10495,14 @@ function CableGrommet({
10200
10495
  }
10201
10496
 
10202
10497
  // lib/models/cablegrommet/register.tsx
10203
- var model33 = defineModelRenderer({
10498
+ var model35 = defineModelRenderer({
10204
10499
  name: "cablegrommet",
10205
10500
  schema: cableGrommetModelDefinitionSchema,
10206
10501
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(CableGrommet, { ...props }),
10207
10502
  pads: "none"
10208
10503
  });
10209
- function register33(registry2) {
10210
- registry2.register(model33);
10504
+ function register35(registry2) {
10505
+ registry2.register(model35);
10211
10506
  }
10212
10507
 
10213
10508
  // lib/models/clampingshaftcollar/mesh.ts
@@ -10235,9 +10530,9 @@ function createAnnularSleeve({
10235
10530
  outerRadius,
10236
10531
  boreARadius,
10237
10532
  boreBRadius = boreARadius,
10238
- length: length15,
10533
+ length: length16,
10239
10534
  chamfer,
10240
- stepZ = length15 / 2
10535
+ stepZ = length16 / 2
10241
10536
  }) {
10242
10537
  const halfAngle = Math.PI / bodySegments;
10243
10538
  const cosine = Math.cos(halfAngle);
@@ -10248,10 +10543,10 @@ function createAnnularSleeve({
10248
10543
  const raw = [
10249
10544
  [0, outerRadius - chamfer, false],
10250
10545
  [chamfer, outerRadius, false],
10251
- [length15 - chamfer, outerRadius, false],
10252
- [length15, outerRadius - chamfer, false],
10253
- [length15, boreBRadius + chamfer, true],
10254
- [length15 - chamfer, boreBRadius, true],
10546
+ [length16 - chamfer, outerRadius, false],
10547
+ [length16, outerRadius - chamfer, false],
10548
+ [length16, boreBRadius + chamfer, true],
10549
+ [length16 - chamfer, boreBRadius, true],
10255
10550
  [stepZ, boreBRadius, true],
10256
10551
  [stepZ, boreARadius, true],
10257
10552
  [chamfer, boreARadius, true],
@@ -10457,15 +10752,15 @@ function finishShaftMountMesh(geometry) {
10457
10752
  // lib/models/clampingshaftcollar/mesh.ts
10458
10753
  function createClampingShaftCollarMesh(input) {
10459
10754
  const props = clampingShaftCollarModelPropsSchema.parse(input);
10460
- const dimensions4 = getClampingShaftCollarDimensions(props);
10461
- assertShaftMountResolution([dimensions4.threadedHole]);
10755
+ const dimensions5 = getClampingShaftCollarDimensions(props);
10756
+ assertShaftMountResolution([dimensions5.threadedHole]);
10462
10757
  const body = createAnnularSleeve({
10463
10758
  outerRadius: props.outerDiameter / 2,
10464
10759
  boreARadius: props.boreDiameter / 2,
10465
10760
  length: props.width,
10466
10761
  chamfer: props.chamfer
10467
10762
  });
10468
- const s = dimensions4.split;
10763
+ const s = dimensions5.split;
10469
10764
  const epsilon = 1e-4;
10470
10765
  const slit = jscad3.primitives.cuboid({
10471
10766
  size: [
@@ -10483,8 +10778,8 @@ function createClampingShaftCollarMesh(input) {
10483
10778
  subtractShaftMountParts(
10484
10779
  body,
10485
10780
  slit,
10486
- createMountingHoleCutter(dimensions4.clearanceHole),
10487
- createMountingHoleCutter(dimensions4.threadedHole)
10781
+ createMountingHoleCutter(dimensions5.clearanceHole),
10782
+ createMountingHoleCutter(dimensions5.threadedHole)
10488
10783
  )
10489
10784
  );
10490
10785
  }
@@ -10501,14 +10796,14 @@ function ClampingShaftCollar({
10501
10796
  }
10502
10797
 
10503
10798
  // lib/models/clampingshaftcollar/register.tsx
10504
- var model34 = defineModelRenderer({
10799
+ var model36 = defineModelRenderer({
10505
10800
  name: "clampingshaftcollar",
10506
10801
  schema: clampingShaftCollarModelDefinitionSchema,
10507
10802
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(ClampingShaftCollar, { ...props }),
10508
10803
  pads: "none"
10509
10804
  });
10510
- function register34(registry2) {
10511
- registry2.register(model34);
10805
+ function register36(registry2) {
10806
+ registry2.register(model36);
10512
10807
  }
10513
10808
 
10514
10809
  // lib/mechanical/clip-mesh-to-z-range.ts
@@ -10630,7 +10925,7 @@ function clipMeshToZRange(mesh, lower, upper) {
10630
10925
  // lib/models/compressionspring/mesh.ts
10631
10926
  function createCompressionSpringMesh(input, options = {}) {
10632
10927
  const props = compressionSpringModelPropsSchema.parse(input);
10633
- const dimensions4 = getCompressionSpringDimensions(props);
10928
+ const dimensions5 = getCompressionSpringDimensions(props);
10634
10929
  const segmentsPerTurn = options.segmentsPerTurn ?? 64;
10635
10930
  const wireSegments = options.wireSegments ?? 24;
10636
10931
  for (const [name, value, minimum, maximum] of [
@@ -10645,7 +10940,7 @@ function createCompressionSpringMesh(input, options = {}) {
10645
10940
  if (!Number.isSafeInteger(steps) || (steps + 1) * wireSegments > 25e4)
10646
10941
  throw new Error("Spring exceeds mesh resolution limit (250000 vertices)");
10647
10942
  const scale = Math.max(props.outerDiameter, props.freeLength);
10648
- if (dimensions4.activePitch - props.wireDiameter <= scale * 1e-10 || props.wireDiameter <= scale * 1e-10 || dimensions4.insideDiameter <= scale * 1e-10)
10943
+ if (dimensions5.activePitch - props.wireDiameter <= scale * 1e-10 || props.wireDiameter <= scale * 1e-10 || dimensions5.insideDiameter <= scale * 1e-10)
10649
10944
  throw new Error("Spring clearance exceeds mesh resolution limit");
10650
10945
  const positions = [];
10651
10946
  const indices = [];
@@ -10687,8 +10982,8 @@ function createCompressionSpringMesh(input, options = {}) {
10687
10982
  }
10688
10983
  return clipMeshToZRange(
10689
10984
  { positions, indices },
10690
- dimensions4.lowerBearingZ,
10691
- dimensions4.upperBearingZ
10985
+ dimensions5.lowerBearingZ,
10986
+ dimensions5.upperBearingZ
10692
10987
  );
10693
10988
  }
10694
10989
 
@@ -10704,14 +10999,72 @@ function CompressionSpring({
10704
10999
  }
10705
11000
 
10706
11001
  // lib/models/compressionspring/register.tsx
10707
- var model35 = defineModelRenderer({
11002
+ var model37 = defineModelRenderer({
10708
11003
  name: "compressionspring",
10709
11004
  schema: compressionSpringModelDefinitionSchema,
10710
11005
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(CompressionSpring, { ...props }),
10711
11006
  pads: "none"
10712
11007
  });
10713
- function register35(registry2) {
10714
- registry2.register(model35);
11008
+ function register37(registry2) {
11009
+ registry2.register(model37);
11010
+ }
11011
+
11012
+ // lib/models/dowelpin/mesh.ts
11013
+ function createDowelPinMesh(input, options = {}) {
11014
+ const d = getDowelPinDimensions(input);
11015
+ const radial = options.radialSegments ?? 96;
11016
+ if (!Number.isInteger(radial) || radial < 24 || radial > 256 || radial % 4 !== 0)
11017
+ throw new Error(
11018
+ "Mesh resolution limit: radial segments must be a multiple of 4 in [24,256]"
11019
+ );
11020
+ const positions = [], indices = [];
11021
+ const levels = [
11022
+ [0, d.endDiameter / 2],
11023
+ [d.endLeadLength, d.diameter / 2],
11024
+ [d.length - d.endLeadLength, d.diameter / 2],
11025
+ [d.length, d.endDiameter / 2]
11026
+ ];
11027
+ for (const [z, radius] of levels)
11028
+ for (let i = 0; i < radial; i++) {
11029
+ const angle = i * 2 * Math.PI / radial;
11030
+ positions.push(radius * Math.cos(angle), radius * Math.sin(angle), z);
11031
+ }
11032
+ for (let layer = 0; layer < 3; layer++)
11033
+ for (let i = 0; i < radial; i++) {
11034
+ const n = (i + 1) % radial, a = layer * radial, b = (layer + 1) * radial;
11035
+ indices.push(a + i, a + n, b + n, a + i, b + n, b + i);
11036
+ }
11037
+ for (const [ring, z, up] of [
11038
+ [0, 0, false],
11039
+ [3 * radial, d.length, true]
11040
+ ]) {
11041
+ const center = positions.length / 3;
11042
+ positions.push(0, 0, z);
11043
+ for (let i = 0; i < radial; i++) {
11044
+ const n = (i + 1) % radial;
11045
+ indices.push(center, ring + (up ? i : n), ring + (up ? n : i));
11046
+ }
11047
+ }
11048
+ return { positions, indices };
11049
+ }
11050
+
11051
+ // lib/models/dowelpin/DowelPin.tsx
11052
+ function createDowelPinGeom(input, resolution4) {
11053
+ return indexedMeshToGeom3(createDowelPinMesh(input, resolution4));
11054
+ }
11055
+ function DowelPin({ color = "#929da9", ...props }) {
11056
+ return /* @__PURE__ */ jsx(Colorize, { color, children: /* @__PURE__ */ jsx(Custom, { geometry: createDowelPinGeom(props) }) });
11057
+ }
11058
+
11059
+ // lib/models/dowelpin/register.tsx
11060
+ var model38 = defineModelRenderer({
11061
+ name: "dowelpin",
11062
+ schema: dowelPinModelDefinitionSchema,
11063
+ render: ({ fn, ...props }) => /* @__PURE__ */ jsx(DowelPin, { ...props }),
11064
+ pads: "none"
11065
+ });
11066
+ function register38(registry2) {
11067
+ registry2.register(model38);
10715
11068
  }
10716
11069
 
10717
11070
  // lib/models/flangedbushing/mesh.ts
@@ -10760,14 +11113,14 @@ function FlangedBushing({
10760
11113
  }
10761
11114
 
10762
11115
  // lib/models/flangedbushing/register.tsx
10763
- var model36 = defineModelRenderer({
11116
+ var model39 = defineModelRenderer({
10764
11117
  name: "flangedbushing",
10765
11118
  schema: flangedBushingModelDefinitionSchema,
10766
11119
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(FlangedBushing, { ...props }),
10767
11120
  pads: "none"
10768
11121
  });
10769
- function register36(registry2) {
10770
- registry2.register(model36);
11122
+ function register39(registry2) {
11123
+ registry2.register(model39);
10771
11124
  }
10772
11125
 
10773
11126
  // lib/models/flatheadscrew/mesh.ts
@@ -10894,14 +11247,14 @@ function FlatHeadScrew({
10894
11247
  }
10895
11248
 
10896
11249
  // lib/models/flatheadscrew/register.tsx
10897
- var model37 = defineModelRenderer({
11250
+ var model40 = defineModelRenderer({
10898
11251
  name: "flatheadscrew",
10899
11252
  schema: flatHeadScrewModelDefinitionSchema,
10900
11253
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(FlatHeadScrew, { ...props }),
10901
11254
  pads: "none"
10902
11255
  });
10903
- function register37(registry2) {
10904
- registry2.register(model37);
11256
+ function register40(registry2) {
11257
+ registry2.register(model40);
10905
11258
  }
10906
11259
 
10907
11260
  // lib/Screen.tsx
@@ -11576,14 +11929,106 @@ var FlexScreen = (props) => {
11576
11929
  };
11577
11930
 
11578
11931
  // lib/models/flexscreen/register.tsx
11579
- var model38 = defineModelRenderer({
11932
+ var model41 = defineModelRenderer({
11580
11933
  name: "flexscreen",
11581
11934
  schema: flexScreenModelDefinitionSchema,
11582
11935
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(FlexScreen, { ...props }),
11583
11936
  pads: "footprinter"
11584
11937
  });
11585
- function register38(registry2) {
11586
- registry2.register(model38);
11938
+ function register41(registry2) {
11939
+ registry2.register(model41);
11940
+ }
11941
+
11942
+ // lib/models/heatsetinsert/mesh.ts
11943
+ function createHeatSetInsertMesh(input, options = {}) {
11944
+ const p = heatSetInsertModelPropsSchema.parse(input);
11945
+ const repeat = p.knurlTeeth * 8;
11946
+ const segments = options.radialSegments ?? Math.ceil(96 / repeat) * repeat;
11947
+ const axial = options.segmentsPerPitch ?? 24;
11948
+ if (!Number.isInteger(segments) || segments < 24 || segments > 768 || segments % (4 * p.knurlTeeth) !== 0 || !Number.isInteger(axial) || axial < 8 || axial > 64)
11949
+ throw new Error(
11950
+ "Mesh resolution requires 24..768 radial segments divisible by four times knurl teeth and 8..64 segments per pitch"
11951
+ );
11952
+ const outerSteps = Math.max(1, Math.ceil(p.length / p.knurlPitch * axial));
11953
+ const innerSteps = p.showThreads ? Math.max(1, Math.ceil(p.length / p.threadPitch * axial)) : 1;
11954
+ if ((outerSteps + Math.ceil(2 * p.length / p.knurlPitch) + innerSteps + 4) * segments > 4e5)
11955
+ throw new Error("Insert exceeds mesh resolution limit");
11956
+ const positions = [], indices = [];
11957
+ const ring = (z, radius) => {
11958
+ const start = positions.length / 3;
11959
+ for (let i = 0; i < segments; i++) {
11960
+ const theta = i * 2 * Math.PI / segments, r = radius(theta);
11961
+ positions.push(r * Math.cos(theta), r * Math.sin(theta), z);
11962
+ }
11963
+ return start;
11964
+ };
11965
+ const connect = (a, b) => {
11966
+ for (let i = 0; i < segments; i++) {
11967
+ const n = (i + 1) % segments;
11968
+ indices.push(a + i, a + n, b + n, a + i, b + n, b + i);
11969
+ }
11970
+ };
11971
+ const triangular = (q) => {
11972
+ const phase = (q % 1 + 1) % 1;
11973
+ return 2 * Math.min(phase, 1 - phase);
11974
+ };
11975
+ const outer = (z, theta) => {
11976
+ const u = p.knurlTeeth * theta / (2 * Math.PI), v = z / p.knurlPitch;
11977
+ return p.outerDiameter / 2 - p.knurlDepth * Math.max(triangular(u + v), triangular(u - v));
11978
+ };
11979
+ const outerLevels = new Set(
11980
+ Array.from(
11981
+ { length: outerSteps + 1 },
11982
+ (_, i) => p.length * i / outerSteps
11983
+ )
11984
+ );
11985
+ for (let i = 1; i * p.knurlPitch / 2 < p.length; i++)
11986
+ outerLevels.add(i * p.knurlPitch / 2);
11987
+ const first = ring(0, (theta) => outer(0, theta));
11988
+ let previous = first;
11989
+ const orderedLevels = [...outerLevels].sort((a, b) => a - b).filter((z, i, levels) => i === 0 || z - levels[i - 1] > p.length * 1e-12);
11990
+ for (const z of orderedLevels.slice(1)) {
11991
+ const current = ring(z, (theta) => outer(z, theta));
11992
+ connect(previous, current);
11993
+ previous = current;
11994
+ }
11995
+ const minor = p.threadMinorDiameter / 2, depth = (p.diameter - p.threadMinorDiameter) / 2;
11996
+ for (let i = innerSteps; i >= 0; i--) {
11997
+ const z = p.length * i / innerSteps;
11998
+ const current = ring(z, (theta) => {
11999
+ const phase = ((z / p.threadPitch - (p.leftHand ? -1 : 1) * theta / (2 * Math.PI)) % 1 + 1) % 1, d = Math.min(phase, 1 - phase);
12000
+ return minor + (p.showThreads ? Math.min(
12001
+ depth,
12002
+ Math.max(0, (d - 1 / 8) * p.threadPitch * Math.sqrt(3))
12003
+ ) : 0);
12004
+ });
12005
+ connect(previous, current);
12006
+ previous = current;
12007
+ }
12008
+ connect(previous, first);
12009
+ return { positions, indices };
12010
+ }
12011
+
12012
+ // lib/models/heatsetinsert/HeatSetInsert.tsx
12013
+ function createHeatSetInsertGeom(input, options) {
12014
+ return indexedMeshToGeom3(createHeatSetInsertMesh(input, options));
12015
+ }
12016
+ function HeatSetInsert({
12017
+ color = "#bd8c45",
12018
+ ...props
12019
+ }) {
12020
+ return /* @__PURE__ */ jsx(Colorize, { color, children: /* @__PURE__ */ jsx(Custom, { geometry: createHeatSetInsertGeom(props) }) });
12021
+ }
12022
+
12023
+ // lib/models/heatsetinsert/register.tsx
12024
+ var model42 = defineModelRenderer({
12025
+ name: "heatsetinsert",
12026
+ schema: heatSetInsertModelDefinitionSchema,
12027
+ render: ({ fn, ...props }) => /* @__PURE__ */ jsx(HeatSetInsert, { ...props }),
12028
+ pads: "none"
12029
+ });
12030
+ function register42(registry2) {
12031
+ registry2.register(model42);
11587
12032
  }
11588
12033
 
11589
12034
  // lib/mechanical/spur-gear-mesh.ts
@@ -11593,15 +12038,15 @@ function createSpurGearMesh(input) {
11593
12038
  }
11594
12039
  function createTwistedSpurGearMesh(input, twist = 0, segmentsPerTurn = 32) {
11595
12040
  const props = spurGearModelPropsSchema.parse(input);
11596
- const dimensions4 = getSpurGearDimensions(props);
11597
- const pitchRadius = dimensions4.pitchDiameter / 2;
11598
- const baseRadius = dimensions4.baseDiameter / 2;
11599
- const outsideRadius = dimensions4.outsideDiameter / 2;
11600
- const rootRadius = dimensions4.rootDiameter / 2;
12041
+ const dimensions5 = getSpurGearDimensions(props);
12042
+ const pitchRadius = dimensions5.pitchDiameter / 2;
12043
+ const baseRadius = dimensions5.baseDiameter / 2;
12044
+ const outsideRadius = dimensions5.outsideDiameter / 2;
12045
+ const rootRadius = dimensions5.rootDiameter / 2;
11601
12046
  const pressureAngle = props.pressureAngle * Math.PI / 180;
11602
12047
  const toothAngle = Math.PI * 2 / props.toothCount;
11603
12048
  const phase = (props.phase % 360 + 360) % 360 * (Math.PI / 180);
11604
- const baseHalfAngle = dimensions4.toothThickness / (2 * pitchRadius) + Math.tan(pressureAngle) - pressureAngle;
12049
+ const baseHalfAngle = dimensions5.toothThickness / (2 * pitchRadius) + Math.tan(pressureAngle) - pressureAngle;
11605
12050
  const startRadius = Math.max(baseRadius, rootRadius);
11606
12051
  const startT = Math.sqrt(Math.max(0, (startRadius / baseRadius) ** 2 - 1));
11607
12052
  const outsideT = Math.sqrt((outsideRadius / baseRadius) ** 2 - 1);
@@ -11776,14 +12221,14 @@ function HelicalGear({ color = "#737e8f", ...props }) {
11776
12221
  }
11777
12222
 
11778
12223
  // lib/models/helicalgear/register.tsx
11779
- var model39 = defineModelRenderer({
12224
+ var model43 = defineModelRenderer({
11780
12225
  name: "helicalgear",
11781
12226
  schema: helicalGearModelDefinitionSchema,
11782
12227
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(HelicalGear, { ...props }),
11783
12228
  pads: "none"
11784
12229
  });
11785
- function register39(registry2) {
11786
- registry2.register(model39);
12230
+ function register43(registry2) {
12231
+ registry2.register(model43);
11787
12232
  }
11788
12233
 
11789
12234
  // lib/models/hexbolt/mesh.ts
@@ -11918,14 +12363,14 @@ function HexBolt({ color = "#737e8f", ...props }) {
11918
12363
  }
11919
12364
 
11920
12365
  // lib/models/hexbolt/register.tsx
11921
- var model40 = defineModelRenderer({
12366
+ var model44 = defineModelRenderer({
11922
12367
  name: "hexbolt",
11923
12368
  schema: hexBoltModelDefinitionSchema,
11924
12369
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(HexBolt, { ...props }),
11925
12370
  pads: "none"
11926
12371
  });
11927
- function register40(registry2) {
11928
- registry2.register(model40);
12372
+ function register44(registry2) {
12373
+ registry2.register(model44);
11929
12374
  }
11930
12375
 
11931
12376
  // lib/models/hexnut/mesh.ts
@@ -12044,14 +12489,14 @@ function HexNut({ color = "#737e8f", ...props }) {
12044
12489
  }
12045
12490
 
12046
12491
  // lib/models/hexnut/register.tsx
12047
- var model41 = defineModelRenderer({
12492
+ var model45 = defineModelRenderer({
12048
12493
  name: "hexnut",
12049
12494
  schema: hexNutModelDefinitionSchema,
12050
12495
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(HexNut, { ...props }),
12051
12496
  pads: "none"
12052
12497
  });
12053
- function register41(registry2) {
12054
- registry2.register(model41);
12498
+ function register45(registry2) {
12499
+ registry2.register(model45);
12055
12500
  }
12056
12501
 
12057
12502
  // lib/mechanical/hex-socket-bolt-mesh.ts
@@ -12065,9 +12510,9 @@ var createHexSocketBoltMesh = (input) => {
12065
12510
  socketWidth,
12066
12511
  socketDepth
12067
12512
  } = hexSocketBoltDimensions[props.metricSize];
12068
- const { length: length15, showThreads } = props;
12513
+ const { length: length16, showThreads } = props;
12069
12514
  const segments = 96;
12070
- const steps = showThreads ? Math.max(2, Math.ceil(length15 / pitch * 24)) : 2;
12515
+ const steps = showThreads ? Math.max(2, Math.ceil(length16 / pitch * 24)) : 2;
12071
12516
  if (steps > 24e3)
12072
12517
  throw new Error(
12073
12518
  "Bolt length exceeds mesh resolution limit (1000 thread turns)"
@@ -12077,7 +12522,7 @@ var createHexSocketBoltMesh = (input) => {
12077
12522
  const radius = diameter / 2;
12078
12523
  const depth = pitch * 0.61343;
12079
12524
  const bevel = Math.min(0.2, headHeight * 0.08);
12080
- const tipBevel = Math.min(pitch * 0.6, length15 / 3);
12525
+ const tipBevel = Math.min(pitch * 0.6, length16 / 3);
12081
12526
  const ring = (z, radiusAt) => {
12082
12527
  const start = positions.length / 3;
12083
12528
  for (let i = 0; i < segments; i++) {
@@ -12105,8 +12550,8 @@ var createHexSocketBoltMesh = (input) => {
12105
12550
  let previous = -1;
12106
12551
  const shaftLevels = showThreads ? Array.from(
12107
12552
  { length: steps + 1 },
12108
- (_, step) => -length15 + length15 * step / steps
12109
- ) : [-length15, -length15 + tipBevel, 0];
12553
+ (_, step) => -length16 + length16 * step / steps
12554
+ ) : [-length16, -length16 + tipBevel, 0];
12110
12555
  for (const z of shaftLevels) {
12111
12556
  const current = ring(z, (angle) => {
12112
12557
  const phase = ((z / pitch - angle / (2 * Math.PI)) % 1 + 1) % 1;
@@ -12117,10 +12562,10 @@ var createHexSocketBoltMesh = (input) => {
12117
12562
  );
12118
12563
  const endRamp = Math.min(
12119
12564
  1,
12120
- (z + length15) / tipBevel,
12121
- -z / Math.min(pitch / 2, length15 / 3)
12565
+ (z + length16) / tipBevel,
12566
+ -z / Math.min(pitch / 2, length16 / 3)
12122
12567
  );
12123
- const tipCut = tipBevel * Math.max(0, 1 - (z + length15) / tipBevel);
12568
+ const tipCut = tipBevel * Math.max(0, 1 - (z + length16) / tipBevel);
12124
12569
  return radius - (showThreads ? groove * endRamp : 0) - tipCut;
12125
12570
  });
12126
12571
  if (previous < 0) cap2(current, z, false);
@@ -12156,20 +12601,20 @@ function HexSocketBolt({
12156
12601
  }
12157
12602
 
12158
12603
  // lib/models/hexsocketbolt/register.tsx
12159
- var model42 = defineModelRenderer({
12604
+ var model46 = defineModelRenderer({
12160
12605
  name: "hexsocketbolt",
12161
12606
  schema: hexSocketBoltModelDefinitionSchema,
12162
12607
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(HexSocketBolt, { ...props }),
12163
12608
  pads: "none"
12164
12609
  });
12165
- function register42(registry2) {
12166
- registry2.register(model42);
12610
+ function register46(registry2) {
12611
+ registry2.register(model46);
12167
12612
  }
12168
12613
 
12169
12614
  // lib/models/hollowpositioningarmtube/mesh.ts
12170
12615
  function createHollowPositioningArmTubeMesh(input, options = {}) {
12171
12616
  const props = hollowPositioningArmTubeModelPropsSchema.parse(input);
12172
- const dimensions4 = getHollowPositioningArmTubeDimensions(props);
12617
+ const dimensions5 = getHollowPositioningArmTubeDimensions(props);
12173
12618
  const radialSegments = options.radialSegments ?? 24;
12174
12619
  const segmentsPerRib = options.segmentsPerRib ?? 4;
12175
12620
  for (const [name, value, minimum, maximum] of [
@@ -12180,7 +12625,7 @@ function createHollowPositioningArmTubeMesh(input, options = {}) {
12180
12625
  throw new Error(
12181
12626
  `${name} must be a multiple of four in [${minimum},${maximum}]`
12182
12627
  );
12183
- const { totalLength, bendLength, minimumWallThickness } = dimensions4;
12628
+ const { totalLength, bendLength, minimumWallThickness } = dimensions5;
12184
12629
  const innerRadius = props.innerDiameter / 2;
12185
12630
  const scale = Math.max(totalLength, props.outerDiameter);
12186
12631
  const tolerance = scale * 1e-10;
@@ -12276,14 +12721,14 @@ function HollowPositioningArmTube({
12276
12721
  }
12277
12722
 
12278
12723
  // lib/models/hollowpositioningarmtube/register.tsx
12279
- var model43 = defineModelRenderer({
12724
+ var model47 = defineModelRenderer({
12280
12725
  name: "hollowpositioningarmtube",
12281
12726
  schema: hollowPositioningArmTubeModelDefinitionSchema,
12282
12727
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(HollowPositioningArmTube, { ...props }),
12283
12728
  pads: "none"
12284
12729
  });
12285
- function register43(registry2) {
12286
- registry2.register(model43);
12730
+ function register47(registry2) {
12731
+ registry2.register(model47);
12287
12732
  }
12288
12733
 
12289
12734
  // lib/NemaMotor.tsx
@@ -12542,14 +12987,14 @@ var NEMA17 = (props) => /* @__PURE__ */ jsx(NemaMotor, { ...props, nemaSize: 17
12542
12987
  var NEMA23 = (props) => /* @__PURE__ */ jsx(NemaMotor, { ...props, nemaSize: 23 });
12543
12988
 
12544
12989
  // lib/models/nema/register.tsx
12545
- var model44 = defineModelRenderer({
12990
+ var model48 = defineModelRenderer({
12546
12991
  name: "nema",
12547
12992
  schema: nemaMotorModelDefinitionSchema,
12548
12993
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(NemaMotor, { ...props }),
12549
12994
  pads: "none"
12550
12995
  });
12551
- function register44(registry2) {
12552
- registry2.register(model44);
12996
+ function register48(registry2) {
12997
+ registry2.register(model48);
12553
12998
  }
12554
12999
 
12555
13000
  // lib/models/panscrew/mesh.ts
@@ -12755,14 +13200,14 @@ function PanScrew({ color = "#737e8f", ...props }) {
12755
13200
  }
12756
13201
 
12757
13202
  // lib/models/panscrew/register.tsx
12758
- var model45 = defineModelRenderer({
13203
+ var model49 = defineModelRenderer({
12759
13204
  name: "panscrew",
12760
13205
  schema: panScrewModelDefinitionSchema,
12761
13206
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(PanScrew, { ...props }),
12762
13207
  pads: "none"
12763
13208
  });
12764
- function register45(registry2) {
12765
- registry2.register(model45);
13209
+ function register49(registry2) {
13210
+ registry2.register(model49);
12766
13211
  }
12767
13212
 
12768
13213
  // lib/models/plainbushing/mesh.ts
@@ -12818,34 +13263,34 @@ function PlainBushing({
12818
13263
  }
12819
13264
 
12820
13265
  // lib/models/plainbushing/register.tsx
12821
- var model46 = defineModelRenderer({
13266
+ var model50 = defineModelRenderer({
12822
13267
  name: "plainbushing",
12823
13268
  schema: plainBushingModelDefinitionSchema,
12824
13269
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(PlainBushing, { ...props }),
12825
13270
  pads: "none"
12826
13271
  });
12827
- function register46(registry2) {
12828
- registry2.register(model46);
13272
+ function register50(registry2) {
13273
+ registry2.register(model50);
12829
13274
  }
12830
13275
 
12831
13276
  // lib/models/rigidcoupler/mesh.ts
12832
13277
  import "@jscad/modeling";
12833
13278
  function createRigidCouplerMesh(input) {
12834
13279
  const props = rigidCouplerModelPropsSchema.parse(input);
12835
- const dimensions4 = getRigidCouplerDimensions(props);
12836
- assertShaftMountResolution(dimensions4.screwHoles);
13280
+ const dimensions5 = getRigidCouplerDimensions(props);
13281
+ assertShaftMountResolution(dimensions5.screwHoles);
12837
13282
  const body = createAnnularSleeve({
12838
13283
  outerRadius: props.outerDiameter / 2,
12839
13284
  boreARadius: props.boreDiameter / 2,
12840
13285
  boreBRadius: props.boreBDiameter / 2,
12841
13286
  length: props.length,
12842
13287
  chamfer: props.chamfer,
12843
- stepZ: dimensions4.boreADepth
13288
+ stepZ: dimensions5.boreADepth
12844
13289
  });
12845
13290
  return finishShaftMountMesh(
12846
13291
  subtractShaftMountParts(
12847
13292
  body,
12848
- ...dimensions4.screwHoles.map(createMountingHoleCutter)
13293
+ ...dimensions5.screwHoles.map(createMountingHoleCutter)
12849
13294
  )
12850
13295
  );
12851
13296
  }
@@ -12862,22 +13307,22 @@ function RigidCoupler({
12862
13307
  }
12863
13308
 
12864
13309
  // lib/models/rigidcoupler/register.tsx
12865
- var model47 = defineModelRenderer({
13310
+ var model51 = defineModelRenderer({
12866
13311
  name: "rigidcoupler",
12867
13312
  schema: rigidCouplerModelDefinitionSchema,
12868
13313
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(RigidCoupler, { ...props }),
12869
13314
  pads: "none"
12870
13315
  });
12871
- function register47(registry2) {
12872
- registry2.register(model47);
13316
+ function register51(registry2) {
13317
+ registry2.register(model51);
12873
13318
  }
12874
13319
 
12875
13320
  // lib/models/shaftcollar/mesh.ts
12876
13321
  import "@jscad/modeling";
12877
13322
  function createShaftCollarMesh(input) {
12878
13323
  const props = shaftCollarModelPropsSchema.parse(input);
12879
- const dimensions4 = getShaftCollarDimensions(props);
12880
- assertShaftMountResolution([dimensions4.screwHole]);
13324
+ const dimensions5 = getShaftCollarDimensions(props);
13325
+ assertShaftMountResolution([dimensions5.screwHole]);
12881
13326
  const body = createAnnularSleeve({
12882
13327
  outerRadius: props.outerDiameter / 2,
12883
13328
  boreARadius: props.boreDiameter / 2,
@@ -12887,7 +13332,7 @@ function createShaftCollarMesh(input) {
12887
13332
  return finishShaftMountMesh(
12888
13333
  subtractShaftMountParts(
12889
13334
  body,
12890
- createMountingHoleCutter(dimensions4.screwHole)
13335
+ createMountingHoleCutter(dimensions5.screwHole)
12891
13336
  )
12892
13337
  );
12893
13338
  }
@@ -12901,14 +13346,14 @@ function ShaftCollar({ color = "#737e8f", ...props }) {
12901
13346
  }
12902
13347
 
12903
13348
  // lib/models/shaftcollar/register.tsx
12904
- var model48 = defineModelRenderer({
13349
+ var model52 = defineModelRenderer({
12905
13350
  name: "shaftcollar",
12906
13351
  schema: shaftCollarModelDefinitionSchema,
12907
13352
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(ShaftCollar, { ...props }),
12908
13353
  pads: "none"
12909
13354
  });
12910
- function register48(registry2) {
12911
- registry2.register(model48);
13355
+ function register52(registry2) {
13356
+ registry2.register(model52);
12912
13357
  }
12913
13358
 
12914
13359
  // lib/mechanical/sheet-metal-mesh.ts
@@ -12953,7 +13398,7 @@ function createSheetMetalMesh(input) {
12953
13398
  throw new Error(`No ${hole.panel} panel on ${profile}`);
12954
13399
  }
12955
13400
  for (const panel of panels) {
12956
- const length15 = panel === "base" ? baseLength : flangeHeight;
13401
+ const length16 = panel === "base" ? baseLength : flangeHeight;
12957
13402
  const holes = props.holes.filter((hole) => hole.panel === panel).map(holeOutline);
12958
13403
  const bounds = holes.map((outline2) => ({
12959
13404
  minU: Math.min(...outline2.map((p) => p.u)),
@@ -12962,17 +13407,17 @@ function createSheetMetalMesh(input) {
12962
13407
  maxV: Math.max(...outline2.map((p) => p.v))
12963
13408
  }));
12964
13409
  for (const [i, box] of bounds.entries()) {
12965
- if (box.minU <= -length15 / 2 || box.maxU >= length15 / 2 || box.minV <= -width10 / 2 || box.maxV >= width10 / 2)
13410
+ if (box.minU <= -length16 / 2 || box.maxU >= length16 / 2 || box.minV <= -width10 / 2 || box.maxV >= width10 / 2)
12966
13411
  throw new Error(`Hole crosses ${panel} panel edge or bend tangent`);
12967
13412
  for (const previous of bounds.slice(0, i))
12968
13413
  if (box.minU <= previous.maxU && box.maxU >= previous.minU && box.minV <= previous.maxV && box.maxV >= previous.minV)
12969
13414
  throw new Error("Hole bounding boxes must not overlap");
12970
13415
  }
12971
13416
  const outline = [
12972
- { u: -length15 / 2, v: -width10 / 2 },
12973
- { u: length15 / 2, v: -width10 / 2 },
12974
- { u: length15 / 2, v: width10 / 2 },
12975
- { u: -length15 / 2, v: width10 / 2 }
13417
+ { u: -length16 / 2, v: -width10 / 2 },
13418
+ { u: length16 / 2, v: -width10 / 2 },
13419
+ { u: length16 / 2, v: width10 / 2 },
13420
+ { u: -length16 / 2, v: width10 / 2 }
12976
13421
  ];
12977
13422
  const loops = [outline, ...holes.map((hole) => [...hole].reverse())];
12978
13423
  const points = loops.flat();
@@ -13062,14 +13507,14 @@ function SheetMetal({ color = "#737e8f", ...props }) {
13062
13507
  }
13063
13508
 
13064
13509
  // lib/models/sheetmetal/register.tsx
13065
- var model49 = defineModelRenderer({
13510
+ var model53 = defineModelRenderer({
13066
13511
  name: "sheetmetal",
13067
13512
  schema: sheetMetalModelDefinitionSchema,
13068
13513
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(SheetMetal, { ...props }),
13069
13514
  pads: "none"
13070
13515
  });
13071
- function register49(registry2) {
13072
- registry2.register(model49);
13516
+ function register53(registry2) {
13517
+ registry2.register(model53);
13073
13518
  }
13074
13519
 
13075
13520
  // lib/models/splitwasher/mesh.ts
@@ -13132,14 +13577,14 @@ function SplitWasher({ color = "#929ba6", ...props }) {
13132
13577
  }
13133
13578
 
13134
13579
  // lib/models/splitwasher/register.tsx
13135
- var model50 = defineModelRenderer({
13580
+ var model54 = defineModelRenderer({
13136
13581
  name: "splitwasher",
13137
13582
  schema: splitWasherModelDefinitionSchema,
13138
13583
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(SplitWasher, { ...props }),
13139
13584
  pads: "none"
13140
13585
  });
13141
- function register50(registry2) {
13142
- registry2.register(model50);
13586
+ function register54(registry2) {
13587
+ registry2.register(model54);
13143
13588
  }
13144
13589
 
13145
13590
  // lib/SpurGear.tsx
@@ -13151,14 +13596,14 @@ function SpurGear({ color = "#737e8f", ...props }) {
13151
13596
  }
13152
13597
 
13153
13598
  // lib/models/spurgear/register.tsx
13154
- var model51 = defineModelRenderer({
13599
+ var model55 = defineModelRenderer({
13155
13600
  name: "spurgear",
13156
13601
  schema: spurGearModelDefinitionSchema,
13157
13602
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(SpurGear, { ...props }),
13158
13603
  pads: "none"
13159
13604
  });
13160
- function register51(registry2) {
13161
- registry2.register(model51);
13605
+ function register55(registry2) {
13606
+ registry2.register(model55);
13162
13607
  }
13163
13608
 
13164
13609
  // lib/models/threadedrod/mesh.ts
@@ -13248,14 +13693,14 @@ function ThreadedRod({ color = "#737e8f", ...props }) {
13248
13693
  }
13249
13694
 
13250
13695
  // lib/models/threadedrod/register.tsx
13251
- var model52 = defineModelRenderer({
13696
+ var model56 = defineModelRenderer({
13252
13697
  name: "threadedrod",
13253
13698
  schema: threadedRodModelDefinitionSchema,
13254
13699
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(ThreadedRod, { ...props }),
13255
13700
  pads: "none"
13256
13701
  });
13257
- function register52(registry2) {
13258
- registry2.register(model52);
13702
+ function register56(registry2) {
13703
+ registry2.register(model56);
13259
13704
  }
13260
13705
 
13261
13706
  // lib/models/torsionspring/mesh.ts
@@ -13344,20 +13789,20 @@ function TorsionSpring({
13344
13789
  }
13345
13790
 
13346
13791
  // lib/models/torsionspring/register.tsx
13347
- var model53 = defineModelRenderer({
13792
+ var model57 = defineModelRenderer({
13348
13793
  name: "torsionspring",
13349
13794
  schema: torsionSpringModelDefinitionSchema,
13350
13795
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(TorsionSpring, { ...props }),
13351
13796
  pads: "none"
13352
13797
  });
13353
- function register53(registry2) {
13354
- registry2.register(model53);
13798
+ function register57(registry2) {
13799
+ registry2.register(model57);
13355
13800
  }
13356
13801
 
13357
13802
  // lib/models/tslotextrusion/mesh.ts
13358
13803
  function createTSlotExtrusionMesh(input = {}) {
13359
13804
  const props = tSlotExtrusionModelPropsSchema.parse(input);
13360
- const { width: width10, height: height10, length: length15, cornerRadius, lipThickness, pocketDepth } = props;
13805
+ const { width: width10, height: height10, length: length16, cornerRadius, lipThickness, pocketDepth } = props;
13361
13806
  const slot = props.slotWidth / 2;
13362
13807
  const pocket = props.pocketWidth / 2;
13363
13808
  const depth = lipThickness + pocketDepth;
@@ -13394,7 +13839,7 @@ function createTSlotExtrusionMesh(input = {}) {
13394
13839
  outer,
13395
13840
  holes: props.boreDiameter > 0 ? [circularProfile(0, 0, props.boreDiameter / 2)] : [],
13396
13841
  start: 0,
13397
- end: length15
13842
+ end: length16
13398
13843
  });
13399
13844
  }
13400
13845
 
@@ -13410,14 +13855,14 @@ function TSlotExtrusion({
13410
13855
  }
13411
13856
 
13412
13857
  // lib/models/tslotextrusion/register.tsx
13413
- var model54 = defineModelRenderer({
13858
+ var model58 = defineModelRenderer({
13414
13859
  name: "tslotextrusion",
13415
13860
  schema: tSlotExtrusionModelDefinitionSchema,
13416
13861
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(TSlotExtrusion, { ...props }),
13417
13862
  pads: "none"
13418
13863
  });
13419
- function register54(registry2) {
13420
- registry2.register(model54);
13864
+ function register58(registry2) {
13865
+ registry2.register(model58);
13421
13866
  }
13422
13867
 
13423
13868
  // lib/models/tslotgusset/mesh.ts
@@ -13463,14 +13908,14 @@ function TSlotGusset({ color = "#8995a3", ...props }) {
13463
13908
  }
13464
13909
 
13465
13910
  // lib/models/tslotgusset/register.tsx
13466
- var model55 = defineModelRenderer({
13911
+ var model59 = defineModelRenderer({
13467
13912
  name: "tslotgusset",
13468
13913
  schema: tSlotGussetModelDefinitionSchema,
13469
13914
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(TSlotGusset, { ...props }),
13470
13915
  pads: "none"
13471
13916
  });
13472
- function register55(registry2) {
13473
- registry2.register(model55);
13917
+ function register59(registry2) {
13918
+ registry2.register(model59);
13474
13919
  }
13475
13920
 
13476
13921
  // lib/models/tslotinsidecorner/mesh.ts
@@ -13544,14 +13989,14 @@ function TSlotInsideCorner({
13544
13989
  }
13545
13990
 
13546
13991
  // lib/models/tslotinsidecorner/register.tsx
13547
- var model56 = defineModelRenderer({
13992
+ var model60 = defineModelRenderer({
13548
13993
  name: "tslotinsidecorner",
13549
13994
  schema: tSlotInsideCornerModelDefinitionSchema,
13550
13995
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(TSlotInsideCorner, { ...props }),
13551
13996
  pads: "none"
13552
13997
  });
13553
- function register56(registry2) {
13554
- registry2.register(model56);
13998
+ function register60(registry2) {
13999
+ registry2.register(model60);
13555
14000
  }
13556
14001
 
13557
14002
  // lib/mechanical/worm-gear-mesh.ts
@@ -13736,20 +14181,18 @@ function WormGear({ color = "#737e8f", ...props }) {
13736
14181
  }
13737
14182
 
13738
14183
  // lib/models/wormgear/register.tsx
13739
- var model57 = defineModelRenderer({
14184
+ var model61 = defineModelRenderer({
13740
14185
  name: "wormgear",
13741
14186
  schema: wormGearModelDefinitionSchema,
13742
14187
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(WormGear, { ...props }),
13743
14188
  pads: "none"
13744
14189
  });
13745
- function register57(registry2) {
13746
- registry2.register(model57);
14190
+ function register61(registry2) {
14191
+ registry2.register(model61);
13747
14192
  }
13748
14193
 
13749
14194
  // lib/generated/model-renderers.ts
13750
14195
  function registerAllModelRenderers(registry2) {
13751
- register30(registry2);
13752
- register31(registry2);
13753
14196
  register32(registry2);
13754
14197
  register33(registry2);
13755
14198
  register34(registry2);
@@ -13776,6 +14219,10 @@ function registerAllModelRenderers(registry2) {
13776
14219
  register55(registry2);
13777
14220
  register56(registry2);
13778
14221
  register57(registry2);
14222
+ register58(registry2);
14223
+ register59(registry2);
14224
+ register60(registry2);
14225
+ register61(registry2);
13779
14226
  }
13780
14227
 
13781
14228
  // lib/default-model-registry.ts
@@ -14117,7 +14564,7 @@ import { fp as fp10 } from "@tscircuit/footprinter";
14117
14564
  var ChipBody = ({
14118
14565
  center,
14119
14566
  width: width10,
14120
- length: length15,
14567
+ length: length16,
14121
14568
  height: height10,
14122
14569
  heightAboveSurface: heightAboveSurface2 = 0.15,
14123
14570
  color = "#555",
@@ -14134,24 +14581,24 @@ var ChipBody = ({
14134
14581
  }) => {
14135
14582
  const straightHeight = height10 * straightHeightRatio;
14136
14583
  const taperHeight = height10 - straightHeight;
14137
- const taperInset = Math.min(width10, length15) * taperRatio;
14584
+ const taperInset = Math.min(width10, length16) * taperRatio;
14138
14585
  const faceWidth = Math.max(width10 - taperInset, width10 * faceRatio);
14139
- const faceLength = Math.max(length15 - taperInset, length15 * faceRatio);
14140
- const defaultNotchRadius = Math.min(width10, length15) * 0.12;
14586
+ const faceLength = Math.max(length16 - taperInset, length16 * faceRatio);
14587
+ const defaultNotchRadius = Math.min(width10, length16) * 0.12;
14141
14588
  const actualNotchRadius = notchRadius ?? defaultNotchRadius;
14142
14589
  const defaultNotchPosition = {
14143
14590
  x: 0,
14144
- y: length15 / 2 - actualNotchRadius * 0.25,
14591
+ y: length16 / 2 - actualNotchRadius * 0.25,
14145
14592
  z: height10
14146
14593
  };
14147
14594
  const actualNotchPosition = notchPosition ?? defaultNotchPosition;
14148
14595
  const body = /* @__PURE__ */ jsxs(Union, { children: [
14149
14596
  /* @__PURE__ */ jsxs(Hull, { children: [
14150
14597
  /* @__PURE__ */ jsx(Translate, { z: 5e-3, children: /* @__PURE__ */ jsx(Cuboid, { size: [faceWidth, faceLength, 0.01] }) }),
14151
- /* @__PURE__ */ jsx(Translate, { z: straightHeight, children: /* @__PURE__ */ jsx(Cuboid, { size: [width10, length15, 0.01] }) })
14598
+ /* @__PURE__ */ jsx(Translate, { z: straightHeight, children: /* @__PURE__ */ jsx(Cuboid, { size: [width10, length16, 0.01] }) })
14152
14599
  ] }),
14153
14600
  /* @__PURE__ */ jsxs(Hull, { children: [
14154
- /* @__PURE__ */ jsx(Translate, { z: straightHeight, children: /* @__PURE__ */ jsx(Cuboid, { size: [width10, length15, 0.01] }) }),
14601
+ /* @__PURE__ */ jsx(Translate, { z: straightHeight, children: /* @__PURE__ */ jsx(Cuboid, { size: [width10, length16, 0.01] }) }),
14155
14602
  /* @__PURE__ */ jsx(Translate, { z: straightHeight + taperHeight, children: /* @__PURE__ */ jsx(Cuboid, { size: [faceWidth, faceLength, 0.01] }) })
14156
14603
  ] })
14157
14604
  ] });
@@ -14168,7 +14615,7 @@ var ChipBody = ({
14168
14615
  let finalBody = body;
14169
14616
  if (chamferSize > 0) {
14170
14617
  const xOffset = width10 / 2;
14171
- const yOffset = length15 / 2;
14618
+ const yOffset = length16 / 2;
14172
14619
  finalBody = /* @__PURE__ */ jsxs(Subtract, { children: [
14173
14620
  body,
14174
14621
  chamferCutout(xOffset, yOffset),
@@ -14198,8 +14645,8 @@ function getExpandedStroke(strokeInput, width10) {
14198
14645
  function getNormal(p1, p2) {
14199
14646
  const dx = p2.x - p1.x;
14200
14647
  const dy = p2.y - p1.y;
14201
- const length15 = Math.sqrt(dx * dx + dy * dy);
14202
- return { x: -dy / length15, y: dx / length15 };
14648
+ const length16 = Math.sqrt(dx * dx + dy * dy);
14649
+ return { x: -dy / length16, y: dx / length16 };
14203
14650
  }
14204
14651
  function addPoint(point, normal, factor) {
14205
14652
  const newPoint = {
@@ -15867,11 +16314,11 @@ var FemaleHeaderRow = ({
15867
16314
  // lib/PushButton.tsx
15868
16315
  var PushButton = ({
15869
16316
  width: width10,
15870
- length: length15,
16317
+ length: length16,
15871
16318
  innerDiameter = 1
15872
16319
  }) => {
15873
16320
  const bodyWidth = width10;
15874
- const bodyLength10 = length15;
16321
+ const bodyLength10 = length16;
15875
16322
  const bodyHeight = width10 * 0.7;
15876
16323
  const legWidth = innerDiameter / 2.5;
15877
16324
  return /* @__PURE__ */ jsxs(Fragment2, { children: [
@@ -19805,12 +20252,12 @@ var JstSh = ({ footprint = "jst6_sh" }) => {
19805
20252
  };
19806
20253
 
19807
20254
  // lib/Crystal.tsx
19808
- var getTerminalPoints = ([centerX, centerY], width10, length15, chamfer, isPinOne) => {
20255
+ var getTerminalPoints = ([centerX, centerY], width10, length16, chamfer, isPinOne) => {
19809
20256
  const xDirection = Math.sign(centerX);
19810
20257
  const yDirection = Math.sign(centerY);
19811
20258
  const halfWidth = width10 / 2;
19812
- const halfLength = length15 / 2;
19813
- const innerChamfer = isPinOne ? Math.min(0.32, length15 * 0.36) : 0;
20259
+ const halfLength = length16 / 2;
20260
+ const innerChamfer = isPinOne ? Math.min(0.32, length16 * 0.36) : 0;
19814
20261
  const outerChamfer = Math.min(chamfer, halfWidth, halfLength);
19815
20262
  const points = [
19816
20263
  [-halfWidth, -halfLength],
@@ -19830,13 +20277,13 @@ var getTerminalPoints = ([centerX, centerY], width10, length15, chamfer, isPinOn
19830
20277
  };
19831
20278
  var getRoundedRectProfile = ({
19832
20279
  width: width10,
19833
- length: length15,
20280
+ length: length16,
19834
20281
  radius,
19835
20282
  height: height10,
19836
20283
  z
19837
20284
  }) => {
19838
20285
  const x = width10 / 2 - radius;
19839
- const y = length15 / 2 - radius;
20286
+ const y = length16 / 2 - radius;
19840
20287
  return [
19841
20288
  [-x, -y],
19842
20289
  [x, -y],
@@ -19980,12 +20427,12 @@ var FPC = ({
19980
20427
  const contactRows = Array.from({ length: pinCount }, (_, index) => {
19981
20428
  const isUpperRow = staggered && index % 2 === 1 !== reverse;
19982
20429
  const y = staggered ? isUpperRow ? rowPitch / 2 : -rowPitch / 2 : 0;
19983
- const length15 = isUpperRow ? topPadLength : bottomPadLength;
20430
+ const length16 = isUpperRow ? topPadLength : bottomPadLength;
19984
20431
  return {
19985
20432
  index,
19986
20433
  x: contactStartX + index * pitch,
19987
20434
  y,
19988
- length: length15
20435
+ length: length16
19989
20436
  };
19990
20437
  });
19991
20438
  const contactMaxY = Math.max(
@@ -20537,7 +20984,7 @@ var Led2835 = ({
20537
20984
  };
20538
20985
 
20539
20986
  // lib/RJ45.tsx
20540
- var range2 = (length15) => Array.from({ length: length15 }, (_, index) => index);
20987
+ var range2 = (length16) => Array.from({ length: length16 }, (_, index) => index);
20541
20988
  var RJ45 = ({
20542
20989
  bodyWidth = 16.26,
20543
20990
  bodyDepth = 15.88,
@@ -21357,10 +21804,10 @@ var SOT143 = ({ footprint = "sot143" }) => {
21357
21804
  var Footprinter3d = ({ footprint }) => {
21358
21805
  const modelFn = mp.string(footprint.split("_", 1)[0]).params().fn;
21359
21806
  if (mp.getModelNames().includes(modelFn)) {
21360
- const model58 = mp.string(footprint).json();
21361
- const renderer = modelRendererRegistry.get(model58.fn);
21807
+ const model62 = mp.string(footprint).json();
21808
+ const renderer = modelRendererRegistry.get(model62.fn);
21362
21809
  if (renderer) {
21363
- return renderer.render(model58);
21810
+ return renderer.render(model62);
21364
21811
  }
21365
21812
  }
21366
21813
  let normalizedFootprint = footprint;
@@ -22317,9 +22764,11 @@ export {
22317
22764
  CableGrommet,
22318
22765
  ClampingShaftCollar,
22319
22766
  CompressionSpring,
22767
+ DowelPin,
22320
22768
  FlangedBushing,
22321
22769
  FlatHeadScrew,
22322
22770
  Fragment,
22771
+ HeatSetInsert,
22323
22772
  HelicalGear,
22324
22773
  HexBolt,
22325
22774
  HexNut,
@@ -22355,10 +22804,14 @@ export {
22355
22804
  createClampingShaftCollarMesh,
22356
22805
  createCompressionSpringGeom,
22357
22806
  createCompressionSpringMesh,
22807
+ createDowelPinGeom,
22808
+ createDowelPinMesh,
22358
22809
  createFlangedBushingGeom,
22359
22810
  createFlangedBushingMesh,
22360
22811
  createFlatHeadScrewGeom,
22361
22812
  createFlatHeadScrewMesh,
22813
+ createHeatSetInsertGeom,
22814
+ createHeatSetInsertMesh,
22362
22815
  createHelicalGearGeom,
22363
22816
  createHelicalGearMesh,
22364
22817
  createHexBoltGeom,