@tscircuit/circuit-json-util 0.0.118 → 0.0.119
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 +82 -14
- package/dist/index.js +11 -11
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -133,8 +133,8 @@ declare const transformSchematicElement: (elm: AnyCircuitElement, matrix: Matrix
|
|
|
133
133
|
requires_power?: boolean | undefined;
|
|
134
134
|
provides_ground?: boolean | undefined;
|
|
135
135
|
requires_ground?: boolean | undefined;
|
|
136
|
-
provides_voltage?:
|
|
137
|
-
requires_voltage?:
|
|
136
|
+
provides_voltage?: number | undefined;
|
|
137
|
+
requires_voltage?: number | undefined;
|
|
138
138
|
do_not_connect?: boolean | undefined;
|
|
139
139
|
include_in_board_pinout?: boolean | undefined;
|
|
140
140
|
can_use_internal_pullup?: boolean | undefined;
|
|
@@ -665,9 +665,9 @@ declare const transformSchematicElement: (elm: AnyCircuitElement, matrix: Matrix
|
|
|
665
665
|
type: "source_missing_manufacturer_part_number_warning";
|
|
666
666
|
source_component_id: string;
|
|
667
667
|
warning_type: "source_missing_manufacturer_part_number_warning";
|
|
668
|
-
standard: string;
|
|
669
668
|
source_missing_manufacturer_part_number_warning_id: string;
|
|
670
669
|
subcircuit_id?: string | undefined;
|
|
670
|
+
standard?: string | undefined;
|
|
671
671
|
} | {
|
|
672
672
|
message: string;
|
|
673
673
|
type: "source_refdes_convention_warning";
|
|
@@ -1055,9 +1055,9 @@ declare const transformSchematicElement: (elm: AnyCircuitElement, matrix: Matrix
|
|
|
1055
1055
|
type: "source_missing_manufacturer_part_number_warning";
|
|
1056
1056
|
source_component_id: string;
|
|
1057
1057
|
warning_type: "source_missing_manufacturer_part_number_warning";
|
|
1058
|
-
standard: string;
|
|
1059
1058
|
source_missing_manufacturer_part_number_warning_id: string;
|
|
1060
1059
|
subcircuit_id?: string | undefined;
|
|
1060
|
+
standard?: string | undefined;
|
|
1061
1061
|
} | {
|
|
1062
1062
|
message: string;
|
|
1063
1063
|
type: "source_refdes_convention_warning";
|
|
@@ -2073,6 +2073,23 @@ declare const transformSchematicElement: (elm: AnyCircuitElement, matrix: Matrix
|
|
|
2073
2073
|
subcircuit_id?: string | undefined;
|
|
2074
2074
|
pcb_group_id?: string | undefined;
|
|
2075
2075
|
pcb_smtpad_id?: string | undefined;
|
|
2076
|
+
} | {
|
|
2077
|
+
type: "pcb_solder_paste";
|
|
2078
|
+
shape: "polygon";
|
|
2079
|
+
points: {
|
|
2080
|
+
x: number;
|
|
2081
|
+
y: number;
|
|
2082
|
+
}[];
|
|
2083
|
+
layer: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | "inner7" | "inner8";
|
|
2084
|
+
pcb_solder_paste_id: string;
|
|
2085
|
+
pcb_component_id?: string | undefined;
|
|
2086
|
+
subcircuit_id?: string | undefined;
|
|
2087
|
+
pcb_group_id?: string | undefined;
|
|
2088
|
+
pcb_smtpad_id?: string | undefined;
|
|
2089
|
+
holes?: {
|
|
2090
|
+
x: number;
|
|
2091
|
+
y: number;
|
|
2092
|
+
}[][] | undefined;
|
|
2076
2093
|
} | {
|
|
2077
2094
|
type: "pcb_soldermask_opening";
|
|
2078
2095
|
x: number;
|
|
@@ -5287,8 +5304,8 @@ declare const transformSchematicElements: (elms: AnyCircuitElement[], matrix: Ma
|
|
|
5287
5304
|
requires_power?: boolean | undefined;
|
|
5288
5305
|
provides_ground?: boolean | undefined;
|
|
5289
5306
|
requires_ground?: boolean | undefined;
|
|
5290
|
-
provides_voltage?:
|
|
5291
|
-
requires_voltage?:
|
|
5307
|
+
provides_voltage?: number | undefined;
|
|
5308
|
+
requires_voltage?: number | undefined;
|
|
5292
5309
|
do_not_connect?: boolean | undefined;
|
|
5293
5310
|
include_in_board_pinout?: boolean | undefined;
|
|
5294
5311
|
can_use_internal_pullup?: boolean | undefined;
|
|
@@ -5819,9 +5836,9 @@ declare const transformSchematicElements: (elms: AnyCircuitElement[], matrix: Ma
|
|
|
5819
5836
|
type: "source_missing_manufacturer_part_number_warning";
|
|
5820
5837
|
source_component_id: string;
|
|
5821
5838
|
warning_type: "source_missing_manufacturer_part_number_warning";
|
|
5822
|
-
standard: string;
|
|
5823
5839
|
source_missing_manufacturer_part_number_warning_id: string;
|
|
5824
5840
|
subcircuit_id?: string | undefined;
|
|
5841
|
+
standard?: string | undefined;
|
|
5825
5842
|
} | {
|
|
5826
5843
|
message: string;
|
|
5827
5844
|
type: "source_refdes_convention_warning";
|
|
@@ -6209,9 +6226,9 @@ declare const transformSchematicElements: (elms: AnyCircuitElement[], matrix: Ma
|
|
|
6209
6226
|
type: "source_missing_manufacturer_part_number_warning";
|
|
6210
6227
|
source_component_id: string;
|
|
6211
6228
|
warning_type: "source_missing_manufacturer_part_number_warning";
|
|
6212
|
-
standard: string;
|
|
6213
6229
|
source_missing_manufacturer_part_number_warning_id: string;
|
|
6214
6230
|
subcircuit_id?: string | undefined;
|
|
6231
|
+
standard?: string | undefined;
|
|
6215
6232
|
} | {
|
|
6216
6233
|
message: string;
|
|
6217
6234
|
type: "source_refdes_convention_warning";
|
|
@@ -7227,6 +7244,23 @@ declare const transformSchematicElements: (elms: AnyCircuitElement[], matrix: Ma
|
|
|
7227
7244
|
subcircuit_id?: string | undefined;
|
|
7228
7245
|
pcb_group_id?: string | undefined;
|
|
7229
7246
|
pcb_smtpad_id?: string | undefined;
|
|
7247
|
+
} | {
|
|
7248
|
+
type: "pcb_solder_paste";
|
|
7249
|
+
shape: "polygon";
|
|
7250
|
+
points: {
|
|
7251
|
+
x: number;
|
|
7252
|
+
y: number;
|
|
7253
|
+
}[];
|
|
7254
|
+
layer: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | "inner7" | "inner8";
|
|
7255
|
+
pcb_solder_paste_id: string;
|
|
7256
|
+
pcb_component_id?: string | undefined;
|
|
7257
|
+
subcircuit_id?: string | undefined;
|
|
7258
|
+
pcb_group_id?: string | undefined;
|
|
7259
|
+
pcb_smtpad_id?: string | undefined;
|
|
7260
|
+
holes?: {
|
|
7261
|
+
x: number;
|
|
7262
|
+
y: number;
|
|
7263
|
+
}[][] | undefined;
|
|
7230
7264
|
} | {
|
|
7231
7265
|
type: "pcb_soldermask_opening";
|
|
7232
7266
|
x: number;
|
|
@@ -10441,8 +10475,8 @@ declare const transformPCBElement: (elm: AnyCircuitElement, matrix: Matrix) => {
|
|
|
10441
10475
|
requires_power?: boolean | undefined;
|
|
10442
10476
|
provides_ground?: boolean | undefined;
|
|
10443
10477
|
requires_ground?: boolean | undefined;
|
|
10444
|
-
provides_voltage?:
|
|
10445
|
-
requires_voltage?:
|
|
10478
|
+
provides_voltage?: number | undefined;
|
|
10479
|
+
requires_voltage?: number | undefined;
|
|
10446
10480
|
do_not_connect?: boolean | undefined;
|
|
10447
10481
|
include_in_board_pinout?: boolean | undefined;
|
|
10448
10482
|
can_use_internal_pullup?: boolean | undefined;
|
|
@@ -10973,9 +11007,9 @@ declare const transformPCBElement: (elm: AnyCircuitElement, matrix: Matrix) => {
|
|
|
10973
11007
|
type: "source_missing_manufacturer_part_number_warning";
|
|
10974
11008
|
source_component_id: string;
|
|
10975
11009
|
warning_type: "source_missing_manufacturer_part_number_warning";
|
|
10976
|
-
standard: string;
|
|
10977
11010
|
source_missing_manufacturer_part_number_warning_id: string;
|
|
10978
11011
|
subcircuit_id?: string | undefined;
|
|
11012
|
+
standard?: string | undefined;
|
|
10979
11013
|
} | {
|
|
10980
11014
|
message: string;
|
|
10981
11015
|
type: "source_refdes_convention_warning";
|
|
@@ -12035,6 +12069,23 @@ declare const transformPCBElement: (elm: AnyCircuitElement, matrix: Matrix) => {
|
|
|
12035
12069
|
subcircuit_id?: string | undefined;
|
|
12036
12070
|
pcb_group_id?: string | undefined;
|
|
12037
12071
|
pcb_smtpad_id?: string | undefined;
|
|
12072
|
+
} | {
|
|
12073
|
+
type: "pcb_solder_paste";
|
|
12074
|
+
shape: "polygon";
|
|
12075
|
+
points: {
|
|
12076
|
+
x: number;
|
|
12077
|
+
y: number;
|
|
12078
|
+
}[];
|
|
12079
|
+
layer: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | "inner7" | "inner8";
|
|
12080
|
+
pcb_solder_paste_id: string;
|
|
12081
|
+
pcb_component_id?: string | undefined;
|
|
12082
|
+
subcircuit_id?: string | undefined;
|
|
12083
|
+
pcb_group_id?: string | undefined;
|
|
12084
|
+
pcb_smtpad_id?: string | undefined;
|
|
12085
|
+
holes?: {
|
|
12086
|
+
x: number;
|
|
12087
|
+
y: number;
|
|
12088
|
+
}[][] | undefined;
|
|
12038
12089
|
} | {
|
|
12039
12090
|
type: "pcb_board";
|
|
12040
12091
|
thickness: number;
|
|
@@ -15201,8 +15252,8 @@ declare const transformPCBElements: (elms: AnyCircuitElement[], matrix: Matrix)
|
|
|
15201
15252
|
requires_power?: boolean | undefined;
|
|
15202
15253
|
provides_ground?: boolean | undefined;
|
|
15203
15254
|
requires_ground?: boolean | undefined;
|
|
15204
|
-
provides_voltage?:
|
|
15205
|
-
requires_voltage?:
|
|
15255
|
+
provides_voltage?: number | undefined;
|
|
15256
|
+
requires_voltage?: number | undefined;
|
|
15206
15257
|
do_not_connect?: boolean | undefined;
|
|
15207
15258
|
include_in_board_pinout?: boolean | undefined;
|
|
15208
15259
|
can_use_internal_pullup?: boolean | undefined;
|
|
@@ -15733,9 +15784,9 @@ declare const transformPCBElements: (elms: AnyCircuitElement[], matrix: Matrix)
|
|
|
15733
15784
|
type: "source_missing_manufacturer_part_number_warning";
|
|
15734
15785
|
source_component_id: string;
|
|
15735
15786
|
warning_type: "source_missing_manufacturer_part_number_warning";
|
|
15736
|
-
standard: string;
|
|
15737
15787
|
source_missing_manufacturer_part_number_warning_id: string;
|
|
15738
15788
|
subcircuit_id?: string | undefined;
|
|
15789
|
+
standard?: string | undefined;
|
|
15739
15790
|
} | {
|
|
15740
15791
|
message: string;
|
|
15741
15792
|
type: "source_refdes_convention_warning";
|
|
@@ -16795,6 +16846,23 @@ declare const transformPCBElements: (elms: AnyCircuitElement[], matrix: Matrix)
|
|
|
16795
16846
|
subcircuit_id?: string | undefined;
|
|
16796
16847
|
pcb_group_id?: string | undefined;
|
|
16797
16848
|
pcb_smtpad_id?: string | undefined;
|
|
16849
|
+
} | {
|
|
16850
|
+
type: "pcb_solder_paste";
|
|
16851
|
+
shape: "polygon";
|
|
16852
|
+
points: {
|
|
16853
|
+
x: number;
|
|
16854
|
+
y: number;
|
|
16855
|
+
}[];
|
|
16856
|
+
layer: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | "inner7" | "inner8";
|
|
16857
|
+
pcb_solder_paste_id: string;
|
|
16858
|
+
pcb_component_id?: string | undefined;
|
|
16859
|
+
subcircuit_id?: string | undefined;
|
|
16860
|
+
pcb_group_id?: string | undefined;
|
|
16861
|
+
pcb_smtpad_id?: string | undefined;
|
|
16862
|
+
holes?: {
|
|
16863
|
+
x: number;
|
|
16864
|
+
y: number;
|
|
16865
|
+
}[][] | undefined;
|
|
16798
16866
|
} | {
|
|
16799
16867
|
type: "pcb_board";
|
|
16800
16868
|
thickness: number;
|
package/dist/index.js
CHANGED
|
@@ -1021,26 +1021,26 @@ var transformPCBElement = (elm, matrix) => {
|
|
|
1021
1021
|
if (elm.type === "pcb_soldermask_opening") {
|
|
1022
1022
|
return transformPcbSoldermaskOpening(elm, matrix);
|
|
1023
1023
|
}
|
|
1024
|
+
if ((elm.type === "pcb_smtpad" || elm.type === "pcb_solder_paste") && elm.shape === "polygon") {
|
|
1025
|
+
elm.points = elm.points.map((point) => applyToPoint(matrix, point));
|
|
1026
|
+
if (elm.type === "pcb_solder_paste" && elm.holes) {
|
|
1027
|
+
elm.holes = elm.holes.map(
|
|
1028
|
+
(hole) => hole.map((point) => applyToPoint(matrix, point))
|
|
1029
|
+
);
|
|
1030
|
+
}
|
|
1031
|
+
return elm;
|
|
1032
|
+
}
|
|
1024
1033
|
const tsr = decomposeTSR(matrix);
|
|
1025
1034
|
const flipPadWidthHeight = Math.abs(getQuarterTurns(tsr.rotation.angle)) % 2 === 1;
|
|
1026
1035
|
const rotationDegrees = tsr.rotation.angle / Math.PI * 180;
|
|
1027
1036
|
const isFlipped = tsr.scale.sy < 0;
|
|
1028
1037
|
if (elm.type === "pcb_plated_hole" || elm.type === "pcb_hole" || elm.type === "pcb_via" || elm.type === "pcb_smtpad" || elm.type === "pcb_solder_paste" || elm.type === "pcb_port") {
|
|
1029
1038
|
const { x, y } = applyToPoint(matrix, {
|
|
1030
|
-
x:
|
|
1031
|
-
y:
|
|
1039
|
+
x: elm.x,
|
|
1040
|
+
y: elm.y
|
|
1032
1041
|
});
|
|
1033
1042
|
elm.x = x;
|
|
1034
1043
|
elm.y = y;
|
|
1035
|
-
if (elm.type === "pcb_smtpad" && elm.shape === "polygon" && Array.isArray(elm.points)) {
|
|
1036
|
-
elm.points = elm.points.map((point) => {
|
|
1037
|
-
const tp = applyToPoint(matrix, { x: point.x, y: point.y });
|
|
1038
|
-
return {
|
|
1039
|
-
x: tp.x,
|
|
1040
|
-
y: tp.y
|
|
1041
|
-
};
|
|
1042
|
-
});
|
|
1043
|
-
}
|
|
1044
1044
|
} else if (elm.type === "pcb_keepout" && elm.shape === "outline") {
|
|
1045
1045
|
elm.outline = elm.outline.map((point) => applyToPoint(matrix, point));
|
|
1046
1046
|
} else if (elm.type === "pcb_keepout" || elm.type === "pcb_board") {
|