@tscircuit/footprinter 0.0.141 → 0.0.142

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -379,9 +379,9 @@ declare const any_footprinter_def: z.ZodUnion<[z.ZodObject<{
379
379
  p?: string | number | undefined;
380
380
  id?: string | number | undefined;
381
381
  od?: string | number | undefined;
382
- rows?: string | number | undefined;
383
382
  male?: boolean | undefined;
384
383
  female?: boolean | undefined;
384
+ rows?: string | number | undefined;
385
385
  }>, {
386
386
  male: boolean;
387
387
  female: boolean;
@@ -397,9 +397,9 @@ declare const any_footprinter_def: z.ZodUnion<[z.ZodObject<{
397
397
  p?: string | number | undefined;
398
398
  id?: string | number | undefined;
399
399
  od?: string | number | undefined;
400
- rows?: string | number | undefined;
401
400
  male?: boolean | undefined;
402
401
  female?: boolean | undefined;
402
+ rows?: string | number | undefined;
403
403
  }>, {
404
404
  male: boolean;
405
405
  female: boolean;
@@ -415,9 +415,9 @@ declare const any_footprinter_def: z.ZodUnion<[z.ZodObject<{
415
415
  p?: string | number | undefined;
416
416
  id?: string | number | undefined;
417
417
  od?: string | number | undefined;
418
- rows?: string | number | undefined;
419
418
  male?: boolean | undefined;
420
419
  female?: boolean | undefined;
420
+ rows?: string | number | undefined;
421
421
  }>, z.ZodEffects<z.ZodObject<z.objectUtil.extendShape<{
422
422
  fn: z.ZodString;
423
423
  cc: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
@@ -1019,6 +1019,7 @@ type Footprinter = {
1019
1019
  smc: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pw" | "pl">;
1020
1020
  minimelf: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pw" | "pl">;
1021
1021
  melf: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pw" | "pl">;
1022
+ jst: () => FootprinterParamsBuilder<"w" | "h" | "p" | "id" | "pw" | "pl">;
1022
1023
  micromelf: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pw" | "pl">;
1023
1024
  ms013: () => FootprinterParamsBuilder<"w" | "p">;
1024
1025
  ms012: () => FootprinterParamsBuilder<"w" | "p">;
package/dist/index.js CHANGED
@@ -15,6 +15,7 @@ __export(fn_exports, {
15
15
  diode: () => diode,
16
16
  dip: () => dip,
17
17
  hc49: () => hc49,
18
+ jst: () => jst,
18
19
  led: () => led,
19
20
  lqfp: () => lqfp,
20
21
  melf: () => melf,
@@ -3534,12 +3535,12 @@ var sot89_3 = (parameters) => {
3534
3535
  const pads = [];
3535
3536
  const padGap = Number.parseFloat(parameters.p);
3536
3537
  const padWidth = Number.parseFloat(parameters.pw);
3537
- const length36 = Number.parseFloat(parameters.w);
3538
+ const length37 = Number.parseFloat(parameters.w);
3538
3539
  const padHeight = Number.parseFloat(parameters.pl);
3539
3540
  pads.push(
3540
- rectpad(1, -length36 / 2, padGap, padHeight, padWidth),
3541
- rectpad(2, -length36 / 2 + (1.5 - 1.3) / 2, 0, 1.5, padWidth),
3542
- rectpad(3, -length36 / 2, -padGap, padHeight, padWidth)
3541
+ rectpad(1, -length37 / 2, padGap, padHeight, padWidth),
3542
+ rectpad(2, -length37 / 2 + (1.5 - 1.3) / 2, 0, 1.5, padWidth),
3543
+ rectpad(3, -length37 / 2, -padGap, padHeight, padWidth)
3543
3544
  );
3544
3545
  const silkscreenRefText = silkscreenRef(0, 0, 0.3);
3545
3546
  const width = Number.parseFloat(parameters.w) / 2 - 1;
@@ -3579,7 +3580,7 @@ var sot89_5 = (parameters) => {
3579
3580
  const pads = [];
3580
3581
  const padGap = Number.parseFloat(parameters.p);
3581
3582
  const padWidth = Number.parseFloat(parameters.pw);
3582
- const length36 = Number.parseFloat(parameters.w);
3583
+ const length37 = Number.parseFloat(parameters.w);
3583
3584
  pads.push(
3584
3585
  rectpad(1, -1.85, -1.5, 1.5, 0.7),
3585
3586
  rectpad(2, -1.85, 1.5, 1.5, 0.7),
@@ -4723,23 +4724,92 @@ var sot223_6 = (parameters) => {
4723
4724
  return [...pads, silkscreenPath1, silkscreenPath2, silkscreenRefText];
4724
4725
  };
4725
4726
 
4726
- // src/fn/sod110.ts
4727
+ // src/fn/jst.ts
4728
+ import {
4729
+ length as length35
4730
+ } from "circuit-json";
4727
4731
  import { z as z43 } from "zod";
4728
- import { length as length35 } from "circuit-json";
4729
- var sod_def12 = z43.object({
4732
+
4733
+ // src/helpers/platedHoleWithRectPad.ts
4734
+ import { mm as mm4 } from "@tscircuit/mm";
4735
+ var platedHoleWithRectPad = (pn, x, y, holeDiameter, rectPadWidth, rectPadHeight) => {
4736
+ return {
4737
+ pcb_plated_hole_id: "",
4738
+ type: "pcb_plated_hole",
4739
+ shape: "circular_hole_with_rect_pad",
4740
+ x,
4741
+ y,
4742
+ hole_diameter: mm4(holeDiameter),
4743
+ hole_shape: "circle",
4744
+ pad_shape: "rect",
4745
+ rect_pad_width: mm4(rectPadWidth),
4746
+ rect_pad_height: mm4(rectPadHeight),
4747
+ pcb_port_id: "",
4748
+ layers: ["top", "bottom"],
4749
+ port_hints: [pn.toString()]
4750
+ };
4751
+ };
4752
+
4753
+ // src/fn/jst.ts
4754
+ var jst_def = z43.object({
4730
4755
  fn: z43.string(),
4731
- num_pins: z43.literal(2).default(2),
4732
- w: z43.string().default("3.30mm"),
4733
- h: z43.string().default("1.70mm"),
4734
- pl: z43.string().default("0.80mm"),
4735
- pw: z43.string().default("1mm"),
4736
- p: z43.string().default("1.90mm")
4756
+ p: length35.optional().default("2.2mm"),
4757
+ id: length35.optional().default("0.70mm"),
4758
+ pw: length35.optional().default("1.20mm"),
4759
+ pl: length35.optional().default("1.20mm"),
4760
+ w: length35.optional().default("6mm"),
4761
+ h: length35.optional().default("5mm")
4762
+ });
4763
+ var jst = (raw_params) => {
4764
+ const parameters = jst_def.parse(raw_params);
4765
+ const { p, id, pw, pl, h } = parameters;
4766
+ const half_p = p / 2;
4767
+ const plated_holes = [
4768
+ platedHoleWithRectPad(1, -half_p, 2, id, pw, pl),
4769
+ platedHoleWithRectPad(2, half_p, 2, id, pw, pl)
4770
+ ];
4771
+ const silkscreenBody = {
4772
+ type: "pcb_silkscreen_path",
4773
+ layer: "top",
4774
+ pcb_component_id: "",
4775
+ route: [
4776
+ { x: -3, y: 3 },
4777
+ { x: 3, y: 3 },
4778
+ { x: 3, y: -2 },
4779
+ { x: -3, y: -2 },
4780
+ { x: -3, y: 3 }
4781
+ ],
4782
+ stroke_width: 0.1,
4783
+ pcb_silkscreen_path_id: ""
4784
+ };
4785
+ const silkscreenRefText = silkscreenRef(0, h / 2 + 1, 0.5);
4786
+ return {
4787
+ circuitJson: [
4788
+ ...plated_holes,
4789
+ silkscreenBody,
4790
+ silkscreenRefText
4791
+ ],
4792
+ parameters
4793
+ };
4794
+ };
4795
+
4796
+ // src/fn/sod110.ts
4797
+ import { z as z44 } from "zod";
4798
+ import { length as length36 } from "circuit-json";
4799
+ var sod_def12 = z44.object({
4800
+ fn: z44.string(),
4801
+ num_pins: z44.literal(2).default(2),
4802
+ w: z44.string().default("3.30mm"),
4803
+ h: z44.string().default("1.70mm"),
4804
+ pl: z44.string().default("0.80mm"),
4805
+ pw: z44.string().default("1mm"),
4806
+ p: z44.string().default("1.90mm")
4737
4807
  });
4738
4808
  var sod110 = (raw_params) => {
4739
4809
  const parameters = sod_def12.parse(raw_params);
4740
4810
  const silkscreenRefText = silkscreenRef(
4741
4811
  0,
4742
- length35.parse(parameters.h) / 2 + 0.5,
4812
+ length36.parse(parameters.h) / 2 + 0.5,
4743
4813
  0.3
4744
4814
  );
4745
4815
  const silkscreenLine = {
@@ -4748,20 +4818,20 @@ var sod110 = (raw_params) => {
4748
4818
  pcb_component_id: "",
4749
4819
  route: [
4750
4820
  {
4751
- x: length35.parse(parameters.p) / 2,
4752
- y: length35.parse(parameters.h) / 2
4821
+ x: length36.parse(parameters.p) / 2,
4822
+ y: length36.parse(parameters.h) / 2
4753
4823
  },
4754
4824
  {
4755
- x: -length35.parse(parameters.w) / 2,
4756
- y: length35.parse(parameters.h) / 2
4825
+ x: -length36.parse(parameters.w) / 2,
4826
+ y: length36.parse(parameters.h) / 2
4757
4827
  },
4758
4828
  {
4759
- x: -length35.parse(parameters.w) / 2,
4760
- y: -length35.parse(parameters.h) / 2
4829
+ x: -length36.parse(parameters.w) / 2,
4830
+ y: -length36.parse(parameters.h) / 2
4761
4831
  },
4762
4832
  {
4763
- x: length35.parse(parameters.p) / 2,
4764
- y: -length35.parse(parameters.h) / 2
4833
+ x: length36.parse(parameters.p) / 2,
4834
+ y: -length36.parse(parameters.h) / 2
4765
4835
  }
4766
4836
  ],
4767
4837
  stroke_width: 0.1,