@tscircuit/core 0.0.730 → 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.
Files changed (2) hide show
  1. package/dist/index.js +36 -1
  2. package/package.json +1 -1
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
  );
@@ -15248,7 +15283,7 @@ import { identity as identity6 } from "transformation-matrix";
15248
15283
  var package_default = {
15249
15284
  name: "@tscircuit/core",
15250
15285
  type: "module",
15251
- version: "0.0.729",
15286
+ version: "0.0.730",
15252
15287
  types: "dist/index.d.ts",
15253
15288
  main: "dist/index.js",
15254
15289
  module: "dist/index.js",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.730",
4
+ "version": "0.0.731",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",