circuit-json 0.0.432 → 0.0.434
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/README.md +22 -0
- package/dist/index.d.mts +1126 -204
- package/dist/index.mjs +539 -696
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/dist/index.mjs
CHANGED
|
@@ -1,221 +1,19 @@
|
|
|
1
|
-
// src/utils/convert-si-unit-to-number.ts
|
|
2
|
-
var unitMappings = {
|
|
3
|
-
Hz: {
|
|
4
|
-
baseUnit: "Hz",
|
|
5
|
-
variants: {
|
|
6
|
-
MHz: 1e6,
|
|
7
|
-
kHz: 1e3,
|
|
8
|
-
Hz: 1
|
|
9
|
-
}
|
|
10
|
-
},
|
|
11
|
-
g: {
|
|
12
|
-
baseUnit: "g",
|
|
13
|
-
variants: {
|
|
14
|
-
kg: 1e3,
|
|
15
|
-
g: 1
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
\u03A9: {
|
|
19
|
-
baseUnit: "\u03A9",
|
|
20
|
-
variants: {
|
|
21
|
-
m\u03A9: 1e-3,
|
|
22
|
-
\u03A9: 1,
|
|
23
|
-
k\u03A9: 1e3,
|
|
24
|
-
K\u03A9: 1e3,
|
|
25
|
-
kohm: 1e3,
|
|
26
|
-
M\u03A9: 1e6,
|
|
27
|
-
G\u03A9: 1e9,
|
|
28
|
-
T\u03A9: 1e12
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
V: {
|
|
32
|
-
baseUnit: "V",
|
|
33
|
-
variants: {
|
|
34
|
-
mV: 1e-3,
|
|
35
|
-
V: 1,
|
|
36
|
-
kV: 1e3,
|
|
37
|
-
KV: 1e3,
|
|
38
|
-
MV: 1e6,
|
|
39
|
-
GV: 1e9,
|
|
40
|
-
TV: 1e12
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
A: {
|
|
44
|
-
baseUnit: "A",
|
|
45
|
-
variants: {
|
|
46
|
-
\u00B5A: 1e-6,
|
|
47
|
-
mA: 1e-3,
|
|
48
|
-
ma: 1e-3,
|
|
49
|
-
A: 1,
|
|
50
|
-
kA: 1e3,
|
|
51
|
-
MA: 1e6
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
F: {
|
|
55
|
-
baseUnit: "F",
|
|
56
|
-
variants: {
|
|
57
|
-
pF: 1e-12,
|
|
58
|
-
nF: 1e-9,
|
|
59
|
-
\u00B5F: 1e-6,
|
|
60
|
-
uF: 1e-6,
|
|
61
|
-
mF: 1e-3,
|
|
62
|
-
F: 1
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
ml: {
|
|
66
|
-
baseUnit: "ml",
|
|
67
|
-
variants: {
|
|
68
|
-
ml: 1,
|
|
69
|
-
mL: 1,
|
|
70
|
-
l: 1e3,
|
|
71
|
-
L: 1e3
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
deg: {
|
|
75
|
-
baseUnit: "deg",
|
|
76
|
-
variants: {
|
|
77
|
-
rad: 180 / Math.PI
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
ms: {
|
|
81
|
-
baseUnit: "ms",
|
|
82
|
-
variants: {
|
|
83
|
-
fs: 1e-12,
|
|
84
|
-
ps: 1e-9,
|
|
85
|
-
ns: 1e-6,
|
|
86
|
-
us: 1e-3,
|
|
87
|
-
\u00B5s: 1e-3,
|
|
88
|
-
ms: 1,
|
|
89
|
-
s: 1e3
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
mm: {
|
|
93
|
-
baseUnit: "mm",
|
|
94
|
-
variants: {
|
|
95
|
-
nm: 1e-6,
|
|
96
|
-
\u00B5m: 1e-3,
|
|
97
|
-
um: 1e-3,
|
|
98
|
-
mm: 1,
|
|
99
|
-
cm: 10,
|
|
100
|
-
dm: 100,
|
|
101
|
-
m: 1e3,
|
|
102
|
-
km: 1e6,
|
|
103
|
-
in: 25.4,
|
|
104
|
-
ft: 304.8,
|
|
105
|
-
IN: 25.4,
|
|
106
|
-
FT: 304.8,
|
|
107
|
-
yd: 914.4,
|
|
108
|
-
mi: 1609344,
|
|
109
|
-
mil: 0.0254
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
var unitMappingAndVariantSuffixes = /* @__PURE__ */ new Set();
|
|
114
|
-
for (const [baseUnit, info] of Object.entries(unitMappings)) {
|
|
115
|
-
unitMappingAndVariantSuffixes.add(baseUnit);
|
|
116
|
-
for (const variant of Object.keys(info.variants)) {
|
|
117
|
-
unitMappingAndVariantSuffixes.add(variant);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
function getBaseTscircuitUnit(unit) {
|
|
121
|
-
for (const [baseUnit, info] of Object.entries(unitMappings)) {
|
|
122
|
-
if (unit in info.variants) {
|
|
123
|
-
return {
|
|
124
|
-
baseUnit: info.baseUnit,
|
|
125
|
-
conversionFactor: info.variants[unit]
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
return {
|
|
130
|
-
baseUnit: unit,
|
|
131
|
-
conversionFactor: 1
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
var si_prefix_multiplier = {
|
|
135
|
-
tera: 1e12,
|
|
136
|
-
T: 1e12,
|
|
137
|
-
giga: 1e9,
|
|
138
|
-
G: 1e9,
|
|
139
|
-
mega: 1e6,
|
|
140
|
-
M: 1e6,
|
|
141
|
-
kilo: 1e3,
|
|
142
|
-
k: 1e3,
|
|
143
|
-
deci: 0.1,
|
|
144
|
-
d: 0.1,
|
|
145
|
-
centi: 0.01,
|
|
146
|
-
c: 0.01,
|
|
147
|
-
milli: 1e-3,
|
|
148
|
-
m: 1e-3,
|
|
149
|
-
micro: 1e-6,
|
|
150
|
-
u: 1e-6,
|
|
151
|
-
\u00B5: 1e-6,
|
|
152
|
-
nano: 1e-9,
|
|
153
|
-
n: 1e-9,
|
|
154
|
-
pico: 1e-12,
|
|
155
|
-
p: 1e-12
|
|
156
|
-
};
|
|
157
|
-
function parseAndConvertSiUnit(v) {
|
|
158
|
-
if (v === void 0 || v === null)
|
|
159
|
-
return { parsedUnit: null, unitOfValue: null, value: null };
|
|
160
|
-
if (typeof v === "string" && v.match(/^-?[\d\.]+$/))
|
|
161
|
-
return {
|
|
162
|
-
value: Number.parseFloat(v),
|
|
163
|
-
parsedUnit: null,
|
|
164
|
-
unitOfValue: null
|
|
165
|
-
};
|
|
166
|
-
if (typeof v === "number")
|
|
167
|
-
return { value: v, parsedUnit: null, unitOfValue: null };
|
|
168
|
-
if (typeof v === "object" && "x" in v && "y" in v) {
|
|
169
|
-
const { parsedUnit, unitOfValue } = parseAndConvertSiUnit(v.x);
|
|
170
|
-
const xResult = parseAndConvertSiUnit(v.x);
|
|
171
|
-
const yResult = parseAndConvertSiUnit(v.y);
|
|
172
|
-
if (xResult.value === null || yResult.value === null) {
|
|
173
|
-
return { parsedUnit: null, unitOfValue: null, value: null };
|
|
174
|
-
}
|
|
175
|
-
return {
|
|
176
|
-
parsedUnit,
|
|
177
|
-
unitOfValue,
|
|
178
|
-
value: {
|
|
179
|
-
x: xResult.value,
|
|
180
|
-
y: yResult.value
|
|
181
|
-
}
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
const reversed_input_string = v.toString().split("").reverse().join("");
|
|
185
|
-
const unit_reversed = reversed_input_string.match(/[^\d\s]+/)?.[0];
|
|
186
|
-
if (!unit_reversed) {
|
|
187
|
-
throw new Error(`Could not determine unit: "${v}"`);
|
|
188
|
-
}
|
|
189
|
-
const unit = unit_reversed.split("").reverse().join("");
|
|
190
|
-
const numberPart = v.slice(0, -unit.length);
|
|
191
|
-
if (unit in si_prefix_multiplier && !unitMappingAndVariantSuffixes.has(unit)) {
|
|
192
|
-
const siMultiplier = si_prefix_multiplier[unit];
|
|
193
|
-
return {
|
|
194
|
-
parsedUnit: null,
|
|
195
|
-
unitOfValue: null,
|
|
196
|
-
value: Number.parseFloat(numberPart) * siMultiplier
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
const { baseUnit, conversionFactor } = getBaseTscircuitUnit(unit);
|
|
200
|
-
return {
|
|
201
|
-
parsedUnit: unit,
|
|
202
|
-
unitOfValue: baseUnit,
|
|
203
|
-
value: conversionFactor * Number.parseFloat(numberPart)
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
|
|
207
1
|
// src/units/index.ts
|
|
2
|
+
import { parseAndConvertSiUnit } from "format-si-unit";
|
|
208
3
|
import { z } from "zod";
|
|
209
|
-
|
|
210
|
-
|
|
4
|
+
import {
|
|
5
|
+
parseAndConvertSiUnit as parseAndConvertSiUnit2
|
|
6
|
+
} from "format-si-unit";
|
|
7
|
+
var resistance = z.string().or(z.number()).transform((v) => parseAndConvertSiUnit(v, "\u03A9").value);
|
|
8
|
+
var capacitance = z.string().or(z.number()).transform((v) => parseAndConvertSiUnit(v, "F").value).transform((value) => {
|
|
211
9
|
return Number.parseFloat(value.toPrecision(12));
|
|
212
10
|
});
|
|
213
|
-
var inductance = z.string().or(z.number()).transform((v) => parseAndConvertSiUnit(v).value);
|
|
214
|
-
var voltage = z.string().or(z.number()).transform((v) => parseAndConvertSiUnit(v).value);
|
|
11
|
+
var inductance = z.string().or(z.number()).transform((v) => parseAndConvertSiUnit(v, "H").value);
|
|
12
|
+
var voltage = z.string().or(z.number()).transform((v) => parseAndConvertSiUnit(v, "V").value);
|
|
215
13
|
var length = z.string().or(z.number()).transform((v) => parseAndConvertSiUnit(v).value);
|
|
216
|
-
var frequency = z.string().or(z.number()).transform((v) => parseAndConvertSiUnit(v).value);
|
|
14
|
+
var frequency = z.string().or(z.number()).transform((v) => parseAndConvertSiUnit(v, "Hz").value);
|
|
217
15
|
var distance = length;
|
|
218
|
-
var current = z.string().or(z.number()).transform((v) => parseAndConvertSiUnit(v).value);
|
|
16
|
+
var current = z.string().or(z.number()).transform((v) => parseAndConvertSiUnit(v, "A").value);
|
|
219
17
|
var duration_ms = z.string().or(z.number()).transform((v) => parseAndConvertSiUnit(v).value);
|
|
220
18
|
var time = duration_ms;
|
|
221
19
|
var ms = duration_ms;
|
|
@@ -959,7 +757,12 @@ var source_simple_voltage_source = source_component_base.extend({
|
|
|
959
757
|
peak_to_peak_voltage: voltage.optional(),
|
|
960
758
|
wave_shape: z51.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
961
759
|
phase: rotation.optional(),
|
|
962
|
-
duty_cycle: z51.number().optional().describe("Duty cycle as a fraction (0 to 1)")
|
|
760
|
+
duty_cycle: z51.number().optional().describe("Duty cycle as a fraction (0 to 1)"),
|
|
761
|
+
pulse_delay: ms.optional(),
|
|
762
|
+
rise_time: ms.optional(),
|
|
763
|
+
fall_time: ms.optional(),
|
|
764
|
+
pulse_width: ms.optional(),
|
|
765
|
+
period: ms.optional()
|
|
963
766
|
});
|
|
964
767
|
expectTypesMatch(
|
|
965
768
|
true
|
|
@@ -2716,243 +2519,266 @@ var pcb_silkscreen_oval = z120.object({
|
|
|
2716
2519
|
}).describe("Defines a silkscreen oval on the PCB");
|
|
2717
2520
|
expectTypesMatch(true);
|
|
2718
2521
|
|
|
2719
|
-
// src/pcb/
|
|
2522
|
+
// src/pcb/pcb_silkscreen_graphic.ts
|
|
2720
2523
|
import { z as z121 } from "zod";
|
|
2721
|
-
var
|
|
2722
|
-
type: z121.literal("
|
|
2723
|
-
|
|
2524
|
+
var pcb_silkscreen_graphic_base = z121.object({
|
|
2525
|
+
type: z121.literal("pcb_silkscreen_graphic"),
|
|
2526
|
+
pcb_silkscreen_graphic_id: getZodPrefixedIdWithDefault(
|
|
2527
|
+
"pcb_silkscreen_graphic"
|
|
2528
|
+
),
|
|
2724
2529
|
pcb_component_id: z121.string(),
|
|
2725
2530
|
pcb_group_id: z121.string().optional(),
|
|
2726
2531
|
subcircuit_id: z121.string().optional(),
|
|
2532
|
+
layer: visible_layer,
|
|
2533
|
+
image_asset: asset.optional()
|
|
2534
|
+
});
|
|
2535
|
+
var pcb_silkscreen_graphic_brep = pcb_silkscreen_graphic_base.extend({
|
|
2536
|
+
shape: z121.literal("brep"),
|
|
2537
|
+
brep_shape
|
|
2538
|
+
}).describe("Defines a BRep silkscreen graphic on the PCB");
|
|
2539
|
+
expectTypesMatch(
|
|
2540
|
+
true
|
|
2541
|
+
);
|
|
2542
|
+
var pcb_silkscreen_graphic = z121.discriminatedUnion("shape", [pcb_silkscreen_graphic_brep]).describe("Defines a silkscreen graphic on the PCB");
|
|
2543
|
+
expectTypesMatch(true);
|
|
2544
|
+
|
|
2545
|
+
// src/pcb/pcb_silkscreen_pill.ts
|
|
2546
|
+
import { z as z122 } from "zod";
|
|
2547
|
+
var pcb_silkscreen_pill = z122.object({
|
|
2548
|
+
type: z122.literal("pcb_silkscreen_pill"),
|
|
2549
|
+
pcb_silkscreen_pill_id: getZodPrefixedIdWithDefault("pcb_silkscreen_pill"),
|
|
2550
|
+
pcb_component_id: z122.string(),
|
|
2551
|
+
pcb_group_id: z122.string().optional(),
|
|
2552
|
+
subcircuit_id: z122.string().optional(),
|
|
2727
2553
|
center: point,
|
|
2728
2554
|
width: length,
|
|
2729
2555
|
height: length,
|
|
2730
2556
|
layer: layer_ref,
|
|
2731
|
-
ccw_rotation:
|
|
2557
|
+
ccw_rotation: z122.number().optional()
|
|
2732
2558
|
}).describe("Defines a silkscreen pill on the PCB");
|
|
2733
2559
|
expectTypesMatch(true);
|
|
2734
2560
|
|
|
2735
2561
|
// src/pcb/pcb_fabrication_note_text.ts
|
|
2736
|
-
import { z as
|
|
2737
|
-
var pcb_fabrication_note_text =
|
|
2738
|
-
type:
|
|
2562
|
+
import { z as z123 } from "zod";
|
|
2563
|
+
var pcb_fabrication_note_text = z123.object({
|
|
2564
|
+
type: z123.literal("pcb_fabrication_note_text"),
|
|
2739
2565
|
pcb_fabrication_note_text_id: getZodPrefixedIdWithDefault(
|
|
2740
2566
|
"pcb_fabrication_note_text"
|
|
2741
2567
|
),
|
|
2742
|
-
subcircuit_id:
|
|
2743
|
-
pcb_group_id:
|
|
2744
|
-
font:
|
|
2568
|
+
subcircuit_id: z123.string().optional(),
|
|
2569
|
+
pcb_group_id: z123.string().optional(),
|
|
2570
|
+
font: z123.literal("tscircuit2024").default("tscircuit2024"),
|
|
2745
2571
|
font_size: distance.default("1mm"),
|
|
2746
|
-
pcb_component_id:
|
|
2747
|
-
text:
|
|
2748
|
-
ccw_rotation:
|
|
2572
|
+
pcb_component_id: z123.string(),
|
|
2573
|
+
text: z123.string(),
|
|
2574
|
+
ccw_rotation: z123.number().optional(),
|
|
2749
2575
|
layer: visible_layer,
|
|
2750
2576
|
anchor_position: point.default({ x: 0, y: 0 }),
|
|
2751
|
-
anchor_alignment:
|
|
2752
|
-
color:
|
|
2577
|
+
anchor_alignment: z123.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
2578
|
+
color: z123.string().optional()
|
|
2753
2579
|
}).describe(
|
|
2754
2580
|
"Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators"
|
|
2755
2581
|
);
|
|
2756
2582
|
expectTypesMatch(true);
|
|
2757
2583
|
|
|
2758
2584
|
// src/pcb/pcb_fabrication_note_path.ts
|
|
2759
|
-
import { z as
|
|
2760
|
-
var pcb_fabrication_note_path =
|
|
2761
|
-
type:
|
|
2585
|
+
import { z as z124 } from "zod";
|
|
2586
|
+
var pcb_fabrication_note_path = z124.object({
|
|
2587
|
+
type: z124.literal("pcb_fabrication_note_path"),
|
|
2762
2588
|
pcb_fabrication_note_path_id: getZodPrefixedIdWithDefault(
|
|
2763
2589
|
"pcb_fabrication_note_path"
|
|
2764
2590
|
),
|
|
2765
|
-
pcb_component_id:
|
|
2766
|
-
subcircuit_id:
|
|
2591
|
+
pcb_component_id: z124.string(),
|
|
2592
|
+
subcircuit_id: z124.string().optional(),
|
|
2767
2593
|
layer: layer_ref,
|
|
2768
|
-
route:
|
|
2594
|
+
route: z124.array(point),
|
|
2769
2595
|
stroke_width: length,
|
|
2770
|
-
color:
|
|
2596
|
+
color: z124.string().optional()
|
|
2771
2597
|
}).describe(
|
|
2772
2598
|
"Defines a fabrication path on the PCB for fabricators or assemblers"
|
|
2773
2599
|
);
|
|
2774
2600
|
expectTypesMatch(true);
|
|
2775
2601
|
|
|
2776
2602
|
// src/pcb/pcb_fabrication_note_rect.ts
|
|
2777
|
-
import { z as
|
|
2778
|
-
var pcb_fabrication_note_rect =
|
|
2779
|
-
type:
|
|
2603
|
+
import { z as z125 } from "zod";
|
|
2604
|
+
var pcb_fabrication_note_rect = z125.object({
|
|
2605
|
+
type: z125.literal("pcb_fabrication_note_rect"),
|
|
2780
2606
|
pcb_fabrication_note_rect_id: getZodPrefixedIdWithDefault(
|
|
2781
2607
|
"pcb_fabrication_note_rect"
|
|
2782
2608
|
),
|
|
2783
|
-
pcb_component_id:
|
|
2784
|
-
pcb_group_id:
|
|
2785
|
-
subcircuit_id:
|
|
2609
|
+
pcb_component_id: z125.string(),
|
|
2610
|
+
pcb_group_id: z125.string().optional(),
|
|
2611
|
+
subcircuit_id: z125.string().optional(),
|
|
2786
2612
|
center: point,
|
|
2787
2613
|
width: length,
|
|
2788
2614
|
height: length,
|
|
2789
2615
|
layer: visible_layer,
|
|
2790
2616
|
stroke_width: length.default("0.1mm"),
|
|
2791
2617
|
corner_radius: length.optional(),
|
|
2792
|
-
is_filled:
|
|
2793
|
-
has_stroke:
|
|
2794
|
-
is_stroke_dashed:
|
|
2795
|
-
color:
|
|
2618
|
+
is_filled: z125.boolean().optional(),
|
|
2619
|
+
has_stroke: z125.boolean().optional(),
|
|
2620
|
+
is_stroke_dashed: z125.boolean().optional(),
|
|
2621
|
+
color: z125.string().optional()
|
|
2796
2622
|
}).describe("Defines a fabrication note rectangle on the PCB");
|
|
2797
2623
|
expectTypesMatch(true);
|
|
2798
2624
|
|
|
2799
2625
|
// src/pcb/pcb_fabrication_note_dimension.ts
|
|
2800
|
-
import { z as
|
|
2801
|
-
var pcb_fabrication_note_dimension =
|
|
2802
|
-
type:
|
|
2626
|
+
import { z as z126 } from "zod";
|
|
2627
|
+
var pcb_fabrication_note_dimension = z126.object({
|
|
2628
|
+
type: z126.literal("pcb_fabrication_note_dimension"),
|
|
2803
2629
|
pcb_fabrication_note_dimension_id: getZodPrefixedIdWithDefault(
|
|
2804
2630
|
"pcb_fabrication_note_dimension"
|
|
2805
2631
|
),
|
|
2806
|
-
pcb_component_id:
|
|
2807
|
-
pcb_group_id:
|
|
2808
|
-
subcircuit_id:
|
|
2632
|
+
pcb_component_id: z126.string(),
|
|
2633
|
+
pcb_group_id: z126.string().optional(),
|
|
2634
|
+
subcircuit_id: z126.string().optional(),
|
|
2809
2635
|
layer: visible_layer,
|
|
2810
2636
|
from: point,
|
|
2811
2637
|
to: point,
|
|
2812
|
-
text:
|
|
2813
|
-
text_ccw_rotation:
|
|
2638
|
+
text: z126.string().optional(),
|
|
2639
|
+
text_ccw_rotation: z126.number().optional(),
|
|
2814
2640
|
offset: length.optional(),
|
|
2815
2641
|
offset_distance: length.optional(),
|
|
2816
|
-
offset_direction:
|
|
2817
|
-
x:
|
|
2818
|
-
y:
|
|
2642
|
+
offset_direction: z126.object({
|
|
2643
|
+
x: z126.number(),
|
|
2644
|
+
y: z126.number()
|
|
2819
2645
|
}).optional(),
|
|
2820
|
-
font:
|
|
2646
|
+
font: z126.literal("tscircuit2024").default("tscircuit2024"),
|
|
2821
2647
|
font_size: length.default("1mm"),
|
|
2822
|
-
color:
|
|
2648
|
+
color: z126.string().optional(),
|
|
2823
2649
|
arrow_size: length.default("1mm")
|
|
2824
2650
|
}).describe("Defines a measurement annotation within PCB fabrication notes");
|
|
2825
2651
|
expectTypesMatch(true);
|
|
2826
2652
|
|
|
2827
2653
|
// src/pcb/pcb_note_text.ts
|
|
2828
|
-
import { z as z126 } from "zod";
|
|
2829
|
-
var pcb_note_text = z126.object({
|
|
2830
|
-
type: z126.literal("pcb_note_text"),
|
|
2831
|
-
pcb_note_text_id: getZodPrefixedIdWithDefault("pcb_note_text"),
|
|
2832
|
-
pcb_component_id: z126.string().optional(),
|
|
2833
|
-
pcb_group_id: z126.string().optional(),
|
|
2834
|
-
subcircuit_id: z126.string().optional(),
|
|
2835
|
-
name: z126.string().optional(),
|
|
2836
|
-
font: z126.literal("tscircuit2024").default("tscircuit2024"),
|
|
2837
|
-
font_size: distance.default("1mm"),
|
|
2838
|
-
text: z126.string().optional(),
|
|
2839
|
-
anchor_position: point.default({ x: 0, y: 0 }),
|
|
2840
|
-
anchor_alignment: z126.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
2841
|
-
layer: visible_layer.default("top"),
|
|
2842
|
-
is_mirrored_from_top_view: z126.boolean().optional(),
|
|
2843
|
-
color: z126.string().optional()
|
|
2844
|
-
}).describe("Defines a documentation note in text on the PCB");
|
|
2845
|
-
expectTypesMatch(true);
|
|
2846
|
-
|
|
2847
|
-
// src/pcb/pcb_note_rect.ts
|
|
2848
2654
|
import { z as z127 } from "zod";
|
|
2849
|
-
var
|
|
2850
|
-
type: z127.literal("
|
|
2851
|
-
|
|
2655
|
+
var pcb_note_text = z127.object({
|
|
2656
|
+
type: z127.literal("pcb_note_text"),
|
|
2657
|
+
pcb_note_text_id: getZodPrefixedIdWithDefault("pcb_note_text"),
|
|
2852
2658
|
pcb_component_id: z127.string().optional(),
|
|
2853
2659
|
pcb_group_id: z127.string().optional(),
|
|
2854
2660
|
subcircuit_id: z127.string().optional(),
|
|
2855
2661
|
name: z127.string().optional(),
|
|
2662
|
+
font: z127.literal("tscircuit2024").default("tscircuit2024"),
|
|
2663
|
+
font_size: distance.default("1mm"),
|
|
2856
2664
|
text: z127.string().optional(),
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
height: length,
|
|
2665
|
+
anchor_position: point.default({ x: 0, y: 0 }),
|
|
2666
|
+
anchor_alignment: z127.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
2860
2667
|
layer: visible_layer.default("top"),
|
|
2861
|
-
|
|
2862
|
-
corner_radius: length.optional(),
|
|
2863
|
-
is_filled: z127.boolean().optional(),
|
|
2864
|
-
has_stroke: z127.boolean().optional(),
|
|
2865
|
-
is_stroke_dashed: z127.boolean().optional(),
|
|
2668
|
+
is_mirrored_from_top_view: z127.boolean().optional(),
|
|
2866
2669
|
color: z127.string().optional()
|
|
2867
|
-
}).describe("Defines a
|
|
2670
|
+
}).describe("Defines a documentation note in text on the PCB");
|
|
2868
2671
|
expectTypesMatch(true);
|
|
2869
2672
|
|
|
2870
|
-
// src/pcb/
|
|
2673
|
+
// src/pcb/pcb_note_rect.ts
|
|
2871
2674
|
import { z as z128 } from "zod";
|
|
2872
|
-
var
|
|
2873
|
-
type: z128.literal("
|
|
2874
|
-
|
|
2675
|
+
var pcb_note_rect = z128.object({
|
|
2676
|
+
type: z128.literal("pcb_note_rect"),
|
|
2677
|
+
pcb_note_rect_id: getZodPrefixedIdWithDefault("pcb_note_rect"),
|
|
2875
2678
|
pcb_component_id: z128.string().optional(),
|
|
2876
2679
|
pcb_group_id: z128.string().optional(),
|
|
2877
2680
|
subcircuit_id: z128.string().optional(),
|
|
2878
2681
|
name: z128.string().optional(),
|
|
2879
2682
|
text: z128.string().optional(),
|
|
2880
|
-
|
|
2683
|
+
center: point,
|
|
2684
|
+
width: length,
|
|
2685
|
+
height: length,
|
|
2881
2686
|
layer: visible_layer.default("top"),
|
|
2882
2687
|
stroke_width: length.default("0.1mm"),
|
|
2688
|
+
corner_radius: length.optional(),
|
|
2689
|
+
is_filled: z128.boolean().optional(),
|
|
2690
|
+
has_stroke: z128.boolean().optional(),
|
|
2691
|
+
is_stroke_dashed: z128.boolean().optional(),
|
|
2883
2692
|
color: z128.string().optional()
|
|
2884
|
-
}).describe("Defines a
|
|
2693
|
+
}).describe("Defines a rectangular documentation note on the PCB");
|
|
2885
2694
|
expectTypesMatch(true);
|
|
2886
2695
|
|
|
2887
|
-
// src/pcb/
|
|
2696
|
+
// src/pcb/pcb_note_path.ts
|
|
2888
2697
|
import { z as z129 } from "zod";
|
|
2889
|
-
var
|
|
2890
|
-
type: z129.literal("
|
|
2891
|
-
|
|
2698
|
+
var pcb_note_path = z129.object({
|
|
2699
|
+
type: z129.literal("pcb_note_path"),
|
|
2700
|
+
pcb_note_path_id: getZodPrefixedIdWithDefault("pcb_note_path"),
|
|
2892
2701
|
pcb_component_id: z129.string().optional(),
|
|
2893
2702
|
pcb_group_id: z129.string().optional(),
|
|
2894
2703
|
subcircuit_id: z129.string().optional(),
|
|
2895
2704
|
name: z129.string().optional(),
|
|
2896
2705
|
text: z129.string().optional(),
|
|
2706
|
+
route: z129.array(point),
|
|
2707
|
+
layer: visible_layer.default("top"),
|
|
2708
|
+
stroke_width: length.default("0.1mm"),
|
|
2709
|
+
color: z129.string().optional()
|
|
2710
|
+
}).describe("Defines a polyline documentation note on the PCB");
|
|
2711
|
+
expectTypesMatch(true);
|
|
2712
|
+
|
|
2713
|
+
// src/pcb/pcb_note_line.ts
|
|
2714
|
+
import { z as z130 } from "zod";
|
|
2715
|
+
var pcb_note_line = z130.object({
|
|
2716
|
+
type: z130.literal("pcb_note_line"),
|
|
2717
|
+
pcb_note_line_id: getZodPrefixedIdWithDefault("pcb_note_line"),
|
|
2718
|
+
pcb_component_id: z130.string().optional(),
|
|
2719
|
+
pcb_group_id: z130.string().optional(),
|
|
2720
|
+
subcircuit_id: z130.string().optional(),
|
|
2721
|
+
name: z130.string().optional(),
|
|
2722
|
+
text: z130.string().optional(),
|
|
2897
2723
|
x1: distance,
|
|
2898
2724
|
y1: distance,
|
|
2899
2725
|
x2: distance,
|
|
2900
2726
|
y2: distance,
|
|
2901
2727
|
layer: visible_layer.default("top"),
|
|
2902
2728
|
stroke_width: distance.default("0.1mm"),
|
|
2903
|
-
color:
|
|
2904
|
-
is_dashed:
|
|
2729
|
+
color: z130.string().optional(),
|
|
2730
|
+
is_dashed: z130.boolean().optional()
|
|
2905
2731
|
}).describe("Defines a straight documentation note line on the PCB");
|
|
2906
2732
|
expectTypesMatch(true);
|
|
2907
2733
|
|
|
2908
2734
|
// src/pcb/pcb_note_dimension.ts
|
|
2909
|
-
import { z as
|
|
2910
|
-
var pcb_note_dimension =
|
|
2911
|
-
type:
|
|
2735
|
+
import { z as z131 } from "zod";
|
|
2736
|
+
var pcb_note_dimension = z131.object({
|
|
2737
|
+
type: z131.literal("pcb_note_dimension"),
|
|
2912
2738
|
pcb_note_dimension_id: getZodPrefixedIdWithDefault("pcb_note_dimension"),
|
|
2913
|
-
pcb_component_id:
|
|
2914
|
-
pcb_group_id:
|
|
2915
|
-
subcircuit_id:
|
|
2916
|
-
name:
|
|
2739
|
+
pcb_component_id: z131.string().optional(),
|
|
2740
|
+
pcb_group_id: z131.string().optional(),
|
|
2741
|
+
subcircuit_id: z131.string().optional(),
|
|
2742
|
+
name: z131.string().optional(),
|
|
2917
2743
|
from: point,
|
|
2918
2744
|
to: point,
|
|
2919
|
-
text:
|
|
2920
|
-
text_ccw_rotation:
|
|
2745
|
+
text: z131.string().optional(),
|
|
2746
|
+
text_ccw_rotation: z131.number().optional(),
|
|
2921
2747
|
offset_distance: length.optional(),
|
|
2922
|
-
offset_direction:
|
|
2923
|
-
x:
|
|
2924
|
-
y:
|
|
2748
|
+
offset_direction: z131.object({
|
|
2749
|
+
x: z131.number(),
|
|
2750
|
+
y: z131.number()
|
|
2925
2751
|
}).optional(),
|
|
2926
|
-
font:
|
|
2752
|
+
font: z131.literal("tscircuit2024").default("tscircuit2024"),
|
|
2927
2753
|
font_size: length.default("1mm"),
|
|
2928
2754
|
layer: visible_layer.default("top"),
|
|
2929
|
-
color:
|
|
2755
|
+
color: z131.string().optional(),
|
|
2930
2756
|
arrow_size: length.default("1mm")
|
|
2931
2757
|
}).describe("Defines a measurement annotation within PCB documentation notes");
|
|
2932
2758
|
expectTypesMatch(true);
|
|
2933
2759
|
|
|
2934
2760
|
// src/pcb/pcb_footprint_overlap_error.ts
|
|
2935
|
-
import { z as
|
|
2761
|
+
import { z as z132 } from "zod";
|
|
2936
2762
|
var pcb_footprint_overlap_error = base_circuit_json_error.extend({
|
|
2937
|
-
type:
|
|
2763
|
+
type: z132.literal("pcb_footprint_overlap_error"),
|
|
2938
2764
|
pcb_error_id: getZodPrefixedIdWithDefault("pcb_error"),
|
|
2939
|
-
error_type:
|
|
2940
|
-
pcb_smtpad_ids:
|
|
2941
|
-
pcb_plated_hole_ids:
|
|
2942
|
-
pcb_hole_ids:
|
|
2943
|
-
pcb_keepout_ids:
|
|
2765
|
+
error_type: z132.literal("pcb_footprint_overlap_error").default("pcb_footprint_overlap_error"),
|
|
2766
|
+
pcb_smtpad_ids: z132.array(z132.string()).optional(),
|
|
2767
|
+
pcb_plated_hole_ids: z132.array(z132.string()).optional(),
|
|
2768
|
+
pcb_hole_ids: z132.array(z132.string()).optional(),
|
|
2769
|
+
pcb_keepout_ids: z132.array(z132.string()).optional()
|
|
2944
2770
|
}).describe("Error emitted when a pcb footprint overlaps with another element");
|
|
2945
2771
|
expectTypesMatch(
|
|
2946
2772
|
true
|
|
2947
2773
|
);
|
|
2948
2774
|
|
|
2949
2775
|
// src/pcb/pcb_courtyard_overlap_error.ts
|
|
2950
|
-
import { z as
|
|
2776
|
+
import { z as z133 } from "zod";
|
|
2951
2777
|
var pcb_courtyard_overlap_error = base_circuit_json_error.extend({
|
|
2952
|
-
type:
|
|
2778
|
+
type: z133.literal("pcb_courtyard_overlap_error"),
|
|
2953
2779
|
pcb_error_id: getZodPrefixedIdWithDefault("pcb_error"),
|
|
2954
|
-
error_type:
|
|
2955
|
-
pcb_component_ids:
|
|
2780
|
+
error_type: z133.literal("pcb_courtyard_overlap_error").default("pcb_courtyard_overlap_error"),
|
|
2781
|
+
pcb_component_ids: z133.tuple([z133.string(), z133.string()])
|
|
2956
2782
|
}).describe(
|
|
2957
2783
|
"Error emitted when the courtyard (CrtYd) of one PCB component overlaps with the courtyard of another"
|
|
2958
2784
|
);
|
|
@@ -2961,49 +2787,49 @@ expectTypesMatch(
|
|
|
2961
2787
|
);
|
|
2962
2788
|
|
|
2963
2789
|
// src/pcb/pcb_keepout.ts
|
|
2964
|
-
import { z as
|
|
2965
|
-
var pcb_keepout =
|
|
2966
|
-
type:
|
|
2967
|
-
shape:
|
|
2968
|
-
pcb_group_id:
|
|
2969
|
-
subcircuit_id:
|
|
2790
|
+
import { z as z134 } from "zod";
|
|
2791
|
+
var pcb_keepout = z134.object({
|
|
2792
|
+
type: z134.literal("pcb_keepout"),
|
|
2793
|
+
shape: z134.literal("rect"),
|
|
2794
|
+
pcb_group_id: z134.string().optional(),
|
|
2795
|
+
subcircuit_id: z134.string().optional(),
|
|
2970
2796
|
center: point,
|
|
2971
2797
|
width: distance,
|
|
2972
2798
|
height: distance,
|
|
2973
|
-
pcb_keepout_id:
|
|
2974
|
-
layers:
|
|
2799
|
+
pcb_keepout_id: z134.string(),
|
|
2800
|
+
layers: z134.array(z134.string()),
|
|
2975
2801
|
// Specify layers where the keepout applies
|
|
2976
|
-
description:
|
|
2802
|
+
description: z134.string().optional()
|
|
2977
2803
|
// Optional description of the keepout
|
|
2978
2804
|
}).or(
|
|
2979
|
-
|
|
2980
|
-
type:
|
|
2981
|
-
shape:
|
|
2982
|
-
pcb_group_id:
|
|
2983
|
-
subcircuit_id:
|
|
2805
|
+
z134.object({
|
|
2806
|
+
type: z134.literal("pcb_keepout"),
|
|
2807
|
+
shape: z134.literal("circle"),
|
|
2808
|
+
pcb_group_id: z134.string().optional(),
|
|
2809
|
+
subcircuit_id: z134.string().optional(),
|
|
2984
2810
|
center: point,
|
|
2985
2811
|
radius: distance,
|
|
2986
|
-
pcb_keepout_id:
|
|
2987
|
-
layers:
|
|
2812
|
+
pcb_keepout_id: z134.string(),
|
|
2813
|
+
layers: z134.array(z134.string()),
|
|
2988
2814
|
// Specify layers where the keepout applies
|
|
2989
|
-
description:
|
|
2815
|
+
description: z134.string().optional()
|
|
2990
2816
|
// Optional description of the keepout
|
|
2991
2817
|
})
|
|
2992
2818
|
);
|
|
2993
2819
|
expectTypesMatch(true);
|
|
2994
2820
|
|
|
2995
2821
|
// src/pcb/pcb_cutout.ts
|
|
2996
|
-
import { z as
|
|
2997
|
-
var pcb_cutout_base =
|
|
2998
|
-
type:
|
|
2822
|
+
import { z as z135 } from "zod";
|
|
2823
|
+
var pcb_cutout_base = z135.object({
|
|
2824
|
+
type: z135.literal("pcb_cutout"),
|
|
2999
2825
|
pcb_cutout_id: getZodPrefixedIdWithDefault("pcb_cutout"),
|
|
3000
|
-
pcb_group_id:
|
|
3001
|
-
subcircuit_id:
|
|
3002
|
-
pcb_board_id:
|
|
3003
|
-
pcb_panel_id:
|
|
2826
|
+
pcb_group_id: z135.string().optional(),
|
|
2827
|
+
subcircuit_id: z135.string().optional(),
|
|
2828
|
+
pcb_board_id: z135.string().optional(),
|
|
2829
|
+
pcb_panel_id: z135.string().optional()
|
|
3004
2830
|
});
|
|
3005
2831
|
var pcb_cutout_rect = pcb_cutout_base.extend({
|
|
3006
|
-
shape:
|
|
2832
|
+
shape: z135.literal("rect"),
|
|
3007
2833
|
center: point,
|
|
3008
2834
|
width: length,
|
|
3009
2835
|
height: length,
|
|
@@ -3012,26 +2838,26 @@ var pcb_cutout_rect = pcb_cutout_base.extend({
|
|
|
3012
2838
|
});
|
|
3013
2839
|
expectTypesMatch(true);
|
|
3014
2840
|
var pcb_cutout_circle = pcb_cutout_base.extend({
|
|
3015
|
-
shape:
|
|
2841
|
+
shape: z135.literal("circle"),
|
|
3016
2842
|
center: point,
|
|
3017
2843
|
radius: length
|
|
3018
2844
|
});
|
|
3019
2845
|
expectTypesMatch(true);
|
|
3020
2846
|
var pcb_cutout_polygon = pcb_cutout_base.extend({
|
|
3021
|
-
shape:
|
|
3022
|
-
points:
|
|
2847
|
+
shape: z135.literal("polygon"),
|
|
2848
|
+
points: z135.array(point)
|
|
3023
2849
|
});
|
|
3024
2850
|
expectTypesMatch(true);
|
|
3025
2851
|
var pcb_cutout_path = pcb_cutout_base.extend({
|
|
3026
|
-
shape:
|
|
3027
|
-
route:
|
|
2852
|
+
shape: z135.literal("path"),
|
|
2853
|
+
route: z135.array(point),
|
|
3028
2854
|
slot_width: length,
|
|
3029
2855
|
slot_length: length.optional(),
|
|
3030
2856
|
space_between_slots: length.optional(),
|
|
3031
2857
|
slot_corner_radius: length.optional()
|
|
3032
2858
|
});
|
|
3033
2859
|
expectTypesMatch(true);
|
|
3034
|
-
var pcb_cutout =
|
|
2860
|
+
var pcb_cutout = z135.discriminatedUnion("shape", [
|
|
3035
2861
|
pcb_cutout_rect,
|
|
3036
2862
|
pcb_cutout_circle,
|
|
3037
2863
|
pcb_cutout_polygon,
|
|
@@ -3040,169 +2866,169 @@ var pcb_cutout = z134.discriminatedUnion("shape", [
|
|
|
3040
2866
|
expectTypesMatch(true);
|
|
3041
2867
|
|
|
3042
2868
|
// src/pcb/pcb_missing_footprint_error.ts
|
|
3043
|
-
import { z as
|
|
2869
|
+
import { z as z136 } from "zod";
|
|
3044
2870
|
var pcb_missing_footprint_error = base_circuit_json_error.extend({
|
|
3045
|
-
type:
|
|
2871
|
+
type: z136.literal("pcb_missing_footprint_error"),
|
|
3046
2872
|
pcb_missing_footprint_error_id: getZodPrefixedIdWithDefault(
|
|
3047
2873
|
"pcb_missing_footprint_error"
|
|
3048
2874
|
),
|
|
3049
|
-
pcb_group_id:
|
|
3050
|
-
subcircuit_id:
|
|
3051
|
-
error_type:
|
|
3052
|
-
source_component_id:
|
|
2875
|
+
pcb_group_id: z136.string().optional(),
|
|
2876
|
+
subcircuit_id: z136.string().optional(),
|
|
2877
|
+
error_type: z136.literal("pcb_missing_footprint_error").default("pcb_missing_footprint_error"),
|
|
2878
|
+
source_component_id: z136.string()
|
|
3053
2879
|
}).describe("Defines a missing footprint error on the PCB");
|
|
3054
2880
|
expectTypesMatch(
|
|
3055
2881
|
true
|
|
3056
2882
|
);
|
|
3057
2883
|
|
|
3058
2884
|
// src/pcb/external_footprint_load_error.ts
|
|
3059
|
-
import { z as
|
|
2885
|
+
import { z as z137 } from "zod";
|
|
3060
2886
|
var external_footprint_load_error = base_circuit_json_error.extend({
|
|
3061
|
-
type:
|
|
2887
|
+
type: z137.literal("external_footprint_load_error"),
|
|
3062
2888
|
external_footprint_load_error_id: getZodPrefixedIdWithDefault(
|
|
3063
2889
|
"external_footprint_load_error"
|
|
3064
2890
|
),
|
|
3065
|
-
pcb_component_id:
|
|
3066
|
-
source_component_id:
|
|
3067
|
-
pcb_group_id:
|
|
3068
|
-
subcircuit_id:
|
|
3069
|
-
footprinter_string:
|
|
3070
|
-
error_type:
|
|
2891
|
+
pcb_component_id: z137.string(),
|
|
2892
|
+
source_component_id: z137.string(),
|
|
2893
|
+
pcb_group_id: z137.string().optional(),
|
|
2894
|
+
subcircuit_id: z137.string().optional(),
|
|
2895
|
+
footprinter_string: z137.string().optional(),
|
|
2896
|
+
error_type: z137.literal("external_footprint_load_error").default("external_footprint_load_error")
|
|
3071
2897
|
}).describe("Defines an error when an external footprint fails to load");
|
|
3072
2898
|
expectTypesMatch(true);
|
|
3073
2899
|
|
|
3074
2900
|
// src/pcb/circuit_json_footprint_load_error.ts
|
|
3075
|
-
import { z as
|
|
2901
|
+
import { z as z138 } from "zod";
|
|
3076
2902
|
var circuit_json_footprint_load_error = base_circuit_json_error.extend({
|
|
3077
|
-
type:
|
|
2903
|
+
type: z138.literal("circuit_json_footprint_load_error"),
|
|
3078
2904
|
circuit_json_footprint_load_error_id: getZodPrefixedIdWithDefault(
|
|
3079
2905
|
"circuit_json_footprint_load_error"
|
|
3080
2906
|
),
|
|
3081
|
-
pcb_component_id:
|
|
3082
|
-
source_component_id:
|
|
3083
|
-
pcb_group_id:
|
|
3084
|
-
subcircuit_id:
|
|
3085
|
-
error_type:
|
|
3086
|
-
circuit_json:
|
|
2907
|
+
pcb_component_id: z138.string(),
|
|
2908
|
+
source_component_id: z138.string(),
|
|
2909
|
+
pcb_group_id: z138.string().optional(),
|
|
2910
|
+
subcircuit_id: z138.string().optional(),
|
|
2911
|
+
error_type: z138.literal("circuit_json_footprint_load_error").default("circuit_json_footprint_load_error"),
|
|
2912
|
+
circuit_json: z138.array(z138.any()).optional()
|
|
3087
2913
|
}).describe("Defines an error when a circuit JSON footprint fails to load");
|
|
3088
2914
|
expectTypesMatch(true);
|
|
3089
2915
|
|
|
3090
2916
|
// src/pcb/pcb_group.ts
|
|
3091
|
-
import { z as
|
|
3092
|
-
var pcb_group =
|
|
3093
|
-
type:
|
|
2917
|
+
import { z as z139 } from "zod";
|
|
2918
|
+
var pcb_group = z139.object({
|
|
2919
|
+
type: z139.literal("pcb_group"),
|
|
3094
2920
|
pcb_group_id: getZodPrefixedIdWithDefault("pcb_group"),
|
|
3095
|
-
source_group_id:
|
|
3096
|
-
is_subcircuit:
|
|
3097
|
-
subcircuit_id:
|
|
2921
|
+
source_group_id: z139.string(),
|
|
2922
|
+
is_subcircuit: z139.boolean().optional(),
|
|
2923
|
+
subcircuit_id: z139.string().optional(),
|
|
3098
2924
|
width: length.optional(),
|
|
3099
2925
|
height: length.optional(),
|
|
3100
2926
|
center: point,
|
|
3101
|
-
display_offset_x:
|
|
2927
|
+
display_offset_x: z139.string().optional().describe(
|
|
3102
2928
|
"How to display the x offset for this group, usually corresponding with how the user specified it"
|
|
3103
2929
|
),
|
|
3104
|
-
display_offset_y:
|
|
2930
|
+
display_offset_y: z139.string().optional().describe(
|
|
3105
2931
|
"How to display the y offset for this group, usually corresponding with how the user specified it"
|
|
3106
2932
|
),
|
|
3107
|
-
outline:
|
|
2933
|
+
outline: z139.array(point).optional(),
|
|
3108
2934
|
anchor_position: point.optional(),
|
|
3109
2935
|
anchor_alignment: ninePointAnchor.default("center"),
|
|
3110
|
-
position_mode:
|
|
3111
|
-
positioned_relative_to_pcb_group_id:
|
|
3112
|
-
positioned_relative_to_pcb_board_id:
|
|
3113
|
-
pcb_component_ids:
|
|
3114
|
-
child_layout_mode:
|
|
3115
|
-
name:
|
|
3116
|
-
description:
|
|
3117
|
-
layout_mode:
|
|
3118
|
-
autorouter_configuration:
|
|
2936
|
+
position_mode: z139.enum(["packed", "relative_to_group_anchor", "none"]).optional(),
|
|
2937
|
+
positioned_relative_to_pcb_group_id: z139.string().optional(),
|
|
2938
|
+
positioned_relative_to_pcb_board_id: z139.string().optional(),
|
|
2939
|
+
pcb_component_ids: z139.array(z139.string()),
|
|
2940
|
+
child_layout_mode: z139.enum(["packed", "none"]).optional(),
|
|
2941
|
+
name: z139.string().optional(),
|
|
2942
|
+
description: z139.string().optional(),
|
|
2943
|
+
layout_mode: z139.string().optional(),
|
|
2944
|
+
autorouter_configuration: z139.object({
|
|
3119
2945
|
trace_clearance: length
|
|
3120
2946
|
}).optional(),
|
|
3121
|
-
autorouter_used_string:
|
|
2947
|
+
autorouter_used_string: z139.string().optional()
|
|
3122
2948
|
}).describe("Defines a group of components on the PCB");
|
|
3123
2949
|
expectTypesMatch(true);
|
|
3124
2950
|
|
|
3125
2951
|
// src/pcb/pcb_autorouting_error.ts
|
|
3126
|
-
import { z as
|
|
2952
|
+
import { z as z140 } from "zod";
|
|
3127
2953
|
var pcb_autorouting_error = base_circuit_json_error.extend({
|
|
3128
|
-
type:
|
|
2954
|
+
type: z140.literal("pcb_autorouting_error"),
|
|
3129
2955
|
pcb_error_id: getZodPrefixedIdWithDefault("pcb_autorouting_error"),
|
|
3130
|
-
error_type:
|
|
3131
|
-
subcircuit_id:
|
|
2956
|
+
error_type: z140.literal("pcb_autorouting_error").default("pcb_autorouting_error"),
|
|
2957
|
+
subcircuit_id: z140.string().optional()
|
|
3132
2958
|
}).describe("The autorouting has failed to route a portion of the board");
|
|
3133
2959
|
expectTypesMatch(true);
|
|
3134
2960
|
|
|
3135
2961
|
// src/pcb/pcb_manual_edit_conflict_warning.ts
|
|
3136
|
-
import { z as
|
|
3137
|
-
var pcb_manual_edit_conflict_warning =
|
|
3138
|
-
type:
|
|
2962
|
+
import { z as z141 } from "zod";
|
|
2963
|
+
var pcb_manual_edit_conflict_warning = z141.object({
|
|
2964
|
+
type: z141.literal("pcb_manual_edit_conflict_warning"),
|
|
3139
2965
|
pcb_manual_edit_conflict_warning_id: getZodPrefixedIdWithDefault(
|
|
3140
2966
|
"pcb_manual_edit_conflict_warning"
|
|
3141
2967
|
),
|
|
3142
|
-
warning_type:
|
|
3143
|
-
message:
|
|
3144
|
-
pcb_component_id:
|
|
3145
|
-
pcb_group_id:
|
|
3146
|
-
subcircuit_id:
|
|
3147
|
-
source_component_id:
|
|
2968
|
+
warning_type: z141.literal("pcb_manual_edit_conflict_warning").default("pcb_manual_edit_conflict_warning"),
|
|
2969
|
+
message: z141.string(),
|
|
2970
|
+
pcb_component_id: z141.string(),
|
|
2971
|
+
pcb_group_id: z141.string().optional(),
|
|
2972
|
+
subcircuit_id: z141.string().optional(),
|
|
2973
|
+
source_component_id: z141.string()
|
|
3148
2974
|
}).describe(
|
|
3149
2975
|
"Warning emitted when a component has both manual placement and explicit pcbX/pcbY coordinates"
|
|
3150
2976
|
);
|
|
3151
2977
|
expectTypesMatch(true);
|
|
3152
2978
|
|
|
3153
2979
|
// src/pcb/pcb_connector_not_in_accessible_orientation_warning.ts
|
|
3154
|
-
import { z as
|
|
3155
|
-
var connectorOrientationDirection =
|
|
3156
|
-
var pcb_connector_not_in_accessible_orientation_warning =
|
|
3157
|
-
type:
|
|
2980
|
+
import { z as z142 } from "zod";
|
|
2981
|
+
var connectorOrientationDirection = z142.enum(["x-", "x+", "y+", "y-"]);
|
|
2982
|
+
var pcb_connector_not_in_accessible_orientation_warning = z142.object({
|
|
2983
|
+
type: z142.literal("pcb_connector_not_in_accessible_orientation_warning"),
|
|
3158
2984
|
pcb_connector_not_in_accessible_orientation_warning_id: getZodPrefixedIdWithDefault(
|
|
3159
2985
|
"pcb_connector_not_in_accessible_orientation_warning"
|
|
3160
2986
|
),
|
|
3161
|
-
warning_type:
|
|
3162
|
-
message:
|
|
3163
|
-
pcb_component_id:
|
|
3164
|
-
source_component_id:
|
|
3165
|
-
pcb_board_id:
|
|
2987
|
+
warning_type: z142.literal("pcb_connector_not_in_accessible_orientation_warning").default("pcb_connector_not_in_accessible_orientation_warning"),
|
|
2988
|
+
message: z142.string(),
|
|
2989
|
+
pcb_component_id: z142.string(),
|
|
2990
|
+
source_component_id: z142.string().optional(),
|
|
2991
|
+
pcb_board_id: z142.string().optional(),
|
|
3166
2992
|
facing_direction: connectorOrientationDirection,
|
|
3167
2993
|
recommended_facing_direction: connectorOrientationDirection,
|
|
3168
|
-
subcircuit_id:
|
|
2994
|
+
subcircuit_id: z142.string().optional()
|
|
3169
2995
|
}).describe(
|
|
3170
2996
|
"Warning emitted when a connector PCB component is facing inward toward the board and should be reoriented to an outward-facing direction"
|
|
3171
2997
|
);
|
|
3172
2998
|
expectTypesMatch(true);
|
|
3173
2999
|
|
|
3174
3000
|
// src/pcb/supplier_footprint_mismatch_warning.ts
|
|
3175
|
-
import { z as
|
|
3176
|
-
var supplier_footprint_mismatch_warning =
|
|
3177
|
-
type:
|
|
3001
|
+
import { z as z143 } from "zod";
|
|
3002
|
+
var supplier_footprint_mismatch_warning = z143.object({
|
|
3003
|
+
type: z143.literal("supplier_footprint_mismatch_warning"),
|
|
3178
3004
|
supplier_footprint_mismatch_warning_id: getZodPrefixedIdWithDefault(
|
|
3179
3005
|
"supplier_footprint_mismatch_warning"
|
|
3180
3006
|
),
|
|
3181
|
-
warning_type:
|
|
3182
|
-
message:
|
|
3183
|
-
source_component_id:
|
|
3184
|
-
pcb_component_id:
|
|
3185
|
-
pcb_group_id:
|
|
3186
|
-
subcircuit_id:
|
|
3007
|
+
warning_type: z143.literal("supplier_footprint_mismatch_warning").default("supplier_footprint_mismatch_warning"),
|
|
3008
|
+
message: z143.string(),
|
|
3009
|
+
source_component_id: z143.string(),
|
|
3010
|
+
pcb_component_id: z143.string().optional(),
|
|
3011
|
+
pcb_group_id: z143.string().optional(),
|
|
3012
|
+
subcircuit_id: z143.string().optional(),
|
|
3187
3013
|
supplier_name: supplier_name.optional(),
|
|
3188
|
-
supplier_part_number:
|
|
3189
|
-
supplier_footprint_url:
|
|
3190
|
-
footprint_copper_intersection_over_union:
|
|
3014
|
+
supplier_part_number: z143.string().optional(),
|
|
3015
|
+
supplier_footprint_url: z143.string().optional(),
|
|
3016
|
+
footprint_copper_intersection_over_union: z143.number()
|
|
3191
3017
|
}).describe(
|
|
3192
3018
|
"Warning emitted when a supplier part footprint does not match the expected footprint"
|
|
3193
3019
|
);
|
|
3194
3020
|
expectTypesMatch(true);
|
|
3195
3021
|
|
|
3196
3022
|
// src/pcb/pcb_breakout_point.ts
|
|
3197
|
-
import { z as
|
|
3198
|
-
var pcb_breakout_point =
|
|
3199
|
-
type:
|
|
3023
|
+
import { z as z144 } from "zod";
|
|
3024
|
+
var pcb_breakout_point = z144.object({
|
|
3025
|
+
type: z144.literal("pcb_breakout_point"),
|
|
3200
3026
|
pcb_breakout_point_id: getZodPrefixedIdWithDefault("pcb_breakout_point"),
|
|
3201
|
-
pcb_group_id:
|
|
3202
|
-
subcircuit_id:
|
|
3203
|
-
source_trace_id:
|
|
3204
|
-
source_port_id:
|
|
3205
|
-
source_net_id:
|
|
3027
|
+
pcb_group_id: z144.string(),
|
|
3028
|
+
subcircuit_id: z144.string().optional(),
|
|
3029
|
+
source_trace_id: z144.string().optional(),
|
|
3030
|
+
source_port_id: z144.string().optional(),
|
|
3031
|
+
source_net_id: z144.string().optional(),
|
|
3206
3032
|
x: distance,
|
|
3207
3033
|
y: distance
|
|
3208
3034
|
}).describe(
|
|
@@ -3211,61 +3037,61 @@ var pcb_breakout_point = z143.object({
|
|
|
3211
3037
|
expectTypesMatch(true);
|
|
3212
3038
|
|
|
3213
3039
|
// src/pcb/pcb_ground_plane.ts
|
|
3214
|
-
import { z as
|
|
3215
|
-
var pcb_ground_plane =
|
|
3216
|
-
type:
|
|
3040
|
+
import { z as z145 } from "zod";
|
|
3041
|
+
var pcb_ground_plane = z145.object({
|
|
3042
|
+
type: z145.literal("pcb_ground_plane"),
|
|
3217
3043
|
pcb_ground_plane_id: getZodPrefixedIdWithDefault("pcb_ground_plane"),
|
|
3218
|
-
source_pcb_ground_plane_id:
|
|
3219
|
-
source_net_id:
|
|
3220
|
-
pcb_group_id:
|
|
3221
|
-
subcircuit_id:
|
|
3044
|
+
source_pcb_ground_plane_id: z145.string(),
|
|
3045
|
+
source_net_id: z145.string(),
|
|
3046
|
+
pcb_group_id: z145.string().optional(),
|
|
3047
|
+
subcircuit_id: z145.string().optional()
|
|
3222
3048
|
}).describe("Defines a ground plane on the PCB");
|
|
3223
3049
|
expectTypesMatch(true);
|
|
3224
3050
|
|
|
3225
3051
|
// src/pcb/pcb_ground_plane_region.ts
|
|
3226
|
-
import { z as
|
|
3227
|
-
var pcb_ground_plane_region =
|
|
3228
|
-
type:
|
|
3052
|
+
import { z as z146 } from "zod";
|
|
3053
|
+
var pcb_ground_plane_region = z146.object({
|
|
3054
|
+
type: z146.literal("pcb_ground_plane_region"),
|
|
3229
3055
|
pcb_ground_plane_region_id: getZodPrefixedIdWithDefault(
|
|
3230
3056
|
"pcb_ground_plane_region"
|
|
3231
3057
|
),
|
|
3232
|
-
pcb_ground_plane_id:
|
|
3233
|
-
pcb_group_id:
|
|
3234
|
-
subcircuit_id:
|
|
3058
|
+
pcb_ground_plane_id: z146.string(),
|
|
3059
|
+
pcb_group_id: z146.string().optional(),
|
|
3060
|
+
subcircuit_id: z146.string().optional(),
|
|
3235
3061
|
layer: layer_ref,
|
|
3236
|
-
points:
|
|
3062
|
+
points: z146.array(point)
|
|
3237
3063
|
}).describe("Defines a polygon region of a ground plane");
|
|
3238
3064
|
expectTypesMatch(true);
|
|
3239
3065
|
|
|
3240
3066
|
// src/pcb/pcb_thermal_spoke.ts
|
|
3241
|
-
import { z as
|
|
3242
|
-
var pcb_thermal_spoke =
|
|
3243
|
-
type:
|
|
3067
|
+
import { z as z147 } from "zod";
|
|
3068
|
+
var pcb_thermal_spoke = z147.object({
|
|
3069
|
+
type: z147.literal("pcb_thermal_spoke"),
|
|
3244
3070
|
pcb_thermal_spoke_id: getZodPrefixedIdWithDefault("pcb_thermal_spoke"),
|
|
3245
|
-
pcb_ground_plane_id:
|
|
3246
|
-
shape:
|
|
3247
|
-
spoke_count:
|
|
3071
|
+
pcb_ground_plane_id: z147.string(),
|
|
3072
|
+
shape: z147.string(),
|
|
3073
|
+
spoke_count: z147.number(),
|
|
3248
3074
|
spoke_thickness: distance,
|
|
3249
3075
|
spoke_inner_diameter: distance,
|
|
3250
3076
|
spoke_outer_diameter: distance,
|
|
3251
|
-
pcb_plated_hole_id:
|
|
3252
|
-
subcircuit_id:
|
|
3077
|
+
pcb_plated_hole_id: z147.string().optional(),
|
|
3078
|
+
subcircuit_id: z147.string().optional()
|
|
3253
3079
|
}).describe("Pattern for connecting a ground plane to a plated hole");
|
|
3254
3080
|
expectTypesMatch(true);
|
|
3255
3081
|
|
|
3256
3082
|
// src/pcb/pcb_copper_pour.ts
|
|
3257
|
-
import { z as
|
|
3258
|
-
var pcb_copper_pour_base =
|
|
3259
|
-
type:
|
|
3083
|
+
import { z as z148 } from "zod";
|
|
3084
|
+
var pcb_copper_pour_base = z148.object({
|
|
3085
|
+
type: z148.literal("pcb_copper_pour"),
|
|
3260
3086
|
pcb_copper_pour_id: getZodPrefixedIdWithDefault("pcb_copper_pour"),
|
|
3261
|
-
pcb_group_id:
|
|
3262
|
-
subcircuit_id:
|
|
3087
|
+
pcb_group_id: z148.string().optional(),
|
|
3088
|
+
subcircuit_id: z148.string().optional(),
|
|
3263
3089
|
layer: layer_ref,
|
|
3264
|
-
source_net_id:
|
|
3265
|
-
covered_with_solder_mask:
|
|
3090
|
+
source_net_id: z148.string().optional(),
|
|
3091
|
+
covered_with_solder_mask: z148.boolean().optional().default(true)
|
|
3266
3092
|
});
|
|
3267
3093
|
var pcb_copper_pour_rect = pcb_copper_pour_base.extend({
|
|
3268
|
-
shape:
|
|
3094
|
+
shape: z148.literal("rect"),
|
|
3269
3095
|
center: point,
|
|
3270
3096
|
width: length,
|
|
3271
3097
|
height: length,
|
|
@@ -3273,16 +3099,16 @@ var pcb_copper_pour_rect = pcb_copper_pour_base.extend({
|
|
|
3273
3099
|
});
|
|
3274
3100
|
expectTypesMatch(true);
|
|
3275
3101
|
var pcb_copper_pour_brep = pcb_copper_pour_base.extend({
|
|
3276
|
-
shape:
|
|
3102
|
+
shape: z148.literal("brep"),
|
|
3277
3103
|
brep_shape
|
|
3278
3104
|
});
|
|
3279
3105
|
expectTypesMatch(true);
|
|
3280
3106
|
var pcb_copper_pour_polygon = pcb_copper_pour_base.extend({
|
|
3281
|
-
shape:
|
|
3282
|
-
points:
|
|
3107
|
+
shape: z148.literal("polygon"),
|
|
3108
|
+
points: z148.array(point)
|
|
3283
3109
|
});
|
|
3284
3110
|
expectTypesMatch(true);
|
|
3285
|
-
var pcb_copper_pour =
|
|
3111
|
+
var pcb_copper_pour = z148.discriminatedUnion("shape", [
|
|
3286
3112
|
pcb_copper_pour_rect,
|
|
3287
3113
|
pcb_copper_pour_brep,
|
|
3288
3114
|
pcb_copper_pour_polygon
|
|
@@ -3290,99 +3116,99 @@ var pcb_copper_pour = z147.discriminatedUnion("shape", [
|
|
|
3290
3116
|
expectTypesMatch(true);
|
|
3291
3117
|
|
|
3292
3118
|
// src/pcb/pcb_component_outside_board_error.ts
|
|
3293
|
-
import { z as
|
|
3119
|
+
import { z as z149 } from "zod";
|
|
3294
3120
|
var pcb_component_outside_board_error = base_circuit_json_error.extend({
|
|
3295
|
-
type:
|
|
3121
|
+
type: z149.literal("pcb_component_outside_board_error"),
|
|
3296
3122
|
pcb_component_outside_board_error_id: getZodPrefixedIdWithDefault(
|
|
3297
3123
|
"pcb_component_outside_board_error"
|
|
3298
3124
|
),
|
|
3299
|
-
error_type:
|
|
3300
|
-
pcb_component_id:
|
|
3301
|
-
pcb_board_id:
|
|
3125
|
+
error_type: z149.literal("pcb_component_outside_board_error").default("pcb_component_outside_board_error"),
|
|
3126
|
+
pcb_component_id: z149.string(),
|
|
3127
|
+
pcb_board_id: z149.string(),
|
|
3302
3128
|
component_center: point,
|
|
3303
|
-
component_bounds:
|
|
3304
|
-
min_x:
|
|
3305
|
-
max_x:
|
|
3306
|
-
min_y:
|
|
3307
|
-
max_y:
|
|
3129
|
+
component_bounds: z149.object({
|
|
3130
|
+
min_x: z149.number(),
|
|
3131
|
+
max_x: z149.number(),
|
|
3132
|
+
min_y: z149.number(),
|
|
3133
|
+
max_y: z149.number()
|
|
3308
3134
|
}),
|
|
3309
|
-
subcircuit_id:
|
|
3310
|
-
source_component_id:
|
|
3135
|
+
subcircuit_id: z149.string().optional(),
|
|
3136
|
+
source_component_id: z149.string().optional()
|
|
3311
3137
|
}).describe(
|
|
3312
3138
|
"Error emitted when a PCB component is placed outside the board boundaries"
|
|
3313
3139
|
);
|
|
3314
3140
|
expectTypesMatch(true);
|
|
3315
3141
|
|
|
3316
3142
|
// src/pcb/pcb_component_not_on_board_edge_error.ts
|
|
3317
|
-
import { z as
|
|
3143
|
+
import { z as z150 } from "zod";
|
|
3318
3144
|
var pcb_component_not_on_board_edge_error = base_circuit_json_error.extend({
|
|
3319
|
-
type:
|
|
3145
|
+
type: z150.literal("pcb_component_not_on_board_edge_error"),
|
|
3320
3146
|
pcb_component_not_on_board_edge_error_id: getZodPrefixedIdWithDefault(
|
|
3321
3147
|
"pcb_component_not_on_board_edge_error"
|
|
3322
3148
|
),
|
|
3323
|
-
error_type:
|
|
3324
|
-
pcb_component_id:
|
|
3325
|
-
pcb_board_id:
|
|
3149
|
+
error_type: z150.literal("pcb_component_not_on_board_edge_error").default("pcb_component_not_on_board_edge_error"),
|
|
3150
|
+
pcb_component_id: z150.string(),
|
|
3151
|
+
pcb_board_id: z150.string(),
|
|
3326
3152
|
component_center: point,
|
|
3327
|
-
pad_to_nearest_board_edge_distance:
|
|
3328
|
-
source_component_id:
|
|
3329
|
-
subcircuit_id:
|
|
3153
|
+
pad_to_nearest_board_edge_distance: z150.number(),
|
|
3154
|
+
source_component_id: z150.string().optional(),
|
|
3155
|
+
subcircuit_id: z150.string().optional()
|
|
3330
3156
|
}).describe(
|
|
3331
3157
|
"Error emitted when a component that must be placed on the board edge is centered away from the edge"
|
|
3332
3158
|
);
|
|
3333
3159
|
expectTypesMatch(true);
|
|
3334
3160
|
|
|
3335
3161
|
// src/pcb/pcb_component_invalid_layer_error.ts
|
|
3336
|
-
import { z as
|
|
3162
|
+
import { z as z151 } from "zod";
|
|
3337
3163
|
var pcb_component_invalid_layer_error = base_circuit_json_error.extend({
|
|
3338
|
-
type:
|
|
3164
|
+
type: z151.literal("pcb_component_invalid_layer_error"),
|
|
3339
3165
|
pcb_component_invalid_layer_error_id: getZodPrefixedIdWithDefault(
|
|
3340
3166
|
"pcb_component_invalid_layer_error"
|
|
3341
3167
|
),
|
|
3342
|
-
error_type:
|
|
3343
|
-
pcb_component_id:
|
|
3344
|
-
source_component_id:
|
|
3168
|
+
error_type: z151.literal("pcb_component_invalid_layer_error").default("pcb_component_invalid_layer_error"),
|
|
3169
|
+
pcb_component_id: z151.string().optional(),
|
|
3170
|
+
source_component_id: z151.string(),
|
|
3345
3171
|
layer: layer_ref,
|
|
3346
|
-
subcircuit_id:
|
|
3172
|
+
subcircuit_id: z151.string().optional()
|
|
3347
3173
|
}).describe(
|
|
3348
3174
|
"Error emitted when a component is placed on an invalid layer (components can only be on 'top' or 'bottom' layers)"
|
|
3349
3175
|
);
|
|
3350
3176
|
expectTypesMatch(true);
|
|
3351
3177
|
|
|
3352
3178
|
// src/pcb/pcb_via_clearance_error.ts
|
|
3353
|
-
import { z as
|
|
3179
|
+
import { z as z152 } from "zod";
|
|
3354
3180
|
var pcb_via_clearance_error = base_circuit_json_error.extend({
|
|
3355
|
-
type:
|
|
3181
|
+
type: z152.literal("pcb_via_clearance_error"),
|
|
3356
3182
|
pcb_error_id: getZodPrefixedIdWithDefault("pcb_error"),
|
|
3357
|
-
error_type:
|
|
3358
|
-
pcb_via_ids:
|
|
3183
|
+
error_type: z152.literal("pcb_via_clearance_error").default("pcb_via_clearance_error"),
|
|
3184
|
+
pcb_via_ids: z152.array(z152.string()).min(2),
|
|
3359
3185
|
minimum_clearance: distance.optional(),
|
|
3360
3186
|
actual_clearance: distance.optional(),
|
|
3361
|
-
pcb_center:
|
|
3362
|
-
x:
|
|
3363
|
-
y:
|
|
3187
|
+
pcb_center: z152.object({
|
|
3188
|
+
x: z152.number().optional(),
|
|
3189
|
+
y: z152.number().optional()
|
|
3364
3190
|
}).optional(),
|
|
3365
|
-
subcircuit_id:
|
|
3191
|
+
subcircuit_id: z152.string().optional()
|
|
3366
3192
|
}).describe("Error emitted when vias are closer than the allowed clearance");
|
|
3367
3193
|
expectTypesMatch(true);
|
|
3368
3194
|
|
|
3369
3195
|
// src/pcb/pcb_via_trace_clearance_error.ts
|
|
3370
|
-
import { z as
|
|
3196
|
+
import { z as z153 } from "zod";
|
|
3371
3197
|
var pcb_via_trace_clearance_error = base_circuit_json_error.extend({
|
|
3372
|
-
type:
|
|
3198
|
+
type: z153.literal("pcb_via_trace_clearance_error"),
|
|
3373
3199
|
pcb_via_trace_clearance_error_id: getZodPrefixedIdWithDefault(
|
|
3374
3200
|
"pcb_via_trace_clearance_error"
|
|
3375
3201
|
),
|
|
3376
|
-
error_type:
|
|
3377
|
-
pcb_via_id:
|
|
3378
|
-
pcb_trace_id:
|
|
3202
|
+
error_type: z153.literal("pcb_via_trace_clearance_error").default("pcb_via_trace_clearance_error"),
|
|
3203
|
+
pcb_via_id: z153.string(),
|
|
3204
|
+
pcb_trace_id: z153.string(),
|
|
3379
3205
|
minimum_clearance: distance.optional(),
|
|
3380
3206
|
actual_clearance: distance.optional(),
|
|
3381
|
-
center:
|
|
3382
|
-
x:
|
|
3383
|
-
y:
|
|
3207
|
+
center: z153.object({
|
|
3208
|
+
x: z153.number().optional(),
|
|
3209
|
+
y: z153.number().optional()
|
|
3384
3210
|
}).optional(),
|
|
3385
|
-
subcircuit_id:
|
|
3211
|
+
subcircuit_id: z153.string().optional()
|
|
3386
3212
|
}).describe(
|
|
3387
3213
|
"Error emitted when a via and trace are closer than the allowed clearance"
|
|
3388
3214
|
);
|
|
@@ -3391,41 +3217,41 @@ expectTypesMatch(
|
|
|
3391
3217
|
);
|
|
3392
3218
|
|
|
3393
3219
|
// src/pcb/pcb_pad_pad_clearance_error.ts
|
|
3394
|
-
import { z as
|
|
3220
|
+
import { z as z154 } from "zod";
|
|
3395
3221
|
var pcb_pad_pad_clearance_error = base_circuit_json_error.extend({
|
|
3396
|
-
type:
|
|
3222
|
+
type: z154.literal("pcb_pad_pad_clearance_error"),
|
|
3397
3223
|
pcb_pad_pad_clearance_error_id: getZodPrefixedIdWithDefault(
|
|
3398
3224
|
"pcb_pad_pad_clearance_error"
|
|
3399
3225
|
),
|
|
3400
|
-
error_type:
|
|
3401
|
-
pcb_pad_ids:
|
|
3226
|
+
error_type: z154.literal("pcb_pad_pad_clearance_error").default("pcb_pad_pad_clearance_error"),
|
|
3227
|
+
pcb_pad_ids: z154.array(z154.string()).min(2),
|
|
3402
3228
|
minimum_clearance: distance.optional(),
|
|
3403
3229
|
actual_clearance: distance.optional(),
|
|
3404
|
-
center:
|
|
3405
|
-
x:
|
|
3406
|
-
y:
|
|
3230
|
+
center: z154.object({
|
|
3231
|
+
x: z154.number().optional(),
|
|
3232
|
+
y: z154.number().optional()
|
|
3407
3233
|
}).optional(),
|
|
3408
|
-
subcircuit_id:
|
|
3234
|
+
subcircuit_id: z154.string().optional()
|
|
3409
3235
|
}).describe("Error emitted when pads are closer than the allowed clearance");
|
|
3410
3236
|
expectTypesMatch(true);
|
|
3411
3237
|
|
|
3412
3238
|
// src/pcb/pcb_pad_trace_clearance_error.ts
|
|
3413
|
-
import { z as
|
|
3239
|
+
import { z as z155 } from "zod";
|
|
3414
3240
|
var pcb_pad_trace_clearance_error = base_circuit_json_error.extend({
|
|
3415
|
-
type:
|
|
3241
|
+
type: z155.literal("pcb_pad_trace_clearance_error"),
|
|
3416
3242
|
pcb_pad_trace_clearance_error_id: getZodPrefixedIdWithDefault(
|
|
3417
3243
|
"pcb_pad_trace_clearance_error"
|
|
3418
3244
|
),
|
|
3419
|
-
error_type:
|
|
3420
|
-
pcb_pad_id:
|
|
3421
|
-
pcb_trace_id:
|
|
3245
|
+
error_type: z155.literal("pcb_pad_trace_clearance_error").default("pcb_pad_trace_clearance_error"),
|
|
3246
|
+
pcb_pad_id: z155.string(),
|
|
3247
|
+
pcb_trace_id: z155.string(),
|
|
3422
3248
|
minimum_clearance: distance.optional(),
|
|
3423
3249
|
actual_clearance: distance.optional(),
|
|
3424
|
-
center:
|
|
3425
|
-
x:
|
|
3426
|
-
y:
|
|
3250
|
+
center: z155.object({
|
|
3251
|
+
x: z155.number().optional(),
|
|
3252
|
+
y: z155.number().optional()
|
|
3427
3253
|
}).optional(),
|
|
3428
|
-
subcircuit_id:
|
|
3254
|
+
subcircuit_id: z155.string().optional()
|
|
3429
3255
|
}).describe(
|
|
3430
3256
|
"Error emitted when a pad and trace are closer than allowed clearance"
|
|
3431
3257
|
);
|
|
@@ -3434,89 +3260,89 @@ expectTypesMatch(
|
|
|
3434
3260
|
);
|
|
3435
3261
|
|
|
3436
3262
|
// src/pcb/pcb_courtyard_rect.ts
|
|
3437
|
-
import { z as
|
|
3438
|
-
var pcb_courtyard_rect =
|
|
3439
|
-
type:
|
|
3263
|
+
import { z as z156 } from "zod";
|
|
3264
|
+
var pcb_courtyard_rect = z156.object({
|
|
3265
|
+
type: z156.literal("pcb_courtyard_rect"),
|
|
3440
3266
|
pcb_courtyard_rect_id: getZodPrefixedIdWithDefault("pcb_courtyard_rect"),
|
|
3441
|
-
pcb_component_id:
|
|
3442
|
-
pcb_group_id:
|
|
3443
|
-
subcircuit_id:
|
|
3267
|
+
pcb_component_id: z156.string(),
|
|
3268
|
+
pcb_group_id: z156.string().optional(),
|
|
3269
|
+
subcircuit_id: z156.string().optional(),
|
|
3444
3270
|
center: point,
|
|
3445
3271
|
width: length,
|
|
3446
3272
|
height: length,
|
|
3447
3273
|
layer: visible_layer,
|
|
3448
3274
|
ccw_rotation: rotation.optional(),
|
|
3449
|
-
color:
|
|
3275
|
+
color: z156.string().optional()
|
|
3450
3276
|
}).describe("Defines a courtyard rectangle on the PCB");
|
|
3451
3277
|
expectTypesMatch(true);
|
|
3452
3278
|
|
|
3453
3279
|
// src/pcb/pcb_courtyard_outline.ts
|
|
3454
|
-
import { z as
|
|
3455
|
-
var pcb_courtyard_outline =
|
|
3456
|
-
type:
|
|
3280
|
+
import { z as z157 } from "zod";
|
|
3281
|
+
var pcb_courtyard_outline = z157.object({
|
|
3282
|
+
type: z157.literal("pcb_courtyard_outline"),
|
|
3457
3283
|
pcb_courtyard_outline_id: getZodPrefixedIdWithDefault(
|
|
3458
3284
|
"pcb_courtyard_outline"
|
|
3459
3285
|
),
|
|
3460
|
-
pcb_component_id:
|
|
3461
|
-
pcb_group_id:
|
|
3462
|
-
subcircuit_id:
|
|
3286
|
+
pcb_component_id: z157.string(),
|
|
3287
|
+
pcb_group_id: z157.string().optional(),
|
|
3288
|
+
subcircuit_id: z157.string().optional(),
|
|
3463
3289
|
layer: visible_layer,
|
|
3464
|
-
outline:
|
|
3290
|
+
outline: z157.array(point).min(2)
|
|
3465
3291
|
}).describe("Defines a courtyard outline on the PCB");
|
|
3466
3292
|
expectTypesMatch(true);
|
|
3467
3293
|
|
|
3468
3294
|
// src/pcb/pcb_courtyard_polygon.ts
|
|
3469
|
-
import { z as
|
|
3470
|
-
var pcb_courtyard_polygon =
|
|
3471
|
-
type:
|
|
3295
|
+
import { z as z158 } from "zod";
|
|
3296
|
+
var pcb_courtyard_polygon = z158.object({
|
|
3297
|
+
type: z158.literal("pcb_courtyard_polygon"),
|
|
3472
3298
|
pcb_courtyard_polygon_id: getZodPrefixedIdWithDefault(
|
|
3473
3299
|
"pcb_courtyard_polygon"
|
|
3474
3300
|
),
|
|
3475
|
-
pcb_component_id:
|
|
3476
|
-
pcb_group_id:
|
|
3477
|
-
subcircuit_id:
|
|
3301
|
+
pcb_component_id: z158.string(),
|
|
3302
|
+
pcb_group_id: z158.string().optional(),
|
|
3303
|
+
subcircuit_id: z158.string().optional(),
|
|
3478
3304
|
layer: visible_layer,
|
|
3479
|
-
points:
|
|
3480
|
-
color:
|
|
3305
|
+
points: z158.array(point).min(3),
|
|
3306
|
+
color: z158.string().optional()
|
|
3481
3307
|
}).describe("Defines a courtyard polygon on the PCB");
|
|
3482
3308
|
expectTypesMatch(true);
|
|
3483
3309
|
|
|
3484
3310
|
// src/pcb/pcb_courtyard_circle.ts
|
|
3485
|
-
import { z as
|
|
3486
|
-
var pcb_courtyard_circle =
|
|
3487
|
-
type:
|
|
3311
|
+
import { z as z159 } from "zod";
|
|
3312
|
+
var pcb_courtyard_circle = z159.object({
|
|
3313
|
+
type: z159.literal("pcb_courtyard_circle"),
|
|
3488
3314
|
pcb_courtyard_circle_id: getZodPrefixedIdWithDefault(
|
|
3489
3315
|
"pcb_courtyard_circle"
|
|
3490
3316
|
),
|
|
3491
|
-
pcb_component_id:
|
|
3492
|
-
pcb_group_id:
|
|
3493
|
-
subcircuit_id:
|
|
3317
|
+
pcb_component_id: z159.string(),
|
|
3318
|
+
pcb_group_id: z159.string().optional(),
|
|
3319
|
+
subcircuit_id: z159.string().optional(),
|
|
3494
3320
|
center: point,
|
|
3495
3321
|
radius: length,
|
|
3496
3322
|
layer: visible_layer,
|
|
3497
|
-
color:
|
|
3323
|
+
color: z159.string().optional()
|
|
3498
3324
|
}).describe("Defines a courtyard circle on the PCB");
|
|
3499
3325
|
expectTypesMatch(true);
|
|
3500
3326
|
|
|
3501
3327
|
// src/pcb/pcb_courtyard_pill.ts
|
|
3502
|
-
import { z as
|
|
3503
|
-
var pcb_courtyard_pill =
|
|
3504
|
-
type:
|
|
3328
|
+
import { z as z160 } from "zod";
|
|
3329
|
+
var pcb_courtyard_pill = z160.object({
|
|
3330
|
+
type: z160.literal("pcb_courtyard_pill"),
|
|
3505
3331
|
pcb_courtyard_pill_id: getZodPrefixedIdWithDefault("pcb_courtyard_pill"),
|
|
3506
|
-
pcb_component_id:
|
|
3507
|
-
pcb_group_id:
|
|
3508
|
-
subcircuit_id:
|
|
3332
|
+
pcb_component_id: z160.string(),
|
|
3333
|
+
pcb_group_id: z160.string().optional(),
|
|
3334
|
+
subcircuit_id: z160.string().optional(),
|
|
3509
3335
|
center: point,
|
|
3510
3336
|
width: length,
|
|
3511
3337
|
height: length,
|
|
3512
3338
|
radius: length,
|
|
3513
3339
|
layer: visible_layer,
|
|
3514
|
-
color:
|
|
3340
|
+
color: z160.string().optional()
|
|
3515
3341
|
}).describe("Defines a courtyard pill on the PCB");
|
|
3516
3342
|
expectTypesMatch(true);
|
|
3517
3343
|
|
|
3518
3344
|
// src/cad/cad_component.ts
|
|
3519
|
-
import { z as
|
|
3345
|
+
import { z as z161 } from "zod";
|
|
3520
3346
|
|
|
3521
3347
|
// src/cad/cad_model_conventions.ts
|
|
3522
3348
|
var cad_model_formats = [
|
|
@@ -3547,49 +3373,49 @@ var cadModelDefaultDirectionMap = {
|
|
|
3547
3373
|
};
|
|
3548
3374
|
|
|
3549
3375
|
// src/cad/cad_component.ts
|
|
3550
|
-
var cad_component =
|
|
3551
|
-
type:
|
|
3552
|
-
cad_component_id:
|
|
3553
|
-
pcb_component_id:
|
|
3554
|
-
source_component_id:
|
|
3376
|
+
var cad_component = z161.object({
|
|
3377
|
+
type: z161.literal("cad_component"),
|
|
3378
|
+
cad_component_id: z161.string(),
|
|
3379
|
+
pcb_component_id: z161.string(),
|
|
3380
|
+
source_component_id: z161.string(),
|
|
3555
3381
|
position: point3,
|
|
3556
3382
|
rotation: point3.optional(),
|
|
3557
3383
|
size: point3.optional(),
|
|
3558
3384
|
layer: layer_ref.optional(),
|
|
3559
|
-
subcircuit_id:
|
|
3385
|
+
subcircuit_id: z161.string().optional(),
|
|
3560
3386
|
// These are all ways to generate/load the 3d model
|
|
3561
|
-
footprinter_string:
|
|
3562
|
-
model_obj_url:
|
|
3563
|
-
model_stl_url:
|
|
3564
|
-
model_3mf_url:
|
|
3565
|
-
model_gltf_url:
|
|
3566
|
-
model_glb_url:
|
|
3567
|
-
model_step_url:
|
|
3568
|
-
model_wrl_url:
|
|
3387
|
+
footprinter_string: z161.string().optional(),
|
|
3388
|
+
model_obj_url: z161.string().optional(),
|
|
3389
|
+
model_stl_url: z161.string().optional(),
|
|
3390
|
+
model_3mf_url: z161.string().optional(),
|
|
3391
|
+
model_gltf_url: z161.string().optional(),
|
|
3392
|
+
model_glb_url: z161.string().optional(),
|
|
3393
|
+
model_step_url: z161.string().optional(),
|
|
3394
|
+
model_wrl_url: z161.string().optional(),
|
|
3569
3395
|
model_asset: asset.optional(),
|
|
3570
|
-
model_unit_to_mm_scale_factor:
|
|
3571
|
-
model_board_normal_direction:
|
|
3396
|
+
model_unit_to_mm_scale_factor: z161.number().optional(),
|
|
3397
|
+
model_board_normal_direction: z161.enum(cad_model_axis_directions).optional().describe(
|
|
3572
3398
|
`The direction in the model's coordinate space that is considered "up" or "coming out of the board surface"`
|
|
3573
3399
|
),
|
|
3574
3400
|
model_origin_position: point3.optional(),
|
|
3575
|
-
model_origin_alignment:
|
|
3401
|
+
model_origin_alignment: z161.enum([
|
|
3576
3402
|
"unknown",
|
|
3577
3403
|
"center",
|
|
3578
3404
|
"center_of_component_on_board_surface",
|
|
3579
3405
|
"bottom_center_of_component"
|
|
3580
3406
|
]).optional(),
|
|
3581
|
-
model_object_fit:
|
|
3582
|
-
model_jscad:
|
|
3583
|
-
show_as_translucent_model:
|
|
3584
|
-
show_as_bounding_box:
|
|
3585
|
-
anchor_alignment:
|
|
3407
|
+
model_object_fit: z161.enum(["contain_within_bounds", "fill_bounds"]).optional().default("contain_within_bounds"),
|
|
3408
|
+
model_jscad: z161.any().optional(),
|
|
3409
|
+
show_as_translucent_model: z161.boolean().optional(),
|
|
3410
|
+
show_as_bounding_box: z161.boolean().optional(),
|
|
3411
|
+
anchor_alignment: z161.enum(["center", "center_of_component_on_board_surface"]).optional().default("center")
|
|
3586
3412
|
}).describe("Defines a component on the PCB");
|
|
3587
3413
|
expectTypesMatch(true);
|
|
3588
3414
|
|
|
3589
3415
|
// src/simulation/simulation_voltage_source.ts
|
|
3590
|
-
import { z as
|
|
3591
|
-
var wave_shape =
|
|
3592
|
-
var percentage =
|
|
3416
|
+
import { z as z162 } from "zod";
|
|
3417
|
+
var wave_shape = z162.enum(["sinewave", "square", "triangle", "sawtooth"]);
|
|
3418
|
+
var percentage = z162.union([z162.string(), z162.number()]).transform((val) => {
|
|
3593
3419
|
if (typeof val === "string") {
|
|
3594
3420
|
if (val.endsWith("%")) {
|
|
3595
3421
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -3598,45 +3424,50 @@ var percentage = z161.union([z161.string(), z161.number()]).transform((val) => {
|
|
|
3598
3424
|
}
|
|
3599
3425
|
return val;
|
|
3600
3426
|
}).pipe(
|
|
3601
|
-
|
|
3427
|
+
z162.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
3602
3428
|
);
|
|
3603
|
-
var simulation_dc_voltage_source =
|
|
3604
|
-
type:
|
|
3429
|
+
var simulation_dc_voltage_source = z162.object({
|
|
3430
|
+
type: z162.literal("simulation_voltage_source"),
|
|
3605
3431
|
simulation_voltage_source_id: getZodPrefixedIdWithDefault(
|
|
3606
3432
|
"simulation_voltage_source"
|
|
3607
3433
|
),
|
|
3608
|
-
is_dc_source:
|
|
3609
|
-
positive_source_port_id:
|
|
3610
|
-
negative_source_port_id:
|
|
3611
|
-
positive_source_net_id:
|
|
3612
|
-
negative_source_net_id:
|
|
3434
|
+
is_dc_source: z162.literal(true).optional().default(true),
|
|
3435
|
+
positive_source_port_id: z162.string().optional(),
|
|
3436
|
+
negative_source_port_id: z162.string().optional(),
|
|
3437
|
+
positive_source_net_id: z162.string().optional(),
|
|
3438
|
+
negative_source_net_id: z162.string().optional(),
|
|
3613
3439
|
voltage
|
|
3614
3440
|
}).describe("Defines a DC voltage source for simulation");
|
|
3615
|
-
var simulation_ac_voltage_source =
|
|
3616
|
-
type:
|
|
3441
|
+
var simulation_ac_voltage_source = z162.object({
|
|
3442
|
+
type: z162.literal("simulation_voltage_source"),
|
|
3617
3443
|
simulation_voltage_source_id: getZodPrefixedIdWithDefault(
|
|
3618
3444
|
"simulation_voltage_source"
|
|
3619
3445
|
),
|
|
3620
|
-
is_dc_source:
|
|
3621
|
-
terminal1_source_port_id:
|
|
3622
|
-
terminal2_source_port_id:
|
|
3623
|
-
terminal1_source_net_id:
|
|
3624
|
-
terminal2_source_net_id:
|
|
3446
|
+
is_dc_source: z162.literal(false),
|
|
3447
|
+
terminal1_source_port_id: z162.string().optional(),
|
|
3448
|
+
terminal2_source_port_id: z162.string().optional(),
|
|
3449
|
+
terminal1_source_net_id: z162.string().optional(),
|
|
3450
|
+
terminal2_source_net_id: z162.string().optional(),
|
|
3625
3451
|
voltage: voltage.optional(),
|
|
3626
3452
|
frequency: frequency.optional(),
|
|
3627
3453
|
peak_to_peak_voltage: voltage.optional(),
|
|
3628
3454
|
wave_shape: wave_shape.optional(),
|
|
3629
3455
|
phase: rotation.optional(),
|
|
3630
|
-
duty_cycle: percentage.optional()
|
|
3456
|
+
duty_cycle: percentage.optional(),
|
|
3457
|
+
pulse_delay: ms.optional(),
|
|
3458
|
+
rise_time: ms.optional(),
|
|
3459
|
+
fall_time: ms.optional(),
|
|
3460
|
+
pulse_width: ms.optional(),
|
|
3461
|
+
period: ms.optional()
|
|
3631
3462
|
}).describe("Defines an AC voltage source for simulation");
|
|
3632
|
-
var simulation_voltage_source =
|
|
3463
|
+
var simulation_voltage_source = z162.union([simulation_dc_voltage_source, simulation_ac_voltage_source]).describe("Defines a voltage source for simulation");
|
|
3633
3464
|
expectTypesMatch(true);
|
|
3634
3465
|
expectTypesMatch(true);
|
|
3635
3466
|
expectTypesMatch(true);
|
|
3636
3467
|
|
|
3637
3468
|
// src/simulation/simulation_current_source.ts
|
|
3638
|
-
import { z as
|
|
3639
|
-
var percentage2 =
|
|
3469
|
+
import { z as z163 } from "zod";
|
|
3470
|
+
var percentage2 = z163.union([z163.string(), z163.number()]).transform((val) => {
|
|
3640
3471
|
if (typeof val === "string") {
|
|
3641
3472
|
if (val.endsWith("%")) {
|
|
3642
3473
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -3645,30 +3476,30 @@ var percentage2 = z162.union([z162.string(), z162.number()]).transform((val) =>
|
|
|
3645
3476
|
}
|
|
3646
3477
|
return val;
|
|
3647
3478
|
}).pipe(
|
|
3648
|
-
|
|
3479
|
+
z163.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
3649
3480
|
);
|
|
3650
|
-
var simulation_dc_current_source =
|
|
3651
|
-
type:
|
|
3481
|
+
var simulation_dc_current_source = z163.object({
|
|
3482
|
+
type: z163.literal("simulation_current_source"),
|
|
3652
3483
|
simulation_current_source_id: getZodPrefixedIdWithDefault(
|
|
3653
3484
|
"simulation_current_source"
|
|
3654
3485
|
),
|
|
3655
|
-
is_dc_source:
|
|
3656
|
-
positive_source_port_id:
|
|
3657
|
-
negative_source_port_id:
|
|
3658
|
-
positive_source_net_id:
|
|
3659
|
-
negative_source_net_id:
|
|
3486
|
+
is_dc_source: z163.literal(true).optional().default(true),
|
|
3487
|
+
positive_source_port_id: z163.string().optional(),
|
|
3488
|
+
negative_source_port_id: z163.string().optional(),
|
|
3489
|
+
positive_source_net_id: z163.string().optional(),
|
|
3490
|
+
negative_source_net_id: z163.string().optional(),
|
|
3660
3491
|
current
|
|
3661
3492
|
}).describe("Defines a DC current source for simulation");
|
|
3662
|
-
var simulation_ac_current_source =
|
|
3663
|
-
type:
|
|
3493
|
+
var simulation_ac_current_source = z163.object({
|
|
3494
|
+
type: z163.literal("simulation_current_source"),
|
|
3664
3495
|
simulation_current_source_id: getZodPrefixedIdWithDefault(
|
|
3665
3496
|
"simulation_current_source"
|
|
3666
3497
|
),
|
|
3667
|
-
is_dc_source:
|
|
3668
|
-
terminal1_source_port_id:
|
|
3669
|
-
terminal2_source_port_id:
|
|
3670
|
-
terminal1_source_net_id:
|
|
3671
|
-
terminal2_source_net_id:
|
|
3498
|
+
is_dc_source: z163.literal(false),
|
|
3499
|
+
terminal1_source_port_id: z163.string().optional(),
|
|
3500
|
+
terminal2_source_port_id: z163.string().optional(),
|
|
3501
|
+
terminal1_source_net_id: z163.string().optional(),
|
|
3502
|
+
terminal2_source_net_id: z163.string().optional(),
|
|
3672
3503
|
current: current.optional(),
|
|
3673
3504
|
frequency: frequency.optional(),
|
|
3674
3505
|
peak_to_peak_current: current.optional(),
|
|
@@ -3676,80 +3507,87 @@ var simulation_ac_current_source = z162.object({
|
|
|
3676
3507
|
phase: rotation.optional(),
|
|
3677
3508
|
duty_cycle: percentage2.optional()
|
|
3678
3509
|
}).describe("Defines an AC current source for simulation");
|
|
3679
|
-
var simulation_current_source =
|
|
3510
|
+
var simulation_current_source = z163.union([simulation_dc_current_source, simulation_ac_current_source]).describe("Defines a current source for simulation");
|
|
3680
3511
|
expectTypesMatch(true);
|
|
3681
3512
|
expectTypesMatch(true);
|
|
3682
3513
|
expectTypesMatch(true);
|
|
3683
3514
|
|
|
3684
3515
|
// src/simulation/simulation_experiment.ts
|
|
3685
|
-
import { z as
|
|
3686
|
-
var experiment_type =
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3516
|
+
import { z as z164 } from "zod";
|
|
3517
|
+
var experiment_type = z164.union([
|
|
3518
|
+
z164.literal("spice_dc_sweep"),
|
|
3519
|
+
z164.literal("spice_dc_operating_point"),
|
|
3520
|
+
z164.literal("spice_transient_analysis"),
|
|
3521
|
+
z164.literal("spice_ac_analysis")
|
|
3691
3522
|
]);
|
|
3692
|
-
var
|
|
3693
|
-
|
|
3523
|
+
var spice_simulation_options = z164.object({
|
|
3524
|
+
method: z164.enum(["trap", "gear"]).optional(),
|
|
3525
|
+
reltol: z164.union([z164.number(), z164.string()]).optional(),
|
|
3526
|
+
abstol: z164.union([z164.number(), z164.string()]).optional(),
|
|
3527
|
+
vntol: z164.union([z164.number(), z164.string()]).optional()
|
|
3528
|
+
}).describe("SPICE solver options for a simulation experiment");
|
|
3529
|
+
var simulation_experiment = z164.object({
|
|
3530
|
+
type: z164.literal("simulation_experiment"),
|
|
3694
3531
|
simulation_experiment_id: getZodPrefixedIdWithDefault(
|
|
3695
3532
|
"simulation_experiment"
|
|
3696
3533
|
),
|
|
3697
|
-
name:
|
|
3534
|
+
name: z164.string(),
|
|
3698
3535
|
experiment_type,
|
|
3699
3536
|
time_per_step: duration_ms.optional(),
|
|
3700
3537
|
start_time_ms: ms.optional(),
|
|
3701
|
-
end_time_ms: ms.optional()
|
|
3538
|
+
end_time_ms: ms.optional(),
|
|
3539
|
+
spice_options: spice_simulation_options.optional()
|
|
3702
3540
|
}).describe("Defines a simulation experiment configuration");
|
|
3703
3541
|
expectTypesMatch(true);
|
|
3704
3542
|
|
|
3705
3543
|
// src/simulation/simulation_transient_voltage_graph.ts
|
|
3706
|
-
import { z as
|
|
3707
|
-
var simulation_transient_voltage_graph =
|
|
3708
|
-
type:
|
|
3544
|
+
import { z as z165 } from "zod";
|
|
3545
|
+
var simulation_transient_voltage_graph = z165.object({
|
|
3546
|
+
type: z165.literal("simulation_transient_voltage_graph"),
|
|
3709
3547
|
simulation_transient_voltage_graph_id: getZodPrefixedIdWithDefault(
|
|
3710
3548
|
"simulation_transient_voltage_graph"
|
|
3711
3549
|
),
|
|
3712
|
-
simulation_experiment_id:
|
|
3713
|
-
timestamps_ms:
|
|
3714
|
-
voltage_levels:
|
|
3715
|
-
source_component_id:
|
|
3716
|
-
subcircuit_connectivity_map_key:
|
|
3550
|
+
simulation_experiment_id: z165.string(),
|
|
3551
|
+
timestamps_ms: z165.array(z165.number()).optional(),
|
|
3552
|
+
voltage_levels: z165.array(z165.number()),
|
|
3553
|
+
source_component_id: z165.string().optional(),
|
|
3554
|
+
subcircuit_connectivity_map_key: z165.string().optional(),
|
|
3717
3555
|
time_per_step: duration_ms,
|
|
3718
3556
|
start_time_ms: ms,
|
|
3719
3557
|
end_time_ms: ms,
|
|
3720
|
-
name:
|
|
3721
|
-
color:
|
|
3558
|
+
name: z165.string().optional(),
|
|
3559
|
+
color: z165.string().optional()
|
|
3722
3560
|
}).describe("Stores voltage measurements over time for a simulation");
|
|
3723
3561
|
expectTypesMatch(true);
|
|
3724
3562
|
|
|
3725
3563
|
// src/simulation/simulation_switch.ts
|
|
3726
|
-
import { z as
|
|
3727
|
-
var simulation_switch =
|
|
3728
|
-
type:
|
|
3564
|
+
import { z as z166 } from "zod";
|
|
3565
|
+
var simulation_switch = z166.object({
|
|
3566
|
+
type: z166.literal("simulation_switch"),
|
|
3729
3567
|
simulation_switch_id: getZodPrefixedIdWithDefault("simulation_switch"),
|
|
3730
|
-
source_component_id:
|
|
3568
|
+
source_component_id: z166.string().optional(),
|
|
3731
3569
|
closes_at: ms.optional(),
|
|
3732
3570
|
opens_at: ms.optional(),
|
|
3733
|
-
starts_closed:
|
|
3571
|
+
starts_closed: z166.boolean().optional(),
|
|
3734
3572
|
switching_frequency: frequency.optional()
|
|
3735
3573
|
}).describe("Defines a switch for simulation timing control");
|
|
3736
3574
|
expectTypesMatch(true);
|
|
3737
3575
|
|
|
3738
3576
|
// src/simulation/simulation_voltage_probe.ts
|
|
3739
|
-
import { z as
|
|
3740
|
-
var simulation_voltage_probe =
|
|
3741
|
-
type:
|
|
3577
|
+
import { z as z167 } from "zod";
|
|
3578
|
+
var simulation_voltage_probe = z167.object({
|
|
3579
|
+
type: z167.literal("simulation_voltage_probe"),
|
|
3742
3580
|
simulation_voltage_probe_id: getZodPrefixedIdWithDefault(
|
|
3743
3581
|
"simulation_voltage_probe"
|
|
3744
3582
|
),
|
|
3745
|
-
source_component_id:
|
|
3746
|
-
name:
|
|
3747
|
-
signal_input_source_port_id:
|
|
3748
|
-
signal_input_source_net_id:
|
|
3749
|
-
reference_input_source_port_id:
|
|
3750
|
-
reference_input_source_net_id:
|
|
3751
|
-
subcircuit_id:
|
|
3752
|
-
color:
|
|
3583
|
+
source_component_id: z167.string().optional(),
|
|
3584
|
+
name: z167.string().optional(),
|
|
3585
|
+
signal_input_source_port_id: z167.string().optional(),
|
|
3586
|
+
signal_input_source_net_id: z167.string().optional(),
|
|
3587
|
+
reference_input_source_port_id: z167.string().optional(),
|
|
3588
|
+
reference_input_source_net_id: z167.string().optional(),
|
|
3589
|
+
subcircuit_id: z167.string().optional(),
|
|
3590
|
+
color: z167.string().optional()
|
|
3753
3591
|
}).describe(
|
|
3754
3592
|
"Defines a voltage probe for simulation. If a reference input is not provided, it measures against ground. If a reference input is provided, it measures the differential voltage between two points."
|
|
3755
3593
|
).superRefine((data, ctx) => {
|
|
@@ -3759,20 +3597,20 @@ var simulation_voltage_probe = z166.object({
|
|
|
3759
3597
|
const has_nets = !!data.signal_input_source_net_id || !!data.reference_input_source_net_id;
|
|
3760
3598
|
if (has_ports && has_nets) {
|
|
3761
3599
|
ctx.addIssue({
|
|
3762
|
-
code:
|
|
3600
|
+
code: z167.ZodIssueCode.custom,
|
|
3763
3601
|
message: "Cannot mix port and net connections in a differential probe."
|
|
3764
3602
|
});
|
|
3765
3603
|
} else if (has_ports) {
|
|
3766
3604
|
if (!data.signal_input_source_port_id || !data.reference_input_source_port_id) {
|
|
3767
3605
|
ctx.addIssue({
|
|
3768
|
-
code:
|
|
3606
|
+
code: z167.ZodIssueCode.custom,
|
|
3769
3607
|
message: "Differential port probe requires both signal_input_source_port_id and reference_input_source_port_id."
|
|
3770
3608
|
});
|
|
3771
3609
|
}
|
|
3772
3610
|
} else if (has_nets) {
|
|
3773
3611
|
if (!data.signal_input_source_net_id || !data.reference_input_source_net_id) {
|
|
3774
3612
|
ctx.addIssue({
|
|
3775
|
-
code:
|
|
3613
|
+
code: z167.ZodIssueCode.custom,
|
|
3776
3614
|
message: "Differential net probe requires both signal_input_source_net_id and reference_input_source_net_id."
|
|
3777
3615
|
});
|
|
3778
3616
|
}
|
|
@@ -3780,7 +3618,7 @@ var simulation_voltage_probe = z166.object({
|
|
|
3780
3618
|
} else {
|
|
3781
3619
|
if (!!data.signal_input_source_port_id === !!data.signal_input_source_net_id) {
|
|
3782
3620
|
ctx.addIssue({
|
|
3783
|
-
code:
|
|
3621
|
+
code: z167.ZodIssueCode.custom,
|
|
3784
3622
|
message: "A voltage probe must have exactly one of signal_input_source_port_id or signal_input_source_net_id."
|
|
3785
3623
|
});
|
|
3786
3624
|
}
|
|
@@ -3789,50 +3627,50 @@ var simulation_voltage_probe = z166.object({
|
|
|
3789
3627
|
expectTypesMatch(true);
|
|
3790
3628
|
|
|
3791
3629
|
// src/simulation/simulation_unknown_experiment_error.ts
|
|
3792
|
-
import { z as
|
|
3630
|
+
import { z as z168 } from "zod";
|
|
3793
3631
|
var simulation_unknown_experiment_error = base_circuit_json_error.extend({
|
|
3794
|
-
type:
|
|
3632
|
+
type: z168.literal("simulation_unknown_experiment_error"),
|
|
3795
3633
|
simulation_unknown_experiment_error_id: getZodPrefixedIdWithDefault(
|
|
3796
3634
|
"simulation_unknown_experiment_error"
|
|
3797
3635
|
),
|
|
3798
|
-
error_type:
|
|
3799
|
-
simulation_experiment_id:
|
|
3800
|
-
subcircuit_id:
|
|
3636
|
+
error_type: z168.literal("simulation_unknown_experiment_error").default("simulation_unknown_experiment_error"),
|
|
3637
|
+
simulation_experiment_id: z168.string().optional(),
|
|
3638
|
+
subcircuit_id: z168.string().optional()
|
|
3801
3639
|
}).describe("An unknown error occurred during the simulation experiment.");
|
|
3802
3640
|
expectTypesMatch(true);
|
|
3803
3641
|
|
|
3804
3642
|
// src/simulation/simulation_op_amp.ts
|
|
3805
|
-
import { z as
|
|
3806
|
-
var simulation_op_amp =
|
|
3807
|
-
type:
|
|
3643
|
+
import { z as z169 } from "zod";
|
|
3644
|
+
var simulation_op_amp = z169.object({
|
|
3645
|
+
type: z169.literal("simulation_op_amp"),
|
|
3808
3646
|
simulation_op_amp_id: getZodPrefixedIdWithDefault("simulation_op_amp"),
|
|
3809
|
-
source_component_id:
|
|
3810
|
-
inverting_input_source_port_id:
|
|
3811
|
-
non_inverting_input_source_port_id:
|
|
3812
|
-
output_source_port_id:
|
|
3813
|
-
positive_supply_source_port_id:
|
|
3814
|
-
negative_supply_source_port_id:
|
|
3647
|
+
source_component_id: z169.string().optional(),
|
|
3648
|
+
inverting_input_source_port_id: z169.string(),
|
|
3649
|
+
non_inverting_input_source_port_id: z169.string(),
|
|
3650
|
+
output_source_port_id: z169.string(),
|
|
3651
|
+
positive_supply_source_port_id: z169.string(),
|
|
3652
|
+
negative_supply_source_port_id: z169.string()
|
|
3815
3653
|
}).describe("Defines a simple ideal operational amplifier for simulation");
|
|
3816
3654
|
expectTypesMatch(true);
|
|
3817
3655
|
|
|
3818
3656
|
// src/simulation/simulation_spice_subcircuit.ts
|
|
3819
|
-
import { z as
|
|
3820
|
-
var simulation_spice_subcircuit =
|
|
3821
|
-
type:
|
|
3657
|
+
import { z as z170 } from "zod";
|
|
3658
|
+
var simulation_spice_subcircuit = z170.object({
|
|
3659
|
+
type: z170.literal("simulation_spice_subcircuit"),
|
|
3822
3660
|
simulation_spice_subcircuit_id: getZodPrefixedIdWithDefault(
|
|
3823
3661
|
"simulation_spice_subcircuit"
|
|
3824
3662
|
),
|
|
3825
|
-
source_component_id:
|
|
3826
|
-
spice_pin_to_source_port_map:
|
|
3827
|
-
subcircuit_source:
|
|
3663
|
+
source_component_id: z170.string(),
|
|
3664
|
+
spice_pin_to_source_port_map: z170.record(z170.string(), z170.string()),
|
|
3665
|
+
subcircuit_source: z170.string()
|
|
3828
3666
|
}).describe("Defines a custom SPICE subcircuit model for simulation");
|
|
3829
3667
|
expectTypesMatch(
|
|
3830
3668
|
true
|
|
3831
3669
|
);
|
|
3832
3670
|
|
|
3833
3671
|
// src/any_circuit_element.ts
|
|
3834
|
-
import { z as
|
|
3835
|
-
var any_circuit_element =
|
|
3672
|
+
import { z as z171 } from "zod";
|
|
3673
|
+
var any_circuit_element = z171.union([
|
|
3836
3674
|
source_trace,
|
|
3837
3675
|
source_port,
|
|
3838
3676
|
source_component_internal_connection,
|
|
@@ -3903,6 +3741,7 @@ var any_circuit_element = z170.union([
|
|
|
3903
3741
|
pcb_silkscreen_rect,
|
|
3904
3742
|
pcb_silkscreen_circle,
|
|
3905
3743
|
pcb_silkscreen_oval,
|
|
3744
|
+
pcb_silkscreen_graphic,
|
|
3906
3745
|
pcb_trace_error,
|
|
3907
3746
|
pcb_trace_missing_error,
|
|
3908
3747
|
pcb_placement_error,
|
|
@@ -4018,6 +3857,7 @@ export {
|
|
|
4018
3857
|
manufacturing_drc_properties,
|
|
4019
3858
|
ms,
|
|
4020
3859
|
ninePointAnchor,
|
|
3860
|
+
parseAndConvertSiUnit2 as parseAndConvertSiUnit,
|
|
4021
3861
|
pcbRenderLayer,
|
|
4022
3862
|
pcb_autorouting_error,
|
|
4023
3863
|
pcb_board,
|
|
@@ -4079,6 +3919,8 @@ export {
|
|
|
4079
3919
|
pcb_route_hint,
|
|
4080
3920
|
pcb_route_hints,
|
|
4081
3921
|
pcb_silkscreen_circle,
|
|
3922
|
+
pcb_silkscreen_graphic,
|
|
3923
|
+
pcb_silkscreen_graphic_brep,
|
|
4082
3924
|
pcb_silkscreen_line,
|
|
4083
3925
|
pcb_silkscreen_oval,
|
|
4084
3926
|
pcb_silkscreen_path,
|
|
@@ -4205,6 +4047,7 @@ export {
|
|
|
4205
4047
|
source_simple_voltage_source,
|
|
4206
4048
|
source_trace,
|
|
4207
4049
|
source_trace_not_connected_error,
|
|
4050
|
+
spice_simulation_options,
|
|
4208
4051
|
supplier_footprint_mismatch_warning,
|
|
4209
4052
|
supplier_name,
|
|
4210
4053
|
time,
|