@tscircuit/core 0.0.729 → 0.0.731

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
@@ -1308,6 +1308,7 @@ declare class Board extends Group<typeof boardProps> {
1308
1308
  pcbFlexColumn: zod.ZodOptional<zod.ZodBoolean>;
1309
1309
  pcbGap: zod.ZodOptional<zod.ZodUnion<[zod.ZodNumber, zod.ZodString]>>;
1310
1310
  pcbPack: zod.ZodOptional<zod.ZodBoolean>;
1311
+ pcbPackGap: zod.ZodOptional<zod.ZodUnion<[zod.ZodNumber, zod.ZodString]>>;
1311
1312
  schGrid: zod.ZodOptional<zod.ZodBoolean>;
1312
1313
  schGridCols: zod.ZodOptional<zod.ZodUnion<[zod.ZodNumber, zod.ZodString]>>;
1313
1314
  schGridRows: zod.ZodOptional<zod.ZodUnion<[zod.ZodNumber, zod.ZodString]>>;
@@ -2003,6 +2004,7 @@ declare class Board extends Group<typeof boardProps> {
2003
2004
  pcbFlexColumn?: boolean | undefined;
2004
2005
  pcbGap?: string | number | undefined;
2005
2006
  pcbPack?: boolean | undefined;
2007
+ pcbPackGap?: string | number | undefined;
2006
2008
  schGrid?: boolean | undefined;
2007
2009
  schGridCols?: string | number | undefined;
2008
2010
  schGridRows?: string | number | undefined;
@@ -2254,6 +2256,7 @@ declare class Board extends Group<typeof boardProps> {
2254
2256
  pcbFlexColumn?: boolean | undefined;
2255
2257
  pcbGap?: string | number | undefined;
2256
2258
  pcbPack?: boolean | undefined;
2259
+ pcbPackGap?: string | number | undefined;
2257
2260
  schGrid?: boolean | undefined;
2258
2261
  schGridCols?: string | number | undefined;
2259
2262
  schGridRows?: string | number | undefined;
@@ -17625,6 +17628,7 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
17625
17628
  holeDiameter: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
17626
17629
  rectPadWidth: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
17627
17630
  rectPadHeight: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
17631
+ rectBorderRadius: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
17628
17632
  holeShape: zod.ZodOptional<zod.ZodLiteral<"circle">>;
17629
17633
  padShape: zod.ZodOptional<zod.ZodLiteral<"rect">>;
17630
17634
  portHints: zod.ZodOptional<zod.ZodArray<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, "many">>;
@@ -17649,6 +17653,7 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
17649
17653
  name?: string | undefined;
17650
17654
  connectsTo?: string | string[] | undefined;
17651
17655
  portHints?: (string | number)[] | undefined;
17656
+ rectBorderRadius?: number | undefined;
17652
17657
  holeShape?: "circle" | undefined;
17653
17658
  padShape?: "rect" | undefined;
17654
17659
  pcbHoleOffsetX?: number | undefined;
@@ -17672,6 +17677,7 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
17672
17677
  name?: string | undefined;
17673
17678
  connectsTo?: string | string[] | undefined;
17674
17679
  portHints?: (string | number)[] | undefined;
17680
+ rectBorderRadius?: string | number | undefined;
17675
17681
  holeShape?: "circle" | undefined;
17676
17682
  padShape?: "rect" | undefined;
17677
17683
  pcbHoleOffsetX?: string | number | undefined;
@@ -17836,6 +17842,7 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
17836
17842
  name?: string | undefined;
17837
17843
  connectsTo?: string | string[] | undefined;
17838
17844
  portHints?: (string | number)[] | undefined;
17845
+ rectBorderRadius?: number | undefined;
17839
17846
  holeShape?: "circle" | undefined;
17840
17847
  padShape?: "rect" | undefined;
17841
17848
  pcbHoleOffsetX?: number | undefined;
@@ -17945,6 +17952,7 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
17945
17952
  name?: string | undefined;
17946
17953
  connectsTo?: string | string[] | undefined;
17947
17954
  portHints?: (string | number)[] | undefined;
17955
+ rectBorderRadius?: string | number | undefined;
17948
17956
  holeShape?: "circle" | undefined;
17949
17957
  padShape?: "rect" | undefined;
17950
17958
  pcbHoleOffsetX?: string | number | undefined;
@@ -18555,6 +18563,7 @@ declare class SmtPad extends PrimitiveComponent<typeof smtPadProps> {
18555
18563
  shape: zod.ZodLiteral<"rect">;
18556
18564
  width: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
18557
18565
  height: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
18566
+ rectBorderRadius: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
18558
18567
  portHints: zod.ZodOptional<zod.ZodArray<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, "many">>;
18559
18568
  coveredWithSolderMask: zod.ZodOptional<zod.ZodBoolean>;
18560
18569
  }, "strip", zod.ZodTypeAny, {
@@ -18575,6 +18584,7 @@ declare class SmtPad extends PrimitiveComponent<typeof smtPadProps> {
18575
18584
  relative?: boolean | undefined;
18576
18585
  name?: string | undefined;
18577
18586
  portHints?: (string | number)[] | undefined;
18587
+ rectBorderRadius?: number | undefined;
18578
18588
  coveredWithSolderMask?: boolean | undefined;
18579
18589
  }, {
18580
18590
  shape: "rect";
@@ -18596,6 +18606,7 @@ declare class SmtPad extends PrimitiveComponent<typeof smtPadProps> {
18596
18606
  relative?: boolean | undefined;
18597
18607
  name?: string | undefined;
18598
18608
  portHints?: (string | number)[] | undefined;
18609
+ rectBorderRadius?: string | number | undefined;
18599
18610
  coveredWithSolderMask?: boolean | undefined;
18600
18611
  }>, zod.ZodObject<Omit<{
18601
18612
  pcbX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
package/dist/index.js CHANGED
@@ -1816,6 +1816,9 @@ var SmtPad = class extends PrimitiveComponent2 {
1816
1816
  const maxY = Math.max(...ys);
1817
1817
  return { width: maxX - minX, height: maxY - minY };
1818
1818
  }
1819
+ if (props.shape === "pill") {
1820
+ return { width: props.width, height: props.height };
1821
+ }
1819
1822
  throw new Error(
1820
1823
  `getPcbSize for shape "${props.shape}" not implemented for ${this.componentName}`
1821
1824
  );
@@ -1949,6 +1952,23 @@ var SmtPad = class extends PrimitiveComponent2 {
1949
1952
  subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
1950
1953
  pcb_group_id: this.getGroup()?.pcb_group_id ?? void 0
1951
1954
  });
1955
+ } else if (props.shape === "pill") {
1956
+ pcb_smtpad = db.pcb_smtpad.insert({
1957
+ pcb_component_id,
1958
+ pcb_port_id: this.matchedPort?.pcb_port_id,
1959
+ // port likely isn't matched
1960
+ layer: maybeFlipLayer(props.layer ?? "top"),
1961
+ shape: "pill",
1962
+ x: position.x,
1963
+ y: position.y,
1964
+ radius: props.radius,
1965
+ height: props.height,
1966
+ width: props.width,
1967
+ port_hints: props.portHints.map((ph) => ph.toString()),
1968
+ is_covered_with_solder_mask: props.coveredWithSolderMask ?? false,
1969
+ subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
1970
+ pcb_group_id: this.getGroup()?.pcb_group_id ?? void 0
1971
+ });
1952
1972
  }
1953
1973
  if (pcb_smtpad) {
1954
1974
  this.pcb_smtpad_id = pcb_smtpad.pcb_smtpad_id;
@@ -2030,6 +2050,21 @@ var SmtPad = class extends PrimitiveComponent2 {
2030
2050
  height: maxY - minY
2031
2051
  };
2032
2052
  }
2053
+ if (smtpad.shape === "pill") {
2054
+ const halfWidth = smtpad.width / 2;
2055
+ const halfHeight = smtpad.height / 2;
2056
+ return {
2057
+ center: { x: smtpad.x, y: smtpad.y },
2058
+ bounds: {
2059
+ left: smtpad.x - halfWidth,
2060
+ top: smtpad.y - halfHeight,
2061
+ right: smtpad.x + halfWidth,
2062
+ bottom: smtpad.y + halfHeight
2063
+ },
2064
+ width: smtpad.width,
2065
+ height: smtpad.height
2066
+ };
2067
+ }
2033
2068
  throw new Error(
2034
2069
  `circuitJson bounds calculation not implemented for shape "${smtpad.shape}"`
2035
2070
  );
@@ -2409,7 +2444,8 @@ var PlatedHole = class extends PrimitiveComponent2 {
2409
2444
  subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
2410
2445
  pcb_group_id: this.getGroup()?.pcb_group_id ?? void 0,
2411
2446
  hole_offset_x: props.pcbHoleOffsetX ?? 0,
2412
- hole_offset_y: props.pcbHoleOffsetY ?? 0
2447
+ hole_offset_y: props.pcbHoleOffsetY ?? 0,
2448
+ rect_border_radius: props.rectBorderRadius ?? 0
2413
2449
  });
2414
2450
  this.pcb_plated_hole_id = pcb_plated_hole.pcb_plated_hole_id;
2415
2451
  } else if (props.shape === "pill_hole_with_rect_pad") {
@@ -2810,7 +2846,8 @@ var createComponentsFromCircuitJson = ({
2810
2846
  shape: "rect",
2811
2847
  height: elm.height,
2812
2848
  width: elm.width,
2813
- portHints: elm.port_hints
2849
+ portHints: elm.port_hints,
2850
+ rectBorderRadius: elm.rect_border_radius
2814
2851
  })
2815
2852
  );
2816
2853
  } else if (elm.type === "pcb_smtpad" && elm.shape === "circle") {
@@ -2855,7 +2892,8 @@ var createComponentsFromCircuitJson = ({
2855
2892
  rectPadWidth: elm.rect_pad_width,
2856
2893
  portHints: elm.port_hints,
2857
2894
  pcbHoleOffsetX: elm.hole_offset_x,
2858
- pcbHoleOffsetY: elm.hole_offset_y
2895
+ pcbHoleOffsetY: elm.hole_offset_y,
2896
+ rectBorderRadius: elm.rect_border_radius
2859
2897
  })
2860
2898
  );
2861
2899
  } else if (elm.shape === "pill" || elm.shape === "oval") {
@@ -10413,7 +10451,6 @@ var Group_doInitialPcbLayoutPack = (group) => {
10413
10451
  packPlacementStrategy,
10414
10452
  gap: gapProp,
10415
10453
  pcbGap,
10416
- // @ts-expect-error remove when props introduces pcbPackGap
10417
10454
  pcbPackGap
10418
10455
  } = props;
10419
10456
  const gap = pcbPackGap ?? pcbGap ?? gapProp;
@@ -15246,7 +15283,7 @@ import { identity as identity6 } from "transformation-matrix";
15246
15283
  var package_default = {
15247
15284
  name: "@tscircuit/core",
15248
15285
  type: "module",
15249
- version: "0.0.728",
15286
+ version: "0.0.730",
15250
15287
  types: "dist/index.d.ts",
15251
15288
  main: "dist/index.js",
15252
15289
  module: "dist/index.js",
@@ -15285,7 +15322,7 @@ var package_default = {
15285
15322
  "@tscircuit/matchpack": "^0.0.16",
15286
15323
  "@tscircuit/math-utils": "^0.0.21",
15287
15324
  "@tscircuit/miniflex": "^0.0.4",
15288
- "@tscircuit/props": "0.0.322",
15325
+ "@tscircuit/props": "0.0.324",
15289
15326
  "@tscircuit/schematic-autolayout": "^0.0.6",
15290
15327
  "@tscircuit/schematic-match-adapt": "^0.0.16",
15291
15328
  "@tscircuit/schematic-trace-solver": "^0.0.37",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.729",
4
+ "version": "0.0.731",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -40,7 +40,7 @@
40
40
  "@tscircuit/matchpack": "^0.0.16",
41
41
  "@tscircuit/math-utils": "^0.0.21",
42
42
  "@tscircuit/miniflex": "^0.0.4",
43
- "@tscircuit/props": "0.0.322",
43
+ "@tscircuit/props": "0.0.324",
44
44
  "@tscircuit/schematic-autolayout": "^0.0.6",
45
45
  "@tscircuit/schematic-match-adapt": "^0.0.16",
46
46
  "@tscircuit/schematic-trace-solver": "^0.0.37",