@tscircuit/core 0.0.810 → 0.0.812
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.js +65 -58
- 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
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
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: "
|
|
1992
|
-
width:
|
|
1993
|
-
height:
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
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
|
-
|
|
2002
|
-
db.
|
|
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: "
|
|
2005
|
-
width:
|
|
2006
|
-
height:
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
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;
|
|
@@ -8391,7 +8399,6 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
|
|
|
8391
8399
|
if (!cadModel && !footprint) return;
|
|
8392
8400
|
if (cadModel === null) return;
|
|
8393
8401
|
const bounds = this._getPcbCircuitJsonBounds();
|
|
8394
|
-
const pcb_component = db.pcb_component.get(this.pcb_component_id);
|
|
8395
8402
|
if (typeof cadModel === "string") {
|
|
8396
8403
|
throw new Error("String cadModel not yet implemented");
|
|
8397
8404
|
}
|
|
@@ -8413,10 +8420,10 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
|
|
|
8413
8420
|
const computedLayer = this.props.layer === "bottom" ? "bottom" : "top";
|
|
8414
8421
|
const globalTransform = this._computePcbGlobalTransformBeforeLayout();
|
|
8415
8422
|
const decomposedTransform = decomposeTSR5(globalTransform);
|
|
8416
|
-
const
|
|
8417
|
-
const
|
|
8418
|
-
const rotationWithOffset =
|
|
8419
|
-
const cadRotationZ =
|
|
8423
|
+
const totalRotation = decomposedTransform.rotation.angle * 180 / Math.PI;
|
|
8424
|
+
const isBottomLayer = computedLayer === "bottom";
|
|
8425
|
+
const rotationWithOffset = totalRotation + (rotationOffset.z ?? 0);
|
|
8426
|
+
const cadRotationZ = normalizeDegrees(rotationWithOffset);
|
|
8420
8427
|
const cad_model = db.cad_component.insert({
|
|
8421
8428
|
// TODO z maybe depends on layer
|
|
8422
8429
|
position: {
|
|
@@ -8426,8 +8433,8 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
|
|
|
8426
8433
|
},
|
|
8427
8434
|
rotation: {
|
|
8428
8435
|
x: rotationOffset.x,
|
|
8429
|
-
y:
|
|
8430
|
-
z: cadRotationZ
|
|
8436
|
+
y: rotationOffset.y + (isBottomLayer ? 180 : 0),
|
|
8437
|
+
z: normalizeDegrees(isBottomLayer ? -cadRotationZ : cadRotationZ)
|
|
8431
8438
|
},
|
|
8432
8439
|
pcb_component_id: this.pcb_component_id,
|
|
8433
8440
|
source_component_id: this.source_component_id,
|
|
@@ -17220,7 +17227,7 @@ import { identity as identity6 } from "transformation-matrix";
|
|
|
17220
17227
|
var package_default = {
|
|
17221
17228
|
name: "@tscircuit/core",
|
|
17222
17229
|
type: "module",
|
|
17223
|
-
version: "0.0.
|
|
17230
|
+
version: "0.0.811",
|
|
17224
17231
|
types: "dist/index.d.ts",
|
|
17225
17232
|
main: "dist/index.js",
|
|
17226
17233
|
module: "dist/index.js",
|
|
@@ -17277,7 +17284,7 @@ var package_default = {
|
|
|
17277
17284
|
"circuit-json": "^0.0.288",
|
|
17278
17285
|
"circuit-json-to-bpc": "^0.0.13",
|
|
17279
17286
|
"circuit-json-to-connectivity-map": "^0.0.22",
|
|
17280
|
-
"circuit-json-to-gltf": "^0.0.
|
|
17287
|
+
"circuit-json-to-gltf": "^0.0.28",
|
|
17281
17288
|
"circuit-json-to-simple-3d": "^0.0.9",
|
|
17282
17289
|
"circuit-json-to-spice": "^0.0.15",
|
|
17283
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.
|
|
4
|
+
"version": "0.0.812",
|
|
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.
|
|
61
|
+
"circuit-json-to-gltf": "^0.0.28",
|
|
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",
|