easyeda 0.0.270 → 0.0.271
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/browser/index.js +710 -225
- package/dist/browser/index.js.map +1 -1
- package/dist/index.js +2301 -1800
- package/dist/index.js.map +1 -1
- package/dist/main.cjs +5541 -2538
- package/dist/main.cjs.map +1 -1
- package/package.json +4 -4
package/dist/browser/index.js
CHANGED
|
@@ -47,8 +47,10 @@ __export(dist_exports, {
|
|
|
47
47
|
layer_ref: () => layer_ref,
|
|
48
48
|
layer_string: () => layer_string,
|
|
49
49
|
length: () => length,
|
|
50
|
+
manufacturing_drc_properties: () => manufacturing_drc_properties,
|
|
50
51
|
ms: () => ms,
|
|
51
52
|
ninePointAnchor: () => ninePointAnchor,
|
|
53
|
+
parseAndConvertSiUnit: () => parseAndConvertSiUnit,
|
|
52
54
|
pcbRenderLayer: () => pcbRenderLayer,
|
|
53
55
|
pcb_autorouting_error: () => pcb_autorouting_error,
|
|
54
56
|
pcb_board: () => pcb_board,
|
|
@@ -66,6 +68,7 @@ __export(dist_exports, {
|
|
|
66
68
|
pcb_courtyard_circle: () => pcb_courtyard_circle,
|
|
67
69
|
pcb_courtyard_outline: () => pcb_courtyard_outline,
|
|
68
70
|
pcb_courtyard_overlap_error: () => pcb_courtyard_overlap_error,
|
|
71
|
+
pcb_courtyard_pill: () => pcb_courtyard_pill,
|
|
69
72
|
pcb_courtyard_polygon: () => pcb_courtyard_polygon,
|
|
70
73
|
pcb_courtyard_rect: () => pcb_courtyard_rect,
|
|
71
74
|
pcb_cutout: () => pcb_cutout,
|
|
@@ -97,6 +100,8 @@ __export(dist_exports, {
|
|
|
97
100
|
pcb_note_path: () => pcb_note_path,
|
|
98
101
|
pcb_note_rect: () => pcb_note_rect,
|
|
99
102
|
pcb_note_text: () => pcb_note_text,
|
|
103
|
+
pcb_pad_pad_clearance_error: () => pcb_pad_pad_clearance_error,
|
|
104
|
+
pcb_pad_trace_clearance_error: () => pcb_pad_trace_clearance_error,
|
|
100
105
|
pcb_panel: () => pcb_panel,
|
|
101
106
|
pcb_panelization_placement_error: () => pcb_panelization_placement_error,
|
|
102
107
|
pcb_placement_error: () => pcb_placement_error,
|
|
@@ -107,6 +112,8 @@ __export(dist_exports, {
|
|
|
107
112
|
pcb_route_hint: () => pcb_route_hint,
|
|
108
113
|
pcb_route_hints: () => pcb_route_hints,
|
|
109
114
|
pcb_silkscreen_circle: () => pcb_silkscreen_circle,
|
|
115
|
+
pcb_silkscreen_graphic: () => pcb_silkscreen_graphic,
|
|
116
|
+
pcb_silkscreen_graphic_brep: () => pcb_silkscreen_graphic_brep,
|
|
110
117
|
pcb_silkscreen_line: () => pcb_silkscreen_line,
|
|
111
118
|
pcb_silkscreen_oval: () => pcb_silkscreen_oval,
|
|
112
119
|
pcb_silkscreen_path: () => pcb_silkscreen_path,
|
|
@@ -123,10 +130,13 @@ __export(dist_exports, {
|
|
|
123
130
|
pcb_trace_hint: () => pcb_trace_hint,
|
|
124
131
|
pcb_trace_missing_error: () => pcb_trace_missing_error,
|
|
125
132
|
pcb_trace_route_point: () => pcb_trace_route_point,
|
|
133
|
+
pcb_trace_route_point_through_pad: () => pcb_trace_route_point_through_pad,
|
|
126
134
|
pcb_trace_route_point_via: () => pcb_trace_route_point_via,
|
|
127
135
|
pcb_trace_route_point_wire: () => pcb_trace_route_point_wire,
|
|
136
|
+
pcb_trace_warning: () => pcb_trace_warning,
|
|
128
137
|
pcb_via: () => pcb_via,
|
|
129
138
|
pcb_via_clearance_error: () => pcb_via_clearance_error,
|
|
139
|
+
pcb_via_trace_clearance_error: () => pcb_via_trace_clearance_error,
|
|
130
140
|
point: () => point,
|
|
131
141
|
point3: () => point3,
|
|
132
142
|
point_with_bulge: () => point_with_bulge,
|
|
@@ -167,21 +177,27 @@ __export(dist_exports, {
|
|
|
167
177
|
schematic_voltage_probe: () => schematic_voltage_probe,
|
|
168
178
|
simulation_ac_current_source: () => simulation_ac_current_source,
|
|
169
179
|
simulation_ac_voltage_source: () => simulation_ac_voltage_source,
|
|
180
|
+
simulation_current_probe: () => simulation_current_probe,
|
|
181
|
+
simulation_current_probe_display_options: () => simulation_current_probe_display_options,
|
|
170
182
|
simulation_current_source: () => simulation_current_source,
|
|
171
183
|
simulation_dc_current_source: () => simulation_dc_current_source,
|
|
172
184
|
simulation_dc_voltage_source: () => simulation_dc_voltage_source,
|
|
173
185
|
simulation_experiment: () => simulation_experiment,
|
|
174
186
|
simulation_op_amp: () => simulation_op_amp,
|
|
187
|
+
simulation_spice_subcircuit: () => simulation_spice_subcircuit,
|
|
175
188
|
simulation_switch: () => simulation_switch,
|
|
189
|
+
simulation_transient_current_graph: () => simulation_transient_current_graph,
|
|
176
190
|
simulation_transient_voltage_graph: () => simulation_transient_voltage_graph,
|
|
177
191
|
simulation_unknown_experiment_error: () => simulation_unknown_experiment_error,
|
|
178
192
|
simulation_voltage_probe: () => simulation_voltage_probe,
|
|
193
|
+
simulation_voltage_probe_display_options: () => simulation_voltage_probe_display_options,
|
|
179
194
|
simulation_voltage_source: () => simulation_voltage_source,
|
|
180
195
|
size: () => size,
|
|
181
196
|
source_ambiguous_port_reference: () => source_ambiguous_port_reference,
|
|
182
197
|
source_board: () => source_board,
|
|
183
198
|
source_component_base: () => source_component_base,
|
|
184
199
|
source_component_internal_connection: () => source_component_internal_connection,
|
|
200
|
+
source_component_misconfigured_error: () => source_component_misconfigured_error,
|
|
185
201
|
source_component_pins_underspecified_warning: () => source_component_pins_underspecified_warning,
|
|
186
202
|
source_failed_to_create_component_error: () => source_failed_to_create_component_error,
|
|
187
203
|
source_group: () => source_group,
|
|
@@ -189,6 +205,7 @@ __export(dist_exports, {
|
|
|
189
205
|
source_interconnect: () => source_interconnect,
|
|
190
206
|
source_invalid_component_property_error: () => source_invalid_component_property_error,
|
|
191
207
|
source_manually_placed_via: () => source_manually_placed_via,
|
|
208
|
+
source_missing_manufacturer_part_number_warning: () => source_missing_manufacturer_part_number_warning,
|
|
192
209
|
source_missing_property_error: () => source_missing_property_error,
|
|
193
210
|
source_net: () => source_net,
|
|
194
211
|
source_no_ground_pin_defined_warning: () => source_no_ground_pin_defined_warning,
|
|
@@ -200,6 +217,7 @@ __export(dist_exports, {
|
|
|
200
217
|
source_port: () => source_port,
|
|
201
218
|
source_project_metadata: () => source_project_metadata,
|
|
202
219
|
source_property_ignored_warning: () => source_property_ignored_warning,
|
|
220
|
+
source_simple_ammeter: () => source_simple_ammeter,
|
|
203
221
|
source_simple_battery: () => source_simple_battery,
|
|
204
222
|
source_simple_capacitor: () => source_simple_capacitor,
|
|
205
223
|
source_simple_chip: () => source_simple_chip,
|
|
@@ -227,6 +245,8 @@ __export(dist_exports, {
|
|
|
227
245
|
source_simple_voltage_source: () => source_simple_voltage_source,
|
|
228
246
|
source_trace: () => source_trace,
|
|
229
247
|
source_trace_not_connected_error: () => source_trace_not_connected_error,
|
|
248
|
+
spice_simulation_options: () => spice_simulation_options,
|
|
249
|
+
supplier_footprint_mismatch_warning: () => supplier_footprint_mismatch_warning,
|
|
230
250
|
supplier_name: () => supplier_name,
|
|
231
251
|
time: () => time,
|
|
232
252
|
timestamp: () => timestamp,
|
|
@@ -236,6 +256,273 @@ __export(dist_exports, {
|
|
|
236
256
|
wave_shape: () => wave_shape
|
|
237
257
|
});
|
|
238
258
|
|
|
259
|
+
// node_modules/format-si-unit/dist/index.js
|
|
260
|
+
var SI_PREFIX_VALUES = /* @__PURE__ */ new Map([
|
|
261
|
+
["T", 1e12],
|
|
262
|
+
["G", 1e9],
|
|
263
|
+
["M", 1e6],
|
|
264
|
+
["K", 1e3],
|
|
265
|
+
["k", 1e3],
|
|
266
|
+
["", 1],
|
|
267
|
+
["m", 1e-3],
|
|
268
|
+
["\xB5", 1e-6],
|
|
269
|
+
["u", 1e-6],
|
|
270
|
+
["n", 1e-9],
|
|
271
|
+
["p", 1e-12],
|
|
272
|
+
["f", 1e-15]
|
|
273
|
+
]);
|
|
274
|
+
var SI_PREFIXES = [...SI_PREFIX_VALUES.keys()];
|
|
275
|
+
function getSiPrefixMultiplier(prefix) {
|
|
276
|
+
return SI_PREFIX_VALUES.get(prefix);
|
|
277
|
+
}
|
|
278
|
+
var unitMappings = {
|
|
279
|
+
Hz: {
|
|
280
|
+
baseUnit: "Hz",
|
|
281
|
+
variants: {
|
|
282
|
+
MHz: 1e6,
|
|
283
|
+
kHz: 1e3,
|
|
284
|
+
Hz: 1
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
g: {
|
|
288
|
+
baseUnit: "g",
|
|
289
|
+
variants: {
|
|
290
|
+
kg: 1e3,
|
|
291
|
+
g: 1
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
\u03A9: {
|
|
295
|
+
baseUnit: "\u03A9",
|
|
296
|
+
variants: {
|
|
297
|
+
m\u03A9: 1e-3,
|
|
298
|
+
mohm: 1e-3,
|
|
299
|
+
mOhm: 1e-3,
|
|
300
|
+
milliohm: 1e-3,
|
|
301
|
+
\u03A9: 1,
|
|
302
|
+
ohm: 1,
|
|
303
|
+
Ohm: 1,
|
|
304
|
+
k\u03A9: 1e3,
|
|
305
|
+
K\u03A9: 1e3,
|
|
306
|
+
kohm: 1e3,
|
|
307
|
+
kOhm: 1e3,
|
|
308
|
+
KOhm: 1e3,
|
|
309
|
+
Kohm: 1e3,
|
|
310
|
+
M\u03A9: 1e6,
|
|
311
|
+
Mohm: 1e6,
|
|
312
|
+
MOhm: 1e6,
|
|
313
|
+
megohm: 1e6,
|
|
314
|
+
Megohm: 1e6,
|
|
315
|
+
G\u03A9: 1e9,
|
|
316
|
+
Gohm: 1e9,
|
|
317
|
+
GOhm: 1e9,
|
|
318
|
+
T\u03A9: 1e12,
|
|
319
|
+
Tohm: 1e12,
|
|
320
|
+
TOhm: 1e12
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
V: {
|
|
324
|
+
baseUnit: "V",
|
|
325
|
+
variants: {
|
|
326
|
+
mV: 1e-3,
|
|
327
|
+
V: 1,
|
|
328
|
+
kV: 1e3,
|
|
329
|
+
KV: 1e3,
|
|
330
|
+
MV: 1e6,
|
|
331
|
+
GV: 1e9,
|
|
332
|
+
TV: 1e12
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
A: {
|
|
336
|
+
baseUnit: "A",
|
|
337
|
+
variants: {
|
|
338
|
+
\u00B5A: 1e-6,
|
|
339
|
+
mA: 1e-3,
|
|
340
|
+
ma: 1e-3,
|
|
341
|
+
A: 1,
|
|
342
|
+
kA: 1e3,
|
|
343
|
+
MA: 1e6
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
F: {
|
|
347
|
+
baseUnit: "F",
|
|
348
|
+
variants: {
|
|
349
|
+
pF: 1e-12,
|
|
350
|
+
nF: 1e-9,
|
|
351
|
+
\u00B5F: 1e-6,
|
|
352
|
+
uF: 1e-6,
|
|
353
|
+
mF: 1e-3,
|
|
354
|
+
F: 1,
|
|
355
|
+
kF: 1e3,
|
|
356
|
+
KF: 1e3,
|
|
357
|
+
MF: 1e6
|
|
358
|
+
}
|
|
359
|
+
},
|
|
360
|
+
H: {
|
|
361
|
+
baseUnit: "H",
|
|
362
|
+
variants: {
|
|
363
|
+
pH: 1e-12,
|
|
364
|
+
nH: 1e-9,
|
|
365
|
+
\u00B5H: 1e-6,
|
|
366
|
+
uH: 1e-6,
|
|
367
|
+
mH: 1e-3,
|
|
368
|
+
H: 1,
|
|
369
|
+
kH: 1e3,
|
|
370
|
+
KH: 1e3,
|
|
371
|
+
MH: 1e6
|
|
372
|
+
}
|
|
373
|
+
},
|
|
374
|
+
ml: {
|
|
375
|
+
baseUnit: "ml",
|
|
376
|
+
variants: {
|
|
377
|
+
ml: 1,
|
|
378
|
+
mL: 1,
|
|
379
|
+
l: 1e3,
|
|
380
|
+
L: 1e3
|
|
381
|
+
}
|
|
382
|
+
},
|
|
383
|
+
deg: {
|
|
384
|
+
baseUnit: "deg",
|
|
385
|
+
variants: {
|
|
386
|
+
rad: 180 / Math.PI
|
|
387
|
+
}
|
|
388
|
+
},
|
|
389
|
+
ms: {
|
|
390
|
+
baseUnit: "ms",
|
|
391
|
+
variants: {
|
|
392
|
+
fs: 1e-12,
|
|
393
|
+
ps: 1e-9,
|
|
394
|
+
ns: 1e-6,
|
|
395
|
+
us: 1e-3,
|
|
396
|
+
\u00B5s: 1e-3,
|
|
397
|
+
ms: 1,
|
|
398
|
+
s: 1e3
|
|
399
|
+
}
|
|
400
|
+
},
|
|
401
|
+
mm: {
|
|
402
|
+
baseUnit: "mm",
|
|
403
|
+
variants: {
|
|
404
|
+
nm: 1e-6,
|
|
405
|
+
\u00B5m: 1e-3,
|
|
406
|
+
um: 1e-3,
|
|
407
|
+
mm: 1,
|
|
408
|
+
cm: 10,
|
|
409
|
+
dm: 100,
|
|
410
|
+
m: 1e3,
|
|
411
|
+
km: 1e6,
|
|
412
|
+
in: 25.4,
|
|
413
|
+
ft: 304.8,
|
|
414
|
+
IN: 25.4,
|
|
415
|
+
FT: 304.8,
|
|
416
|
+
yd: 914.4,
|
|
417
|
+
mi: 1609344,
|
|
418
|
+
mil: 0.0254
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
};
|
|
422
|
+
var unitMappingAndVariantSuffixes = /* @__PURE__ */ new Set();
|
|
423
|
+
for (const [baseUnit, info] of Object.entries(unitMappings)) {
|
|
424
|
+
unitMappingAndVariantSuffixes.add(baseUnit);
|
|
425
|
+
for (const variant of Object.keys(info.variants)) {
|
|
426
|
+
unitMappingAndVariantSuffixes.add(variant);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
function getBaseTscircuitUnit(unit) {
|
|
430
|
+
for (const info of Object.values(unitMappings)) {
|
|
431
|
+
if (unit in info.variants) {
|
|
432
|
+
return {
|
|
433
|
+
baseUnit: info.baseUnit,
|
|
434
|
+
conversionFactor: info.variants[unit]
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
for (const [variant, conversionFactor] of Object.entries(info.variants)) {
|
|
438
|
+
if (!unit.endsWith(variant)) continue;
|
|
439
|
+
const prefix = unit.slice(0, -variant.length);
|
|
440
|
+
const prefixMultiplier = getSiPrefixMultiplier(prefix);
|
|
441
|
+
if (prefixMultiplier == null) continue;
|
|
442
|
+
return {
|
|
443
|
+
baseUnit: info.baseUnit,
|
|
444
|
+
conversionFactor: prefixMultiplier * conversionFactor
|
|
445
|
+
};
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
return {
|
|
449
|
+
baseUnit: unit,
|
|
450
|
+
conversionFactor: 1
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
function parseAndConvertSiUnit(v, unitOfValue) {
|
|
454
|
+
if (v === void 0 || v === null)
|
|
455
|
+
return { parsedUnit: null, unitOfValue: null, value: null };
|
|
456
|
+
if (typeof v === "string" && v.match(/^-?[\d.]+$/))
|
|
457
|
+
return {
|
|
458
|
+
value: Number.parseFloat(v),
|
|
459
|
+
parsedUnit: null,
|
|
460
|
+
unitOfValue: null
|
|
461
|
+
};
|
|
462
|
+
if (typeof v === "number")
|
|
463
|
+
return { value: v, parsedUnit: null, unitOfValue: null };
|
|
464
|
+
if (typeof v === "object" && "x" in v && "y" in v) {
|
|
465
|
+
const firstResult = parseAndConvertSiUnit(v.x, unitOfValue);
|
|
466
|
+
const xResult = parseAndConvertSiUnit(v.x, unitOfValue);
|
|
467
|
+
const yResult = parseAndConvertSiUnit(v.y, unitOfValue);
|
|
468
|
+
if (xResult.value === null || yResult.value === null) {
|
|
469
|
+
return { parsedUnit: null, unitOfValue: null, value: null };
|
|
470
|
+
}
|
|
471
|
+
return {
|
|
472
|
+
parsedUnit: firstResult.parsedUnit,
|
|
473
|
+
unitOfValue: firstResult.unitOfValue,
|
|
474
|
+
value: {
|
|
475
|
+
x: xResult.value,
|
|
476
|
+
y: yResult.value
|
|
477
|
+
}
|
|
478
|
+
};
|
|
479
|
+
}
|
|
480
|
+
const reversedInputString = v.toString().split("").reverse().join("");
|
|
481
|
+
const unitReversed = reversedInputString.match(/[^\d\s]+/)?.[0];
|
|
482
|
+
if (!unitReversed) {
|
|
483
|
+
throw new Error(`Could not determine unit: "${v}"`);
|
|
484
|
+
}
|
|
485
|
+
const unit = unitReversed.split("").reverse().join("");
|
|
486
|
+
const numberPart = v.slice(0, -unit.length);
|
|
487
|
+
const bareSiPrefixMultiplier = getSiPrefixMultiplier(unit);
|
|
488
|
+
if (unitOfValue && bareSiPrefixMultiplier != null) {
|
|
489
|
+
return {
|
|
490
|
+
parsedUnit: null,
|
|
491
|
+
unitOfValue,
|
|
492
|
+
value: Number.parseFloat(numberPart) * bareSiPrefixMultiplier
|
|
493
|
+
};
|
|
494
|
+
}
|
|
495
|
+
if (bareSiPrefixMultiplier != null && !unitMappingAndVariantSuffixes.has(unit)) {
|
|
496
|
+
return {
|
|
497
|
+
parsedUnit: null,
|
|
498
|
+
unitOfValue: null,
|
|
499
|
+
value: Number.parseFloat(numberPart) * bareSiPrefixMultiplier
|
|
500
|
+
};
|
|
501
|
+
}
|
|
502
|
+
const { baseUnit, conversionFactor } = getBaseTscircuitUnit(unit);
|
|
503
|
+
return {
|
|
504
|
+
parsedUnit: unit,
|
|
505
|
+
unitOfValue: baseUnit,
|
|
506
|
+
value: conversionFactor * Number.parseFloat(numberPart)
|
|
507
|
+
};
|
|
508
|
+
}
|
|
509
|
+
var SI_PREFIX_PATTERN = SI_PREFIXES.filter((prefix) => prefix !== "").sort((a, b) => b.length - a.length).map((prefix) => prefix.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
|
|
510
|
+
var SI_UNIT_PATTERN = new RegExp(
|
|
511
|
+
`^([+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+-]?\\d+)?)(?:(${SI_PREFIX_PATTERN}))?$`
|
|
512
|
+
);
|
|
513
|
+
var SI_PREFIXES2 = [
|
|
514
|
+
{ value: 1e12, symbol: "T" },
|
|
515
|
+
{ value: 1e9, symbol: "G" },
|
|
516
|
+
{ value: 1e6, symbol: "M" },
|
|
517
|
+
{ value: 1e3, symbol: "k" },
|
|
518
|
+
{ value: 1, symbol: "" },
|
|
519
|
+
{ value: 1e-3, symbol: "m" },
|
|
520
|
+
{ value: 1e-6, symbol: "\xB5" },
|
|
521
|
+
{ value: 1e-9, symbol: "n" },
|
|
522
|
+
{ value: 1e-12, symbol: "p" }
|
|
523
|
+
];
|
|
524
|
+
var FALLBACK_PREFIX = SI_PREFIXES2[SI_PREFIXES2.length - 1];
|
|
525
|
+
|
|
239
526
|
// node_modules/zod/v3/external.js
|
|
240
527
|
var external_exports = {};
|
|
241
528
|
__export(external_exports, {
|
|
@@ -4278,220 +4565,16 @@ var coerce = {
|
|
|
4278
4565
|
var NEVER = INVALID;
|
|
4279
4566
|
|
|
4280
4567
|
// node_modules/circuit-json/dist/index.mjs
|
|
4281
|
-
var
|
|
4282
|
-
|
|
4283
|
-
baseUnit: "Hz",
|
|
4284
|
-
variants: {
|
|
4285
|
-
MHz: 1e6,
|
|
4286
|
-
kHz: 1e3,
|
|
4287
|
-
Hz: 1
|
|
4288
|
-
}
|
|
4289
|
-
},
|
|
4290
|
-
g: {
|
|
4291
|
-
baseUnit: "g",
|
|
4292
|
-
variants: {
|
|
4293
|
-
kg: 1e3,
|
|
4294
|
-
g: 1
|
|
4295
|
-
}
|
|
4296
|
-
},
|
|
4297
|
-
\u03A9: {
|
|
4298
|
-
baseUnit: "\u03A9",
|
|
4299
|
-
variants: {
|
|
4300
|
-
m\u03A9: 1e-3,
|
|
4301
|
-
\u03A9: 1,
|
|
4302
|
-
k\u03A9: 1e3,
|
|
4303
|
-
K\u03A9: 1e3,
|
|
4304
|
-
kohm: 1e3,
|
|
4305
|
-
M\u03A9: 1e6,
|
|
4306
|
-
G\u03A9: 1e9,
|
|
4307
|
-
T\u03A9: 1e12
|
|
4308
|
-
}
|
|
4309
|
-
},
|
|
4310
|
-
V: {
|
|
4311
|
-
baseUnit: "V",
|
|
4312
|
-
variants: {
|
|
4313
|
-
mV: 1e-3,
|
|
4314
|
-
V: 1,
|
|
4315
|
-
kV: 1e3,
|
|
4316
|
-
KV: 1e3,
|
|
4317
|
-
MV: 1e6,
|
|
4318
|
-
GV: 1e9,
|
|
4319
|
-
TV: 1e12
|
|
4320
|
-
}
|
|
4321
|
-
},
|
|
4322
|
-
A: {
|
|
4323
|
-
baseUnit: "A",
|
|
4324
|
-
variants: {
|
|
4325
|
-
\u00B5A: 1e-6,
|
|
4326
|
-
mA: 1e-3,
|
|
4327
|
-
ma: 1e-3,
|
|
4328
|
-
A: 1,
|
|
4329
|
-
kA: 1e3,
|
|
4330
|
-
MA: 1e6
|
|
4331
|
-
}
|
|
4332
|
-
},
|
|
4333
|
-
F: {
|
|
4334
|
-
baseUnit: "F",
|
|
4335
|
-
variants: {
|
|
4336
|
-
pF: 1e-12,
|
|
4337
|
-
nF: 1e-9,
|
|
4338
|
-
\u00B5F: 1e-6,
|
|
4339
|
-
uF: 1e-6,
|
|
4340
|
-
mF: 1e-3,
|
|
4341
|
-
F: 1
|
|
4342
|
-
}
|
|
4343
|
-
},
|
|
4344
|
-
ml: {
|
|
4345
|
-
baseUnit: "ml",
|
|
4346
|
-
variants: {
|
|
4347
|
-
ml: 1,
|
|
4348
|
-
mL: 1,
|
|
4349
|
-
l: 1e3,
|
|
4350
|
-
L: 1e3
|
|
4351
|
-
}
|
|
4352
|
-
},
|
|
4353
|
-
deg: {
|
|
4354
|
-
baseUnit: "deg",
|
|
4355
|
-
variants: {
|
|
4356
|
-
rad: 180 / Math.PI
|
|
4357
|
-
}
|
|
4358
|
-
},
|
|
4359
|
-
ms: {
|
|
4360
|
-
baseUnit: "ms",
|
|
4361
|
-
variants: {
|
|
4362
|
-
fs: 1e-12,
|
|
4363
|
-
ps: 1e-9,
|
|
4364
|
-
ns: 1e-6,
|
|
4365
|
-
us: 1e-3,
|
|
4366
|
-
\u00B5s: 1e-3,
|
|
4367
|
-
ms: 1,
|
|
4368
|
-
s: 1e3
|
|
4369
|
-
}
|
|
4370
|
-
},
|
|
4371
|
-
mm: {
|
|
4372
|
-
baseUnit: "mm",
|
|
4373
|
-
variants: {
|
|
4374
|
-
nm: 1e-6,
|
|
4375
|
-
\u00B5m: 1e-3,
|
|
4376
|
-
um: 1e-3,
|
|
4377
|
-
mm: 1,
|
|
4378
|
-
cm: 10,
|
|
4379
|
-
dm: 100,
|
|
4380
|
-
m: 1e3,
|
|
4381
|
-
km: 1e6,
|
|
4382
|
-
in: 25.4,
|
|
4383
|
-
ft: 304.8,
|
|
4384
|
-
IN: 25.4,
|
|
4385
|
-
FT: 304.8,
|
|
4386
|
-
yd: 914.4,
|
|
4387
|
-
mi: 1609344,
|
|
4388
|
-
mil: 0.0254
|
|
4389
|
-
}
|
|
4390
|
-
}
|
|
4391
|
-
};
|
|
4392
|
-
var unitMappingAndVariantSuffixes = /* @__PURE__ */ new Set();
|
|
4393
|
-
for (const [baseUnit, info] of Object.entries(unitMappings)) {
|
|
4394
|
-
unitMappingAndVariantSuffixes.add(baseUnit);
|
|
4395
|
-
for (const variant of Object.keys(info.variants)) {
|
|
4396
|
-
unitMappingAndVariantSuffixes.add(variant);
|
|
4397
|
-
}
|
|
4398
|
-
}
|
|
4399
|
-
function getBaseTscircuitUnit(unit) {
|
|
4400
|
-
for (const [baseUnit, info] of Object.entries(unitMappings)) {
|
|
4401
|
-
if (unit in info.variants) {
|
|
4402
|
-
return {
|
|
4403
|
-
baseUnit: info.baseUnit,
|
|
4404
|
-
conversionFactor: info.variants[unit]
|
|
4405
|
-
};
|
|
4406
|
-
}
|
|
4407
|
-
}
|
|
4408
|
-
return {
|
|
4409
|
-
baseUnit: unit,
|
|
4410
|
-
conversionFactor: 1
|
|
4411
|
-
};
|
|
4412
|
-
}
|
|
4413
|
-
var si_prefix_multiplier = {
|
|
4414
|
-
tera: 1e12,
|
|
4415
|
-
T: 1e12,
|
|
4416
|
-
giga: 1e9,
|
|
4417
|
-
G: 1e9,
|
|
4418
|
-
mega: 1e6,
|
|
4419
|
-
M: 1e6,
|
|
4420
|
-
kilo: 1e3,
|
|
4421
|
-
k: 1e3,
|
|
4422
|
-
deci: 0.1,
|
|
4423
|
-
d: 0.1,
|
|
4424
|
-
centi: 0.01,
|
|
4425
|
-
c: 0.01,
|
|
4426
|
-
milli: 1e-3,
|
|
4427
|
-
m: 1e-3,
|
|
4428
|
-
micro: 1e-6,
|
|
4429
|
-
u: 1e-6,
|
|
4430
|
-
\u00B5: 1e-6,
|
|
4431
|
-
nano: 1e-9,
|
|
4432
|
-
n: 1e-9,
|
|
4433
|
-
pico: 1e-12,
|
|
4434
|
-
p: 1e-12
|
|
4435
|
-
};
|
|
4436
|
-
function parseAndConvertSiUnit(v) {
|
|
4437
|
-
if (v === void 0 || v === null)
|
|
4438
|
-
return { parsedUnit: null, unitOfValue: null, value: null };
|
|
4439
|
-
if (typeof v === "string" && v.match(/^-?[\d\.]+$/))
|
|
4440
|
-
return {
|
|
4441
|
-
value: Number.parseFloat(v),
|
|
4442
|
-
parsedUnit: null,
|
|
4443
|
-
unitOfValue: null
|
|
4444
|
-
};
|
|
4445
|
-
if (typeof v === "number")
|
|
4446
|
-
return { value: v, parsedUnit: null, unitOfValue: null };
|
|
4447
|
-
if (typeof v === "object" && "x" in v && "y" in v) {
|
|
4448
|
-
const { parsedUnit, unitOfValue } = parseAndConvertSiUnit(v.x);
|
|
4449
|
-
const xResult = parseAndConvertSiUnit(v.x);
|
|
4450
|
-
const yResult = parseAndConvertSiUnit(v.y);
|
|
4451
|
-
if (xResult.value === null || yResult.value === null) {
|
|
4452
|
-
return { parsedUnit: null, unitOfValue: null, value: null };
|
|
4453
|
-
}
|
|
4454
|
-
return {
|
|
4455
|
-
parsedUnit,
|
|
4456
|
-
unitOfValue,
|
|
4457
|
-
value: {
|
|
4458
|
-
x: xResult.value,
|
|
4459
|
-
y: yResult.value
|
|
4460
|
-
}
|
|
4461
|
-
};
|
|
4462
|
-
}
|
|
4463
|
-
const reversed_input_string = v.toString().split("").reverse().join("");
|
|
4464
|
-
const unit_reversed = reversed_input_string.match(/[^\d\s]+/)?.[0];
|
|
4465
|
-
if (!unit_reversed) {
|
|
4466
|
-
throw new Error(`Could not determine unit: "${v}"`);
|
|
4467
|
-
}
|
|
4468
|
-
const unit = unit_reversed.split("").reverse().join("");
|
|
4469
|
-
const numberPart = v.slice(0, -unit.length);
|
|
4470
|
-
if (unit in si_prefix_multiplier && !unitMappingAndVariantSuffixes.has(unit)) {
|
|
4471
|
-
const siMultiplier = si_prefix_multiplier[unit];
|
|
4472
|
-
return {
|
|
4473
|
-
parsedUnit: null,
|
|
4474
|
-
unitOfValue: null,
|
|
4475
|
-
value: Number.parseFloat(numberPart) * siMultiplier
|
|
4476
|
-
};
|
|
4477
|
-
}
|
|
4478
|
-
const { baseUnit, conversionFactor } = getBaseTscircuitUnit(unit);
|
|
4479
|
-
return {
|
|
4480
|
-
parsedUnit: unit,
|
|
4481
|
-
unitOfValue: baseUnit,
|
|
4482
|
-
value: conversionFactor * Number.parseFloat(numberPart)
|
|
4483
|
-
};
|
|
4484
|
-
}
|
|
4485
|
-
var resistance = external_exports.string().or(external_exports.number()).transform((v) => parseAndConvertSiUnit(v).value);
|
|
4486
|
-
var capacitance = external_exports.string().or(external_exports.number()).transform((v) => parseAndConvertSiUnit(v).value).transform((value) => {
|
|
4568
|
+
var resistance = external_exports.string().or(external_exports.number()).transform((v) => parseAndConvertSiUnit(v, "\u03A9").value);
|
|
4569
|
+
var capacitance = external_exports.string().or(external_exports.number()).transform((v) => parseAndConvertSiUnit(v, "F").value).transform((value) => {
|
|
4487
4570
|
return Number.parseFloat(value.toPrecision(12));
|
|
4488
4571
|
});
|
|
4489
|
-
var inductance = external_exports.string().or(external_exports.number()).transform((v) => parseAndConvertSiUnit(v).value);
|
|
4490
|
-
var voltage = external_exports.string().or(external_exports.number()).transform((v) => parseAndConvertSiUnit(v).value);
|
|
4572
|
+
var inductance = external_exports.string().or(external_exports.number()).transform((v) => parseAndConvertSiUnit(v, "H").value);
|
|
4573
|
+
var voltage = external_exports.string().or(external_exports.number()).transform((v) => parseAndConvertSiUnit(v, "V").value);
|
|
4491
4574
|
var length = external_exports.string().or(external_exports.number()).transform((v) => parseAndConvertSiUnit(v).value);
|
|
4492
|
-
var frequency = external_exports.string().or(external_exports.number()).transform((v) => parseAndConvertSiUnit(v).value);
|
|
4575
|
+
var frequency = external_exports.string().or(external_exports.number()).transform((v) => parseAndConvertSiUnit(v, "Hz").value);
|
|
4493
4576
|
var distance = length;
|
|
4494
|
-
var current = external_exports.string().or(external_exports.number()).transform((v) => parseAndConvertSiUnit(v).value);
|
|
4577
|
+
var current = external_exports.string().or(external_exports.number()).transform((v) => parseAndConvertSiUnit(v, "A").value);
|
|
4495
4578
|
var duration_ms = external_exports.string().or(external_exports.number()).transform((v) => parseAndConvertSiUnit(v).value);
|
|
4496
4579
|
var time = duration_ms;
|
|
4497
4580
|
var ms = duration_ms;
|
|
@@ -4804,6 +4887,10 @@ var source_simple_current_source = source_component_base.extend({
|
|
|
4804
4887
|
expectTypesMatch(
|
|
4805
4888
|
true
|
|
4806
4889
|
);
|
|
4890
|
+
var source_simple_ammeter = source_component_base.extend({
|
|
4891
|
+
ftype: external_exports.literal("simple_ammeter")
|
|
4892
|
+
});
|
|
4893
|
+
expectTypesMatch(true);
|
|
4807
4894
|
var source_pin_attributes = external_exports.object({
|
|
4808
4895
|
must_be_connected: external_exports.boolean().optional(),
|
|
4809
4896
|
provides_power: external_exports.boolean().optional(),
|
|
@@ -4858,6 +4945,7 @@ expectTypesMatch(true);
|
|
|
4858
4945
|
var source_simple_inductor = source_component_base.extend({
|
|
4859
4946
|
ftype: external_exports.literal("simple_inductor"),
|
|
4860
4947
|
inductance,
|
|
4948
|
+
display_inductance: external_exports.string().optional(),
|
|
4861
4949
|
max_current_rating: external_exports.number().optional()
|
|
4862
4950
|
});
|
|
4863
4951
|
expectTypesMatch(true);
|
|
@@ -5021,6 +5109,20 @@ var source_pin_missing_trace_warning = external_exports.object({
|
|
|
5021
5109
|
"Warning emitted when a source component pin is missing a trace connection"
|
|
5022
5110
|
);
|
|
5023
5111
|
expectTypesMatch(true);
|
|
5112
|
+
var source_missing_manufacturer_part_number_warning = external_exports.object({
|
|
5113
|
+
type: external_exports.literal("source_missing_manufacturer_part_number_warning"),
|
|
5114
|
+
source_missing_manufacturer_part_number_warning_id: getZodPrefixedIdWithDefault(
|
|
5115
|
+
"source_missing_manufacturer_part_number_warning"
|
|
5116
|
+
),
|
|
5117
|
+
warning_type: external_exports.literal("source_missing_manufacturer_part_number_warning").default("source_missing_manufacturer_part_number_warning"),
|
|
5118
|
+
message: external_exports.string(),
|
|
5119
|
+
source_component_id: external_exports.string(),
|
|
5120
|
+
standard: external_exports.string(),
|
|
5121
|
+
subcircuit_id: external_exports.string().optional()
|
|
5122
|
+
}).describe(
|
|
5123
|
+
"Warning emitted when a standard connector is missing manufacturer part number"
|
|
5124
|
+
);
|
|
5125
|
+
expectTypesMatch(true);
|
|
5024
5126
|
var source_simple_voltage_probe = source_component_base.extend({
|
|
5025
5127
|
ftype: external_exports.literal("simple_voltage_probe")
|
|
5026
5128
|
});
|
|
@@ -5042,6 +5144,18 @@ var source_i2c_misconfigured_error = base_circuit_json_error.extend({
|
|
|
5042
5144
|
"Error emitted when incompatible I2C pins (e.g. SDA and SCL) are connected to the same net"
|
|
5043
5145
|
);
|
|
5044
5146
|
expectTypesMatch(true);
|
|
5147
|
+
var source_component_misconfigured_error = base_circuit_json_error.extend({
|
|
5148
|
+
type: external_exports.literal("source_component_misconfigured_error"),
|
|
5149
|
+
source_component_misconfigured_error_id: getZodPrefixedIdWithDefault(
|
|
5150
|
+
"source_component_misconfigured_error"
|
|
5151
|
+
),
|
|
5152
|
+
error_type: external_exports.literal("source_component_misconfigured_error").default("source_component_misconfigured_error"),
|
|
5153
|
+
source_component_ids: external_exports.array(external_exports.string()),
|
|
5154
|
+
source_port_ids: external_exports.array(external_exports.string()).optional()
|
|
5155
|
+
}).describe(
|
|
5156
|
+
"Error emitted when one or more source components have an invalid or conflicting configuration"
|
|
5157
|
+
);
|
|
5158
|
+
expectTypesMatch(true);
|
|
5045
5159
|
var source_simple_voltage_source = source_component_base.extend({
|
|
5046
5160
|
ftype: external_exports.literal("simple_voltage_source"),
|
|
5047
5161
|
voltage,
|
|
@@ -5049,7 +5163,12 @@ var source_simple_voltage_source = source_component_base.extend({
|
|
|
5049
5163
|
peak_to_peak_voltage: voltage.optional(),
|
|
5050
5164
|
wave_shape: external_exports.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
5051
5165
|
phase: rotation.optional(),
|
|
5052
|
-
duty_cycle: external_exports.number().optional().describe("Duty cycle as a fraction (0 to 1)")
|
|
5166
|
+
duty_cycle: external_exports.number().optional().describe("Duty cycle as a fraction (0 to 1)"),
|
|
5167
|
+
pulse_delay: ms.optional(),
|
|
5168
|
+
rise_time: ms.optional(),
|
|
5169
|
+
fall_time: ms.optional(),
|
|
5170
|
+
pulse_width: ms.optional(),
|
|
5171
|
+
period: ms.optional()
|
|
5053
5172
|
});
|
|
5054
5173
|
expectTypesMatch(
|
|
5055
5174
|
true
|
|
@@ -5064,6 +5183,7 @@ var any_source_component = external_exports.union([
|
|
|
5064
5183
|
source_simple_chip,
|
|
5065
5184
|
source_simple_power_source,
|
|
5066
5185
|
source_simple_current_source,
|
|
5186
|
+
source_simple_ammeter,
|
|
5067
5187
|
source_simple_battery,
|
|
5068
5188
|
source_simple_inductor,
|
|
5069
5189
|
source_simple_push_button,
|
|
@@ -5089,7 +5209,9 @@ var any_source_component = external_exports.union([
|
|
|
5089
5209
|
source_trace_not_connected_error,
|
|
5090
5210
|
source_property_ignored_warning,
|
|
5091
5211
|
source_pin_missing_trace_warning,
|
|
5092
|
-
|
|
5212
|
+
source_missing_manufacturer_part_number_warning,
|
|
5213
|
+
source_i2c_misconfigured_error,
|
|
5214
|
+
source_component_misconfigured_error
|
|
5093
5215
|
]);
|
|
5094
5216
|
expectTypesMatch(true);
|
|
5095
5217
|
var source_port = external_exports.object({
|
|
@@ -5297,8 +5419,11 @@ var schematic_path = external_exports.object({
|
|
|
5297
5419
|
schematic_symbol_id: external_exports.string().optional(),
|
|
5298
5420
|
fill_color: external_exports.string().optional(),
|
|
5299
5421
|
is_filled: external_exports.boolean().optional(),
|
|
5422
|
+
is_dashed: external_exports.boolean().default(false),
|
|
5300
5423
|
stroke_width: distance.nullable().optional(),
|
|
5301
5424
|
stroke_color: external_exports.string().optional(),
|
|
5425
|
+
dash_length: distance.optional(),
|
|
5426
|
+
dash_gap: distance.optional(),
|
|
5302
5427
|
points: external_exports.array(point),
|
|
5303
5428
|
subcircuit_id: external_exports.string().optional()
|
|
5304
5429
|
});
|
|
@@ -5390,6 +5515,8 @@ var schematic_line = external_exports.object({
|
|
|
5390
5515
|
stroke_width: distance.nullable().optional(),
|
|
5391
5516
|
color: external_exports.string().default("#000000"),
|
|
5392
5517
|
is_dashed: external_exports.boolean().default(false),
|
|
5518
|
+
dash_length: distance.optional(),
|
|
5519
|
+
dash_gap: distance.optional(),
|
|
5393
5520
|
subcircuit_id: external_exports.string().optional()
|
|
5394
5521
|
}).describe("Draws a styled line on the schematic");
|
|
5395
5522
|
expectTypesMatch(true);
|
|
@@ -5691,6 +5818,19 @@ var route_hint_point = external_exports.object({
|
|
|
5691
5818
|
trace_width: distance.optional()
|
|
5692
5819
|
});
|
|
5693
5820
|
expectTypesMatch(true);
|
|
5821
|
+
var manufacturing_drc_properties = external_exports.object({
|
|
5822
|
+
min_trace_width: length.optional(),
|
|
5823
|
+
min_board_edge_clearance: length.optional(),
|
|
5824
|
+
min_via_hole_edge_to_via_hole_edge_clearance: length.optional(),
|
|
5825
|
+
min_plated_hole_drill_edge_to_drill_edge_clearance: length.optional(),
|
|
5826
|
+
min_trace_to_pad_edge_clearance: length.optional(),
|
|
5827
|
+
min_pad_edge_to_pad_edge_clearance: length.optional(),
|
|
5828
|
+
min_same_net_trace_edge_to_trace_edge_clearance: length.optional(),
|
|
5829
|
+
min_different_net_trace_edge_to_trace_edge_clearance: length.optional(),
|
|
5830
|
+
min_via_edge_to_pad_edge_clearance: length.optional(),
|
|
5831
|
+
min_via_hole_diameter: length.optional(),
|
|
5832
|
+
min_via_pad_diameter: length.optional()
|
|
5833
|
+
});
|
|
5694
5834
|
var pcb_component = external_exports.object({
|
|
5695
5835
|
type: external_exports.literal("pcb_component"),
|
|
5696
5836
|
pcb_component_id: getZodPrefixedIdWithDefault("pcb_component"),
|
|
@@ -5721,6 +5861,13 @@ var pcb_component = external_exports.object({
|
|
|
5721
5861
|
positioned_relative_to_pcb_group_id: external_exports.string().optional(),
|
|
5722
5862
|
positioned_relative_to_pcb_board_id: external_exports.string().optional(),
|
|
5723
5863
|
cable_insertion_center: point.optional(),
|
|
5864
|
+
insertion_direction: external_exports.enum([
|
|
5865
|
+
"from_above",
|
|
5866
|
+
"from_left",
|
|
5867
|
+
"from_right",
|
|
5868
|
+
"from_front",
|
|
5869
|
+
"from_back"
|
|
5870
|
+
]).optional(),
|
|
5724
5871
|
metadata: external_exports.object({
|
|
5725
5872
|
kicad_footprint: kicadFootprintMetadata.optional()
|
|
5726
5873
|
}).optional(),
|
|
@@ -6252,12 +6399,23 @@ var pcb_trace_route_point_via = external_exports.object({
|
|
|
6252
6399
|
is_inside_copper_pour: external_exports.boolean().optional(),
|
|
6253
6400
|
hole_diameter: distance.optional(),
|
|
6254
6401
|
outer_diameter: distance.optional(),
|
|
6255
|
-
from_layer:
|
|
6256
|
-
to_layer:
|
|
6402
|
+
from_layer: layer_ref,
|
|
6403
|
+
to_layer: layer_ref
|
|
6404
|
+
});
|
|
6405
|
+
var pcb_trace_route_point_through_pad = external_exports.object({
|
|
6406
|
+
route_type: external_exports.literal("through_pad"),
|
|
6407
|
+
start: point,
|
|
6408
|
+
end: point,
|
|
6409
|
+
width: distance,
|
|
6410
|
+
start_layer: layer_ref,
|
|
6411
|
+
end_layer: layer_ref,
|
|
6412
|
+
pcb_smtpad_id: external_exports.string().optional(),
|
|
6413
|
+
pcb_plated_hole_id: external_exports.string().optional()
|
|
6257
6414
|
});
|
|
6258
6415
|
var pcb_trace_route_point = external_exports.union([
|
|
6259
6416
|
pcb_trace_route_point_wire,
|
|
6260
|
-
pcb_trace_route_point_via
|
|
6417
|
+
pcb_trace_route_point_via,
|
|
6418
|
+
pcb_trace_route_point_through_pad
|
|
6261
6419
|
]);
|
|
6262
6420
|
var pcb_trace = external_exports.object({
|
|
6263
6421
|
type: external_exports.literal("pcb_trace"),
|
|
@@ -6275,6 +6433,19 @@ var pcb_trace = external_exports.object({
|
|
|
6275
6433
|
}).describe("Defines a trace on the PCB");
|
|
6276
6434
|
expectTypesMatch(true);
|
|
6277
6435
|
expectTypesMatch(true);
|
|
6436
|
+
var pcb_trace_warning = external_exports.object({
|
|
6437
|
+
type: external_exports.literal("pcb_trace_warning"),
|
|
6438
|
+
pcb_trace_warning_id: getZodPrefixedIdWithDefault("pcb_trace_warning"),
|
|
6439
|
+
warning_type: external_exports.literal("pcb_trace_warning").default("pcb_trace_warning"),
|
|
6440
|
+
message: external_exports.string(),
|
|
6441
|
+
center: point.optional(),
|
|
6442
|
+
pcb_trace_id: external_exports.string(),
|
|
6443
|
+
source_trace_id: external_exports.string(),
|
|
6444
|
+
pcb_component_ids: external_exports.array(external_exports.string()),
|
|
6445
|
+
pcb_port_ids: external_exports.array(external_exports.string()),
|
|
6446
|
+
subcircuit_id: external_exports.string().optional()
|
|
6447
|
+
}).describe("Defines a trace warning on the PCB");
|
|
6448
|
+
expectTypesMatch(true);
|
|
6278
6449
|
var pcb_trace_error = base_circuit_json_error.extend({
|
|
6279
6450
|
type: external_exports.literal("pcb_trace_error"),
|
|
6280
6451
|
pcb_trace_error_id: getZodPrefixedIdWithDefault("pcb_trace_error"),
|
|
@@ -6373,10 +6544,12 @@ var pcb_board = external_exports.object({
|
|
|
6373
6544
|
outline: external_exports.array(point).optional(),
|
|
6374
6545
|
shape: external_exports.enum(["rect", "polygon"]).optional(),
|
|
6375
6546
|
material: external_exports.enum(["fr4", "fr1"]).default("fr4"),
|
|
6547
|
+
solder_mask_color: external_exports.string().optional(),
|
|
6548
|
+
silkscreen_color: external_exports.string().optional(),
|
|
6376
6549
|
anchor_position: point.optional(),
|
|
6377
6550
|
anchor_alignment: ninePointAnchor.optional(),
|
|
6378
6551
|
position_mode: external_exports.enum(["relative_to_panel_anchor", "none"]).optional()
|
|
6379
|
-
}).describe("Defines the board outline of the PCB");
|
|
6552
|
+
}).merge(manufacturing_drc_properties).describe("Defines the board outline of the PCB");
|
|
6380
6553
|
expectTypesMatch(true);
|
|
6381
6554
|
var pcb_panel = external_exports.object({
|
|
6382
6555
|
type: external_exports.literal("pcb_panel"),
|
|
@@ -6384,6 +6557,7 @@ var pcb_panel = external_exports.object({
|
|
|
6384
6557
|
width: length,
|
|
6385
6558
|
height: length,
|
|
6386
6559
|
center: point,
|
|
6560
|
+
thickness: length.optional().default(1.4),
|
|
6387
6561
|
covered_with_solder_mask: external_exports.boolean().optional().default(true)
|
|
6388
6562
|
}).describe("Defines a PCB panel that can contain multiple boards");
|
|
6389
6563
|
expectTypesMatch(true);
|
|
@@ -6524,7 +6698,8 @@ var pcb_silkscreen_circle = external_exports.object({
|
|
|
6524
6698
|
center: point,
|
|
6525
6699
|
radius: length,
|
|
6526
6700
|
layer: visible_layer,
|
|
6527
|
-
stroke_width: length.default("1mm")
|
|
6701
|
+
stroke_width: length.default("1mm"),
|
|
6702
|
+
is_filled: external_exports.boolean().optional()
|
|
6528
6703
|
}).describe("Defines a silkscreen circle on the PCB");
|
|
6529
6704
|
expectTypesMatch(true);
|
|
6530
6705
|
var pcb_silkscreen_oval = external_exports.object({
|
|
@@ -6540,6 +6715,26 @@ var pcb_silkscreen_oval = external_exports.object({
|
|
|
6540
6715
|
ccw_rotation: rotation.optional()
|
|
6541
6716
|
}).describe("Defines a silkscreen oval on the PCB");
|
|
6542
6717
|
expectTypesMatch(true);
|
|
6718
|
+
var pcb_silkscreen_graphic_base = external_exports.object({
|
|
6719
|
+
type: external_exports.literal("pcb_silkscreen_graphic"),
|
|
6720
|
+
pcb_silkscreen_graphic_id: getZodPrefixedIdWithDefault(
|
|
6721
|
+
"pcb_silkscreen_graphic"
|
|
6722
|
+
),
|
|
6723
|
+
pcb_component_id: external_exports.string(),
|
|
6724
|
+
pcb_group_id: external_exports.string().optional(),
|
|
6725
|
+
subcircuit_id: external_exports.string().optional(),
|
|
6726
|
+
layer: visible_layer,
|
|
6727
|
+
image_asset: asset.optional()
|
|
6728
|
+
});
|
|
6729
|
+
var pcb_silkscreen_graphic_brep = pcb_silkscreen_graphic_base.extend({
|
|
6730
|
+
shape: external_exports.literal("brep"),
|
|
6731
|
+
brep_shape
|
|
6732
|
+
}).describe("Defines a BRep silkscreen graphic on the PCB");
|
|
6733
|
+
expectTypesMatch(
|
|
6734
|
+
true
|
|
6735
|
+
);
|
|
6736
|
+
var pcb_silkscreen_graphic = external_exports.discriminatedUnion("shape", [pcb_silkscreen_graphic_brep]).describe("Defines a silkscreen graphic on the PCB");
|
|
6737
|
+
expectTypesMatch(true);
|
|
6543
6738
|
var pcb_silkscreen_pill = external_exports.object({
|
|
6544
6739
|
type: external_exports.literal("pcb_silkscreen_pill"),
|
|
6545
6740
|
pcb_silkscreen_pill_id: getZodPrefixedIdWithDefault("pcb_silkscreen_pill"),
|
|
@@ -6564,6 +6759,7 @@ var pcb_fabrication_note_text = external_exports.object({
|
|
|
6564
6759
|
font_size: distance.default("1mm"),
|
|
6565
6760
|
pcb_component_id: external_exports.string(),
|
|
6566
6761
|
text: external_exports.string(),
|
|
6762
|
+
ccw_rotation: external_exports.number().optional(),
|
|
6567
6763
|
layer: visible_layer,
|
|
6568
6764
|
anchor_position: point.default({ x: 0, y: 0 }),
|
|
6569
6765
|
anchor_alignment: external_exports.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
@@ -6644,6 +6840,8 @@ var pcb_note_text = external_exports.object({
|
|
|
6644
6840
|
text: external_exports.string().optional(),
|
|
6645
6841
|
anchor_position: point.default({ x: 0, y: 0 }),
|
|
6646
6842
|
anchor_alignment: external_exports.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
6843
|
+
layer: visible_layer.default("top"),
|
|
6844
|
+
is_mirrored_from_top_view: external_exports.boolean().optional(),
|
|
6647
6845
|
color: external_exports.string().optional()
|
|
6648
6846
|
}).describe("Defines a documentation note in text on the PCB");
|
|
6649
6847
|
expectTypesMatch(true);
|
|
@@ -6658,6 +6856,7 @@ var pcb_note_rect = external_exports.object({
|
|
|
6658
6856
|
center: point,
|
|
6659
6857
|
width: length,
|
|
6660
6858
|
height: length,
|
|
6859
|
+
layer: visible_layer.default("top"),
|
|
6661
6860
|
stroke_width: length.default("0.1mm"),
|
|
6662
6861
|
corner_radius: length.optional(),
|
|
6663
6862
|
is_filled: external_exports.boolean().optional(),
|
|
@@ -6675,6 +6874,7 @@ var pcb_note_path = external_exports.object({
|
|
|
6675
6874
|
name: external_exports.string().optional(),
|
|
6676
6875
|
text: external_exports.string().optional(),
|
|
6677
6876
|
route: external_exports.array(point),
|
|
6877
|
+
layer: visible_layer.default("top"),
|
|
6678
6878
|
stroke_width: length.default("0.1mm"),
|
|
6679
6879
|
color: external_exports.string().optional()
|
|
6680
6880
|
}).describe("Defines a polyline documentation note on the PCB");
|
|
@@ -6691,6 +6891,7 @@ var pcb_note_line = external_exports.object({
|
|
|
6691
6891
|
y1: distance,
|
|
6692
6892
|
x2: distance,
|
|
6693
6893
|
y2: distance,
|
|
6894
|
+
layer: visible_layer.default("top"),
|
|
6694
6895
|
stroke_width: distance.default("0.1mm"),
|
|
6695
6896
|
color: external_exports.string().optional(),
|
|
6696
6897
|
is_dashed: external_exports.boolean().optional()
|
|
@@ -6714,6 +6915,7 @@ var pcb_note_dimension = external_exports.object({
|
|
|
6714
6915
|
}).optional(),
|
|
6715
6916
|
font: external_exports.literal("tscircuit2024").default("tscircuit2024"),
|
|
6716
6917
|
font_size: length.default("1mm"),
|
|
6918
|
+
layer: visible_layer.default("top"),
|
|
6717
6919
|
color: external_exports.string().optional(),
|
|
6718
6920
|
arrow_size: length.default("1mm")
|
|
6719
6921
|
}).describe("Defines a measurement annotation within PCB documentation notes");
|
|
@@ -6925,6 +7127,25 @@ var pcb_connector_not_in_accessible_orientation_warning = external_exports.objec
|
|
|
6925
7127
|
"Warning emitted when a connector PCB component is facing inward toward the board and should be reoriented to an outward-facing direction"
|
|
6926
7128
|
);
|
|
6927
7129
|
expectTypesMatch(true);
|
|
7130
|
+
var supplier_footprint_mismatch_warning = external_exports.object({
|
|
7131
|
+
type: external_exports.literal("supplier_footprint_mismatch_warning"),
|
|
7132
|
+
supplier_footprint_mismatch_warning_id: getZodPrefixedIdWithDefault(
|
|
7133
|
+
"supplier_footprint_mismatch_warning"
|
|
7134
|
+
),
|
|
7135
|
+
warning_type: external_exports.literal("supplier_footprint_mismatch_warning").default("supplier_footprint_mismatch_warning"),
|
|
7136
|
+
message: external_exports.string(),
|
|
7137
|
+
source_component_id: external_exports.string(),
|
|
7138
|
+
pcb_component_id: external_exports.string().optional(),
|
|
7139
|
+
pcb_group_id: external_exports.string().optional(),
|
|
7140
|
+
subcircuit_id: external_exports.string().optional(),
|
|
7141
|
+
supplier_name: supplier_name.optional(),
|
|
7142
|
+
supplier_part_number: external_exports.string().optional(),
|
|
7143
|
+
supplier_footprint_url: external_exports.string().optional(),
|
|
7144
|
+
footprint_copper_intersection_over_union: external_exports.number()
|
|
7145
|
+
}).describe(
|
|
7146
|
+
"Warning emitted when a supplier part footprint does not match the expected footprint"
|
|
7147
|
+
);
|
|
7148
|
+
expectTypesMatch(true);
|
|
6928
7149
|
var pcb_breakout_point = external_exports.object({
|
|
6929
7150
|
type: external_exports.literal("pcb_breakout_point"),
|
|
6930
7151
|
pcb_breakout_point_id: getZodPrefixedIdWithDefault("pcb_breakout_point"),
|
|
@@ -7071,6 +7292,64 @@ var pcb_via_clearance_error = base_circuit_json_error.extend({
|
|
|
7071
7292
|
subcircuit_id: external_exports.string().optional()
|
|
7072
7293
|
}).describe("Error emitted when vias are closer than the allowed clearance");
|
|
7073
7294
|
expectTypesMatch(true);
|
|
7295
|
+
var pcb_via_trace_clearance_error = base_circuit_json_error.extend({
|
|
7296
|
+
type: external_exports.literal("pcb_via_trace_clearance_error"),
|
|
7297
|
+
pcb_via_trace_clearance_error_id: getZodPrefixedIdWithDefault(
|
|
7298
|
+
"pcb_via_trace_clearance_error"
|
|
7299
|
+
),
|
|
7300
|
+
error_type: external_exports.literal("pcb_via_trace_clearance_error").default("pcb_via_trace_clearance_error"),
|
|
7301
|
+
pcb_via_id: external_exports.string(),
|
|
7302
|
+
pcb_trace_id: external_exports.string(),
|
|
7303
|
+
minimum_clearance: distance.optional(),
|
|
7304
|
+
actual_clearance: distance.optional(),
|
|
7305
|
+
center: external_exports.object({
|
|
7306
|
+
x: external_exports.number().optional(),
|
|
7307
|
+
y: external_exports.number().optional()
|
|
7308
|
+
}).optional(),
|
|
7309
|
+
subcircuit_id: external_exports.string().optional()
|
|
7310
|
+
}).describe(
|
|
7311
|
+
"Error emitted when a via and trace are closer than the allowed clearance"
|
|
7312
|
+
);
|
|
7313
|
+
expectTypesMatch(
|
|
7314
|
+
true
|
|
7315
|
+
);
|
|
7316
|
+
var pcb_pad_pad_clearance_error = base_circuit_json_error.extend({
|
|
7317
|
+
type: external_exports.literal("pcb_pad_pad_clearance_error"),
|
|
7318
|
+
pcb_pad_pad_clearance_error_id: getZodPrefixedIdWithDefault(
|
|
7319
|
+
"pcb_pad_pad_clearance_error"
|
|
7320
|
+
),
|
|
7321
|
+
error_type: external_exports.literal("pcb_pad_pad_clearance_error").default("pcb_pad_pad_clearance_error"),
|
|
7322
|
+
pcb_pad_ids: external_exports.array(external_exports.string()).min(2),
|
|
7323
|
+
minimum_clearance: distance.optional(),
|
|
7324
|
+
actual_clearance: distance.optional(),
|
|
7325
|
+
center: external_exports.object({
|
|
7326
|
+
x: external_exports.number().optional(),
|
|
7327
|
+
y: external_exports.number().optional()
|
|
7328
|
+
}).optional(),
|
|
7329
|
+
subcircuit_id: external_exports.string().optional()
|
|
7330
|
+
}).describe("Error emitted when pads are closer than the allowed clearance");
|
|
7331
|
+
expectTypesMatch(true);
|
|
7332
|
+
var pcb_pad_trace_clearance_error = base_circuit_json_error.extend({
|
|
7333
|
+
type: external_exports.literal("pcb_pad_trace_clearance_error"),
|
|
7334
|
+
pcb_pad_trace_clearance_error_id: getZodPrefixedIdWithDefault(
|
|
7335
|
+
"pcb_pad_trace_clearance_error"
|
|
7336
|
+
),
|
|
7337
|
+
error_type: external_exports.literal("pcb_pad_trace_clearance_error").default("pcb_pad_trace_clearance_error"),
|
|
7338
|
+
pcb_pad_id: external_exports.string(),
|
|
7339
|
+
pcb_trace_id: external_exports.string(),
|
|
7340
|
+
minimum_clearance: distance.optional(),
|
|
7341
|
+
actual_clearance: distance.optional(),
|
|
7342
|
+
center: external_exports.object({
|
|
7343
|
+
x: external_exports.number().optional(),
|
|
7344
|
+
y: external_exports.number().optional()
|
|
7345
|
+
}).optional(),
|
|
7346
|
+
subcircuit_id: external_exports.string().optional()
|
|
7347
|
+
}).describe(
|
|
7348
|
+
"Error emitted when a pad and trace are closer than allowed clearance"
|
|
7349
|
+
);
|
|
7350
|
+
expectTypesMatch(
|
|
7351
|
+
true
|
|
7352
|
+
);
|
|
7074
7353
|
var pcb_courtyard_rect = external_exports.object({
|
|
7075
7354
|
type: external_exports.literal("pcb_courtyard_rect"),
|
|
7076
7355
|
pcb_courtyard_rect_id: getZodPrefixedIdWithDefault("pcb_courtyard_rect"),
|
|
@@ -7124,6 +7403,20 @@ var pcb_courtyard_circle = external_exports.object({
|
|
|
7124
7403
|
color: external_exports.string().optional()
|
|
7125
7404
|
}).describe("Defines a courtyard circle on the PCB");
|
|
7126
7405
|
expectTypesMatch(true);
|
|
7406
|
+
var pcb_courtyard_pill = external_exports.object({
|
|
7407
|
+
type: external_exports.literal("pcb_courtyard_pill"),
|
|
7408
|
+
pcb_courtyard_pill_id: getZodPrefixedIdWithDefault("pcb_courtyard_pill"),
|
|
7409
|
+
pcb_component_id: external_exports.string(),
|
|
7410
|
+
pcb_group_id: external_exports.string().optional(),
|
|
7411
|
+
subcircuit_id: external_exports.string().optional(),
|
|
7412
|
+
center: point,
|
|
7413
|
+
width: length,
|
|
7414
|
+
height: length,
|
|
7415
|
+
radius: length,
|
|
7416
|
+
layer: visible_layer,
|
|
7417
|
+
color: external_exports.string().optional()
|
|
7418
|
+
}).describe("Defines a courtyard pill on the PCB");
|
|
7419
|
+
expectTypesMatch(true);
|
|
7127
7420
|
var cad_model_formats = [
|
|
7128
7421
|
"obj",
|
|
7129
7422
|
"stl",
|
|
@@ -7184,6 +7477,7 @@ var cad_component = external_exports.object({
|
|
|
7184
7477
|
model_object_fit: external_exports.enum(["contain_within_bounds", "fill_bounds"]).optional().default("contain_within_bounds"),
|
|
7185
7478
|
model_jscad: external_exports.any().optional(),
|
|
7186
7479
|
show_as_translucent_model: external_exports.boolean().optional(),
|
|
7480
|
+
show_as_bounding_box: external_exports.boolean().optional(),
|
|
7187
7481
|
anchor_alignment: external_exports.enum(["center", "center_of_component_on_board_surface"]).optional().default("center")
|
|
7188
7482
|
}).describe("Defines a component on the PCB");
|
|
7189
7483
|
expectTypesMatch(true);
|
|
@@ -7226,7 +7520,12 @@ var simulation_ac_voltage_source = external_exports.object({
|
|
|
7226
7520
|
peak_to_peak_voltage: voltage.optional(),
|
|
7227
7521
|
wave_shape: wave_shape.optional(),
|
|
7228
7522
|
phase: rotation.optional(),
|
|
7229
|
-
duty_cycle: percentage.optional()
|
|
7523
|
+
duty_cycle: percentage.optional(),
|
|
7524
|
+
pulse_delay: ms.optional(),
|
|
7525
|
+
rise_time: ms.optional(),
|
|
7526
|
+
fall_time: ms.optional(),
|
|
7527
|
+
pulse_width: ms.optional(),
|
|
7528
|
+
period: ms.optional()
|
|
7230
7529
|
}).describe("Defines an AC voltage source for simulation");
|
|
7231
7530
|
var simulation_voltage_source = external_exports.union([simulation_dc_voltage_source, simulation_ac_voltage_source]).describe("Defines a voltage source for simulation");
|
|
7232
7531
|
expectTypesMatch(true);
|
|
@@ -7282,6 +7581,12 @@ var experiment_type = external_exports.union([
|
|
|
7282
7581
|
external_exports.literal("spice_transient_analysis"),
|
|
7283
7582
|
external_exports.literal("spice_ac_analysis")
|
|
7284
7583
|
]);
|
|
7584
|
+
var spice_simulation_options = external_exports.object({
|
|
7585
|
+
method: external_exports.enum(["trap", "gear"]).optional(),
|
|
7586
|
+
reltol: external_exports.union([external_exports.number(), external_exports.string()]).optional(),
|
|
7587
|
+
abstol: external_exports.union([external_exports.number(), external_exports.string()]).optional(),
|
|
7588
|
+
vntol: external_exports.union([external_exports.number(), external_exports.string()]).optional()
|
|
7589
|
+
}).describe("SPICE solver options for a simulation experiment");
|
|
7285
7590
|
var simulation_experiment = external_exports.object({
|
|
7286
7591
|
type: external_exports.literal("simulation_experiment"),
|
|
7287
7592
|
simulation_experiment_id: getZodPrefixedIdWithDefault(
|
|
@@ -7291,7 +7596,8 @@ var simulation_experiment = external_exports.object({
|
|
|
7291
7596
|
experiment_type,
|
|
7292
7597
|
time_per_step: duration_ms.optional(),
|
|
7293
7598
|
start_time_ms: ms.optional(),
|
|
7294
|
-
end_time_ms: ms.optional()
|
|
7599
|
+
end_time_ms: ms.optional(),
|
|
7600
|
+
spice_options: spice_simulation_options.optional()
|
|
7295
7601
|
}).describe("Defines a simulation experiment configuration");
|
|
7296
7602
|
expectTypesMatch(true);
|
|
7297
7603
|
var simulation_transient_voltage_graph = external_exports.object({
|
|
@@ -7311,6 +7617,23 @@ var simulation_transient_voltage_graph = external_exports.object({
|
|
|
7311
7617
|
color: external_exports.string().optional()
|
|
7312
7618
|
}).describe("Stores voltage measurements over time for a simulation");
|
|
7313
7619
|
expectTypesMatch(true);
|
|
7620
|
+
var simulation_transient_current_graph = external_exports.object({
|
|
7621
|
+
type: external_exports.literal("simulation_transient_current_graph"),
|
|
7622
|
+
simulation_transient_current_graph_id: getZodPrefixedIdWithDefault(
|
|
7623
|
+
"simulation_transient_current_graph"
|
|
7624
|
+
),
|
|
7625
|
+
simulation_experiment_id: external_exports.string(),
|
|
7626
|
+
timestamps_ms: external_exports.array(external_exports.number()).optional(),
|
|
7627
|
+
current_levels: external_exports.array(external_exports.number()),
|
|
7628
|
+
source_component_id: external_exports.string().optional(),
|
|
7629
|
+
subcircuit_connectivity_map_key: external_exports.string().optional(),
|
|
7630
|
+
time_per_step: duration_ms,
|
|
7631
|
+
start_time_ms: ms,
|
|
7632
|
+
end_time_ms: ms,
|
|
7633
|
+
name: external_exports.string().optional(),
|
|
7634
|
+
color: external_exports.string().optional()
|
|
7635
|
+
}).describe("Stores current measurements over time for a simulation");
|
|
7636
|
+
expectTypesMatch(true);
|
|
7314
7637
|
var simulation_switch = external_exports.object({
|
|
7315
7638
|
type: external_exports.literal("simulation_switch"),
|
|
7316
7639
|
simulation_switch_id: getZodPrefixedIdWithDefault("simulation_switch"),
|
|
@@ -7321,6 +7644,12 @@ var simulation_switch = external_exports.object({
|
|
|
7321
7644
|
switching_frequency: frequency.optional()
|
|
7322
7645
|
}).describe("Defines a switch for simulation timing control");
|
|
7323
7646
|
expectTypesMatch(true);
|
|
7647
|
+
var simulation_voltage_probe_display_options = external_exports.object({
|
|
7648
|
+
label: external_exports.string().optional(),
|
|
7649
|
+
center: external_exports.number().optional(),
|
|
7650
|
+
offset_divs: external_exports.number().optional(),
|
|
7651
|
+
units_per_div: external_exports.number().optional()
|
|
7652
|
+
});
|
|
7324
7653
|
var simulation_voltage_probe = external_exports.object({
|
|
7325
7654
|
type: external_exports.literal("simulation_voltage_probe"),
|
|
7326
7655
|
simulation_voltage_probe_id: getZodPrefixedIdWithDefault(
|
|
@@ -7333,7 +7662,8 @@ var simulation_voltage_probe = external_exports.object({
|
|
|
7333
7662
|
reference_input_source_port_id: external_exports.string().optional(),
|
|
7334
7663
|
reference_input_source_net_id: external_exports.string().optional(),
|
|
7335
7664
|
subcircuit_id: external_exports.string().optional(),
|
|
7336
|
-
color: external_exports.string().optional()
|
|
7665
|
+
color: external_exports.string().optional(),
|
|
7666
|
+
display_options: simulation_voltage_probe_display_options.optional()
|
|
7337
7667
|
}).describe(
|
|
7338
7668
|
"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."
|
|
7339
7669
|
).superRefine((data, ctx) => {
|
|
@@ -7371,6 +7701,68 @@ var simulation_voltage_probe = external_exports.object({
|
|
|
7371
7701
|
}
|
|
7372
7702
|
});
|
|
7373
7703
|
expectTypesMatch(true);
|
|
7704
|
+
expectTypesMatch(true);
|
|
7705
|
+
var simulation_current_probe_display_options = external_exports.object({
|
|
7706
|
+
label: external_exports.string().optional(),
|
|
7707
|
+
center: external_exports.number().optional(),
|
|
7708
|
+
offset_divs: external_exports.number().optional(),
|
|
7709
|
+
units_per_div: external_exports.number().optional()
|
|
7710
|
+
});
|
|
7711
|
+
var simulation_current_probe = external_exports.object({
|
|
7712
|
+
type: external_exports.literal("simulation_current_probe"),
|
|
7713
|
+
simulation_current_probe_id: getZodPrefixedIdWithDefault(
|
|
7714
|
+
"simulation_current_probe"
|
|
7715
|
+
),
|
|
7716
|
+
source_component_id: external_exports.string().optional(),
|
|
7717
|
+
name: external_exports.string().optional(),
|
|
7718
|
+
positive_source_port_id: external_exports.string().optional(),
|
|
7719
|
+
negative_source_port_id: external_exports.string().optional(),
|
|
7720
|
+
positive_source_net_id: external_exports.string().optional(),
|
|
7721
|
+
negative_source_net_id: external_exports.string().optional(),
|
|
7722
|
+
subcircuit_id: external_exports.string().optional(),
|
|
7723
|
+
color: external_exports.string().optional(),
|
|
7724
|
+
display_options: simulation_current_probe_display_options.optional()
|
|
7725
|
+
}).describe(
|
|
7726
|
+
"Defines a current probe for simulation. It measures current flowing from the positive endpoint to the negative endpoint."
|
|
7727
|
+
).superRefine((data, ctx) => {
|
|
7728
|
+
const hasPositivePort = !!data.positive_source_port_id;
|
|
7729
|
+
const hasNegativePort = !!data.negative_source_port_id;
|
|
7730
|
+
const hasPositiveNet = !!data.positive_source_net_id;
|
|
7731
|
+
const hasNegativeNet = !!data.negative_source_net_id;
|
|
7732
|
+
const hasPorts = hasPositivePort || hasNegativePort;
|
|
7733
|
+
const hasNets = hasPositiveNet || hasNegativeNet;
|
|
7734
|
+
if (hasPorts && hasNets) {
|
|
7735
|
+
ctx.addIssue({
|
|
7736
|
+
code: external_exports.ZodIssueCode.custom,
|
|
7737
|
+
message: "Cannot mix port and net connections in a current probe."
|
|
7738
|
+
});
|
|
7739
|
+
return;
|
|
7740
|
+
}
|
|
7741
|
+
if (hasPorts) {
|
|
7742
|
+
if (!hasPositivePort || !hasNegativePort) {
|
|
7743
|
+
ctx.addIssue({
|
|
7744
|
+
code: external_exports.ZodIssueCode.custom,
|
|
7745
|
+
message: "Current probe using source ports requires both positive_source_port_id and negative_source_port_id."
|
|
7746
|
+
});
|
|
7747
|
+
}
|
|
7748
|
+
return;
|
|
7749
|
+
}
|
|
7750
|
+
if (hasNets) {
|
|
7751
|
+
if (!hasPositiveNet || !hasNegativeNet) {
|
|
7752
|
+
ctx.addIssue({
|
|
7753
|
+
code: external_exports.ZodIssueCode.custom,
|
|
7754
|
+
message: "Current probe using source nets requires both positive_source_net_id and negative_source_net_id."
|
|
7755
|
+
});
|
|
7756
|
+
}
|
|
7757
|
+
return;
|
|
7758
|
+
}
|
|
7759
|
+
ctx.addIssue({
|
|
7760
|
+
code: external_exports.ZodIssueCode.custom,
|
|
7761
|
+
message: "A current probe must have either positive/negative source port ids or positive/negative source net ids."
|
|
7762
|
+
});
|
|
7763
|
+
});
|
|
7764
|
+
expectTypesMatch(true);
|
|
7765
|
+
expectTypesMatch(true);
|
|
7374
7766
|
var simulation_unknown_experiment_error = base_circuit_json_error.extend({
|
|
7375
7767
|
type: external_exports.literal("simulation_unknown_experiment_error"),
|
|
7376
7768
|
simulation_unknown_experiment_error_id: getZodPrefixedIdWithDefault(
|
|
@@ -7392,6 +7784,18 @@ var simulation_op_amp = external_exports.object({
|
|
|
7392
7784
|
negative_supply_source_port_id: external_exports.string()
|
|
7393
7785
|
}).describe("Defines a simple ideal operational amplifier for simulation");
|
|
7394
7786
|
expectTypesMatch(true);
|
|
7787
|
+
var simulation_spice_subcircuit = external_exports.object({
|
|
7788
|
+
type: external_exports.literal("simulation_spice_subcircuit"),
|
|
7789
|
+
simulation_spice_subcircuit_id: getZodPrefixedIdWithDefault(
|
|
7790
|
+
"simulation_spice_subcircuit"
|
|
7791
|
+
),
|
|
7792
|
+
source_component_id: external_exports.string(),
|
|
7793
|
+
spice_pin_to_source_port_map: external_exports.record(external_exports.string(), external_exports.string()),
|
|
7794
|
+
subcircuit_source: external_exports.string()
|
|
7795
|
+
}).describe("Defines a custom SPICE subcircuit model for simulation");
|
|
7796
|
+
expectTypesMatch(
|
|
7797
|
+
true
|
|
7798
|
+
);
|
|
7395
7799
|
var any_circuit_element = external_exports.union([
|
|
7396
7800
|
source_trace,
|
|
7397
7801
|
source_port,
|
|
@@ -7424,12 +7828,14 @@ var any_circuit_element = external_exports.union([
|
|
|
7424
7828
|
source_invalid_component_property_error,
|
|
7425
7829
|
source_trace_not_connected_error,
|
|
7426
7830
|
source_pin_missing_trace_warning,
|
|
7831
|
+
source_missing_manufacturer_part_number_warning,
|
|
7427
7832
|
source_no_power_pin_defined_warning,
|
|
7428
7833
|
source_no_ground_pin_defined_warning,
|
|
7429
7834
|
source_component_pins_underspecified_warning,
|
|
7430
7835
|
source_pin_must_be_connected_error,
|
|
7431
7836
|
unknown_error_finding_part,
|
|
7432
7837
|
source_i2c_misconfigured_error,
|
|
7838
|
+
source_component_misconfigured_error,
|
|
7433
7839
|
source_ambiguous_port_reference,
|
|
7434
7840
|
pcb_component,
|
|
7435
7841
|
pcb_hole,
|
|
@@ -7438,12 +7844,14 @@ var any_circuit_element = external_exports.union([
|
|
|
7438
7844
|
circuit_json_footprint_load_error,
|
|
7439
7845
|
pcb_manual_edit_conflict_warning,
|
|
7440
7846
|
pcb_connector_not_in_accessible_orientation_warning,
|
|
7847
|
+
supplier_footprint_mismatch_warning,
|
|
7441
7848
|
pcb_plated_hole,
|
|
7442
7849
|
pcb_keepout,
|
|
7443
7850
|
pcb_port,
|
|
7444
7851
|
pcb_net,
|
|
7445
7852
|
pcb_text,
|
|
7446
7853
|
pcb_trace,
|
|
7854
|
+
pcb_trace_warning,
|
|
7447
7855
|
pcb_via,
|
|
7448
7856
|
pcb_smtpad,
|
|
7449
7857
|
pcb_solder_paste,
|
|
@@ -7459,6 +7867,7 @@ var any_circuit_element = external_exports.union([
|
|
|
7459
7867
|
pcb_silkscreen_rect,
|
|
7460
7868
|
pcb_silkscreen_circle,
|
|
7461
7869
|
pcb_silkscreen_oval,
|
|
7870
|
+
pcb_silkscreen_graphic,
|
|
7462
7871
|
pcb_trace_error,
|
|
7463
7872
|
pcb_trace_missing_error,
|
|
7464
7873
|
pcb_placement_error,
|
|
@@ -7466,6 +7875,9 @@ var any_circuit_element = external_exports.union([
|
|
|
7466
7875
|
pcb_port_not_matched_error,
|
|
7467
7876
|
pcb_port_not_connected_error,
|
|
7468
7877
|
pcb_via_clearance_error,
|
|
7878
|
+
pcb_via_trace_clearance_error,
|
|
7879
|
+
pcb_pad_pad_clearance_error,
|
|
7880
|
+
pcb_pad_trace_clearance_error,
|
|
7469
7881
|
pcb_fabrication_note_path,
|
|
7470
7882
|
pcb_fabrication_note_text,
|
|
7471
7883
|
pcb_fabrication_note_rect,
|
|
@@ -7491,6 +7903,7 @@ var any_circuit_element = external_exports.union([
|
|
|
7491
7903
|
pcb_courtyard_outline,
|
|
7492
7904
|
pcb_courtyard_polygon,
|
|
7493
7905
|
pcb_courtyard_circle,
|
|
7906
|
+
pcb_courtyard_pill,
|
|
7494
7907
|
schematic_box,
|
|
7495
7908
|
schematic_text,
|
|
7496
7909
|
schematic_line,
|
|
@@ -7517,10 +7930,13 @@ var any_circuit_element = external_exports.union([
|
|
|
7517
7930
|
simulation_current_source,
|
|
7518
7931
|
simulation_experiment,
|
|
7519
7932
|
simulation_transient_voltage_graph,
|
|
7933
|
+
simulation_transient_current_graph,
|
|
7520
7934
|
simulation_switch,
|
|
7521
7935
|
simulation_voltage_probe,
|
|
7936
|
+
simulation_current_probe,
|
|
7522
7937
|
simulation_unknown_experiment_error,
|
|
7523
|
-
simulation_op_amp
|
|
7938
|
+
simulation_op_amp,
|
|
7939
|
+
simulation_spice_subcircuit
|
|
7524
7940
|
]);
|
|
7525
7941
|
var any_soup_element = any_circuit_element;
|
|
7526
7942
|
expectTypesMatch(true);
|
|
@@ -8590,9 +9006,52 @@ var cjuIndexed = ((soup, options = {}) => {
|
|
|
8590
9006
|
return suIndexed;
|
|
8591
9007
|
});
|
|
8592
9008
|
cjuIndexed.unparsed = cjuIndexed;
|
|
9009
|
+
var getQuarterTurns = (angleRadians) => Math.round(angleRadians / (Math.PI / 2));
|
|
9010
|
+
var insertionDirectionToVec = (direction) => {
|
|
9011
|
+
switch (direction) {
|
|
9012
|
+
case "from_left":
|
|
9013
|
+
return { x: -1, y: 0 };
|
|
9014
|
+
case "from_right":
|
|
9015
|
+
return { x: 1, y: 0 };
|
|
9016
|
+
case "from_front":
|
|
9017
|
+
return { x: 0, y: 1 };
|
|
9018
|
+
case "from_back":
|
|
9019
|
+
return { x: 0, y: -1 };
|
|
9020
|
+
}
|
|
9021
|
+
};
|
|
9022
|
+
var vecToInsertionDirection = ({
|
|
9023
|
+
x,
|
|
9024
|
+
y
|
|
9025
|
+
}) => {
|
|
9026
|
+
if (x > 0) return "from_right";
|
|
9027
|
+
if (x < 0) return "from_left";
|
|
9028
|
+
if (y > 0) return "from_front";
|
|
9029
|
+
return "from_back";
|
|
9030
|
+
};
|
|
9031
|
+
var transformInsertionDirection = (direction, opts) => {
|
|
9032
|
+
if (!direction || direction === "from_above") return direction;
|
|
9033
|
+
let { x, y } = insertionDirectionToVec(direction);
|
|
9034
|
+
let quarterTurns = Math.round(opts.rotationDegrees / 90);
|
|
9035
|
+
while (quarterTurns > 0) {
|
|
9036
|
+
;
|
|
9037
|
+
[x, y] = [-y, x];
|
|
9038
|
+
quarterTurns--;
|
|
9039
|
+
}
|
|
9040
|
+
while (quarterTurns < 0) {
|
|
9041
|
+
;
|
|
9042
|
+
[x, y] = [y, -x];
|
|
9043
|
+
quarterTurns++;
|
|
9044
|
+
}
|
|
9045
|
+
if (opts.isFlipped) {
|
|
9046
|
+
y = -y;
|
|
9047
|
+
}
|
|
9048
|
+
return vecToInsertionDirection({ x, y });
|
|
9049
|
+
};
|
|
8593
9050
|
var transformPCBElement = (elm, matrix) => {
|
|
8594
9051
|
const tsr = decomposeTSR(matrix);
|
|
8595
|
-
const flipPadWidthHeight = Math.
|
|
9052
|
+
const flipPadWidthHeight = Math.abs(getQuarterTurns(tsr.rotation.angle)) % 2 === 1;
|
|
9053
|
+
const rotationDegrees = tsr.rotation.angle / Math.PI * 180;
|
|
9054
|
+
const isFlipped = tsr.scale.sy < 0;
|
|
8596
9055
|
if (elm.type === "pcb_plated_hole" || elm.type === "pcb_hole" || elm.type === "pcb_via" || elm.type === "pcb_smtpad" || elm.type === "pcb_port") {
|
|
8597
9056
|
const { x, y } = applyToPoint(matrix, {
|
|
8598
9057
|
x: Number(elm.x),
|
|
@@ -8613,12 +9072,28 @@ var transformPCBElement = (elm, matrix) => {
|
|
|
8613
9072
|
elm.center = applyToPoint(matrix, elm.center);
|
|
8614
9073
|
} else if (elm.type === "pcb_silkscreen_text" || elm.type === "pcb_fabrication_note_text" || elm.type === "pcb_note_text") {
|
|
8615
9074
|
elm.anchor_position = applyToPoint(matrix, elm.anchor_position);
|
|
8616
|
-
} else if (elm.type === "
|
|
9075
|
+
} else if (elm.type === "pcb_courtyard_rect") {
|
|
9076
|
+
elm.center = applyToPoint(matrix, elm.center);
|
|
9077
|
+
elm.ccw_rotation = ((elm.ccw_rotation ?? 0) + rotationDegrees) % 360;
|
|
9078
|
+
} else if (elm.type === "pcb_silkscreen_circle" || elm.type === "pcb_silkscreen_rect" || elm.type === "pcb_note_rect" || elm.type === "pcb_courtyard_circle") {
|
|
8617
9079
|
elm.center = applyToPoint(matrix, elm.center);
|
|
8618
9080
|
} else if (elm.type === "pcb_component") {
|
|
8619
9081
|
elm.center = applyToPoint(matrix, elm.center);
|
|
8620
|
-
elm.rotation = elm.rotation +
|
|
9082
|
+
elm.rotation = elm.rotation + rotationDegrees;
|
|
8621
9083
|
elm.rotation = elm.rotation % 360;
|
|
9084
|
+
if (elm.cable_insertion_center) {
|
|
9085
|
+
elm.cable_insertion_center = applyToPoint(
|
|
9086
|
+
matrix,
|
|
9087
|
+
elm.cable_insertion_center
|
|
9088
|
+
);
|
|
9089
|
+
}
|
|
9090
|
+
elm.insertion_direction = transformInsertionDirection(
|
|
9091
|
+
elm.insertion_direction,
|
|
9092
|
+
{
|
|
9093
|
+
rotationDegrees,
|
|
9094
|
+
isFlipped
|
|
9095
|
+
}
|
|
9096
|
+
);
|
|
8622
9097
|
if (flipPadWidthHeight) {
|
|
8623
9098
|
;
|
|
8624
9099
|
[elm.width, elm.height] = [elm.height, elm.width];
|
|
@@ -8665,7 +9140,7 @@ var transformPCBElement = (elm, matrix) => {
|
|
|
8665
9140
|
};
|
|
8666
9141
|
var transformPCBElements = (elms, matrix) => {
|
|
8667
9142
|
const tsr = decomposeTSR(matrix);
|
|
8668
|
-
const quarterTurns =
|
|
9143
|
+
const quarterTurns = getQuarterTurns(tsr.rotation.angle);
|
|
8669
9144
|
const flipPadWidthHeight = Math.abs(quarterTurns) % 2 === 1;
|
|
8670
9145
|
let transformedElms = elms.map((elm) => transformPCBElement(elm, matrix));
|
|
8671
9146
|
if (flipPadWidthHeight) {
|
|
@@ -8828,6 +9303,16 @@ var getDebugLayoutObject = (lo) => {
|
|
|
8828
9303
|
if ("outer_diameter" in lo) {
|
|
8829
9304
|
width = lo.outer_diameter;
|
|
8830
9305
|
height = lo.outer_diameter;
|
|
9306
|
+
} else if ("rect_pad_width" in lo && "rect_pad_height" in lo) {
|
|
9307
|
+
width = lo.rect_pad_width;
|
|
9308
|
+
height = lo.rect_pad_height;
|
|
9309
|
+
if ("hole_diameter" in lo) {
|
|
9310
|
+
width = Math.max(width, lo.hole_diameter);
|
|
9311
|
+
height = Math.max(height, lo.hole_diameter);
|
|
9312
|
+
}
|
|
9313
|
+
} else if ("hole_diameter" in lo) {
|
|
9314
|
+
width = lo.hole_diameter;
|
|
9315
|
+
height = lo.hole_diameter;
|
|
8831
9316
|
}
|
|
8832
9317
|
}
|
|
8833
9318
|
if (width === void 0 || height === void 0) {
|