jscad-electronics 0.0.197 → 0.0.199

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.d.ts CHANGED
@@ -3,7 +3,7 @@ import { BufferGeometry } from 'three';
3
3
  import * as jscadModeling from '@jscad/modeling';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import * as _jscad_modeling_src_geometries_types from '@jscad/modeling/src/geometries/types';
6
- import { FlatHeadScrewModelPropsInput, SpurGearModelPropsInput, HelicalGearModelPropsInput, HexBoltModelPropsInput, HexSocketBoltModelPropsInput, NemaMotorModelPropsInput, PanScrewModelPropsInput, PlainBushingModelPropsInput, SheetMetalModelPropsInput, WormGearModelPropsInput } from '@tscircuit/modelprinter';
6
+ import { ButtonScrewModelPropsInput, FlangedBushingModelPropsInput, FlatHeadScrewModelPropsInput, SpurGearModelPropsInput, HelicalGearModelPropsInput, HexBoltModelPropsInput, HexSocketBoltModelPropsInput, NemaMotorModelPropsInput, PanScrewModelPropsInput, PlainBushingModelPropsInput, SheetMetalModelPropsInput, WormGearModelPropsInput } from '@tscircuit/modelprinter';
7
7
 
8
8
  type VNode = {
9
9
  type: any;
@@ -26,6 +26,40 @@ type RenderResult = {
26
26
 
27
27
  declare function convertCSGToThreeGeom(csg: any): BufferGeometry;
28
28
 
29
+ /** Indexed counterclockwise triangles in millimeters. */
30
+ interface ButtonScrewMesh {
31
+ positions: number[];
32
+ indices: number[];
33
+ }
34
+ /** Renderer resolution affects tessellation only, never model specifications. */
35
+ interface ButtonScrewMeshOptions {
36
+ radialSegments?: number;
37
+ segmentsPerPitch?: number;
38
+ }
39
+ /** Closed nominal surface: bearing z=0, tip -length, blind hex socket above. */
40
+ declare function createButtonScrewMesh(input: ButtonScrewModelPropsInput, options?: ButtonScrewMeshOptions): ButtonScrewMesh;
41
+
42
+ type ButtonScrewProps = ButtonScrewModelPropsInput & {
43
+ color?: string;
44
+ };
45
+ declare function createButtonScrewGeom(input: ButtonScrewModelPropsInput, resolution?: ButtonScrewMeshOptions): _jscad_modeling_src_geometries_types.Geom3;
46
+ declare function ButtonScrew({ color, ...props }: ButtonScrewProps): react_jsx_runtime.JSX.Element;
47
+
48
+ /** Shared ring vertices and outward counterclockwise triangles, in millimeters. */
49
+ interface FlangedBushingMesh {
50
+ positions: number[];
51
+ indices: number[];
52
+ }
53
+ /** Integral flange at Z=0..flangeThickness; total length includes the flange. */
54
+ declare function createFlangedBushingMesh(input: FlangedBushingModelPropsInput): FlangedBushingMesh;
55
+
56
+ type FlangedBushingProps = FlangedBushingModelPropsInput & {
57
+ color?: string;
58
+ };
59
+ /** Square integral flange at the Z=0 end; bore continues through overall length. */
60
+ declare function createFlangedBushingGeom(input: FlangedBushingModelPropsInput): _jscad_modeling_src_geometries_types.Geom3;
61
+ declare function FlangedBushing({ color, ...props }: FlangedBushingProps): react_jsx_runtime.JSX.Element;
62
+
29
63
  interface FlatHeadScrewMeshOptions {
30
64
  radialSegments?: number;
31
65
  threadStepsPerTurn?: number;
@@ -210,4 +244,4 @@ declare function createJSCADRenderer(jscad: typeof jscadModeling): {
210
244
  };
211
245
  };
212
246
 
213
- export { type ColoredGeom, FlatHeadScrew, type FlatHeadScrewMesh, type FlatHeadScrewMeshOptions, type FlatHeadScrewProps, Fragment, HelicalGear, type HelicalGearMesh, type HelicalGearProps, HexBolt, type HexBoltMesh, type HexBoltMeshOptions, type HexBoltProps, HexSocketBolt, type HexSocketBoltMesh, type HexSocketBoltProps, NEMA17, NEMA23, NEMA8, type NemaFrameMotorProps, NemaMotor, type NemaMotorProps, PanScrew, type PanScrewMesh, type PanScrewMeshOptions, type PanScrewProps, PlainBushing, type PlainBushingMesh, type PlainBushingProps, type RenderResult, SheetMetal, type SheetMetalMesh, type SheetMetalProps, SpurGear, type SpurGearMesh, type SpurGearProps, type VNode, WormGear, type WormGearMesh, type WormGearProps, convertCSGToThreeGeom, createFlatHeadScrewGeom, createFlatHeadScrewMesh, createHelicalGearGeom, createHelicalGearMesh, createHexBoltGeom, createHexBoltMesh, createHexSocketBoltGeom, createHexSocketBoltMesh, createJSCADRenderer, createPanScrewGeom, createPanScrewMesh, createPlainBushingGeom, createPlainBushingMesh, createSheetMetalGeom, createSheetMetalMesh, createSpurGearGeom, createSpurGearMesh, createWormGearGeom, createWormGearMesh, getJscadModelForFootprint, getJscadModelForFootprintWithPads, h };
247
+ export { ButtonScrew, type ButtonScrewMesh, type ButtonScrewMeshOptions, type ButtonScrewProps, type ColoredGeom, FlangedBushing, type FlangedBushingMesh, type FlangedBushingProps, FlatHeadScrew, type FlatHeadScrewMesh, type FlatHeadScrewMeshOptions, type FlatHeadScrewProps, Fragment, HelicalGear, type HelicalGearMesh, type HelicalGearProps, HexBolt, type HexBoltMesh, type HexBoltMeshOptions, type HexBoltProps, HexSocketBolt, type HexSocketBoltMesh, type HexSocketBoltProps, NEMA17, NEMA23, NEMA8, type NemaFrameMotorProps, NemaMotor, type NemaMotorProps, PanScrew, type PanScrewMesh, type PanScrewMeshOptions, type PanScrewProps, PlainBushing, type PlainBushingMesh, type PlainBushingProps, type RenderResult, SheetMetal, type SheetMetalMesh, type SheetMetalProps, SpurGear, type SpurGearMesh, type SpurGearProps, type VNode, WormGear, type WormGearMesh, type WormGearProps, convertCSGToThreeGeom, createButtonScrewGeom, createButtonScrewMesh, createFlangedBushingGeom, createFlangedBushingMesh, createFlatHeadScrewGeom, createFlatHeadScrewMesh, createHelicalGearGeom, createHelicalGearMesh, createHexBoltGeom, createHexBoltMesh, createHexSocketBoltGeom, createHexSocketBoltMesh, createJSCADRenderer, createPanScrewGeom, createPanScrewMesh, createPlainBushingGeom, createPlainBushingMesh, createSheetMetalGeom, createSheetMetalMesh, createSpurGearGeom, createSpurGearMesh, createWormGearGeom, createWormGearMesh, getJscadModelForFootprint, getJscadModelForFootprintWithPads, h };
package/dist/vanilla.js CHANGED
@@ -179,28 +179,28 @@ var FootprintPlatedHole = ({
179
179
  throw new Error("Shape not supported: " + hole.shape);
180
180
  };
181
181
 
182
- // lib/models/flatheadscrew/register.tsx
183
- import { flatHeadScrewModelDefinitionSchema } from "@tscircuit/modelprinter";
182
+ // lib/models/buttonscrew/register.tsx
183
+ import { buttonScrewModelDefinitionSchema } from "@tscircuit/modelprinter";
184
184
 
185
185
  // lib/model-registry.ts
186
- function defineModelRenderer(model12) {
187
- return model12;
186
+ function defineModelRenderer(model14) {
187
+ return model14;
188
188
  }
189
189
  var ModelRendererRegistry = class {
190
190
  models = /* @__PURE__ */ new Map();
191
- register(model12) {
192
- if (typeof model12.name !== "string" || !/^[a-z]+$/.test(model12.name)) {
191
+ register(model14) {
192
+ if (typeof model14.name !== "string" || !/^[a-z]+$/.test(model14.name)) {
193
193
  throw new Error(
194
194
  "Model renderer names must contain only lowercase letters"
195
195
  );
196
196
  }
197
- if (this.models.has(model12.name)) {
198
- throw new Error(`Model renderer "${model12.name}" is already registered`);
197
+ if (this.models.has(model14.name)) {
198
+ throw new Error(`Model renderer "${model14.name}" is already registered`);
199
199
  }
200
- if (model12.pads !== "none" && model12.pads !== "footprinter") {
200
+ if (model14.pads !== "none" && model14.pads !== "footprinter") {
201
201
  throw new Error('Model renderer pads must be "none" or "footprinter"');
202
202
  }
203
- const { name, schema, render: render2, pads } = model12;
203
+ const { name, schema, render: render2, pads } = model14;
204
204
  this.models.set(name, {
205
205
  name,
206
206
  schema,
@@ -226,6 +226,218 @@ var ModelRendererRegistry = class {
226
226
  }
227
227
  };
228
228
 
229
+ // lib/models/buttonscrew/mesh.ts
230
+ import {
231
+ buttonScrewModelPropsSchema,
232
+ getButtonScrewDimensions
233
+ } from "@tscircuit/modelprinter";
234
+ function resolution(options) {
235
+ const radial = options.radialSegments ?? 96;
236
+ const axial = options.segmentsPerPitch ?? 32;
237
+ if (!Number.isInteger(radial) || radial < 24 || radial > 192 || radial % 12 !== 0 || !Number.isInteger(axial) || axial < 8 || axial > 64)
238
+ throw new Error(
239
+ "Mesh resolution limit: radial segments must be a multiple of 12 in [24,192], pitch segments an integer in [8,64]"
240
+ );
241
+ return { radial, axial };
242
+ }
243
+ function surface(segments) {
244
+ const positions = [], indices = [];
245
+ const ring = (z, radius) => {
246
+ const start = positions.length / 3;
247
+ for (let i = 0; i < segments; i++) {
248
+ const angle = i * 2 * Math.PI / segments;
249
+ const r = radius(angle);
250
+ positions.push(r * Math.cos(angle), r * Math.sin(angle), z);
251
+ }
252
+ return start;
253
+ };
254
+ const connect = (a, b) => {
255
+ for (let i = 0; i < segments; i++) {
256
+ const n = (i + 1) % segments;
257
+ indices.push(a + i, a + n, b + n, a + i, b + n, b + i);
258
+ }
259
+ };
260
+ const cap = (start, z, up) => {
261
+ const center = positions.length / 3;
262
+ positions.push(0, 0, z);
263
+ for (let i = 0; i < segments; i++) {
264
+ const n = (i + 1) % segments;
265
+ indices.push(center, start + (up ? i : n), start + (up ? n : i));
266
+ }
267
+ };
268
+ return { positions, indices, ring, connect, cap };
269
+ }
270
+ function hexRadius(angle, acrossFlats) {
271
+ const period = Math.PI / 3;
272
+ const distance2 = ((angle - Math.PI / 2 + period / 2) % period + period) % period - period / 2;
273
+ return acrossFlats / 2 / Math.cos(distance2);
274
+ }
275
+ function threadDistance(z, angle, pitch, hand = 1) {
276
+ const phase = ((z / pitch - hand * angle / (2 * Math.PI)) % 1 + 1) % 1;
277
+ return Math.min(phase, 1 - phase);
278
+ }
279
+ function createButtonScrewMesh(input, options = {}) {
280
+ const props = buttonScrewModelPropsSchema.parse(input);
281
+ const d = getButtonScrewDimensions(input);
282
+ const { radial, axial } = resolution(options);
283
+ const steps = Math.max(2, Math.ceil(props.length / d.threadPitch * axial));
284
+ if (steps > 24e3 || !Number.isFinite(steps))
285
+ throw new Error("Mesh resolution limit: too many thread turns");
286
+ const m = surface(radial);
287
+ const radius = d.diameter / 2;
288
+ const depth = (d.diameter - d.threadMinorDiameter) / 2;
289
+ const fillet = d.underHeadRadius;
290
+ const levels = new Set(
291
+ props.showThreads ? Array.from(
292
+ { length: steps + 1 },
293
+ (_, i) => -props.length + props.length * i / steps
294
+ ) : [-props.length, 0]
295
+ );
296
+ levels.add(-props.length + d.tipChamfer);
297
+ levels.add(-d.threadPitch);
298
+ for (let i = 0; i <= 16; i++)
299
+ levels.add(-fillet + fillet * Math.sin(i * Math.PI / 32));
300
+ let previous = -1;
301
+ const shaftLevels = [...levels].sort((a, b) => a - b).filter((z, index, sorted) => index === 0 || z - sorted[index - 1] > 1e-10);
302
+ for (const z of shaftLevels) {
303
+ const current = m.ring(z, (angle) => {
304
+ const envelope = z >= -fillet ? radius + fillet - Math.sqrt(Math.max(0, fillet ** 2 - (z + fillet) ** 2)) : radius;
305
+ const groove = Math.min(
306
+ depth,
307
+ Math.max(
308
+ 0,
309
+ (threadDistance(z + props.length, angle, d.threadPitch) - 1 / 16) * d.threadPitch * Math.sqrt(3)
310
+ )
311
+ );
312
+ const threaded = envelope - (props.showThreads ? groove * Math.min(1, -z / d.threadPitch) : 0);
313
+ const tip = z + props.length < d.tipChamfer ? radius - (d.tipChamfer - (z + props.length)) : Infinity;
314
+ return Math.min(threaded, tip);
315
+ });
316
+ if (previous < 0) m.cap(current, z, false);
317
+ else m.connect(previous, current);
318
+ previous = current;
319
+ }
320
+ const add = (z, radiusAt) => {
321
+ const current = m.ring(z, radiusAt);
322
+ m.connect(previous, current);
323
+ previous = current;
324
+ };
325
+ add(0, () => d.headDiameter / 2);
326
+ for (let i = 1; i <= 24; i++) {
327
+ const z = d.headHeight * i / 24;
328
+ add(
329
+ z,
330
+ () => d.crownArcCenterR + Math.sqrt(
331
+ Math.max(0, d.crownRadius ** 2 - (z - d.crownArcCenterZ) ** 2)
332
+ )
333
+ );
334
+ }
335
+ add(d.topZ, (angle) => hexRadius(angle, d.socketWidth));
336
+ add(d.topZ - d.socketDepth, (angle) => hexRadius(angle, d.socketWidth));
337
+ m.cap(previous, d.topZ - d.socketDepth, true);
338
+ return { positions: m.positions, indices: m.indices };
339
+ }
340
+
341
+ // lib/mechanical/indexedMeshToGeom3.ts
342
+ import jscad from "@jscad/modeling";
343
+ function indexedMeshToGeom3(mesh) {
344
+ const polygons = [];
345
+ for (let i = 0; i < mesh.indices.length; i += 3)
346
+ polygons.push(
347
+ mesh.indices.slice(i, i + 3).map((index) => [
348
+ mesh.positions[index * 3],
349
+ mesh.positions[index * 3 + 1],
350
+ mesh.positions[index * 3 + 2]
351
+ ])
352
+ );
353
+ return jscad.geometries.geom3.fromPoints(polygons);
354
+ }
355
+
356
+ // lib/models/buttonscrew/ButtonScrew.tsx
357
+ function createButtonScrewGeom(input, resolution2) {
358
+ return indexedMeshToGeom3(createButtonScrewMesh(input, resolution2));
359
+ }
360
+ function ButtonScrew({ color = "#737e8f", ...props }) {
361
+ return /* @__PURE__ */ jsx(Colorize, { color, children: /* @__PURE__ */ jsx(Custom, { geometry: createButtonScrewGeom(props) }) });
362
+ }
363
+
364
+ // lib/models/buttonscrew/register.tsx
365
+ var model = defineModelRenderer({
366
+ name: "buttonscrew",
367
+ schema: buttonScrewModelDefinitionSchema,
368
+ render: ({ fn, ...props }) => /* @__PURE__ */ jsx(ButtonScrew, { ...props }),
369
+ pads: "none"
370
+ });
371
+ function register(registry) {
372
+ registry.register(model);
373
+ }
374
+
375
+ // lib/models/flangedbushing/register.tsx
376
+ import { flangedBushingModelDefinitionSchema } from "@tscircuit/modelprinter";
377
+
378
+ // lib/models/flangedbushing/mesh.ts
379
+ import {
380
+ flangedBushingModelPropsSchema,
381
+ getFlangedBushingDimensions
382
+ } from "@tscircuit/modelprinter";
383
+ function createFlangedBushingMesh(input) {
384
+ const props = flangedBushingModelPropsSchema.parse(input);
385
+ const d = getFlangedBushingDimensions(props);
386
+ const ri = d.innerDiameter / 2;
387
+ const ro = d.outerDiameter / 2;
388
+ const rf = d.flangeDiameter / 2;
389
+ const profile = [
390
+ [rf, 0],
391
+ [rf, d.shoulderZ],
392
+ [ro, d.shoulderZ],
393
+ [ro, d.length],
394
+ [ri, d.length],
395
+ [ri, 0]
396
+ ];
397
+ const segments = 96;
398
+ const positions = [];
399
+ const indices = [];
400
+ for (const [radius, z] of profile)
401
+ for (let i = 0; i < segments; i++) {
402
+ const angle = i * Math.PI * 2 / segments;
403
+ positions.push(radius * Math.cos(angle), radius * Math.sin(angle), z);
404
+ }
405
+ for (let ring = 0; ring < profile.length; ring++) {
406
+ const a = ring * segments;
407
+ const b = (ring + 1) % profile.length * segments;
408
+ for (let i = 0; i < segments; i++) {
409
+ const next = (i + 1) % segments;
410
+ indices.push(a + i, a + next, b + next, a + i, b + next, b + i);
411
+ }
412
+ }
413
+ return { positions, indices };
414
+ }
415
+
416
+ // lib/models/flangedbushing/FlangedBushing.tsx
417
+ function createFlangedBushingGeom(input) {
418
+ return indexedMeshToGeom3(createFlangedBushingMesh(input));
419
+ }
420
+ function FlangedBushing({
421
+ color = "#a18450",
422
+ ...props
423
+ }) {
424
+ return /* @__PURE__ */ jsx(Colorize, { color, children: /* @__PURE__ */ jsx(Custom, { geometry: createFlangedBushingGeom(props) }) });
425
+ }
426
+
427
+ // lib/models/flangedbushing/register.tsx
428
+ var model2 = defineModelRenderer({
429
+ name: "flangedbushing",
430
+ schema: flangedBushingModelDefinitionSchema,
431
+ render: ({ fn, ...props }) => /* @__PURE__ */ jsx(FlangedBushing, { ...props }),
432
+ pads: "none"
433
+ });
434
+ function register2(registry) {
435
+ registry.register(model2);
436
+ }
437
+
438
+ // lib/models/flatheadscrew/register.tsx
439
+ import { flatHeadScrewModelDefinitionSchema } from "@tscircuit/modelprinter";
440
+
229
441
  // lib/models/flatheadscrew/mesh.ts
230
442
  import {
231
443
  flatHeadScrewModelPropsSchema
@@ -329,33 +541,18 @@ function createFlatHeadScrewMesh(input, options = {}) {
329
541
  filletCenterZ + p.underHeadRadius * Math.sin(angle)
330
542
  );
331
543
  }
332
- const hexRadius = (theta) => p.socketAcrossFlats / 2 / Math.max(
544
+ const hexRadius2 = (theta) => p.socketAcrossFlats / 2 / Math.max(
333
545
  Math.abs(Math.sin(theta)),
334
546
  Math.abs(Math.sin(theta + 2 * Math.PI / 3)),
335
547
  Math.abs(Math.sin(theta + 4 * Math.PI / 3))
336
548
  );
337
549
  add(() => p.headDiameter / 2, 0);
338
- add(hexRadius, 0);
339
- add(hexRadius, -p.socketDepth);
550
+ add(hexRadius2, 0);
551
+ add(hexRadius2, -p.socketDepth);
340
552
  cap(previous, -p.socketDepth, true);
341
553
  return { positions, indices };
342
554
  }
343
555
 
344
- // lib/mechanical/indexedMeshToGeom3.ts
345
- import jscad from "@jscad/modeling";
346
- function indexedMeshToGeom3(mesh) {
347
- const polygons = [];
348
- for (let i = 0; i < mesh.indices.length; i += 3)
349
- polygons.push(
350
- mesh.indices.slice(i, i + 3).map((index) => [
351
- mesh.positions[index * 3],
352
- mesh.positions[index * 3 + 1],
353
- mesh.positions[index * 3 + 2]
354
- ])
355
- );
356
- return jscad.geometries.geom3.fromPoints(polygons);
357
- }
358
-
359
556
  // lib/models/flatheadscrew/FlatHeadScrew.tsx
360
557
  function createFlatHeadScrewGeom(input, options) {
361
558
  return indexedMeshToGeom3(createFlatHeadScrewMesh(input, options));
@@ -368,14 +565,14 @@ function FlatHeadScrew({
368
565
  }
369
566
 
370
567
  // lib/models/flatheadscrew/register.tsx
371
- var model = defineModelRenderer({
568
+ var model3 = defineModelRenderer({
372
569
  name: "flatheadscrew",
373
570
  schema: flatHeadScrewModelDefinitionSchema,
374
571
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(FlatHeadScrew, { ...props }),
375
572
  pads: "none"
376
573
  });
377
- function register(registry) {
378
- registry.register(model);
574
+ function register3(registry) {
575
+ registry.register(model3);
379
576
  }
380
577
 
381
578
  // lib/models/flexscreen/register.tsx
@@ -1053,14 +1250,14 @@ var FlexScreen = (props) => {
1053
1250
  };
1054
1251
 
1055
1252
  // lib/models/flexscreen/register.tsx
1056
- var model2 = defineModelRenderer({
1253
+ var model4 = defineModelRenderer({
1057
1254
  name: "flexscreen",
1058
1255
  schema: flexScreenModelDefinitionSchema,
1059
1256
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(FlexScreen, { ...props }),
1060
1257
  pads: "footprinter"
1061
1258
  });
1062
- function register2(registry) {
1063
- registry.register(model2);
1259
+ function register4(registry) {
1260
+ registry.register(model4);
1064
1261
  }
1065
1262
 
1066
1263
  // lib/models/helicalgear/register.tsx
@@ -1266,14 +1463,14 @@ function HelicalGear({ color = "#737e8f", ...props }) {
1266
1463
  }
1267
1464
 
1268
1465
  // lib/models/helicalgear/register.tsx
1269
- var model3 = defineModelRenderer({
1466
+ var model5 = defineModelRenderer({
1270
1467
  name: "helicalgear",
1271
1468
  schema: helicalGearModelDefinitionSchema,
1272
1469
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(HelicalGear, { ...props }),
1273
1470
  pads: "none"
1274
1471
  });
1275
- function register3(registry) {
1276
- registry.register(model3);
1472
+ function register5(registry) {
1473
+ registry.register(model5);
1277
1474
  }
1278
1475
 
1279
1476
  // lib/models/hexbolt/register.tsx
@@ -1382,20 +1579,20 @@ function createHexBoltMesh(input, options = {}) {
1382
1579
  filletCenterZ + p.underHeadRadius * Math.sin(angle)
1383
1580
  );
1384
1581
  }
1385
- const hexRadius = (theta) => p.headAcrossFlats / 2 / Math.max(
1582
+ const hexRadius2 = (theta) => p.headAcrossFlats / 2 / Math.max(
1386
1583
  Math.abs(Math.sin(theta)),
1387
1584
  Math.abs(Math.sin(theta + 2 * Math.PI / 3)),
1388
1585
  Math.abs(Math.sin(theta + 4 * Math.PI / 3))
1389
1586
  );
1390
- add(hexRadius, 0);
1587
+ add(hexRadius2, 0);
1391
1588
  const slope = Math.tan(p.headChamferAngle * Math.PI / 180);
1392
1589
  const start = p.headHeight - (p.headCornerDiameter - p.headChamferDiameter) / 2 * slope;
1393
- add(hexRadius, start);
1590
+ add(hexRadius2, start);
1394
1591
  for (let i = 1; i <= 12; i++) {
1395
1592
  const z = start + (p.headHeight - start) * i / 12;
1396
1593
  add(
1397
1594
  (theta) => Math.min(
1398
- hexRadius(theta),
1595
+ hexRadius2(theta),
1399
1596
  p.headChamferDiameter / 2 + (p.headHeight - z) / slope
1400
1597
  ),
1401
1598
  z
@@ -1414,14 +1611,14 @@ function HexBolt({ color = "#737e8f", ...props }) {
1414
1611
  }
1415
1612
 
1416
1613
  // lib/models/hexbolt/register.tsx
1417
- var model4 = defineModelRenderer({
1614
+ var model6 = defineModelRenderer({
1418
1615
  name: "hexbolt",
1419
1616
  schema: hexBoltModelDefinitionSchema,
1420
1617
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(HexBolt, { ...props }),
1421
1618
  pads: "none"
1422
1619
  });
1423
- function register4(registry) {
1424
- registry.register(model4);
1620
+ function register6(registry) {
1621
+ registry.register(model6);
1425
1622
  }
1426
1623
 
1427
1624
  // lib/models/hexsocketbolt/register.tsx
@@ -1513,10 +1710,10 @@ var createHexSocketBoltMesh = (input) => {
1513
1710
  addRing(bevel, () => headDiameter / 2);
1514
1711
  addRing(headHeight - bevel, () => headDiameter / 2);
1515
1712
  addRing(headHeight, () => headDiameter / 2 - bevel);
1516
- const hexRadius = (angle, acrossFlats) => acrossFlats / 2 / Math.cos((angle + Math.PI / 6) % (Math.PI / 3) - Math.PI / 6);
1517
- addRing(headHeight, (angle) => hexRadius(angle, socketWidth + bevel));
1518
- addRing(headHeight - bevel / 2, (angle) => hexRadius(angle, socketWidth));
1519
- addRing(headHeight - socketDepth, (angle) => hexRadius(angle, socketWidth));
1713
+ const hexRadius2 = (angle, acrossFlats) => acrossFlats / 2 / Math.cos((angle + Math.PI / 6) % (Math.PI / 3) - Math.PI / 6);
1714
+ addRing(headHeight, (angle) => hexRadius2(angle, socketWidth + bevel));
1715
+ addRing(headHeight - bevel / 2, (angle) => hexRadius2(angle, socketWidth));
1716
+ addRing(headHeight - socketDepth, (angle) => hexRadius2(angle, socketWidth));
1520
1717
  cap(previous, headHeight - socketDepth, true);
1521
1718
  return { positions, indices };
1522
1719
  };
@@ -1533,14 +1730,14 @@ function HexSocketBolt({
1533
1730
  }
1534
1731
 
1535
1732
  // lib/models/hexsocketbolt/register.tsx
1536
- var model5 = defineModelRenderer({
1733
+ var model7 = defineModelRenderer({
1537
1734
  name: "hexsocketbolt",
1538
1735
  schema: hexSocketBoltModelDefinitionSchema,
1539
1736
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(HexSocketBolt, { ...props }),
1540
1737
  pads: "none"
1541
1738
  });
1542
- function register5(registry) {
1543
- registry.register(model5);
1739
+ function register7(registry) {
1740
+ registry.register(model7);
1544
1741
  }
1545
1742
 
1546
1743
  // lib/models/nema/register.tsx
@@ -1809,14 +2006,14 @@ var NEMA17 = (props) => /* @__PURE__ */ jsx(NemaMotor, { ...props, nemaSize: 17
1809
2006
  var NEMA23 = (props) => /* @__PURE__ */ jsx(NemaMotor, { ...props, nemaSize: 23 });
1810
2007
 
1811
2008
  // lib/models/nema/register.tsx
1812
- var model6 = defineModelRenderer({
2009
+ var model8 = defineModelRenderer({
1813
2010
  name: "nema",
1814
2011
  schema: nemaMotorModelDefinitionSchema,
1815
2012
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(NemaMotor, { ...props }),
1816
2013
  pads: "none"
1817
2014
  });
1818
- function register6(registry) {
1819
- registry.register(model6);
2015
+ function register8(registry) {
2016
+ registry.register(model8);
1820
2017
  }
1821
2018
 
1822
2019
  // lib/models/panscrew/register.tsx
@@ -2028,14 +2225,14 @@ function PanScrew({ color = "#737e8f", ...props }) {
2028
2225
  }
2029
2226
 
2030
2227
  // lib/models/panscrew/register.tsx
2031
- var model7 = defineModelRenderer({
2228
+ var model9 = defineModelRenderer({
2032
2229
  name: "panscrew",
2033
2230
  schema: panScrewModelDefinitionSchema,
2034
2231
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(PanScrew, { ...props }),
2035
2232
  pads: "none"
2036
2233
  });
2037
- function register7(registry) {
2038
- registry.register(model7);
2234
+ function register9(registry) {
2235
+ registry.register(model9);
2039
2236
  }
2040
2237
 
2041
2238
  // lib/models/plainbushing/register.tsx
@@ -2098,14 +2295,14 @@ function PlainBushing({
2098
2295
  }
2099
2296
 
2100
2297
  // lib/models/plainbushing/register.tsx
2101
- var model8 = defineModelRenderer({
2298
+ var model10 = defineModelRenderer({
2102
2299
  name: "plainbushing",
2103
2300
  schema: plainBushingModelDefinitionSchema,
2104
2301
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(PlainBushing, { ...props }),
2105
2302
  pads: "none"
2106
2303
  });
2107
- function register8(registry) {
2108
- registry.register(model8);
2304
+ function register10(registry) {
2305
+ registry.register(model10);
2109
2306
  }
2110
2307
 
2111
2308
  // lib/models/sheetmetal/register.tsx
@@ -2265,14 +2462,14 @@ function SheetMetal({ color = "#737e8f", ...props }) {
2265
2462
  }
2266
2463
 
2267
2464
  // lib/models/sheetmetal/register.tsx
2268
- var model9 = defineModelRenderer({
2465
+ var model11 = defineModelRenderer({
2269
2466
  name: "sheetmetal",
2270
2467
  schema: sheetMetalModelDefinitionSchema,
2271
2468
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(SheetMetal, { ...props }),
2272
2469
  pads: "none"
2273
2470
  });
2274
- function register9(registry) {
2275
- registry.register(model9);
2471
+ function register11(registry) {
2472
+ registry.register(model11);
2276
2473
  }
2277
2474
 
2278
2475
  // lib/models/spurgear/register.tsx
@@ -2287,14 +2484,14 @@ function SpurGear({ color = "#737e8f", ...props }) {
2287
2484
  }
2288
2485
 
2289
2486
  // lib/models/spurgear/register.tsx
2290
- var model10 = defineModelRenderer({
2487
+ var model12 = defineModelRenderer({
2291
2488
  name: "spurgear",
2292
2489
  schema: spurGearModelDefinitionSchema,
2293
2490
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(SpurGear, { ...props }),
2294
2491
  pads: "none"
2295
2492
  });
2296
- function register10(registry) {
2297
- registry.register(model10);
2493
+ function register12(registry) {
2494
+ registry.register(model12);
2298
2495
  }
2299
2496
 
2300
2497
  // lib/models/wormgear/register.tsx
@@ -2486,14 +2683,14 @@ function WormGear({ color = "#737e8f", ...props }) {
2486
2683
  }
2487
2684
 
2488
2685
  // lib/models/wormgear/register.tsx
2489
- var model11 = defineModelRenderer({
2686
+ var model13 = defineModelRenderer({
2490
2687
  name: "wormgear",
2491
2688
  schema: wormGearModelDefinitionSchema,
2492
2689
  render: ({ fn, ...props }) => /* @__PURE__ */ jsx(WormGear, { ...props }),
2493
2690
  pads: "none"
2494
2691
  });
2495
- function register11(registry) {
2496
- registry.register(model11);
2692
+ function register13(registry) {
2693
+ registry.register(model13);
2497
2694
  }
2498
2695
 
2499
2696
  // lib/generated/model-renderers.ts
@@ -2509,6 +2706,8 @@ function registerAllModelRenderers(registry) {
2509
2706
  register9(registry);
2510
2707
  register10(registry);
2511
2708
  register11(registry);
2709
+ register12(registry);
2710
+ register13(registry);
2512
2711
  }
2513
2712
 
2514
2713
  // lib/default-model-registry.ts
@@ -10065,10 +10264,10 @@ var SOT143 = ({ footprint = "sot143" }) => {
10065
10264
  var Footprinter3d = ({ footprint }) => {
10066
10265
  const modelFn = mp3.string(footprint.split("_", 1)[0]).params().fn;
10067
10266
  if (mp3.getModelNames().includes(modelFn)) {
10068
- const model12 = mp3.string(footprint).json();
10069
- const renderer = modelRendererRegistry.get(model12.fn);
10267
+ const model14 = mp3.string(footprint).json();
10268
+ const renderer = modelRendererRegistry.get(model14.fn);
10070
10269
  if (renderer) {
10071
- return renderer.render(model12);
10270
+ return renderer.render(model14);
10072
10271
  }
10073
10272
  }
10074
10273
  let normalizedFootprint = footprint;
@@ -11019,6 +11218,8 @@ function createJSCADRenderer(jscad4) {
11019
11218
  return { createJSCADRoot };
11020
11219
  }
11021
11220
  export {
11221
+ ButtonScrew,
11222
+ FlangedBushing,
11022
11223
  FlatHeadScrew,
11023
11224
  Fragment,
11024
11225
  HelicalGear,
@@ -11034,6 +11235,10 @@ export {
11034
11235
  SpurGear,
11035
11236
  WormGear,
11036
11237
  convertCSGToThreeGeom,
11238
+ createButtonScrewGeom,
11239
+ createButtonScrewMesh,
11240
+ createFlangedBushingGeom,
11241
+ createFlangedBushingMesh,
11037
11242
  createFlatHeadScrewGeom,
11038
11243
  createFlatHeadScrewMesh,
11039
11244
  createHelicalGearGeom,