@tscircuit/footprinter 0.0.234 → 0.0.235

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
@@ -1053,6 +1053,7 @@ declare const any_footprinter_def: z.ZodUnion<[z.ZodObject<{
1053
1053
  circle: z.ZodOptional<z.ZodBoolean>;
1054
1054
  rect: z.ZodOptional<z.ZodBoolean>;
1055
1055
  square: z.ZodOptional<z.ZodBoolean>;
1056
+ pill: z.ZodOptional<z.ZodBoolean>;
1056
1057
  d: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
1057
1058
  pd: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
1058
1059
  diameter: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
@@ -1072,6 +1073,7 @@ declare const any_footprinter_def: z.ZodUnion<[z.ZodObject<{
1072
1073
  fn: string;
1073
1074
  string?: string | undefined;
1074
1075
  circle?: boolean | undefined;
1076
+ pill?: boolean | undefined;
1075
1077
  w?: number | undefined;
1076
1078
  rect?: boolean | undefined;
1077
1079
  width?: number | undefined;
@@ -1092,6 +1094,7 @@ declare const any_footprinter_def: z.ZodUnion<[z.ZodObject<{
1092
1094
  fn: string;
1093
1095
  string?: string | undefined;
1094
1096
  circle?: boolean | undefined;
1097
+ pill?: boolean | undefined;
1095
1098
  w?: string | number | undefined;
1096
1099
  rect?: boolean | undefined;
1097
1100
  width?: string | number | undefined;
@@ -1110,7 +1113,7 @@ declare const any_footprinter_def: z.ZodUnion<[z.ZodObject<{
1110
1113
  size?: string | number | undefined;
1111
1114
  }>, {
1112
1115
  fn: string;
1113
- shape: "circle" | "rect" | "square";
1116
+ shape: "circle" | "pill" | "rect" | "square";
1114
1117
  radius: number | undefined;
1115
1118
  width: number | undefined;
1116
1119
  height: number | undefined;
@@ -1118,6 +1121,7 @@ declare const any_footprinter_def: z.ZodUnion<[z.ZodObject<{
1118
1121
  fn: string;
1119
1122
  string?: string | undefined;
1120
1123
  circle?: boolean | undefined;
1124
+ pill?: boolean | undefined;
1121
1125
  w?: string | number | undefined;
1122
1126
  rect?: boolean | undefined;
1123
1127
  width?: string | number | undefined;
@@ -1223,7 +1227,7 @@ type Footprinter = {
1223
1227
  stampboard: () => FootprinterParamsBuilder<"w" | "h" | "left" | "right" | "top" | "bottom" | "p" | "pw" | "pl" | "innerhole" | "innerholeedgedistance" | "silkscreenlabels" | "silkscreenlabelmargin">;
1224
1228
  stampreceiver: () => FootprinterParamsBuilder<"w" | "h" | "left" | "right" | "top" | "bottom" | "p" | "pw" | "pl" | "innerhole" | "innerholeedgedistance">;
1225
1229
  breakoutheaders: () => FootprinterParamsBuilder<"w" | "h" | "left" | "right" | "top" | "bottom" | "p" | "id" | "od">;
1226
- smtpad: () => FootprinterParamsBuilder<"circle" | "rect" | "square" | "d" | "pd" | "diameter" | "r" | "pr" | "radius" | "w" | "pw" | "width" | "h" | "ph" | "height" | "s" | "size"> & {
1230
+ smtpad: () => FootprinterParamsBuilder<"circle" | "rect" | "square" | "pill" | "d" | "pd" | "diameter" | "r" | "pr" | "radius" | "w" | "pw" | "width" | "h" | "ph" | "height" | "s" | "size"> & {
1227
1231
  params: () => any;
1228
1232
  soup: () => AnySoupElement[];
1229
1233
  circuitJson: () => AnyCircuitElement[];
package/dist/index.js CHANGED
@@ -6856,6 +6856,7 @@ var smtpad_def = z59.object({
6856
6856
  circle: z59.boolean().optional(),
6857
6857
  rect: z59.boolean().optional(),
6858
6858
  square: z59.boolean().optional(),
6859
+ pill: z59.boolean().optional(),
6859
6860
  d: length45.optional(),
6860
6861
  pd: length45.optional(),
6861
6862
  diameter: length45.optional(),
@@ -6876,6 +6877,7 @@ var smtpad_def = z59.object({
6876
6877
  if (v.circle) shape = "circle";
6877
6878
  if (v.square) shape = "square";
6878
6879
  if (v.rect) shape = "rect";
6880
+ if (v.pill) shape = "pill";
6879
6881
  let radius;
6880
6882
  let width;
6881
6883
  let height;
@@ -6897,7 +6899,10 @@ var smtpad_def = z59.object({
6897
6899
  if (v.h !== void 0) height = mm6(v.h);
6898
6900
  else if (v.ph !== void 0) height = mm6(v.ph);
6899
6901
  else if (v.height !== void 0) height = mm6(v.height);
6900
- else height = width;
6902
+ else if (shape === "square") height = width;
6903
+ else if (shape === "rect")
6904
+ height = width;
6905
+ else height = mm6("1mm");
6901
6906
  }
6902
6907
  return {
6903
6908
  fn: v.fn,
@@ -6910,14 +6915,22 @@ var smtpad_def = z59.object({
6910
6915
  var smtpad = (raw_params) => {
6911
6916
  const params = smtpad_def.parse(raw_params);
6912
6917
  const { shape, radius, width, height } = params;
6918
+ let pad2;
6919
+ let silkscreenOffset;
6920
+ if (shape === "circle") {
6921
+ pad2 = circlepad(1, { x: 0, y: 0, radius });
6922
+ silkscreenOffset = radius + 0.5;
6923
+ } else if (shape === "pill") {
6924
+ pad2 = pillpad(1, 0, 0, width, height);
6925
+ silkscreenOffset = Math.max(width, height) / 2 + 0.5;
6926
+ } else {
6927
+ pad2 = rectpad(1, 0, 0, width, height);
6928
+ silkscreenOffset = height / 2 + 0.5;
6929
+ }
6913
6930
  return {
6914
6931
  circuitJson: [
6915
- shape === "circle" ? circlepad(1, { x: 0, y: 0, radius }) : rectpad(1, 0, 0, width, height),
6916
- silkscreenRef(
6917
- 0,
6918
- shape === "circle" ? radius + 0.5 : height / 2 + 0.5,
6919
- 0.2
6920
- )
6932
+ pad2,
6933
+ silkscreenRef(0, silkscreenOffset, 0.2)
6921
6934
  ],
6922
6935
  parameters: params
6923
6936
  };