@tscircuit/core 0.0.811 → 0.0.813

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 +59 -51
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1955,63 +1955,71 @@ var SmtPad = class extends PrimitiveComponent2 {
1955
1955
  pcb_group_id: this.getGroup()?.pcb_group_id ?? void 0
1956
1956
  });
1957
1957
  } else if (props.shape === "rect") {
1958
- pcb_smtpad = isAxisAligned || isRotated90Degrees ? db.pcb_smtpad.insert({
1959
- pcb_component_id,
1960
- pcb_port_id: this.matchedPort?.pcb_port_id,
1961
- // port likely isn't matched
1962
- layer: maybeFlipLayer(props.layer ?? "top"),
1963
- shape: "rect",
1964
- width: isRotated90Degrees ? props.height : props.width,
1965
- height: isRotated90Degrees ? props.width : props.height,
1966
- corner_radius: props.cornerRadius ?? 0,
1967
- port_hints: props.portHints.map((ph) => ph.toString()),
1968
- is_covered_with_solder_mask: isCoveredWithSolderMask,
1969
- x: position.x,
1970
- y: position.y,
1971
- subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
1972
- pcb_group_id: this.getGroup()?.pcb_group_id ?? void 0
1973
- }) : db.pcb_smtpad.insert({
1974
- pcb_component_id,
1975
- layer: maybeFlipLayer(props.layer ?? "top"),
1976
- shape: "rotated_rect",
1977
- width: props.width,
1978
- height: props.height,
1979
- corner_radius: props.cornerRadius ?? 0,
1980
- x: position.x,
1981
- y: position.y,
1982
- ccw_rotation: finalRotationDegrees,
1983
- port_hints: props.portHints.map((ph) => ph.toString()),
1984
- is_covered_with_solder_mask: isCoveredWithSolderMask,
1985
- subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
1986
- pcb_group_id: this.getGroup()?.pcb_group_id ?? void 0
1987
- });
1988
- if (shouldCreateSolderPaste && pcb_smtpad.shape === "rect")
1989
- db.pcb_solder_paste.insert({
1958
+ const hasRotation = !isAxisAligned && !isRotated90Degrees;
1959
+ if (hasRotation) {
1960
+ pcb_smtpad = db.pcb_smtpad.insert({
1961
+ pcb_component_id,
1962
+ pcb_port_id: this.matchedPort?.pcb_port_id,
1990
1963
  layer: maybeFlipLayer(props.layer ?? "top"),
1991
- shape: "rect",
1992
- width: pcb_smtpad.width * 0.7,
1993
- height: pcb_smtpad.height * 0.7,
1994
- x: pcb_smtpad.x,
1995
- y: pcb_smtpad.y,
1996
- pcb_component_id: pcb_smtpad.pcb_component_id,
1997
- pcb_smtpad_id: pcb_smtpad.pcb_smtpad_id,
1964
+ shape: "rotated_rect",
1965
+ width: props.width,
1966
+ height: props.height,
1967
+ corner_radius: props.cornerRadius ?? 0,
1968
+ x: position.x,
1969
+ y: position.y,
1970
+ ccw_rotation: finalRotationDegrees,
1971
+ port_hints: props.portHints.map((ph) => ph.toString()),
1972
+ is_covered_with_solder_mask: isCoveredWithSolderMask,
1998
1973
  subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
1999
1974
  pcb_group_id: this.getGroup()?.pcb_group_id ?? void 0
2000
1975
  });
2001
- if (shouldCreateSolderPaste && pcb_smtpad.shape === "rotated_rect")
2002
- db.pcb_solder_paste.insert({
1976
+ } else {
1977
+ pcb_smtpad = db.pcb_smtpad.insert({
1978
+ pcb_component_id,
1979
+ pcb_port_id: this.matchedPort?.pcb_port_id,
2003
1980
  layer: maybeFlipLayer(props.layer ?? "top"),
2004
- shape: "rotated_rect",
2005
- width: pcb_smtpad.width * 0.7,
2006
- height: pcb_smtpad.height * 0.7,
2007
- x: pcb_smtpad.x,
2008
- y: pcb_smtpad.y,
2009
- ccw_rotation: pcb_smtpad.ccw_rotation,
2010
- pcb_component_id: pcb_smtpad.pcb_component_id,
2011
- pcb_smtpad_id: pcb_smtpad.pcb_smtpad_id,
1981
+ shape: "rect",
1982
+ width: isRotated90Degrees ? props.height : props.width,
1983
+ height: isRotated90Degrees ? props.width : props.height,
1984
+ corner_radius: props.cornerRadius ?? 0,
1985
+ port_hints: props.portHints.map((ph) => ph.toString()),
1986
+ is_covered_with_solder_mask: isCoveredWithSolderMask,
1987
+ x: position.x,
1988
+ y: position.y,
2012
1989
  subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
2013
1990
  pcb_group_id: this.getGroup()?.pcb_group_id ?? void 0
2014
1991
  });
1992
+ }
1993
+ if (shouldCreateSolderPaste) {
1994
+ if (pcb_smtpad.shape === "rect") {
1995
+ db.pcb_solder_paste.insert({
1996
+ layer: maybeFlipLayer(props.layer ?? "top"),
1997
+ shape: "rect",
1998
+ width: pcb_smtpad.width * 0.7,
1999
+ height: pcb_smtpad.height * 0.7,
2000
+ x: pcb_smtpad.x,
2001
+ y: pcb_smtpad.y,
2002
+ pcb_component_id: pcb_smtpad.pcb_component_id,
2003
+ pcb_smtpad_id: pcb_smtpad.pcb_smtpad_id,
2004
+ subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
2005
+ pcb_group_id: this.getGroup()?.pcb_group_id ?? void 0
2006
+ });
2007
+ } else if (pcb_smtpad.shape === "rotated_rect") {
2008
+ db.pcb_solder_paste.insert({
2009
+ layer: maybeFlipLayer(props.layer ?? "top"),
2010
+ shape: "rotated_rect",
2011
+ width: pcb_smtpad.width * 0.7,
2012
+ height: pcb_smtpad.height * 0.7,
2013
+ x: pcb_smtpad.x,
2014
+ y: pcb_smtpad.y,
2015
+ ccw_rotation: pcb_smtpad.ccw_rotation,
2016
+ pcb_component_id: pcb_smtpad.pcb_component_id,
2017
+ pcb_smtpad_id: pcb_smtpad.pcb_smtpad_id,
2018
+ subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
2019
+ pcb_group_id: this.getGroup()?.pcb_group_id ?? void 0
2020
+ });
2021
+ }
2022
+ }
2015
2023
  } else if (props.shape === "rotated_rect") {
2016
2024
  const baseRotation = props.ccwRotation ?? 0;
2017
2025
  const combinedRotationBeforeFlip = (transformRotationBeforeFlip + baseRotation + 360) % 360;
@@ -17219,7 +17227,7 @@ import { identity as identity6 } from "transformation-matrix";
17219
17227
  var package_default = {
17220
17228
  name: "@tscircuit/core",
17221
17229
  type: "module",
17222
- version: "0.0.810",
17230
+ version: "0.0.812",
17223
17231
  types: "dist/index.d.ts",
17224
17232
  main: "dist/index.js",
17225
17233
  module: "dist/index.js",
@@ -17276,7 +17284,7 @@ var package_default = {
17276
17284
  "circuit-json": "^0.0.288",
17277
17285
  "circuit-json-to-bpc": "^0.0.13",
17278
17286
  "circuit-json-to-connectivity-map": "^0.0.22",
17279
- "circuit-json-to-gltf": "^0.0.28",
17287
+ "circuit-json-to-gltf": "^0.0.31",
17280
17288
  "circuit-json-to-simple-3d": "^0.0.9",
17281
17289
  "circuit-json-to-spice": "^0.0.15",
17282
17290
  "circuit-to-svg": "^0.0.250",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.811",
4
+ "version": "0.0.813",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -58,7 +58,7 @@
58
58
  "circuit-json": "^0.0.288",
59
59
  "circuit-json-to-bpc": "^0.0.13",
60
60
  "circuit-json-to-connectivity-map": "^0.0.22",
61
- "circuit-json-to-gltf": "^0.0.28",
61
+ "circuit-json-to-gltf": "^0.0.31",
62
62
  "circuit-json-to-simple-3d": "^0.0.9",
63
63
  "circuit-json-to-spice": "^0.0.15",
64
64
  "circuit-to-svg": "^0.0.250",