@tscircuit/footprinter 0.0.162 → 0.0.164

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
@@ -364,6 +364,7 @@ declare const any_footprinter_def: z.ZodUnion<[z.ZodObject<{
364
364
  od: z.ZodDefault<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
365
365
  male: z.ZodOptional<z.ZodBoolean>;
366
366
  female: z.ZodOptional<z.ZodBoolean>;
367
+ nosquareplating: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
367
368
  }, "strip", z.ZodTypeAny, {
368
369
  fn: string;
369
370
  num_pins: number;
@@ -371,6 +372,7 @@ declare const any_footprinter_def: z.ZodUnion<[z.ZodObject<{
371
372
  id: number;
372
373
  od: number;
373
374
  rows: number;
375
+ nosquareplating: boolean;
374
376
  male?: boolean | undefined;
375
377
  female?: boolean | undefined;
376
378
  }, {
@@ -382,6 +384,7 @@ declare const any_footprinter_def: z.ZodUnion<[z.ZodObject<{
382
384
  male?: boolean | undefined;
383
385
  female?: boolean | undefined;
384
386
  rows?: string | number | undefined;
387
+ nosquareplating?: boolean | undefined;
385
388
  }>, {
386
389
  male: boolean;
387
390
  female: boolean;
@@ -391,6 +394,7 @@ declare const any_footprinter_def: z.ZodUnion<[z.ZodObject<{
391
394
  id: number;
392
395
  od: number;
393
396
  rows: number;
397
+ nosquareplating: boolean;
394
398
  }, {
395
399
  fn: string;
396
400
  num_pins?: number | undefined;
@@ -400,6 +404,7 @@ declare const any_footprinter_def: z.ZodUnion<[z.ZodObject<{
400
404
  male?: boolean | undefined;
401
405
  female?: boolean | undefined;
402
406
  rows?: string | number | undefined;
407
+ nosquareplating?: boolean | undefined;
403
408
  }>, {
404
409
  male: boolean;
405
410
  female: boolean;
@@ -409,6 +414,7 @@ declare const any_footprinter_def: z.ZodUnion<[z.ZodObject<{
409
414
  id: number;
410
415
  od: number;
411
416
  rows: number;
417
+ nosquareplating: boolean;
412
418
  }, {
413
419
  fn: string;
414
420
  num_pins?: number | undefined;
@@ -418,6 +424,7 @@ declare const any_footprinter_def: z.ZodUnion<[z.ZodObject<{
418
424
  male?: boolean | undefined;
419
425
  female?: boolean | undefined;
420
426
  rows?: string | number | undefined;
427
+ nosquareplating?: boolean | undefined;
421
428
  }>, z.ZodEffects<z.ZodObject<z.objectUtil.extendShape<{
422
429
  fn: z.ZodString;
423
430
  cc: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
@@ -1007,7 +1014,7 @@ type Footprinter = {
1007
1014
  ssop: (num_pins?: number) => FootprinterParamsBuilder<"w" | "p">;
1008
1015
  tssop: (num_pins?: number) => FootprinterParamsBuilder<"w" | "p">;
1009
1016
  dfn: (num_pins?: number) => FootprinterParamsBuilder<"w" | "p">;
1010
- pinrow: (num_pins?: number) => FootprinterParamsBuilder<"p" | "id" | "od" | "male" | "female" | "rows">;
1017
+ pinrow: (num_pins?: number) => FootprinterParamsBuilder<"p" | "id" | "od" | "male" | "female" | "rows" | "nosquareplating">;
1011
1018
  axial: () => FootprinterParamsBuilder<"p" | "id" | "od">;
1012
1019
  hc49: () => FootprinterParamsBuilder<"p" | "id" | "od" | "w" | "h">;
1013
1020
  to220: () => FootprinterParamsBuilder<"w" | "h" | "p" | "id" | "od">;
package/dist/index.js CHANGED
@@ -1537,6 +1537,26 @@ var dfn = (raw_params) => {
1537
1537
  import { z as z11 } from "zod";
1538
1538
  import { length as length5 } from "circuit-json";
1539
1539
 
1540
+ // src/helpers/platedHoleWithRectPad.ts
1541
+ import { mm as mm3 } from "@tscircuit/mm";
1542
+ var platedHoleWithRectPad = (pn, x, y, holeDiameter, rectPadWidth, rectPadHeight) => {
1543
+ return {
1544
+ pcb_plated_hole_id: "",
1545
+ type: "pcb_plated_hole",
1546
+ shape: "circular_hole_with_rect_pad",
1547
+ x,
1548
+ y,
1549
+ hole_diameter: mm3(holeDiameter),
1550
+ hole_shape: "circle",
1551
+ pad_shape: "rect",
1552
+ rect_pad_width: mm3(rectPadWidth),
1553
+ rect_pad_height: mm3(rectPadHeight),
1554
+ pcb_port_id: "",
1555
+ layers: ["top", "bottom"],
1556
+ port_hints: [pn.toString()]
1557
+ };
1558
+ };
1559
+
1540
1560
  // src/helpers/silkscreenPin.ts
1541
1561
  var silkscreenPin = ({
1542
1562
  x,
@@ -1559,6 +1579,7 @@ var silkscreenPin = ({
1559
1579
  };
1560
1580
 
1561
1581
  // src/fn/pinrow.ts
1582
+ import "@tscircuit/mm";
1562
1583
  var pinrow_def = z11.object({
1563
1584
  fn: z11.string(),
1564
1585
  num_pins: z11.number().optional().default(6),
@@ -1567,7 +1588,8 @@ var pinrow_def = z11.object({
1567
1588
  id: length5.default("1.0mm").describe("inner diameter"),
1568
1589
  od: length5.default("1.5mm").describe("outer diameter"),
1569
1590
  male: z11.boolean().optional().describe("for male pin headers"),
1570
- female: z11.boolean().optional().describe("for female pin headers")
1591
+ female: z11.boolean().optional().describe("for female pin headers"),
1592
+ nosquareplating: z11.boolean().optional().default(false).describe("do not use rectangular pad for pin 1")
1571
1593
  }).transform((data) => ({
1572
1594
  ...data,
1573
1595
  male: data.male ?? (data.female ? false : true),
@@ -1588,7 +1610,11 @@ var pinrow = (raw_params) => {
1588
1610
  const numPinsPerRow = Math.ceil(num_pins / rows);
1589
1611
  const ySpacing = -p;
1590
1612
  const addPin = (pinNumber, xoff, yoff) => {
1591
- holes.push(platedhole(pinNumber, xoff, yoff, id, od));
1613
+ if (pinNumber === 1 && !parameters.nosquareplating) {
1614
+ holes.push(platedHoleWithRectPad(pinNumber, xoff, yoff, id, od, od));
1615
+ } else {
1616
+ holes.push(platedhole(pinNumber, xoff, yoff, id, od));
1617
+ }
1592
1618
  holes.push(
1593
1619
  silkscreenPin({ x: xoff, y: yoff + p / 2, fs: od / 5, pn: pinNumber })
1594
1620
  );
@@ -2859,15 +2885,15 @@ var hc49 = (raw_params) => {
2859
2885
  // src/fn/pad.ts
2860
2886
  import { z as z20 } from "zod";
2861
2887
  import { length as length14 } from "circuit-json";
2862
- import { mm as mm3 } from "@tscircuit/mm";
2888
+ import { mm as mm5 } from "@tscircuit/mm";
2863
2889
  var pad_def = z20.object({
2864
2890
  w: length14,
2865
2891
  h: length14
2866
2892
  });
2867
2893
  var pad = (params) => {
2868
2894
  const { w, h } = params;
2869
- const width = mm3(w);
2870
- const height = mm3(h);
2895
+ const width = mm5(w);
2896
+ const height = mm5(h);
2871
2897
  return {
2872
2898
  circuitJson: [
2873
2899
  rectpad(1, 0, 0, width, height),
@@ -5138,28 +5164,6 @@ import {
5138
5164
  length as length36
5139
5165
  } from "circuit-json";
5140
5166
  import { z as z46 } from "zod";
5141
-
5142
- // src/helpers/platedHoleWithRectPad.ts
5143
- import { mm as mm4 } from "@tscircuit/mm";
5144
- var platedHoleWithRectPad = (pn, x, y, holeDiameter, rectPadWidth, rectPadHeight) => {
5145
- return {
5146
- pcb_plated_hole_id: "",
5147
- type: "pcb_plated_hole",
5148
- shape: "circular_hole_with_rect_pad",
5149
- x,
5150
- y,
5151
- hole_diameter: mm4(holeDiameter),
5152
- hole_shape: "circle",
5153
- pad_shape: "rect",
5154
- rect_pad_width: mm4(rectPadWidth),
5155
- rect_pad_height: mm4(rectPadHeight),
5156
- pcb_port_id: "",
5157
- layers: ["top", "bottom"],
5158
- port_hints: [pn.toString()]
5159
- };
5160
- };
5161
-
5162
- // src/fn/jst.ts
5163
5167
  var jst_def = z46.object({
5164
5168
  fn: z46.string(),
5165
5169
  p: length36.optional().default("2.2mm"),