circuit-json 0.0.530 → 0.0.532
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 +530 -286
- package/dist/index.d.mts +1245 -4
- package/dist/index.mjs +1202 -1003
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -2
package/dist/index.mjs
CHANGED
|
@@ -3225,24 +3225,74 @@ var pcb_board = z140.object({
|
|
|
3225
3225
|
}).merge(manufacturing_drc_properties).describe("Defines the board outline of the PCB");
|
|
3226
3226
|
expectTypesMatch(true);
|
|
3227
3227
|
|
|
3228
|
-
// src/pcb/
|
|
3228
|
+
// src/pcb/pcb_stackup.ts
|
|
3229
3229
|
import { z as z141 } from "zod";
|
|
3230
|
+
var positive_length = length.pipe(z141.number().finite().positive());
|
|
3231
|
+
var nonnegative_length = length.pipe(z141.number().finite().nonnegative());
|
|
3232
|
+
var positive_number = z141.number().finite().positive();
|
|
3233
|
+
var nonnegative_number = z141.number().finite().nonnegative();
|
|
3234
|
+
var pcb_stackup_soldermask_layer = z141.object({
|
|
3235
|
+
layer_type: z141.literal("soldermask").describe("Soldermask layer"),
|
|
3236
|
+
thickness: positive_length.optional().describe("Soldermask thickness in mm, omitted when unknown"),
|
|
3237
|
+
relative_permittivity: positive_number.optional().describe("Soldermask relative permittivity")
|
|
3238
|
+
});
|
|
3239
|
+
expectTypesMatch(true);
|
|
3240
|
+
var pcb_stackup_copper_layer = z141.object({
|
|
3241
|
+
layer_type: z141.literal("copper").describe("Copper layer"),
|
|
3242
|
+
layer: layer_ref.describe("PCB copper layer, such as top, inner1 or bottom"),
|
|
3243
|
+
thickness: positive_length.describe("Copper thickness in mm"),
|
|
3244
|
+
electrical_conductivity_s_per_m: positive_number.optional().describe(
|
|
3245
|
+
"Electrical conductivity in S/m, consumers may assume 5.8e7 (annealed copper) when omitted"
|
|
3246
|
+
),
|
|
3247
|
+
rms_surface_roughness: nonnegative_length.optional().describe("RMS copper surface roughness in mm")
|
|
3248
|
+
});
|
|
3249
|
+
expectTypesMatch(true);
|
|
3250
|
+
var pcb_stackup_dielectric_layer = z141.object({
|
|
3251
|
+
layer_type: z141.literal("dielectric").describe("Dielectric layer"),
|
|
3252
|
+
dielectric_type: z141.enum(["core", "prepreg"]).optional().describe("Core or prepreg construction"),
|
|
3253
|
+
material_name: z141.string().optional().describe("Fabricator material name, such as FR-4 or 7628"),
|
|
3254
|
+
thickness: positive_length.describe("Dielectric thickness in mm"),
|
|
3255
|
+
relative_permittivity: positive_number.optional().describe("Dielectric relative permittivity, Dk"),
|
|
3256
|
+
loss_tangent: nonnegative_number.optional().describe("Dielectric loss tangent, Df"),
|
|
3257
|
+
dielectric_properties_frequency_hz: positive_number.optional().describe(
|
|
3258
|
+
"Frequency in Hz at which relative_permittivity and loss_tangent were measured"
|
|
3259
|
+
)
|
|
3260
|
+
});
|
|
3261
|
+
expectTypesMatch(true);
|
|
3262
|
+
var pcb_stackup_layer = z141.discriminatedUnion("layer_type", [
|
|
3263
|
+
pcb_stackup_soldermask_layer,
|
|
3264
|
+
pcb_stackup_copper_layer,
|
|
3265
|
+
pcb_stackup_dielectric_layer
|
|
3266
|
+
]);
|
|
3267
|
+
expectTypesMatch(true);
|
|
3268
|
+
var pcb_stackup = z141.object({
|
|
3269
|
+
type: z141.literal("pcb_stackup"),
|
|
3270
|
+
pcb_stackup_id: getZodPrefixedIdWithDefault("pcb_stackup"),
|
|
3271
|
+
pcb_board_id: z141.string().describe("Board described by this stackup"),
|
|
3272
|
+
subcircuit_id: z141.string().optional(),
|
|
3273
|
+
plated_hole_copper_thickness: positive_length.optional().describe("Copper thickness of plated hole and via barrel walls in mm"),
|
|
3274
|
+
layers: z141.array(pcb_stackup_layer).min(1).describe("Physical layers ordered from top to bottom")
|
|
3275
|
+
}).describe("Physical layer construction and material data for a PCB board");
|
|
3276
|
+
expectTypesMatch(true);
|
|
3277
|
+
|
|
3278
|
+
// src/pcb/pcb_bend.ts
|
|
3279
|
+
import { z as z142 } from "zod";
|
|
3230
3280
|
var finite_point = point.extend({
|
|
3231
|
-
x: length.pipe(
|
|
3232
|
-
y: length.pipe(
|
|
3281
|
+
x: length.pipe(z142.number().finite()),
|
|
3282
|
+
y: length.pipe(z142.number().finite())
|
|
3233
3283
|
});
|
|
3234
|
-
var pcb_bend =
|
|
3235
|
-
type:
|
|
3284
|
+
var pcb_bend = z142.object({
|
|
3285
|
+
type: z142.literal("pcb_bend"),
|
|
3236
3286
|
pcb_bend_id: getZodPrefixedIdWithDefault("pcb_bend"),
|
|
3237
|
-
pcb_board_id:
|
|
3238
|
-
pcb_group_id:
|
|
3239
|
-
subcircuit_id:
|
|
3240
|
-
name:
|
|
3287
|
+
pcb_board_id: z142.string(),
|
|
3288
|
+
pcb_group_id: z142.string().optional(),
|
|
3289
|
+
subcircuit_id: z142.string().optional(),
|
|
3290
|
+
name: z142.string().optional(),
|
|
3241
3291
|
start: finite_point,
|
|
3242
3292
|
end: finite_point,
|
|
3243
|
-
bend_angle: rotation.pipe(
|
|
3244
|
-
bend_radius: length.pipe(
|
|
3245
|
-
bend_side:
|
|
3293
|
+
bend_angle: rotation.pipe(z142.number().finite()),
|
|
3294
|
+
bend_radius: length.pipe(z142.number().finite().positive()),
|
|
3295
|
+
bend_side: z142.enum(["left", "right"])
|
|
3246
3296
|
}).refine(({ start, end }) => start.x !== end.x || start.y !== end.y, {
|
|
3247
3297
|
message: "Bend centerline endpoints must be distinct",
|
|
3248
3298
|
path: ["end"]
|
|
@@ -3252,123 +3302,123 @@ var pcb_bend = z141.object({
|
|
|
3252
3302
|
expectTypesMatch(true);
|
|
3253
3303
|
|
|
3254
3304
|
// src/pcb/pcb_stiffener.ts
|
|
3255
|
-
import { z as
|
|
3256
|
-
var
|
|
3305
|
+
import { z as z143 } from "zod";
|
|
3306
|
+
var positive_length2 = length.pipe(z143.number().finite().positive());
|
|
3257
3307
|
var finite_point2 = point.extend({
|
|
3258
|
-
x: length.pipe(
|
|
3259
|
-
y: length.pipe(
|
|
3308
|
+
x: length.pipe(z143.number().finite()),
|
|
3309
|
+
y: length.pipe(z143.number().finite())
|
|
3260
3310
|
});
|
|
3261
|
-
var pcb_stiffener_base =
|
|
3262
|
-
type:
|
|
3311
|
+
var pcb_stiffener_base = z143.object({
|
|
3312
|
+
type: z143.literal("pcb_stiffener"),
|
|
3263
3313
|
pcb_stiffener_id: getZodPrefixedIdWithDefault("pcb_stiffener"),
|
|
3264
|
-
pcb_board_id:
|
|
3265
|
-
pcb_group_id:
|
|
3266
|
-
subcircuit_id:
|
|
3267
|
-
name:
|
|
3268
|
-
layer:
|
|
3269
|
-
material:
|
|
3270
|
-
thickness:
|
|
3271
|
-
adhesive_thickness: length.pipe(
|
|
3314
|
+
pcb_board_id: z143.string(),
|
|
3315
|
+
pcb_group_id: z143.string().optional(),
|
|
3316
|
+
subcircuit_id: z143.string().optional(),
|
|
3317
|
+
name: z143.string().optional(),
|
|
3318
|
+
layer: z143.enum(["top", "bottom"]),
|
|
3319
|
+
material: z143.enum(["fr4", "polyimide", "stainless_steel", "aluminum"]),
|
|
3320
|
+
thickness: positive_length2,
|
|
3321
|
+
adhesive_thickness: length.pipe(z143.number().finite().nonnegative()).optional()
|
|
3272
3322
|
});
|
|
3273
3323
|
var pcb_stiffener_rect = pcb_stiffener_base.extend({
|
|
3274
|
-
shape:
|
|
3324
|
+
shape: z143.literal("rect"),
|
|
3275
3325
|
center: finite_point2,
|
|
3276
|
-
rotation: rotation.pipe(
|
|
3277
|
-
width:
|
|
3278
|
-
height:
|
|
3279
|
-
outline:
|
|
3326
|
+
rotation: rotation.pipe(z143.number().finite()).optional(),
|
|
3327
|
+
width: positive_length2,
|
|
3328
|
+
height: positive_length2,
|
|
3329
|
+
outline: z143.never().optional()
|
|
3280
3330
|
});
|
|
3281
3331
|
expectTypesMatch(true);
|
|
3282
3332
|
var pcb_stiffener_polygon = pcb_stiffener_base.extend({
|
|
3283
|
-
shape:
|
|
3284
|
-
outline:
|
|
3333
|
+
shape: z143.literal("polygon"),
|
|
3334
|
+
outline: z143.array(finite_point2).min(3).refine((points) => {
|
|
3285
3335
|
const twice_area = points.reduce((sum, p, i) => {
|
|
3286
3336
|
const next = points[(i + 1) % points.length];
|
|
3287
3337
|
return sum + p.x * next.y - next.x * p.y;
|
|
3288
3338
|
}, 0);
|
|
3289
3339
|
return Number.isFinite(twice_area) && twice_area !== 0;
|
|
3290
3340
|
}, "Stiffener outline must enclose a nonzero area"),
|
|
3291
|
-
center:
|
|
3292
|
-
rotation:
|
|
3293
|
-
width:
|
|
3294
|
-
height:
|
|
3341
|
+
center: z143.never().optional(),
|
|
3342
|
+
rotation: z143.never().optional(),
|
|
3343
|
+
width: z143.never().optional(),
|
|
3344
|
+
height: z143.never().optional()
|
|
3295
3345
|
});
|
|
3296
3346
|
expectTypesMatch(
|
|
3297
3347
|
true
|
|
3298
3348
|
);
|
|
3299
|
-
var pcb_stiffener =
|
|
3349
|
+
var pcb_stiffener = z143.discriminatedUnion("shape", [pcb_stiffener_rect, pcb_stiffener_polygon]).describe(
|
|
3300
3350
|
"Defines bonded mechanical PCB reinforcement without adding copper layers"
|
|
3301
3351
|
);
|
|
3302
3352
|
expectTypesMatch(true);
|
|
3303
3353
|
|
|
3304
3354
|
// src/pcb/pcb_panel.ts
|
|
3305
|
-
import { z as
|
|
3306
|
-
var pcb_panel =
|
|
3307
|
-
type:
|
|
3355
|
+
import { z as z144 } from "zod";
|
|
3356
|
+
var pcb_panel = z144.object({
|
|
3357
|
+
type: z144.literal("pcb_panel"),
|
|
3308
3358
|
pcb_panel_id: getZodPrefixedIdWithDefault("pcb_panel"),
|
|
3309
3359
|
width: length,
|
|
3310
3360
|
height: length,
|
|
3311
3361
|
center: point,
|
|
3312
3362
|
thickness: length.optional().default(1.4),
|
|
3313
|
-
covered_with_solder_mask:
|
|
3363
|
+
covered_with_solder_mask: z144.boolean().optional().default(true)
|
|
3314
3364
|
}).describe("Defines a PCB panel that can contain multiple boards");
|
|
3315
3365
|
expectTypesMatch(true);
|
|
3316
3366
|
|
|
3317
3367
|
// src/pcb/pcb_placement_error.ts
|
|
3318
|
-
import { z as
|
|
3368
|
+
import { z as z145 } from "zod";
|
|
3319
3369
|
var pcb_placement_error = base_circuit_json_error.extend({
|
|
3320
|
-
type:
|
|
3370
|
+
type: z145.literal("pcb_placement_error"),
|
|
3321
3371
|
pcb_placement_error_id: getZodPrefixedIdWithDefault("pcb_placement_error"),
|
|
3322
|
-
error_type:
|
|
3323
|
-
subcircuit_id:
|
|
3372
|
+
error_type: z145.literal("pcb_placement_error").default("pcb_placement_error"),
|
|
3373
|
+
subcircuit_id: z145.string().optional()
|
|
3324
3374
|
}).describe("Defines a placement error on the PCB");
|
|
3325
3375
|
expectTypesMatch(true);
|
|
3326
3376
|
|
|
3327
3377
|
// src/pcb/pcb_packing_error.ts
|
|
3328
|
-
import { z as
|
|
3378
|
+
import { z as z146 } from "zod";
|
|
3329
3379
|
var pcb_packing_error = base_circuit_json_error.extend({
|
|
3330
|
-
type:
|
|
3380
|
+
type: z146.literal("pcb_packing_error"),
|
|
3331
3381
|
pcb_packing_error_id: getZodPrefixedIdWithDefault("pcb_packing_error"),
|
|
3332
|
-
error_type:
|
|
3333
|
-
pcb_group_id:
|
|
3334
|
-
subcircuit_id:
|
|
3382
|
+
error_type: z146.literal("pcb_packing_error").default("pcb_packing_error"),
|
|
3383
|
+
pcb_group_id: z146.string().optional(),
|
|
3384
|
+
subcircuit_id: z146.string().optional()
|
|
3335
3385
|
}).describe("Defines a failure to pack PCB components within layout bounds");
|
|
3336
3386
|
expectTypesMatch(true);
|
|
3337
3387
|
|
|
3338
3388
|
// src/pcb/pcb_panelization_placement_error.ts
|
|
3339
|
-
import { z as
|
|
3389
|
+
import { z as z147 } from "zod";
|
|
3340
3390
|
var pcb_panelization_placement_error = base_circuit_json_error.extend({
|
|
3341
|
-
type:
|
|
3391
|
+
type: z147.literal("pcb_panelization_placement_error"),
|
|
3342
3392
|
pcb_panelization_placement_error_id: getZodPrefixedIdWithDefault(
|
|
3343
3393
|
"pcb_panelization_placement_error"
|
|
3344
3394
|
),
|
|
3345
|
-
error_type:
|
|
3346
|
-
pcb_panel_id:
|
|
3347
|
-
pcb_board_id:
|
|
3348
|
-
subcircuit_id:
|
|
3395
|
+
error_type: z147.literal("pcb_panelization_placement_error").default("pcb_panelization_placement_error"),
|
|
3396
|
+
pcb_panel_id: z147.string().optional(),
|
|
3397
|
+
pcb_board_id: z147.string().optional(),
|
|
3398
|
+
subcircuit_id: z147.string().optional()
|
|
3349
3399
|
}).describe("Defines a panelization placement error on the PCB");
|
|
3350
3400
|
expectTypesMatch(true);
|
|
3351
3401
|
|
|
3352
3402
|
// src/pcb/pcb_trace_hint.ts
|
|
3353
|
-
import { z as
|
|
3354
|
-
var pcb_trace_hint =
|
|
3355
|
-
type:
|
|
3403
|
+
import { z as z148 } from "zod";
|
|
3404
|
+
var pcb_trace_hint = z148.object({
|
|
3405
|
+
type: z148.literal("pcb_trace_hint"),
|
|
3356
3406
|
pcb_trace_hint_id: getZodPrefixedIdWithDefault("pcb_trace_hint"),
|
|
3357
|
-
pcb_port_id:
|
|
3358
|
-
pcb_component_id:
|
|
3359
|
-
route:
|
|
3360
|
-
subcircuit_id:
|
|
3407
|
+
pcb_port_id: z148.string(),
|
|
3408
|
+
pcb_component_id: z148.string(),
|
|
3409
|
+
route: z148.array(route_hint_point),
|
|
3410
|
+
subcircuit_id: z148.string().optional()
|
|
3361
3411
|
}).describe("A hint that can be used during generation of a PCB trace");
|
|
3362
3412
|
expectTypesMatch(true);
|
|
3363
3413
|
|
|
3364
3414
|
// src/pcb/pcb_silkscreen_line.ts
|
|
3365
|
-
import { z as
|
|
3366
|
-
var pcb_silkscreen_line =
|
|
3367
|
-
type:
|
|
3415
|
+
import { z as z149 } from "zod";
|
|
3416
|
+
var pcb_silkscreen_line = z149.object({
|
|
3417
|
+
type: z149.literal("pcb_silkscreen_line"),
|
|
3368
3418
|
pcb_silkscreen_line_id: getZodPrefixedIdWithDefault("pcb_silkscreen_line"),
|
|
3369
|
-
pcb_component_id:
|
|
3370
|
-
pcb_group_id:
|
|
3371
|
-
subcircuit_id:
|
|
3419
|
+
pcb_component_id: z149.string(),
|
|
3420
|
+
pcb_group_id: z149.string().optional(),
|
|
3421
|
+
subcircuit_id: z149.string().optional(),
|
|
3372
3422
|
stroke_width: distance.default("0.1mm"),
|
|
3373
3423
|
x1: distance,
|
|
3374
3424
|
y1: distance,
|
|
@@ -3379,32 +3429,32 @@ var pcb_silkscreen_line = z148.object({
|
|
|
3379
3429
|
expectTypesMatch(true);
|
|
3380
3430
|
|
|
3381
3431
|
// src/pcb/pcb_silkscreen_path.ts
|
|
3382
|
-
import { z as
|
|
3383
|
-
var pcb_silkscreen_path =
|
|
3384
|
-
type:
|
|
3432
|
+
import { z as z150 } from "zod";
|
|
3433
|
+
var pcb_silkscreen_path = z150.object({
|
|
3434
|
+
type: z150.literal("pcb_silkscreen_path"),
|
|
3385
3435
|
pcb_silkscreen_path_id: getZodPrefixedIdWithDefault("pcb_silkscreen_path"),
|
|
3386
|
-
pcb_component_id:
|
|
3387
|
-
pcb_group_id:
|
|
3388
|
-
subcircuit_id:
|
|
3436
|
+
pcb_component_id: z150.string(),
|
|
3437
|
+
pcb_group_id: z150.string().optional(),
|
|
3438
|
+
subcircuit_id: z150.string().optional(),
|
|
3389
3439
|
layer: visible_layer,
|
|
3390
|
-
route:
|
|
3440
|
+
route: z150.array(point),
|
|
3391
3441
|
stroke_width: length
|
|
3392
3442
|
}).describe("Defines a silkscreen path on the PCB");
|
|
3393
3443
|
expectTypesMatch(true);
|
|
3394
3444
|
|
|
3395
3445
|
// src/pcb/pcb_silkscreen_text.ts
|
|
3396
|
-
import { z as
|
|
3397
|
-
var pcb_silkscreen_text =
|
|
3398
|
-
type:
|
|
3446
|
+
import { z as z151 } from "zod";
|
|
3447
|
+
var pcb_silkscreen_text = z151.object({
|
|
3448
|
+
type: z151.literal("pcb_silkscreen_text"),
|
|
3399
3449
|
pcb_silkscreen_text_id: getZodPrefixedIdWithDefault("pcb_silkscreen_text"),
|
|
3400
|
-
pcb_group_id:
|
|
3401
|
-
subcircuit_id:
|
|
3402
|
-
font:
|
|
3450
|
+
pcb_group_id: z151.string().optional(),
|
|
3451
|
+
subcircuit_id: z151.string().optional(),
|
|
3452
|
+
font: z151.literal("tscircuit2024").default("tscircuit2024"),
|
|
3403
3453
|
font_size: distance.default("0.2mm"),
|
|
3404
|
-
pcb_component_id:
|
|
3405
|
-
text:
|
|
3406
|
-
is_knockout:
|
|
3407
|
-
knockout_padding:
|
|
3454
|
+
pcb_component_id: z151.string(),
|
|
3455
|
+
text: z151.string(),
|
|
3456
|
+
is_knockout: z151.boolean().default(false).optional(),
|
|
3457
|
+
knockout_padding: z151.object({
|
|
3408
3458
|
left: length,
|
|
3409
3459
|
top: length,
|
|
3410
3460
|
bottom: length,
|
|
@@ -3415,27 +3465,27 @@ var pcb_silkscreen_text = z150.object({
|
|
|
3415
3465
|
bottom: "0.2mm",
|
|
3416
3466
|
right: "0.2mm"
|
|
3417
3467
|
}).optional(),
|
|
3418
|
-
ccw_rotation:
|
|
3468
|
+
ccw_rotation: z151.number().optional(),
|
|
3419
3469
|
layer: layer_ref,
|
|
3420
|
-
is_mirrored:
|
|
3470
|
+
is_mirrored: z151.boolean().default(false).optional(),
|
|
3421
3471
|
anchor_position: point.default({ x: 0, y: 0 }),
|
|
3422
3472
|
anchor_alignment: ninePointAnchor.default("center")
|
|
3423
3473
|
}).describe("Defines silkscreen text on the PCB");
|
|
3424
3474
|
expectTypesMatch(true);
|
|
3425
3475
|
|
|
3426
3476
|
// src/pcb/pcb_copper_text.ts
|
|
3427
|
-
import { z as
|
|
3428
|
-
var pcb_copper_text =
|
|
3429
|
-
type:
|
|
3477
|
+
import { z as z152 } from "zod";
|
|
3478
|
+
var pcb_copper_text = z152.object({
|
|
3479
|
+
type: z152.literal("pcb_copper_text"),
|
|
3430
3480
|
pcb_copper_text_id: getZodPrefixedIdWithDefault("pcb_copper_text"),
|
|
3431
|
-
pcb_group_id:
|
|
3432
|
-
subcircuit_id:
|
|
3433
|
-
font:
|
|
3481
|
+
pcb_group_id: z152.string().optional(),
|
|
3482
|
+
subcircuit_id: z152.string().optional(),
|
|
3483
|
+
font: z152.literal("tscircuit2024").default("tscircuit2024"),
|
|
3434
3484
|
font_size: distance.default("0.2mm"),
|
|
3435
|
-
pcb_component_id:
|
|
3436
|
-
text:
|
|
3437
|
-
is_knockout:
|
|
3438
|
-
knockout_padding:
|
|
3485
|
+
pcb_component_id: z152.string(),
|
|
3486
|
+
text: z152.string(),
|
|
3487
|
+
is_knockout: z152.boolean().default(false).optional(),
|
|
3488
|
+
knockout_padding: z152.object({
|
|
3439
3489
|
left: length,
|
|
3440
3490
|
top: length,
|
|
3441
3491
|
bottom: length,
|
|
@@ -3446,61 +3496,61 @@ var pcb_copper_text = z151.object({
|
|
|
3446
3496
|
bottom: "0.2mm",
|
|
3447
3497
|
right: "0.2mm"
|
|
3448
3498
|
}).optional(),
|
|
3449
|
-
ccw_rotation:
|
|
3499
|
+
ccw_rotation: z152.number().optional(),
|
|
3450
3500
|
layer: layer_ref,
|
|
3451
|
-
is_mirrored:
|
|
3501
|
+
is_mirrored: z152.boolean().default(false).optional(),
|
|
3452
3502
|
anchor_position: point.default({ x: 0, y: 0 }),
|
|
3453
3503
|
anchor_alignment: ninePointAnchor.default("center")
|
|
3454
3504
|
}).describe("Defines copper text on the PCB");
|
|
3455
3505
|
expectTypesMatch(true);
|
|
3456
3506
|
|
|
3457
3507
|
// src/pcb/pcb_silkscreen_rect.ts
|
|
3458
|
-
import { z as
|
|
3459
|
-
var pcb_silkscreen_rect =
|
|
3460
|
-
type:
|
|
3508
|
+
import { z as z153 } from "zod";
|
|
3509
|
+
var pcb_silkscreen_rect = z153.object({
|
|
3510
|
+
type: z153.literal("pcb_silkscreen_rect"),
|
|
3461
3511
|
pcb_silkscreen_rect_id: getZodPrefixedIdWithDefault("pcb_silkscreen_rect"),
|
|
3462
|
-
pcb_component_id:
|
|
3463
|
-
pcb_group_id:
|
|
3464
|
-
subcircuit_id:
|
|
3512
|
+
pcb_component_id: z153.string(),
|
|
3513
|
+
pcb_group_id: z153.string().optional(),
|
|
3514
|
+
subcircuit_id: z153.string().optional(),
|
|
3465
3515
|
center: point,
|
|
3466
3516
|
width: length,
|
|
3467
3517
|
height: length,
|
|
3468
3518
|
layer: layer_ref,
|
|
3469
3519
|
stroke_width: length.default("1mm"),
|
|
3470
3520
|
corner_radius: length.optional(),
|
|
3471
|
-
is_filled:
|
|
3472
|
-
has_stroke:
|
|
3473
|
-
is_stroke_dashed:
|
|
3474
|
-
ccw_rotation:
|
|
3521
|
+
is_filled: z153.boolean().default(true).optional(),
|
|
3522
|
+
has_stroke: z153.boolean().optional(),
|
|
3523
|
+
is_stroke_dashed: z153.boolean().optional(),
|
|
3524
|
+
ccw_rotation: z153.number().optional()
|
|
3475
3525
|
}).describe("Defines a silkscreen rect on the PCB");
|
|
3476
3526
|
expectTypesMatch(true);
|
|
3477
3527
|
|
|
3478
3528
|
// src/pcb/pcb_silkscreen_circle.ts
|
|
3479
|
-
import { z as
|
|
3480
|
-
var pcb_silkscreen_circle =
|
|
3481
|
-
type:
|
|
3529
|
+
import { z as z154 } from "zod";
|
|
3530
|
+
var pcb_silkscreen_circle = z154.object({
|
|
3531
|
+
type: z154.literal("pcb_silkscreen_circle"),
|
|
3482
3532
|
pcb_silkscreen_circle_id: getZodPrefixedIdWithDefault(
|
|
3483
3533
|
"pcb_silkscreen_circle"
|
|
3484
3534
|
),
|
|
3485
|
-
pcb_component_id:
|
|
3486
|
-
pcb_group_id:
|
|
3487
|
-
subcircuit_id:
|
|
3535
|
+
pcb_component_id: z154.string(),
|
|
3536
|
+
pcb_group_id: z154.string().optional(),
|
|
3537
|
+
subcircuit_id: z154.string().optional(),
|
|
3488
3538
|
center: point,
|
|
3489
3539
|
radius: length,
|
|
3490
3540
|
layer: visible_layer,
|
|
3491
3541
|
stroke_width: length.default("1mm"),
|
|
3492
|
-
is_filled:
|
|
3542
|
+
is_filled: z154.boolean().optional()
|
|
3493
3543
|
}).describe("Defines a silkscreen circle on the PCB");
|
|
3494
3544
|
expectTypesMatch(true);
|
|
3495
3545
|
|
|
3496
3546
|
// src/pcb/pcb_silkscreen_oval.ts
|
|
3497
|
-
import { z as
|
|
3498
|
-
var pcb_silkscreen_oval =
|
|
3499
|
-
type:
|
|
3547
|
+
import { z as z155 } from "zod";
|
|
3548
|
+
var pcb_silkscreen_oval = z155.object({
|
|
3549
|
+
type: z155.literal("pcb_silkscreen_oval"),
|
|
3500
3550
|
pcb_silkscreen_oval_id: getZodPrefixedIdWithDefault("pcb_silkscreen_oval"),
|
|
3501
|
-
pcb_component_id:
|
|
3502
|
-
pcb_group_id:
|
|
3503
|
-
subcircuit_id:
|
|
3551
|
+
pcb_component_id: z155.string(),
|
|
3552
|
+
pcb_group_id: z155.string().optional(),
|
|
3553
|
+
subcircuit_id: z155.string().optional(),
|
|
3504
3554
|
center: point,
|
|
3505
3555
|
radius_x: distance,
|
|
3506
3556
|
radius_y: distance,
|
|
@@ -3510,267 +3560,267 @@ var pcb_silkscreen_oval = z154.object({
|
|
|
3510
3560
|
expectTypesMatch(true);
|
|
3511
3561
|
|
|
3512
3562
|
// src/pcb/pcb_silkscreen_graphic.ts
|
|
3513
|
-
import { z as
|
|
3514
|
-
var pcb_silkscreen_graphic_base =
|
|
3515
|
-
type:
|
|
3563
|
+
import { z as z156 } from "zod";
|
|
3564
|
+
var pcb_silkscreen_graphic_base = z156.object({
|
|
3565
|
+
type: z156.literal("pcb_silkscreen_graphic"),
|
|
3516
3566
|
pcb_silkscreen_graphic_id: getZodPrefixedIdWithDefault(
|
|
3517
3567
|
"pcb_silkscreen_graphic"
|
|
3518
3568
|
),
|
|
3519
|
-
pcb_component_id:
|
|
3520
|
-
pcb_group_id:
|
|
3521
|
-
subcircuit_id:
|
|
3569
|
+
pcb_component_id: z156.string(),
|
|
3570
|
+
pcb_group_id: z156.string().optional(),
|
|
3571
|
+
subcircuit_id: z156.string().optional(),
|
|
3522
3572
|
layer: visible_layer,
|
|
3523
3573
|
image_asset: asset.optional()
|
|
3524
3574
|
});
|
|
3525
3575
|
var pcb_silkscreen_graphic_brep = pcb_silkscreen_graphic_base.extend({
|
|
3526
|
-
shape:
|
|
3576
|
+
shape: z156.literal("brep"),
|
|
3527
3577
|
brep_shape
|
|
3528
3578
|
}).describe("Defines a BRep silkscreen graphic on the PCB");
|
|
3529
3579
|
expectTypesMatch(
|
|
3530
3580
|
true
|
|
3531
3581
|
);
|
|
3532
|
-
var pcb_silkscreen_graphic =
|
|
3582
|
+
var pcb_silkscreen_graphic = z156.discriminatedUnion("shape", [pcb_silkscreen_graphic_brep]).describe("Defines a silkscreen graphic on the PCB");
|
|
3533
3583
|
expectTypesMatch(true);
|
|
3534
3584
|
|
|
3535
3585
|
// src/pcb/pcb_silkscreen_pill.ts
|
|
3536
|
-
import { z as
|
|
3537
|
-
var pcb_silkscreen_pill =
|
|
3538
|
-
type:
|
|
3586
|
+
import { z as z157 } from "zod";
|
|
3587
|
+
var pcb_silkscreen_pill = z157.object({
|
|
3588
|
+
type: z157.literal("pcb_silkscreen_pill"),
|
|
3539
3589
|
pcb_silkscreen_pill_id: getZodPrefixedIdWithDefault("pcb_silkscreen_pill"),
|
|
3540
|
-
pcb_component_id:
|
|
3541
|
-
pcb_group_id:
|
|
3542
|
-
subcircuit_id:
|
|
3590
|
+
pcb_component_id: z157.string(),
|
|
3591
|
+
pcb_group_id: z157.string().optional(),
|
|
3592
|
+
subcircuit_id: z157.string().optional(),
|
|
3543
3593
|
center: point,
|
|
3544
3594
|
width: length,
|
|
3545
3595
|
height: length,
|
|
3546
3596
|
layer: layer_ref,
|
|
3547
|
-
ccw_rotation:
|
|
3597
|
+
ccw_rotation: z157.number().optional()
|
|
3548
3598
|
}).describe("Defines a silkscreen pill on the PCB");
|
|
3549
3599
|
expectTypesMatch(true);
|
|
3550
3600
|
|
|
3551
3601
|
// src/pcb/pcb_fabrication_note_text.ts
|
|
3552
|
-
import { z as
|
|
3553
|
-
var pcb_fabrication_note_text =
|
|
3554
|
-
type:
|
|
3602
|
+
import { z as z158 } from "zod";
|
|
3603
|
+
var pcb_fabrication_note_text = z158.object({
|
|
3604
|
+
type: z158.literal("pcb_fabrication_note_text"),
|
|
3555
3605
|
pcb_fabrication_note_text_id: getZodPrefixedIdWithDefault(
|
|
3556
3606
|
"pcb_fabrication_note_text"
|
|
3557
3607
|
),
|
|
3558
|
-
subcircuit_id:
|
|
3559
|
-
pcb_group_id:
|
|
3560
|
-
font:
|
|
3608
|
+
subcircuit_id: z158.string().optional(),
|
|
3609
|
+
pcb_group_id: z158.string().optional(),
|
|
3610
|
+
font: z158.literal("tscircuit2024").default("tscircuit2024"),
|
|
3561
3611
|
font_size: distance.default("1mm"),
|
|
3562
|
-
pcb_component_id:
|
|
3563
|
-
text:
|
|
3564
|
-
ccw_rotation:
|
|
3612
|
+
pcb_component_id: z158.string(),
|
|
3613
|
+
text: z158.string(),
|
|
3614
|
+
ccw_rotation: z158.number().optional(),
|
|
3565
3615
|
layer: visible_layer,
|
|
3566
3616
|
anchor_position: point.default({ x: 0, y: 0 }),
|
|
3567
|
-
anchor_alignment:
|
|
3568
|
-
color:
|
|
3617
|
+
anchor_alignment: z158.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
3618
|
+
color: z158.string().optional()
|
|
3569
3619
|
}).describe(
|
|
3570
3620
|
"Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators"
|
|
3571
3621
|
);
|
|
3572
3622
|
expectTypesMatch(true);
|
|
3573
3623
|
|
|
3574
3624
|
// src/pcb/pcb_fabrication_note_path.ts
|
|
3575
|
-
import { z as
|
|
3576
|
-
var pcb_fabrication_note_path =
|
|
3577
|
-
type:
|
|
3625
|
+
import { z as z159 } from "zod";
|
|
3626
|
+
var pcb_fabrication_note_path = z159.object({
|
|
3627
|
+
type: z159.literal("pcb_fabrication_note_path"),
|
|
3578
3628
|
pcb_fabrication_note_path_id: getZodPrefixedIdWithDefault(
|
|
3579
3629
|
"pcb_fabrication_note_path"
|
|
3580
3630
|
),
|
|
3581
|
-
pcb_component_id:
|
|
3582
|
-
subcircuit_id:
|
|
3631
|
+
pcb_component_id: z159.string(),
|
|
3632
|
+
subcircuit_id: z159.string().optional(),
|
|
3583
3633
|
layer: layer_ref,
|
|
3584
|
-
route:
|
|
3634
|
+
route: z159.array(point),
|
|
3585
3635
|
stroke_width: length,
|
|
3586
|
-
color:
|
|
3587
|
-
is_filled:
|
|
3588
|
-
has_stroke:
|
|
3636
|
+
color: z159.string().optional(),
|
|
3637
|
+
is_filled: z159.boolean().optional(),
|
|
3638
|
+
has_stroke: z159.boolean().optional()
|
|
3589
3639
|
}).describe(
|
|
3590
3640
|
"Defines a fabrication path on the PCB for fabricators or assemblers"
|
|
3591
3641
|
);
|
|
3592
3642
|
expectTypesMatch(true);
|
|
3593
3643
|
|
|
3594
3644
|
// src/pcb/pcb_fabrication_note_rect.ts
|
|
3595
|
-
import { z as
|
|
3596
|
-
var pcb_fabrication_note_rect =
|
|
3597
|
-
type:
|
|
3645
|
+
import { z as z160 } from "zod";
|
|
3646
|
+
var pcb_fabrication_note_rect = z160.object({
|
|
3647
|
+
type: z160.literal("pcb_fabrication_note_rect"),
|
|
3598
3648
|
pcb_fabrication_note_rect_id: getZodPrefixedIdWithDefault(
|
|
3599
3649
|
"pcb_fabrication_note_rect"
|
|
3600
3650
|
),
|
|
3601
|
-
pcb_component_id:
|
|
3602
|
-
pcb_group_id:
|
|
3603
|
-
subcircuit_id:
|
|
3651
|
+
pcb_component_id: z160.string(),
|
|
3652
|
+
pcb_group_id: z160.string().optional(),
|
|
3653
|
+
subcircuit_id: z160.string().optional(),
|
|
3604
3654
|
center: point,
|
|
3605
3655
|
width: length,
|
|
3606
3656
|
height: length,
|
|
3607
3657
|
layer: visible_layer,
|
|
3608
3658
|
stroke_width: length.default("0.1mm"),
|
|
3609
3659
|
corner_radius: length.optional(),
|
|
3610
|
-
is_filled:
|
|
3611
|
-
has_stroke:
|
|
3612
|
-
is_stroke_dashed:
|
|
3613
|
-
color:
|
|
3660
|
+
is_filled: z160.boolean().optional(),
|
|
3661
|
+
has_stroke: z160.boolean().optional(),
|
|
3662
|
+
is_stroke_dashed: z160.boolean().optional(),
|
|
3663
|
+
color: z160.string().optional()
|
|
3614
3664
|
}).describe("Defines a fabrication note rectangle on the PCB");
|
|
3615
3665
|
expectTypesMatch(true);
|
|
3616
3666
|
|
|
3617
3667
|
// src/pcb/pcb_fabrication_note_dimension.ts
|
|
3618
|
-
import { z as
|
|
3619
|
-
var pcb_fabrication_note_dimension =
|
|
3620
|
-
type:
|
|
3668
|
+
import { z as z161 } from "zod";
|
|
3669
|
+
var pcb_fabrication_note_dimension = z161.object({
|
|
3670
|
+
type: z161.literal("pcb_fabrication_note_dimension"),
|
|
3621
3671
|
pcb_fabrication_note_dimension_id: getZodPrefixedIdWithDefault(
|
|
3622
3672
|
"pcb_fabrication_note_dimension"
|
|
3623
3673
|
),
|
|
3624
|
-
pcb_component_id:
|
|
3625
|
-
pcb_group_id:
|
|
3626
|
-
subcircuit_id:
|
|
3674
|
+
pcb_component_id: z161.string(),
|
|
3675
|
+
pcb_group_id: z161.string().optional(),
|
|
3676
|
+
subcircuit_id: z161.string().optional(),
|
|
3627
3677
|
layer: visible_layer,
|
|
3628
3678
|
from: point,
|
|
3629
3679
|
to: point,
|
|
3630
|
-
text:
|
|
3631
|
-
text_ccw_rotation:
|
|
3680
|
+
text: z161.string().optional(),
|
|
3681
|
+
text_ccw_rotation: z161.number().optional(),
|
|
3632
3682
|
offset: length.optional(),
|
|
3633
3683
|
offset_distance: length.optional(),
|
|
3634
|
-
offset_direction:
|
|
3635
|
-
x:
|
|
3636
|
-
y:
|
|
3684
|
+
offset_direction: z161.object({
|
|
3685
|
+
x: z161.number(),
|
|
3686
|
+
y: z161.number()
|
|
3637
3687
|
}).optional(),
|
|
3638
|
-
font:
|
|
3688
|
+
font: z161.literal("tscircuit2024").default("tscircuit2024"),
|
|
3639
3689
|
font_size: length.default("1mm"),
|
|
3640
|
-
color:
|
|
3690
|
+
color: z161.string().optional(),
|
|
3641
3691
|
arrow_size: length.default("1mm")
|
|
3642
3692
|
}).describe("Defines a measurement annotation within PCB fabrication notes");
|
|
3643
3693
|
expectTypesMatch(true);
|
|
3644
3694
|
|
|
3645
3695
|
// src/pcb/pcb_note_text.ts
|
|
3646
|
-
import { z as z161 } from "zod";
|
|
3647
|
-
var pcb_note_text = z161.object({
|
|
3648
|
-
type: z161.literal("pcb_note_text"),
|
|
3649
|
-
pcb_note_text_id: getZodPrefixedIdWithDefault("pcb_note_text"),
|
|
3650
|
-
pcb_component_id: z161.string().optional(),
|
|
3651
|
-
pcb_group_id: z161.string().optional(),
|
|
3652
|
-
subcircuit_id: z161.string().optional(),
|
|
3653
|
-
name: z161.string().optional(),
|
|
3654
|
-
font: z161.literal("tscircuit2024").default("tscircuit2024"),
|
|
3655
|
-
font_size: distance.default("1mm"),
|
|
3656
|
-
text: z161.string().optional(),
|
|
3657
|
-
anchor_position: point.default({ x: 0, y: 0 }),
|
|
3658
|
-
anchor_alignment: z161.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
3659
|
-
layer: visible_layer.default("top"),
|
|
3660
|
-
is_mirrored_from_top_view: z161.boolean().optional(),
|
|
3661
|
-
color: z161.string().optional()
|
|
3662
|
-
}).describe("Defines a documentation note in text on the PCB");
|
|
3663
|
-
expectTypesMatch(true);
|
|
3664
|
-
|
|
3665
|
-
// src/pcb/pcb_note_rect.ts
|
|
3666
3696
|
import { z as z162 } from "zod";
|
|
3667
|
-
var
|
|
3668
|
-
type: z162.literal("
|
|
3669
|
-
|
|
3697
|
+
var pcb_note_text = z162.object({
|
|
3698
|
+
type: z162.literal("pcb_note_text"),
|
|
3699
|
+
pcb_note_text_id: getZodPrefixedIdWithDefault("pcb_note_text"),
|
|
3670
3700
|
pcb_component_id: z162.string().optional(),
|
|
3671
3701
|
pcb_group_id: z162.string().optional(),
|
|
3672
3702
|
subcircuit_id: z162.string().optional(),
|
|
3673
3703
|
name: z162.string().optional(),
|
|
3704
|
+
font: z162.literal("tscircuit2024").default("tscircuit2024"),
|
|
3705
|
+
font_size: distance.default("1mm"),
|
|
3674
3706
|
text: z162.string().optional(),
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
height: length,
|
|
3707
|
+
anchor_position: point.default({ x: 0, y: 0 }),
|
|
3708
|
+
anchor_alignment: z162.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
3678
3709
|
layer: visible_layer.default("top"),
|
|
3679
|
-
|
|
3680
|
-
corner_radius: length.optional(),
|
|
3681
|
-
is_filled: z162.boolean().optional(),
|
|
3682
|
-
has_stroke: z162.boolean().optional(),
|
|
3683
|
-
is_stroke_dashed: z162.boolean().optional(),
|
|
3710
|
+
is_mirrored_from_top_view: z162.boolean().optional(),
|
|
3684
3711
|
color: z162.string().optional()
|
|
3685
|
-
}).describe("Defines a
|
|
3712
|
+
}).describe("Defines a documentation note in text on the PCB");
|
|
3686
3713
|
expectTypesMatch(true);
|
|
3687
3714
|
|
|
3688
|
-
// src/pcb/
|
|
3715
|
+
// src/pcb/pcb_note_rect.ts
|
|
3689
3716
|
import { z as z163 } from "zod";
|
|
3690
|
-
var
|
|
3691
|
-
type: z163.literal("
|
|
3692
|
-
|
|
3717
|
+
var pcb_note_rect = z163.object({
|
|
3718
|
+
type: z163.literal("pcb_note_rect"),
|
|
3719
|
+
pcb_note_rect_id: getZodPrefixedIdWithDefault("pcb_note_rect"),
|
|
3693
3720
|
pcb_component_id: z163.string().optional(),
|
|
3694
3721
|
pcb_group_id: z163.string().optional(),
|
|
3695
3722
|
subcircuit_id: z163.string().optional(),
|
|
3696
3723
|
name: z163.string().optional(),
|
|
3697
3724
|
text: z163.string().optional(),
|
|
3698
|
-
|
|
3725
|
+
center: point,
|
|
3726
|
+
width: length,
|
|
3727
|
+
height: length,
|
|
3699
3728
|
layer: visible_layer.default("top"),
|
|
3700
3729
|
stroke_width: length.default("0.1mm"),
|
|
3730
|
+
corner_radius: length.optional(),
|
|
3731
|
+
is_filled: z163.boolean().optional(),
|
|
3732
|
+
has_stroke: z163.boolean().optional(),
|
|
3733
|
+
is_stroke_dashed: z163.boolean().optional(),
|
|
3701
3734
|
color: z163.string().optional()
|
|
3702
|
-
}).describe("Defines a
|
|
3735
|
+
}).describe("Defines a rectangular documentation note on the PCB");
|
|
3703
3736
|
expectTypesMatch(true);
|
|
3704
3737
|
|
|
3705
|
-
// src/pcb/
|
|
3738
|
+
// src/pcb/pcb_note_path.ts
|
|
3706
3739
|
import { z as z164 } from "zod";
|
|
3707
|
-
var
|
|
3708
|
-
type: z164.literal("
|
|
3709
|
-
|
|
3740
|
+
var pcb_note_path = z164.object({
|
|
3741
|
+
type: z164.literal("pcb_note_path"),
|
|
3742
|
+
pcb_note_path_id: getZodPrefixedIdWithDefault("pcb_note_path"),
|
|
3710
3743
|
pcb_component_id: z164.string().optional(),
|
|
3711
3744
|
pcb_group_id: z164.string().optional(),
|
|
3712
3745
|
subcircuit_id: z164.string().optional(),
|
|
3713
3746
|
name: z164.string().optional(),
|
|
3714
3747
|
text: z164.string().optional(),
|
|
3748
|
+
route: z164.array(point),
|
|
3749
|
+
layer: visible_layer.default("top"),
|
|
3750
|
+
stroke_width: length.default("0.1mm"),
|
|
3751
|
+
color: z164.string().optional()
|
|
3752
|
+
}).describe("Defines a polyline documentation note on the PCB");
|
|
3753
|
+
expectTypesMatch(true);
|
|
3754
|
+
|
|
3755
|
+
// src/pcb/pcb_note_line.ts
|
|
3756
|
+
import { z as z165 } from "zod";
|
|
3757
|
+
var pcb_note_line = z165.object({
|
|
3758
|
+
type: z165.literal("pcb_note_line"),
|
|
3759
|
+
pcb_note_line_id: getZodPrefixedIdWithDefault("pcb_note_line"),
|
|
3760
|
+
pcb_component_id: z165.string().optional(),
|
|
3761
|
+
pcb_group_id: z165.string().optional(),
|
|
3762
|
+
subcircuit_id: z165.string().optional(),
|
|
3763
|
+
name: z165.string().optional(),
|
|
3764
|
+
text: z165.string().optional(),
|
|
3715
3765
|
x1: distance,
|
|
3716
3766
|
y1: distance,
|
|
3717
3767
|
x2: distance,
|
|
3718
3768
|
y2: distance,
|
|
3719
3769
|
layer: visible_layer.default("top"),
|
|
3720
3770
|
stroke_width: distance.default("0.1mm"),
|
|
3721
|
-
color:
|
|
3722
|
-
is_dashed:
|
|
3771
|
+
color: z165.string().optional(),
|
|
3772
|
+
is_dashed: z165.boolean().optional()
|
|
3723
3773
|
}).describe("Defines a straight documentation note line on the PCB");
|
|
3724
3774
|
expectTypesMatch(true);
|
|
3725
3775
|
|
|
3726
3776
|
// src/pcb/pcb_note_dimension.ts
|
|
3727
|
-
import { z as
|
|
3728
|
-
var pcb_note_dimension =
|
|
3729
|
-
type:
|
|
3777
|
+
import { z as z166 } from "zod";
|
|
3778
|
+
var pcb_note_dimension = z166.object({
|
|
3779
|
+
type: z166.literal("pcb_note_dimension"),
|
|
3730
3780
|
pcb_note_dimension_id: getZodPrefixedIdWithDefault("pcb_note_dimension"),
|
|
3731
|
-
pcb_component_id:
|
|
3732
|
-
pcb_group_id:
|
|
3733
|
-
subcircuit_id:
|
|
3734
|
-
name:
|
|
3781
|
+
pcb_component_id: z166.string().optional(),
|
|
3782
|
+
pcb_group_id: z166.string().optional(),
|
|
3783
|
+
subcircuit_id: z166.string().optional(),
|
|
3784
|
+
name: z166.string().optional(),
|
|
3735
3785
|
from: point,
|
|
3736
3786
|
to: point,
|
|
3737
|
-
text:
|
|
3738
|
-
text_ccw_rotation:
|
|
3787
|
+
text: z166.string().optional(),
|
|
3788
|
+
text_ccw_rotation: z166.number().optional(),
|
|
3739
3789
|
offset_distance: length.optional(),
|
|
3740
|
-
offset_direction:
|
|
3741
|
-
x:
|
|
3742
|
-
y:
|
|
3790
|
+
offset_direction: z166.object({
|
|
3791
|
+
x: z166.number(),
|
|
3792
|
+
y: z166.number()
|
|
3743
3793
|
}).optional(),
|
|
3744
|
-
font:
|
|
3794
|
+
font: z166.literal("tscircuit2024").default("tscircuit2024"),
|
|
3745
3795
|
font_size: length.default("1mm"),
|
|
3746
3796
|
layer: visible_layer.default("top"),
|
|
3747
|
-
color:
|
|
3797
|
+
color: z166.string().optional(),
|
|
3748
3798
|
arrow_size: length.default("1mm")
|
|
3749
3799
|
}).describe("Defines a measurement annotation within PCB documentation notes");
|
|
3750
3800
|
expectTypesMatch(true);
|
|
3751
3801
|
|
|
3752
3802
|
// src/pcb/pcb_footprint_overlap_error.ts
|
|
3753
|
-
import { z as
|
|
3803
|
+
import { z as z167 } from "zod";
|
|
3754
3804
|
var pcb_footprint_overlap_error = base_circuit_json_error.extend({
|
|
3755
|
-
type:
|
|
3805
|
+
type: z167.literal("pcb_footprint_overlap_error"),
|
|
3756
3806
|
pcb_error_id: getZodPrefixedIdWithDefault("pcb_error"),
|
|
3757
|
-
error_type:
|
|
3758
|
-
pcb_smtpad_ids:
|
|
3759
|
-
pcb_plated_hole_ids:
|
|
3760
|
-
pcb_hole_ids:
|
|
3761
|
-
pcb_keepout_ids:
|
|
3807
|
+
error_type: z167.literal("pcb_footprint_overlap_error").default("pcb_footprint_overlap_error"),
|
|
3808
|
+
pcb_smtpad_ids: z167.array(z167.string()).optional(),
|
|
3809
|
+
pcb_plated_hole_ids: z167.array(z167.string()).optional(),
|
|
3810
|
+
pcb_hole_ids: z167.array(z167.string()).optional(),
|
|
3811
|
+
pcb_keepout_ids: z167.array(z167.string()).optional()
|
|
3762
3812
|
}).describe("Error emitted when a pcb footprint overlaps with another element");
|
|
3763
3813
|
expectTypesMatch(
|
|
3764
3814
|
true
|
|
3765
3815
|
);
|
|
3766
3816
|
|
|
3767
3817
|
// src/pcb/pcb_courtyard_overlap_error.ts
|
|
3768
|
-
import { z as
|
|
3818
|
+
import { z as z168 } from "zod";
|
|
3769
3819
|
var pcb_courtyard_overlap_error = base_circuit_json_error.extend({
|
|
3770
|
-
type:
|
|
3820
|
+
type: z168.literal("pcb_courtyard_overlap_error"),
|
|
3771
3821
|
pcb_error_id: getZodPrefixedIdWithDefault("pcb_error"),
|
|
3772
|
-
error_type:
|
|
3773
|
-
pcb_component_ids:
|
|
3822
|
+
error_type: z168.literal("pcb_courtyard_overlap_error").default("pcb_courtyard_overlap_error"),
|
|
3823
|
+
pcb_component_ids: z168.tuple([z168.string(), z168.string()])
|
|
3774
3824
|
}).describe(
|
|
3775
3825
|
"Error emitted when the courtyard (CrtYd) of one PCB component overlaps with the courtyard of another"
|
|
3776
3826
|
);
|
|
@@ -3779,81 +3829,81 @@ expectTypesMatch(
|
|
|
3779
3829
|
);
|
|
3780
3830
|
|
|
3781
3831
|
// src/pcb/pcb_keepout.ts
|
|
3782
|
-
import { z as
|
|
3783
|
-
var pcb_keepout_outline =
|
|
3784
|
-
type:
|
|
3785
|
-
shape:
|
|
3786
|
-
pcb_component_id:
|
|
3787
|
-
pcb_group_id:
|
|
3788
|
-
subcircuit_id:
|
|
3789
|
-
outline:
|
|
3832
|
+
import { z as z169 } from "zod";
|
|
3833
|
+
var pcb_keepout_outline = z169.object({
|
|
3834
|
+
type: z169.literal("pcb_keepout"),
|
|
3835
|
+
shape: z169.literal("outline"),
|
|
3836
|
+
pcb_component_id: z169.string().optional(),
|
|
3837
|
+
pcb_group_id: z169.string().optional(),
|
|
3838
|
+
subcircuit_id: z169.string().optional(),
|
|
3839
|
+
outline: z169.array(point).min(2),
|
|
3790
3840
|
stroke_width: length,
|
|
3791
|
-
pcb_keepout_id:
|
|
3792
|
-
layers:
|
|
3793
|
-
description:
|
|
3794
|
-
excluded_pcb_component_ids:
|
|
3795
|
-
warning_only:
|
|
3796
|
-
allow_traces:
|
|
3797
|
-
allow_placements:
|
|
3798
|
-
});
|
|
3799
|
-
var pcb_keepout =
|
|
3800
|
-
type:
|
|
3801
|
-
shape:
|
|
3802
|
-
pcb_component_id:
|
|
3803
|
-
pcb_group_id:
|
|
3804
|
-
subcircuit_id:
|
|
3841
|
+
pcb_keepout_id: z169.string(),
|
|
3842
|
+
layers: z169.array(z169.string()),
|
|
3843
|
+
description: z169.string().optional(),
|
|
3844
|
+
excluded_pcb_component_ids: z169.array(z169.string()).optional(),
|
|
3845
|
+
warning_only: z169.boolean().optional(),
|
|
3846
|
+
allow_traces: z169.boolean().optional(),
|
|
3847
|
+
allow_placements: z169.boolean().optional()
|
|
3848
|
+
});
|
|
3849
|
+
var pcb_keepout = z169.object({
|
|
3850
|
+
type: z169.literal("pcb_keepout"),
|
|
3851
|
+
shape: z169.literal("rect"),
|
|
3852
|
+
pcb_component_id: z169.string().optional(),
|
|
3853
|
+
pcb_group_id: z169.string().optional(),
|
|
3854
|
+
subcircuit_id: z169.string().optional(),
|
|
3805
3855
|
center: point,
|
|
3806
3856
|
width: distance,
|
|
3807
3857
|
height: distance,
|
|
3808
|
-
pcb_keepout_id:
|
|
3809
|
-
layers:
|
|
3858
|
+
pcb_keepout_id: z169.string(),
|
|
3859
|
+
layers: z169.array(z169.string()),
|
|
3810
3860
|
// Specify layers where the keepout applies
|
|
3811
|
-
description:
|
|
3861
|
+
description: z169.string().optional(),
|
|
3812
3862
|
// Optional description of the keepout
|
|
3813
|
-
excluded_pcb_component_ids:
|
|
3814
|
-
warning_only:
|
|
3815
|
-
allow_traces:
|
|
3816
|
-
allow_placements:
|
|
3863
|
+
excluded_pcb_component_ids: z169.array(z169.string()).optional(),
|
|
3864
|
+
warning_only: z169.boolean().optional(),
|
|
3865
|
+
allow_traces: z169.boolean().optional(),
|
|
3866
|
+
allow_placements: z169.boolean().optional()
|
|
3817
3867
|
}).or(
|
|
3818
|
-
|
|
3819
|
-
type:
|
|
3820
|
-
shape:
|
|
3821
|
-
pcb_component_id:
|
|
3822
|
-
pcb_group_id:
|
|
3823
|
-
subcircuit_id:
|
|
3868
|
+
z169.object({
|
|
3869
|
+
type: z169.literal("pcb_keepout"),
|
|
3870
|
+
shape: z169.literal("circle"),
|
|
3871
|
+
pcb_component_id: z169.string().optional(),
|
|
3872
|
+
pcb_group_id: z169.string().optional(),
|
|
3873
|
+
subcircuit_id: z169.string().optional(),
|
|
3824
3874
|
center: point,
|
|
3825
3875
|
radius: distance,
|
|
3826
|
-
pcb_keepout_id:
|
|
3827
|
-
layers:
|
|
3876
|
+
pcb_keepout_id: z169.string(),
|
|
3877
|
+
layers: z169.array(z169.string()),
|
|
3828
3878
|
// Specify layers where the keepout applies
|
|
3829
|
-
description:
|
|
3879
|
+
description: z169.string().optional(),
|
|
3830
3880
|
// Optional description of the keepout
|
|
3831
|
-
excluded_pcb_component_ids:
|
|
3832
|
-
warning_only:
|
|
3833
|
-
allow_traces:
|
|
3834
|
-
allow_placements:
|
|
3881
|
+
excluded_pcb_component_ids: z169.array(z169.string()).optional(),
|
|
3882
|
+
warning_only: z169.boolean().optional(),
|
|
3883
|
+
allow_traces: z169.boolean().optional(),
|
|
3884
|
+
allow_placements: z169.boolean().optional()
|
|
3835
3885
|
})
|
|
3836
3886
|
).or(pcb_keepout_outline);
|
|
3837
3887
|
expectTypesMatch(true);
|
|
3838
3888
|
expectTypesMatch(true);
|
|
3839
3889
|
|
|
3840
3890
|
// src/pcb/pcb_keepout_overlap_warning.ts
|
|
3841
|
-
import { z as
|
|
3842
|
-
var pcb_keepout_overlap_warning =
|
|
3843
|
-
type:
|
|
3891
|
+
import { z as z170 } from "zod";
|
|
3892
|
+
var pcb_keepout_overlap_warning = z170.object({
|
|
3893
|
+
type: z170.literal("pcb_keepout_overlap_warning"),
|
|
3844
3894
|
pcb_keepout_overlap_warning_id: getZodPrefixedIdWithDefault(
|
|
3845
3895
|
"pcb_keepout_overlap_warning"
|
|
3846
3896
|
),
|
|
3847
|
-
warning_type:
|
|
3848
|
-
message:
|
|
3849
|
-
pcb_keepout_id:
|
|
3850
|
-
pcb_component_ids:
|
|
3851
|
-
pcb_trace_ids:
|
|
3852
|
-
pcb_smtpad_ids:
|
|
3853
|
-
pcb_plated_hole_ids:
|
|
3854
|
-
pcb_via_ids:
|
|
3897
|
+
warning_type: z170.literal("pcb_keepout_overlap_warning").default("pcb_keepout_overlap_warning"),
|
|
3898
|
+
message: z170.string(),
|
|
3899
|
+
pcb_keepout_id: z170.string(),
|
|
3900
|
+
pcb_component_ids: z170.array(z170.string()).optional(),
|
|
3901
|
+
pcb_trace_ids: z170.array(z170.string()).optional(),
|
|
3902
|
+
pcb_smtpad_ids: z170.array(z170.string()).optional(),
|
|
3903
|
+
pcb_plated_hole_ids: z170.array(z170.string()).optional(),
|
|
3904
|
+
pcb_via_ids: z170.array(z170.string()).optional(),
|
|
3855
3905
|
center: point.optional(),
|
|
3856
|
-
subcircuit_id:
|
|
3906
|
+
subcircuit_id: z170.string().optional()
|
|
3857
3907
|
}).describe(
|
|
3858
3908
|
"Warning emitted when copper overlaps a PCB keepout with warning_only enabled"
|
|
3859
3909
|
);
|
|
@@ -3862,18 +3912,18 @@ expectTypesMatch(
|
|
|
3862
3912
|
);
|
|
3863
3913
|
|
|
3864
3914
|
// src/pcb/pcb_cutout.ts
|
|
3865
|
-
import { z as
|
|
3866
|
-
var pcb_cutout_base =
|
|
3867
|
-
type:
|
|
3915
|
+
import { z as z171 } from "zod";
|
|
3916
|
+
var pcb_cutout_base = z171.object({
|
|
3917
|
+
type: z171.literal("pcb_cutout"),
|
|
3868
3918
|
pcb_cutout_id: getZodPrefixedIdWithDefault("pcb_cutout"),
|
|
3869
|
-
pcb_component_id:
|
|
3870
|
-
pcb_group_id:
|
|
3871
|
-
subcircuit_id:
|
|
3872
|
-
pcb_board_id:
|
|
3873
|
-
pcb_panel_id:
|
|
3919
|
+
pcb_component_id: z171.string().optional(),
|
|
3920
|
+
pcb_group_id: z171.string().optional(),
|
|
3921
|
+
subcircuit_id: z171.string().optional(),
|
|
3922
|
+
pcb_board_id: z171.string().optional(),
|
|
3923
|
+
pcb_panel_id: z171.string().optional()
|
|
3874
3924
|
});
|
|
3875
3925
|
var pcb_cutout_rect = pcb_cutout_base.extend({
|
|
3876
|
-
shape:
|
|
3926
|
+
shape: z171.literal("rect"),
|
|
3877
3927
|
center: point,
|
|
3878
3928
|
width: length,
|
|
3879
3929
|
height: length,
|
|
@@ -3882,26 +3932,26 @@ var pcb_cutout_rect = pcb_cutout_base.extend({
|
|
|
3882
3932
|
});
|
|
3883
3933
|
expectTypesMatch(true);
|
|
3884
3934
|
var pcb_cutout_circle = pcb_cutout_base.extend({
|
|
3885
|
-
shape:
|
|
3935
|
+
shape: z171.literal("circle"),
|
|
3886
3936
|
center: point,
|
|
3887
3937
|
radius: length
|
|
3888
3938
|
});
|
|
3889
3939
|
expectTypesMatch(true);
|
|
3890
3940
|
var pcb_cutout_polygon = pcb_cutout_base.extend({
|
|
3891
|
-
shape:
|
|
3892
|
-
points:
|
|
3941
|
+
shape: z171.literal("polygon"),
|
|
3942
|
+
points: z171.array(point)
|
|
3893
3943
|
});
|
|
3894
3944
|
expectTypesMatch(true);
|
|
3895
3945
|
var pcb_cutout_path = pcb_cutout_base.extend({
|
|
3896
|
-
shape:
|
|
3897
|
-
route:
|
|
3946
|
+
shape: z171.literal("path"),
|
|
3947
|
+
route: z171.array(point),
|
|
3898
3948
|
slot_width: length,
|
|
3899
3949
|
slot_length: length.optional(),
|
|
3900
3950
|
space_between_slots: length.optional(),
|
|
3901
3951
|
slot_corner_radius: length.optional()
|
|
3902
3952
|
});
|
|
3903
3953
|
expectTypesMatch(true);
|
|
3904
|
-
var pcb_cutout =
|
|
3954
|
+
var pcb_cutout = z171.discriminatedUnion("shape", [
|
|
3905
3955
|
pcb_cutout_rect,
|
|
3906
3956
|
pcb_cutout_circle,
|
|
3907
3957
|
pcb_cutout_polygon,
|
|
@@ -3910,223 +3960,223 @@ var pcb_cutout = z170.discriminatedUnion("shape", [
|
|
|
3910
3960
|
expectTypesMatch(true);
|
|
3911
3961
|
|
|
3912
3962
|
// src/pcb/pcb_missing_footprint_error.ts
|
|
3913
|
-
import { z as
|
|
3963
|
+
import { z as z172 } from "zod";
|
|
3914
3964
|
var pcb_missing_footprint_error = base_circuit_json_error.extend({
|
|
3915
|
-
type:
|
|
3965
|
+
type: z172.literal("pcb_missing_footprint_error"),
|
|
3916
3966
|
pcb_missing_footprint_error_id: getZodPrefixedIdWithDefault(
|
|
3917
3967
|
"pcb_missing_footprint_error"
|
|
3918
3968
|
),
|
|
3919
|
-
pcb_group_id:
|
|
3920
|
-
subcircuit_id:
|
|
3921
|
-
error_type:
|
|
3922
|
-
source_component_id:
|
|
3969
|
+
pcb_group_id: z172.string().optional(),
|
|
3970
|
+
subcircuit_id: z172.string().optional(),
|
|
3971
|
+
error_type: z172.literal("pcb_missing_footprint_error").default("pcb_missing_footprint_error"),
|
|
3972
|
+
source_component_id: z172.string()
|
|
3923
3973
|
}).describe("Defines a missing footprint error on the PCB");
|
|
3924
3974
|
expectTypesMatch(
|
|
3925
3975
|
true
|
|
3926
3976
|
);
|
|
3927
3977
|
|
|
3928
3978
|
// src/pcb/external_footprint_load_error.ts
|
|
3929
|
-
import { z as
|
|
3979
|
+
import { z as z173 } from "zod";
|
|
3930
3980
|
var external_footprint_load_error = base_circuit_json_error.extend({
|
|
3931
|
-
type:
|
|
3981
|
+
type: z173.literal("external_footprint_load_error"),
|
|
3932
3982
|
external_footprint_load_error_id: getZodPrefixedIdWithDefault(
|
|
3933
3983
|
"external_footprint_load_error"
|
|
3934
3984
|
),
|
|
3935
|
-
pcb_component_id:
|
|
3936
|
-
source_component_id:
|
|
3937
|
-
pcb_group_id:
|
|
3938
|
-
subcircuit_id:
|
|
3939
|
-
footprinter_string:
|
|
3940
|
-
error_type:
|
|
3985
|
+
pcb_component_id: z173.string(),
|
|
3986
|
+
source_component_id: z173.string(),
|
|
3987
|
+
pcb_group_id: z173.string().optional(),
|
|
3988
|
+
subcircuit_id: z173.string().optional(),
|
|
3989
|
+
footprinter_string: z173.string().optional(),
|
|
3990
|
+
error_type: z173.literal("external_footprint_load_error").default("external_footprint_load_error")
|
|
3941
3991
|
}).describe("Defines an error when an external footprint fails to load");
|
|
3942
3992
|
expectTypesMatch(true);
|
|
3943
3993
|
|
|
3944
3994
|
// src/pcb/circuit_json_footprint_load_error.ts
|
|
3945
|
-
import { z as
|
|
3995
|
+
import { z as z174 } from "zod";
|
|
3946
3996
|
var circuit_json_footprint_load_error = base_circuit_json_error.extend({
|
|
3947
|
-
type:
|
|
3997
|
+
type: z174.literal("circuit_json_footprint_load_error"),
|
|
3948
3998
|
circuit_json_footprint_load_error_id: getZodPrefixedIdWithDefault(
|
|
3949
3999
|
"circuit_json_footprint_load_error"
|
|
3950
4000
|
),
|
|
3951
|
-
pcb_component_id:
|
|
3952
|
-
source_component_id:
|
|
3953
|
-
pcb_group_id:
|
|
3954
|
-
subcircuit_id:
|
|
3955
|
-
error_type:
|
|
3956
|
-
circuit_json:
|
|
4001
|
+
pcb_component_id: z174.string(),
|
|
4002
|
+
source_component_id: z174.string(),
|
|
4003
|
+
pcb_group_id: z174.string().optional(),
|
|
4004
|
+
subcircuit_id: z174.string().optional(),
|
|
4005
|
+
error_type: z174.literal("circuit_json_footprint_load_error").default("circuit_json_footprint_load_error"),
|
|
4006
|
+
circuit_json: z174.array(z174.any()).optional()
|
|
3957
4007
|
}).describe("Defines an error when a circuit JSON footprint fails to load");
|
|
3958
4008
|
expectTypesMatch(true);
|
|
3959
4009
|
|
|
3960
4010
|
// src/pcb/pcb_group.ts
|
|
3961
|
-
import { z as
|
|
3962
|
-
var pcb_group =
|
|
3963
|
-
type:
|
|
4011
|
+
import { z as z175 } from "zod";
|
|
4012
|
+
var pcb_group = z175.object({
|
|
4013
|
+
type: z175.literal("pcb_group"),
|
|
3964
4014
|
pcb_group_id: getZodPrefixedIdWithDefault("pcb_group"),
|
|
3965
|
-
source_group_id:
|
|
3966
|
-
is_subcircuit:
|
|
3967
|
-
subcircuit_id:
|
|
4015
|
+
source_group_id: z175.string(),
|
|
4016
|
+
is_subcircuit: z175.boolean().optional(),
|
|
4017
|
+
subcircuit_id: z175.string().optional(),
|
|
3968
4018
|
width: length.optional(),
|
|
3969
4019
|
height: length.optional(),
|
|
3970
4020
|
center: point,
|
|
3971
|
-
display_offset_x:
|
|
4021
|
+
display_offset_x: z175.string().optional().describe(
|
|
3972
4022
|
"How to display the x offset for this group, usually corresponding with how the user specified it"
|
|
3973
4023
|
),
|
|
3974
|
-
display_offset_y:
|
|
4024
|
+
display_offset_y: z175.string().optional().describe(
|
|
3975
4025
|
"How to display the y offset for this group, usually corresponding with how the user specified it"
|
|
3976
4026
|
),
|
|
3977
|
-
outline:
|
|
4027
|
+
outline: z175.array(point).optional(),
|
|
3978
4028
|
anchor_position: point.optional(),
|
|
3979
4029
|
anchor_alignment: ninePointAnchor.default("center"),
|
|
3980
|
-
position_mode:
|
|
3981
|
-
positioned_relative_to_pcb_group_id:
|
|
3982
|
-
positioned_relative_to_pcb_board_id:
|
|
3983
|
-
pcb_component_ids:
|
|
3984
|
-
child_layout_mode:
|
|
3985
|
-
name:
|
|
3986
|
-
description:
|
|
3987
|
-
layout_mode:
|
|
3988
|
-
autorouter_configuration:
|
|
4030
|
+
position_mode: z175.enum(["packed", "relative_to_group_anchor", "none"]).optional(),
|
|
4031
|
+
positioned_relative_to_pcb_group_id: z175.string().optional(),
|
|
4032
|
+
positioned_relative_to_pcb_board_id: z175.string().optional(),
|
|
4033
|
+
pcb_component_ids: z175.array(z175.string()),
|
|
4034
|
+
child_layout_mode: z175.enum(["packed", "none"]).optional(),
|
|
4035
|
+
name: z175.string().optional(),
|
|
4036
|
+
description: z175.string().optional(),
|
|
4037
|
+
layout_mode: z175.string().optional(),
|
|
4038
|
+
autorouter_configuration: z175.object({
|
|
3989
4039
|
trace_clearance: length
|
|
3990
4040
|
}).optional(),
|
|
3991
|
-
autorouter_used_string:
|
|
4041
|
+
autorouter_used_string: z175.string().optional()
|
|
3992
4042
|
}).describe("Defines a group of components on the PCB");
|
|
3993
4043
|
expectTypesMatch(true);
|
|
3994
4044
|
|
|
3995
4045
|
// src/pcb/pcb_autorouting_error.ts
|
|
3996
|
-
import { z as
|
|
4046
|
+
import { z as z176 } from "zod";
|
|
3997
4047
|
var pcb_autorouting_error = base_circuit_json_error.extend({
|
|
3998
|
-
type:
|
|
4048
|
+
type: z176.literal("pcb_autorouting_error"),
|
|
3999
4049
|
pcb_error_id: getZodPrefixedIdWithDefault("pcb_autorouting_error"),
|
|
4000
|
-
error_type:
|
|
4001
|
-
subcircuit_id:
|
|
4050
|
+
error_type: z176.literal("pcb_autorouting_error").default("pcb_autorouting_error"),
|
|
4051
|
+
subcircuit_id: z176.string().optional()
|
|
4002
4052
|
}).describe("The autorouting has failed to route a portion of the board");
|
|
4003
4053
|
expectTypesMatch(true);
|
|
4004
4054
|
|
|
4005
4055
|
// src/pcb/pcb_preflight_routing_error.ts
|
|
4006
|
-
import { z as
|
|
4056
|
+
import { z as z177 } from "zod";
|
|
4007
4057
|
var pcb_preflight_routing_error = base_circuit_json_error.extend({
|
|
4008
|
-
type:
|
|
4058
|
+
type: z177.literal("pcb_preflight_routing_error"),
|
|
4009
4059
|
pcb_preflight_routing_error_id: getZodPrefixedIdWithDefault(
|
|
4010
4060
|
"pcb_preflight_routing_error"
|
|
4011
4061
|
),
|
|
4012
|
-
error_type:
|
|
4013
|
-
error_code:
|
|
4014
|
-
subcircuit_id:
|
|
4015
|
-
pcb_group_id:
|
|
4016
|
-
routing_phase_index:
|
|
4017
|
-
phase_name:
|
|
4018
|
-
source_trace_ids:
|
|
4019
|
-
pcb_component_ids:
|
|
4020
|
-
pcb_port_ids:
|
|
4021
|
-
related_error_ids:
|
|
4022
|
-
measurements:
|
|
4062
|
+
error_type: z177.literal("pcb_preflight_routing_error").default("pcb_preflight_routing_error"),
|
|
4063
|
+
error_code: z177.string(),
|
|
4064
|
+
subcircuit_id: z177.string().optional(),
|
|
4065
|
+
pcb_group_id: z177.string().optional(),
|
|
4066
|
+
routing_phase_index: z177.number().int().optional(),
|
|
4067
|
+
phase_name: z177.string().optional(),
|
|
4068
|
+
source_trace_ids: z177.array(z177.string()).optional(),
|
|
4069
|
+
pcb_component_ids: z177.array(z177.string()).optional(),
|
|
4070
|
+
pcb_port_ids: z177.array(z177.string()).optional(),
|
|
4071
|
+
related_error_ids: z177.array(z177.string()).optional(),
|
|
4072
|
+
measurements: z177.record(z177.number().finite()).optional()
|
|
4023
4073
|
});
|
|
4024
4074
|
expectTypesMatch(true);
|
|
4025
4075
|
|
|
4026
4076
|
// src/pcb/pcb_manual_edit_conflict_warning.ts
|
|
4027
|
-
import { z as
|
|
4028
|
-
var pcb_manual_edit_conflict_warning =
|
|
4029
|
-
type:
|
|
4077
|
+
import { z as z178 } from "zod";
|
|
4078
|
+
var pcb_manual_edit_conflict_warning = z178.object({
|
|
4079
|
+
type: z178.literal("pcb_manual_edit_conflict_warning"),
|
|
4030
4080
|
pcb_manual_edit_conflict_warning_id: getZodPrefixedIdWithDefault(
|
|
4031
4081
|
"pcb_manual_edit_conflict_warning"
|
|
4032
4082
|
),
|
|
4033
|
-
warning_type:
|
|
4034
|
-
message:
|
|
4035
|
-
pcb_component_id:
|
|
4036
|
-
pcb_group_id:
|
|
4037
|
-
subcircuit_id:
|
|
4038
|
-
source_component_id:
|
|
4083
|
+
warning_type: z178.literal("pcb_manual_edit_conflict_warning").default("pcb_manual_edit_conflict_warning"),
|
|
4084
|
+
message: z178.string(),
|
|
4085
|
+
pcb_component_id: z178.string(),
|
|
4086
|
+
pcb_group_id: z178.string().optional(),
|
|
4087
|
+
subcircuit_id: z178.string().optional(),
|
|
4088
|
+
source_component_id: z178.string()
|
|
4039
4089
|
}).describe(
|
|
4040
4090
|
"Warning emitted when a component has both manual placement and explicit pcbX/pcbY coordinates"
|
|
4041
4091
|
);
|
|
4042
4092
|
expectTypesMatch(true);
|
|
4043
4093
|
|
|
4044
4094
|
// src/pcb/pcb_connector_not_in_accessible_orientation_warning.ts
|
|
4045
|
-
import { z as
|
|
4046
|
-
var connectorOrientationDirection =
|
|
4047
|
-
var pcb_connector_not_in_accessible_orientation_warning =
|
|
4048
|
-
type:
|
|
4095
|
+
import { z as z179 } from "zod";
|
|
4096
|
+
var connectorOrientationDirection = z179.enum(["x-", "x+", "y+", "y-"]);
|
|
4097
|
+
var pcb_connector_not_in_accessible_orientation_warning = z179.object({
|
|
4098
|
+
type: z179.literal("pcb_connector_not_in_accessible_orientation_warning"),
|
|
4049
4099
|
pcb_connector_not_in_accessible_orientation_warning_id: getZodPrefixedIdWithDefault(
|
|
4050
4100
|
"pcb_connector_not_in_accessible_orientation_warning"
|
|
4051
4101
|
),
|
|
4052
|
-
warning_type:
|
|
4053
|
-
message:
|
|
4054
|
-
pcb_component_id:
|
|
4055
|
-
source_component_id:
|
|
4056
|
-
pcb_board_id:
|
|
4102
|
+
warning_type: z179.literal("pcb_connector_not_in_accessible_orientation_warning").default("pcb_connector_not_in_accessible_orientation_warning"),
|
|
4103
|
+
message: z179.string(),
|
|
4104
|
+
pcb_component_id: z179.string(),
|
|
4105
|
+
source_component_id: z179.string().optional(),
|
|
4106
|
+
pcb_board_id: z179.string().optional(),
|
|
4057
4107
|
facing_direction: connectorOrientationDirection,
|
|
4058
4108
|
recommended_facing_direction: connectorOrientationDirection,
|
|
4059
|
-
subcircuit_id:
|
|
4109
|
+
subcircuit_id: z179.string().optional()
|
|
4060
4110
|
}).describe(
|
|
4061
4111
|
"Warning emitted when a connector PCB component is facing inward toward the board and should be reoriented to an outward-facing direction"
|
|
4062
4112
|
);
|
|
4063
4113
|
expectTypesMatch(true);
|
|
4064
4114
|
|
|
4065
4115
|
// src/pcb/pcb_component_missing_courtyard_warning.ts
|
|
4066
|
-
import { z as
|
|
4067
|
-
var pcb_component_missing_courtyard_warning =
|
|
4068
|
-
type:
|
|
4116
|
+
import { z as z180 } from "zod";
|
|
4117
|
+
var pcb_component_missing_courtyard_warning = z180.object({
|
|
4118
|
+
type: z180.literal("pcb_component_missing_courtyard_warning"),
|
|
4069
4119
|
pcb_component_missing_courtyard_warning_id: getZodPrefixedIdWithDefault(
|
|
4070
4120
|
"pcb_component_missing_courtyard_warning"
|
|
4071
4121
|
),
|
|
4072
|
-
warning_type:
|
|
4073
|
-
message:
|
|
4074
|
-
pcb_component_id:
|
|
4075
|
-
source_component_id:
|
|
4076
|
-
subcircuit_id:
|
|
4122
|
+
warning_type: z180.literal("pcb_component_missing_courtyard_warning").default("pcb_component_missing_courtyard_warning"),
|
|
4123
|
+
message: z180.string(),
|
|
4124
|
+
pcb_component_id: z180.string(),
|
|
4125
|
+
source_component_id: z180.string().optional(),
|
|
4126
|
+
subcircuit_id: z180.string().optional()
|
|
4077
4127
|
}).describe("Warning emitted when a PCB component has no courtyard geometry");
|
|
4078
4128
|
expectTypesMatch(true);
|
|
4079
4129
|
|
|
4080
4130
|
// src/pcb/supplier_footprint_mismatch_warning.ts
|
|
4081
|
-
import { z as
|
|
4082
|
-
var supplier_footprint_mismatch_warning =
|
|
4083
|
-
type:
|
|
4131
|
+
import { z as z181 } from "zod";
|
|
4132
|
+
var supplier_footprint_mismatch_warning = z181.object({
|
|
4133
|
+
type: z181.literal("supplier_footprint_mismatch_warning"),
|
|
4084
4134
|
supplier_footprint_mismatch_warning_id: getZodPrefixedIdWithDefault(
|
|
4085
4135
|
"supplier_footprint_mismatch_warning"
|
|
4086
4136
|
),
|
|
4087
|
-
warning_type:
|
|
4088
|
-
message:
|
|
4089
|
-
source_component_id:
|
|
4090
|
-
pcb_component_id:
|
|
4091
|
-
pcb_group_id:
|
|
4092
|
-
subcircuit_id:
|
|
4137
|
+
warning_type: z181.literal("supplier_footprint_mismatch_warning").default("supplier_footprint_mismatch_warning"),
|
|
4138
|
+
message: z181.string(),
|
|
4139
|
+
source_component_id: z181.string(),
|
|
4140
|
+
pcb_component_id: z181.string().optional(),
|
|
4141
|
+
pcb_group_id: z181.string().optional(),
|
|
4142
|
+
subcircuit_id: z181.string().optional(),
|
|
4093
4143
|
supplier_name: supplier_name.optional(),
|
|
4094
|
-
supplier_part_number:
|
|
4095
|
-
supplier_footprint_url:
|
|
4096
|
-
footprint_copper_intersection_over_union:
|
|
4144
|
+
supplier_part_number: z181.string().optional(),
|
|
4145
|
+
supplier_footprint_url: z181.string().optional(),
|
|
4146
|
+
footprint_copper_intersection_over_union: z181.number()
|
|
4097
4147
|
}).describe(
|
|
4098
4148
|
"Warning emitted when a supplier part footprint does not match the expected footprint"
|
|
4099
4149
|
);
|
|
4100
4150
|
expectTypesMatch(true);
|
|
4101
4151
|
|
|
4102
4152
|
// src/pcb/pcb_fabricator_extra_charge_warning.ts
|
|
4103
|
-
import { z as
|
|
4104
|
-
var pcb_fabricator_extra_charge_warning =
|
|
4105
|
-
type:
|
|
4153
|
+
import { z as z182 } from "zod";
|
|
4154
|
+
var pcb_fabricator_extra_charge_warning = z182.object({
|
|
4155
|
+
type: z182.literal("pcb_fabricator_extra_charge_warning"),
|
|
4106
4156
|
pcb_fabricator_extra_charge_warning_id: getZodPrefixedIdWithDefault(
|
|
4107
4157
|
"pcb_fabricator_extra_charge_warning"
|
|
4108
4158
|
),
|
|
4109
|
-
warning_type:
|
|
4110
|
-
message:
|
|
4111
|
-
fabricator_preset:
|
|
4112
|
-
pcb_board_id:
|
|
4113
|
-
pcb_via_ids:
|
|
4114
|
-
subcircuit_id:
|
|
4159
|
+
warning_type: z182.literal("pcb_fabricator_extra_charge_warning").default("pcb_fabricator_extra_charge_warning"),
|
|
4160
|
+
message: z182.string(),
|
|
4161
|
+
fabricator_preset: z182.string(),
|
|
4162
|
+
pcb_board_id: z182.string().optional(),
|
|
4163
|
+
pcb_via_ids: z182.array(z182.string()).optional(),
|
|
4164
|
+
subcircuit_id: z182.string().optional()
|
|
4115
4165
|
}).describe(
|
|
4116
4166
|
"Warning that a design feature incurs an extra charge for the selected fabricator preset, such as via hole diameters below 0.3 mm with JLCPCB economy or standard presets."
|
|
4117
4167
|
);
|
|
4118
4168
|
expectTypesMatch(true);
|
|
4119
4169
|
|
|
4120
4170
|
// src/pcb/pcb_breakout_point.ts
|
|
4121
|
-
import { z as
|
|
4122
|
-
var pcb_breakout_point =
|
|
4123
|
-
type:
|
|
4171
|
+
import { z as z183 } from "zod";
|
|
4172
|
+
var pcb_breakout_point = z183.object({
|
|
4173
|
+
type: z183.literal("pcb_breakout_point"),
|
|
4124
4174
|
pcb_breakout_point_id: getZodPrefixedIdWithDefault("pcb_breakout_point"),
|
|
4125
|
-
pcb_group_id:
|
|
4126
|
-
subcircuit_id:
|
|
4127
|
-
source_trace_id:
|
|
4128
|
-
source_port_id:
|
|
4129
|
-
source_net_id:
|
|
4175
|
+
pcb_group_id: z183.string(),
|
|
4176
|
+
subcircuit_id: z183.string().optional(),
|
|
4177
|
+
source_trace_id: z183.string().optional(),
|
|
4178
|
+
source_port_id: z183.string().optional(),
|
|
4179
|
+
source_net_id: z183.string().optional(),
|
|
4130
4180
|
layer: layer_ref.optional(),
|
|
4131
4181
|
x: distance,
|
|
4132
4182
|
y: distance
|
|
@@ -4136,61 +4186,61 @@ var pcb_breakout_point = z182.object({
|
|
|
4136
4186
|
expectTypesMatch(true);
|
|
4137
4187
|
|
|
4138
4188
|
// src/pcb/pcb_ground_plane.ts
|
|
4139
|
-
import { z as
|
|
4140
|
-
var pcb_ground_plane =
|
|
4141
|
-
type:
|
|
4189
|
+
import { z as z184 } from "zod";
|
|
4190
|
+
var pcb_ground_plane = z184.object({
|
|
4191
|
+
type: z184.literal("pcb_ground_plane"),
|
|
4142
4192
|
pcb_ground_plane_id: getZodPrefixedIdWithDefault("pcb_ground_plane"),
|
|
4143
|
-
source_pcb_ground_plane_id:
|
|
4144
|
-
source_net_id:
|
|
4145
|
-
pcb_group_id:
|
|
4146
|
-
subcircuit_id:
|
|
4193
|
+
source_pcb_ground_plane_id: z184.string(),
|
|
4194
|
+
source_net_id: z184.string(),
|
|
4195
|
+
pcb_group_id: z184.string().optional(),
|
|
4196
|
+
subcircuit_id: z184.string().optional()
|
|
4147
4197
|
}).describe("Defines a ground plane on the PCB");
|
|
4148
4198
|
expectTypesMatch(true);
|
|
4149
4199
|
|
|
4150
4200
|
// src/pcb/pcb_ground_plane_region.ts
|
|
4151
|
-
import { z as
|
|
4152
|
-
var pcb_ground_plane_region =
|
|
4153
|
-
type:
|
|
4201
|
+
import { z as z185 } from "zod";
|
|
4202
|
+
var pcb_ground_plane_region = z185.object({
|
|
4203
|
+
type: z185.literal("pcb_ground_plane_region"),
|
|
4154
4204
|
pcb_ground_plane_region_id: getZodPrefixedIdWithDefault(
|
|
4155
4205
|
"pcb_ground_plane_region"
|
|
4156
4206
|
),
|
|
4157
|
-
pcb_ground_plane_id:
|
|
4158
|
-
pcb_group_id:
|
|
4159
|
-
subcircuit_id:
|
|
4207
|
+
pcb_ground_plane_id: z185.string(),
|
|
4208
|
+
pcb_group_id: z185.string().optional(),
|
|
4209
|
+
subcircuit_id: z185.string().optional(),
|
|
4160
4210
|
layer: layer_ref,
|
|
4161
|
-
points:
|
|
4211
|
+
points: z185.array(point)
|
|
4162
4212
|
}).describe("Defines a polygon region of a ground plane");
|
|
4163
4213
|
expectTypesMatch(true);
|
|
4164
4214
|
|
|
4165
4215
|
// src/pcb/pcb_thermal_spoke.ts
|
|
4166
|
-
import { z as
|
|
4167
|
-
var pcb_thermal_spoke =
|
|
4168
|
-
type:
|
|
4216
|
+
import { z as z186 } from "zod";
|
|
4217
|
+
var pcb_thermal_spoke = z186.object({
|
|
4218
|
+
type: z186.literal("pcb_thermal_spoke"),
|
|
4169
4219
|
pcb_thermal_spoke_id: getZodPrefixedIdWithDefault("pcb_thermal_spoke"),
|
|
4170
|
-
pcb_ground_plane_id:
|
|
4171
|
-
shape:
|
|
4172
|
-
spoke_count:
|
|
4220
|
+
pcb_ground_plane_id: z186.string(),
|
|
4221
|
+
shape: z186.string(),
|
|
4222
|
+
spoke_count: z186.number(),
|
|
4173
4223
|
spoke_thickness: distance,
|
|
4174
4224
|
spoke_inner_diameter: distance,
|
|
4175
4225
|
spoke_outer_diameter: distance,
|
|
4176
|
-
pcb_plated_hole_id:
|
|
4177
|
-
subcircuit_id:
|
|
4226
|
+
pcb_plated_hole_id: z186.string().optional(),
|
|
4227
|
+
subcircuit_id: z186.string().optional()
|
|
4178
4228
|
}).describe("Pattern for connecting a ground plane to a plated hole");
|
|
4179
4229
|
expectTypesMatch(true);
|
|
4180
4230
|
|
|
4181
4231
|
// src/pcb/pcb_copper_pour.ts
|
|
4182
|
-
import { z as
|
|
4183
|
-
var pcb_copper_pour_base =
|
|
4184
|
-
type:
|
|
4232
|
+
import { z as z187 } from "zod";
|
|
4233
|
+
var pcb_copper_pour_base = z187.object({
|
|
4234
|
+
type: z187.literal("pcb_copper_pour"),
|
|
4185
4235
|
pcb_copper_pour_id: getZodPrefixedIdWithDefault("pcb_copper_pour"),
|
|
4186
|
-
pcb_group_id:
|
|
4187
|
-
subcircuit_id:
|
|
4236
|
+
pcb_group_id: z187.string().optional(),
|
|
4237
|
+
subcircuit_id: z187.string().optional(),
|
|
4188
4238
|
layer: layer_ref,
|
|
4189
|
-
source_net_id:
|
|
4190
|
-
covered_with_solder_mask:
|
|
4239
|
+
source_net_id: z187.string().optional(),
|
|
4240
|
+
covered_with_solder_mask: z187.boolean().optional().default(true)
|
|
4191
4241
|
});
|
|
4192
4242
|
var pcb_copper_pour_rect = pcb_copper_pour_base.extend({
|
|
4193
|
-
shape:
|
|
4243
|
+
shape: z187.literal("rect"),
|
|
4194
4244
|
center: point,
|
|
4195
4245
|
width: length,
|
|
4196
4246
|
height: length,
|
|
@@ -4198,16 +4248,16 @@ var pcb_copper_pour_rect = pcb_copper_pour_base.extend({
|
|
|
4198
4248
|
});
|
|
4199
4249
|
expectTypesMatch(true);
|
|
4200
4250
|
var pcb_copper_pour_brep = pcb_copper_pour_base.extend({
|
|
4201
|
-
shape:
|
|
4251
|
+
shape: z187.literal("brep"),
|
|
4202
4252
|
brep_shape
|
|
4203
4253
|
});
|
|
4204
4254
|
expectTypesMatch(true);
|
|
4205
4255
|
var pcb_copper_pour_polygon = pcb_copper_pour_base.extend({
|
|
4206
|
-
shape:
|
|
4207
|
-
points:
|
|
4256
|
+
shape: z187.literal("polygon"),
|
|
4257
|
+
points: z187.array(point)
|
|
4208
4258
|
});
|
|
4209
4259
|
expectTypesMatch(true);
|
|
4210
|
-
var pcb_copper_pour =
|
|
4260
|
+
var pcb_copper_pour = z187.discriminatedUnion("shape", [
|
|
4211
4261
|
pcb_copper_pour_rect,
|
|
4212
4262
|
pcb_copper_pour_brep,
|
|
4213
4263
|
pcb_copper_pour_polygon
|
|
@@ -4215,99 +4265,99 @@ var pcb_copper_pour = z186.discriminatedUnion("shape", [
|
|
|
4215
4265
|
expectTypesMatch(true);
|
|
4216
4266
|
|
|
4217
4267
|
// src/pcb/pcb_component_outside_board_error.ts
|
|
4218
|
-
import { z as
|
|
4268
|
+
import { z as z188 } from "zod";
|
|
4219
4269
|
var pcb_component_outside_board_error = base_circuit_json_error.extend({
|
|
4220
|
-
type:
|
|
4270
|
+
type: z188.literal("pcb_component_outside_board_error"),
|
|
4221
4271
|
pcb_component_outside_board_error_id: getZodPrefixedIdWithDefault(
|
|
4222
4272
|
"pcb_component_outside_board_error"
|
|
4223
4273
|
),
|
|
4224
|
-
error_type:
|
|
4225
|
-
pcb_component_id:
|
|
4226
|
-
pcb_board_id:
|
|
4274
|
+
error_type: z188.literal("pcb_component_outside_board_error").default("pcb_component_outside_board_error"),
|
|
4275
|
+
pcb_component_id: z188.string(),
|
|
4276
|
+
pcb_board_id: z188.string(),
|
|
4227
4277
|
component_center: point,
|
|
4228
|
-
component_bounds:
|
|
4229
|
-
min_x:
|
|
4230
|
-
max_x:
|
|
4231
|
-
min_y:
|
|
4232
|
-
max_y:
|
|
4278
|
+
component_bounds: z188.object({
|
|
4279
|
+
min_x: z188.number(),
|
|
4280
|
+
max_x: z188.number(),
|
|
4281
|
+
min_y: z188.number(),
|
|
4282
|
+
max_y: z188.number()
|
|
4233
4283
|
}),
|
|
4234
|
-
subcircuit_id:
|
|
4235
|
-
source_component_id:
|
|
4284
|
+
subcircuit_id: z188.string().optional(),
|
|
4285
|
+
source_component_id: z188.string().optional()
|
|
4236
4286
|
}).describe(
|
|
4237
4287
|
"Error emitted when a PCB component is placed outside the board boundaries"
|
|
4238
4288
|
);
|
|
4239
4289
|
expectTypesMatch(true);
|
|
4240
4290
|
|
|
4241
4291
|
// src/pcb/pcb_component_not_on_board_edge_error.ts
|
|
4242
|
-
import { z as
|
|
4292
|
+
import { z as z189 } from "zod";
|
|
4243
4293
|
var pcb_component_not_on_board_edge_error = base_circuit_json_error.extend({
|
|
4244
|
-
type:
|
|
4294
|
+
type: z189.literal("pcb_component_not_on_board_edge_error"),
|
|
4245
4295
|
pcb_component_not_on_board_edge_error_id: getZodPrefixedIdWithDefault(
|
|
4246
4296
|
"pcb_component_not_on_board_edge_error"
|
|
4247
4297
|
),
|
|
4248
|
-
error_type:
|
|
4249
|
-
pcb_component_id:
|
|
4250
|
-
pcb_board_id:
|
|
4298
|
+
error_type: z189.literal("pcb_component_not_on_board_edge_error").default("pcb_component_not_on_board_edge_error"),
|
|
4299
|
+
pcb_component_id: z189.string(),
|
|
4300
|
+
pcb_board_id: z189.string(),
|
|
4251
4301
|
component_center: point,
|
|
4252
|
-
pad_to_nearest_board_edge_distance:
|
|
4253
|
-
source_component_id:
|
|
4254
|
-
subcircuit_id:
|
|
4302
|
+
pad_to_nearest_board_edge_distance: z189.number(),
|
|
4303
|
+
source_component_id: z189.string().optional(),
|
|
4304
|
+
subcircuit_id: z189.string().optional()
|
|
4255
4305
|
}).describe(
|
|
4256
4306
|
"Error emitted when a component that must be placed on the board edge is centered away from the edge"
|
|
4257
4307
|
);
|
|
4258
4308
|
expectTypesMatch(true);
|
|
4259
4309
|
|
|
4260
4310
|
// src/pcb/pcb_component_invalid_layer_error.ts
|
|
4261
|
-
import { z as
|
|
4311
|
+
import { z as z190 } from "zod";
|
|
4262
4312
|
var pcb_component_invalid_layer_error = base_circuit_json_error.extend({
|
|
4263
|
-
type:
|
|
4313
|
+
type: z190.literal("pcb_component_invalid_layer_error"),
|
|
4264
4314
|
pcb_component_invalid_layer_error_id: getZodPrefixedIdWithDefault(
|
|
4265
4315
|
"pcb_component_invalid_layer_error"
|
|
4266
4316
|
),
|
|
4267
|
-
error_type:
|
|
4268
|
-
pcb_component_id:
|
|
4269
|
-
source_component_id:
|
|
4317
|
+
error_type: z190.literal("pcb_component_invalid_layer_error").default("pcb_component_invalid_layer_error"),
|
|
4318
|
+
pcb_component_id: z190.string().optional(),
|
|
4319
|
+
source_component_id: z190.string(),
|
|
4270
4320
|
layer: layer_ref,
|
|
4271
|
-
subcircuit_id:
|
|
4321
|
+
subcircuit_id: z190.string().optional()
|
|
4272
4322
|
}).describe(
|
|
4273
4323
|
"Error emitted when a component is placed on an invalid layer (components can only be on 'top' or 'bottom' layers)"
|
|
4274
4324
|
);
|
|
4275
4325
|
expectTypesMatch(true);
|
|
4276
4326
|
|
|
4277
4327
|
// src/pcb/pcb_via_clearance_error.ts
|
|
4278
|
-
import { z as
|
|
4328
|
+
import { z as z191 } from "zod";
|
|
4279
4329
|
var pcb_via_clearance_error = base_circuit_json_error.extend({
|
|
4280
|
-
type:
|
|
4330
|
+
type: z191.literal("pcb_via_clearance_error"),
|
|
4281
4331
|
pcb_error_id: getZodPrefixedIdWithDefault("pcb_error"),
|
|
4282
|
-
error_type:
|
|
4283
|
-
pcb_via_ids:
|
|
4332
|
+
error_type: z191.literal("pcb_via_clearance_error").default("pcb_via_clearance_error"),
|
|
4333
|
+
pcb_via_ids: z191.array(z191.string()).min(2),
|
|
4284
4334
|
minimum_clearance: distance.optional(),
|
|
4285
4335
|
actual_clearance: distance.optional(),
|
|
4286
|
-
pcb_center:
|
|
4287
|
-
x:
|
|
4288
|
-
y:
|
|
4336
|
+
pcb_center: z191.object({
|
|
4337
|
+
x: z191.number().optional(),
|
|
4338
|
+
y: z191.number().optional()
|
|
4289
4339
|
}).optional(),
|
|
4290
|
-
subcircuit_id:
|
|
4340
|
+
subcircuit_id: z191.string().optional()
|
|
4291
4341
|
}).describe("Error emitted when vias are closer than the allowed clearance");
|
|
4292
4342
|
expectTypesMatch(true);
|
|
4293
4343
|
|
|
4294
4344
|
// src/pcb/pcb_via_trace_clearance_error.ts
|
|
4295
|
-
import { z as
|
|
4345
|
+
import { z as z192 } from "zod";
|
|
4296
4346
|
var pcb_via_trace_clearance_error = base_circuit_json_error.extend({
|
|
4297
|
-
type:
|
|
4347
|
+
type: z192.literal("pcb_via_trace_clearance_error"),
|
|
4298
4348
|
pcb_via_trace_clearance_error_id: getZodPrefixedIdWithDefault(
|
|
4299
4349
|
"pcb_via_trace_clearance_error"
|
|
4300
4350
|
),
|
|
4301
|
-
error_type:
|
|
4302
|
-
pcb_via_id:
|
|
4303
|
-
pcb_trace_id:
|
|
4351
|
+
error_type: z192.literal("pcb_via_trace_clearance_error").default("pcb_via_trace_clearance_error"),
|
|
4352
|
+
pcb_via_id: z192.string(),
|
|
4353
|
+
pcb_trace_id: z192.string(),
|
|
4304
4354
|
minimum_clearance: distance.optional(),
|
|
4305
4355
|
actual_clearance: distance.optional(),
|
|
4306
|
-
center:
|
|
4307
|
-
x:
|
|
4308
|
-
y:
|
|
4356
|
+
center: z192.object({
|
|
4357
|
+
x: z192.number().optional(),
|
|
4358
|
+
y: z192.number().optional()
|
|
4309
4359
|
}).optional(),
|
|
4310
|
-
subcircuit_id:
|
|
4360
|
+
subcircuit_id: z192.string().optional()
|
|
4311
4361
|
}).describe(
|
|
4312
4362
|
"Error emitted when a via and trace are closer than the allowed clearance"
|
|
4313
4363
|
);
|
|
@@ -4316,41 +4366,41 @@ expectTypesMatch(
|
|
|
4316
4366
|
);
|
|
4317
4367
|
|
|
4318
4368
|
// src/pcb/pcb_pad_pad_clearance_error.ts
|
|
4319
|
-
import { z as
|
|
4369
|
+
import { z as z193 } from "zod";
|
|
4320
4370
|
var pcb_pad_pad_clearance_error = base_circuit_json_error.extend({
|
|
4321
|
-
type:
|
|
4371
|
+
type: z193.literal("pcb_pad_pad_clearance_error"),
|
|
4322
4372
|
pcb_pad_pad_clearance_error_id: getZodPrefixedIdWithDefault(
|
|
4323
4373
|
"pcb_pad_pad_clearance_error"
|
|
4324
4374
|
),
|
|
4325
|
-
error_type:
|
|
4326
|
-
pcb_pad_ids:
|
|
4375
|
+
error_type: z193.literal("pcb_pad_pad_clearance_error").default("pcb_pad_pad_clearance_error"),
|
|
4376
|
+
pcb_pad_ids: z193.array(z193.string()).min(2),
|
|
4327
4377
|
minimum_clearance: distance.optional(),
|
|
4328
4378
|
actual_clearance: distance.optional(),
|
|
4329
|
-
center:
|
|
4330
|
-
x:
|
|
4331
|
-
y:
|
|
4379
|
+
center: z193.object({
|
|
4380
|
+
x: z193.number().optional(),
|
|
4381
|
+
y: z193.number().optional()
|
|
4332
4382
|
}).optional(),
|
|
4333
|
-
subcircuit_id:
|
|
4383
|
+
subcircuit_id: z193.string().optional()
|
|
4334
4384
|
}).describe("Error emitted when pads are closer than the allowed clearance");
|
|
4335
4385
|
expectTypesMatch(true);
|
|
4336
4386
|
|
|
4337
4387
|
// src/pcb/pcb_pad_trace_clearance_error.ts
|
|
4338
|
-
import { z as
|
|
4388
|
+
import { z as z194 } from "zod";
|
|
4339
4389
|
var pcb_pad_trace_clearance_error = base_circuit_json_error.extend({
|
|
4340
|
-
type:
|
|
4390
|
+
type: z194.literal("pcb_pad_trace_clearance_error"),
|
|
4341
4391
|
pcb_pad_trace_clearance_error_id: getZodPrefixedIdWithDefault(
|
|
4342
4392
|
"pcb_pad_trace_clearance_error"
|
|
4343
4393
|
),
|
|
4344
|
-
error_type:
|
|
4345
|
-
pcb_pad_id:
|
|
4346
|
-
pcb_trace_id:
|
|
4394
|
+
error_type: z194.literal("pcb_pad_trace_clearance_error").default("pcb_pad_trace_clearance_error"),
|
|
4395
|
+
pcb_pad_id: z194.string(),
|
|
4396
|
+
pcb_trace_id: z194.string(),
|
|
4347
4397
|
minimum_clearance: distance.optional(),
|
|
4348
4398
|
actual_clearance: distance.optional(),
|
|
4349
|
-
center:
|
|
4350
|
-
x:
|
|
4351
|
-
y:
|
|
4399
|
+
center: z194.object({
|
|
4400
|
+
x: z194.number().optional(),
|
|
4401
|
+
y: z194.number().optional()
|
|
4352
4402
|
}).optional(),
|
|
4353
|
-
subcircuit_id:
|
|
4403
|
+
subcircuit_id: z194.string().optional()
|
|
4354
4404
|
}).describe(
|
|
4355
4405
|
"Error emitted when a pad and trace are closer than allowed clearance"
|
|
4356
4406
|
);
|
|
@@ -4359,89 +4409,89 @@ expectTypesMatch(
|
|
|
4359
4409
|
);
|
|
4360
4410
|
|
|
4361
4411
|
// src/pcb/pcb_courtyard_rect.ts
|
|
4362
|
-
import { z as
|
|
4363
|
-
var pcb_courtyard_rect =
|
|
4364
|
-
type:
|
|
4412
|
+
import { z as z195 } from "zod";
|
|
4413
|
+
var pcb_courtyard_rect = z195.object({
|
|
4414
|
+
type: z195.literal("pcb_courtyard_rect"),
|
|
4365
4415
|
pcb_courtyard_rect_id: getZodPrefixedIdWithDefault("pcb_courtyard_rect"),
|
|
4366
|
-
pcb_component_id:
|
|
4367
|
-
pcb_group_id:
|
|
4368
|
-
subcircuit_id:
|
|
4416
|
+
pcb_component_id: z195.string(),
|
|
4417
|
+
pcb_group_id: z195.string().optional(),
|
|
4418
|
+
subcircuit_id: z195.string().optional(),
|
|
4369
4419
|
center: point,
|
|
4370
4420
|
width: length,
|
|
4371
4421
|
height: length,
|
|
4372
4422
|
layer: visible_layer,
|
|
4373
4423
|
ccw_rotation: rotation.optional(),
|
|
4374
|
-
color:
|
|
4424
|
+
color: z195.string().optional()
|
|
4375
4425
|
}).describe("Defines a courtyard rectangle on the PCB");
|
|
4376
4426
|
expectTypesMatch(true);
|
|
4377
4427
|
|
|
4378
4428
|
// src/pcb/pcb_courtyard_outline.ts
|
|
4379
|
-
import { z as
|
|
4380
|
-
var pcb_courtyard_outline =
|
|
4381
|
-
type:
|
|
4429
|
+
import { z as z196 } from "zod";
|
|
4430
|
+
var pcb_courtyard_outline = z196.object({
|
|
4431
|
+
type: z196.literal("pcb_courtyard_outline"),
|
|
4382
4432
|
pcb_courtyard_outline_id: getZodPrefixedIdWithDefault(
|
|
4383
4433
|
"pcb_courtyard_outline"
|
|
4384
4434
|
),
|
|
4385
|
-
pcb_component_id:
|
|
4386
|
-
pcb_group_id:
|
|
4387
|
-
subcircuit_id:
|
|
4435
|
+
pcb_component_id: z196.string(),
|
|
4436
|
+
pcb_group_id: z196.string().optional(),
|
|
4437
|
+
subcircuit_id: z196.string().optional(),
|
|
4388
4438
|
layer: visible_layer,
|
|
4389
|
-
outline:
|
|
4439
|
+
outline: z196.array(point).min(2)
|
|
4390
4440
|
}).describe("Defines a courtyard outline on the PCB");
|
|
4391
4441
|
expectTypesMatch(true);
|
|
4392
4442
|
|
|
4393
4443
|
// src/pcb/pcb_courtyard_polygon.ts
|
|
4394
|
-
import { z as
|
|
4395
|
-
var pcb_courtyard_polygon =
|
|
4396
|
-
type:
|
|
4444
|
+
import { z as z197 } from "zod";
|
|
4445
|
+
var pcb_courtyard_polygon = z197.object({
|
|
4446
|
+
type: z197.literal("pcb_courtyard_polygon"),
|
|
4397
4447
|
pcb_courtyard_polygon_id: getZodPrefixedIdWithDefault(
|
|
4398
4448
|
"pcb_courtyard_polygon"
|
|
4399
4449
|
),
|
|
4400
|
-
pcb_component_id:
|
|
4401
|
-
pcb_group_id:
|
|
4402
|
-
subcircuit_id:
|
|
4450
|
+
pcb_component_id: z197.string(),
|
|
4451
|
+
pcb_group_id: z197.string().optional(),
|
|
4452
|
+
subcircuit_id: z197.string().optional(),
|
|
4403
4453
|
layer: visible_layer,
|
|
4404
|
-
points:
|
|
4405
|
-
color:
|
|
4454
|
+
points: z197.array(point).min(3),
|
|
4455
|
+
color: z197.string().optional()
|
|
4406
4456
|
}).describe("Defines a courtyard polygon on the PCB");
|
|
4407
4457
|
expectTypesMatch(true);
|
|
4408
4458
|
|
|
4409
4459
|
// src/pcb/pcb_courtyard_circle.ts
|
|
4410
|
-
import { z as
|
|
4411
|
-
var pcb_courtyard_circle =
|
|
4412
|
-
type:
|
|
4460
|
+
import { z as z198 } from "zod";
|
|
4461
|
+
var pcb_courtyard_circle = z198.object({
|
|
4462
|
+
type: z198.literal("pcb_courtyard_circle"),
|
|
4413
4463
|
pcb_courtyard_circle_id: getZodPrefixedIdWithDefault(
|
|
4414
4464
|
"pcb_courtyard_circle"
|
|
4415
4465
|
),
|
|
4416
|
-
pcb_component_id:
|
|
4417
|
-
pcb_group_id:
|
|
4418
|
-
subcircuit_id:
|
|
4466
|
+
pcb_component_id: z198.string(),
|
|
4467
|
+
pcb_group_id: z198.string().optional(),
|
|
4468
|
+
subcircuit_id: z198.string().optional(),
|
|
4419
4469
|
center: point,
|
|
4420
4470
|
radius: length,
|
|
4421
4471
|
layer: visible_layer,
|
|
4422
|
-
color:
|
|
4472
|
+
color: z198.string().optional()
|
|
4423
4473
|
}).describe("Defines a courtyard circle on the PCB");
|
|
4424
4474
|
expectTypesMatch(true);
|
|
4425
4475
|
|
|
4426
4476
|
// src/pcb/pcb_courtyard_pill.ts
|
|
4427
|
-
import { z as
|
|
4428
|
-
var pcb_courtyard_pill =
|
|
4429
|
-
type:
|
|
4477
|
+
import { z as z199 } from "zod";
|
|
4478
|
+
var pcb_courtyard_pill = z199.object({
|
|
4479
|
+
type: z199.literal("pcb_courtyard_pill"),
|
|
4430
4480
|
pcb_courtyard_pill_id: getZodPrefixedIdWithDefault("pcb_courtyard_pill"),
|
|
4431
|
-
pcb_component_id:
|
|
4432
|
-
pcb_group_id:
|
|
4433
|
-
subcircuit_id:
|
|
4481
|
+
pcb_component_id: z199.string(),
|
|
4482
|
+
pcb_group_id: z199.string().optional(),
|
|
4483
|
+
subcircuit_id: z199.string().optional(),
|
|
4434
4484
|
center: point,
|
|
4435
4485
|
width: length,
|
|
4436
4486
|
height: length,
|
|
4437
4487
|
radius: length,
|
|
4438
4488
|
layer: visible_layer,
|
|
4439
|
-
color:
|
|
4489
|
+
color: z199.string().optional()
|
|
4440
4490
|
}).describe("Defines a courtyard pill on the PCB");
|
|
4441
4491
|
expectTypesMatch(true);
|
|
4442
4492
|
|
|
4443
4493
|
// src/cad/cad_component.ts
|
|
4444
|
-
import { z as
|
|
4494
|
+
import { z as z200 } from "zod";
|
|
4445
4495
|
|
|
4446
4496
|
// src/cad/cad_model_conventions.ts
|
|
4447
4497
|
var cad_model_formats = [
|
|
@@ -4472,90 +4522,90 @@ var cadModelDefaultDirectionMap = {
|
|
|
4472
4522
|
};
|
|
4473
4523
|
|
|
4474
4524
|
// src/cad/cad_component.ts
|
|
4475
|
-
var cad_component =
|
|
4476
|
-
type:
|
|
4477
|
-
cad_component_id:
|
|
4478
|
-
pcb_component_id:
|
|
4525
|
+
var cad_component = z200.object({
|
|
4526
|
+
type: z200.literal("cad_component"),
|
|
4527
|
+
cad_component_id: z200.string(),
|
|
4528
|
+
pcb_component_id: z200.string().optional().describe(
|
|
4479
4529
|
"Optional PCB component reference; omit for CAD geometry without a PCB component"
|
|
4480
4530
|
),
|
|
4481
|
-
source_component_id:
|
|
4531
|
+
source_component_id: z200.string(),
|
|
4482
4532
|
position: point3,
|
|
4483
4533
|
rotation: point3.optional(),
|
|
4484
|
-
is_on_folded_board:
|
|
4534
|
+
is_on_folded_board: z200.boolean().optional().describe(
|
|
4485
4535
|
"True when position and rotation describe the assembled folded board pose. False or omitted means the flat board pose. PCB records remain flat; pcb_component_id identifies the flat mount and owning board for reversible transforms."
|
|
4486
4536
|
),
|
|
4487
4537
|
size: point3.optional(),
|
|
4488
4538
|
layer: layer_ref.optional(),
|
|
4489
|
-
subcircuit_id:
|
|
4539
|
+
subcircuit_id: z200.string().optional(),
|
|
4490
4540
|
// These are all ways to generate/load the 3d model
|
|
4491
|
-
footprinter_string:
|
|
4492
|
-
model_obj_url:
|
|
4493
|
-
model_stl_url:
|
|
4494
|
-
model_3mf_url:
|
|
4495
|
-
model_gltf_url:
|
|
4496
|
-
model_glb_url:
|
|
4497
|
-
model_step_url:
|
|
4498
|
-
model_wrl_url:
|
|
4541
|
+
footprinter_string: z200.string().optional(),
|
|
4542
|
+
model_obj_url: z200.string().optional(),
|
|
4543
|
+
model_stl_url: z200.string().optional(),
|
|
4544
|
+
model_3mf_url: z200.string().optional(),
|
|
4545
|
+
model_gltf_url: z200.string().optional(),
|
|
4546
|
+
model_glb_url: z200.string().optional(),
|
|
4547
|
+
model_step_url: z200.string().optional(),
|
|
4548
|
+
model_wrl_url: z200.string().optional(),
|
|
4499
4549
|
model_asset: asset.optional(),
|
|
4500
|
-
model_unit_to_mm_scale_factor:
|
|
4501
|
-
model_board_normal_direction:
|
|
4550
|
+
model_unit_to_mm_scale_factor: z200.number().optional(),
|
|
4551
|
+
model_board_normal_direction: z200.enum(cad_model_axis_directions).optional().describe(
|
|
4502
4552
|
`The direction in the model's coordinate space that is considered "up" or "coming out of the board surface"`
|
|
4503
4553
|
),
|
|
4504
4554
|
model_origin_position: point3.optional(),
|
|
4505
|
-
model_origin_alignment:
|
|
4555
|
+
model_origin_alignment: z200.enum([
|
|
4506
4556
|
"unknown",
|
|
4507
4557
|
"center",
|
|
4508
4558
|
"center_of_component_on_board_surface",
|
|
4509
4559
|
"bottom_center_of_component"
|
|
4510
4560
|
]).optional(),
|
|
4511
|
-
model_object_fit:
|
|
4512
|
-
model_jscad:
|
|
4513
|
-
color:
|
|
4561
|
+
model_object_fit: z200.enum(["contain_within_bounds", "fill_bounds"]).optional().default("contain_within_bounds"),
|
|
4562
|
+
model_jscad: z200.any().optional(),
|
|
4563
|
+
color: z200.string().trim().min(1).optional().describe(
|
|
4514
4564
|
"Explicit color override for CAD geometry, including authored JSCAD material colors. Omit to preserve model materials."
|
|
4515
4565
|
),
|
|
4516
|
-
show_as_translucent_model:
|
|
4517
|
-
show_as_bounding_box:
|
|
4518
|
-
show_hidden_edges:
|
|
4519
|
-
anchor_alignment:
|
|
4566
|
+
show_as_translucent_model: z200.boolean().optional(),
|
|
4567
|
+
show_as_bounding_box: z200.boolean().optional(),
|
|
4568
|
+
show_hidden_edges: z200.boolean().optional(),
|
|
4569
|
+
anchor_alignment: z200.enum(["center", "center_of_component_on_board_surface"]).optional().default("center")
|
|
4520
4570
|
}).describe("Defines CAD geometry, optionally associated with a PCB component");
|
|
4521
4571
|
expectTypesMatch(true);
|
|
4522
4572
|
|
|
4523
4573
|
// src/cad/cad_collision_error.ts
|
|
4524
|
-
import { z as
|
|
4574
|
+
import { z as z201 } from "zod";
|
|
4525
4575
|
var cad_collision_error = base_circuit_json_error.extend({
|
|
4526
|
-
type:
|
|
4576
|
+
type: z201.literal("cad_collision_error"),
|
|
4527
4577
|
cad_collision_error_id: getZodPrefixedIdWithDefault("cad_collision_error"),
|
|
4528
|
-
error_type:
|
|
4529
|
-
cad_component_ids:
|
|
4530
|
-
pcb_component_ids:
|
|
4531
|
-
source_component_ids:
|
|
4532
|
-
intersection_area_mm2:
|
|
4533
|
-
threshold_area_mm2:
|
|
4578
|
+
error_type: z201.literal("cad_collision_error").default("cad_collision_error"),
|
|
4579
|
+
cad_component_ids: z201.array(z201.string()).min(1),
|
|
4580
|
+
pcb_component_ids: z201.array(z201.string()).optional(),
|
|
4581
|
+
source_component_ids: z201.array(z201.string()).min(1),
|
|
4582
|
+
intersection_area_mm2: z201.number().finite().nonnegative(),
|
|
4583
|
+
threshold_area_mm2: z201.number().finite().nonnegative()
|
|
4534
4584
|
}).describe(
|
|
4535
4585
|
"An aperture-bearing part intersects the finished enclosure. The intersection_area_mm2 is the union silhouette area of the solid intersection projected along the aperture face normal, in the right-handed Circuit JSON world frame (+X right, +Y top, +Z above). It is an area in square millimetres, not intersection volume or surface area. This indicates possible aperture misplacement, insufficient size/depth, or body clearance problems; it does not prove which cause applies."
|
|
4536
4586
|
);
|
|
4537
4587
|
expectTypesMatch(true);
|
|
4538
4588
|
|
|
4539
4589
|
// src/cad/cad_cable.ts
|
|
4540
|
-
import { z as
|
|
4590
|
+
import { z as z202 } from "zod";
|
|
4541
4591
|
var connectorPin1Position = point3.refine(
|
|
4542
4592
|
(point2) => [point2.x, point2.y, point2.z].every(Number.isFinite),
|
|
4543
4593
|
"Connector pin 1 positions must be finite"
|
|
4544
4594
|
).describe(
|
|
4545
4595
|
"Resolved pin 1 position at the connector mating face, in right-handed circuit world, millimeters: +X right, +Y top, +Z above. An absolute point, not a direction. Computed by the circuit producer from endpoint geometry. Together with the endpoint path tangent, fixes connector roll and identifies its pin 1 side; renderers must not infer it from footprints."
|
|
4546
4596
|
);
|
|
4547
|
-
var cad_cable =
|
|
4548
|
-
type:
|
|
4549
|
-
cad_cable_id:
|
|
4550
|
-
name:
|
|
4551
|
-
from_source_component_id:
|
|
4552
|
-
to_source_component_id:
|
|
4597
|
+
var cad_cable = z202.object({
|
|
4598
|
+
type: z202.literal("cad_cable"),
|
|
4599
|
+
cad_cable_id: z202.string(),
|
|
4600
|
+
name: z202.string().min(1),
|
|
4601
|
+
from_source_component_id: z202.string(),
|
|
4602
|
+
to_source_component_id: z202.string(),
|
|
4553
4603
|
from_connector_pin1_position: connectorPin1Position.optional(),
|
|
4554
4604
|
to_connector_pin1_position: connectorPin1Position.optional(),
|
|
4555
|
-
cableprinter_string:
|
|
4605
|
+
cableprinter_string: z202.string().min(1).describe(
|
|
4556
4606
|
'Physical cable definition, e.g. "usb_c" or "jst_ph_pins6". Independent of the route.'
|
|
4557
4607
|
),
|
|
4558
|
-
path:
|
|
4608
|
+
path: z202.array(point3).min(2).refine(
|
|
4559
4609
|
(path) => path.every(
|
|
4560
4610
|
(point2, i) => [point2.x, point2.y, point2.z].every(Number.isFinite) && (i === 0 || Math.hypot(
|
|
4561
4611
|
point2.x - path[i - 1].x,
|
|
@@ -4573,27 +4623,27 @@ var cad_cable = z201.object({
|
|
|
4573
4623
|
expectTypesMatch(true);
|
|
4574
4624
|
|
|
4575
4625
|
// src/cad/cad_reference_surface.ts
|
|
4576
|
-
import { z as
|
|
4626
|
+
import { z as z203 } from "zod";
|
|
4577
4627
|
var FRAME_TOLERANCE = 1e-6;
|
|
4578
|
-
var unitDirection =
|
|
4579
|
-
x:
|
|
4580
|
-
y:
|
|
4581
|
-
z:
|
|
4628
|
+
var unitDirection = z203.object({
|
|
4629
|
+
x: z203.number().finite(),
|
|
4630
|
+
y: z203.number().finite(),
|
|
4631
|
+
z: z203.number().finite()
|
|
4582
4632
|
}).refine(
|
|
4583
4633
|
(v) => Math.abs(Math.hypot(v.x, v.y, v.z) - 1) <= FRAME_TOLERANCE,
|
|
4584
4634
|
"Reference surface directions must be unit vectors"
|
|
4585
4635
|
);
|
|
4586
|
-
var extent = distance.pipe(
|
|
4587
|
-
var cad_reference_surface =
|
|
4588
|
-
type:
|
|
4589
|
-
cad_reference_surface_id:
|
|
4590
|
-
source_component_id:
|
|
4636
|
+
var extent = distance.pipe(z203.number().finite().positive());
|
|
4637
|
+
var cad_reference_surface = z203.object({
|
|
4638
|
+
type: z203.literal("cad_reference_surface"),
|
|
4639
|
+
cad_reference_surface_id: z203.string().min(1),
|
|
4640
|
+
source_component_id: z203.string().min(1).describe(
|
|
4591
4641
|
"Owning assembly part's source component ID. The part may have no CAD geometry."
|
|
4592
4642
|
),
|
|
4593
|
-
name:
|
|
4643
|
+
name: z203.string().trim().min(1).describe(
|
|
4594
4644
|
"Reference name, unique within the owning part, e.g. shade in STEM.shade."
|
|
4595
4645
|
),
|
|
4596
|
-
shape:
|
|
4646
|
+
shape: z203.literal("rect"),
|
|
4597
4647
|
center: point3.refine(
|
|
4598
4648
|
(p) => [p.x, p.y, p.z].every(Number.isFinite),
|
|
4599
4649
|
"Reference surface centers must be finite"
|
|
@@ -4612,18 +4662,18 @@ var cad_reference_surface = z202.object({
|
|
|
4612
4662
|
height: extent.optional().describe(
|
|
4613
4663
|
"Rectangular extent along normal cross x_axis in millimeters. Supply together with width."
|
|
4614
4664
|
),
|
|
4615
|
-
subcircuit_id:
|
|
4665
|
+
subcircuit_id: z203.string().optional()
|
|
4616
4666
|
}).superRefine((surface, ctx) => {
|
|
4617
4667
|
if (surface.width === void 0 !== (surface.height === void 0))
|
|
4618
4668
|
ctx.addIssue({
|
|
4619
|
-
code:
|
|
4669
|
+
code: z203.ZodIssueCode.custom,
|
|
4620
4670
|
path: ["width"],
|
|
4621
4671
|
message: "Provide width and height together"
|
|
4622
4672
|
});
|
|
4623
4673
|
const { normal: n, x_axis: x } = surface;
|
|
4624
4674
|
if (Math.abs(n.x * x.x + n.y * x.y + n.z * x.z) > FRAME_TOLERANCE)
|
|
4625
4675
|
ctx.addIssue({
|
|
4626
|
-
code:
|
|
4676
|
+
code: z203.ZodIssueCode.custom,
|
|
4627
4677
|
path: ["x_axis"],
|
|
4628
4678
|
message: "x_axis must be perpendicular to normal"
|
|
4629
4679
|
});
|
|
@@ -4635,9 +4685,9 @@ expectTypesMatch(
|
|
|
4635
4685
|
);
|
|
4636
4686
|
|
|
4637
4687
|
// src/simulation/simulation_voltage_source.ts
|
|
4638
|
-
import { z as
|
|
4639
|
-
var wave_shape =
|
|
4640
|
-
var percentage =
|
|
4688
|
+
import { z as z204 } from "zod";
|
|
4689
|
+
var wave_shape = z204.enum(["sinewave", "square", "triangle", "sawtooth"]);
|
|
4690
|
+
var percentage = z204.union([z204.string(), z204.number()]).transform((val) => {
|
|
4641
4691
|
if (typeof val === "string") {
|
|
4642
4692
|
if (val.endsWith("%")) {
|
|
4643
4693
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -4646,32 +4696,32 @@ var percentage = z203.union([z203.string(), z203.number()]).transform((val) => {
|
|
|
4646
4696
|
}
|
|
4647
4697
|
return val;
|
|
4648
4698
|
}).pipe(
|
|
4649
|
-
|
|
4699
|
+
z204.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
4650
4700
|
);
|
|
4651
|
-
var simulation_dc_voltage_source =
|
|
4652
|
-
type:
|
|
4701
|
+
var simulation_dc_voltage_source = z204.object({
|
|
4702
|
+
type: z204.literal("simulation_voltage_source"),
|
|
4653
4703
|
simulation_voltage_source_id: getZodPrefixedIdWithDefault(
|
|
4654
4704
|
"simulation_voltage_source"
|
|
4655
4705
|
),
|
|
4656
|
-
is_dc_source:
|
|
4657
|
-
positive_source_port_id:
|
|
4658
|
-
negative_source_port_id:
|
|
4659
|
-
positive_source_net_id:
|
|
4660
|
-
negative_source_net_id:
|
|
4706
|
+
is_dc_source: z204.literal(true).optional().default(true),
|
|
4707
|
+
positive_source_port_id: z204.string().optional(),
|
|
4708
|
+
negative_source_port_id: z204.string().optional(),
|
|
4709
|
+
positive_source_net_id: z204.string().optional(),
|
|
4710
|
+
negative_source_net_id: z204.string().optional(),
|
|
4661
4711
|
voltage,
|
|
4662
4712
|
ac_magnitude: voltage.optional(),
|
|
4663
4713
|
ac_phase: rotation.optional()
|
|
4664
4714
|
}).describe("Defines a DC voltage source for simulation");
|
|
4665
|
-
var simulation_ac_voltage_source =
|
|
4666
|
-
type:
|
|
4715
|
+
var simulation_ac_voltage_source = z204.object({
|
|
4716
|
+
type: z204.literal("simulation_voltage_source"),
|
|
4667
4717
|
simulation_voltage_source_id: getZodPrefixedIdWithDefault(
|
|
4668
4718
|
"simulation_voltage_source"
|
|
4669
4719
|
),
|
|
4670
|
-
is_dc_source:
|
|
4671
|
-
terminal1_source_port_id:
|
|
4672
|
-
terminal2_source_port_id:
|
|
4673
|
-
terminal1_source_net_id:
|
|
4674
|
-
terminal2_source_net_id:
|
|
4720
|
+
is_dc_source: z204.literal(false),
|
|
4721
|
+
terminal1_source_port_id: z204.string().optional(),
|
|
4722
|
+
terminal2_source_port_id: z204.string().optional(),
|
|
4723
|
+
terminal1_source_net_id: z204.string().optional(),
|
|
4724
|
+
terminal2_source_net_id: z204.string().optional(),
|
|
4675
4725
|
voltage: voltage.optional(),
|
|
4676
4726
|
frequency: frequency.optional(),
|
|
4677
4727
|
peak_to_peak_voltage: voltage.optional(),
|
|
@@ -4686,14 +4736,14 @@ var simulation_ac_voltage_source = z203.object({
|
|
|
4686
4736
|
ac_magnitude: voltage.optional(),
|
|
4687
4737
|
ac_phase: rotation.optional()
|
|
4688
4738
|
}).describe("Defines an AC voltage source for simulation");
|
|
4689
|
-
var simulation_voltage_source =
|
|
4739
|
+
var simulation_voltage_source = z204.union([simulation_dc_voltage_source, simulation_ac_voltage_source]).describe("Defines a voltage source for simulation");
|
|
4690
4740
|
expectTypesMatch(true);
|
|
4691
4741
|
expectTypesMatch(true);
|
|
4692
4742
|
expectTypesMatch(true);
|
|
4693
4743
|
|
|
4694
4744
|
// src/simulation/simulation_current_source.ts
|
|
4695
|
-
import { z as
|
|
4696
|
-
var percentage2 =
|
|
4745
|
+
import { z as z205 } from "zod";
|
|
4746
|
+
var percentage2 = z205.union([z205.string(), z205.number()]).transform((val) => {
|
|
4697
4747
|
if (typeof val === "string") {
|
|
4698
4748
|
if (val.endsWith("%")) {
|
|
4699
4749
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -4702,32 +4752,32 @@ var percentage2 = z204.union([z204.string(), z204.number()]).transform((val) =>
|
|
|
4702
4752
|
}
|
|
4703
4753
|
return val;
|
|
4704
4754
|
}).pipe(
|
|
4705
|
-
|
|
4755
|
+
z205.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
4706
4756
|
);
|
|
4707
|
-
var simulation_dc_current_source =
|
|
4708
|
-
type:
|
|
4757
|
+
var simulation_dc_current_source = z205.object({
|
|
4758
|
+
type: z205.literal("simulation_current_source"),
|
|
4709
4759
|
simulation_current_source_id: getZodPrefixedIdWithDefault(
|
|
4710
4760
|
"simulation_current_source"
|
|
4711
4761
|
),
|
|
4712
|
-
is_dc_source:
|
|
4713
|
-
positive_source_port_id:
|
|
4714
|
-
negative_source_port_id:
|
|
4715
|
-
positive_source_net_id:
|
|
4716
|
-
negative_source_net_id:
|
|
4762
|
+
is_dc_source: z205.literal(true).optional().default(true),
|
|
4763
|
+
positive_source_port_id: z205.string().optional(),
|
|
4764
|
+
negative_source_port_id: z205.string().optional(),
|
|
4765
|
+
positive_source_net_id: z205.string().optional(),
|
|
4766
|
+
negative_source_net_id: z205.string().optional(),
|
|
4717
4767
|
current,
|
|
4718
4768
|
ac_magnitude: current.optional(),
|
|
4719
4769
|
ac_phase: rotation.optional()
|
|
4720
4770
|
}).describe("Defines a DC current source for simulation");
|
|
4721
|
-
var simulation_ac_current_source =
|
|
4722
|
-
type:
|
|
4771
|
+
var simulation_ac_current_source = z205.object({
|
|
4772
|
+
type: z205.literal("simulation_current_source"),
|
|
4723
4773
|
simulation_current_source_id: getZodPrefixedIdWithDefault(
|
|
4724
4774
|
"simulation_current_source"
|
|
4725
4775
|
),
|
|
4726
|
-
is_dc_source:
|
|
4727
|
-
terminal1_source_port_id:
|
|
4728
|
-
terminal2_source_port_id:
|
|
4729
|
-
terminal1_source_net_id:
|
|
4730
|
-
terminal2_source_net_id:
|
|
4776
|
+
is_dc_source: z205.literal(false),
|
|
4777
|
+
terminal1_source_port_id: z205.string().optional(),
|
|
4778
|
+
terminal2_source_port_id: z205.string().optional(),
|
|
4779
|
+
terminal1_source_net_id: z205.string().optional(),
|
|
4780
|
+
terminal2_source_net_id: z205.string().optional(),
|
|
4731
4781
|
current: current.optional(),
|
|
4732
4782
|
frequency: frequency.optional(),
|
|
4733
4783
|
peak_to_peak_current: current.optional(),
|
|
@@ -4737,61 +4787,61 @@ var simulation_ac_current_source = z204.object({
|
|
|
4737
4787
|
ac_magnitude: current.optional(),
|
|
4738
4788
|
ac_phase: rotation.optional()
|
|
4739
4789
|
}).describe("Defines an AC current source for simulation");
|
|
4740
|
-
var simulation_current_source =
|
|
4790
|
+
var simulation_current_source = z205.union([simulation_dc_current_source, simulation_ac_current_source]).describe("Defines a current source for simulation");
|
|
4741
4791
|
expectTypesMatch(true);
|
|
4742
4792
|
expectTypesMatch(true);
|
|
4743
4793
|
expectTypesMatch(true);
|
|
4744
4794
|
|
|
4745
4795
|
// src/simulation/simulation_experiment.ts
|
|
4746
|
-
import { z as
|
|
4796
|
+
import { z as z207 } from "zod";
|
|
4747
4797
|
|
|
4748
4798
|
// src/simulation/simulation_units.ts
|
|
4749
|
-
import { z as
|
|
4750
|
-
var simulation_dc_sweep_unit =
|
|
4799
|
+
import { z as z206 } from "zod";
|
|
4800
|
+
var simulation_dc_sweep_unit = z206.custom(
|
|
4751
4801
|
(dcSweepUnit) => dcSweepUnit === "V" || dcSweepUnit === "A"
|
|
4752
4802
|
);
|
|
4753
|
-
var simulation_parameter_unit =
|
|
4803
|
+
var simulation_parameter_unit = z206.custom(
|
|
4754
4804
|
(parameterUnit) => parameterUnit === "\u03A9" || parameterUnit === "F" || parameterUnit === "H" || parameterUnit === "V" || parameterUnit === "A"
|
|
4755
4805
|
);
|
|
4756
4806
|
|
|
4757
4807
|
// src/simulation/simulation_experiment.ts
|
|
4758
|
-
var experiment_type =
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
|
|
4763
|
-
|
|
4808
|
+
var experiment_type = z207.union([
|
|
4809
|
+
z207.literal("spice_dc_sweep"),
|
|
4810
|
+
z207.literal("spice_dc_operating_point"),
|
|
4811
|
+
z207.literal("spice_transient_analysis"),
|
|
4812
|
+
z207.literal("spice_ac_analysis"),
|
|
4813
|
+
z207.literal("pcb_return_current")
|
|
4764
4814
|
]);
|
|
4765
|
-
var spice_simulation_options =
|
|
4766
|
-
method:
|
|
4767
|
-
reltol:
|
|
4768
|
-
abstol:
|
|
4769
|
-
vntol:
|
|
4815
|
+
var spice_simulation_options = z207.object({
|
|
4816
|
+
method: z207.enum(["trap", "gear"]).optional(),
|
|
4817
|
+
reltol: z207.union([z207.number(), z207.string()]).optional(),
|
|
4818
|
+
abstol: z207.union([z207.number(), z207.string()]).optional(),
|
|
4819
|
+
vntol: z207.union([z207.number(), z207.string()]).optional()
|
|
4770
4820
|
}).describe("SPICE solver options for a simulation experiment");
|
|
4771
|
-
var simulation_experiment =
|
|
4772
|
-
type:
|
|
4821
|
+
var simulation_experiment = z207.object({
|
|
4822
|
+
type: z207.literal("simulation_experiment"),
|
|
4773
4823
|
simulation_experiment_id: getZodPrefixedIdWithDefault(
|
|
4774
4824
|
"simulation_experiment"
|
|
4775
4825
|
),
|
|
4776
|
-
name:
|
|
4826
|
+
name: z207.string(),
|
|
4777
4827
|
experiment_type,
|
|
4778
|
-
subcircuit_id:
|
|
4779
|
-
spice_engine:
|
|
4828
|
+
subcircuit_id: z207.string().optional(),
|
|
4829
|
+
spice_engine: z207.string().optional(),
|
|
4780
4830
|
time_per_step: duration_ms.optional(),
|
|
4781
4831
|
start_time_ms: ms.optional(),
|
|
4782
4832
|
end_time_ms: ms.optional(),
|
|
4783
4833
|
spice_options: spice_simulation_options.optional(),
|
|
4784
|
-
dc_sweep_voltage_source_id:
|
|
4785
|
-
dc_sweep_current_source_id:
|
|
4786
|
-
dc_sweep_start:
|
|
4787
|
-
dc_sweep_stop:
|
|
4788
|
-
dc_sweep_step:
|
|
4834
|
+
dc_sweep_voltage_source_id: z207.string().optional(),
|
|
4835
|
+
dc_sweep_current_source_id: z207.string().optional(),
|
|
4836
|
+
dc_sweep_start: z207.number().optional(),
|
|
4837
|
+
dc_sweep_stop: z207.number().optional(),
|
|
4838
|
+
dc_sweep_step: z207.number().refine((dcSweepStep) => dcSweepStep !== 0).optional(),
|
|
4789
4839
|
dc_sweep_unit: simulation_dc_sweep_unit.optional(),
|
|
4790
|
-
ac_sweep_type:
|
|
4791
|
-
ac_samples_per_interval:
|
|
4792
|
-
ac_sample_count:
|
|
4793
|
-
ac_start_frequency_hz:
|
|
4794
|
-
ac_stop_frequency_hz:
|
|
4840
|
+
ac_sweep_type: z207.enum(["linear", "decade", "octave"]).optional(),
|
|
4841
|
+
ac_samples_per_interval: z207.number().int().positive().optional(),
|
|
4842
|
+
ac_sample_count: z207.number().int().positive().optional(),
|
|
4843
|
+
ac_start_frequency_hz: z207.number().positive().optional(),
|
|
4844
|
+
ac_stop_frequency_hz: z207.number().positive().optional()
|
|
4795
4845
|
}).superRefine((experiment, context) => {
|
|
4796
4846
|
if (experiment.experiment_type === "spice_dc_sweep") {
|
|
4797
4847
|
const requiredFields = [
|
|
@@ -4803,7 +4853,7 @@ var simulation_experiment = z206.object({
|
|
|
4803
4853
|
for (const field of requiredFields) {
|
|
4804
4854
|
if (experiment[field] === void 0) {
|
|
4805
4855
|
context.addIssue({
|
|
4806
|
-
code:
|
|
4856
|
+
code: z207.ZodIssueCode.custom,
|
|
4807
4857
|
path: [field],
|
|
4808
4858
|
message: `${field} is required for a DC sweep`
|
|
4809
4859
|
});
|
|
@@ -4813,7 +4863,7 @@ var simulation_experiment = z206.object({
|
|
|
4813
4863
|
const hasCurrentSource = experiment.dc_sweep_current_source_id !== void 0;
|
|
4814
4864
|
if (hasVoltageSource === hasCurrentSource) {
|
|
4815
4865
|
context.addIssue({
|
|
4816
|
-
code:
|
|
4866
|
+
code: z207.ZodIssueCode.custom,
|
|
4817
4867
|
path: ["dc_sweep_voltage_source_id"],
|
|
4818
4868
|
message: "Exactly one DC sweep voltage or current source ID is required"
|
|
4819
4869
|
});
|
|
@@ -4822,35 +4872,35 @@ var simulation_experiment = z206.object({
|
|
|
4822
4872
|
if (experiment.experiment_type === "spice_ac_analysis") {
|
|
4823
4873
|
if (experiment.ac_sweep_type === void 0) {
|
|
4824
4874
|
context.addIssue({
|
|
4825
|
-
code:
|
|
4875
|
+
code: z207.ZodIssueCode.custom,
|
|
4826
4876
|
path: ["ac_sweep_type"],
|
|
4827
4877
|
message: "ac_sweep_type is required for an AC analysis"
|
|
4828
4878
|
});
|
|
4829
4879
|
}
|
|
4830
4880
|
if (experiment.ac_start_frequency_hz === void 0) {
|
|
4831
4881
|
context.addIssue({
|
|
4832
|
-
code:
|
|
4882
|
+
code: z207.ZodIssueCode.custom,
|
|
4833
4883
|
path: ["ac_start_frequency_hz"],
|
|
4834
4884
|
message: "ac_start_frequency_hz is required for an AC analysis"
|
|
4835
4885
|
});
|
|
4836
4886
|
}
|
|
4837
4887
|
if (experiment.ac_stop_frequency_hz === void 0) {
|
|
4838
4888
|
context.addIssue({
|
|
4839
|
-
code:
|
|
4889
|
+
code: z207.ZodIssueCode.custom,
|
|
4840
4890
|
path: ["ac_stop_frequency_hz"],
|
|
4841
4891
|
message: "ac_stop_frequency_hz is required for an AC analysis"
|
|
4842
4892
|
});
|
|
4843
4893
|
}
|
|
4844
4894
|
if (experiment.ac_sweep_type === "linear" && experiment.ac_sample_count === void 0) {
|
|
4845
4895
|
context.addIssue({
|
|
4846
|
-
code:
|
|
4896
|
+
code: z207.ZodIssueCode.custom,
|
|
4847
4897
|
path: ["ac_sample_count"],
|
|
4848
4898
|
message: "ac_sample_count is required for a linear AC analysis"
|
|
4849
4899
|
});
|
|
4850
4900
|
}
|
|
4851
4901
|
if ((experiment.ac_sweep_type === "decade" || experiment.ac_sweep_type === "octave") && experiment.ac_samples_per_interval === void 0) {
|
|
4852
4902
|
context.addIssue({
|
|
4853
|
-
code:
|
|
4903
|
+
code: z207.ZodIssueCode.custom,
|
|
4854
4904
|
path: ["ac_samples_per_interval"],
|
|
4855
4905
|
message: "ac_samples_per_interval is required for decade and octave AC analyses"
|
|
4856
4906
|
});
|
|
@@ -4860,88 +4910,88 @@ var simulation_experiment = z206.object({
|
|
|
4860
4910
|
expectTypesMatch(true);
|
|
4861
4911
|
|
|
4862
4912
|
// src/simulation/simulation_transient_voltage_graph.ts
|
|
4863
|
-
import { z as
|
|
4913
|
+
import { z as z209 } from "zod";
|
|
4864
4914
|
|
|
4865
4915
|
// src/simulation/simulation_parameter_sweep_coordinate.ts
|
|
4866
|
-
import { z as
|
|
4867
|
-
var simulation_parameter_sweep_coordinate =
|
|
4868
|
-
simulation_parameter_sweep_id:
|
|
4869
|
-
sweep_index:
|
|
4870
|
-
parameter_value:
|
|
4916
|
+
import { z as z208 } from "zod";
|
|
4917
|
+
var simulation_parameter_sweep_coordinate = z208.object({
|
|
4918
|
+
simulation_parameter_sweep_id: z208.string(),
|
|
4919
|
+
sweep_index: z208.number().int().nonnegative(),
|
|
4920
|
+
parameter_value: z208.number(),
|
|
4871
4921
|
parameter_unit: simulation_parameter_unit
|
|
4872
4922
|
});
|
|
4873
4923
|
expectTypesMatch(true);
|
|
4874
4924
|
|
|
4875
4925
|
// src/simulation/simulation_transient_voltage_graph.ts
|
|
4876
|
-
var simulation_transient_voltage_graph =
|
|
4877
|
-
type:
|
|
4926
|
+
var simulation_transient_voltage_graph = z209.object({
|
|
4927
|
+
type: z209.literal("simulation_transient_voltage_graph"),
|
|
4878
4928
|
simulation_transient_voltage_graph_id: getZodPrefixedIdWithDefault(
|
|
4879
4929
|
"simulation_transient_voltage_graph"
|
|
4880
4930
|
),
|
|
4881
|
-
simulation_experiment_id:
|
|
4882
|
-
simulation_voltage_probe_id:
|
|
4931
|
+
simulation_experiment_id: z209.string(),
|
|
4932
|
+
simulation_voltage_probe_id: z209.string().optional(),
|
|
4883
4933
|
simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
|
|
4884
|
-
timestamps_ms:
|
|
4885
|
-
voltage_levels:
|
|
4886
|
-
source_component_id:
|
|
4887
|
-
subcircuit_connectivity_map_key:
|
|
4934
|
+
timestamps_ms: z209.array(z209.number()).optional(),
|
|
4935
|
+
voltage_levels: z209.array(z209.number()),
|
|
4936
|
+
source_component_id: z209.string().optional(),
|
|
4937
|
+
subcircuit_connectivity_map_key: z209.string().optional(),
|
|
4888
4938
|
time_per_step: duration_ms,
|
|
4889
4939
|
start_time_ms: ms,
|
|
4890
4940
|
end_time_ms: ms,
|
|
4891
|
-
name:
|
|
4892
|
-
color:
|
|
4941
|
+
name: z209.string().optional(),
|
|
4942
|
+
color: z209.string().optional()
|
|
4893
4943
|
}).describe("Stores voltage measurements over time for a simulation");
|
|
4894
4944
|
expectTypesMatch(true);
|
|
4895
4945
|
|
|
4896
4946
|
// src/simulation/simulation_transient_current_graph.ts
|
|
4897
|
-
import { z as
|
|
4898
|
-
var simulation_transient_current_graph =
|
|
4899
|
-
type:
|
|
4947
|
+
import { z as z210 } from "zod";
|
|
4948
|
+
var simulation_transient_current_graph = z210.object({
|
|
4949
|
+
type: z210.literal("simulation_transient_current_graph"),
|
|
4900
4950
|
simulation_transient_current_graph_id: getZodPrefixedIdWithDefault(
|
|
4901
4951
|
"simulation_transient_current_graph"
|
|
4902
4952
|
),
|
|
4903
|
-
simulation_experiment_id:
|
|
4953
|
+
simulation_experiment_id: z210.string(),
|
|
4904
4954
|
simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
|
|
4905
|
-
timestamps_ms:
|
|
4906
|
-
current_levels:
|
|
4907
|
-
source_component_id:
|
|
4908
|
-
subcircuit_connectivity_map_key:
|
|
4955
|
+
timestamps_ms: z210.array(z210.number()).optional(),
|
|
4956
|
+
current_levels: z210.array(z210.number()),
|
|
4957
|
+
source_component_id: z210.string().optional(),
|
|
4958
|
+
subcircuit_connectivity_map_key: z210.string().optional(),
|
|
4909
4959
|
time_per_step: duration_ms,
|
|
4910
4960
|
start_time_ms: ms,
|
|
4911
4961
|
end_time_ms: ms,
|
|
4912
|
-
name:
|
|
4913
|
-
color:
|
|
4962
|
+
name: z210.string().optional(),
|
|
4963
|
+
color: z210.string().optional()
|
|
4914
4964
|
}).describe("Stores current measurements over time for a simulation");
|
|
4915
4965
|
expectTypesMatch(true);
|
|
4916
4966
|
|
|
4917
4967
|
// src/simulation/simulation_switch.ts
|
|
4918
|
-
import { z as
|
|
4919
|
-
var simulation_switch =
|
|
4920
|
-
type:
|
|
4968
|
+
import { z as z211 } from "zod";
|
|
4969
|
+
var simulation_switch = z211.object({
|
|
4970
|
+
type: z211.literal("simulation_switch"),
|
|
4921
4971
|
simulation_switch_id: getZodPrefixedIdWithDefault("simulation_switch"),
|
|
4922
|
-
source_component_id:
|
|
4972
|
+
source_component_id: z211.string().optional(),
|
|
4923
4973
|
closes_at: ms.optional(),
|
|
4924
4974
|
opens_at: ms.optional(),
|
|
4925
|
-
starts_closed:
|
|
4975
|
+
starts_closed: z211.boolean().optional(),
|
|
4926
4976
|
switching_frequency: frequency.optional()
|
|
4927
4977
|
}).describe("Defines a switch for simulation timing control");
|
|
4928
4978
|
expectTypesMatch(true);
|
|
4929
4979
|
|
|
4930
4980
|
// src/simulation/simulation_voltage_probe.ts
|
|
4931
|
-
import { z as
|
|
4932
|
-
var simulation_voltage_probe =
|
|
4933
|
-
type:
|
|
4981
|
+
import { z as z212 } from "zod";
|
|
4982
|
+
var simulation_voltage_probe = z212.object({
|
|
4983
|
+
type: z212.literal("simulation_voltage_probe"),
|
|
4934
4984
|
simulation_voltage_probe_id: getZodPrefixedIdWithDefault(
|
|
4935
4985
|
"simulation_voltage_probe"
|
|
4936
4986
|
),
|
|
4937
|
-
source_component_id:
|
|
4938
|
-
name:
|
|
4939
|
-
signal_input_source_port_id:
|
|
4940
|
-
signal_input_source_net_id:
|
|
4941
|
-
reference_input_source_port_id:
|
|
4942
|
-
reference_input_source_net_id:
|
|
4943
|
-
subcircuit_id:
|
|
4944
|
-
color:
|
|
4987
|
+
source_component_id: z212.string().optional(),
|
|
4988
|
+
name: z212.string().optional(),
|
|
4989
|
+
signal_input_source_port_id: z212.string().optional(),
|
|
4990
|
+
signal_input_source_net_id: z212.string().optional(),
|
|
4991
|
+
reference_input_source_port_id: z212.string().optional(),
|
|
4992
|
+
reference_input_source_net_id: z212.string().optional(),
|
|
4993
|
+
subcircuit_id: z212.string().optional(),
|
|
4994
|
+
color: z212.string().optional()
|
|
4945
4995
|
}).describe(
|
|
4946
4996
|
"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."
|
|
4947
4997
|
).superRefine((data, ctx) => {
|
|
@@ -4951,20 +5001,20 @@ var simulation_voltage_probe = z211.object({
|
|
|
4951
5001
|
const has_nets = !!data.signal_input_source_net_id || !!data.reference_input_source_net_id;
|
|
4952
5002
|
if (has_ports && has_nets) {
|
|
4953
5003
|
ctx.addIssue({
|
|
4954
|
-
code:
|
|
5004
|
+
code: z212.ZodIssueCode.custom,
|
|
4955
5005
|
message: "Cannot mix port and net connections in a differential probe."
|
|
4956
5006
|
});
|
|
4957
5007
|
} else if (has_ports) {
|
|
4958
5008
|
if (!data.signal_input_source_port_id || !data.reference_input_source_port_id) {
|
|
4959
5009
|
ctx.addIssue({
|
|
4960
|
-
code:
|
|
5010
|
+
code: z212.ZodIssueCode.custom,
|
|
4961
5011
|
message: "Differential port probe requires both signal_input_source_port_id and reference_input_source_port_id."
|
|
4962
5012
|
});
|
|
4963
5013
|
}
|
|
4964
5014
|
} else if (has_nets) {
|
|
4965
5015
|
if (!data.signal_input_source_net_id || !data.reference_input_source_net_id) {
|
|
4966
5016
|
ctx.addIssue({
|
|
4967
|
-
code:
|
|
5017
|
+
code: z212.ZodIssueCode.custom,
|
|
4968
5018
|
message: "Differential net probe requires both signal_input_source_net_id and reference_input_source_net_id."
|
|
4969
5019
|
});
|
|
4970
5020
|
}
|
|
@@ -4972,7 +5022,7 @@ var simulation_voltage_probe = z211.object({
|
|
|
4972
5022
|
} else {
|
|
4973
5023
|
if (!!data.signal_input_source_port_id === !!data.signal_input_source_net_id) {
|
|
4974
5024
|
ctx.addIssue({
|
|
4975
|
-
code:
|
|
5025
|
+
code: z212.ZodIssueCode.custom,
|
|
4976
5026
|
message: "A voltage probe must have exactly one of signal_input_source_port_id or signal_input_source_net_id."
|
|
4977
5027
|
});
|
|
4978
5028
|
}
|
|
@@ -4981,20 +5031,20 @@ var simulation_voltage_probe = z211.object({
|
|
|
4981
5031
|
expectTypesMatch(true);
|
|
4982
5032
|
|
|
4983
5033
|
// src/simulation/simulation_current_probe.ts
|
|
4984
|
-
import { z as
|
|
4985
|
-
var simulation_current_probe =
|
|
4986
|
-
type:
|
|
5034
|
+
import { z as z213 } from "zod";
|
|
5035
|
+
var simulation_current_probe = z213.object({
|
|
5036
|
+
type: z213.literal("simulation_current_probe"),
|
|
4987
5037
|
simulation_current_probe_id: getZodPrefixedIdWithDefault(
|
|
4988
5038
|
"simulation_current_probe"
|
|
4989
5039
|
),
|
|
4990
|
-
source_component_id:
|
|
4991
|
-
name:
|
|
4992
|
-
positive_source_port_id:
|
|
4993
|
-
negative_source_port_id:
|
|
4994
|
-
positive_source_net_id:
|
|
4995
|
-
negative_source_net_id:
|
|
4996
|
-
subcircuit_id:
|
|
4997
|
-
color:
|
|
5040
|
+
source_component_id: z213.string().optional(),
|
|
5041
|
+
name: z213.string().optional(),
|
|
5042
|
+
positive_source_port_id: z213.string().optional(),
|
|
5043
|
+
negative_source_port_id: z213.string().optional(),
|
|
5044
|
+
positive_source_net_id: z213.string().optional(),
|
|
5045
|
+
negative_source_net_id: z213.string().optional(),
|
|
5046
|
+
subcircuit_id: z213.string().optional(),
|
|
5047
|
+
color: z213.string().optional()
|
|
4998
5048
|
}).describe(
|
|
4999
5049
|
"Defines a current probe for simulation. It measures current flowing from the positive endpoint to the negative endpoint."
|
|
5000
5050
|
).superRefine((data, ctx) => {
|
|
@@ -5006,7 +5056,7 @@ var simulation_current_probe = z212.object({
|
|
|
5006
5056
|
const hasNets = hasPositiveNet || hasNegativeNet;
|
|
5007
5057
|
if (hasPorts && hasNets) {
|
|
5008
5058
|
ctx.addIssue({
|
|
5009
|
-
code:
|
|
5059
|
+
code: z213.ZodIssueCode.custom,
|
|
5010
5060
|
message: "Cannot mix port and net connections in a current probe."
|
|
5011
5061
|
});
|
|
5012
5062
|
return;
|
|
@@ -5014,7 +5064,7 @@ var simulation_current_probe = z212.object({
|
|
|
5014
5064
|
if (hasPorts) {
|
|
5015
5065
|
if (!hasPositivePort || !hasNegativePort) {
|
|
5016
5066
|
ctx.addIssue({
|
|
5017
|
-
code:
|
|
5067
|
+
code: z213.ZodIssueCode.custom,
|
|
5018
5068
|
message: "Current probe using source ports requires both positive_source_port_id and negative_source_port_id."
|
|
5019
5069
|
});
|
|
5020
5070
|
}
|
|
@@ -5023,71 +5073,71 @@ var simulation_current_probe = z212.object({
|
|
|
5023
5073
|
if (hasNets) {
|
|
5024
5074
|
if (!hasPositiveNet || !hasNegativeNet) {
|
|
5025
5075
|
ctx.addIssue({
|
|
5026
|
-
code:
|
|
5076
|
+
code: z213.ZodIssueCode.custom,
|
|
5027
5077
|
message: "Current probe using source nets requires both positive_source_net_id and negative_source_net_id."
|
|
5028
5078
|
});
|
|
5029
5079
|
}
|
|
5030
5080
|
return;
|
|
5031
5081
|
}
|
|
5032
5082
|
ctx.addIssue({
|
|
5033
|
-
code:
|
|
5083
|
+
code: z213.ZodIssueCode.custom,
|
|
5034
5084
|
message: "A current probe must have either positive/negative source port ids or positive/negative source net ids."
|
|
5035
5085
|
});
|
|
5036
5086
|
});
|
|
5037
5087
|
expectTypesMatch(true);
|
|
5038
5088
|
|
|
5039
5089
|
// src/simulation/simulation_unknown_experiment_error.ts
|
|
5040
|
-
import { z as
|
|
5090
|
+
import { z as z214 } from "zod";
|
|
5041
5091
|
var simulation_unknown_experiment_error = base_circuit_json_error.extend({
|
|
5042
|
-
type:
|
|
5092
|
+
type: z214.literal("simulation_unknown_experiment_error"),
|
|
5043
5093
|
simulation_unknown_experiment_error_id: getZodPrefixedIdWithDefault(
|
|
5044
5094
|
"simulation_unknown_experiment_error"
|
|
5045
5095
|
),
|
|
5046
|
-
error_type:
|
|
5047
|
-
simulation_experiment_id:
|
|
5048
|
-
subcircuit_id:
|
|
5096
|
+
error_type: z214.literal("simulation_unknown_experiment_error").default("simulation_unknown_experiment_error"),
|
|
5097
|
+
simulation_experiment_id: z214.string().optional(),
|
|
5098
|
+
subcircuit_id: z214.string().optional()
|
|
5049
5099
|
}).describe("An unknown error occurred during the simulation experiment.");
|
|
5050
5100
|
expectTypesMatch(true);
|
|
5051
5101
|
|
|
5052
5102
|
// src/simulation/simulation_parameter_sweep.ts
|
|
5053
|
-
import { z as
|
|
5054
|
-
var simulation_parameter_type =
|
|
5103
|
+
import { z as z215 } from "zod";
|
|
5104
|
+
var simulation_parameter_type = z215.enum([
|
|
5055
5105
|
"resistance",
|
|
5056
5106
|
"capacitance",
|
|
5057
5107
|
"inductance",
|
|
5058
5108
|
"voltage",
|
|
5059
5109
|
"current"
|
|
5060
5110
|
]);
|
|
5061
|
-
var simulation_parameter_sweep_base =
|
|
5062
|
-
type:
|
|
5111
|
+
var simulation_parameter_sweep_base = z215.object({
|
|
5112
|
+
type: z215.literal("simulation_parameter_sweep"),
|
|
5063
5113
|
simulation_parameter_sweep_id: getZodPrefixedIdWithDefault(
|
|
5064
5114
|
"simulation_parameter_sweep"
|
|
5065
5115
|
),
|
|
5066
|
-
simulation_experiment_id:
|
|
5067
|
-
name:
|
|
5068
|
-
parameter_values:
|
|
5116
|
+
simulation_experiment_id: z215.string(),
|
|
5117
|
+
name: z215.string().optional(),
|
|
5118
|
+
parameter_values: z215.array(z215.number()).min(1),
|
|
5069
5119
|
parameter_unit: simulation_parameter_unit
|
|
5070
5120
|
});
|
|
5071
|
-
var simulation_parameter_sweep =
|
|
5121
|
+
var simulation_parameter_sweep = z215.discriminatedUnion("parameter_type", [
|
|
5072
5122
|
simulation_parameter_sweep_base.extend({
|
|
5073
|
-
parameter_type:
|
|
5074
|
-
resistor_source_component_id:
|
|
5123
|
+
parameter_type: z215.literal("resistance"),
|
|
5124
|
+
resistor_source_component_id: z215.string()
|
|
5075
5125
|
}),
|
|
5076
5126
|
simulation_parameter_sweep_base.extend({
|
|
5077
|
-
parameter_type:
|
|
5078
|
-
capacitor_source_component_id:
|
|
5127
|
+
parameter_type: z215.literal("capacitance"),
|
|
5128
|
+
capacitor_source_component_id: z215.string()
|
|
5079
5129
|
}),
|
|
5080
5130
|
simulation_parameter_sweep_base.extend({
|
|
5081
|
-
parameter_type:
|
|
5082
|
-
inductor_source_component_id:
|
|
5131
|
+
parameter_type: z215.literal("inductance"),
|
|
5132
|
+
inductor_source_component_id: z215.string()
|
|
5083
5133
|
}),
|
|
5084
5134
|
simulation_parameter_sweep_base.extend({
|
|
5085
|
-
parameter_type:
|
|
5086
|
-
source_net_id:
|
|
5135
|
+
parameter_type: z215.literal("voltage"),
|
|
5136
|
+
source_net_id: z215.string()
|
|
5087
5137
|
}),
|
|
5088
5138
|
simulation_parameter_sweep_base.extend({
|
|
5089
|
-
parameter_type:
|
|
5090
|
-
current_source_component_id:
|
|
5139
|
+
parameter_type: z215.literal("current"),
|
|
5140
|
+
current_source_component_id: z215.string()
|
|
5091
5141
|
})
|
|
5092
5142
|
]).describe("Repeats a simulation experiment over component parameter values");
|
|
5093
5143
|
expectTypesMatch(
|
|
@@ -5095,52 +5145,52 @@ expectTypesMatch(
|
|
|
5095
5145
|
);
|
|
5096
5146
|
|
|
5097
5147
|
// src/simulation/simulation_dc_operating_point_voltage.ts
|
|
5098
|
-
import { z as
|
|
5099
|
-
var simulation_dc_operating_point_voltage =
|
|
5100
|
-
type:
|
|
5148
|
+
import { z as z216 } from "zod";
|
|
5149
|
+
var simulation_dc_operating_point_voltage = z216.object({
|
|
5150
|
+
type: z216.literal("simulation_dc_operating_point_voltage"),
|
|
5101
5151
|
simulation_dc_operating_point_voltage_id: getZodPrefixedIdWithDefault(
|
|
5102
5152
|
"simulation_dc_operating_point_voltage"
|
|
5103
5153
|
),
|
|
5104
|
-
simulation_experiment_id:
|
|
5154
|
+
simulation_experiment_id: z216.string(),
|
|
5105
5155
|
simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
|
|
5106
|
-
simulation_voltage_probe_id:
|
|
5107
|
-
voltage:
|
|
5108
|
-
name:
|
|
5109
|
-
color:
|
|
5156
|
+
simulation_voltage_probe_id: z216.string(),
|
|
5157
|
+
voltage: z216.number(),
|
|
5158
|
+
name: z216.string().optional(),
|
|
5159
|
+
color: z216.string().optional()
|
|
5110
5160
|
});
|
|
5111
5161
|
expectTypesMatch(true);
|
|
5112
5162
|
|
|
5113
5163
|
// src/simulation/simulation_dc_operating_point_current.ts
|
|
5114
|
-
import { z as
|
|
5115
|
-
var simulation_dc_operating_point_current =
|
|
5116
|
-
type:
|
|
5164
|
+
import { z as z217 } from "zod";
|
|
5165
|
+
var simulation_dc_operating_point_current = z217.object({
|
|
5166
|
+
type: z217.literal("simulation_dc_operating_point_current"),
|
|
5117
5167
|
simulation_dc_operating_point_current_id: getZodPrefixedIdWithDefault(
|
|
5118
5168
|
"simulation_dc_operating_point_current"
|
|
5119
5169
|
),
|
|
5120
|
-
simulation_experiment_id:
|
|
5170
|
+
simulation_experiment_id: z217.string(),
|
|
5121
5171
|
simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
|
|
5122
|
-
simulation_current_probe_id:
|
|
5123
|
-
current:
|
|
5124
|
-
name:
|
|
5125
|
-
color:
|
|
5172
|
+
simulation_current_probe_id: z217.string(),
|
|
5173
|
+
current: z217.number(),
|
|
5174
|
+
name: z217.string().optional(),
|
|
5175
|
+
color: z217.string().optional()
|
|
5126
5176
|
});
|
|
5127
5177
|
expectTypesMatch(true);
|
|
5128
5178
|
|
|
5129
5179
|
// src/simulation/simulation_dc_sweep_voltage_graph.ts
|
|
5130
|
-
import { z as
|
|
5131
|
-
var simulation_dc_sweep_voltage_graph =
|
|
5132
|
-
type:
|
|
5180
|
+
import { z as z218 } from "zod";
|
|
5181
|
+
var simulation_dc_sweep_voltage_graph = z218.object({
|
|
5182
|
+
type: z218.literal("simulation_dc_sweep_voltage_graph"),
|
|
5133
5183
|
simulation_dc_sweep_voltage_graph_id: getZodPrefixedIdWithDefault(
|
|
5134
5184
|
"simulation_dc_sweep_voltage_graph"
|
|
5135
5185
|
),
|
|
5136
|
-
simulation_experiment_id:
|
|
5186
|
+
simulation_experiment_id: z218.string(),
|
|
5137
5187
|
simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
|
|
5138
|
-
simulation_voltage_probe_id:
|
|
5139
|
-
sweep_values:
|
|
5188
|
+
simulation_voltage_probe_id: z218.string(),
|
|
5189
|
+
sweep_values: z218.array(z218.number()),
|
|
5140
5190
|
sweep_unit: simulation_dc_sweep_unit,
|
|
5141
|
-
voltage_levels:
|
|
5142
|
-
name:
|
|
5143
|
-
color:
|
|
5191
|
+
voltage_levels: z218.array(z218.number()),
|
|
5192
|
+
name: z218.string().optional(),
|
|
5193
|
+
color: z218.string().optional()
|
|
5144
5194
|
}).refine(
|
|
5145
5195
|
(graph) => graph.sweep_values.length === graph.voltage_levels.length,
|
|
5146
5196
|
{
|
|
@@ -5150,20 +5200,20 @@ var simulation_dc_sweep_voltage_graph = z217.object({
|
|
|
5150
5200
|
expectTypesMatch(true);
|
|
5151
5201
|
|
|
5152
5202
|
// src/simulation/simulation_dc_sweep_current_graph.ts
|
|
5153
|
-
import { z as
|
|
5154
|
-
var simulation_dc_sweep_current_graph =
|
|
5155
|
-
type:
|
|
5203
|
+
import { z as z219 } from "zod";
|
|
5204
|
+
var simulation_dc_sweep_current_graph = z219.object({
|
|
5205
|
+
type: z219.literal("simulation_dc_sweep_current_graph"),
|
|
5156
5206
|
simulation_dc_sweep_current_graph_id: getZodPrefixedIdWithDefault(
|
|
5157
5207
|
"simulation_dc_sweep_current_graph"
|
|
5158
5208
|
),
|
|
5159
|
-
simulation_experiment_id:
|
|
5209
|
+
simulation_experiment_id: z219.string(),
|
|
5160
5210
|
simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
|
|
5161
|
-
simulation_current_probe_id:
|
|
5162
|
-
sweep_values:
|
|
5211
|
+
simulation_current_probe_id: z219.string(),
|
|
5212
|
+
sweep_values: z219.array(z219.number()),
|
|
5163
5213
|
sweep_unit: simulation_dc_sweep_unit,
|
|
5164
|
-
current_levels:
|
|
5165
|
-
name:
|
|
5166
|
-
color:
|
|
5214
|
+
current_levels: z219.array(z219.number()),
|
|
5215
|
+
name: z219.string().optional(),
|
|
5216
|
+
color: z219.string().optional()
|
|
5167
5217
|
}).refine(
|
|
5168
5218
|
(graph) => graph.sweep_values.length === graph.current_levels.length,
|
|
5169
5219
|
{
|
|
@@ -5173,29 +5223,29 @@ var simulation_dc_sweep_current_graph = z218.object({
|
|
|
5173
5223
|
expectTypesMatch(true);
|
|
5174
5224
|
|
|
5175
5225
|
// src/simulation/simulation_ac_sweep_voltage_graph.ts
|
|
5176
|
-
import { z as
|
|
5226
|
+
import { z as z221 } from "zod";
|
|
5177
5227
|
|
|
5178
5228
|
// src/simulation/simulation_complex_sample.ts
|
|
5179
|
-
import { z as
|
|
5180
|
-
var simulation_complex_sample =
|
|
5181
|
-
re:
|
|
5182
|
-
im:
|
|
5229
|
+
import { z as z220 } from "zod";
|
|
5230
|
+
var simulation_complex_sample = z220.object({
|
|
5231
|
+
re: z220.number(),
|
|
5232
|
+
im: z220.number()
|
|
5183
5233
|
});
|
|
5184
5234
|
expectTypesMatch(true);
|
|
5185
5235
|
|
|
5186
5236
|
// src/simulation/simulation_ac_sweep_voltage_graph.ts
|
|
5187
|
-
var simulation_ac_sweep_voltage_graph =
|
|
5188
|
-
type:
|
|
5237
|
+
var simulation_ac_sweep_voltage_graph = z221.object({
|
|
5238
|
+
type: z221.literal("simulation_ac_sweep_voltage_graph"),
|
|
5189
5239
|
simulation_ac_sweep_voltage_graph_id: getZodPrefixedIdWithDefault(
|
|
5190
5240
|
"simulation_ac_sweep_voltage_graph"
|
|
5191
5241
|
),
|
|
5192
|
-
simulation_experiment_id:
|
|
5242
|
+
simulation_experiment_id: z221.string(),
|
|
5193
5243
|
simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
|
|
5194
|
-
simulation_voltage_probe_id:
|
|
5195
|
-
frequencies_hz:
|
|
5196
|
-
complex_voltages:
|
|
5197
|
-
name:
|
|
5198
|
-
color:
|
|
5244
|
+
simulation_voltage_probe_id: z221.string(),
|
|
5245
|
+
frequencies_hz: z221.array(z221.number()),
|
|
5246
|
+
complex_voltages: z221.array(simulation_complex_sample),
|
|
5247
|
+
name: z221.string().optional(),
|
|
5248
|
+
color: z221.string().optional()
|
|
5199
5249
|
}).refine(
|
|
5200
5250
|
(graph) => graph.frequencies_hz.length === graph.complex_voltages.length,
|
|
5201
5251
|
{
|
|
@@ -5205,19 +5255,19 @@ var simulation_ac_sweep_voltage_graph = z220.object({
|
|
|
5205
5255
|
expectTypesMatch(true);
|
|
5206
5256
|
|
|
5207
5257
|
// src/simulation/simulation_ac_sweep_current_graph.ts
|
|
5208
|
-
import { z as
|
|
5209
|
-
var simulation_ac_sweep_current_graph =
|
|
5210
|
-
type:
|
|
5258
|
+
import { z as z222 } from "zod";
|
|
5259
|
+
var simulation_ac_sweep_current_graph = z222.object({
|
|
5260
|
+
type: z222.literal("simulation_ac_sweep_current_graph"),
|
|
5211
5261
|
simulation_ac_sweep_current_graph_id: getZodPrefixedIdWithDefault(
|
|
5212
5262
|
"simulation_ac_sweep_current_graph"
|
|
5213
5263
|
),
|
|
5214
|
-
simulation_experiment_id:
|
|
5264
|
+
simulation_experiment_id: z222.string(),
|
|
5215
5265
|
simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
|
|
5216
|
-
simulation_current_probe_id:
|
|
5217
|
-
frequencies_hz:
|
|
5218
|
-
complex_currents:
|
|
5219
|
-
name:
|
|
5220
|
-
color:
|
|
5266
|
+
simulation_current_probe_id: z222.string(),
|
|
5267
|
+
frequencies_hz: z222.array(z222.number()),
|
|
5268
|
+
complex_currents: z222.array(simulation_complex_sample),
|
|
5269
|
+
name: z222.string().optional(),
|
|
5270
|
+
color: z222.string().optional()
|
|
5221
5271
|
}).refine(
|
|
5222
5272
|
(graph) => graph.frequencies_hz.length === graph.complex_currents.length,
|
|
5223
5273
|
{
|
|
@@ -5227,52 +5277,52 @@ var simulation_ac_sweep_current_graph = z221.object({
|
|
|
5227
5277
|
expectTypesMatch(true);
|
|
5228
5278
|
|
|
5229
5279
|
// src/simulation/simulation_op_amp.ts
|
|
5230
|
-
import { z as
|
|
5231
|
-
var simulation_op_amp =
|
|
5232
|
-
type:
|
|
5280
|
+
import { z as z223 } from "zod";
|
|
5281
|
+
var simulation_op_amp = z223.object({
|
|
5282
|
+
type: z223.literal("simulation_op_amp"),
|
|
5233
5283
|
simulation_op_amp_id: getZodPrefixedIdWithDefault("simulation_op_amp"),
|
|
5234
|
-
source_component_id:
|
|
5235
|
-
inverting_input_source_port_id:
|
|
5236
|
-
non_inverting_input_source_port_id:
|
|
5237
|
-
output_source_port_id:
|
|
5238
|
-
positive_supply_source_port_id:
|
|
5239
|
-
negative_supply_source_port_id:
|
|
5284
|
+
source_component_id: z223.string().optional(),
|
|
5285
|
+
inverting_input_source_port_id: z223.string(),
|
|
5286
|
+
non_inverting_input_source_port_id: z223.string(),
|
|
5287
|
+
output_source_port_id: z223.string(),
|
|
5288
|
+
positive_supply_source_port_id: z223.string(),
|
|
5289
|
+
negative_supply_source_port_id: z223.string()
|
|
5240
5290
|
}).describe("Defines a simple ideal operational amplifier for simulation");
|
|
5241
5291
|
expectTypesMatch(true);
|
|
5242
5292
|
|
|
5243
5293
|
// src/simulation/simulation_spice_subcircuit.ts
|
|
5244
|
-
import { z as
|
|
5245
|
-
var simulation_spice_subcircuit =
|
|
5246
|
-
type:
|
|
5294
|
+
import { z as z224 } from "zod";
|
|
5295
|
+
var simulation_spice_subcircuit = z224.object({
|
|
5296
|
+
type: z224.literal("simulation_spice_subcircuit"),
|
|
5247
5297
|
simulation_spice_subcircuit_id: getZodPrefixedIdWithDefault(
|
|
5248
5298
|
"simulation_spice_subcircuit"
|
|
5249
5299
|
),
|
|
5250
|
-
source_component_id:
|
|
5251
|
-
spice_pin_to_source_port_map:
|
|
5252
|
-
subcircuit_source:
|
|
5300
|
+
source_component_id: z224.string(),
|
|
5301
|
+
spice_pin_to_source_port_map: z224.record(z224.string(), z224.string()),
|
|
5302
|
+
subcircuit_source: z224.string()
|
|
5253
5303
|
}).describe("Defines a custom SPICE subcircuit model for simulation");
|
|
5254
5304
|
expectTypesMatch(
|
|
5255
5305
|
true
|
|
5256
5306
|
);
|
|
5257
5307
|
|
|
5258
5308
|
// src/simulation/simulation_oscilloscope_trace.ts
|
|
5259
|
-
import { z as
|
|
5309
|
+
import { z as z225 } from "zod";
|
|
5260
5310
|
var hasValue = (value) => value !== void 0;
|
|
5261
|
-
var simulation_oscilloscope_trace =
|
|
5262
|
-
type:
|
|
5311
|
+
var simulation_oscilloscope_trace = z225.object({
|
|
5312
|
+
type: z225.literal("simulation_oscilloscope_trace"),
|
|
5263
5313
|
simulation_oscilloscope_trace_id: getZodPrefixedIdWithDefault(
|
|
5264
5314
|
"simulation_oscilloscope_trace"
|
|
5265
5315
|
),
|
|
5266
|
-
simulation_transient_voltage_graph_id:
|
|
5267
|
-
simulation_transient_current_graph_id:
|
|
5268
|
-
simulation_voltage_probe_id:
|
|
5269
|
-
simulation_current_probe_id:
|
|
5270
|
-
display_name:
|
|
5271
|
-
color:
|
|
5272
|
-
display_center_value:
|
|
5273
|
-
display_center_offset_divs:
|
|
5274
|
-
volts_per_div:
|
|
5275
|
-
amps_per_div:
|
|
5316
|
+
simulation_transient_voltage_graph_id: z225.string().optional(),
|
|
5317
|
+
simulation_transient_current_graph_id: z225.string().optional(),
|
|
5318
|
+
simulation_voltage_probe_id: z225.string().optional(),
|
|
5319
|
+
simulation_current_probe_id: z225.string().optional(),
|
|
5320
|
+
display_name: z225.string().optional(),
|
|
5321
|
+
color: z225.string().optional(),
|
|
5322
|
+
display_center_value: z225.number().optional(),
|
|
5323
|
+
display_center_offset_divs: z225.number().optional(),
|
|
5324
|
+
volts_per_div: z225.number().positive().optional(),
|
|
5325
|
+
amps_per_div: z225.number().positive().optional()
|
|
5276
5326
|
}).describe(
|
|
5277
5327
|
"Defines how a simulation measurement is rendered as an oscilloscope-style trace."
|
|
5278
5328
|
).superRefine((data, ctx) => {
|
|
@@ -5286,19 +5336,19 @@ var simulation_oscilloscope_trace = z224.object({
|
|
|
5286
5336
|
].filter(hasValue).length;
|
|
5287
5337
|
if (voltageReferences + currentReferences !== 1) {
|
|
5288
5338
|
ctx.addIssue({
|
|
5289
|
-
code:
|
|
5339
|
+
code: z225.ZodIssueCode.custom,
|
|
5290
5340
|
message: "An oscilloscope trace must reference exactly one voltage graph, current graph, voltage probe, or current probe."
|
|
5291
5341
|
});
|
|
5292
5342
|
}
|
|
5293
5343
|
if (voltageReferences > 0 && data.amps_per_div !== void 0) {
|
|
5294
5344
|
ctx.addIssue({
|
|
5295
|
-
code:
|
|
5345
|
+
code: z225.ZodIssueCode.custom,
|
|
5296
5346
|
message: "Voltage oscilloscope traces must use volts_per_div, not amps_per_div."
|
|
5297
5347
|
});
|
|
5298
5348
|
}
|
|
5299
5349
|
if (currentReferences > 0 && data.volts_per_div !== void 0) {
|
|
5300
5350
|
ctx.addIssue({
|
|
5301
|
-
code:
|
|
5351
|
+
code: z225.ZodIssueCode.custom,
|
|
5302
5352
|
message: "Current oscilloscope traces must use amps_per_div, not volts_per_div."
|
|
5303
5353
|
});
|
|
5304
5354
|
}
|
|
@@ -5306,47 +5356,47 @@ var simulation_oscilloscope_trace = z224.object({
|
|
|
5306
5356
|
expectTypesMatch(true);
|
|
5307
5357
|
|
|
5308
5358
|
// src/simulation/simulation_ibis_model.ts
|
|
5309
|
-
import { z as
|
|
5310
|
-
var ibisAssetPath =
|
|
5311
|
-
var simulation_ibis_model =
|
|
5312
|
-
type:
|
|
5359
|
+
import { z as z226 } from "zod";
|
|
5360
|
+
var ibisAssetPath = z226.string().min(1).regex(/^(?!\s|[a-z][a-z\d+.-]*:|[/\\])[^\\\u0000-\u001f\u007f]+$/i);
|
|
5361
|
+
var simulation_ibis_model = z226.object({
|
|
5362
|
+
type: z226.literal("simulation_ibis_model"),
|
|
5313
5363
|
simulation_ibis_model_id: getZodPrefixedIdWithDefault(
|
|
5314
5364
|
"simulation_ibis_model"
|
|
5315
5365
|
),
|
|
5316
|
-
source_component_id:
|
|
5366
|
+
source_component_id: z226.string().min(1),
|
|
5317
5367
|
// Consumers must still apply their own fetch policy to prevent SSRF.
|
|
5318
5368
|
ibis_model_asset: asset.extend({
|
|
5319
5369
|
project_relative_path: ibisAssetPath,
|
|
5320
|
-
url:
|
|
5370
|
+
url: z226.string().url().regex(/^https?:\/\//i).or(ibisAssetPath)
|
|
5321
5371
|
}).describe(
|
|
5322
5372
|
"Reference to the .ibs file containing the vendor's IBIS models"
|
|
5323
5373
|
),
|
|
5324
|
-
ibis_component_name:
|
|
5325
|
-
ibis_pin_name_to_source_port_id:
|
|
5374
|
+
ibis_component_name: z226.string().min(1).describe("Name of the [Component] section in the IBIS file"),
|
|
5375
|
+
ibis_pin_name_to_source_port_id: z226.record(z226.string().min(1), z226.string().min(1)).refine(
|
|
5326
5376
|
(pins) => Object.keys(pins).length > 0,
|
|
5327
5377
|
"At least one physical IBIS pin is required"
|
|
5328
5378
|
).describe(
|
|
5329
5379
|
"Maps pin names from the IBIS [Pin] table, such as A1 or 12, to physical source_port_id values"
|
|
5330
5380
|
),
|
|
5331
|
-
ibis_pin_name_to_model_name:
|
|
5381
|
+
ibis_pin_name_to_model_name: z226.record(z226.string().min(1), z226.string().min(1)).optional().describe(
|
|
5332
5382
|
"Maps an IBIS pin name to the selected [Model] name when its [Model Selector] has multiple buffers"
|
|
5333
5383
|
),
|
|
5334
|
-
ibis_pin_name_to_reference_source_port_ids:
|
|
5335
|
-
|
|
5336
|
-
|
|
5337
|
-
pullup_reference_source_port_id:
|
|
5338
|
-
pulldown_reference_source_port_id:
|
|
5339
|
-
power_clamp_reference_source_port_id:
|
|
5340
|
-
ground_clamp_reference_source_port_id:
|
|
5341
|
-
external_reference_source_port_id:
|
|
5384
|
+
ibis_pin_name_to_reference_source_port_ids: z226.record(
|
|
5385
|
+
z226.string().min(1),
|
|
5386
|
+
z226.object({
|
|
5387
|
+
pullup_reference_source_port_id: z226.string().min(1).optional(),
|
|
5388
|
+
pulldown_reference_source_port_id: z226.string().min(1).optional(),
|
|
5389
|
+
power_clamp_reference_source_port_id: z226.string().min(1).optional(),
|
|
5390
|
+
ground_clamp_reference_source_port_id: z226.string().min(1).optional(),
|
|
5391
|
+
external_reference_source_port_id: z226.string().min(1).optional()
|
|
5342
5392
|
}).strict()
|
|
5343
5393
|
).optional().describe(
|
|
5344
5394
|
"Maps each IBIS signal pin name to the physical source ports used as its buffer supply/clamp references"
|
|
5345
5395
|
),
|
|
5346
|
-
model_value_corner:
|
|
5396
|
+
model_value_corner: z226.union([z226.literal("typical"), z226.literal("minimum"), z226.literal("maximum")]).describe(
|
|
5347
5397
|
"Selects the typ, min, or max column of numerical data in the IBIS model"
|
|
5348
5398
|
),
|
|
5349
|
-
include_package_parasitics:
|
|
5399
|
+
include_package_parasitics: z226.boolean().describe(
|
|
5350
5400
|
"Whether the runner includes the IBIS vendor's package resistance, inductance, and capacitance"
|
|
5351
5401
|
)
|
|
5352
5402
|
}).superRefine((model, context) => {
|
|
@@ -5360,7 +5410,7 @@ var simulation_ibis_model = z225.object({
|
|
|
5360
5410
|
for (const pin of Object.keys(model[field] ?? {})) {
|
|
5361
5411
|
if (!boundPins.has(pin)) {
|
|
5362
5412
|
context.addIssue({
|
|
5363
|
-
code:
|
|
5413
|
+
code: z226.ZodIssueCode.custom,
|
|
5364
5414
|
path: [field, pin],
|
|
5365
5415
|
message: `IBIS pin "${pin}" must be bound in ibis_pin_name_to_source_port_id`
|
|
5366
5416
|
});
|
|
@@ -5372,22 +5422,22 @@ var simulation_ibis_model = z225.object({
|
|
|
5372
5422
|
);
|
|
5373
5423
|
|
|
5374
5424
|
// src/simulation/simulation_ibis_pin_state.ts
|
|
5375
|
-
import { z as
|
|
5376
|
-
var simulation_ibis_pin_state =
|
|
5377
|
-
type:
|
|
5425
|
+
import { z as z227 } from "zod";
|
|
5426
|
+
var simulation_ibis_pin_state = z227.object({
|
|
5427
|
+
type: z227.literal("simulation_ibis_pin_state"),
|
|
5378
5428
|
simulation_ibis_pin_state_id: getZodPrefixedIdWithDefault(
|
|
5379
5429
|
"simulation_ibis_pin_state"
|
|
5380
5430
|
),
|
|
5381
|
-
simulation_experiment_id:
|
|
5382
|
-
source_port_id:
|
|
5383
|
-
is_output:
|
|
5431
|
+
simulation_experiment_id: z227.string().min(1),
|
|
5432
|
+
source_port_id: z227.string().min(1),
|
|
5433
|
+
is_output: z227.boolean().describe(
|
|
5384
5434
|
"True selects output mode; false selects input mode for this experiment"
|
|
5385
5435
|
),
|
|
5386
|
-
is_output_enabled:
|
|
5436
|
+
is_output_enabled: z227.boolean().optional()
|
|
5387
5437
|
}).superRefine((pin, context) => {
|
|
5388
5438
|
if (pin.is_output && pin.is_output_enabled === void 0 || !pin.is_output && pin.is_output_enabled !== void 0) {
|
|
5389
5439
|
context.addIssue({
|
|
5390
|
-
code:
|
|
5440
|
+
code: z227.ZodIssueCode.custom,
|
|
5391
5441
|
path: ["is_output_enabled"],
|
|
5392
5442
|
message: "Only output pins require an explicit is_output_enabled boolean"
|
|
5393
5443
|
});
|
|
@@ -5397,41 +5447,41 @@ var simulation_ibis_pin_state = z226.object({
|
|
|
5397
5447
|
);
|
|
5398
5448
|
|
|
5399
5449
|
// src/simulation/simulation_digital_stimulus.ts
|
|
5400
|
-
import { z as
|
|
5450
|
+
import { z as z228 } from "zod";
|
|
5401
5451
|
var MAX_PATTERN_BITS = 65536;
|
|
5402
|
-
var simulation_digital_stimulus =
|
|
5403
|
-
type:
|
|
5452
|
+
var simulation_digital_stimulus = z228.object({
|
|
5453
|
+
type: z228.literal("simulation_digital_stimulus"),
|
|
5404
5454
|
simulation_digital_stimulus_id: getZodPrefixedIdWithDefault(
|
|
5405
5455
|
"simulation_digital_stimulus"
|
|
5406
5456
|
),
|
|
5407
|
-
name:
|
|
5408
|
-
simulation_experiment_id:
|
|
5409
|
-
source_port_id:
|
|
5457
|
+
name: z228.string().min(1),
|
|
5458
|
+
simulation_experiment_id: z228.string().min(1),
|
|
5459
|
+
source_port_id: z228.string().min(1),
|
|
5410
5460
|
bit_duration_ms: ms.refine((milliseconds) => milliseconds > 0),
|
|
5411
5461
|
start_time_ms: ms.refine((milliseconds) => milliseconds >= 0),
|
|
5412
|
-
initial_state:
|
|
5413
|
-
inverted:
|
|
5414
|
-
transmission_pattern:
|
|
5415
|
-
transmission_type:
|
|
5416
|
-
bits:
|
|
5417
|
-
|
|
5462
|
+
initial_state: z228.union([z228.literal(0), z228.literal(1)]),
|
|
5463
|
+
inverted: z228.boolean(),
|
|
5464
|
+
transmission_pattern: z228.object({
|
|
5465
|
+
transmission_type: z228.literal("bits"),
|
|
5466
|
+
bits: z228.string().max(MAX_PATTERN_BITS).regex(/^[01]+$/).or(
|
|
5467
|
+
z228.array(z228.union([z228.literal(0), z228.literal(1)])).min(1).max(MAX_PATTERN_BITS)
|
|
5418
5468
|
),
|
|
5419
|
-
repeat:
|
|
5469
|
+
repeat: z228.boolean()
|
|
5420
5470
|
}).strict()
|
|
5421
5471
|
}).describe(
|
|
5422
5472
|
"Declares a digital transmission pattern and bit duration in milliseconds for a physical source port"
|
|
5423
5473
|
);
|
|
5424
5474
|
|
|
5425
5475
|
// src/simulation/simulation_eye_diagram.ts
|
|
5426
|
-
import { z as
|
|
5427
|
-
var simulation_eye_diagram =
|
|
5428
|
-
type:
|
|
5476
|
+
import { z as z229 } from "zod";
|
|
5477
|
+
var simulation_eye_diagram = z229.object({
|
|
5478
|
+
type: z229.literal("simulation_eye_diagram"),
|
|
5429
5479
|
simulation_eye_diagram_id: getZodPrefixedIdWithDefault(
|
|
5430
5480
|
"simulation_eye_diagram"
|
|
5431
5481
|
),
|
|
5432
|
-
name:
|
|
5433
|
-
simulation_experiment_id:
|
|
5434
|
-
simulation_voltage_probe_id:
|
|
5482
|
+
name: z229.string().min(1),
|
|
5483
|
+
simulation_experiment_id: z229.string().min(1),
|
|
5484
|
+
simulation_voltage_probe_id: z229.string().min(1),
|
|
5435
5485
|
unit_interval_ms: ms.refine((milliseconds) => milliseconds > 0),
|
|
5436
5486
|
time_origin_ms: ms,
|
|
5437
5487
|
start_time_ms: ms.refine((milliseconds) => milliseconds >= 0).optional(),
|
|
@@ -5439,7 +5489,7 @@ var simulation_eye_diagram = z228.object({
|
|
|
5439
5489
|
}).superRefine((eye, context) => {
|
|
5440
5490
|
if (eye.start_time_ms !== void 0 && eye.end_time_ms !== void 0 && eye.start_time_ms >= eye.end_time_ms) {
|
|
5441
5491
|
context.addIssue({
|
|
5442
|
-
code:
|
|
5492
|
+
code: z229.ZodIssueCode.custom,
|
|
5443
5493
|
path: ["end_time_ms"],
|
|
5444
5494
|
message: "Eye gate end must follow its start"
|
|
5445
5495
|
});
|
|
@@ -5449,51 +5499,51 @@ var simulation_eye_diagram = z228.object({
|
|
|
5449
5499
|
);
|
|
5450
5500
|
|
|
5451
5501
|
// src/simulation/simulation_return_current_contact.ts
|
|
5452
|
-
import { z as
|
|
5453
|
-
var contact_position =
|
|
5454
|
-
x:
|
|
5455
|
-
y:
|
|
5502
|
+
import { z as z230 } from "zod";
|
|
5503
|
+
var contact_position = z230.object({
|
|
5504
|
+
x: z230.number().finite(),
|
|
5505
|
+
y: z230.number().finite(),
|
|
5456
5506
|
layer: layer_ref
|
|
5457
5507
|
});
|
|
5458
|
-
var simulation_return_current_contact =
|
|
5508
|
+
var simulation_return_current_contact = z230.discriminatedUnion("contact_type", [
|
|
5459
5509
|
contact_position.extend({
|
|
5460
|
-
contact_type:
|
|
5461
|
-
pcb_port_id:
|
|
5510
|
+
contact_type: z230.literal("pcb_port"),
|
|
5511
|
+
pcb_port_id: z230.string().min(1)
|
|
5462
5512
|
}),
|
|
5463
5513
|
contact_position.extend({
|
|
5464
|
-
contact_type:
|
|
5465
|
-
pcb_via_id:
|
|
5514
|
+
contact_type: z230.literal("pcb_via"),
|
|
5515
|
+
pcb_via_id: z230.string().min(1)
|
|
5466
5516
|
}),
|
|
5467
5517
|
contact_position.extend({
|
|
5468
|
-
contact_type:
|
|
5469
|
-
pcb_copper_pour_id:
|
|
5518
|
+
contact_type: z230.literal("pcb_copper_pour"),
|
|
5519
|
+
pcb_copper_pour_id: z230.string().min(1)
|
|
5470
5520
|
})
|
|
5471
5521
|
]).describe("Identifies the reference conductor at a return-current contact");
|
|
5472
5522
|
expectTypesMatch(true);
|
|
5473
5523
|
|
|
5474
5524
|
// src/simulation/simulation_terminal_port.ts
|
|
5475
|
-
import { z as
|
|
5476
|
-
var simulation_terminal_port =
|
|
5477
|
-
signal_pcb_port_id:
|
|
5478
|
-
reference_pcb_port_id:
|
|
5525
|
+
import { z as z231 } from "zod";
|
|
5526
|
+
var simulation_terminal_port = z231.object({
|
|
5527
|
+
signal_pcb_port_id: z231.string().min(1),
|
|
5528
|
+
reference_pcb_port_id: z231.string().min(1).optional(),
|
|
5479
5529
|
reference_layer: layer_ref,
|
|
5480
|
-
resistance:
|
|
5530
|
+
resistance: z231.number().finite().positive()
|
|
5481
5531
|
}).describe(
|
|
5482
5532
|
"A two-terminal return-current excitation port with resistance in ohms"
|
|
5483
5533
|
);
|
|
5484
5534
|
expectTypesMatch(true);
|
|
5485
5535
|
|
|
5486
5536
|
// src/simulation/simulation_return_current_excitation.ts
|
|
5487
|
-
import { z as
|
|
5488
|
-
var simulation_return_current_excitation =
|
|
5489
|
-
type:
|
|
5537
|
+
import { z as z232 } from "zod";
|
|
5538
|
+
var simulation_return_current_excitation = z232.object({
|
|
5539
|
+
type: z232.literal("simulation_return_current_excitation"),
|
|
5490
5540
|
simulation_return_current_excitation_id: getZodPrefixedIdWithDefault(
|
|
5491
5541
|
"simulation_return_current_excitation"
|
|
5492
5542
|
),
|
|
5493
|
-
simulation_experiment_id:
|
|
5494
|
-
pcb_trace_id:
|
|
5495
|
-
ground_source_net_id:
|
|
5496
|
-
current:
|
|
5543
|
+
simulation_experiment_id: z232.string().min(1),
|
|
5544
|
+
pcb_trace_id: z232.string().min(1),
|
|
5545
|
+
ground_source_net_id: z232.string().min(1),
|
|
5546
|
+
current: z232.number().finite(),
|
|
5497
5547
|
return_source: simulation_return_current_contact,
|
|
5498
5548
|
return_sink: simulation_return_current_contact,
|
|
5499
5549
|
source_port: simulation_terminal_port.optional(),
|
|
@@ -5504,34 +5554,34 @@ var simulation_return_current_excitation = z231.object({
|
|
|
5504
5554
|
expectTypesMatch(true);
|
|
5505
5555
|
|
|
5506
5556
|
// src/simulation/simulation_pcb_return_current_result.ts
|
|
5507
|
-
import { z as
|
|
5508
|
-
var simulation_pcb_return_current_result =
|
|
5509
|
-
type:
|
|
5557
|
+
import { z as z233 } from "zod";
|
|
5558
|
+
var simulation_pcb_return_current_result = z233.object({
|
|
5559
|
+
type: z233.literal("simulation_pcb_return_current_result"),
|
|
5510
5560
|
simulation_pcb_return_current_result_id: getZodPrefixedIdWithDefault(
|
|
5511
5561
|
"simulation_pcb_return_current_result"
|
|
5512
5562
|
),
|
|
5513
|
-
simulation_experiment_id:
|
|
5514
|
-
pcb_board_id:
|
|
5515
|
-
simulation_return_current_excitation_ids:
|
|
5563
|
+
simulation_experiment_id: z233.string().min(1),
|
|
5564
|
+
pcb_board_id: z233.string().min(1),
|
|
5565
|
+
simulation_return_current_excitation_ids: z233.array(z233.string().min(1)).min(1).refine(
|
|
5516
5566
|
(ids) => new Set(ids).size === ids.length,
|
|
5517
5567
|
"Excitation IDs must be unique"
|
|
5518
5568
|
),
|
|
5519
|
-
frequency_hz:
|
|
5569
|
+
frequency_hz: z233.number().finite().positive().optional()
|
|
5520
5570
|
}).describe(
|
|
5521
5571
|
"A PCB return-current result at one frequency, or a frequency-independent result when frequency_hz is absent"
|
|
5522
5572
|
);
|
|
5523
5573
|
expectTypesMatch(true);
|
|
5524
5574
|
|
|
5525
5575
|
// src/simulation/simulation_return_current_asset.ts
|
|
5526
|
-
import { z as
|
|
5576
|
+
import { z as z234 } from "zod";
|
|
5527
5577
|
function createSimulationReturnCurrentAssetSchema(mimetypes) {
|
|
5528
5578
|
return asset.extend({
|
|
5529
|
-
project_relative_path:
|
|
5530
|
-
url:
|
|
5579
|
+
project_relative_path: z234.string().min(1),
|
|
5580
|
+
url: z234.string().url()
|
|
5531
5581
|
}).superRefine((value, context) => {
|
|
5532
5582
|
if (!mimetypes.includes(value.mimetype)) {
|
|
5533
5583
|
context.addIssue({
|
|
5534
|
-
code:
|
|
5584
|
+
code: z234.ZodIssueCode.custom,
|
|
5535
5585
|
path: ["mimetype"],
|
|
5536
5586
|
message: `Expected one of: ${mimetypes.join(", ")}`
|
|
5537
5587
|
});
|
|
@@ -5540,7 +5590,7 @@ function createSimulationReturnCurrentAssetSchema(mimetypes) {
|
|
|
5540
5590
|
const mediaType = /^data:([^;,]*)(?:;[^,]*)?,/i.exec(value.url)?.[1];
|
|
5541
5591
|
if (mediaType?.toLowerCase() !== value.mimetype) {
|
|
5542
5592
|
context.addIssue({
|
|
5543
|
-
code:
|
|
5593
|
+
code: z234.ZodIssueCode.custom,
|
|
5544
5594
|
path: ["url"],
|
|
5545
5595
|
message: "Data URL media type must match asset.mimetype"
|
|
5546
5596
|
});
|
|
@@ -5555,29 +5605,29 @@ var simulation_return_current_field_asset = createSimulationReturnCurrentAssetSc
|
|
|
5555
5605
|
var simulation_return_current_image_asset = createSimulationReturnCurrentAssetSchema(["image/png", "image/webp"]);
|
|
5556
5606
|
|
|
5557
5607
|
// src/simulation/simulation_pcb_return_current_field.ts
|
|
5558
|
-
import { z as
|
|
5559
|
-
var simulation_pcb_return_current_field =
|
|
5560
|
-
type:
|
|
5608
|
+
import { z as z235 } from "zod";
|
|
5609
|
+
var simulation_pcb_return_current_field = z235.object({
|
|
5610
|
+
type: z235.literal("simulation_pcb_return_current_field"),
|
|
5561
5611
|
simulation_pcb_return_current_field_id: getZodPrefixedIdWithDefault(
|
|
5562
5612
|
"simulation_pcb_return_current_field"
|
|
5563
5613
|
),
|
|
5564
|
-
simulation_pcb_return_current_result_id:
|
|
5614
|
+
simulation_pcb_return_current_result_id: z235.string().min(1),
|
|
5565
5615
|
layer: layer_ref,
|
|
5566
|
-
source_net_id:
|
|
5567
|
-
field_type:
|
|
5568
|
-
min_x:
|
|
5569
|
-
min_y:
|
|
5570
|
-
columns:
|
|
5571
|
-
rows:
|
|
5572
|
-
cell_width:
|
|
5573
|
-
cell_height:
|
|
5574
|
-
copper_thickness:
|
|
5575
|
-
data_format:
|
|
5616
|
+
source_net_id: z235.string().min(1),
|
|
5617
|
+
field_type: z235.enum(["real", "complex_phasor"]),
|
|
5618
|
+
min_x: z235.number().finite(),
|
|
5619
|
+
min_y: z235.number().finite(),
|
|
5620
|
+
columns: z235.number().int().positive().safe(),
|
|
5621
|
+
rows: z235.number().int().positive().safe(),
|
|
5622
|
+
cell_width: z235.number().finite().positive(),
|
|
5623
|
+
cell_height: z235.number().finite().positive(),
|
|
5624
|
+
copper_thickness: z235.number().finite().positive(),
|
|
5625
|
+
data_format: z235.literal("simulation_return_current_grid_json_v1"),
|
|
5576
5626
|
field_asset: simulation_return_current_field_asset
|
|
5577
5627
|
}).superRefine((field, context) => {
|
|
5578
5628
|
if (!Number.isSafeInteger(field.columns * field.rows)) {
|
|
5579
5629
|
context.addIssue({
|
|
5580
|
-
code:
|
|
5630
|
+
code: z235.ZodIssueCode.custom,
|
|
5581
5631
|
path: ["columns"],
|
|
5582
5632
|
message: "The grid cell count must be a safe integer"
|
|
5583
5633
|
});
|
|
@@ -5588,16 +5638,16 @@ var simulation_pcb_return_current_field = z234.object({
|
|
|
5588
5638
|
expectTypesMatch(true);
|
|
5589
5639
|
|
|
5590
5640
|
// src/simulation/simulation_return_current_grid_json.ts
|
|
5591
|
-
import { z as
|
|
5592
|
-
var channel =
|
|
5593
|
-
var simulation_return_current_grid_json =
|
|
5594
|
-
|
|
5595
|
-
field_type:
|
|
5641
|
+
import { z as z236 } from "zod";
|
|
5642
|
+
var channel = z236.array(z236.number().finite().nullable()).min(1);
|
|
5643
|
+
var simulation_return_current_grid_json = z236.discriminatedUnion("field_type", [
|
|
5644
|
+
z236.object({
|
|
5645
|
+
field_type: z236.literal("real"),
|
|
5596
5646
|
sheet_current_x: channel,
|
|
5597
5647
|
sheet_current_y: channel
|
|
5598
5648
|
}),
|
|
5599
|
-
|
|
5600
|
-
field_type:
|
|
5649
|
+
z236.object({
|
|
5650
|
+
field_type: z236.literal("complex_phasor"),
|
|
5601
5651
|
sheet_current_x_real: channel,
|
|
5602
5652
|
sheet_current_x_imag: channel,
|
|
5603
5653
|
sheet_current_y_real: channel,
|
|
@@ -5613,7 +5663,7 @@ var simulation_return_current_grid_json = z235.discriminatedUnion("field_type",
|
|
|
5613
5663
|
const first = channels[0];
|
|
5614
5664
|
if (channels.some((values) => values.length !== first.length)) {
|
|
5615
5665
|
context.addIssue({
|
|
5616
|
-
code:
|
|
5666
|
+
code: z236.ZodIssueCode.custom,
|
|
5617
5667
|
message: "Current channels must have equal lengths"
|
|
5618
5668
|
});
|
|
5619
5669
|
return;
|
|
@@ -5622,7 +5672,7 @@ var simulation_return_current_grid_json = z235.discriminatedUnion("field_type",
|
|
|
5622
5672
|
const masked = first[index] === null;
|
|
5623
5673
|
if (channels.some((values) => values[index] === null !== masked)) {
|
|
5624
5674
|
context.addIssue({
|
|
5625
|
-
code:
|
|
5675
|
+
code: z236.ZodIssueCode.custom,
|
|
5626
5676
|
message: `Cell ${index} must be null in every channel or finite in every channel`
|
|
5627
5677
|
});
|
|
5628
5678
|
return;
|
|
@@ -5639,7 +5689,7 @@ function getSimulationReturnCurrentGridJsonSchema(field) {
|
|
|
5639
5689
|
return simulation_return_current_grid_json.superRefine((grid, context) => {
|
|
5640
5690
|
if (grid.field_type !== field.field_type) {
|
|
5641
5691
|
context.addIssue({
|
|
5642
|
-
code:
|
|
5692
|
+
code: z236.ZodIssueCode.custom,
|
|
5643
5693
|
path: ["field_type"],
|
|
5644
5694
|
message: "Decoded field_type must match the parent field"
|
|
5645
5695
|
});
|
|
@@ -5647,7 +5697,7 @@ function getSimulationReturnCurrentGridJsonSchema(field) {
|
|
|
5647
5697
|
const first = grid.field_type === "real" ? grid.sheet_current_x : grid.sheet_current_x_real;
|
|
5648
5698
|
if (first.length !== count) {
|
|
5649
5699
|
context.addIssue({
|
|
5650
|
-
code:
|
|
5700
|
+
code: z236.ZodIssueCode.custom,
|
|
5651
5701
|
message: `Each current channel must have ${count} entries (columns * rows)`
|
|
5652
5702
|
});
|
|
5653
5703
|
}
|
|
@@ -5655,25 +5705,25 @@ function getSimulationReturnCurrentGridJsonSchema(field) {
|
|
|
5655
5705
|
}
|
|
5656
5706
|
|
|
5657
5707
|
// src/simulation/simulation_pcb_return_current_heatmap.ts
|
|
5658
|
-
import { z as
|
|
5659
|
-
var simulation_pcb_return_current_heatmap =
|
|
5660
|
-
type:
|
|
5708
|
+
import { z as z237 } from "zod";
|
|
5709
|
+
var simulation_pcb_return_current_heatmap = z237.object({
|
|
5710
|
+
type: z237.literal("simulation_pcb_return_current_heatmap"),
|
|
5661
5711
|
simulation_pcb_return_current_heatmap_id: getZodPrefixedIdWithDefault(
|
|
5662
5712
|
"simulation_pcb_return_current_heatmap"
|
|
5663
5713
|
),
|
|
5664
|
-
simulation_pcb_return_current_result_id:
|
|
5714
|
+
simulation_pcb_return_current_result_id: z237.string().min(1),
|
|
5665
5715
|
layer: layer_ref,
|
|
5666
|
-
source_net_id:
|
|
5667
|
-
min_x:
|
|
5668
|
-
min_y:
|
|
5669
|
-
max_x:
|
|
5670
|
-
max_y:
|
|
5716
|
+
source_net_id: z237.string().min(1),
|
|
5717
|
+
min_x: z237.number().finite(),
|
|
5718
|
+
min_y: z237.number().finite(),
|
|
5719
|
+
max_x: z237.number().finite(),
|
|
5720
|
+
max_y: z237.number().finite(),
|
|
5671
5721
|
image_asset: simulation_return_current_image_asset
|
|
5672
5722
|
}).superRefine((heatmap, context) => {
|
|
5673
5723
|
for (const axis of ["x", "y"]) {
|
|
5674
5724
|
if (heatmap[`max_${axis}`] <= heatmap[`min_${axis}`]) {
|
|
5675
5725
|
context.addIssue({
|
|
5676
|
-
code:
|
|
5726
|
+
code: z237.ZodIssueCode.custom,
|
|
5677
5727
|
path: [`max_${axis}`],
|
|
5678
5728
|
message: "Heatmap bounds must have positive width and height"
|
|
5679
5729
|
});
|
|
@@ -5685,14 +5735,14 @@ var simulation_pcb_return_current_heatmap = z236.object({
|
|
|
5685
5735
|
expectTypesMatch(true);
|
|
5686
5736
|
|
|
5687
5737
|
// src/simulation/simulation_pcb_return_current_marker.ts
|
|
5688
|
-
import { z as
|
|
5689
|
-
var marker_base =
|
|
5690
|
-
type:
|
|
5738
|
+
import { z as z238 } from "zod";
|
|
5739
|
+
var marker_base = z238.object({
|
|
5740
|
+
type: z238.literal("simulation_pcb_return_current_marker"),
|
|
5691
5741
|
simulation_pcb_return_current_marker_id: getZodPrefixedIdWithDefault(
|
|
5692
5742
|
"simulation_pcb_return_current_marker"
|
|
5693
5743
|
),
|
|
5694
|
-
simulation_pcb_return_current_result_id:
|
|
5695
|
-
role:
|
|
5744
|
+
simulation_pcb_return_current_result_id: z238.string().min(1),
|
|
5745
|
+
role: z238.enum([
|
|
5696
5746
|
"signal_source",
|
|
5697
5747
|
"signal_load",
|
|
5698
5748
|
"return_source",
|
|
@@ -5700,33 +5750,33 @@ var marker_base = z237.object({
|
|
|
5700
5750
|
"signal_transition",
|
|
5701
5751
|
"return_transition"
|
|
5702
5752
|
]),
|
|
5703
|
-
label:
|
|
5704
|
-
label_x:
|
|
5705
|
-
label_y:
|
|
5753
|
+
label: z238.string().optional(),
|
|
5754
|
+
label_x: z238.number().finite().optional(),
|
|
5755
|
+
label_y: z238.number().finite().optional()
|
|
5706
5756
|
});
|
|
5707
|
-
var simulation_pcb_return_current_marker =
|
|
5757
|
+
var simulation_pcb_return_current_marker = z238.discriminatedUnion("target_type", [
|
|
5708
5758
|
marker_base.extend({
|
|
5709
|
-
target_type:
|
|
5710
|
-
pcb_port_id:
|
|
5759
|
+
target_type: z238.literal("pcb_port"),
|
|
5760
|
+
pcb_port_id: z238.string().min(1),
|
|
5711
5761
|
layer: layer_ref
|
|
5712
5762
|
}),
|
|
5713
5763
|
marker_base.extend({
|
|
5714
|
-
target_type:
|
|
5715
|
-
pcb_via_id:
|
|
5764
|
+
target_type: z238.literal("pcb_via"),
|
|
5765
|
+
pcb_via_id: z238.string().min(1),
|
|
5716
5766
|
from_layer: layer_ref,
|
|
5717
5767
|
to_layer: layer_ref
|
|
5718
5768
|
})
|
|
5719
5769
|
]).superRefine((marker, context) => {
|
|
5720
5770
|
if (marker.label_x === void 0 !== (marker.label_y === void 0)) {
|
|
5721
5771
|
context.addIssue({
|
|
5722
|
-
code:
|
|
5772
|
+
code: z238.ZodIssueCode.custom,
|
|
5723
5773
|
path: ["label_x"],
|
|
5724
5774
|
message: "label_x and label_y must be provided together"
|
|
5725
5775
|
});
|
|
5726
5776
|
}
|
|
5727
5777
|
if (marker.target_type === "pcb_via" && marker.from_layer === marker.to_layer) {
|
|
5728
5778
|
context.addIssue({
|
|
5729
|
-
code:
|
|
5779
|
+
code: z238.ZodIssueCode.custom,
|
|
5730
5780
|
path: ["to_layer"],
|
|
5731
5781
|
message: "A via transition must connect distinct layers"
|
|
5732
5782
|
});
|
|
@@ -5737,8 +5787,143 @@ var simulation_pcb_return_current_marker = z237.discriminatedUnion("target_type"
|
|
|
5737
5787
|
expectTypesMatch(true);
|
|
5738
5788
|
|
|
5739
5789
|
// src/any_circuit_element.ts
|
|
5740
|
-
import { z as
|
|
5741
|
-
|
|
5790
|
+
import { z as z243 } from "zod";
|
|
5791
|
+
|
|
5792
|
+
// src/drawing/drawing_page.ts
|
|
5793
|
+
import { z as z240 } from "zod";
|
|
5794
|
+
|
|
5795
|
+
// src/drawing/drawing_page_size.ts
|
|
5796
|
+
import { z as z239 } from "zod";
|
|
5797
|
+
var drawingPageSizes = {
|
|
5798
|
+
iso_a0: [1189, 841],
|
|
5799
|
+
iso_a1: [841, 594],
|
|
5800
|
+
iso_a2: [594, 420],
|
|
5801
|
+
iso_a3: [420, 297],
|
|
5802
|
+
iso_a4: [297, 210],
|
|
5803
|
+
ansi_a: [279.4, 215.9],
|
|
5804
|
+
ansi_b: [431.8, 279.4],
|
|
5805
|
+
ansi_c: [558.8, 431.8],
|
|
5806
|
+
ansi_d: [863.6, 558.8],
|
|
5807
|
+
ansi_e: [1117.6, 863.6]
|
|
5808
|
+
};
|
|
5809
|
+
var drawing_page_size = z239.enum([
|
|
5810
|
+
"iso_a0",
|
|
5811
|
+
"iso_a1",
|
|
5812
|
+
"iso_a2",
|
|
5813
|
+
"iso_a3",
|
|
5814
|
+
"iso_a4",
|
|
5815
|
+
"ansi_a",
|
|
5816
|
+
"ansi_b",
|
|
5817
|
+
"ansi_c",
|
|
5818
|
+
"ansi_d",
|
|
5819
|
+
"ansi_e"
|
|
5820
|
+
]);
|
|
5821
|
+
function getDrawingPageDimensions(size2, orientation = "landscape") {
|
|
5822
|
+
const [width, height] = drawingPageSizes[size2];
|
|
5823
|
+
return orientation === "portrait" ? { width: height, height: width } : { width, height };
|
|
5824
|
+
}
|
|
5825
|
+
|
|
5826
|
+
// src/drawing/drawing_page.ts
|
|
5827
|
+
var drawing_page = z240.object({
|
|
5828
|
+
type: z240.literal("drawing_page"),
|
|
5829
|
+
drawing_page_id: z240.string().min(1),
|
|
5830
|
+
name: z240.string().optional(),
|
|
5831
|
+
display_name: z240.string().optional(),
|
|
5832
|
+
page_size: drawing_page_size.optional(),
|
|
5833
|
+
orientation: z240.enum(["landscape", "portrait"]).optional(),
|
|
5834
|
+
width: z240.number().finite().positive(),
|
|
5835
|
+
height: z240.number().finite().positive()
|
|
5836
|
+
}).superRefine((page, ctx) => {
|
|
5837
|
+
if (!page.page_size) {
|
|
5838
|
+
if (page.orientation)
|
|
5839
|
+
ctx.addIssue({
|
|
5840
|
+
code: "custom",
|
|
5841
|
+
path: ["orientation"],
|
|
5842
|
+
message: "Orientation requires page_size; custom pages use explicit dimensions"
|
|
5843
|
+
});
|
|
5844
|
+
return;
|
|
5845
|
+
}
|
|
5846
|
+
const expected = getDrawingPageDimensions(page.page_size, page.orientation);
|
|
5847
|
+
if (Math.abs(page.width - expected.width) > 1e-6 || Math.abs(page.height - expected.height) > 1e-6)
|
|
5848
|
+
ctx.addIssue({
|
|
5849
|
+
code: "custom",
|
|
5850
|
+
path: ["page_size"],
|
|
5851
|
+
message: "Dimensions must match the named sheet size and orientation"
|
|
5852
|
+
});
|
|
5853
|
+
}).describe(
|
|
5854
|
+
"A paper-space drawing page containing configured part views. Dimensions are mm."
|
|
5855
|
+
);
|
|
5856
|
+
expectTypesMatch(true);
|
|
5857
|
+
|
|
5858
|
+
// src/drawing/drawing_part_view.ts
|
|
5859
|
+
import { z as z241 } from "zod";
|
|
5860
|
+
var drawing_part_view_direction = z241.enum([
|
|
5861
|
+
"x_positive",
|
|
5862
|
+
"x_negative",
|
|
5863
|
+
"y_positive",
|
|
5864
|
+
"y_negative",
|
|
5865
|
+
"z_positive",
|
|
5866
|
+
"z_negative",
|
|
5867
|
+
"isometric"
|
|
5868
|
+
]);
|
|
5869
|
+
var drawing_section_plane = z241.object({
|
|
5870
|
+
axis: z241.enum(["x", "y", "z"]),
|
|
5871
|
+
offset: z241.number().finite(),
|
|
5872
|
+
keep_side: z241.enum(["less", "greater"]),
|
|
5873
|
+
hatch_spacing: z241.number().finite().positive().optional()
|
|
5874
|
+
});
|
|
5875
|
+
var drawing_part_view = z241.object({
|
|
5876
|
+
type: z241.literal("drawing_part_view"),
|
|
5877
|
+
drawing_part_view_id: z241.string().min(1),
|
|
5878
|
+
drawing_page_id: z241.string().min(1),
|
|
5879
|
+
source_group_id: z241.string().min(1).optional(),
|
|
5880
|
+
source_component_ids: z241.array(z241.string().min(1)).optional(),
|
|
5881
|
+
name: z241.string().optional(),
|
|
5882
|
+
display_name: z241.string().optional(),
|
|
5883
|
+
direction: drawing_part_view_direction,
|
|
5884
|
+
center: z241.object({ x: z241.number().finite(), y: z241.number().finite() }),
|
|
5885
|
+
width: z241.number().finite().positive(),
|
|
5886
|
+
height: z241.number().finite().positive(),
|
|
5887
|
+
scale: z241.number().finite().positive().optional(),
|
|
5888
|
+
show_hidden_edges: z241.boolean().optional(),
|
|
5889
|
+
section: drawing_section_plane.optional()
|
|
5890
|
+
}).describe(
|
|
5891
|
+
"A configured orthographic view of selected assembly geometry. Paper coordinates are mm, origin at sheet center, +X right/+Y up. Directions and section planes use CAD world coordinates in mm with +Z up."
|
|
5892
|
+
);
|
|
5893
|
+
expectTypesMatch(
|
|
5894
|
+
true
|
|
5895
|
+
);
|
|
5896
|
+
expectTypesMatch(true);
|
|
5897
|
+
|
|
5898
|
+
// src/drawing/drawing_page_title_block.ts
|
|
5899
|
+
import { z as z242 } from "zod";
|
|
5900
|
+
var drawing_page_title_block = z242.object({
|
|
5901
|
+
type: z242.literal("drawing_page_title_block"),
|
|
5902
|
+
drawing_page_title_block_id: z242.string().min(1),
|
|
5903
|
+
drawing_page_id: z242.string().min(1),
|
|
5904
|
+
title: z242.string().min(1),
|
|
5905
|
+
legal_owner: z242.string().optional(),
|
|
5906
|
+
identification_number: z242.string().optional(),
|
|
5907
|
+
revision_index: z242.string().optional(),
|
|
5908
|
+
date_of_issue: z242.string().optional(),
|
|
5909
|
+
creator: z242.string().optional(),
|
|
5910
|
+
approval_person: z242.string().optional(),
|
|
5911
|
+
sheet_number: z242.number().int().positive().optional(),
|
|
5912
|
+
number_of_sheets: z242.number().int().positive().optional()
|
|
5913
|
+
}).refine(
|
|
5914
|
+
(block) => block.sheet_number == null || block.number_of_sheets == null || block.sheet_number <= block.number_of_sheets,
|
|
5915
|
+
{
|
|
5916
|
+
message: "sheet_number must not exceed number_of_sheets",
|
|
5917
|
+
path: ["sheet_number"]
|
|
5918
|
+
}
|
|
5919
|
+
);
|
|
5920
|
+
expectTypesMatch(true);
|
|
5921
|
+
|
|
5922
|
+
// src/any_circuit_element.ts
|
|
5923
|
+
var any_circuit_element = z243.union([
|
|
5924
|
+
drawing_page,
|
|
5925
|
+
drawing_page_title_block,
|
|
5926
|
+
drawing_part_view,
|
|
5742
5927
|
source_runtime_error,
|
|
5743
5928
|
source_datasheet,
|
|
5744
5929
|
source_trace,
|
|
@@ -5816,6 +6001,7 @@ var any_circuit_element = z238.union([
|
|
|
5816
6001
|
pcb_solder_paste,
|
|
5817
6002
|
pcb_soldermask_opening,
|
|
5818
6003
|
pcb_board,
|
|
6004
|
+
pcb_stackup,
|
|
5819
6005
|
pcb_bend,
|
|
5820
6006
|
pcb_stiffener,
|
|
5821
6007
|
pcb_panel,
|
|
@@ -5954,10 +6140,18 @@ export {
|
|
|
5954
6140
|
circuit_json_footprint_load_error,
|
|
5955
6141
|
current,
|
|
5956
6142
|
distance,
|
|
6143
|
+
drawingPageSizes,
|
|
6144
|
+
drawing_page,
|
|
6145
|
+
drawing_page_size,
|
|
6146
|
+
drawing_page_title_block,
|
|
6147
|
+
drawing_part_view,
|
|
6148
|
+
drawing_part_view_direction,
|
|
6149
|
+
drawing_section_plane,
|
|
5957
6150
|
duration_ms,
|
|
5958
6151
|
experiment_type,
|
|
5959
6152
|
external_footprint_load_error,
|
|
5960
6153
|
frequency,
|
|
6154
|
+
getDrawingPageDimensions,
|
|
5961
6155
|
getRotationBetweenPcbPin1Locations,
|
|
5962
6156
|
getSimulationReturnCurrentGridJsonSchema,
|
|
5963
6157
|
getZodPrefixedIdWithDefault,
|
|
@@ -6076,6 +6270,11 @@ export {
|
|
|
6076
6270
|
pcb_smtpad_pill,
|
|
6077
6271
|
pcb_solder_paste,
|
|
6078
6272
|
pcb_soldermask_opening,
|
|
6273
|
+
pcb_stackup,
|
|
6274
|
+
pcb_stackup_copper_layer,
|
|
6275
|
+
pcb_stackup_dielectric_layer,
|
|
6276
|
+
pcb_stackup_layer,
|
|
6277
|
+
pcb_stackup_soldermask_layer,
|
|
6079
6278
|
pcb_stiffener,
|
|
6080
6279
|
pcb_stiffener_polygon,
|
|
6081
6280
|
pcb_stiffener_rect,
|