jscad-electronics 0.0.186 → 0.0.188

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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../lib/cables/connector-meshes.ts","../lib/cables/geometry-to-mesh.ts","../lib/cables/path-frames.ts","../lib/cables/sweep-round-cable.ts","../lib/cables/create-cable-meshes.ts"],"sourcesContent":["import jscad from \"@jscad/modeling\"\nimport { geometryToCableMesh } from \"./geometry-to-mesh\"\nimport type {\n CableColor,\n CableConnectorSpec,\n CableMesh,\n CablePoint,\n} from \"./types\"\n\nconst { cuboid, roundedCuboid, cylinder, roundedRectangle, polygon, sphere } =\n jscad.primitives\nconst { extrudeLinear } = jscad.extrusions\nconst { translate, rotateY } = jscad.transforms\nconst { subtract, union } = jscad.booleans\nconst plastic: CableColor = [0.055, 0.07, 0.09, 1]\nconst housing: CableColor = [0.86, 0.84, 0.75, 1]\nconst metal: CableColor = [0.6, 0.64, 0.7, 1]\nconst brass: CableColor = [0.66, 0.46, 0.18, 1]\n\nexport function connectorWireExitDepth(connector: CableConnectorSpec): number {\n if (connector.kind === \"usb_c_plug\")\n return connector.shellDepth + connector.bodyDepth\n if (connector.kind === \"nema_5_15p\") return 19.05 + connector.bodyDepth\n return connector.bodyDepth\n}\n\nfunction createJstMeshes(\n connector: Extract<\n CableConnectorSpec,\n { kind: \"jst_sh_housing\" | \"jst_ph_housing\" }\n >,\n): CableMesh[] {\n const {\n bodyWidth: width,\n bodyHeight: height,\n bodyDepth: depth,\n pinCount,\n pitch,\n } = connector\n const opening = pitch === 1 ? 0.55 : 1.05\n const holes = Array.from({ length: pinCount }, (_, index) => {\n const x = (index - (pinCount - 1) / 2) * pitch\n return cuboid({\n size: [opening, opening * 1.35, depth - 0.6],\n center: [x, 0, (depth - 0.6) / 2 - 0.02],\n })\n })\n const backHoles = Array.from({ length: pinCount }, (_, index) =>\n cylinder({\n radius: pitch * 0.34,\n height: 1.3,\n segments: 16,\n center: [(index - (pinCount - 1) / 2) * pitch, 0, depth - 0.5],\n }),\n )\n const latchCut = cuboid({\n size: [width * 0.45, 0.5, depth * 0.5],\n center: [0, height / 2, depth * 0.65],\n })\n const body = subtract(\n roundedCuboid({\n size: [width, height, depth],\n center: [0, 0, depth / 2],\n roundRadius: 0.1,\n segments: 8,\n }),\n ...holes,\n ...backHoles,\n latchCut,\n ...Array.from({ length: pinCount }, (_, index) =>\n cuboid({\n size: [opening * 0.8, height * 0.7, depth * 0.24],\n center: [(index - (pinCount - 1) / 2) * pitch, height / 2, depth * 0.7],\n }),\n ),\n )\n const contacts = Array.from({ length: pinCount }, (_, index) => {\n const x = (index - (pinCount - 1) / 2) * pitch\n return geometryToCableMesh({\n name: `contact-${index + 1}`,\n color: metal,\n geometry: subtract(\n cuboid({\n size: [opening * 0.92, opening * 1.25, depth * 0.65],\n center: [x, 0, depth * 0.45],\n }),\n cuboid({\n size: [\n opening * 0.92 - 0.12,\n opening * 1.25 - 0.12,\n depth * 0.65 + 0.2,\n ],\n center: [x, 0, depth * 0.45],\n }),\n ),\n })\n })\n return [\n geometryToCableMesh({ geometry: body, color: housing, name: \"housing\" }),\n ...contacts,\n ]\n}\n\nfunction createUsbMeshes(\n connector: Extract<CableConnectorSpec, { kind: \"usb_c_plug\" }>,\n): CableMesh[] {\n const {\n shellWidth,\n shellHeight,\n shellDepth,\n bodyWidth,\n bodyHeight,\n bodyDepth,\n } = connector\n const shell = subtract(\n extrudeLinear(\n { height: shellDepth },\n roundedRectangle({\n size: [shellWidth, shellHeight],\n roundRadius: shellHeight / 2 - 0.02,\n segments: 32,\n }),\n ),\n translate(\n [0, 0, -0.1],\n extrudeLinear(\n { height: shellDepth + 0.2 },\n roundedRectangle({\n size: [shellWidth - 0.4, shellHeight - 0.4],\n roundRadius: (shellHeight - 0.4) / 2 - 0.02,\n segments: 32,\n }),\n ),\n ),\n )\n const liner = subtract(\n extrudeLinear(\n { height: shellDepth },\n roundedRectangle({\n size: [shellWidth - 0.41, shellHeight - 0.41],\n roundRadius: 0.85,\n segments: 32,\n }),\n ),\n translate(\n [0, 0, -0.1],\n extrudeLinear(\n { height: shellDepth - 0.3 },\n roundedRectangle({\n size: [shellWidth - 0.8, shellHeight - 0.8],\n roundRadius: 0.65,\n segments: 32,\n }),\n ),\n ),\n )\n const body = roundedCuboid({\n size: [bodyWidth, bodyHeight, bodyDepth],\n center: [0, 0, shellDepth + bodyDepth / 2],\n roundRadius: Math.min(1.3, bodyHeight / 4),\n segments: 16,\n })\n const contacts = Array.from({ length: 24 }, (_, index) =>\n cuboid({\n size: [0.22, 0.08, 3.5],\n center: [((index % 12) - 5.5) * 0.5, index < 12 ? 0.77 : -0.77, 2.6],\n }),\n )\n return [\n geometryToCableMesh({ geometry: body, color: plastic, name: \"overmold\" }),\n geometryToCableMesh({ geometry: shell, color: metal, name: \"shell\" }),\n geometryToCableMesh({\n geometry: liner,\n color: [0.025, 0.026, 0.03, 1],\n name: \"liner\",\n }),\n ...contacts.map((geometry, index) =>\n geometryToCableMesh({\n geometry,\n color: brass,\n name: `contact-${index + 1}`,\n }),\n ),\n ]\n}\n\nfunction createMainsMeshes(connector: CableConnectorSpec): CableMesh[] {\n const { bodyWidth, bodyHeight, bodyDepth, kind } = connector\n const faceDepth = kind === \"nema_5_15p\" ? 19.05 : 0\n let body = roundedCuboid({\n size: [bodyWidth, bodyHeight, bodyDepth],\n center: [0, 0, faceDepth + bodyDepth / 2],\n roundRadius: 2,\n segments: 16,\n })\n if (kind === \"nema_5_15p\") {\n const blades = [-6.35, 6.35].map((x) => {\n const blade = cuboid({\n size: [1.524, 6.35, 15.875],\n center: [x, 2.7, 19.05 - 15.875 / 2],\n })\n const hole = translate(\n [x, 2.7, 7.3],\n rotateY(\n Math.PI / 2,\n cylinder({ radius: 1.1, height: 3, segments: 20 }),\n ),\n )\n return subtract(blade, hole)\n })\n const ground = union(\n cylinder({\n radius: 2.38125,\n height: 19.05 - 2.38125,\n center: [0, -9.20625, (19.05 + 2.38125) / 2],\n segments: 32,\n }),\n sphere({ radius: 2.38125, center: [0, -9.20625, 2.38125], segments: 32 }),\n )\n return [\n geometryToCableMesh({\n geometry: body,\n color: plastic,\n name: \"plug-body\",\n }),\n ...blades.map((geometry, index) =>\n geometryToCableMesh({\n geometry,\n color: brass,\n name: `blade-${index + 1}`,\n }),\n ),\n geometryToCableMesh({\n geometry: ground,\n color: brass,\n name: \"ground-pin\",\n }),\n ]\n }\n const recess = translate(\n [0, 0, -0.1],\n extrudeLinear(\n { height: 3.2 },\n polygon({\n points: [\n [-9, -6],\n [9, -6],\n [9, 2],\n [5, 6],\n [-5, 6],\n [-9, 2],\n ],\n }),\n ),\n )\n const sockets: CablePoint[] = [\n [-4.4, -1.8, 8],\n [4.4, -1.8, 8],\n [0, 3.1, 8],\n ]\n body = subtract(\n body,\n recess,\n ...sockets.map((center) => cuboid({ size: [2.3, 3.4, 16.2], center })),\n )\n return [\n geometryToCableMesh({\n geometry: body,\n color: plastic,\n name: \"appliance-body\",\n }),\n ...sockets.map(([x, y], index) =>\n geometryToCableMesh({\n geometry: cuboid({ size: [0.15, 2.8, 6], center: [x - 1.05, y, 7.8] }),\n color: brass,\n name: `socket-contact-${index + 1}`,\n }),\n ),\n ]\n}\n\nexport function createConnectorMeshes({\n connector,\n jacketDiameter,\n}: { connector: CableConnectorSpec; jacketDiameter?: number }): CableMesh[] {\n const meshes =\n connector.kind === \"usb_c_plug\"\n ? createUsbMeshes(connector)\n : \"pinCount\" in connector\n ? createJstMeshes(connector)\n : createMainsMeshes(connector)\n if (jacketDiameter !== undefined) {\n const exit = connectorWireExitDepth(connector)\n const boot = union(\n cylinder({\n radius: jacketDiameter / 2 + 0.15,\n height: 5,\n center: [0, 0, exit + 2.5],\n segments: 32,\n }),\n ...Array.from({ length: 7 }, (_, index) =>\n cylinder({\n radius: jacketDiameter / 2 + 0.8 - index * 0.06,\n height: 0.28,\n center: [0, 0, exit + 0.4 + index * 0.7],\n segments: 32,\n }),\n ),\n )\n meshes.push(\n geometryToCableMesh({\n geometry: boot,\n color: plastic,\n name: \"strain-relief\",\n }),\n )\n }\n return meshes\n}\n","import jscad from \"@jscad/modeling\"\nimport type { Geom3 } from \"@jscad/modeling/src/geometries/geom3\"\nimport type { CableMesh, CableColor, CableFrame, CablePoint } from \"./types\"\nimport { add, scale } from \"./path-frames\"\n\ntype VertexKey = string\n\nexport function geometryToCableMesh({\n geometry,\n color,\n name,\n}: { geometry: Geom3; color: CableColor; name: string }): CableMesh {\n const triangles = jscad.geometries.geom3.toPolygons(geometry)\n const positions: number[] = []\n const indices: number[] = []\n const vertices = new Map<VertexKey, number>()\n for (const triangle of triangles) {\n const polygonIndices: number[] = []\n for (const point of triangle.vertices) {\n const key = point.map((coordinate) => coordinate.toFixed(8)).join(\",\")\n let index = vertices.get(key)\n if (index === undefined) {\n index = positions.length / 3\n positions.push(...point)\n vertices.set(key, index)\n }\n polygonIndices.push(index)\n }\n // JSCAD CSG polygons are convex, so a fan preserves their outward winding.\n for (let side = 1; side < polygonIndices.length - 1; side++) {\n indices.push(\n polygonIndices[0]!,\n polygonIndices[side]!,\n polygonIndices[side + 1]!,\n )\n }\n }\n return { name, positions, indices, color, smooth: false }\n}\n\nexport function placeConnectorMesh({\n mesh,\n frame,\n wireExitDepth,\n isEnd,\n}: {\n mesh: CableMesh\n frame: CableFrame\n wireExitDepth: number\n isEnd: boolean\n}): CableMesh {\n const tangent = scale(frame.tangent, isEnd ? -1 : 1)\n const binormal: CablePoint = isEnd\n ? scale(frame.binormal, -1)\n : frame.binormal\n const origin = add(frame.point, scale(tangent, -wireExitDepth))\n const positions: number[] = []\n for (let index = 0; index < mesh.positions.length; index += 3) {\n positions.push(\n ...add(\n origin,\n add(\n add(\n scale(frame.normal, mesh.positions[index]!),\n scale(binormal, mesh.positions[index + 1]!),\n ),\n scale(tangent, mesh.positions[index + 2]!),\n ),\n ),\n )\n }\n return { ...mesh, positions }\n}\n","import type { CableFrame, CablePoint } from \"./types\"\n\nexport const add = (a: CablePoint, b: CablePoint): CablePoint => [\n a[0] + b[0],\n a[1] + b[1],\n a[2] + b[2],\n]\nexport const subtract = (a: CablePoint, b: CablePoint): CablePoint => [\n a[0] - b[0],\n a[1] - b[1],\n a[2] - b[2],\n]\nexport const scale = (point: CablePoint, factor: number): CablePoint => [\n point[0] * factor,\n point[1] * factor,\n point[2] * factor,\n]\nexport const dot = (a: CablePoint, b: CablePoint) =>\n a[0] * b[0] + a[1] * b[1] + a[2] * b[2]\nexport const cross = (a: CablePoint, b: CablePoint): CablePoint => [\n a[1] * b[2] - a[2] * b[1],\n a[2] * b[0] - a[0] * b[2],\n a[0] * b[1] - a[1] * b[0],\n]\nexport function normalize(point: CablePoint): CablePoint {\n const length = Math.hypot(...point)\n if (length < 1e-10)\n throw new Error(\n \"Cable path must not contain coincident points or a reversing tangent\",\n )\n return scale(point, 1 / length)\n}\n\n/** Parallel transport avoids a wire bundle flipping when its tangent crosses an axis. */\nexport function createCablePathFrames(path: CablePoint[]): CableFrame[] {\n if (\n path.length < 2 ||\n path.some((point) => point.length !== 3 || !point.every(Number.isFinite))\n ) {\n throw new Error(\"Cable path needs at least two finite 3D points\")\n }\n const segments = path\n .slice(1)\n .map((point, index) => normalize(subtract(point, path[index]!)))\n const tangents = path.map((_, index) =>\n index === 0\n ? segments[0]!\n : index === path.length - 1\n ? segments.at(-1)!\n : normalize(add(segments[index - 1]!, segments[index]!)),\n )\n const initialUp: CablePoint =\n Math.abs(tangents[0]![2]) > 0.95 ? [0, 1, 0] : [0, 0, 1]\n let normal = normalize(cross(initialUp, tangents[0]!))\n return tangents.map((tangent, index) => {\n if (index > 0) {\n const previousTangent = tangents[index - 1]!\n const axis = cross(previousTangent, tangent)\n const sine = Math.hypot(...axis)\n const cosine = Math.max(-1, Math.min(1, dot(previousTangent, tangent)))\n if (sine > 1e-10) {\n const unitAxis = scale(axis, 1 / sine)\n normal = normalize(\n add(\n add(scale(normal, cosine), scale(cross(unitAxis, normal), sine)),\n scale(unitAxis, dot(unitAxis, normal) * (1 - cosine)),\n ),\n )\n }\n }\n return {\n point: path[index]!,\n tangent,\n normal,\n binormal: normalize(cross(tangent, normal)),\n }\n })\n}\n","import { add, scale } from \"./path-frames\"\nimport type { CableFrame, CableMesh, CableColor } from \"./types\"\n\n/** Closed indexed sweep around a supplied centerline; this does not choose a route. */\nexport function sweepRoundCable({\n frames,\n diameter,\n offset = 0,\n radialSegments,\n color,\n name,\n}: {\n frames: CableFrame[]\n diameter: number\n offset?: number\n radialSegments: number\n color: CableColor\n name: string\n}): CableMesh {\n const positions: number[] = []\n const indices: number[] = []\n for (const frame of frames) {\n const center = add(frame.point, scale(frame.normal, offset))\n for (let side = 0; side < radialSegments; side++) {\n const angle = (side * Math.PI * 2) / radialSegments\n positions.push(\n ...add(\n center,\n add(\n scale(frame.normal, (diameter * Math.cos(angle)) / 2),\n scale(frame.binormal, (diameter * Math.sin(angle)) / 2),\n ),\n ),\n )\n }\n }\n for (let ring = 0; ring < frames.length - 1; ring++) {\n for (let side = 0; side < radialSegments; side++) {\n const a = ring * radialSegments + side\n const b = ring * radialSegments + ((side + 1) % radialSegments)\n const c = a + radialSegments\n const d = b + radialSegments\n indices.push(a, b, c, b, d, c)\n }\n }\n const startCenter = positions.length / 3\n positions.push(...add(frames[0]!.point, scale(frames[0]!.normal, offset)))\n const endCenter = positions.length / 3\n positions.push(\n ...add(frames.at(-1)!.point, scale(frames.at(-1)!.normal, offset)),\n )\n const lastRing = (frames.length - 1) * radialSegments\n for (let side = 0; side < radialSegments; side++) {\n const next = (side + 1) % radialSegments\n indices.push(\n startCenter,\n next,\n side,\n endCenter,\n lastRing + side,\n lastRing + next,\n )\n }\n return { name, positions, indices, color, smooth: true }\n}\n","import {\n createConnectorMeshes,\n connectorWireExitDepth,\n} from \"./connector-meshes\"\nimport { placeConnectorMesh } from \"./geometry-to-mesh\"\nimport { createCablePathFrames } from \"./path-frames\"\nimport { sweepRoundCable } from \"./sweep-round-cable\"\nimport type {\n CableColor,\n CableGeometryDefinition,\n CableMesh,\n CablePoint,\n} from \"./types\"\n\nfunction parseCableColor(color: string): CableColor {\n if (!/^#[a-f\\d]{6}$/i.test(color))\n throw new Error(\"Cable colors must be six-digit hex strings\")\n return [\n parseInt(color.slice(1, 3), 16) / 255,\n parseInt(color.slice(3, 5), 16) / 255,\n parseInt(color.slice(5, 7), 16) / 255,\n 1,\n ]\n}\n\nfunction validateCableDefinition(definition: CableGeometryDefinition) {\n for (const connector of [definition.connectorA, definition.connectorB]) {\n const dimensions = [\n connector.bodyWidth,\n connector.bodyHeight,\n connector.bodyDepth,\n ]\n if (connector.kind === \"usb_c_plug\")\n dimensions.push(\n connector.shellWidth,\n connector.shellHeight,\n connector.shellDepth,\n )\n if (\n dimensions.some(\n (dimension) => !Number.isFinite(dimension) || dimension <= 0,\n )\n )\n throw new Error(\"Connector dimensions must be finite and positive\")\n if (\n \"pinCount\" in connector &&\n (!Number.isInteger(connector.pinCount) ||\n connector.pinCount < 2 ||\n !Number.isFinite(connector.pitch) ||\n connector.pitch <= 0)\n )\n throw new Error(\n \"JST connectors need a positive pitch and at least two contacts\",\n )\n }\n const crossSection = definition.crossSection\n const diameters =\n crossSection.kind === \"round_jacket\"\n ? [crossSection.diameter]\n : crossSection.wires.map((wire) => wire.diameter)\n if (\n diameters.length === 0 ||\n diameters.some((diameter) => !Number.isFinite(diameter) || diameter <= 0)\n )\n throw new Error(\"Cable diameters must be finite and positive\")\n if (crossSection.kind === \"wire_bundle\") {\n if (\n !Number.isFinite(crossSection.wirePitch) ||\n crossSection.wires.some((wire) => wire.diameter > crossSection.wirePitch)\n )\n throw new Error(\"Insulated bundle wires must not overlap\")\n for (const connector of [definition.connectorA, definition.connectorB]) {\n if (\n !(\"pinCount\" in connector) ||\n connector.pinCount !== crossSection.wires.length\n )\n throw new Error(\"Bundle wire count must match connector contact count\")\n }\n }\n}\n\n/** Mesh generation only. Path samples are already resolved in world millimeters, +Z up. */\nexport function createCableMeshes({\n definition,\n path,\n radialSegments = 24,\n}: {\n definition: CableGeometryDefinition\n path: CablePoint[]\n radialSegments?: number\n}): CableMesh[] {\n validateCableDefinition(definition)\n if (\n !Number.isInteger(radialSegments) ||\n radialSegments < 8 ||\n radialSegments > 128\n )\n throw new Error(\"radialSegments must be an integer from 8 to 128\")\n const frames = createCablePathFrames(path)\n const crossSection = definition.crossSection\n const jacketDiameter =\n crossSection.kind === \"round_jacket\" ? crossSection.diameter : undefined\n const meshes =\n crossSection.kind === \"round_jacket\"\n ? [\n sweepRoundCable({\n frames,\n diameter: crossSection.diameter,\n radialSegments,\n color: parseCableColor(crossSection.color),\n name: \"jacket\",\n }),\n ]\n : crossSection.wires.map((wire, index) =>\n sweepRoundCable({\n frames,\n diameter: wire.diameter,\n offset:\n (index - (crossSection.wires.length - 1) / 2) *\n crossSection.wirePitch,\n radialSegments,\n color: parseCableColor(wire.color),\n name: `wire-${index + 1}`,\n }),\n )\n for (const [index, connector] of [\n definition.connectorA,\n definition.connectorB,\n ].entries()) {\n const frame = index === 0 ? frames[0]! : frames.at(-1)!\n const parts = createConnectorMeshes({ connector, jacketDiameter })\n meshes.push(\n ...parts.map((mesh) =>\n placeConnectorMesh({\n mesh: { ...mesh, name: `${index === 0 ? \"A\" : \"B\"}-${mesh.name}` },\n frame,\n isEnd: index === 1,\n wireExitDepth: connectorWireExitDepth(connector),\n }),\n ),\n )\n }\n return meshes\n}\n"],"mappings":";AAAA,OAAOA,YAAW;;;ACAlB,OAAO,WAAW;;;ACEX,IAAM,MAAM,CAAC,GAAe,MAA8B;AAAA,EAC/D,EAAE,CAAC,IAAI,EAAE,CAAC;AAAA,EACV,EAAE,CAAC,IAAI,EAAE,CAAC;AAAA,EACV,EAAE,CAAC,IAAI,EAAE,CAAC;AACZ;AACO,IAAM,WAAW,CAAC,GAAe,MAA8B;AAAA,EACpE,EAAE,CAAC,IAAI,EAAE,CAAC;AAAA,EACV,EAAE,CAAC,IAAI,EAAE,CAAC;AAAA,EACV,EAAE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AC;AAAA,EACH,IACA,aAAa,MAAM;AAAA,IAAI,CAAC,MAAM,UAC5B,gBAAgB;AAAA,MACd;AAAA,MACA,UAAU,KAAK;AAAA,MACf,SACG,SAAS,aAAa,MAAM,SAAS,KAAK,KAC3C,aAAa;AAAA,MACf;AAAA,MACA,OAAO,gBAAgB,KAAK,KAAK;AAAA,MACjC,MAAM,QAAQ,QAAQ,CAAC;AAAA,IACzB,CAAC;AAAA,EACH;AACN,aAAW,CAAC,OAAO,SAAS,KAAK;AAAA,IAC/B,WAAW;AAAA,IACX,WAAW;AAAA,EACb,EAAE,QAAQ,GAAG;AACX,UAAM,QAAQ,UAAU,IAAI,OAAO,CAAC,IAAK,OAAO,GAAG,EAAE;AACrD,UAAM,QAAQ,sBAAsB,EAAE,WAAW,eAAe,CAAC;AACjE,WAAO;AAAA,MACL,GAAG,MAAM;AAAA,QAAI,CAAC,SACZ,mBAAmB;AAAA,UACjB,MAAM,EAAE,GAAG,MAAM,MAAM,GAAG,UAAU,IAAI,MAAM,GAAG,IAAI,KAAK,IAAI,GAAG;AAAA,UACjE;AAAA,UACA,OAAO,UAAU;AAAA,UACjB,eAAe,uBAAuB,SAAS;AAAA,QACjD,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;","names":["jscad","jscad","subtract"]}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { AnyCircuitElement, PcbSmtPad, PcbPlatedHole } from 'circuit-json';
3
- import { NemaMotorModelPropsInput, HexSocketBoltModelPropsInput, SheetMetalModelPropsInput, SpurGearModelPropsInput, HelicalGearModelPropsInput, WormGearModelPropsInput } from '@tscircuit/modelprinter';
3
+ import { NemaMotorModelPropsInput, HexSocketBoltModelPropsInput, SheetMetalModelPropsInput, SpurGearModelPropsInput, HelicalGearModelPropsInput, WormGearModelPropsInput, HexBoltModelPropsInput } from '@tscircuit/modelprinter';
4
4
  import * as _jscad_modeling_src_geometries_types from '@jscad/modeling/src/geometries/types';
5
5
 
6
6
  declare const A01005: ({ color }: {
@@ -866,15 +866,32 @@ interface FlexScreenProps {
866
866
  showScreen?: boolean;
867
867
  /** Centerline length of the modeled cable route. */
868
868
  flexCableLength?: number;
869
+ /** Cable body width. The connector end widens when its contacts need more room. */
869
870
  flexCableWidth?: number;
870
871
  flexCableThickness?: number;
871
872
  flexCableColor?: string;
873
+ /** Number of connector contacts, matching FPC.pinCount. */
874
+ pinCount?: number;
875
+ /** Center-to-center connector contact spacing, matching FPC.pitch. */
876
+ pitch?: number;
877
+ /** Connector contact width, matching FPC.padWidth (footprinter pw). */
878
+ padWidth?: number;
879
+ /** Exposed contact length, matching FPC.padLength (footprinter pl). */
880
+ padLength?: number;
881
+ /** Straight length of the widened connector end, before the taper. */
882
+ tailLength?: number;
883
+ /** Length of the transition from the widened tail to the cable body. */
884
+ taperLength?: number;
885
+ /** @deprecated Use pinCount. */
872
886
  conductorCount?: number;
887
+ /** @deprecated Use pitch. */
873
888
  conductorPitch?: number;
889
+ /** @deprecated Use padWidth. */
874
890
  conductorWidth?: number;
875
891
  conductorThickness?: number;
876
892
  conductorColor?: string;
877
893
  cableEdgeMargin?: number;
894
+ /** @deprecated Use padLength. */
878
895
  exposedContactLength?: number;
879
896
  showConductors?: boolean;
880
897
  showFlexCable?: boolean;
@@ -1441,4 +1458,21 @@ type WormGearProps = WormGearModelPropsInput & {
1441
1458
  declare function createWormGearGeom(input: WormGearModelPropsInput): _jscad_modeling_src_geometries_types.Geom3;
1442
1459
  declare function WormGear({ color, ...props }: WormGearProps): react_jsx_runtime.JSX.Element;
1443
1460
 
1444
- export { A01005, A0201, A0402, A0603, A0805, A1206, A1210, A2010, A2512, AxialCapacitor, BGA, CeramicChipAntenna, ChipBody, type ChipBodyProps, Crystal, type CrystalProps, DFN, DO219AD, type DO219ADProps, DPAK, type DPAKProps, Display, ElectrolyticCapacitor, type ElectrolyticCapacitorProps, ExtrudedPads, FPC, type FPCProps, FemaleHeader, FemaleHeaderRow, FlexScreen, type FlexScreenAspectRatio, type FlexScreenOrientation, type FlexScreenProps, FootprintPad, FootprintPlatedHole, Footprinter3d, GullWingBody, type GullWingBodyProps, HC49, type HC49Props, HelicalGear, type HelicalGearMesh, type HelicalGearProps, HexSocketBolt, type HexSocketBoltMesh, type HexSocketBoltProps, JSTPH2_0mm, JSTXH2_5mm, type JSTXH2_5mmProps, JSTZH1_5mm, JstSh, LGA, type LGAProps, LQFP, type LQFPProps, Led2835, type Led2835Props, Led5050, type Led5050Props, MELF, type MELFProps, MINIMELF, type MINIMELFProps, MS012, MS013, MSOP, type MSOPProps, MelfResistor, type MelfResistorSize, MicroMELF, type MicroMELFProps, MountedPcbModule, NEMA17, NEMA23, NEMA8, type NemaFrameMotorProps, NemaMotor, type NemaMotorProps, PinHeader, PinRow, Potentiometer, type PotentiometerLead, type PotentiometerProps, QFN, type QFNProps, QFP, RJ45, type RJ45Props, type ResolvedFlexScreenSize, SMA, SMB, SMC, SMF, SOD123, SOD123F, SOD123FL, type SOD123Props, SOD123W, type SOD123WProps, SOD128, SOD323, SOD323F, SOD323FL, SOD323HE, type SOD323HEProps, SOD523, SOD723, SOD882, SOD923, SOIC, type SOICProps, SOT143, SOT223, type SOT223Props, SOT233P, SOT23W, SOT323, SOT363, SOT457, SOT563, SOT723, SOT886, SOT89, type SOT89Props, SOT963, SSOP, type SSOPProps, Screen, type ScreenProps, SheetMetal, type SheetMetalMesh, type SheetMetalProps, SmdChipLead, type SmdChipLeadProps, SmdLED, type SmdLeadPad, type SmdLedSize, SmdPinHeader, type SmdPinHeaderProps, SmdPushButton, type SmdPushButtonProps, SmdSlideSwitch, SpurGear, type SpurGearMesh, type SpurGearProps, StampBoard, TO220, type TO220Lead, type TO220Props, TO277, type TO277Props, TO92, type TO92Lead, type TO92Props, TQFP, TantalumCapacitor, type TantalumCase, Tssop, type TssopProps, TwoPadCrystal, type TwoPadCrystalPackage, UsbCMidmount, VSSOP, WormGear, type WormGearMesh, type WormGearProps, createHelicalGearGeom, createHelicalGearMesh, createHexSocketBoltGeom, createHexSocketBoltMesh, createSheetMetalGeom, createSheetMetalMesh, createSpurGearGeom, createSpurGearMesh, createWormGearGeom, createWormGearMesh, isJstShFootprint, melfResistorSizes, resolveFlexScreenSize, smdLedDimensions, tantalumCases, twoPadCrystalPackages };
1461
+ interface HexBoltMeshOptions {
1462
+ radialSegments?: number;
1463
+ threadStepsPerTurn?: number;
1464
+ }
1465
+ /** Outward-oriented, welded indexed surface, in millimeters. */
1466
+ interface HexBoltMesh {
1467
+ positions: number[];
1468
+ indices: number[];
1469
+ }
1470
+ declare function createHexBoltMesh(input: HexBoltModelPropsInput, options?: HexBoltMeshOptions): HexBoltMesh;
1471
+
1472
+ type HexBoltProps = HexBoltModelPropsInput & {
1473
+ color?: string;
1474
+ };
1475
+ declare function createHexBoltGeom(input: HexBoltModelPropsInput, options?: HexBoltMeshOptions): _jscad_modeling_src_geometries_types.Geom3;
1476
+ declare function HexBolt({ color, ...props }: HexBoltProps): react_jsx_runtime.JSX.Element;
1477
+
1478
+ export { A01005, A0201, A0402, A0603, A0805, A1206, A1210, A2010, A2512, AxialCapacitor, BGA, CeramicChipAntenna, ChipBody, type ChipBodyProps, Crystal, type CrystalProps, DFN, DO219AD, type DO219ADProps, DPAK, type DPAKProps, Display, ElectrolyticCapacitor, type ElectrolyticCapacitorProps, ExtrudedPads, FPC, type FPCProps, FemaleHeader, FemaleHeaderRow, FlexScreen, type FlexScreenAspectRatio, type FlexScreenOrientation, type FlexScreenProps, FootprintPad, FootprintPlatedHole, Footprinter3d, GullWingBody, type GullWingBodyProps, HC49, type HC49Props, HelicalGear, type HelicalGearMesh, type HelicalGearProps, HexBolt, type HexBoltMesh, type HexBoltMeshOptions, type HexBoltProps, HexSocketBolt, type HexSocketBoltMesh, type HexSocketBoltProps, JSTPH2_0mm, JSTXH2_5mm, type JSTXH2_5mmProps, JSTZH1_5mm, JstSh, LGA, type LGAProps, LQFP, type LQFPProps, Led2835, type Led2835Props, Led5050, type Led5050Props, MELF, type MELFProps, MINIMELF, type MINIMELFProps, MS012, MS013, MSOP, type MSOPProps, MelfResistor, type MelfResistorSize, MicroMELF, type MicroMELFProps, MountedPcbModule, NEMA17, NEMA23, NEMA8, type NemaFrameMotorProps, NemaMotor, type NemaMotorProps, PinHeader, PinRow, Potentiometer, type PotentiometerLead, type PotentiometerProps, QFN, type QFNProps, QFP, RJ45, type RJ45Props, type ResolvedFlexScreenSize, SMA, SMB, SMC, SMF, SOD123, SOD123F, SOD123FL, type SOD123Props, SOD123W, type SOD123WProps, SOD128, SOD323, SOD323F, SOD323FL, SOD323HE, type SOD323HEProps, SOD523, SOD723, SOD882, SOD923, SOIC, type SOICProps, SOT143, SOT223, type SOT223Props, SOT233P, SOT23W, SOT323, SOT363, SOT457, SOT563, SOT723, SOT886, SOT89, type SOT89Props, SOT963, SSOP, type SSOPProps, Screen, type ScreenProps, SheetMetal, type SheetMetalMesh, type SheetMetalProps, SmdChipLead, type SmdChipLeadProps, SmdLED, type SmdLeadPad, type SmdLedSize, SmdPinHeader, type SmdPinHeaderProps, SmdPushButton, type SmdPushButtonProps, SmdSlideSwitch, SpurGear, type SpurGearMesh, type SpurGearProps, StampBoard, TO220, type TO220Lead, type TO220Props, TO277, type TO277Props, TO92, type TO92Lead, type TO92Props, TQFP, TantalumCapacitor, type TantalumCase, Tssop, type TssopProps, TwoPadCrystal, type TwoPadCrystalPackage, UsbCMidmount, VSSOP, WormGear, type WormGearMesh, type WormGearProps, createHelicalGearGeom, createHelicalGearMesh, createHexBoltGeom, createHexBoltMesh, createHexSocketBoltGeom, createHexSocketBoltMesh, createSheetMetalGeom, createSheetMetalMesh, createSpurGearGeom, createSpurGearMesh, createWormGearGeom, createWormGearMesh, isJstShFootprint, melfResistorSizes, resolveFlexScreenSize, smdLedDimensions, tantalumCases, twoPadCrystalPackages };