jscad-electronics 0.0.184 → 0.0.186

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/README.md CHANGED
@@ -124,6 +124,21 @@ produce the wrong model. Parsing and validation are provided by
124
124
  [`@tscircuit/modelprinter`](https://github.com/tscircuit/modelprinter), keeping
125
125
  the string grammar independent of this JSCAD renderer.
126
126
 
127
+ ## Parameterized gears
128
+
129
+ `SpurGear` generates external involute gears with optional bores and hubs.
130
+ `WormGear` generates single or multiple start worm screws of either hand.
131
+ Both accept ModelPrinter strings through `Footprinter3d` and the vanilla renderer:
132
+
133
+ ```tsx
134
+ <Footprinter3d footprint="spurgear24_m1mm_w5mm_bore5mm" />
135
+ <Footprinter3d footprint="wormgear_m1mm_d10mm_l20mm_starts2_left_bore3mm" />
136
+ ```
137
+
138
+ See [the gear guide](docs/gears.md) for direct props, mesh factories, pitch
139
+ conventions, resolution controls, and geometry limits. Worm wheels require a
140
+ conjugate tooth profile and are outside this initial implementation.
141
+
127
142
  ## Integration with tscircuit
128
143
 
129
144
  jscad-electronics is designed to work seamlessly with tscircuit. You can use these 3D models in your tscircuit projects to create accurate 3D representations of your PCB designs just by
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 } from '@tscircuit/modelprinter';
3
+ import { NemaMotorModelPropsInput, HexSocketBoltModelPropsInput, SheetMetalModelPropsInput, SpurGearModelPropsInput, HelicalGearModelPropsInput, WormGearModelPropsInput } 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 }: {
@@ -1385,4 +1385,60 @@ type SheetMetalProps = SheetMetalModelPropsInput & {
1385
1385
  declare function createSheetMetalGeom(input: SheetMetalModelPropsInput): _jscad_modeling_src_geometries_types.Geom3;
1386
1386
  declare function SheetMetal({ color, ...props }: SheetMetalProps): react_jsx_runtime.JSX.Element;
1387
1387
 
1388
- 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, 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, 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, createHexSocketBoltGeom, createHexSocketBoltMesh, createSheetMetalGeom, createSheetMetalMesh, isJstShFootprint, melfResistorSizes, resolveFlexScreenSize, smdLedDimensions, tantalumCases, twoPadCrystalPackages };
1388
+ /** Indexed triangles, counterclockwise from outside; millimeters, Z up. */
1389
+ interface SpurGearMesh {
1390
+ positions: number[];
1391
+ indices: number[];
1392
+ }
1393
+ /**
1394
+ * An external involute spur gear with its lower face at Z=0. Tooth centers
1395
+ * start on +X and rotate counterclockwise with phase. The optional hub extends
1396
+ * above the upper face, and the round bore passes through both gear and hub.
1397
+ * Flanks are sampled involutes; tips and root valleys follow circular arcs.
1398
+ * Below the base circle the flanks extend radially, without a generated
1399
+ * trochoidal root fillet or cutter undercut. No CSG or renderer is required.
1400
+ */
1401
+ declare function createSpurGearMesh(input: SpurGearModelPropsInput): SpurGearMesh;
1402
+
1403
+ type HelicalGearMesh = SpurGearMesh;
1404
+ /**
1405
+ * Twisted transverse involute teeth from Z=0 to faceWidth, with a stationary
1406
+ * round bore and optional hub. Zero helix angle reproduces the spur mesh.
1407
+ */
1408
+ declare function createHelicalGearMesh(input: HelicalGearModelPropsInput): HelicalGearMesh;
1409
+
1410
+ type HelicalGearProps = HelicalGearModelPropsInput & {
1411
+ color?: string;
1412
+ };
1413
+ /** Axis +Z, lower face Z=0; optional hub extends above the gear face. */
1414
+ declare function createHelicalGearGeom(input: HelicalGearModelPropsInput): _jscad_modeling_src_geometries_types.Geom3;
1415
+ declare function HelicalGear({ color, ...props }: HelicalGearProps): react_jsx_runtime.JSX.Element;
1416
+
1417
+ type SpurGearProps = SpurGearModelPropsInput & {
1418
+ color?: string;
1419
+ };
1420
+ /** Axis +Z, lower face Z=0; optional hub extends above the gear face. */
1421
+ declare function createSpurGearGeom(input: SpurGearModelPropsInput): _jscad_modeling_src_geometries_types.Geom3;
1422
+ declare function SpurGear({ color, ...props }: SpurGearProps): react_jsx_runtime.JSX.Element;
1423
+
1424
+ /** Indexed triangles, counterclockwise from outside; millimeters, Z up. */
1425
+ interface WormGearMesh {
1426
+ positions: number[];
1427
+ indices: number[];
1428
+ }
1429
+ /**
1430
+ * A cylindrical worm from Z=0 to Z=length, with square-cut ends.
1431
+ * The axial trapezoidal rack profile is swept around +Z. A right-hand crest
1432
+ * winds counterclockwise as Z increases; phase rotates the entire solid.
1433
+ * This is a faceted visual worm, not a hobbed wheel or a conjugate gear pair.
1434
+ */
1435
+ declare const createWormGearMesh: (input: WormGearModelPropsInput) => WormGearMesh;
1436
+
1437
+ type WormGearProps = WormGearModelPropsInput & {
1438
+ color?: string;
1439
+ };
1440
+ /** Square-cut worm along +Z, from Z=0 to length. Threads are approximate. */
1441
+ declare function createWormGearGeom(input: WormGearModelPropsInput): _jscad_modeling_src_geometries_types.Geom3;
1442
+ declare function WormGear({ color, ...props }: WormGearProps): react_jsx_runtime.JSX.Element;
1443
+
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 };