@tscircuit/core 0.0.1051 → 0.0.1052
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 +10 -2
- package/dist/index.js +24 -16
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -68191,7 +68191,7 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
|
|
|
68191
68191
|
pcbSx: zod.ZodOptional<zod.ZodType<_tscircuit_props.PcbSx, zod.ZodTypeDef, _tscircuit_props.PcbSx>>;
|
|
68192
68192
|
pcbRelative: zod.ZodOptional<zod.ZodBoolean>;
|
|
68193
68193
|
relative: zod.ZodOptional<zod.ZodBoolean>;
|
|
68194
|
-
}, "layer"
|
|
68194
|
+
}, "layer"> & {
|
|
68195
68195
|
name: zod.ZodOptional<zod.ZodString>;
|
|
68196
68196
|
connectsTo: zod.ZodOptional<zod.ZodUnion<[zod.ZodString, zod.ZodArray<zod.ZodString, "many">]>>;
|
|
68197
68197
|
shape: zod.ZodLiteral<"circular_hole_with_rect_pad">;
|
|
@@ -68220,6 +68220,7 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
|
|
|
68220
68220
|
pcbBottomEdgeY?: string | number | undefined;
|
|
68221
68221
|
pcbOffsetX?: number | undefined;
|
|
68222
68222
|
pcbOffsetY?: number | undefined;
|
|
68223
|
+
pcbRotation?: number | undefined;
|
|
68223
68224
|
pcbPositionAnchor?: string | undefined;
|
|
68224
68225
|
pcbPositionMode?: "relative_to_group_anchor" | "auto" | "relative_to_board_anchor" | "relative_to_component_anchor" | undefined;
|
|
68225
68226
|
pcbMarginTop?: number | undefined;
|
|
@@ -68264,6 +68265,7 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
|
|
|
68264
68265
|
pcbBottomEdgeY?: string | number | undefined;
|
|
68265
68266
|
pcbOffsetX?: string | number | undefined;
|
|
68266
68267
|
pcbOffsetY?: string | number | undefined;
|
|
68268
|
+
pcbRotation?: string | number | undefined;
|
|
68267
68269
|
pcbPositionAnchor?: string | undefined;
|
|
68268
68270
|
pcbPositionMode?: "relative_to_group_anchor" | "auto" | "relative_to_board_anchor" | "relative_to_component_anchor" | undefined;
|
|
68269
68271
|
pcbMarginTop?: string | number | undefined;
|
|
@@ -68358,7 +68360,7 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
|
|
|
68358
68360
|
pcbSx: zod.ZodOptional<zod.ZodType<_tscircuit_props.PcbSx, zod.ZodTypeDef, _tscircuit_props.PcbSx>>;
|
|
68359
68361
|
pcbRelative: zod.ZodOptional<zod.ZodBoolean>;
|
|
68360
68362
|
relative: zod.ZodOptional<zod.ZodBoolean>;
|
|
68361
|
-
}, "layer"
|
|
68363
|
+
}, "layer"> & {
|
|
68362
68364
|
name: zod.ZodOptional<zod.ZodString>;
|
|
68363
68365
|
connectsTo: zod.ZodOptional<zod.ZodUnion<[zod.ZodString, zod.ZodArray<zod.ZodString, "many">]>>;
|
|
68364
68366
|
shape: zod.ZodLiteral<"pill_hole_with_rect_pad">;
|
|
@@ -68388,6 +68390,7 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
|
|
|
68388
68390
|
pcbBottomEdgeY?: string | number | undefined;
|
|
68389
68391
|
pcbOffsetX?: number | undefined;
|
|
68390
68392
|
pcbOffsetY?: number | undefined;
|
|
68393
|
+
pcbRotation?: number | undefined;
|
|
68391
68394
|
pcbPositionAnchor?: string | undefined;
|
|
68392
68395
|
pcbPositionMode?: "relative_to_group_anchor" | "auto" | "relative_to_board_anchor" | "relative_to_component_anchor" | undefined;
|
|
68393
68396
|
pcbMarginTop?: number | undefined;
|
|
@@ -68432,6 +68435,7 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
|
|
|
68432
68435
|
pcbBottomEdgeY?: string | number | undefined;
|
|
68433
68436
|
pcbOffsetX?: string | number | undefined;
|
|
68434
68437
|
pcbOffsetY?: string | number | undefined;
|
|
68438
|
+
pcbRotation?: string | number | undefined;
|
|
68435
68439
|
pcbPositionAnchor?: string | undefined;
|
|
68436
68440
|
pcbPositionMode?: "relative_to_group_anchor" | "auto" | "relative_to_board_anchor" | "relative_to_component_anchor" | undefined;
|
|
68437
68441
|
pcbMarginTop?: string | number | undefined;
|
|
@@ -68782,6 +68786,7 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
|
|
|
68782
68786
|
pcbBottomEdgeY?: string | number | undefined;
|
|
68783
68787
|
pcbOffsetX?: number | undefined;
|
|
68784
68788
|
pcbOffsetY?: number | undefined;
|
|
68789
|
+
pcbRotation?: number | undefined;
|
|
68785
68790
|
pcbPositionAnchor?: string | undefined;
|
|
68786
68791
|
pcbPositionMode?: "relative_to_group_anchor" | "auto" | "relative_to_board_anchor" | "relative_to_component_anchor" | undefined;
|
|
68787
68792
|
pcbMarginTop?: number | undefined;
|
|
@@ -68827,6 +68832,7 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
|
|
|
68827
68832
|
pcbBottomEdgeY?: string | number | undefined;
|
|
68828
68833
|
pcbOffsetX?: number | undefined;
|
|
68829
68834
|
pcbOffsetY?: number | undefined;
|
|
68835
|
+
pcbRotation?: number | undefined;
|
|
68830
68836
|
pcbPositionAnchor?: string | undefined;
|
|
68831
68837
|
pcbPositionMode?: "relative_to_group_anchor" | "auto" | "relative_to_board_anchor" | "relative_to_component_anchor" | undefined;
|
|
68832
68838
|
pcbMarginTop?: number | undefined;
|
|
@@ -69044,6 +69050,7 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
|
|
|
69044
69050
|
pcbBottomEdgeY?: string | number | undefined;
|
|
69045
69051
|
pcbOffsetX?: string | number | undefined;
|
|
69046
69052
|
pcbOffsetY?: string | number | undefined;
|
|
69053
|
+
pcbRotation?: string | number | undefined;
|
|
69047
69054
|
pcbPositionAnchor?: string | undefined;
|
|
69048
69055
|
pcbPositionMode?: "relative_to_group_anchor" | "auto" | "relative_to_board_anchor" | "relative_to_component_anchor" | undefined;
|
|
69049
69056
|
pcbMarginTop?: string | number | undefined;
|
|
@@ -69089,6 +69096,7 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
|
|
|
69089
69096
|
pcbBottomEdgeY?: string | number | undefined;
|
|
69090
69097
|
pcbOffsetX?: string | number | undefined;
|
|
69091
69098
|
pcbOffsetY?: string | number | undefined;
|
|
69099
|
+
pcbRotation?: string | number | undefined;
|
|
69092
69100
|
pcbPositionAnchor?: string | undefined;
|
|
69093
69101
|
pcbPositionMode?: "relative_to_group_anchor" | "auto" | "relative_to_board_anchor" | "relative_to_component_anchor" | undefined;
|
|
69094
69102
|
pcbMarginTop?: string | number | undefined;
|
package/dist/index.js
CHANGED
|
@@ -6021,6 +6021,7 @@ var PcbTrace = class extends PrimitiveComponent2 {
|
|
|
6021
6021
|
// lib/components/primitive-components/PlatedHole.ts
|
|
6022
6022
|
import { platedHoleProps } from "@tscircuit/props";
|
|
6023
6023
|
import "circuit-json";
|
|
6024
|
+
import { decomposeTSR as decomposeTSR2 } from "transformation-matrix";
|
|
6024
6025
|
var PlatedHole = class extends PrimitiveComponent2 {
|
|
6025
6026
|
pcb_plated_hole_id = null;
|
|
6026
6027
|
matchedPort = null;
|
|
@@ -6119,6 +6120,12 @@ var PlatedHole = class extends PrimitiveComponent2 {
|
|
|
6119
6120
|
const soldermaskMargin = props.solderMaskMargin;
|
|
6120
6121
|
const isCoveredWithSolderMask = props.coveredWithSolderMask ?? false;
|
|
6121
6122
|
this.emitSolderMaskMarginWarning(isCoveredWithSolderMask, soldermaskMargin);
|
|
6123
|
+
const decomposedTransform = decomposeTSR2(
|
|
6124
|
+
this._computePcbGlobalTransformBeforeLayout()
|
|
6125
|
+
);
|
|
6126
|
+
const rotationDegrees = decomposedTransform.rotation.angle * 180 / Math.PI;
|
|
6127
|
+
const normalizedRotationDegrees = (rotationDegrees % 360 + 360) % 360;
|
|
6128
|
+
const finalRotationDegrees = normalizedRotationDegrees;
|
|
6122
6129
|
if (props.shape === "circle") {
|
|
6123
6130
|
const pcb_plated_hole = db.pcb_plated_hole.insert({
|
|
6124
6131
|
pcb_component_id,
|
|
@@ -6247,7 +6254,8 @@ var PlatedHole = class extends PrimitiveComponent2 {
|
|
|
6247
6254
|
pcb_group_id: this.getGroup()?.pcb_group_id ?? void 0,
|
|
6248
6255
|
hole_offset_x: props.holeOffsetX,
|
|
6249
6256
|
hole_offset_y: props.holeOffsetY,
|
|
6250
|
-
rect_border_radius: props.rectBorderRadius ?? 0
|
|
6257
|
+
rect_border_radius: props.rectBorderRadius ?? 0,
|
|
6258
|
+
rect_ccw_rotation: finalRotationDegrees
|
|
6251
6259
|
});
|
|
6252
6260
|
this.pcb_plated_hole_id = pcb_plated_hole.pcb_plated_hole_id;
|
|
6253
6261
|
} else if (props.shape === "pill_hole_with_rect_pad") {
|
|
@@ -6566,7 +6574,7 @@ var SilkscreenPath = class extends PrimitiveComponent2 {
|
|
|
6566
6574
|
|
|
6567
6575
|
// lib/components/primitive-components/SilkscreenRect.ts
|
|
6568
6576
|
import { silkscreenRectProps } from "@tscircuit/props";
|
|
6569
|
-
import { decomposeTSR as
|
|
6577
|
+
import { decomposeTSR as decomposeTSR3 } from "transformation-matrix";
|
|
6570
6578
|
var SilkscreenRect = class extends PrimitiveComponent2 {
|
|
6571
6579
|
pcb_silkscreen_rect_id = null;
|
|
6572
6580
|
isPcbPrimitive = true;
|
|
@@ -6582,7 +6590,7 @@ var SilkscreenRect = class extends PrimitiveComponent2 {
|
|
|
6582
6590
|
*/
|
|
6583
6591
|
_isRotated90Degrees() {
|
|
6584
6592
|
const globalTransform = this._computePcbGlobalTransformBeforeLayout();
|
|
6585
|
-
const decomposedTransform =
|
|
6593
|
+
const decomposedTransform = decomposeTSR3(globalTransform);
|
|
6586
6594
|
const rotationDegrees = decomposedTransform.rotation.angle * 180 / Math.PI;
|
|
6587
6595
|
const normalizedRotationDegrees = (rotationDegrees % 360 + 360) % 360;
|
|
6588
6596
|
const rotationTolerance = 0.01;
|
|
@@ -6651,7 +6659,7 @@ var SilkscreenRect = class extends PrimitiveComponent2 {
|
|
|
6651
6659
|
|
|
6652
6660
|
// lib/components/primitive-components/SilkscreenText.ts
|
|
6653
6661
|
import { silkscreenTextProps } from "@tscircuit/props";
|
|
6654
|
-
import { decomposeTSR as
|
|
6662
|
+
import { decomposeTSR as decomposeTSR4 } from "transformation-matrix";
|
|
6655
6663
|
|
|
6656
6664
|
// lib/utils/pcbSx/resolve-pcb-property.ts
|
|
6657
6665
|
function parseSegment(seg) {
|
|
@@ -6752,7 +6760,7 @@ var SilkscreenText = class extends PrimitiveComponent2 {
|
|
|
6752
6760
|
rotation4 = props.pcbRotation;
|
|
6753
6761
|
} else {
|
|
6754
6762
|
const globalTransform = this._computePcbGlobalTransformBeforeLayout();
|
|
6755
|
-
const decomposedTransform =
|
|
6763
|
+
const decomposedTransform = decomposeTSR4(globalTransform);
|
|
6756
6764
|
rotation4 = decomposedTransform.rotation.angle * 180 / Math.PI;
|
|
6757
6765
|
}
|
|
6758
6766
|
if (isFlipped) {
|
|
@@ -6838,7 +6846,7 @@ import { smtPadProps } from "@tscircuit/props";
|
|
|
6838
6846
|
import {
|
|
6839
6847
|
distance as distance5
|
|
6840
6848
|
} from "circuit-json";
|
|
6841
|
-
import { applyToPoint as applyToPoint13, decomposeTSR as
|
|
6849
|
+
import { applyToPoint as applyToPoint13, decomposeTSR as decomposeTSR5 } from "transformation-matrix";
|
|
6842
6850
|
var SmtPad = class extends PrimitiveComponent2 {
|
|
6843
6851
|
pcb_smtpad_id = null;
|
|
6844
6852
|
matchedPort = null;
|
|
@@ -6909,7 +6917,7 @@ var SmtPad = class extends PrimitiveComponent2 {
|
|
|
6909
6917
|
const subcircuit = this.getSubcircuit();
|
|
6910
6918
|
const position = this._getGlobalPcbPositionBeforeLayout();
|
|
6911
6919
|
const globalTransform = this._computePcbGlobalTransformBeforeLayout();
|
|
6912
|
-
const decomposedTransform =
|
|
6920
|
+
const decomposedTransform = decomposeTSR5(
|
|
6913
6921
|
this._computePcbGlobalTransformBeforeLayout()
|
|
6914
6922
|
);
|
|
6915
6923
|
const rotationDegrees = decomposedTransform.rotation.angle * 180 / Math.PI;
|
|
@@ -8743,7 +8751,7 @@ import {
|
|
|
8743
8751
|
isValidElement
|
|
8744
8752
|
} from "react";
|
|
8745
8753
|
import { symbols as symbols2 } from "schematic-symbols";
|
|
8746
|
-
import { decomposeTSR as
|
|
8754
|
+
import { decomposeTSR as decomposeTSR7 } from "transformation-matrix";
|
|
8747
8755
|
import { z as z9 } from "zod";
|
|
8748
8756
|
|
|
8749
8757
|
// lib/components/primitive-components/CadAssembly.ts
|
|
@@ -8762,7 +8770,7 @@ var CadAssembly = class extends PrimitiveComponent2 {
|
|
|
8762
8770
|
import { cadmodelProps, point3 } from "@tscircuit/props";
|
|
8763
8771
|
import { z as z8 } from "zod";
|
|
8764
8772
|
import { distance as distance6 } from "circuit-json";
|
|
8765
|
-
import { decomposeTSR as
|
|
8773
|
+
import { decomposeTSR as decomposeTSR6 } from "transformation-matrix";
|
|
8766
8774
|
|
|
8767
8775
|
// lib/components/base-components/NormalComponent/utils/getFileExtension.ts
|
|
8768
8776
|
var getFileExtension = (filename) => {
|
|
@@ -8823,7 +8831,7 @@ var CadModel = class extends PrimitiveComponent2 {
|
|
|
8823
8831
|
if (!props || typeof props.modelUrl !== "string" && typeof props.stepUrl !== "string")
|
|
8824
8832
|
return;
|
|
8825
8833
|
const parentTransform = parent._computePcbGlobalTransformBeforeLayout();
|
|
8826
|
-
const decomposedTransform =
|
|
8834
|
+
const decomposedTransform = decomposeTSR6(parentTransform);
|
|
8827
8835
|
const accumulatedRotation = decomposedTransform.rotation.angle * 180 / Math.PI;
|
|
8828
8836
|
const rotationOffset = rotation3.parse({ x: 0, y: 0, z: 0 });
|
|
8829
8837
|
if (typeof props.rotationOffset === "number") {
|
|
@@ -10218,7 +10226,7 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
|
|
|
10218
10226
|
db.pcb_component_invalid_layer_error.insert(error);
|
|
10219
10227
|
}
|
|
10220
10228
|
const globalTransform = this._computePcbGlobalTransformBeforeLayout();
|
|
10221
|
-
const decomposedTransform =
|
|
10229
|
+
const decomposedTransform = decomposeTSR7(globalTransform);
|
|
10222
10230
|
const accumulatedRotation = decomposedTransform.rotation.angle * 180 / Math.PI;
|
|
10223
10231
|
const pcb_component = db.pcb_component.insert({
|
|
10224
10232
|
center: this._getGlobalPcbPositionBeforeLayout(),
|
|
@@ -10669,7 +10677,7 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
|
|
|
10669
10677
|
) : 0 : 0;
|
|
10670
10678
|
const computedLayer = this.props.layer === "bottom" ? "bottom" : "top";
|
|
10671
10679
|
const globalTransform = this._computePcbGlobalTransformBeforeLayout();
|
|
10672
|
-
const decomposedTransform =
|
|
10680
|
+
const decomposedTransform = decomposeTSR7(globalTransform);
|
|
10673
10681
|
const totalRotation = decomposedTransform.rotation.angle * 180 / Math.PI;
|
|
10674
10682
|
const isBottomLayer = computedLayer === "bottom";
|
|
10675
10683
|
const rotationWithOffset = totalRotation + (rotationOffset.z ?? 0);
|
|
@@ -18406,7 +18414,7 @@ import { identity as identity4 } from "transformation-matrix";
|
|
|
18406
18414
|
var package_default = {
|
|
18407
18415
|
name: "@tscircuit/core",
|
|
18408
18416
|
type: "module",
|
|
18409
|
-
version: "0.0.
|
|
18417
|
+
version: "0.0.1051",
|
|
18410
18418
|
types: "dist/index.d.ts",
|
|
18411
18419
|
main: "dist/index.js",
|
|
18412
18420
|
module: "dist/index.js",
|
|
@@ -18450,7 +18458,7 @@ var package_default = {
|
|
|
18450
18458
|
"@tscircuit/math-utils": "^0.0.29",
|
|
18451
18459
|
"@tscircuit/miniflex": "^0.0.4",
|
|
18452
18460
|
"@tscircuit/ngspice-spice-engine": "^0.0.8",
|
|
18453
|
-
"@tscircuit/props": "^0.0.
|
|
18461
|
+
"@tscircuit/props": "^0.0.479",
|
|
18454
18462
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|
|
18455
18463
|
"@tscircuit/schematic-trace-solver": "^v0.0.45",
|
|
18456
18464
|
"@tscircuit/solver-utils": "^0.0.3",
|
|
@@ -18464,13 +18472,13 @@ var package_default = {
|
|
|
18464
18472
|
"bun-match-svg": "0.0.12",
|
|
18465
18473
|
"calculate-elbow": "^0.0.12",
|
|
18466
18474
|
"chokidar-cli": "^3.0.0",
|
|
18467
|
-
"circuit-json": "^0.0.
|
|
18475
|
+
"circuit-json": "^0.0.384",
|
|
18468
18476
|
"circuit-json-to-bpc": "^0.0.13",
|
|
18469
18477
|
"circuit-json-to-connectivity-map": "^0.0.23",
|
|
18470
18478
|
"circuit-json-to-gltf": "^0.0.73",
|
|
18471
18479
|
"circuit-json-to-simple-3d": "^0.0.9",
|
|
18472
18480
|
"circuit-json-to-spice": "^0.0.34",
|
|
18473
|
-
"circuit-to-svg": "^0.0.
|
|
18481
|
+
"circuit-to-svg": "^0.0.330",
|
|
18474
18482
|
concurrently: "^9.1.2",
|
|
18475
18483
|
"connectivity-map": "^1.0.0",
|
|
18476
18484
|
debug: "^4.3.6",
|
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.1052",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@tscircuit/math-utils": "^0.0.29",
|
|
46
46
|
"@tscircuit/miniflex": "^0.0.4",
|
|
47
47
|
"@tscircuit/ngspice-spice-engine": "^0.0.8",
|
|
48
|
-
"@tscircuit/props": "^0.0.
|
|
48
|
+
"@tscircuit/props": "^0.0.479",
|
|
49
49
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|
|
50
50
|
"@tscircuit/schematic-trace-solver": "^v0.0.45",
|
|
51
51
|
"@tscircuit/solver-utils": "^0.0.3",
|
|
@@ -59,13 +59,13 @@
|
|
|
59
59
|
"bun-match-svg": "0.0.12",
|
|
60
60
|
"calculate-elbow": "^0.0.12",
|
|
61
61
|
"chokidar-cli": "^3.0.0",
|
|
62
|
-
"circuit-json": "^0.0.
|
|
62
|
+
"circuit-json": "^0.0.384",
|
|
63
63
|
"circuit-json-to-bpc": "^0.0.13",
|
|
64
64
|
"circuit-json-to-connectivity-map": "^0.0.23",
|
|
65
65
|
"circuit-json-to-gltf": "^0.0.73",
|
|
66
66
|
"circuit-json-to-simple-3d": "^0.0.9",
|
|
67
67
|
"circuit-json-to-spice": "^0.0.34",
|
|
68
|
-
"circuit-to-svg": "^0.0.
|
|
68
|
+
"circuit-to-svg": "^0.0.330",
|
|
69
69
|
"concurrently": "^9.1.2",
|
|
70
70
|
"connectivity-map": "^1.0.0",
|
|
71
71
|
"debug": "^4.3.6",
|