@tscircuit/footprinter 0.0.140 → 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">;
@@ -1038,6 +1039,7 @@ type Footprinter = {
1038
1039
  sod123f: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pl" | "pw">;
1039
1040
  sod123: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pl" | "pw">;
1040
1041
  sod123w: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pl" | "pw">;
1042
+ sod110: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pl" | "pw">;
1041
1043
  to92: () => FootprinterParamsBuilder<"w" | "h" | "p" | "id" | "od" | "inline">;
1042
1044
  sot223: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pl" | "pw">;
1043
1045
  pushbutton: () => FootprinterParamsBuilder<"tllabel" | "trlabel" | "bllabel" | "brlabel">;
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,
@@ -34,6 +35,7 @@ __export(fn_exports, {
34
35
  smb: () => smb,
35
36
  smc: () => smc,
36
37
  smf: () => smf,
38
+ sod110: () => sod110,
37
39
  sod123: () => sod123,
38
40
  sod123f: () => sod123f,
39
41
  sod123w: () => sod123w,
@@ -3533,12 +3535,12 @@ var sot89_3 = (parameters) => {
3533
3535
  const pads = [];
3534
3536
  const padGap = Number.parseFloat(parameters.p);
3535
3537
  const padWidth = Number.parseFloat(parameters.pw);
3536
- const length35 = Number.parseFloat(parameters.w);
3538
+ const length37 = Number.parseFloat(parameters.w);
3537
3539
  const padHeight = Number.parseFloat(parameters.pl);
3538
3540
  pads.push(
3539
- rectpad(1, -length35 / 2, padGap, padHeight, padWidth),
3540
- rectpad(2, -length35 / 2 + (1.5 - 1.3) / 2, 0, 1.5, padWidth),
3541
- rectpad(3, -length35 / 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)
3542
3544
  );
3543
3545
  const silkscreenRefText = silkscreenRef(0, 0, 0.3);
3544
3546
  const width = Number.parseFloat(parameters.w) / 2 - 1;
@@ -3578,7 +3580,7 @@ var sot89_5 = (parameters) => {
3578
3580
  const pads = [];
3579
3581
  const padGap = Number.parseFloat(parameters.p);
3580
3582
  const padWidth = Number.parseFloat(parameters.pw);
3581
- const length35 = Number.parseFloat(parameters.w);
3583
+ const length37 = Number.parseFloat(parameters.w);
3582
3584
  pads.push(
3583
3585
  rectpad(1, -1.85, -1.5, 1.5, 0.7),
3584
3586
  rectpad(2, -1.85, 1.5, 1.5, 0.7),
@@ -4722,6 +4724,154 @@ var sot223_6 = (parameters) => {
4722
4724
  return [...pads, silkscreenPath1, silkscreenPath2, silkscreenRefText];
4723
4725
  };
4724
4726
 
4727
+ // src/fn/jst.ts
4728
+ import {
4729
+ length as length35
4730
+ } from "circuit-json";
4731
+ import { z as z43 } from "zod";
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({
4755
+ fn: z43.string(),
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")
4807
+ });
4808
+ var sod110 = (raw_params) => {
4809
+ const parameters = sod_def12.parse(raw_params);
4810
+ const silkscreenRefText = silkscreenRef(
4811
+ 0,
4812
+ length36.parse(parameters.h) / 2 + 0.5,
4813
+ 0.3
4814
+ );
4815
+ const silkscreenLine = {
4816
+ type: "pcb_silkscreen_path",
4817
+ layer: "top",
4818
+ pcb_component_id: "",
4819
+ route: [
4820
+ {
4821
+ x: length36.parse(parameters.p) / 2,
4822
+ y: length36.parse(parameters.h) / 2
4823
+ },
4824
+ {
4825
+ x: -length36.parse(parameters.w) / 2,
4826
+ y: length36.parse(parameters.h) / 2
4827
+ },
4828
+ {
4829
+ x: -length36.parse(parameters.w) / 2,
4830
+ y: -length36.parse(parameters.h) / 2
4831
+ },
4832
+ {
4833
+ x: length36.parse(parameters.p) / 2,
4834
+ y: -length36.parse(parameters.h) / 2
4835
+ }
4836
+ ],
4837
+ stroke_width: 0.1,
4838
+ pcb_silkscreen_path_id: ""
4839
+ };
4840
+ return {
4841
+ circuitJson: sodWithoutParsing12(parameters).concat(
4842
+ silkscreenLine,
4843
+ silkscreenRefText
4844
+ ),
4845
+ parameters
4846
+ };
4847
+ };
4848
+ var getSodCoords12 = (parameters) => {
4849
+ const { pn, p } = parameters;
4850
+ if (pn === 1) {
4851
+ return { x: -p / 2, y: 0 };
4852
+ }
4853
+ return { x: p / 2, y: 0 };
4854
+ };
4855
+ var sodWithoutParsing12 = (parameters) => {
4856
+ const pads = [];
4857
+ for (let i = 1; i <= parameters.num_pins; i++) {
4858
+ const { x, y } = getSodCoords12({
4859
+ pn: i,
4860
+ p: Number.parseFloat(parameters.p)
4861
+ });
4862
+ pads.push(
4863
+ rectpad(
4864
+ i,
4865
+ x,
4866
+ y,
4867
+ Number.parseFloat(parameters.pl),
4868
+ Number.parseFloat(parameters.pw)
4869
+ )
4870
+ );
4871
+ }
4872
+ return pads;
4873
+ };
4874
+
4725
4875
  // src/helpers/is-not-null.ts
4726
4876
  function isNotNull(value) {
4727
4877
  return value !== null;